@squonk/data-manager-client 1.2.3-rc.2 → 1.2.4-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/accounting/accounting.cjs +31 -13
  2. package/accounting/accounting.cjs.map +1 -1
  3. package/accounting/accounting.d.cts +77 -0
  4. package/accounting/accounting.d.ts +10 -1
  5. package/accounting/accounting.js +29 -11
  6. package/accounting/accounting.js.map +1 -1
  7. package/admin/admin.cjs +67 -27
  8. package/admin/admin.cjs.map +1 -1
  9. package/admin/admin.d.cts +324 -0
  10. package/admin/admin.d.ts +55 -22
  11. package/admin/admin.js +57 -17
  12. package/admin/admin.js.map +1 -1
  13. package/application/application.cjs +23 -13
  14. package/application/application.cjs.map +1 -1
  15. package/application/application.d.cts +57 -0
  16. package/application/application.d.ts +7 -1
  17. package/application/application.js +22 -12
  18. package/application/application.js.map +1 -1
  19. package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
  20. package/chunk-J22A7LHX.cjs.map +1 -0
  21. package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
  22. package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
  23. package/configuration/configuration.cjs +13 -7
  24. package/configuration/configuration.cjs.map +1 -1
  25. package/configuration/configuration.d.cts +29 -0
  26. package/configuration/configuration.d.ts +4 -1
  27. package/configuration/configuration.js +13 -7
  28. package/configuration/configuration.js.map +1 -1
  29. package/{custom-instance-50c9dd5d.d.ts → custom-instance-a2110e78.d.ts} +825 -825
  30. package/dataset/dataset.cjs +71 -72
  31. package/dataset/dataset.cjs.map +1 -1
  32. package/dataset/dataset.d.cts +315 -0
  33. package/dataset/dataset.d.ts +46 -16
  34. package/dataset/dataset.js +62 -63
  35. package/dataset/dataset.js.map +1 -1
  36. package/exchange-rate/exchange-rate.cjs +43 -32
  37. package/exchange-rate/exchange-rate.cjs.map +1 -1
  38. package/exchange-rate/exchange-rate.d.cts +180 -0
  39. package/exchange-rate/exchange-rate.d.ts +25 -7
  40. package/exchange-rate/exchange-rate.js +38 -27
  41. package/exchange-rate/exchange-rate.js.map +1 -1
  42. package/file/file.cjs +38 -22
  43. package/file/file.cjs.map +1 -1
  44. package/file/file.d.cts +154 -0
  45. package/file/file.d.ts +25 -10
  46. package/file/file.js +34 -18
  47. package/file/file.js.map +1 -1
  48. package/index.cjs +10 -10
  49. package/index.cjs.map +1 -1
  50. package/index.d.cts +2 -0
  51. package/index.d.ts +1 -1
  52. package/index.js +9 -9
  53. package/index.js.map +1 -1
  54. package/instance/instance.cjs +47 -37
  55. package/instance/instance.cjs.map +1 -1
  56. package/instance/instance.d.cts +215 -0
  57. package/instance/instance.d.ts +33 -12
  58. package/instance/instance.js +41 -31
  59. package/instance/instance.js.map +1 -1
  60. package/job/job.cjs +36 -19
  61. package/job/job.cjs.map +1 -1
  62. package/job/job.d.cts +85 -0
  63. package/job/job.d.ts +10 -1
  64. package/job/job.js +34 -17
  65. package/job/job.js.map +1 -1
  66. package/metadata/metadata.cjs +23 -26
  67. package/metadata/metadata.cjs.map +1 -1
  68. package/metadata/metadata.d.cts +132 -0
  69. package/metadata/metadata.d.ts +19 -7
  70. package/metadata/metadata.js +20 -23
  71. package/metadata/metadata.js.map +1 -1
  72. package/package.json +12 -12
  73. package/project/project.cjs +70 -48
  74. package/project/project.cjs.map +1 -1
  75. package/project/project.d.cts +377 -0
  76. package/project/project.d.ts +61 -25
  77. package/project/project.js +59 -37
  78. package/project/project.js.map +1 -1
  79. package/src/accounting/accounting.ts +179 -194
  80. package/src/admin/admin.ts +590 -735
  81. package/src/application/application.ts +125 -141
  82. package/src/configuration/configuration.ts +72 -60
  83. package/src/data-manager-api.schemas.ts +940 -941
  84. package/src/dataset/dataset.ts +591 -770
  85. package/src/exchange-rate/exchange-rate.ts +362 -478
  86. package/src/file/file.ts +292 -357
  87. package/src/instance/instance.ts +427 -533
  88. package/src/job/job.ts +187 -198
  89. package/src/metadata/metadata.ts +247 -339
  90. package/src/project/project.ts +669 -860
  91. package/src/task/task.ts +181 -202
  92. package/src/type/type.ts +72 -68
  93. package/src/user/user.ts +248 -286
  94. package/task/task.cjs +31 -15
  95. package/task/task.cjs.map +1 -1
  96. package/task/task.d.cts +103 -0
  97. package/task/task.d.ts +10 -1
  98. package/task/task.js +29 -13
  99. package/task/task.js.map +1 -1
  100. package/type/type.cjs +13 -7
  101. package/type/type.cjs.map +1 -1
  102. package/type/type.d.cts +31 -0
  103. package/type/type.d.ts +4 -1
  104. package/type/type.js +13 -7
  105. package/type/type.js.map +1 -1
  106. package/user/user.cjs +39 -28
  107. package/user/user.cjs.map +1 -1
  108. package/user/user.d.cts +104 -0
  109. package/user/user.d.ts +16 -4
  110. package/user/user.js +36 -25
  111. package/user/user.js.map +1 -1
  112. package/chunk-UZTHSGDT.cjs.map +0 -1
