@squonk/account-server-client 0.1.27-rc.1 → 0.1.29-rc.1
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/{chunk-GWBPVOL2.js → chunk-6EEIAH4R.js} +23 -2
- package/chunk-6EEIAH4R.js.map +1 -0
- package/chunk-NGBTCJWS.cjs +46 -0
- package/chunk-NGBTCJWS.cjs.map +1 -0
- package/{account-server-api.schemas-e6c5f956.d.ts → custom-instance-13412a15.d.ts} +19 -1
- package/index.cjs +5 -21
- package/index.cjs.map +1 -1
- package/index.d.ts +2 -20
- package/index.js +5 -21
- package/index.js.map +1 -1
- package/organisation/organisation.cjs +35 -30
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +33 -32
- package/organisation/organisation.js +42 -37
- package/organisation/organisation.js.map +1 -1
- package/package.json +1 -1
- package/product/product.cjs +65 -53
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +55 -54
- package/product/product.js +76 -64
- package/product/product.js.map +1 -1
- package/service/service.cjs +21 -23
- package/service/service.cjs.map +1 -1
- package/service/service.d.ts +18 -17
- package/service/service.js +23 -25
- package/service/service.js.map +1 -1
- package/src/organisation/organisation.ts +93 -69
- package/src/product/product.ts +165 -146
- package/src/service/service.ts +59 -57
- package/src/state/state.ts +34 -28
- package/src/unit/unit.ts +145 -130
- package/src/user/user.ts +148 -120
- package/state/state.cjs +12 -12
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +11 -10
- package/state/state.js +13 -13
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +55 -50
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +54 -53
- package/unit/unit.js +66 -61
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +50 -50
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +53 -52
- package/user/user.js +61 -61
- package/user/user.js.map +1 -1
- package/chunk-GWBPVOL2.js.map +0 -1
- package/chunk-N3RLW53G.cjs +0 -25
- package/chunk-N3RLW53G.cjs.map +0 -1
package/unit/unit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from \"axios\";\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n/**\n * Gets Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const appApiUnitGetOrgUnits = (\n orgId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<OrganisationUnitsGetResponse>> => {\n return axios.get(`/organisation/${orgId}/unit`, options);\n};\n\nexport const getAppApiUnitGetOrgUnitsQueryKey = (orgId: string) => [\n `/organisation/${orgId}/unit`,\n];\n\nexport type AppApiUnitGetOrgUnitsQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>\n>;\nexport type AppApiUnitGetOrgUnitsQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGetOrgUnits = <\n TData = AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError = AxiosError<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUnitGetOrgUnitsQueryKey(orgId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>\n > = () => appApiUnitGetOrgUnits(orgId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUnitGetOrgUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const appApiUnitPost = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<OrganisationUnitPostResponse>> => {\n return axios.post(\n `/organisation/${orgId}/unit`,\n organisationUnitPostBodyBody,\n options\n );\n};\n\nexport type AppApiUnitPostMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPost>\n>;\nexport type AppApiUnitPostMutationBody = OrganisationUnitPostBodyBody;\nexport type AppApiUnitPostMutationError = AxiosError<AsError | void>;\n\nexport const useAppApiUnitPost = <\n TError = AxiosError<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPost>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPost>,\n { orgId: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgId, data } = props || {};\n\n return appApiUnitPost(orgId, data, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPost>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units\n\n * @summary Gets a Unit\n */\nexport const appApiUnitGetUnit = (\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UnitGetResponse>> => {\n return axios.get(`/organisation/${orgId}/unit/${unitId}`, options);\n};\n\nexport const getAppApiUnitGetUnitQueryKey = (orgId: string, unitId: string) => [\n `/organisation/${orgId}/unit/${unitId}`,\n];\n\nexport type AppApiUnitGetUnitQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGetUnit>\n>;\nexport type AppApiUnitGetUnitQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGetUnit = <\n TData = AsyncReturnType<typeof appApiUnitGetUnit>,\n TError = AxiosError<void | AsError>\n>(\n orgId: string,\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUnitGetUnit>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUnitGetUnitQueryKey(orgId, unitId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUnitGetUnit>\n > = () => appApiUnitGetUnit(orgId, unitId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUnitGetUnit>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!(orgId && unitId), ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const appApiUnitDelete = (\n orgId: string,\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/organisation/${orgId}/unit/${unitId}`, options);\n};\n\nexport type AppApiUnitDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitDelete>\n>;\n\nexport type AppApiUnitDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUnitDelete = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitDelete>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitDelete>,\n { orgId: string; unitId: string }\n > = (props) => {\n const { orgId, unitId } = props || {};\n\n return appApiUnitDelete(orgId, unitId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitDelete>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the Units that are public or you are a member of. Admin users can see all Units\n\n * @summary Gets Units\n */\nexport const appApiUnitGet = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UnitsGetResponse>> => {\n return axios.get(`/unit`, options);\n};\n\nexport const getAppApiUnitGetQueryKey = () => [`/unit`];\n\nexport type AppApiUnitGetQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUnitGet>\n>;\nexport type AppApiUnitGetQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUnitGet = <\n TData = AsyncReturnType<typeof appApiUnitGet>,\n TError = AxiosError<void | AsError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof appApiUnitGet>, TError, TData>;\n axios?: AxiosRequestConfig;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getAppApiUnitGetQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof appApiUnitGet>> = () =>\n appApiUnitGet(axiosOptions);\n\n const query = useQuery<AsyncReturnType<typeof appApiUnitGet>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\nexport const appApiUnitPersonalPut = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<PersonalUnitPutResponse>> => {\n return axios.put(`/unit`, undefined, options);\n};\n\nexport type AppApiUnitPersonalPutMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPersonalPut>\n>;\n\nexport type AppApiUnitPersonalPutMutationError = AxiosError<AsError | void>;\n\nexport const useAppApiUnitPersonalPut = <\n TError = AxiosError<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TError,\n TVariables,\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TVariables\n > = () => {\n return appApiUnitPersonalPut(axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPersonalPut>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\nexport const appApiUnitPersonalDelete = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/unit`, options);\n};\n\nexport type AppApiUnitPersonalDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUnitPersonalDelete>\n>;\n\nexport type AppApiUnitPersonalDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUnitPersonalDelete = <\n TError = AxiosError<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TError,\n TVariables,\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TVariables\n > = () => {\n return appApiUnitPersonalDelete(axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUnitPersonalDelete>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;AAUA;AACA;AAAA;AAAA;AAAA;AAgCO,IAAM,wBAAwB,CACnC,OACA,YACyD;AACzD,SAAO,MAAM,IAAI,iBAAiB,cAAc,OAAO;AACzD;AAEO,IAAM,mCAAmC,CAAC,UAAkB;AAAA,EACjE,iBAAiB;AACnB;AAOO,IAAM,2BAA2B,CAItC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,OAAO,iBAAiB,WAAW,CAAC;AAEjE,QAAM,WACJ,8CAAc,aAAY,iCAAiC,KAAK;AAElE,QAAM,UAEF,MAAM,sBAAsB,OAAO,YAAY;AAEnD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU,aAAc;AAE1D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,iBAAiB,CAC5B,OACA,8BACA,YACyD;AACzD,SAAO,MAAM,KACX,iBAAiB,cACjB,8BACA,OACF;AACF;AAQO,IAAM,oBAAoB,CAG/B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,SAAS,SAAS,CAAC;AAElC,WAAO,eAAe,OAAO,MAAM,YAAY;AAAA,EACjD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,oBAAoB,CAC/B,OACA,QACA,YA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,SAAO,MAAM,IAAI,SAAS,QAAW,OAAO;AAC9C;AAQO,IAAM,2BAA2B,CAItC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,MAAM;AACR,WAAO,sBAAsB,YAAY;AAAA,EAC3C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,2BAA2B,CACtC,YACiC;AACjC,SAAO,MAAM,OAAO,SAAS,OAAO;AACtC;AAQO,IAAM,8BAA8B,CAIzC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,MAAM;AACR,WAAO,yBAAyB,YAAY;AAAA,EAC9C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Gets Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgId}/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgId: string) => [\n `/organisation/${orgId}/unit`,\n];\n\nexport type GetOrganisationUnitsQueryResult = NonNullable<\n AsyncReturnType<typeof getOrganisationUnits>\n>;\nexport type GetOrganisationUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetOrganisationUnits = <\n TData = AsyncReturnType<typeof getOrganisationUnits>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUnits>\n > = () => getOrganisationUnits(orgId, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnits>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgId}/unit`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport type CreateOrganisationUnitMutationResult = NonNullable<\n AsyncReturnType<typeof createOrganisationUnit>\n>;\nexport type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody;\nexport type CreateOrganisationUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateOrganisationUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createOrganisationUnit>,\n { orgId: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgId, data } = props || {};\n\n return createOrganisationUnit(orgId, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createOrganisationUnit>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units\n\n * @summary Gets a Unit\n */\nexport const getUnit = (\n orgId: string,\n unitId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UnitGetResponse>(\n { url: `/organisation/${orgId}/unit/${unitId}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUnitQueryKey = (orgId: string, unitId: string) => [\n `/organisation/${orgId}/unit/${unitId}`,\n];\n\nexport type GetUnitQueryResult = NonNullable<AsyncReturnType<typeof getUnit>>;\nexport type GetUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnit = <\n TData = AsyncReturnType<typeof getUnit>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n unitId: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getUnit>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(orgId, unitId);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUnit>> = () =>\n getUnit(orgId, unitId, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUnit>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(orgId && unitId), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n orgId: string,\n unitId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgId}/unit/${unitId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteOrganisationUnitMutationResult = NonNullable<\n AsyncReturnType<typeof deleteOrganisationUnit>\n>;\n\nexport type DeleteOrganisationUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n { orgId: string; unitId: string }\n > = (props) => {\n const { orgId, unitId } = props || {};\n\n return deleteOrganisationUnit(orgId, unitId, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUnit>,\n TError,\n { orgId: string; unitId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the Units that are public or you are a member of. Admin users can see all Units\n\n * @summary Gets Units\n */\nexport const getUnits = (options?: SecondParameter<typeof customInstance>) => {\n return customInstance<UnitsGetResponse>(\n { url: `/unit`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUnitsQueryKey = () => [`/unit`];\n\nexport type GetUnitsQueryResult = NonNullable<AsyncReturnType<typeof getUnits>>;\nexport type GetUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnits = <\n TData = AsyncReturnType<typeof getUnits>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getUnits>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUnits>> = () =>\n getUnits(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUnits>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Independent User Unit\n */\nexport const createDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<PersonalUnitPutResponse>(\n { url: `/unit`, method: \"put\" },\n options\n );\n};\n\nexport type CreateDefaultUnitMutationResult = NonNullable<\n AsyncReturnType<typeof createDefaultUnit>\n>;\n\nexport type CreateDefaultUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateDefaultUnit = <\n TError = ErrorType<AsError | void>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createDefaultUnit>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createDefaultUnit>,\n TVariables\n > = () => {\n return createDefaultUnit(requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createDefaultUnit>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes an Independent Unit\n */\nexport const deleteDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>({ url: `/unit`, method: \"delete\" }, options);\n};\n\nexport type DeleteDefaultUnitMutationResult = NonNullable<\n AsyncReturnType<typeof deleteDefaultUnit>\n>;\n\nexport type DeleteDefaultUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteDefaultUnit = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TVariables\n > = () => {\n return deleteDefaultUnit(requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteDefaultUnit>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAyCO,IAAM,uBAAuB,CAClC,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,MAAM,GACpD,OACF;AACF;AAEO,IAAM,kCAAkC,CAAC,UAAkB;AAAA,EAChE,iBAAiB;AACnB;AAOO,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,gCAAgC,KAAK;AAEjE,QAAM,UAEF,MAAM,qBAAqB,OAAO,cAAc;AAEpD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,SAAU,aAAc;AAE1D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,yBAAyB,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AAuB,OAAO,QAAQ,cAAc;AAAA,EAC7D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,WAAW,CAAC,YAAqD;AAC5E,SAAO,eACL,EAAE,KAAK,SAAS,QAAQ,MAAM,GAC9B,OACF;AACF;AAEO,IAAM,sBAAsB,MAAM,CAAC,OAAO;AAK1C,IAAM,cAAc,CAGzB,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,oBAAoB;AAE/D,QAAM,UAA2D,MAC/D,SAAS,cAAc;AAEzB,QAAM,QAAQ,SACZ,UACA,SACA,YACF;AAEA,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,oBAAoB,CAC/B,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,QAAQ,MAAM,GAC9B,OACF;AACF;AAQO,IAAM,uBAAuB,CAIlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,MAAM;AACR,WAAO,kBAAkB,cAAc;AAAA,EACzC;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,oBAAoB,CAC/B,YACG;AACH,SAAO,eAAqB,EAAE,KAAK,SAAS,QAAQ,SAAS,GAAG,OAAO;AACzE;AAQO,IAAM,uBAAuB,CAIlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,MAAM;AACR,WAAO,kBAAkB,cAAc;AAAA,EACzC;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
|
package/user/user.cjs
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
var _chunkNGBTCJWScjs = require('../chunk-NGBTCJWS.cjs');
|
|
4
5
|
|
|
5
6
|
// src/user/user.ts
|
|
6
|
-
var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _reactquery = require('react-query');
|
|
11
|
-
var
|
|
12
|
-
return
|
|
11
|
+
var getUserAccount = (options) => {
|
|
12
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/user/account`, method: "get" }, options);
|
|
13
13
|
};
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
const { query: queryOptions,
|
|
17
|
-
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => (
|
|
18
|
-
const queryFn = () =>
|
|
14
|
+
var getGetUserAccountQueryKey = () => [`/user/account`];
|
|
15
|
+
var useGetUserAccount = (options) => {
|
|
16
|
+
const { query: queryOptions, request: requestOptions } = options || {};
|
|
17
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetUserAccountQueryKey()));
|
|
18
|
+
const queryFn = () => getUserAccount(requestOptions);
|
|
19
19
|
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
|
|
20
|
-
return
|
|
20
|
+
return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
|
|
21
21
|
queryKey
|
|
22
22
|
}, query);
|
|
23
23
|
};
|
|
24
|
-
var
|
|
25
|
-
return
|
|
24
|
+
var getOrganisationUsers = (orgId, options) => {
|
|
25
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/organisation/${orgId}/user`, method: "get" }, options);
|
|
26
26
|
};
|
|
27
|
-
var
|
|
27
|
+
var getGetOrganisationUsersQueryKey = (orgId) => [
|
|
28
28
|
`/organisation/${orgId}/user`
|
|
29
29
|
];
|
|
30
|
-
var
|
|
31
|
-
const { query: queryOptions,
|
|
32
|
-
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => (
|
|
33
|
-
const queryFn = () =>
|
|
34
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn,
|
|
35
|
-
return
|
|
30
|
+
var useGetOrganisationUsers = (orgId, options) => {
|
|
31
|
+
const { query: queryOptions, request: requestOptions } = options || {};
|
|
32
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationUsersQueryKey(orgId)));
|
|
33
|
+
const queryFn = () => getOrganisationUsers(orgId, requestOptions);
|
|
34
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkNGBTCJWScjs.__spreadValues.call(void 0, { enabled: !!orgId }, queryOptions));
|
|
35
|
+
return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
|
|
36
36
|
queryKey
|
|
37
37
|
}, query);
|
|
38
38
|
};
|
|
39
|
-
var
|
|
40
|
-
return
|
|
39
|
+
var addOrganisationUser = (orgId, userId, options) => {
|
|
40
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/organisation/${orgId}/user/${userId}`, method: "put" }, options);
|
|
41
41
|
};
|
|
42
|
-
var
|
|
43
|
-
const { mutation: mutationOptions,
|
|
42
|
+
var useAddOrganisationUser = (options) => {
|
|
43
|
+
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
44
44
|
const mutationFn = (props) => {
|
|
45
45
|
const { orgId, userId } = props || {};
|
|
46
|
-
return
|
|
46
|
+
return addOrganisationUser(orgId, userId, requestOptions);
|
|
47
47
|
};
|
|
48
48
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
49
49
|
};
|
|
50
|
-
var
|
|
51
|
-
return
|
|
50
|
+
var deleteOrganisationUser = (orgId, userId, options) => {
|
|
51
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/organisation/${orgId}/user/${userId}`, method: "delete" }, options);
|
|
52
52
|
};
|
|
53
|
-
var
|
|
54
|
-
const { mutation: mutationOptions,
|
|
53
|
+
var useDeleteOrganisationUser = (options) => {
|
|
54
|
+
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
55
55
|
const mutationFn = (props) => {
|
|
56
56
|
const { orgId, userId } = props || {};
|
|
57
|
-
return
|
|
57
|
+
return deleteOrganisationUser(orgId, userId, requestOptions);
|
|
58
58
|
};
|
|
59
59
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
60
60
|
};
|
|
61
|
-
var
|
|
62
|
-
return
|
|
61
|
+
var getOrganisationUnitUsers = (unitId, options) => {
|
|
62
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/unit/${unitId}/user`, method: "get" }, options);
|
|
63
63
|
};
|
|
64
|
-
var
|
|
64
|
+
var getGetOrganisationUnitUsersQueryKey = (unitId) => [
|
|
65
65
|
`/unit/${unitId}/user`
|
|
66
66
|
];
|
|
67
|
-
var
|
|
68
|
-
const { query: queryOptions,
|
|
69
|
-
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => (
|
|
70
|
-
const queryFn = () =>
|
|
71
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn,
|
|
72
|
-
return
|
|
67
|
+
var useGetOrganisationUnitUsers = (unitId, options) => {
|
|
68
|
+
const { query: queryOptions, request: requestOptions } = options || {};
|
|
69
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetOrganisationUnitUsersQueryKey(unitId)));
|
|
70
|
+
const queryFn = () => getOrganisationUnitUsers(unitId, requestOptions);
|
|
71
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkNGBTCJWScjs.__spreadValues.call(void 0, { enabled: !!unitId }, queryOptions));
|
|
72
|
+
return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
|
|
73
73
|
queryKey
|
|
74
74
|
}, query);
|
|
75
75
|
};
|
|
76
|
-
var
|
|
77
|
-
return
|
|
76
|
+
var addOrganisationUnitUser = (unitId, userId, options) => {
|
|
77
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/unit/${unitId}/user/${userId}`, method: "put" }, options);
|
|
78
78
|
};
|
|
79
|
-
var
|
|
80
|
-
const { mutation: mutationOptions,
|
|
79
|
+
var useAddOrganisationUnitUser = (options) => {
|
|
80
|
+
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
81
81
|
const mutationFn = (props) => {
|
|
82
82
|
const { unitId, userId } = props || {};
|
|
83
|
-
return
|
|
83
|
+
return addOrganisationUnitUser(unitId, userId, requestOptions);
|
|
84
84
|
};
|
|
85
85
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
86
86
|
};
|
|
87
|
-
var
|
|
88
|
-
return
|
|
87
|
+
var deleteOrganisationUnitUser = (unitId, userId, options) => {
|
|
88
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/unit/${unitId}/user/${userId}`, method: "delete" }, options);
|
|
89
89
|
};
|
|
90
|
-
var
|
|
91
|
-
const { mutation: mutationOptions,
|
|
90
|
+
var useDeleteOrganisationUnitUser = (options) => {
|
|
91
|
+
const { mutation: mutationOptions, request: requestOptions } = options || {};
|
|
92
92
|
const mutationFn = (props) => {
|
|
93
93
|
const { unitId, userId } = props || {};
|
|
94
|
-
return
|
|
94
|
+
return deleteOrganisationUnitUser(unitId, userId, requestOptions);
|
|
95
95
|
};
|
|
96
96
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
97
97
|
};
|
|
@@ -113,5 +113,5 @@ var useAppApiUserUnitUserDelete = (options) => {
|
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
exports.
|
|
116
|
+
exports.addOrganisationUnitUser = addOrganisationUnitUser; exports.addOrganisationUser = addOrganisationUser; exports.deleteOrganisationUnitUser = deleteOrganisationUnitUser; exports.deleteOrganisationUser = deleteOrganisationUser; exports.getGetOrganisationUnitUsersQueryKey = getGetOrganisationUnitUsersQueryKey; exports.getGetOrganisationUsersQueryKey = getGetOrganisationUsersQueryKey; exports.getGetUserAccountQueryKey = getGetUserAccountQueryKey; exports.getOrganisationUnitUsers = getOrganisationUnitUsers; exports.getOrganisationUsers = getOrganisationUsers; exports.getUserAccount = getUserAccount; exports.useAddOrganisationUnitUser = useAddOrganisationUnitUser; exports.useAddOrganisationUser = useAddOrganisationUser; exports.useDeleteOrganisationUnitUser = useDeleteOrganisationUnitUser; exports.useDeleteOrganisationUser = useDeleteOrganisationUser; exports.useGetOrganisationUnitUsers = useGetOrganisationUnitUsers; exports.useGetOrganisationUsers = useGetOrganisationUsers; exports.useGetUserAccount = useGetUserAccount;
|
|
117
117
|
//# sourceMappingURL=user.cjs.map
|
package/user/user.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;AAUA;AACA;AAAA;AAAA;AAAA;AA4BO,IAAM,uBAAuB,CAClC,YACmD;AACnD,SAAO,MAAM,IAAI,iBAAiB,OAAO;AAC3C;AAEO,IAAM,kCAAkC,MAAM,CAAC,eAAe;AAO9D,IAAM,0BAA0B,CAGrC,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,OAAO,iBAAiB,WAAW,CAAC;AAEjE,QAAM,WAAW,8CAAc,aAAY,gCAAgC;AAE3E,QAAM,UAEF,MAAM,qBAAqB,YAAY;AAE3C,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAEjC,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,wBAAwB,CACnC,OACA,YAC6C;AAC7C,SAAO,MAAM,IAAI,iBAAiB,cAAc,OAAO;AACzD;AAEO,IAAM,mCAAmC,CAAC,UAAkB;AAAA,EACjE,iBAAiB;AACnB;AAOO,IAAM,2BAA2B,CAItC,OACA,YAQ2D;AAC3D,QAAM,EAAE,O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aAAY,kCAAkC,MAAM;AAEpE,QAAM,UAEF,MAAM,uBAAuB,QAAQ,YAAY;AAErD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,UAAW,aAAc;AAE3D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAWO,IAAM,wBAAwB,CACnC,QACA,QACA,YACiC;AACjC,SAAO,MAAM,IAAI,SAAS,eAAe,UAAU,QAAW,OAAO;AACvE;AAQO,IAAM,2BAA2B,CAGtC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,CAAC;AAErC,WAAO,sBAAsB,QAAQ,QAAQ,YAAY;AAAA,EAC3D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAUO,IAAM,2BAA2B,CACtC,QACA,QACA,YACiC;AACjC,SAAO,MAAM,OAAO,SAAS,eAAe,UAAU,OAAO;AAC/D;AAQO,IAAM,8BAA8B,CAGzC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,OAAO,iBAAiB,WAAW,CAAC;AAEvE,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,CAAC;AAErC,WAAO,yBAAyB,QAAQ,QAAQ,YAAY;AAAA,EAC9D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from \"axios\";\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const appApiUserGetAccount = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UserAccountGetResponse>> => {\n return axios.get(`/user/account`, options);\n};\n\nexport const getAppApiUserGetAccountQueryKey = () => [`/user/account`];\n\nexport type AppApiUserGetAccountQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUserGetAccount>\n>;\nexport type AppApiUserGetAccountQueryError = AxiosError<void | AsError>;\n\nexport const useAppApiUserGetAccount = <\n TData = AsyncReturnType<typeof appApiUserGetAccount>,\n TError = AxiosError<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUserGetAccount>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getAppApiUserGetAccountQueryKey();\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUserGetAccount>\n > = () => appApiUserGetAccount(axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUserGetAccount>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Gets users in an organisation\n */\nexport const appApiUserOrgGetUsers = (\n orgId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UsersGetResponse>> => {\n return axios.get(`/organisation/${orgId}/user`, options);\n};\n\nexport const getAppApiUserOrgGetUsersQueryKey = (orgId: string) => [\n `/organisation/${orgId}/user`,\n];\n\nexport type AppApiUserOrgGetUsersQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUserOrgGetUsers>\n>;\nexport type AppApiUserOrgGetUsersQueryError = AxiosError<AsError | void>;\n\nexport const useAppApiUserOrgGetUsers = <\n TData = AsyncReturnType<typeof appApiUserOrgGetUsers>,\n TError = AxiosError<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUserOrgGetUsers>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUserOrgGetUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUserOrgGetUsers>\n > = () => appApiUserOrgGetUsers(orgId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUserOrgGetUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Adds a user to an organisation\n */\nexport const appApiUserOrgUserPut = (\n orgId: string,\n userId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.put(`/organisation/${orgId}/user/${userId}`, undefined, options);\n};\n\nexport type AppApiUserOrgUserPutMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUserOrgUserPut>\n>;\n\nexport type AppApiUserOrgUserPutMutationError = AxiosError<AsError>;\n\nexport const useAppApiUserOrgUserPut = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUserOrgUserPut>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUserOrgUserPut>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props || {};\n\n return appApiUserOrgUserPut(orgId, userId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUserOrgUserPut>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Deletes a user from an organisation\n */\nexport const appApiUserOrgUserDelete = (\n orgId: string,\n userId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/organisation/${orgId}/user/${userId}`, options);\n};\n\nexport type AppApiUserOrgUserDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUserOrgUserDelete>\n>;\n\nexport type AppApiUserOrgUserDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUserOrgUserDelete = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUserOrgUserDelete>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUserOrgUserDelete>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props || {};\n\n return appApiUserOrgUserDelete(orgId, userId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUserOrgUserDelete>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Gets users in an Organisational Unit\n */\nexport const appApiUserGetUnitUsers = (\n unitId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<UsersGetResponse>> => {\n return axios.get(`/unit/${unitId}/user`, options);\n};\n\nexport const getAppApiUserGetUnitUsersQueryKey = (unitId: string) => [\n `/unit/${unitId}/user`,\n];\n\nexport type AppApiUserGetUnitUsersQueryResult = NonNullable<\n AsyncReturnType<typeof appApiUserGetUnitUsers>\n>;\nexport type AppApiUserGetUnitUsersQueryError = AxiosError<AsError | void>;\n\nexport const useAppApiUserGetUnitUsers = <\n TData = AsyncReturnType<typeof appApiUserGetUnitUsers>,\n TError = AxiosError<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiUserGetUnitUsers>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getAppApiUserGetUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiUserGetUnitUsers>\n > = () => appApiUserGetUnitUsers(unitId, axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiUserGetUnitUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an Organisational Unit.\n\nUsers cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Adds a user to an Organisational Unit\n */\nexport const appApiUserUnitUserPut = (\n unitId: string,\n userId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.put(`/unit/${unitId}/user/${userId}`, undefined, options);\n};\n\nexport type AppApiUserUnitUserPutMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUserUnitUserPut>\n>;\n\nexport type AppApiUserUnitUserPutMutationError = AxiosError<AsError>;\n\nexport const useAppApiUserUnitUserPut = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUserUnitUserPut>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUserUnitUserPut>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props || {};\n\n return appApiUserUnitUserPut(unitId, userId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUserUnitUserPut>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an Organisational Unit.\n\nUsers cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Deletes a user from an Organisational Unit\n */\nexport const appApiUserUnitUserDelete = (\n unitId: string,\n userId: string,\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<void>> => {\n return axios.delete(`/unit/${unitId}/user/${userId}`, options);\n};\n\nexport type AppApiUserUnitUserDeleteMutationResult = NonNullable<\n AsyncReturnType<typeof appApiUserUnitUserDelete>\n>;\n\nexport type AppApiUserUnitUserDeleteMutationError = AxiosError<AsError>;\n\nexport const useAppApiUserUnitUserDelete = <\n TError = AxiosError<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof appApiUserUnitUserDelete>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n axios?: AxiosRequestConfig;\n}) => {\n const { mutation: mutationOptions, axios: axiosOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof appApiUserUnitUserDelete>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props || {};\n\n return appApiUserUnitUserDelete(unitId, userId, axiosOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof appApiUserUnitUserDelete>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/user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,EAC/D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAUO,IAAM,6BAA6B,CACxC,QACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,SAAS,GAC1D,OACF;AACF;AAQO,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,WAAW,SAAS,CAAC;AAErC,WAAO,2BAA2B,QAAQ,QAAQ,cAAc;AAAA,EAClE;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\" },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [`/user/account`];\n\nexport type GetUserAccountQueryResult = NonNullable<\n AsyncReturnType<typeof getUserAccount>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\nexport const useGetUserAccount = <\n TData = AsyncReturnType<typeof getUserAccount>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getUserAccount>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getUserAccount>> = () =>\n getUserAccount(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getUserAccount>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Gets users in an organisation\n */\nexport const getOrganisationUsers = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/organisation/${orgId}/user`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgId: string) => [\n `/organisation/${orgId}/user`,\n];\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n AsyncReturnType<typeof getOrganisationUsers>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUsers = <\n TData = AsyncReturnType<typeof getOrganisationUsers>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUsers>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUsers>\n > = () => getOrganisationUsers(orgId, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Adds a user to an organisation\n */\nexport const addOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddOrganisationUserMutationResult = NonNullable<\n AsyncReturnType<typeof addOrganisationUser>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addOrganisationUser>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addOrganisationUser>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props || {};\n\n return addOrganisationUser(orgId, userId, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addOrganisationUser>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an organisation. You have to be in the Organisation or an Admin user to use this endpoint\n\n * @summary Deletes a user from an organisation\n */\nexport const deleteOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteOrganisationUserMutationResult = NonNullable<\n AsyncReturnType<typeof deleteOrganisationUser>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUser>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUser>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props || {};\n\n return deleteOrganisationUser(orgId, userId, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUser>,\n TError,\n { orgId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Gets users in an Organisational Unit\n */\nexport const getOrganisationUnitUsers = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/unit/${unitId}/user`, method: \"get\" },\n options\n );\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string) => [\n `/unit/${unitId}/user`,\n];\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n AsyncReturnType<typeof getOrganisationUnitUsers>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUnitUsers = <\n TData = AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof getOrganisationUnitUsers>\n > = () => getOrganisationUnitUsers(unitId, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getOrganisationUnitUsers>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Adds a user to an Organisational Unit.\n\nUsers cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Adds a user to an Organisational Unit\n */\nexport const addOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddOrganisationUnitUserMutationResult = NonNullable<\n AsyncReturnType<typeof addOrganisationUnitUser>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props || {};\n\n return addOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addOrganisationUnitUser>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes a user from an Organisational Unit.\n\nUsers cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Deletes a user from an Organisational Unit\n */\nexport const deleteOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteOrganisationUnitUserMutationResult = NonNullable<\n AsyncReturnType<typeof deleteOrganisationUnitUser>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props || {};\n\n return deleteOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteOrganisationUnitUser>,\n TError,\n { unitId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
|
package/user/user.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { V as customInstance, e as UserAccountDetail, W as ErrorType, N as AsError, K as UsersGetResponse } from '../custom-instance-13412a15.js';
|
|
4
|
+
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...args: any) => Promise<infer R> ? R : any;
|
|
7
|
+
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
7
8
|
/**
|
|
8
9
|
* Returns a summary of your account
|
|
9
10
|
|
|
10
11
|
* @summary Get information about your account
|
|
11
12
|
*/
|
|
12
|
-
declare const
|
|
13
|
-
declare const
|
|
14
|
-
declare type
|
|
15
|
-
declare type
|
|
16
|
-
declare const
|
|
17
|
-
query?: UseQueryOptions<
|
|
18
|
-
|
|
13
|
+
declare const getUserAccount: (options?: SecondParameter<typeof customInstance>) => Promise<UserAccountDetail>;
|
|
14
|
+
declare const getGetUserAccountQueryKey: () => string[];
|
|
15
|
+
declare type GetUserAccountQueryResult = NonNullable<AsyncReturnType<typeof getUserAccount>>;
|
|
16
|
+
declare type GetUserAccountQueryError = ErrorType<void | AsError>;
|
|
17
|
+
declare const useGetUserAccount: <TData = UserAccountDetail, TError = ErrorType<void | AsError>>(options?: {
|
|
18
|
+
query?: UseQueryOptions<UserAccountDetail, TError, TData, QueryKey> | undefined;
|
|
19
|
+
request?: SecondParameter<typeof customInstance>;
|
|
19
20
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
20
21
|
queryKey: QueryKey;
|
|
21
22
|
};
|
|
@@ -24,13 +25,13 @@ declare const useAppApiUserGetAccount: <TData = AxiosResponse<UserAccountDetail,
|
|
|
24
25
|
|
|
25
26
|
* @summary Gets users in an organisation
|
|
26
27
|
*/
|
|
27
|
-
declare const
|
|
28
|
-
declare const
|
|
29
|
-
declare type
|
|
30
|
-
declare type
|
|
31
|
-
declare const
|
|
32
|
-
query?: UseQueryOptions<
|
|
33
|
-
|
|
28
|
+
declare const getOrganisationUsers: (orgId: string, options?: SecondParameter<typeof customInstance>) => Promise<UsersGetResponse>;
|
|
29
|
+
declare const getGetOrganisationUsersQueryKey: (orgId: string) => string[];
|
|
30
|
+
declare type GetOrganisationUsersQueryResult = NonNullable<AsyncReturnType<typeof getOrganisationUsers>>;
|
|
31
|
+
declare type GetOrganisationUsersQueryError = ErrorType<AsError | void>;
|
|
32
|
+
declare const useGetOrganisationUsers: <TData = UsersGetResponse, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
33
|
+
query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
|
|
34
|
+
request?: SecondParameter<typeof customInstance>;
|
|
34
35
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
35
36
|
queryKey: QueryKey;
|
|
36
37
|
};
|
|
@@ -39,16 +40,16 @@ declare const useAppApiUserOrgGetUsers: <TData = AxiosResponse<UsersGetResponse,
|
|
|
39
40
|
|
|
40
41
|
* @summary Adds a user to an organisation
|
|
41
42
|
*/
|
|
42
|
-
declare const
|
|
43
|
-
declare type
|
|
44
|
-
declare type
|
|
45
|
-
declare const
|
|
46
|
-
mutation?: UseMutationOptions<
|
|
43
|
+
declare const addOrganisationUser: (orgId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
44
|
+
declare type AddOrganisationUserMutationResult = NonNullable<AsyncReturnType<typeof addOrganisationUser>>;
|
|
45
|
+
declare type AddOrganisationUserMutationError = ErrorType<AsError>;
|
|
46
|
+
declare const useAddOrganisationUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
47
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
47
48
|
orgId: string;
|
|
48
49
|
userId: string;
|
|
49
50
|
}, TContext> | undefined;
|
|
50
|
-
|
|
51
|
-
} | undefined) => react_query.UseMutationResult<
|
|
51
|
+
request?: SecondParameter<typeof customInstance>;
|
|
52
|
+
} | undefined) => react_query.UseMutationResult<void, TError, {
|
|
52
53
|
orgId: string;
|
|
53
54
|
userId: string;
|
|
54
55
|
}, TContext>;
|
|
@@ -57,16 +58,16 @@ declare const useAppApiUserOrgUserPut: <TError = AxiosError<AsError, any>, TCont
|
|
|
57
58
|
|
|
58
59
|
* @summary Deletes a user from an organisation
|
|
59
60
|
*/
|
|
60
|
-
declare const
|
|
61
|
-
declare type
|
|
62
|
-
declare type
|
|
63
|
-
declare const
|
|
64
|
-
mutation?: UseMutationOptions<
|
|
61
|
+
declare const deleteOrganisationUser: (orgId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
62
|
+
declare type DeleteOrganisationUserMutationResult = NonNullable<AsyncReturnType<typeof deleteOrganisationUser>>;
|
|
63
|
+
declare type DeleteOrganisationUserMutationError = ErrorType<AsError>;
|
|
64
|
+
declare const useDeleteOrganisationUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
65
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
65
66
|
orgId: string;
|
|
66
67
|
userId: string;
|
|
67
68
|
}, TContext> | undefined;
|
|
68
|
-
|
|
69
|
-
} | undefined) => react_query.UseMutationResult<
|
|
69
|
+
request?: SecondParameter<typeof customInstance>;
|
|
70
|
+
} | undefined) => react_query.UseMutationResult<void, TError, {
|
|
70
71
|
orgId: string;
|
|
71
72
|
userId: string;
|
|
72
73
|
}, TContext>;
|
|
@@ -75,13 +76,13 @@ declare const useAppApiUserOrgUserDelete: <TError = AxiosError<AsError, any>, TC
|
|
|
75
76
|
|
|
76
77
|
* @summary Gets users in an Organisational Unit
|
|
77
78
|
*/
|
|
78
|
-
declare const
|
|
79
|
-
declare const
|
|
80
|
-
declare type
|
|
81
|
-
declare type
|
|
82
|
-
declare const
|
|
83
|
-
query?: UseQueryOptions<
|
|
84
|
-
|
|
79
|
+
declare const getOrganisationUnitUsers: (unitId: string, options?: SecondParameter<typeof customInstance>) => Promise<UsersGetResponse>;
|
|
80
|
+
declare const getGetOrganisationUnitUsersQueryKey: (unitId: string) => string[];
|
|
81
|
+
declare type GetOrganisationUnitUsersQueryResult = NonNullable<AsyncReturnType<typeof getOrganisationUnitUsers>>;
|
|
82
|
+
declare type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;
|
|
83
|
+
declare const useGetOrganisationUnitUsers: <TData = UsersGetResponse, TError = ErrorType<void | AsError>>(unitId: string, options?: {
|
|
84
|
+
query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
|
|
85
|
+
request?: SecondParameter<typeof customInstance>;
|
|
85
86
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
86
87
|
queryKey: QueryKey;
|
|
87
88
|
};
|
|
@@ -94,16 +95,16 @@ You have to be in the Organisation or Unit or an Admin user to use this endpoint
|
|
|
94
95
|
|
|
95
96
|
* @summary Adds a user to an Organisational Unit
|
|
96
97
|
*/
|
|
97
|
-
declare const
|
|
98
|
-
declare type
|
|
99
|
-
declare type
|
|
100
|
-
declare const
|
|
101
|
-
mutation?: UseMutationOptions<
|
|
98
|
+
declare const addOrganisationUnitUser: (unitId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
99
|
+
declare type AddOrganisationUnitUserMutationResult = NonNullable<AsyncReturnType<typeof addOrganisationUnitUser>>;
|
|
100
|
+
declare type AddOrganisationUnitUserMutationError = ErrorType<AsError>;
|
|
101
|
+
declare const useAddOrganisationUnitUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
102
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
102
103
|
unitId: string;
|
|
103
104
|
userId: string;
|
|
104
105
|
}, TContext> | undefined;
|
|
105
|
-
|
|
106
|
-
} | undefined) => react_query.UseMutationResult<
|
|
106
|
+
request?: SecondParameter<typeof customInstance>;
|
|
107
|
+
} | undefined) => react_query.UseMutationResult<void, TError, {
|
|
107
108
|
unitId: string;
|
|
108
109
|
userId: string;
|
|
109
110
|
}, TContext>;
|
|
@@ -116,18 +117,18 @@ You have to be in the Organisation or Unit or an Admin user to use this endpoint
|
|
|
116
117
|
|
|
117
118
|
* @summary Deletes a user from an Organisational Unit
|
|
118
119
|
*/
|
|
119
|
-
declare const
|
|
120
|
-
declare type
|
|
121
|
-
declare type
|
|
122
|
-
declare const
|
|
123
|
-
mutation?: UseMutationOptions<
|
|
120
|
+
declare const deleteOrganisationUnitUser: (unitId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
121
|
+
declare type DeleteOrganisationUnitUserMutationResult = NonNullable<AsyncReturnType<typeof deleteOrganisationUnitUser>>;
|
|
122
|
+
declare type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;
|
|
123
|
+
declare const useDeleteOrganisationUnitUser: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
124
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
124
125
|
unitId: string;
|
|
125
126
|
userId: string;
|
|
126
127
|
}, TContext> | undefined;
|
|
127
|
-
|
|
128
|
-
} | undefined) => react_query.UseMutationResult<
|
|
128
|
+
request?: SecondParameter<typeof customInstance>;
|
|
129
|
+
} | undefined) => react_query.UseMutationResult<void, TError, {
|
|
129
130
|
unitId: string;
|
|
130
131
|
userId: string;
|
|
131
132
|
}, TContext>;
|
|
132
133
|
|
|
133
|
-
export {
|
|
134
|
+
export { AddOrganisationUnitUserMutationError, AddOrganisationUnitUserMutationResult, AddOrganisationUserMutationError, AddOrganisationUserMutationResult, DeleteOrganisationUnitUserMutationError, DeleteOrganisationUnitUserMutationResult, DeleteOrganisationUserMutationError, DeleteOrganisationUserMutationResult, GetOrganisationUnitUsersQueryError, GetOrganisationUnitUsersQueryResult, GetOrganisationUsersQueryError, GetOrganisationUsersQueryResult, GetUserAccountQueryError, GetUserAccountQueryResult, addOrganisationUnitUser, addOrganisationUser, deleteOrganisationUnitUser, deleteOrganisationUser, getGetOrganisationUnitUsersQueryKey, getGetOrganisationUsersQueryKey, getGetUserAccountQueryKey, getOrganisationUnitUsers, getOrganisationUsers, getUserAccount, useAddOrganisationUnitUser, useAddOrganisationUser, useDeleteOrganisationUnitUser, useDeleteOrganisationUser, useGetOrganisationUnitUsers, useGetOrganisationUsers, useGetUserAccount };
|