@squonk/account-server-client 4.3.1 → 4.4.0-4-4.2174798239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/api/actions/actions.cjs +85 -0
- package/dist/api/actions/actions.cjs.map +1 -0
- package/dist/api/actions/actions.d.cts +74 -0
- package/dist/api/actions/actions.d.cts.map +1 -0
- package/dist/api/actions/actions.d.ts +74 -0
- package/dist/api/actions/actions.d.ts.map +1 -0
- package/dist/api/actions/actions.js +79 -0
- package/dist/api/actions/actions.js.map +1 -0
- package/dist/api/api.schemas.cjs +142 -0
- package/dist/api/api.schemas.cjs.map +1 -0
- package/dist/api/api.schemas.d.cts +1032 -0
- package/dist/api/api.schemas.d.cts.map +1 -0
- package/dist/api/api.schemas.d.ts +1032 -0
- package/dist/api/api.schemas.d.ts.map +1 -0
- package/dist/api/api.schemas.js +118 -0
- package/dist/api/api.schemas.js.map +1 -0
- package/dist/api/asset/asset.cjs +464 -0
- package/dist/api/asset/asset.cjs.map +1 -0
- package/{asset → dist/api/asset}/asset.d.cts +132 -130
- package/dist/api/asset/asset.d.cts.map +1 -0
- package/{asset → dist/api/asset}/asset.d.ts +132 -130
- package/dist/api/asset/asset.d.ts.map +1 -0
- package/dist/api/asset/asset.js +431 -0
- package/dist/api/asset/asset.js.map +1 -0
- package/dist/api/charges/charges.cjs +272 -0
- package/dist/api/charges/charges.cjs.map +1 -0
- package/{charges → dist/api/charges}/charges.d.cts +106 -104
- package/dist/api/charges/charges.d.cts.map +1 -0
- package/{charges → dist/api/charges}/charges.d.ts +106 -104
- package/dist/api/charges/charges.d.ts.map +1 -0
- package/dist/api/charges/charges.js +248 -0
- package/dist/api/charges/charges.js.map +1 -0
- package/dist/api/event-stream/event-stream.cjs +230 -0
- package/dist/api/event-stream/event-stream.cjs.map +1 -0
- package/{event-stream → dist/api/event-stream}/event-stream.d.cts +75 -73
- package/dist/api/event-stream/event-stream.d.cts.map +1 -0
- package/{event-stream → dist/api/event-stream}/event-stream.d.ts +75 -73
- package/dist/api/event-stream/event-stream.d.ts.map +1 -0
- package/dist/api/event-stream/event-stream.js +212 -0
- package/dist/api/event-stream/event-stream.js.map +1 -0
- package/dist/api/merchant/merchant.cjs +139 -0
- package/dist/api/merchant/merchant.cjs.map +1 -0
- package/{merchant → dist/api/merchant}/merchant.d.cts +56 -54
- package/dist/api/merchant/merchant.d.cts.map +1 -0
- package/{merchant → dist/api/merchant}/merchant.d.ts +56 -54
- package/dist/api/merchant/merchant.d.ts.map +1 -0
- package/dist/api/merchant/merchant.js +127 -0
- package/dist/api/merchant/merchant.js.map +1 -0
- package/dist/api/organisation/organisation.cjs +341 -0
- package/dist/api/organisation/organisation.cjs.map +1 -0
- package/{organisation → dist/api/organisation}/organisation.d.cts +112 -110
- package/dist/api/organisation/organisation.d.cts.map +1 -0
- package/{organisation → dist/api/organisation}/organisation.d.ts +112 -110
- package/dist/api/organisation/organisation.d.ts.map +1 -0
- package/dist/api/organisation/organisation.js +314 -0
- package/dist/api/organisation/organisation.js.map +1 -0
- package/dist/api/product/product.cjs +513 -0
- package/dist/api/product/product.cjs.map +1 -0
- package/{product → dist/api/product}/product.d.cts +188 -186
- package/dist/api/product/product.d.cts.map +1 -0
- package/{product → dist/api/product}/product.d.ts +188 -186
- package/dist/api/product/product.d.ts.map +1 -0
- package/dist/api/product/product.js +468 -0
- package/dist/api/product/product.js.map +1 -0
- package/dist/api/state/state.cjs +76 -0
- package/dist/api/state/state.cjs.map +1 -0
- package/dist/api/state/state.d.cts +66 -0
- package/dist/api/state/state.d.cts.map +1 -0
- package/dist/api/state/state.d.ts +66 -0
- package/dist/api/state/state.d.ts.map +1 -0
- package/dist/api/state/state.js +70 -0
- package/dist/api/state/state.js.map +1 -0
- package/dist/api/unit/unit.cjs +568 -0
- package/dist/api/unit/unit.cjs.map +1 -0
- package/{unit → dist/api/unit}/unit.d.cts +167 -165
- package/dist/api/unit/unit.d.cts.map +1 -0
- package/{unit → dist/api/unit}/unit.d.ts +167 -165
- package/dist/api/unit/unit.d.ts.map +1 -0
- package/dist/api/unit/unit.js +523 -0
- package/dist/api/unit/unit.js.map +1 -0
- package/dist/api/user/user.cjs +380 -0
- package/dist/api/user/user.cjs.map +1 -0
- package/{user → dist/api/user}/user.d.cts +129 -127
- package/dist/api/user/user.d.cts.map +1 -0
- package/{user → dist/api/user}/user.d.ts +129 -127
- package/dist/api/user/user.d.ts.map +1 -0
- package/dist/api/user/user.js +350 -0
- package/dist/api/user/user.js.map +1 -0
- package/dist/custom-instance.cjs +49 -0
- package/dist/custom-instance.cjs.map +1 -0
- package/dist/custom-instance.d.cts +22 -0
- package/dist/custom-instance.d.cts.map +1 -0
- package/dist/custom-instance.d.ts +22 -0
- package/dist/custom-instance.d.ts.map +1 -0
- package/dist/custom-instance.js +44 -0
- package/dist/custom-instance.js.map +1 -0
- package/dist/index.cjs +31 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/options-mutator.cjs +24 -0
- package/dist/options-mutator.cjs.map +1 -0
- package/dist/options-mutator.js +23 -0
- package/dist/options-mutator.js.map +1 -0
- package/orval.config.ts +24 -0
- package/package.json +163 -16
- package/pnpm-workspace.yaml +3 -0
- package/src/api/actions/actions.ts +249 -0
- package/src/{account-server-api.schemas.ts → api/api.schemas.ts} +82 -2
- package/src/{asset → api/asset}/asset.ts +8 -8
- package/src/{charges → api/charges}/charges.ts +9 -9
- package/src/{event-stream → api/event-stream}/event-stream.ts +7 -7
- package/src/{merchant → api/merchant}/merchant.ts +7 -7
- package/src/{organisation → api/organisation}/organisation.ts +8 -8
- package/src/{product → api/product}/product.ts +10 -10
- package/src/{state → api/state}/state.ts +6 -6
- package/src/{unit → api/unit}/unit.ts +9 -9
- package/src/{user → api/user}/user.ts +9 -9
- package/src/index.ts +2 -2
- package/src/options-mutator.ts +2 -2
- package/tsconfig.json +29 -0
- package/tsdown.config.ts +52 -0
- package/asset/asset.cjs +0 -281
- package/asset/asset.cjs.map +0 -1
- package/asset/asset.js +0 -281
- package/asset/asset.js.map +0 -1
- package/asset/package.json +0 -7
- package/charges/charges.cjs +0 -176
- package/charges/charges.cjs.map +0 -1
- package/charges/charges.js +0 -176
- package/charges/charges.js.map +0 -1
- package/charges/package.json +0 -7
- package/chunk-3WKSNKHE.js +0 -25
- package/chunk-3WKSNKHE.js.map +0 -1
- package/chunk-NY2VJJG7.cjs +0 -25
- package/chunk-NY2VJJG7.cjs.map +0 -1
- package/chunk-RB2KVIEK.cjs +0 -27
- package/chunk-RB2KVIEK.cjs.map +0 -1
- package/chunk-XYDLYMQ2.js +0 -27
- package/chunk-XYDLYMQ2.js.map +0 -1
- package/event-stream/event-stream.cjs +0 -144
- package/event-stream/event-stream.cjs.map +0 -1
- package/event-stream/event-stream.js +0 -144
- package/event-stream/event-stream.js.map +0 -1
- package/event-stream/package.json +0 -7
- package/index.cjs +0 -142
- package/index.cjs.map +0 -1
- package/index.d.cts +0 -979
- package/index.d.ts +0 -979
- package/index.js +0 -142
- package/index.js.map +0 -1
- package/merchant/merchant.cjs +0 -91
- package/merchant/merchant.cjs.map +0 -1
- package/merchant/merchant.js +0 -91
- package/merchant/merchant.js.map +0 -1
- package/merchant/package.json +0 -7
- package/organisation/organisation.cjs +0 -213
- package/organisation/organisation.cjs.map +0 -1
- package/organisation/organisation.js +0 -213
- package/organisation/organisation.js.map +0 -1
- package/organisation/package.json +0 -7
- package/product/package.json +0 -7
- package/product/product.cjs +0 -341
- package/product/product.cjs.map +0 -1
- package/product/product.js +0 -341
- package/product/product.js.map +0 -1
- package/state/package.json +0 -7
- package/state/state.cjs +0 -53
- package/state/state.cjs.map +0 -1
- package/state/state.d.cts +0 -64
- package/state/state.d.ts +0 -64
- package/state/state.js +0 -53
- package/state/state.js.map +0 -1
- package/unit/package.json +0 -7
- package/unit/unit.cjs +0 -339
- package/unit/unit.cjs.map +0 -1
- package/unit/unit.js +0 -339
- package/unit/unit.js.map +0 -1
- package/user/package.json +0 -7
- package/user/user.cjs +0 -226
- package/user/user.cjs.map +0 -1
- package/user/user.js +0 -226
- package/user/user.js.map +0 -1
package/charges/charges.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/charges/charges.cjs","../../src/charges/charges.ts"],"names":[],"mappings":"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","file":"/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/charges/charges.cjs","sourcesContent":[null,"/**\n * Generated by orval v7.10.0 🍺\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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.3\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n ChargesGetResponse,\n GetChargesParams,\n GetOrganisationChargesParams,\n GetProductChargesParams,\n GetUnitChargesParams,\n OrganisationChargesGetResponse,\n ProductChargesGetResponse,\n UnitChargesGetResponse,\n} from \"../account-server-api.schemas\";\n\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././options-mutator\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets global Charges.\n\nYou need admin rights to use this path.\n\n * @summary Gets charges for all Organisations\n */\nexport const getCharges = (\n params?: GetChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<ChargesGetResponse>(\n { url: `/charges`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetChargesQueryKey = (params?: GetChargesParams) => {\n return [`/charges`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>\n getCharges(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;\nexport type GetChargesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n Awaited<ReturnType<typeof getCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n Awaited<ReturnType<typeof getCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetChargesQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>\n getCharges(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;\nexport type GetChargesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetChargesParams,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetChargesSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a Organisation charges.\n\nThe Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint\n\n * @summary Gets charges for all Units in an Organisation\n */\nexport const getOrganisationCharges = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationChargesGetResponse>(\n { url: `/charges/organisation/${orgId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetOrganisationChargesQueryKey = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n) => {\n return [`/charges/organisation/${orgId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetOrganisationChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>\n getOrganisationCharges(orgId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n>;\nexport type GetOrganisationChargesQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams,\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationChargesQueryOptions(orgId, params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetOrganisationChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>\n getOrganisationCharges(orgId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n>;\nexport type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\n\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Product\n */\nexport const getProductCharges = (\n productId: string,\n params?: GetProductChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<ProductChargesGetResponse>(\n { url: `/charges/product/${productId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetProductChargesQueryKey = (\n productId: string,\n params?: GetProductChargesParams,\n) => {\n return [`/charges/product/${productId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetProductChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetProductChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesQueryError = ErrorType<AsError | void>;\n\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params: undefined | GetProductChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n Awaited<ReturnType<typeof getProductCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n Awaited<ReturnType<typeof getProductCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetProductChargesQueryOptions(productId, params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetProductChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetProductChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params: undefined | GetProductChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetProductChargesSuspenseQueryOptions(productId, params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<UnitChargesGetResponse>(\n { url: `/charges/unit/${unitId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetUnitChargesQueryKey = (unitId: string, params?: GetUnitChargesParams) => {\n return [`/charges/unit/${unitId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetUnitChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>\n getUnitCharges(unitId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>;\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>;\n\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params: undefined | GetUnitChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n Awaited<ReturnType<typeof getUnitCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n Awaited<ReturnType<typeof getUnitCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUnitChargesQueryOptions(unitId, params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetUnitChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>\n getUnitCharges(unitId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUnitChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnitCharges>>\n>;\nexport type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params: undefined | GetUnitChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUnitChargesSuspenseQueryOptions(unitId, params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"]}
|
package/charges/charges.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
queryMutator
|
|
3
|
-
} from "../chunk-3WKSNKHE.js";
|
|
4
|
-
import {
|
|
5
|
-
customInstance
|
|
6
|
-
} from "../chunk-XYDLYMQ2.js";
|
|
7
|
-
|
|
8
|
-
// src/charges/charges.ts
|
|
9
|
-
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
10
|
-
var getCharges = (params, options, signal) => {
|
|
11
|
-
return customInstance(
|
|
12
|
-
{ url: `/charges`, method: "GET", params, signal },
|
|
13
|
-
options
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
var getGetChargesQueryKey = (params) => {
|
|
17
|
-
return [`/charges`, ...params ? [params] : []];
|
|
18
|
-
};
|
|
19
|
-
var useGetChargesQueryOptions = (params, options) => {
|
|
20
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
21
|
-
const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
|
|
22
|
-
const queryFn = ({ signal }) => getCharges(params, requestOptions, signal);
|
|
23
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
24
|
-
return customOptions;
|
|
25
|
-
};
|
|
26
|
-
function useGetCharges(params, options, queryClient) {
|
|
27
|
-
const queryOptions = useGetChargesQueryOptions(params, options);
|
|
28
|
-
const query = useQuery(queryOptions, queryClient);
|
|
29
|
-
query.queryKey = queryOptions.queryKey;
|
|
30
|
-
return query;
|
|
31
|
-
}
|
|
32
|
-
var useGetChargesSuspenseQueryOptions = (params, options) => {
|
|
33
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
34
|
-
const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
|
|
35
|
-
const queryFn = ({ signal }) => getCharges(params, requestOptions, signal);
|
|
36
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
37
|
-
return customOptions;
|
|
38
|
-
};
|
|
39
|
-
function useGetChargesSuspense(params, options, queryClient) {
|
|
40
|
-
const queryOptions = useGetChargesSuspenseQueryOptions(params, options);
|
|
41
|
-
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
42
|
-
query.queryKey = queryOptions.queryKey;
|
|
43
|
-
return query;
|
|
44
|
-
}
|
|
45
|
-
var getOrganisationCharges = (orgId, params, options, signal) => {
|
|
46
|
-
return customInstance(
|
|
47
|
-
{ url: `/charges/organisation/${orgId}`, method: "GET", params, signal },
|
|
48
|
-
options
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
var getGetOrganisationChargesQueryKey = (orgId, params) => {
|
|
52
|
-
return [`/charges/organisation/${orgId}`, ...params ? [params] : []];
|
|
53
|
-
};
|
|
54
|
-
var useGetOrganisationChargesQueryOptions = (orgId, params, options) => {
|
|
55
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
56
|
-
const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);
|
|
57
|
-
const queryFn = ({ signal }) => getOrganisationCharges(orgId, params, requestOptions, signal);
|
|
58
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
59
|
-
return customOptions;
|
|
60
|
-
};
|
|
61
|
-
function useGetOrganisationCharges(orgId, params, options, queryClient) {
|
|
62
|
-
const queryOptions = useGetOrganisationChargesQueryOptions(orgId, params, options);
|
|
63
|
-
const query = useQuery(queryOptions, queryClient);
|
|
64
|
-
query.queryKey = queryOptions.queryKey;
|
|
65
|
-
return query;
|
|
66
|
-
}
|
|
67
|
-
var useGetOrganisationChargesSuspenseQueryOptions = (orgId, params, options) => {
|
|
68
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
69
|
-
const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);
|
|
70
|
-
const queryFn = ({ signal }) => getOrganisationCharges(orgId, params, requestOptions, signal);
|
|
71
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
72
|
-
return customOptions;
|
|
73
|
-
};
|
|
74
|
-
function useGetOrganisationChargesSuspense(orgId, params, options, queryClient) {
|
|
75
|
-
const queryOptions = useGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);
|
|
76
|
-
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
77
|
-
query.queryKey = queryOptions.queryKey;
|
|
78
|
-
return query;
|
|
79
|
-
}
|
|
80
|
-
var getProductCharges = (productId, params, options, signal) => {
|
|
81
|
-
return customInstance(
|
|
82
|
-
{ url: `/charges/product/${productId}`, method: "GET", params, signal },
|
|
83
|
-
options
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
var getGetProductChargesQueryKey = (productId, params) => {
|
|
87
|
-
return [`/charges/product/${productId}`, ...params ? [params] : []];
|
|
88
|
-
};
|
|
89
|
-
var useGetProductChargesQueryOptions = (productId, params, options) => {
|
|
90
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
91
|
-
const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);
|
|
92
|
-
const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
|
|
93
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
94
|
-
return customOptions;
|
|
95
|
-
};
|
|
96
|
-
function useGetProductCharges(productId, params, options, queryClient) {
|
|
97
|
-
const queryOptions = useGetProductChargesQueryOptions(productId, params, options);
|
|
98
|
-
const query = useQuery(queryOptions, queryClient);
|
|
99
|
-
query.queryKey = queryOptions.queryKey;
|
|
100
|
-
return query;
|
|
101
|
-
}
|
|
102
|
-
var useGetProductChargesSuspenseQueryOptions = (productId, params, options) => {
|
|
103
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
104
|
-
const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);
|
|
105
|
-
const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
|
|
106
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
107
|
-
return customOptions;
|
|
108
|
-
};
|
|
109
|
-
function useGetProductChargesSuspense(productId, params, options, queryClient) {
|
|
110
|
-
const queryOptions = useGetProductChargesSuspenseQueryOptions(productId, params, options);
|
|
111
|
-
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
112
|
-
query.queryKey = queryOptions.queryKey;
|
|
113
|
-
return query;
|
|
114
|
-
}
|
|
115
|
-
var getUnitCharges = (unitId, params, options, signal) => {
|
|
116
|
-
return customInstance(
|
|
117
|
-
{ url: `/charges/unit/${unitId}`, method: "GET", params, signal },
|
|
118
|
-
options
|
|
119
|
-
);
|
|
120
|
-
};
|
|
121
|
-
var getGetUnitChargesQueryKey = (unitId, params) => {
|
|
122
|
-
return [`/charges/unit/${unitId}`, ...params ? [params] : []];
|
|
123
|
-
};
|
|
124
|
-
var useGetUnitChargesQueryOptions = (unitId, params, options) => {
|
|
125
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
126
|
-
const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);
|
|
127
|
-
const queryFn = ({ signal }) => getUnitCharges(unitId, params, requestOptions, signal);
|
|
128
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
129
|
-
return customOptions;
|
|
130
|
-
};
|
|
131
|
-
function useGetUnitCharges(unitId, params, options, queryClient) {
|
|
132
|
-
const queryOptions = useGetUnitChargesQueryOptions(unitId, params, options);
|
|
133
|
-
const query = useQuery(queryOptions, queryClient);
|
|
134
|
-
query.queryKey = queryOptions.queryKey;
|
|
135
|
-
return query;
|
|
136
|
-
}
|
|
137
|
-
var useGetUnitChargesSuspenseQueryOptions = (unitId, params, options) => {
|
|
138
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
139
|
-
const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);
|
|
140
|
-
const queryFn = ({ signal }) => getUnitCharges(unitId, params, requestOptions, signal);
|
|
141
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
142
|
-
return customOptions;
|
|
143
|
-
};
|
|
144
|
-
function useGetUnitChargesSuspense(unitId, params, options, queryClient) {
|
|
145
|
-
const queryOptions = useGetUnitChargesSuspenseQueryOptions(unitId, params, options);
|
|
146
|
-
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
147
|
-
query.queryKey = queryOptions.queryKey;
|
|
148
|
-
return query;
|
|
149
|
-
}
|
|
150
|
-
export {
|
|
151
|
-
getCharges,
|
|
152
|
-
getGetChargesQueryKey,
|
|
153
|
-
getGetOrganisationChargesQueryKey,
|
|
154
|
-
getGetProductChargesQueryKey,
|
|
155
|
-
getGetUnitChargesQueryKey,
|
|
156
|
-
getOrganisationCharges,
|
|
157
|
-
getProductCharges,
|
|
158
|
-
getUnitCharges,
|
|
159
|
-
useGetCharges,
|
|
160
|
-
useGetChargesQueryOptions,
|
|
161
|
-
useGetChargesSuspense,
|
|
162
|
-
useGetChargesSuspenseQueryOptions,
|
|
163
|
-
useGetOrganisationCharges,
|
|
164
|
-
useGetOrganisationChargesQueryOptions,
|
|
165
|
-
useGetOrganisationChargesSuspense,
|
|
166
|
-
useGetOrganisationChargesSuspenseQueryOptions,
|
|
167
|
-
useGetProductCharges,
|
|
168
|
-
useGetProductChargesQueryOptions,
|
|
169
|
-
useGetProductChargesSuspense,
|
|
170
|
-
useGetProductChargesSuspenseQueryOptions,
|
|
171
|
-
useGetUnitCharges,
|
|
172
|
-
useGetUnitChargesQueryOptions,
|
|
173
|
-
useGetUnitChargesSuspense,
|
|
174
|
-
useGetUnitChargesSuspenseQueryOptions
|
|
175
|
-
};
|
|
176
|
-
//# sourceMappingURL=charges.js.map
|
package/charges/charges.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/charges/charges.ts"],"sourcesContent":["/**\n * Generated by orval v7.10.0 🍺\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 **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.3\n */\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n ChargesGetResponse,\n GetChargesParams,\n GetOrganisationChargesParams,\n GetProductChargesParams,\n GetUnitChargesParams,\n OrganisationChargesGetResponse,\n ProductChargesGetResponse,\n UnitChargesGetResponse,\n} from \"../account-server-api.schemas\";\n\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././options-mutator\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets global Charges.\n\nYou need admin rights to use this path.\n\n * @summary Gets charges for all Organisations\n */\nexport const getCharges = (\n params?: GetChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<ChargesGetResponse>(\n { url: `/charges`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetChargesQueryKey = (params?: GetChargesParams) => {\n return [`/charges`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>\n getCharges(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;\nexport type GetChargesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n Awaited<ReturnType<typeof getCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n Awaited<ReturnType<typeof getCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetCharges<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetChargesQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>\n getCharges(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;\nexport type GetChargesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetChargesParams,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Organisations\n */\n\nexport function useGetChargesSuspense<\n TData = Awaited<ReturnType<typeof getCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetChargesParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetChargesSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Gets a Organisation charges.\n\nThe Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint\n\n * @summary Gets charges for all Units in an Organisation\n */\nexport const getOrganisationCharges = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationChargesGetResponse>(\n { url: `/charges/organisation/${orgId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetOrganisationChargesQueryKey = (\n orgId: string,\n params?: GetOrganisationChargesParams,\n) => {\n return [`/charges/organisation/${orgId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetOrganisationChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>\n getOrganisationCharges(orgId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n>;\nexport type GetOrganisationChargesQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams,\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n Awaited<ReturnType<typeof getOrganisationCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationCharges<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationChargesQueryOptions(orgId, params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetOrganisationChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>\n getOrganisationCharges(orgId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationCharges>>\n>;\nexport type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params: undefined | GetOrganisationChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets charges for all Units in an Organisation\n */\n\nexport function useGetOrganisationChargesSuspense<\n TData = Awaited<ReturnType<typeof getOrganisationCharges>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n params?: GetOrganisationChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\n\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Product\n */\nexport const getProductCharges = (\n productId: string,\n params?: GetProductChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<ProductChargesGetResponse>(\n { url: `/charges/product/${productId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetProductChargesQueryKey = (\n productId: string,\n params?: GetProductChargesParams,\n) => {\n return [`/charges/product/${productId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetProductChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetProductChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesQueryError = ErrorType<AsError | void>;\n\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params: undefined | GetProductChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n Awaited<ReturnType<typeof getProductCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n Awaited<ReturnType<typeof getProductCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductCharges<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetProductChargesQueryOptions(productId, params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetProductChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>\n getProductCharges(productId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getProductCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetProductChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProductCharges>>\n>;\nexport type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params: undefined | GetProductChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Product\n */\n\nexport function useGetProductChargesSuspense<\n TData = Awaited<ReturnType<typeof getProductCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n productId: string,\n params?: GetProductChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetProductChargesSuspenseQueryOptions(productId, params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<UnitChargesGetResponse>(\n { url: `/charges/unit/${unitId}`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetUnitChargesQueryKey = (unitId: string, params?: GetUnitChargesParams) => {\n return [`/charges/unit/${unitId}`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetUnitChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>\n getUnitCharges(unitId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>;\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>;\n\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params: undefined | GetUnitChargesParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n Awaited<ReturnType<typeof getUnitCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n Awaited<ReturnType<typeof getUnitCharges>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitCharges<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUnitChargesQueryOptions(unitId, params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetUnitChargesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>\n getUnitCharges(unitId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetUnitChargesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnitCharges>>\n>;\nexport type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params: undefined | GetUnitChargesParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Get charges made against a Unit\n */\n\nexport function useGetUnitChargesSuspense<\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>,\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetUnitChargesSuspenseQueryOptions(unitId, params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":"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","names":[]}
|
package/charges/package.json
DELETED
package/chunk-3WKSNKHE.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// src/options-mutator.ts
|
|
2
|
-
import "@tanstack/react-query";
|
|
3
|
-
var queryMutator = ({
|
|
4
|
-
queryKey,
|
|
5
|
-
...queryOptions
|
|
6
|
-
}) => {
|
|
7
|
-
const newQueryKey = ["account-server-api", ...queryKey];
|
|
8
|
-
return { queryKey: newQueryKey, ...queryOptions };
|
|
9
|
-
};
|
|
10
|
-
var mutationMutator = ({
|
|
11
|
-
mutationKey,
|
|
12
|
-
...mutationOptions
|
|
13
|
-
}) => {
|
|
14
|
-
if (Array.isArray(mutationKey)) {
|
|
15
|
-
const newMutationKey = ["account-server-api", ...mutationKey];
|
|
16
|
-
return { mutationKey: newMutationKey, ...mutationOptions };
|
|
17
|
-
}
|
|
18
|
-
return { mutationKey: void 0, ...mutationOptions };
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
queryMutator,
|
|
23
|
-
mutationMutator
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=chunk-3WKSNKHE.js.map
|
package/chunk-3WKSNKHE.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/options-mutator.ts"],"sourcesContent":["import { type UseMutationOptions, type UseQueryOptions } from \"@tanstack/react-query\";\n\nexport const queryMutator = <TQueryFnData, TError, TData>({\n queryKey,\n ...queryOptions\n}: UseQueryOptions<TQueryFnData, TError, TData>): UseQueryOptions<TQueryFnData, TError, TData> => {\n const newQueryKey = [\"account-server-api\", ...queryKey];\n return { queryKey: newQueryKey, ...queryOptions };\n};\n\nexport const mutationMutator = <TData, TError, TVariables, TContext>({\n mutationKey,\n ...mutationOptions\n}: UseMutationOptions<TData, TError, TVariables, TContext>): UseMutationOptions<\n TData,\n TError,\n TVariables,\n TContext\n> => {\n if (Array.isArray(mutationKey)) {\n const newMutationKey = [\"account-server-api\", ...mutationKey];\n return { mutationKey: newMutationKey, ...mutationOptions };\n }\n return { mutationKey: undefined, ...mutationOptions };\n};\n\nexport default queryMutator;\n"],"mappings":";AAAA,OAA8D;AAEvD,IAAM,eAAe,CAA8B;AAAA,EACxD;AAAA,EACA,GAAG;AACL,MAAkG;AAChG,QAAM,cAAc,CAAC,sBAAsB,GAAG,QAAQ;AACtD,SAAO,EAAE,UAAU,aAAa,GAAG,aAAa;AAClD;AAEO,IAAM,kBAAkB,CAAsC;AAAA,EACnE;AAAA,EACA,GAAG;AACL,MAKK;AACH,MAAI,MAAM,QAAQ,WAAW,GAAG;AAC9B,UAAM,iBAAiB,CAAC,sBAAsB,GAAG,WAAW;AAC5D,WAAO,EAAE,aAAa,gBAAgB,GAAG,gBAAgB;AAAA,EAC3D;AACA,SAAO,EAAE,aAAa,QAAW,GAAG,gBAAgB;AACtD;","names":[]}
|
package/chunk-NY2VJJG7.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/options-mutator.ts
|
|
2
|
-
require('@tanstack/react-query');
|
|
3
|
-
var queryMutator = ({
|
|
4
|
-
queryKey,
|
|
5
|
-
...queryOptions
|
|
6
|
-
}) => {
|
|
7
|
-
const newQueryKey = ["account-server-api", ...queryKey];
|
|
8
|
-
return { queryKey: newQueryKey, ...queryOptions };
|
|
9
|
-
};
|
|
10
|
-
var mutationMutator = ({
|
|
11
|
-
mutationKey,
|
|
12
|
-
...mutationOptions
|
|
13
|
-
}) => {
|
|
14
|
-
if (Array.isArray(mutationKey)) {
|
|
15
|
-
const newMutationKey = ["account-server-api", ...mutationKey];
|
|
16
|
-
return { mutationKey: newMutationKey, ...mutationOptions };
|
|
17
|
-
}
|
|
18
|
-
return { mutationKey: void 0, ...mutationOptions };
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
exports.queryMutator = queryMutator; exports.mutationMutator = mutationMutator;
|
|
25
|
-
//# sourceMappingURL=chunk-NY2VJJG7.cjs.map
|
package/chunk-NY2VJJG7.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/chunk-NY2VJJG7.cjs","../src/options-mutator.ts"],"names":[],"mappings":"AAAA;ACAA,iCAA8D;AAEvD,IAAM,aAAA,EAAe,CAA8B;AAAA,EACxD,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAA,GAAkG;AAChG,EAAA,MAAM,YAAA,EAAc,CAAC,oBAAA,EAAsB,GAAG,QAAQ,CAAA;AACtD,EAAA,OAAO,EAAE,QAAA,EAAU,WAAA,EAAa,GAAG,aAAa,CAAA;AAClD,CAAA;AAEO,IAAM,gBAAA,EAAkB,CAAsC;AAAA,EACnE,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAA,GAKK;AACH,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,CAAQ,WAAW,CAAA,EAAG;AAC9B,IAAA,MAAM,eAAA,EAAiB,CAAC,oBAAA,EAAsB,GAAG,WAAW,CAAA;AAC5D,IAAA,OAAO,EAAE,WAAA,EAAa,cAAA,EAAgB,GAAG,gBAAgB,CAAA;AAAA,EAC3D;AACA,EAAA,OAAO,EAAE,WAAA,EAAa,KAAA,CAAA,EAAW,GAAG,gBAAgB,CAAA;AACtD,CAAA;ADLA;AACA;AACE;AACA;AACF,+EAAC","file":"/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/chunk-NY2VJJG7.cjs","sourcesContent":[null,"import { type UseMutationOptions, type UseQueryOptions } from \"@tanstack/react-query\";\n\nexport const queryMutator = <TQueryFnData, TError, TData>({\n queryKey,\n ...queryOptions\n}: UseQueryOptions<TQueryFnData, TError, TData>): UseQueryOptions<TQueryFnData, TError, TData> => {\n const newQueryKey = [\"account-server-api\", ...queryKey];\n return { queryKey: newQueryKey, ...queryOptions };\n};\n\nexport const mutationMutator = <TData, TError, TVariables, TContext>({\n mutationKey,\n ...mutationOptions\n}: UseMutationOptions<TData, TError, TVariables, TContext>): UseMutationOptions<\n TData,\n TError,\n TVariables,\n TContext\n> => {\n if (Array.isArray(mutationKey)) {\n const newMutationKey = [\"account-server-api\", ...mutationKey];\n return { mutationKey: newMutationKey, ...mutationOptions };\n }\n return { mutationKey: undefined, ...mutationOptions };\n};\n\nexport default queryMutator;\n"]}
|
package/chunk-RB2KVIEK.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/custom-instance.ts
|
|
2
|
-
var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
3
|
-
var AXIOS_INSTANCE = _axios2.default.create();
|
|
4
|
-
var setAuthToken = (token) => {
|
|
5
|
-
AXIOS_INSTANCE.defaults.headers.common["Authorization"] = `Bearer ${token}`;
|
|
6
|
-
};
|
|
7
|
-
var setBaseUrl = (baseUrl) => {
|
|
8
|
-
AXIOS_INSTANCE.defaults.baseURL = baseUrl;
|
|
9
|
-
};
|
|
10
|
-
var customInstance = (config, options) => {
|
|
11
|
-
const source = _axios2.default.CancelToken.source();
|
|
12
|
-
const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(
|
|
13
|
-
({ data }) => data
|
|
14
|
-
);
|
|
15
|
-
promise.cancel = () => {
|
|
16
|
-
source.cancel("Query was cancelled");
|
|
17
|
-
};
|
|
18
|
-
return promise;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
exports.AXIOS_INSTANCE = AXIOS_INSTANCE; exports.setAuthToken = setAuthToken; exports.setBaseUrl = setBaseUrl; exports.customInstance = customInstance;
|
|
27
|
-
//# sourceMappingURL=chunk-RB2KVIEK.cjs.map
|
package/chunk-RB2KVIEK.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/chunk-RB2KVIEK.cjs","../src/custom-instance.ts"],"names":[],"mappings":"AAAA;ACUA,4EAA2D;AAEpD,IAAM,eAAA,EAAiB,eAAA,CAAM,MAAA,CAAO,CAAA;AAOpC,IAAM,aAAA,EAAe,CAAC,KAAA,EAAA,GAAkB;AAC7C,EAAA,cAAA,CAAe,QAAA,CAAS,OAAA,CAAQ,MAAA,CAAO,eAAe,EAAA,EAAI,CAAA,OAAA,EAAU,KAAK,CAAA,CAAA;AAC3E;AAM+C;AACX,EAAA;AACpC;AAKuB;AACmB,EAAA;AAE6B,EAAA;AACrD,IAAA;AAChB,EAAA;AAGuB,EAAA;AACc,IAAA;AACrC,EAAA;AAEO,EAAA;AACT;AD5B4E;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/chunk-RB2KVIEK.cjs","sourcesContent":[null,"/** Based off the example custom-instance from Orval docs\n * https://github.com/anymaniax/orval/blob/master/samples/react-app-with-react-query/src/api/mutator/custom-instance.ts\n *\n * See https://react-query.tanstack.com/guides/query-cancellation\n *\n * TODO: Considering using Fetch-API instead of axios. This instance will have to change. Could be\n * achieved without changing much using `redaxios`\n * Or use 'ky'\n */\n\nimport Axios, { AxiosError, type AxiosRequestConfig } from \"axios\";\n\nexport const AXIOS_INSTANCE = Axios.create();\n\n/**\n * Set the access token to be added as the `Authorization: Bearer 'token'` header\n * Useful for client only apps where a proxy API route isn't involved to securely add the access token\n * @param token access token\n */\nexport const setAuthToken = (token: string) => {\n AXIOS_INSTANCE.defaults.headers.common[\"Authorization\"] = `Bearer ${token}`;\n};\n\n/**\n * Set the url to which request paths are added to.\n * @param baseUrl origin + subpath e.g. 'https://example.com/subpath' or '/subpath'\n */\nexport const setBaseUrl = (baseUrl: string) => {\n AXIOS_INSTANCE.defaults.baseURL = baseUrl;\n};\n\nexport const customInstance = <TReturn>(\n config: AxiosRequestConfig,\n options?: AxiosRequestConfig,\n): Promise<TReturn> => {\n const source = Axios.CancelToken.source();\n\n const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(\n ({ data }) => data,\n );\n\n // @ts-expect-error need to add a cancel method to the promise\n promise.cancel = () => {\n source.cancel(\"Query was cancelled\");\n };\n\n return promise;\n};\n\nexport type ErrorType<TError> = AxiosError<TError>;\n"]}
|
package/chunk-XYDLYMQ2.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// src/custom-instance.ts
|
|
2
|
-
import Axios from "axios";
|
|
3
|
-
var AXIOS_INSTANCE = Axios.create();
|
|
4
|
-
var setAuthToken = (token) => {
|
|
5
|
-
AXIOS_INSTANCE.defaults.headers.common["Authorization"] = `Bearer ${token}`;
|
|
6
|
-
};
|
|
7
|
-
var setBaseUrl = (baseUrl) => {
|
|
8
|
-
AXIOS_INSTANCE.defaults.baseURL = baseUrl;
|
|
9
|
-
};
|
|
10
|
-
var customInstance = (config, options) => {
|
|
11
|
-
const source = Axios.CancelToken.source();
|
|
12
|
-
const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(
|
|
13
|
-
({ data }) => data
|
|
14
|
-
);
|
|
15
|
-
promise.cancel = () => {
|
|
16
|
-
source.cancel("Query was cancelled");
|
|
17
|
-
};
|
|
18
|
-
return promise;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
AXIOS_INSTANCE,
|
|
23
|
-
setAuthToken,
|
|
24
|
-
setBaseUrl,
|
|
25
|
-
customInstance
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=chunk-XYDLYMQ2.js.map
|
package/chunk-XYDLYMQ2.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom-instance.ts"],"sourcesContent":["/** Based off the example custom-instance from Orval docs\n * https://github.com/anymaniax/orval/blob/master/samples/react-app-with-react-query/src/api/mutator/custom-instance.ts\n *\n * See https://react-query.tanstack.com/guides/query-cancellation\n *\n * TODO: Considering using Fetch-API instead of axios. This instance will have to change. Could be\n * achieved without changing much using `redaxios`\n * Or use 'ky'\n */\n\nimport Axios, { AxiosError, type AxiosRequestConfig } from \"axios\";\n\nexport const AXIOS_INSTANCE = Axios.create();\n\n/**\n * Set the access token to be added as the `Authorization: Bearer 'token'` header\n * Useful for client only apps where a proxy API route isn't involved to securely add the access token\n * @param token access token\n */\nexport const setAuthToken = (token: string) => {\n AXIOS_INSTANCE.defaults.headers.common[\"Authorization\"] = `Bearer ${token}`;\n};\n\n/**\n * Set the url to which request paths are added to.\n * @param baseUrl origin + subpath e.g. 'https://example.com/subpath' or '/subpath'\n */\nexport const setBaseUrl = (baseUrl: string) => {\n AXIOS_INSTANCE.defaults.baseURL = baseUrl;\n};\n\nexport const customInstance = <TReturn>(\n config: AxiosRequestConfig,\n options?: AxiosRequestConfig,\n): Promise<TReturn> => {\n const source = Axios.CancelToken.source();\n\n const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(\n ({ data }) => data,\n );\n\n // @ts-expect-error need to add a cancel method to the promise\n promise.cancel = () => {\n source.cancel(\"Query was cancelled\");\n };\n\n return promise;\n};\n\nexport type ErrorType<TError> = AxiosError<TError>;\n"],"mappings":";AAUA,OAAO,WAAoD;AAEpD,IAAM,iBAAiB,MAAM,OAAO;AAOpC,IAAM,eAAe,CAAC,UAAkB;AAC7C,iBAAe,SAAS,QAAQ,OAAO,eAAe,IAAI,UAAU,KAAK;AAC3E;AAMO,IAAM,aAAa,CAAC,YAAoB;AAC7C,iBAAe,SAAS,UAAU;AACpC;AAEO,IAAM,iBAAiB,CAC5B,QACA,YACqB;AACrB,QAAM,SAAS,MAAM,YAAY,OAAO;AAExC,QAAM,UAAU,eAAe,EAAE,GAAG,QAAQ,GAAG,SAAS,aAAa,OAAO,MAAM,CAAC,EAAE;AAAA,IACnF,CAAC,EAAE,KAAK,MAAM;AAAA,EAChB;AAGA,UAAQ,SAAS,MAAM;AACrB,WAAO,OAAO,qBAAqB;AAAA,EACrC;AAEA,SAAO;AACT;","names":[]}
|