package/user/user.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAkC/B,IAAM,WAAW,CACtB,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,OAAO;AAAA,IACtC;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,MAAM,CAAC,oBAAoB,OAAO;AAE9D,IAAM,0BAA0B,CAGrC,YAKG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB;AAE/D,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,gBAAgB,MAAM;AAErC,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,cAAc,CAGzB,YAG4D;AAC5D,QAAM,eAAe,wBAAwB,OAAO;AAEpD,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT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AAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,qCAAqC,CAGhD,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,KAAK,IAAI,SAAS,CAAC;AAE3B,WAAO,iBAAiB,MAAM,cAAc;AAAA,EAC9C;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,sBAAsB,CAGjC,YAQI;AACJ,QAAM,kBAAkB,mCAAmC,OAAO;AAElE,SAAO,YAAY,eAAe;AACpC;AAMO,IAAM,gBAAgB,CAC3B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,2BAA2B,CAAC,WACvC,CAAC,oBAAoB,iBAAiB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE5D,IAAM,+BAA+B,CAI1C,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,yBAAyB,MAAM;AAE1E,QAAM,UAAoE,CAAC;AAAA,IACzE;AAAA,EACF,MAAM,cAAc,QAAQ,gBAAgB,MAAM;AAElD,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,mBAAmB,CAI9B,QACA,YAQ2D;AAC3D,QAAM,eAAe,6BAA6B,QAAQ,OAAO;AAEjE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n UsersGetResponse,\n DmError,\n UserAccountGetResponse,\n GetUserAccountParams,\n UserAccountPatchBodyBody,\n UserApiLogGetResponse,\n GetUserApiLogParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a summary of all users that have accessed the Data Manager API and where the account is not `private`. Users can set their accounts to be private and therefore will not show up in methods like this\n\n * @summary Get information about all known Users\n */\nexport const getUsers = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUsersQueryKey = () => [\"data-manager-api\", `/user`] as const;\n\nexport const getGetUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getUsers>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUsersQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUsers>>> = ({\n signal,\n }) => getUsers(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUsers>>\n>;\nexport type GetUsersQueryError = ErrorType<void | DmError>;\n\nexport const useGetUsers = <\n TData = Awaited<ReturnType<typeof getUsers>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUsersQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n params?: GetUserAccountParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = (params?: GetUserAccountParams) =>\n [\"data-manager-api\", `/user/account`, ...(params ? [params] : [])] as const;\n\nexport const getGetUserAccountQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetUserAccountParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({\n signal,\n }) => getUserAccount(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUserAccountQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | DmError>;\n\nexport const useGetUserAccount = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetUserAccountParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUserAccountQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * @summary Patch your account\n */\nexport const patchUserAccount = (\n userAccountPatchBodyBody: UserAccountPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (userAccountPatchBodyBody.private !== undefined) {\n formData.append(\"private\", userAccountPatchBodyBody.private.toString());\n }\n if (userAccountPatchBodyBody.become_admin !== undefined) {\n formData.append(\n \"become_admin\",\n userAccountPatchBodyBody.become_admin.toString()\n );\n }\n if (userAccountPatchBodyBody.impersonate !== undefined) {\n formData.append(\"impersonate\", userAccountPatchBodyBody.impersonate);\n }\n if (userAccountPatchBodyBody.use_impersonation !== undefined) {\n formData.append(\n \"use_impersonation\",\n userAccountPatchBodyBody.use_impersonation.toString()\n );\n }\n\n return customInstance<void>(\n {\n url: `/user/account`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getPatchUserAccountMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchUserAccount>>,\n { data: UserAccountPatchBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return patchUserAccount(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchUserAccountMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchUserAccount>>\n>;\nexport type PatchUserAccountMutationBody = UserAccountPatchBodyBody;\nexport type PatchUserAccountMutationError = ErrorType<DmError>;\n\nexport const usePatchUserAccount = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchUserAccountMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns a summary of your API activity optionally filtered by date. The API log does not include the use of GET methods, and only contains records of potential state-changing calls made against the Data Manager using your account\n\n * @summary Get the API call log recorded against your account\n */\nexport const getUserApiLog = (\n params?: GetUserApiLogParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UserApiLogGetResponse>(\n { url: `/user/api-log`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetUserApiLogQueryKey = (params?: GetUserApiLogParams) =>\n [\"data-manager-api\", `/user/api-log`, ...(params ? [params] : [])] as const;\n\nexport const getGetUserApiLogQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserApiLog>>,\n TError = ErrorType<void>\n>(\n params?: GetUserApiLogParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserApiLog>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserApiLogQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiLog>>> = ({\n signal,\n }) => getUserApiLog(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUserApiLogQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserApiLog>>\n>;\nexport type GetUserApiLogQueryError = ErrorType<void>;\n\nexport const useGetUserApiLog = <\n TData = Awaited<ReturnType<typeof getUserApiLog>>,\n TError = ErrorType<void>\n>(\n params?: GetUserApiLogParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserApiLog>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUserApiLogQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
1
+ {"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAoCA,IAAM,WAAW,CAEvB,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MAAO;AAAA,IAChC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,MAAM;AAErC,SAAO,CAAC,oBAAoB,OAAO;AACnC;AAGG,IAAM,0BAA0B,CAAoF,YACtH;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,oBAAoB;AAI9D,QAAM,UAA+D,CAAC,EAAE,OAAO,MAAM,SAAS,gBAAgB,MAAM;AAMrH,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,cAAc,CACzB,YAE8D;AAE9D,QAAM,eAAe,wBAAwB,OAAO;AAEpD,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAOO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\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetUserAccountParams,\n GetUserApiLogParams,\n UserAccountDetail,\n UserAccountPatchBodyBody,\n UserApiLogGetResponse,\n UsersGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n\n/**\n * Returns a summary of all users that have accessed the Data Manager API and where the account is not `private`. Users can set their accounts to be private and therefore will not show up in methods like this\n\n * @summary Get information about all known Users\n */\nexport const getUsers = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UsersGetResponse>(\n {url: `/user`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetUsersQueryKey = () => {\n \n return [\"data-manager-api\", `/user`] as const;\n }\n\n \nexport const getGetUsersQueryOptions = <TData = Awaited<ReturnType<typeof getUsers>>, TError = ErrorType<void | DmError>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUsersQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUsers>>> = ({ signal }) => getUsers(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>\nexport type GetUsersQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get information about all known Users\n */\nexport const useGetUsers = <TData = Awaited<ReturnType<typeof getUsers>>, TError = ErrorType<void | DmError>>(\n options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUsersQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n params?: GetUserAccountParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UserAccountDetail>(\n {url: `/user/account`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetUserAccountQueryKey = (params?: GetUserAccountParams,) => {\n \n return [\"data-manager-api\", `/user/account`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetUserAccountQueryOptions = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | DmError>>(params?: GetUserAccountParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get information about your account\n */\nexport const useGetUserAccount = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | DmError>>(\n params?: GetUserAccountParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUserAccountQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * @summary Patch your account\n */\nexport const patchUserAccount = (\n userAccountPatchBodyBody: UserAccountPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n const formData = new FormData();\nif(userAccountPatchBodyBody.private !== undefined) {\n formData.append('private', userAccountPatchBodyBody.private.toString())\n }\nif(userAccountPatchBodyBody.become_admin !== undefined) {\n formData.append('become_admin', userAccountPatchBodyBody.become_admin.toString())\n }\nif(userAccountPatchBodyBody.impersonate !== undefined) {\n formData.append('impersonate', userAccountPatchBodyBody.impersonate)\n }\nif(userAccountPatchBodyBody.use_impersonation !== undefined) {\n formData.append('use_impersonation', userAccountPatchBodyBody.use_impersonation.toString())\n }\n\n return customInstance<void>(\n {url: `/user/account`, method: 'patch',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\nexport const getPatchUserAccountMutationOptions = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchUserAccount>>, {data: UserAccountPatchBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return patchUserAccount(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchUserAccountMutationResult = NonNullable<Awaited<ReturnType<typeof patchUserAccount>>>\n export type PatchUserAccountMutationBody = UserAccountPatchBodyBody\n export type PatchUserAccountMutationError = ErrorType<DmError>\n\n /**\n * @summary Patch your account\n */\nexport const usePatchUserAccount = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchUserAccountMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Returns a summary of your API activity optionally filtered by date. The API log does not include the use of GET methods, and only contains records of potential state-changing calls made against the Data Manager using your account\n\n * @summary Get the API call log recorded against your account\n */\nexport const getUserApiLog = (\n params?: GetUserApiLogParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UserApiLogGetResponse>(\n {url: `/user/api-log`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetUserApiLogQueryKey = (params?: GetUserApiLogParams,) => {\n \n return [\"data-manager-api\", `/user/api-log`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetUserApiLogQueryOptions = <TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(params?: GetUserApiLogParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserApiLogQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiLog>>> = ({ signal }) => getUserApiLog(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>\nexport type GetUserApiLogQueryError = ErrorType<void>\n\n/**\n * @summary Get the API call log recorded against your account\n */\nexport const useGetUserApiLog = <TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(\n params?: GetUserApiLogParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUserApiLogQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"]}
@@ -0,0 +1,104 @@
1
+ import * as _tanstack_react_query from '@tanstack/react-query';
2
+ import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
3
+ import { bX as customInstance, b8 as UsersGetResponse, bY as ErrorType, bT as DmError, c as GetUserAccountParams, al as UserAccountDetail, a6 as UserAccountPatchBodyBody, G as GetUserApiLogParams, b9 as UserApiLogGetResponse } from '../custom-instance-a2110e78.js';
4
+ import 'axios';
5
+
6
+ type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
7
+ /**
8
+ * Returns a summary of all users that have accessed the Data Manager API and where the account is not `private`. Users can set their accounts to be private and therefore will not show up in methods like this
9
+
10
+ * @summary Get information about all known Users
11
+ */
12
+ declare const getUsers: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UsersGetResponse>;
13
+ declare const getGetUsersQueryKey: () => readonly ["data-manager-api", "/user"];
14
+ declare const getGetUsersQueryOptions: <TData = UsersGetResponse, TError = ErrorType<void | DmError>>(options?: {
15
+ query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
16
+ request?: SecondParameter<typeof customInstance>;
17
+ } | undefined) => UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> & {
18
+ queryKey: QueryKey;
19
+ };
20
+ type GetUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>;
21
+ type GetUsersQueryError = ErrorType<void | DmError>;
22
+ /**
23
+ * @summary Get information about all known Users
24
+ */
25
+ declare const useGetUsers: <TData = UsersGetResponse, TError = ErrorType<void | DmError>>(options?: {
26
+ query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
27
+ request?: SecondParameter<typeof customInstance>;
28
+ } | undefined) => UseQueryResult<TData, TError> & {
29
+ queryKey: QueryKey;
30
+ };
31
+ /**
32
+ * @summary Get information about your account
33
+ */
34
+ declare const getUserAccount: (params?: GetUserAccountParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UserAccountDetail>;
35
+ declare const getGetUserAccountQueryKey: (params?: GetUserAccountParams) => readonly ["data-manager-api", "/user/account", ...GetUserAccountParams[]];
36
+ declare const getGetUserAccountQueryOptions: <TData = UserAccountDetail, TError = ErrorType<void | DmError>>(params?: GetUserAccountParams, options?: {
37
+ query?: UseQueryOptions<UserAccountDetail, TError, TData, QueryKey> | undefined;
38
+ request?: SecondParameter<typeof customInstance>;
39
+ } | undefined) => UseQueryOptions<UserAccountDetail, TError, TData, QueryKey> & {
40
+ queryKey: QueryKey;
41
+ };
42
+ type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;
43
+ type GetUserAccountQueryError = ErrorType<void | DmError>;
44
+ /**
45
+ * @summary Get information about your account
46
+ */
47
+ declare const useGetUserAccount: <TData = UserAccountDetail, TError = ErrorType<void | DmError>>(params?: GetUserAccountParams, options?: {
48
+ query?: UseQueryOptions<UserAccountDetail, TError, TData, QueryKey> | undefined;
49
+ request?: SecondParameter<typeof customInstance>;
50
+ } | undefined) => UseQueryResult<TData, TError> & {
51
+ queryKey: QueryKey;
52
+ };
53
+ /**
54
+ * @summary Patch your account
55
+ */
56
+ declare const patchUserAccount: (userAccountPatchBodyBody: UserAccountPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
57
+ declare const getPatchUserAccountMutationOptions: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
58
+ mutation?: UseMutationOptions<void, TError, {
59
+ data: UserAccountPatchBodyBody;
60
+ }, TContext> | undefined;
61
+ request?: SecondParameter<typeof customInstance>;
62
+ } | undefined) => UseMutationOptions<void, TError, {
63
+ data: UserAccountPatchBodyBody;
64
+ }, TContext>;
65
+ type PatchUserAccountMutationResult = NonNullable<Awaited<ReturnType<typeof patchUserAccount>>>;
66
+ type PatchUserAccountMutationBody = UserAccountPatchBodyBody;
67
+ type PatchUserAccountMutationError = ErrorType<DmError>;
68
+ /**
69
+ * @summary Patch your account
70
+ */
71
+ declare const usePatchUserAccount: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
72
+ mutation?: UseMutationOptions<void, TError, {
73
+ data: UserAccountPatchBodyBody;
74
+ }, TContext> | undefined;
75
+ request?: SecondParameter<typeof customInstance>;
76
+ } | undefined) => _tanstack_react_query.UseMutationResult<void, TError, {
77
+ data: UserAccountPatchBodyBody;
78
+ }, TContext>;
79
+ /**
80
+ * Returns a summary of your API activity optionally filtered by date. The API log does not include the use of GET methods, and only contains records of potential state-changing calls made against the Data Manager using your account
81
+
82
+ * @summary Get the API call log recorded against your account
83
+ */
84
+ declare const getUserApiLog: (params?: GetUserApiLogParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UserApiLogGetResponse>;
85
+ declare const getGetUserApiLogQueryKey: (params?: GetUserApiLogParams) => readonly ["data-manager-api", "/user/api-log", ...GetUserApiLogParams[]];
86
+ declare const getGetUserApiLogQueryOptions: <TData = UserApiLogGetResponse, TError = ErrorType<void>>(params?: GetUserApiLogParams, options?: {
87
+ query?: UseQueryOptions<UserApiLogGetResponse, TError, TData, QueryKey> | undefined;
88
+ request?: SecondParameter<typeof customInstance>;
89
+ } | undefined) => UseQueryOptions<UserApiLogGetResponse, TError, TData, QueryKey> & {
90
+ queryKey: QueryKey;
91
+ };
92
+ type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>;
93
+ type GetUserApiLogQueryError = ErrorType<void>;
94
+ /**
95
+ * @summary Get the API call log recorded against your account
96
+ */
97
+ declare const useGetUserApiLog: <TData = UserApiLogGetResponse, TError = ErrorType<void>>(params?: GetUserApiLogParams, options?: {
98
+ query?: UseQueryOptions<UserApiLogGetResponse, TError, TData, QueryKey> | undefined;
99
+ request?: SecondParameter<typeof customInstance>;
100
+ } | undefined) => UseQueryResult<TData, TError> & {
101
+ queryKey: QueryKey;
102
+ };
103
+
104
+ export { GetUserAccountQueryError, GetUserAccountQueryResult, GetUserApiLogQueryError, GetUserApiLogQueryResult, GetUsersQueryError, GetUsersQueryResult, PatchUserAccountMutationBody, PatchUserAccountMutationError, PatchUserAccountMutationResult, getGetUserAccountQueryKey, getGetUserAccountQueryOptions, getGetUserApiLogQueryKey, getGetUserApiLogQueryOptions, getGetUsersQueryKey, getGetUsersQueryOptions, getPatchUserAccountMutationOptions, getUserAccount, getUserApiLog, getUsers, patchUserAccount, useGetUserAccount, useGetUserApiLog, useGetUsers, usePatchUserAccount };
package/user/user.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
3
- import { bX as customInstance, b8 as UsersGetResponse, bY as ErrorType, bT as DmError, c as GetUserAccountParams, al as UserAccountDetail, a6 as UserAccountPatchBodyBody, G as GetUserApiLogParams, b9 as UserApiLogGetResponse } from '../custom-instance-50c9dd5d.js';
3
+ import { bX as customInstance, b8 as UsersGetResponse, bY as ErrorType, bT as DmError, c as GetUserAccountParams, al as UserAccountDetail, a6 as UserAccountPatchBodyBody, G as GetUserApiLogParams, b9 as UserApiLogGetResponse } from '../custom-instance-a2110e78.js';
4
4
  import 'axios';
5
5
 
6
6
  type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
@@ -19,6 +19,9 @@ declare const getGetUsersQueryOptions: <TData = UsersGetResponse, TError = Error
19
19
  };
20
20
  type GetUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>;
21
21
  type GetUsersQueryError = ErrorType<void | DmError>;
22
+ /**
23
+ * @summary Get information about all known Users
24
+ */
22
25
  declare const useGetUsers: <TData = UsersGetResponse, TError = ErrorType<void | DmError>>(options?: {
23
26
  query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
24
27
  request?: SecondParameter<typeof customInstance>;
@@ -38,6 +41,9 @@ declare const getGetUserAccountQueryOptions: <TData = UserAccountDetail, TError
38
41
  };
39
42
  type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;
40
43
  type GetUserAccountQueryError = ErrorType<void | DmError>;
44
+ /**
45
+ * @summary Get information about your account
46
+ */
41
47
  declare const useGetUserAccount: <TData = UserAccountDetail, TError = ErrorType<void | DmError>>(params?: GetUserAccountParams, options?: {
42
48
  query?: UseQueryOptions<UserAccountDetail, TError, TData, QueryKey> | undefined;
43
49
  request?: SecondParameter<typeof customInstance>;
@@ -59,6 +65,9 @@ declare const getPatchUserAccountMutationOptions: <TError = ErrorType<DmError>,
59
65
  type PatchUserAccountMutationResult = NonNullable<Awaited<ReturnType<typeof patchUserAccount>>>;
60
66
  type PatchUserAccountMutationBody = UserAccountPatchBodyBody;
61
67
  type PatchUserAccountMutationError = ErrorType<DmError>;
68
+ /**
69
+ * @summary Patch your account
70
+ */
62
71
  declare const usePatchUserAccount: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
63
72
  mutation?: UseMutationOptions<void, TError, {
64
73
  data: UserAccountPatchBodyBody;
@@ -68,10 +77,10 @@ declare const usePatchUserAccount: <TError = ErrorType<DmError>, TContext = unkn
68
77
  data: UserAccountPatchBodyBody;
69
78
  }, TContext>;
70
79
  /**
71
- * Returns a summary of your API activity optionally filtered by date. The API log does not include the use of GET methods, and only contains records of potential state-changing calls made against the Data Manager using your account
80
+ * Returns a summary of your API activity optionally filtered by date. The API log does not include the use of GET methods, and only contains records of potential state-changing calls made against the Data Manager using your account
72
81
 
73
- * @summary Get the API call log recorded against your account
74
- */
82
+ * @summary Get the API call log recorded against your account
83
+ */
75
84
  declare const getUserApiLog: (params?: GetUserApiLogParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UserApiLogGetResponse>;
76
85
  declare const getGetUserApiLogQueryKey: (params?: GetUserApiLogParams) => readonly ["data-manager-api", "/user/api-log", ...GetUserApiLogParams[]];
77
86
  declare const getGetUserApiLogQueryOptions: <TData = UserApiLogGetResponse, TError = ErrorType<void>>(params?: GetUserApiLogParams, options?: {
@@ -82,6 +91,9 @@ declare const getGetUserApiLogQueryOptions: <TData = UserApiLogGetResponse, TErr
82
91
  };
83
92
  type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>;
84
93
  type GetUserApiLogQueryError = ErrorType<void>;
94
+ /**
95
+ * @summary Get the API call log recorded against your account
96
+ */
85
97
  declare const useGetUserApiLog: <TData = UserApiLogGetResponse, TError = ErrorType<void>>(params?: GetUserApiLogParams, options?: {
86
98
  query?: UseQueryOptions<UserApiLogGetResponse, TError, TData, QueryKey> | undefined;
87
99
  request?: SecondParameter<typeof customInstance>;
package/user/user.js CHANGED
@@ -1,22 +1,29 @@
1
1
  import {
2
2
  customInstance
3
- } from "../chunk-3RNIDX7T.js";
3
+ } from "../chunk-UKA7G3OB.js";
4
4
 
5
5
  // src/user/user.ts
6
- import { useQuery, useMutation } from "@tanstack/react-query";
6
+ import {
7
+ useMutation,
8
+ useQuery
9
+ } from "@tanstack/react-query";
7
10
  var getUsers = (options, signal) => {
8
11
  return customInstance(
9
- { url: `/user`, method: "get", signal },
12
+ {
13
+ url: `/user`,
14
+ method: "get",
15
+ signal
16
+ },
10
17
  options
11
18
  );
12
19
  };
13
- var getGetUsersQueryKey = () => ["data-manager-api", `/user`];
20
+ var getGetUsersQueryKey = () => {
21
+ return ["data-manager-api", `/user`];
22
+ };
14
23
  var getGetUsersQueryOptions = (options) => {
15
24
  const { query: queryOptions, request: requestOptions } = options ?? {};
16
25
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUsersQueryKey();
17
- const queryFn = ({
18
- signal
19
- }) => getUsers(requestOptions, signal);
26
+ const queryFn = ({ signal }) => getUsers(requestOptions, signal);
20
27
  return { queryKey, queryFn, ...queryOptions };
21
28
  };
22
29
  var useGetUsers = (options) => {
@@ -27,17 +34,22 @@ var useGetUsers = (options) => {
27
34
  };
28
35
  var getUserAccount = (params, options, signal) => {
29
36
  return customInstance(
30
- { url: `/user/account`, method: "get", params, signal },
37
+ {
38
+ url: `/user/account`,
39
+ method: "get",
40
+ params,
41
+ signal
42
+ },
31
43
  options
32
44
  );
33
45
  };
34
- var getGetUserAccountQueryKey = (params) => ["data-manager-api", `/user/account`, ...params ? [params] : []];
46
+ var getGetUserAccountQueryKey = (params) => {
47
+ return ["data-manager-api", `/user/account`, ...params ? [params] : []];
48
+ };
35
49
  var getGetUserAccountQueryOptions = (params, options) => {
36
50
  const { query: queryOptions, request: requestOptions } = options ?? {};
37
51
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUserAccountQueryKey(params);
38
- const queryFn = ({
39
- signal
40
- }) => getUserAccount(params, requestOptions, signal);
52
+ const queryFn = ({ signal }) => getUserAccount(params, requestOptions, signal);
41
53
  return { queryKey, queryFn, ...queryOptions };
42
54
  };
43
55
  var useGetUserAccount = (params, options) => {
@@ -52,19 +64,13 @@ var patchUserAccount = (userAccountPatchBodyBody, options) => {
52
64
  formData.append("private", userAccountPatchBodyBody.private.toString());
53
65
  }
54
66
  if (userAccountPatchBodyBody.become_admin !== void 0) {
55
- formData.append(
56
- "become_admin",
57
- userAccountPatchBodyBody.become_admin.toString()
58
- );
67
+ formData.append("become_admin", userAccountPatchBodyBody.become_admin.toString());
59
68
  }
60
69
  if (userAccountPatchBodyBody.impersonate !== void 0) {
61
70
  formData.append("impersonate", userAccountPatchBodyBody.impersonate);
62
71
  }
63
72
  if (userAccountPatchBodyBody.use_impersonation !== void 0) {
64
- formData.append(
65
- "use_impersonation",
66
- userAccountPatchBodyBody.use_impersonation.toString()
67
- );
73
+ formData.append("use_impersonation", userAccountPatchBodyBody.use_impersonation.toString());
68
74
  }
69
75
  return customInstance(
70
76
  {
@@ -90,17 +96,22 @@ var usePatchUserAccount = (options) => {
90
96
  };
91
97
  var getUserApiLog = (params, options, signal) => {
92
98
  return customInstance(
93
- { url: `/user/api-log`, method: "get", params, signal },
99
+ {
100
+ url: `/user/api-log`,
101
+ method: "get",
102
+ params,
103
+ signal
104
+ },
94
105
  options
95
106
  );
96
107
  };
97
- var getGetUserApiLogQueryKey = (params) => ["data-manager-api", `/user/api-log`, ...params ? [params] : []];
108
+ var getGetUserApiLogQueryKey = (params) => {
109
+ return ["data-manager-api", `/user/api-log`, ...params ? [params] : []];
110
+ };
98
111
  var getGetUserApiLogQueryOptions = (params, options) => {
99
112
  const { query: queryOptions, request: requestOptions } = options ?? {};
100
113
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetUserApiLogQueryKey(params);
101
- const queryFn = ({
102
- signal
103
- }) => getUserApiLog(params, requestOptions, signal);
114
+ const queryFn = ({ signal }) => getUserApiLog(params, requestOptions, signal);
104
115
  return { queryKey, queryFn, ...queryOptions };
105
116
  };
106
117
  var useGetUserApiLog = (params, options) => {
package/user/user.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n UsersGetResponse,\n DmError,\n UserAccountGetResponse,\n GetUserAccountParams,\n UserAccountPatchBodyBody,\n UserApiLogGetResponse,\n GetUserApiLogParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a summary of all users that have accessed the Data Manager API and where the account is not `private`. Users can set their accounts to be private and therefore will not show up in methods like this\n\n * @summary Get information about all known Users\n */\nexport const getUsers = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUsersQueryKey = () => [\"data-manager-api\", `/user`] as const;\n\nexport const getGetUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getUsers>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUsersQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUsers>>> = ({\n signal,\n }) => getUsers(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUsers>>\n>;\nexport type GetUsersQueryError = ErrorType<void | DmError>;\n\nexport const useGetUsers = <\n TData = Awaited<ReturnType<typeof getUsers>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUsersQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n params?: GetUserAccountParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = (params?: GetUserAccountParams) =>\n [\"data-manager-api\", `/user/account`, ...(params ? [params] : [])] as const;\n\nexport const getGetUserAccountQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetUserAccountParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({\n signal,\n }) => getUserAccount(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUserAccountQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | DmError>;\n\nexport const useGetUserAccount = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetUserAccountParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUserAccountQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * @summary Patch your account\n */\nexport const patchUserAccount = (\n userAccountPatchBodyBody: UserAccountPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (userAccountPatchBodyBody.private !== undefined) {\n formData.append(\"private\", userAccountPatchBodyBody.private.toString());\n }\n if (userAccountPatchBodyBody.become_admin !== undefined) {\n formData.append(\n \"become_admin\",\n userAccountPatchBodyBody.become_admin.toString()\n );\n }\n if (userAccountPatchBodyBody.impersonate !== undefined) {\n formData.append(\"impersonate\", userAccountPatchBodyBody.impersonate);\n }\n if (userAccountPatchBodyBody.use_impersonation !== undefined) {\n formData.append(\n \"use_impersonation\",\n userAccountPatchBodyBody.use_impersonation.toString()\n );\n }\n\n return customInstance<void>(\n {\n url: `/user/account`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getPatchUserAccountMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchUserAccount>>,\n { data: UserAccountPatchBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return patchUserAccount(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchUserAccountMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchUserAccount>>\n>;\nexport type PatchUserAccountMutationBody = UserAccountPatchBodyBody;\nexport type PatchUserAccountMutationError = ErrorType<DmError>;\n\nexport const usePatchUserAccount = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchUserAccountMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns a summary of your API activity optionally filtered by date. The API log does not include the use of GET methods, and only contains records of potential state-changing calls made against the Data Manager using your account\n\n * @summary Get the API call log recorded against your account\n */\nexport const getUserApiLog = (\n params?: GetUserApiLogParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UserApiLogGetResponse>(\n { url: `/user/api-log`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetUserApiLogQueryKey = (params?: GetUserApiLogParams) =>\n [\"data-manager-api\", `/user/api-log`, ...(params ? [params] : [])] as const;\n\nexport const getGetUserApiLogQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserApiLog>>,\n TError = ErrorType<void>\n>(\n params?: GetUserApiLogParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserApiLog>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserApiLogQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiLog>>> = ({\n signal,\n }) => getUserApiLog(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUserApiLogQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserApiLog>>\n>;\nexport type GetUserApiLogQueryError = ErrorType<void>;\n\nexport const useGetUserApiLog = <\n TData = Awaited<ReturnType<typeof getUserApiLog>>,\n TError = ErrorType<void>\n>(\n params?: GetUserApiLogParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserApiLog>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUserApiLogQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAkC/B,IAAM,WAAW,CACtB,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,OAAO;AAAA,IACtC;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,MAAM,CAAC,oBAAoB,OAAO;AAE9D,IAAM,0BAA0B,CAGrC,YAKG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB;AAE/D,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,gBAAgB,MAAM;AAErC,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,cAAc,CAGzB,YAG4D;AAC5D,QAAM,eAAe,wBAAwB,OAAO;AAEpD,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAKO,IAAM,iBAAiB,CAC5B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ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AGhD,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,KAAK,IAAI,SAAS,CAAC;AAE3B,WAAO,iBAAiB,MAAM,cAAc;AAAA,EAC9C;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,sBAAsB,CAGjC,YAQI;AACJ,QAAM,kBAAkB,mCAAmC,OAAO;AAElE,SAAO,YAAY,eAAe;AACpC;AAMO,IAAM,gBAAgB,CAC3B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,2BAA2B,CAAC,WACvC,CAAC,oBAAoB,iBAAiB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE5D,IAAM,+BAA+B,CAI1C,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,yBAAyB,MAAM;AAE1E,QAAM,UAAoE,CAAC;AAAA,IACzE;AAAA,EACF,MAAM,cAAc,QAAQ,gBAAgB,MAAM;AAElD,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,mBAAmB,CAI9B,QACA,YAQ2D;AAC3D,QAAM,eAAe,6BAA6B,QAAQ,OAAO;AAEjE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.20.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetUserAccountParams,\n GetUserApiLogParams,\n UserAccountDetail,\n UserAccountPatchBodyBody,\n UserApiLogGetResponse,\n UsersGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n\n/**\n * Returns a summary of all users that have accessed the Data Manager API and where the account is not `private`. Users can set their accounts to be private and therefore will not show up in methods like this\n\n * @summary Get information about all known Users\n */\nexport const getUsers = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UsersGetResponse>(\n {url: `/user`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetUsersQueryKey = () => {\n \n return [\"data-manager-api\", `/user`] as const;\n }\n\n \nexport const getGetUsersQueryOptions = <TData = Awaited<ReturnType<typeof getUsers>>, TError = ErrorType<void | DmError>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUsersQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUsers>>> = ({ signal }) => getUsers(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>\nexport type GetUsersQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get information about all known Users\n */\nexport const useGetUsers = <TData = Awaited<ReturnType<typeof getUsers>>, TError = ErrorType<void | DmError>>(\n options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUsersQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n params?: GetUserAccountParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UserAccountDetail>(\n {url: `/user/account`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetUserAccountQueryKey = (params?: GetUserAccountParams,) => {\n \n return [\"data-manager-api\", `/user/account`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetUserAccountQueryOptions = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | DmError>>(params?: GetUserAccountParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get information about your account\n */\nexport const useGetUserAccount = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | DmError>>(\n params?: GetUserAccountParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUserAccountQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * @summary Patch your account\n */\nexport const patchUserAccount = (\n userAccountPatchBodyBody: UserAccountPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n const formData = new FormData();\nif(userAccountPatchBodyBody.private !== undefined) {\n formData.append('private', userAccountPatchBodyBody.private.toString())\n }\nif(userAccountPatchBodyBody.become_admin !== undefined) {\n formData.append('become_admin', userAccountPatchBodyBody.become_admin.toString())\n }\nif(userAccountPatchBodyBody.impersonate !== undefined) {\n formData.append('impersonate', userAccountPatchBodyBody.impersonate)\n }\nif(userAccountPatchBodyBody.use_impersonation !== undefined) {\n formData.append('use_impersonation', userAccountPatchBodyBody.use_impersonation.toString())\n }\n\n return customInstance<void>(\n {url: `/user/account`, method: 'patch',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\nexport const getPatchUserAccountMutationOptions = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchUserAccount>>, {data: UserAccountPatchBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return patchUserAccount(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchUserAccountMutationResult = NonNullable<Awaited<ReturnType<typeof patchUserAccount>>>\n export type PatchUserAccountMutationBody = UserAccountPatchBodyBody\n export type PatchUserAccountMutationError = ErrorType<DmError>\n\n /**\n * @summary Patch your account\n */\nexport const usePatchUserAccount = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchUserAccountMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Returns a summary of your API activity optionally filtered by date. The API log does not include the use of GET methods, and only contains records of potential state-changing calls made against the Data Manager using your account\n\n * @summary Get the API call log recorded against your account\n */\nexport const getUserApiLog = (\n params?: GetUserApiLogParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UserApiLogGetResponse>(\n {url: `/user/api-log`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetUserApiLogQueryKey = (params?: GetUserApiLogParams,) => {\n \n return [\"data-manager-api\", `/user/api-log`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetUserApiLogQueryOptions = <TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(params?: GetUserApiLogParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserApiLogQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiLog>>> = ({ signal }) => getUserApiLog(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>\nexport type GetUserApiLogQueryError = ErrorType<void>\n\n/**\n * @summary Get the API call log recorded against your account\n */\nexport const useGetUserApiLog = <TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(\n params?: GetUserApiLogParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUserApiLogQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAoCA,IAAM,WAAW,CAEvB,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MAAO;AAAA,IAChC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,MAAM;AAErC,SAAO,CAAC,oBAAoB,OAAO;AACnC;AAGG,IAAM,0BAA0B,CAAoF,YACtH;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,oBAAoB;AAI9D,QAAM,UAA+D,CAAC,EAAE,OAAO,MAAM,SAAS,gBAAgB,MAAM;AAMrH,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,cAAc,CACzB,YAE8D;AAE9D,QAAM,eAAe,wBAAwB,OAAO;AAEpD,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAOO,IAAM,iBAAiB,CAC1B,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAiB,QAAQ;AAAA,MAC7B;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;A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UAAU;AACtE;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;AAIA,EAAC,QAAgB,SAAS,MAAM;AAC9B,WAAO,OAAO,oCAAoC;AAAA,EACpD;AAEA,SAAO;AACT","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, 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 // Promise doesn't have a cancel method but react-query requires this method to make cancellations general.\n // This can either be a any assertion or a @ts-ignore comment.\n (promise as any).cancel = () => {\n source.cancel('Query was cancelled by React Query');\n };\n\n return promise;\n};\n\nexport type ErrorType<TError> = AxiosError<TError>;\n"]}