@squonk/data-manager-client 1.1.0 → 1.1.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 (96) hide show
  1. package/accounting/accounting.cjs +16 -12
  2. package/accounting/accounting.cjs.map +1 -1
  3. package/accounting/accounting.d.ts +8 -8
  4. package/accounting/accounting.js +13 -9
  5. package/accounting/accounting.js.map +1 -1
  6. package/admin/admin.cjs +19 -14
  7. package/admin/admin.cjs.map +1 -1
  8. package/admin/admin.d.ts +23 -23
  9. package/admin/admin.js +10 -5
  10. package/admin/admin.js.map +1 -1
  11. package/application/application.cjs +12 -10
  12. package/application/application.cjs.map +1 -1
  13. package/application/application.d.ts +6 -6
  14. package/application/application.js +10 -8
  15. package/application/application.js.map +1 -1
  16. package/{chunk-3O5KIRV4.js → chunk-3RNIDX7T.js} +1 -1
  17. package/{chunk-3O5KIRV4.js.map → chunk-3RNIDX7T.js.map} +1 -1
  18. package/chunk-LNYWU37B.cjs +13 -0
  19. package/chunk-LNYWU37B.cjs.map +1 -0
  20. package/chunk-LT4O36DN.js +13 -0
  21. package/chunk-LT4O36DN.js.map +1 -0
  22. package/{chunk-IUEU2LYC.cjs → chunk-UZTHSGDT.cjs} +1 -1
  23. package/chunk-UZTHSGDT.cjs.map +1 -0
  24. package/{custom-instance-5c7b6971.d.ts → custom-instance-b5dd9223.d.ts} +259 -98
  25. package/dataset/dataset.cjs +29 -32
  26. package/dataset/dataset.cjs.map +1 -1
  27. package/dataset/dataset.d.ts +24 -24
  28. package/dataset/dataset.js +19 -22
  29. package/dataset/dataset.js.map +1 -1
  30. package/exchange-rate/exchange-rate.cjs +22 -18
  31. package/exchange-rate/exchange-rate.cjs.map +1 -1
  32. package/exchange-rate/exchange-rate.d.ts +16 -16
  33. package/exchange-rate/exchange-rate.js +16 -12
  34. package/exchange-rate/exchange-rate.js.map +1 -1
  35. package/file/file.cjs +15 -15
  36. package/file/file.cjs.map +1 -1
  37. package/file/file.d.ts +13 -13
  38. package/file/file.js +10 -10
  39. package/file/file.js.map +1 -1
  40. package/index.cjs +2 -2
  41. package/index.cjs.map +1 -1
  42. package/index.d.ts +1 -1
  43. package/index.js +1 -1
  44. package/index.js.map +1 -1
  45. package/instance/instance.cjs +17 -15
  46. package/instance/instance.cjs.map +1 -1
  47. package/instance/instance.d.ts +18 -18
  48. package/instance/instance.js +10 -8
  49. package/instance/instance.js.map +1 -1
  50. package/job/job.cjs +16 -14
  51. package/job/job.cjs.map +1 -1
  52. package/job/job.d.ts +8 -8
  53. package/job/job.js +13 -11
  54. package/job/job.js.map +1 -1
  55. package/metadata/metadata.cjs +14 -15
  56. package/metadata/metadata.cjs.map +1 -1
  57. package/metadata/metadata.d.ts +12 -12
  58. package/metadata/metadata.js +10 -11
  59. package/metadata/metadata.js.map +1 -1
  60. package/package.json +12 -12
  61. package/project/project.cjs +28 -29
  62. package/project/project.cjs.map +1 -1
  63. package/project/project.d.ts +29 -29
  64. package/project/project.js +16 -17
  65. package/project/project.js.map +1 -1
  66. package/src/accounting/accounting.ts +14 -13
  67. package/src/admin/admin.ts +10 -9
  68. package/src/application/application.ts +10 -10
  69. package/src/data-manager-api.schemas.ts +206 -27
  70. package/src/dataset/dataset.ts +22 -24
  71. package/src/exchange-rate/exchange-rate.ts +18 -19
  72. package/src/file/file.ts +10 -10
  73. package/src/instance/instance.ts +10 -10
  74. package/src/job/job.ts +14 -13
  75. package/src/metadata/metadata.ts +10 -11
  76. package/src/project/project.ts +18 -19
  77. package/src/queryMutator.ts +12 -0
  78. package/src/task/task.ts +10 -9
  79. package/src/type/type.ts +6 -5
  80. package/src/user/user.ts +14 -13
  81. package/task/task.cjs +13 -12
  82. package/task/task.cjs.map +1 -1
  83. package/task/task.d.ts +8 -8
  84. package/task/task.js +10 -9
  85. package/task/task.js.map +1 -1
  86. package/type/type.cjs +8 -4
  87. package/type/type.cjs.map +1 -1
  88. package/type/type.d.ts +4 -4
  89. package/type/type.js +7 -3
  90. package/type/type.js.map +1 -1
  91. package/user/user.cjs +17 -13
  92. package/user/user.cjs.map +1 -1
  93. package/user/user.d.ts +11 -11
  94. package/user/user.js +13 -9
  95. package/user/user.js.map +1 -1
  96. package/chunk-IUEU2LYC.cjs.map +0 -1
package/task/task.js CHANGED
@@ -1,6 +1,9 @@
1
+ import {
2
+ queryMutator
3
+ } from "../chunk-LT4O36DN.js";
1
4
  import {
2
5
  customInstance
3
- } from "../chunk-3O5KIRV4.js";
6
+ } from "../chunk-3RNIDX7T.js";
4
7
 
5
8
  // src/task/task.ts
6
9
  import { useQuery, useMutation } from "@tanstack/react-query";
@@ -20,12 +23,11 @@ var useGetTasks = (params, options) => {
20
23
  const queryFn = ({
21
24
  signal
22
25
  }) => getTasks(params, requestOptions, signal);
26
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
23
27
  const query = useQuery(
24
- queryKey,
25
- queryFn,
26
- queryOptions
28
+ customOptions
27
29
  );
28
- query.queryKey = queryKey;
30
+ query.queryKey = customOptions.queryKey;
29
31
  return query;
30
32
  };
31
33
  var getTask = (taskId, params, options, signal) => {
@@ -44,12 +46,11 @@ var useGetTask = (taskId, params, options) => {
44
46
  const queryFn = ({
45
47
  signal
46
48
  }) => getTask(taskId, params, requestOptions, signal);
49
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
47
50
  const query = useQuery(
48
- queryKey,
49
- queryFn,
50
- { enabled: !!taskId, ...queryOptions }
51
+ customOptions
51
52
  );
52
- query.queryKey = queryKey;
53
+ query.queryKey = customOptions.queryKey;
53
54
  return query;
54
55
  };
55
56
  var deleteTask = (taskId, options) => {
package/task/task.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/task/task.ts"],"sourcesContent":["/**\n * Generated by orval v6.10.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.0\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 TasksGetResponse,\n DmError,\n GetTasksParams,\n TaskGetResponse,\n GetTaskParams,\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 list of tasks that you have access to. These will be Tasks that you **own**. Being an editor of the related object does not allow you to see its task.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TasksGetResponse>(\n { url: `/task`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTasksQueryKey = (params?: GetTasksParams) => [\n `/task`,\n ...(params ? [params] : []),\n];\n\nexport type GetTasksQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTasks>>\n>;\nexport type GetTasksQueryError = ErrorType<void | DmError>;\n\nexport const useGetTasks = <\n TData = Awaited<ReturnType<typeof getTasks>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetTasksParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getTasks>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({\n signal,\n }) => getTasks(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getTasks>>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you are its **owner**. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating datasets and launching applications.\n\nTasks contain of a list of `states` and `events`. A task will always have states but may not have events.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 100 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect a it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The dataset is available when the task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the task is `done` but you have a non-zero `exit_code`, the dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** tasks, where the task `purpose` is `INSTANCE`, you must wait until you find the `STARTED` state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TaskGetResponse>(\n { url: `/task/${taskId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTaskQueryKey = (taskId: string, params?: GetTaskParams) => [\n `/task/${taskId}`,\n ...(params ? [params] : []),\n];\n\nexport type GetTaskQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTask>>\n>;\nexport type GetTaskQueryError = ErrorType<void | DmError>;\n\nexport const useGetTask = <\n TData = Awaited<ReturnType<typeof getTask>>,\n TError = ErrorType<void | DmError>\n>(\n taskId: string,\n params?: GetTaskParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({\n signal,\n }) => getTask(taskId, params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getTask>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!taskId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an **owner** of the Task action to delete it. For example you must be the owner of the Dataset to delete **DATASET** tasks and an owner of the ProjectFile to delete **FILE** tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/task/${taskId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteTaskMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteTask>>\n>;\n\nexport type DeleteTaskMutationError = ErrorType<DmError>;\n\nexport const useDeleteTask = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteTask>>,\n { taskId: string }\n > = (props) => {\n const { taskId } = props ?? {};\n\n return deleteTask(taskId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAgC/B,IAAM,WAAW,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ACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;AAQO,IAAM,gBAAgB,CAG3B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/task/task.ts"],"sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\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.0\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 TasksGetResponse,\n DmError,\n GetTasksParams,\n TaskGetResponse,\n GetTaskParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\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 list of tasks that you have access to. These will be Tasks that you **own**. Being an editor of the related object does not allow you to see its task.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TasksGetResponse>(\n { url: `/task`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTasksQueryKey = (params?: GetTasksParams) => [\n `/task`,\n ...(params ? [params] : []),\n];\n\nexport type GetTasksQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTasks>>\n>;\nexport type GetTasksQueryError = ErrorType<void | DmError>;\n\nexport const useGetTasks = <\n TData = Awaited<ReturnType<typeof getTasks>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetTasksParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getTasks>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({\n signal,\n }) => getTasks(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getTasks>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you are its **owner**. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating datasets and launching applications.\n\nTasks contain of a list of `states` and `events`. A task will always have states but may not have events.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 100 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect a it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The dataset is available when the task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the task is `done` but you have a non-zero `exit_code`, the dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** tasks, where the task `purpose` is `INSTANCE`, you must wait until you find the `STARTED` state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TaskGetResponse>(\n { url: `/task/${taskId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTaskQueryKey = (taskId: string, params?: GetTaskParams) => [\n `/task/${taskId}`,\n ...(params ? [params] : []),\n];\n\nexport type GetTaskQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTask>>\n>;\nexport type GetTaskQueryError = ErrorType<void | DmError>;\n\nexport const useGetTask = <\n TData = Awaited<ReturnType<typeof getTask>>,\n TError = ErrorType<void | DmError>\n>(\n taskId: string,\n params?: GetTaskParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({\n signal,\n }) => getTask(taskId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getTask>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an **owner** of the Task action to delete it. For example you must be the owner of the Dataset to delete **DATASET** tasks and an owner of the ProjectFile to delete **FILE** tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/task/${taskId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteTaskMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteTask>>\n>;\n\nexport type DeleteTaskMutationError = ErrorType<DmError>;\n\nexport const useDeleteTask = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteTask>>,\n { taskId: string }\n > = (props) => {\n const { taskId } = props ?? {};\n\n return deleteTask(taskId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAiC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAA4B;AAAA,EAC9D;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ;AAAA,IACZ;AAAA,EACF;AAEA,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AAuBO,IAAM,UAAU,CACrB,QACA,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACxD;AAAA,EACF;AACF;AAEO,IAAM,qBAAqB,CAAC,QAAgB,WAA2B;AAAA,EAC5E,SAAS;AAAA,EACT,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,aAAa,CAIxB,QACA,QACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,mBAAmB,QAAQ,MAAM;AAE5E,QAAM,UAA8D,CAAC;AAAA,IACnE;AAAA,EACF,MAAM,QAAQ,QAAQ,QAAQ,gBAAgB,MAAM;AAEpD,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ;AAAA,IACZ;AAAA,EACF;AAEA,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AAWO,IAAM,aAAa,CACxB,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;AAQO,IAAM,gBAAgB,CAG3B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
package/type/type.cjs CHANGED
@@ -1,11 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkIUEU2LYCcjs = require('../chunk-IUEU2LYC.cjs');
3
+ var _chunkLNYWU37Bcjs = require('../chunk-LNYWU37B.cjs');
4
+
5
+
6
+ var _chunkUZTHSGDTcjs = require('../chunk-UZTHSGDT.cjs');
4
7
 
5
8
  // src/type/type.ts
6
9
  var _reactquery = require('@tanstack/react-query');
7
10
  var getFileTypes = (options, signal) => {
8
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
11
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
9
12
  { url: `/type`, method: "get", signal },
10
13
  options
11
14
  );
@@ -17,8 +20,9 @@ var useGetFileTypes = (options) => {
17
20
  const queryFn = ({
18
21
  signal
19
22
  }) => getFileTypes(requestOptions, signal);
20
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
21
- query.queryKey = queryKey;
23
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
24
+ const query = _reactquery.useQuery.call(void 0, customOptions);
25
+ query.queryKey = customOptions.queryKey;
22
26
  return query;
23
27
  };
24
28
 
package/type/type.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/type/type.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,gBAAgB;AAwBlB,IAAM,eAAe,CAC1B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,OAAO;AAAA,IACtC;AAAA,EACF;AACF;AAEO,IAAM,0BAA0B,MAAM,CAAC,OAAO;AAO9C,IAAM,kBAAkB,CAG7B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,wBAAwB;AAEnE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,EACF,MAAM,aAAa,gBAAgB,MAAM;AAEzC,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.10.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.0\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type { TypesGetResponse, DmError } 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 the supported Dataset and File (MIME) Types\n\n * @summary Get the supported File Types\n */\nexport const getFileTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TypesGetResponse>(\n { url: `/type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetFileTypesQueryKey = () => [`/type`];\n\nexport type GetFileTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFileTypes>>\n>;\nexport type GetFileTypesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFileTypes = <\n TData = Awaited<ReturnType<typeof getFileTypes>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFileTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFileTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFileTypes>>> = ({\n signal,\n }) => getFileTypes(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getFileTypes>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
1
+ {"version":3,"sources":["../../src/type/type.ts"],"names":[],"mappings":";;;;;;;;AAUA,SAAS,gBAAgB;AAyBlB,IAAM,eAAe,CAC1B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,OAAO;AAAA,IACtC;AAAA,EACF;AACF;AAEO,IAAM,0BAA0B,MAAM,CAAC,OAAO;AAO9C,IAAM,kBAAkB,CAG7B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,wBAAwB;AAEnE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,EACF,MAAM,aAAa,gBAAgB,MAAM;AAEzC,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\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.0\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type { TypesGetResponse, DmError } from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\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 the supported Dataset and File (MIME) Types\n\n * @summary Get the supported File Types\n */\nexport const getFileTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TypesGetResponse>(\n { url: `/type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetFileTypesQueryKey = () => [`/type`];\n\nexport type GetFileTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFileTypes>>\n>;\nexport type GetFileTypesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFileTypes = <\n TData = Awaited<ReturnType<typeof getFileTypes>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFileTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFileTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFileTypes>>> = ({\n signal,\n }) => getFileTypes(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getFileTypes>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"]}
package/type/type.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
2
- import { bI as customInstance, aZ as TypesGetResponse, bJ as ErrorType, bE as DmError } from '../custom-instance-5c7b6971.js';
2
+ import { bK as customInstance, a$ as TypesGetResponse, bL as ErrorType, bG as DmError } from '../custom-instance-b5dd9223.js';
3
3
  import 'axios';
4
4
 
5
- declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
5
+ type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
6
6
  /**
7
7
  * Returns the supported Dataset and File (MIME) Types
8
8
 
@@ -10,8 +10,8 @@ declare type SecondParameter<T extends (...args: any) => any> = T extends (confi
10
10
  */
11
11
  declare const getFileTypes: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<TypesGetResponse>;
12
12
  declare const getGetFileTypesQueryKey: () => string[];
13
- declare type GetFileTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getFileTypes>>>;
14
- declare type GetFileTypesQueryError = ErrorType<void | DmError>;
13
+ type GetFileTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getFileTypes>>>;
14
+ type GetFileTypesQueryError = ErrorType<void | DmError>;
15
15
  declare const useGetFileTypes: <TData = TypesGetResponse, TError = ErrorType<void | DmError>>(options?: {
16
16
  query?: UseQueryOptions<TypesGetResponse, TError, TData, QueryKey> | undefined;
17
17
  request?: SecondParameter<typeof customInstance>;
package/type/type.js CHANGED
@@ -1,6 +1,9 @@
1
+ import {
2
+ queryMutator
3
+ } from "../chunk-LT4O36DN.js";
1
4
  import {
2
5
  customInstance
3
- } from "../chunk-3O5KIRV4.js";
6
+ } from "../chunk-3RNIDX7T.js";
4
7
 
5
8
  // src/type/type.ts
6
9
  import { useQuery } from "@tanstack/react-query";
@@ -17,8 +20,9 @@ var useGetFileTypes = (options) => {
17
20
  const queryFn = ({
18
21
  signal
19
22
  }) => getFileTypes(requestOptions, signal);
20
- const query = useQuery(queryKey, queryFn, queryOptions);
21
- query.queryKey = queryKey;
23
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
24
+ const query = useQuery(customOptions);
25
+ query.queryKey = customOptions.queryKey;
22
26
  return query;
23
27
  };
24
28
  export {
package/type/type.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/type/type.ts"],"sourcesContent":["/**\n * Generated by orval v6.10.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.0\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type { TypesGetResponse, DmError } 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 the supported Dataset and File (MIME) Types\n\n * @summary Get the supported File Types\n */\nexport const getFileTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TypesGetResponse>(\n { url: `/type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetFileTypesQueryKey = () => [`/type`];\n\nexport type GetFileTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFileTypes>>\n>;\nexport type GetFileTypesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFileTypes = <\n TData = Awaited<ReturnType<typeof getFileTypes>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFileTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFileTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFileTypes>>> = ({\n signal,\n }) => getFileTypes(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getFileTypes>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,gBAAgB;AAwBlB,IAAM,eAAe,CAC1B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,OAAO;AAAA,IACtC;AAAA,EACF;AACF;AAEO,IAAM,0BAA0B,MAAM,CAAC,OAAO;AAO9C,IAAM,kBAAkB,CAG7B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,wBAAwB;AAEnE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,EACF,MAAM,aAAa,gBAAgB,MAAM;AAEzC,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/type/type.ts"],"sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\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.0\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type { TypesGetResponse, DmError } from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\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 the supported Dataset and File (MIME) Types\n\n * @summary Get the supported File Types\n */\nexport const getFileTypes = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TypesGetResponse>(\n { url: `/type`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetFileTypesQueryKey = () => [`/type`];\n\nexport type GetFileTypesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFileTypes>>\n>;\nexport type GetFileTypesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFileTypes = <\n TData = Awaited<ReturnType<typeof getFileTypes>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFileTypes>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFileTypesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFileTypes>>> = ({\n signal,\n }) => getFileTypes(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getFileTypes>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,gBAAgB;AAyBlB,IAAM,eAAe,CAC1B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,OAAO;AAAA,IACtC;AAAA,EACF;AACF;AAEO,IAAM,0BAA0B,MAAM,CAAC,OAAO;AAO9C,IAAM,kBAAkB,CAG7B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,wBAAwB;AAEnE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,EACF,MAAM,aAAa,gBAAgB,MAAM;AAEzC,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;","names":[]}
package/user/user.cjs CHANGED
@@ -1,11 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkIUEU2LYCcjs = require('../chunk-IUEU2LYC.cjs');
3
+ var _chunkLNYWU37Bcjs = require('../chunk-LNYWU37B.cjs');
4
+
5
+
6
+ var _chunkUZTHSGDTcjs = require('../chunk-UZTHSGDT.cjs');
4
7
 
5
8
  // src/user/user.ts
6
9
  var _reactquery = require('@tanstack/react-query');
7
10
  var getUsers = (options, signal) => {
8
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
11
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
9
12
  { url: `/user`, method: "get", signal },
10
13
  options
11
14
  );
@@ -17,16 +20,15 @@ var useGetUsers = (options) => {
17
20
  const queryFn = ({
18
21
  signal
19
22
  }) => getUsers(requestOptions, signal);
23
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
20
24
  const query = _reactquery.useQuery.call(void 0,
21
- queryKey,
22
- queryFn,
23
- queryOptions
25
+ customOptions
24
26
  );
25
- query.queryKey = queryKey;
27
+ query.queryKey = customOptions.queryKey;
26
28
  return query;
27
29
  };
28
30
  var getUserAccount = (params, options, signal) => {
29
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
31
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
30
32
  { url: `/user/account`, method: "get", params, signal },
31
33
  options
32
34
  );
@@ -41,8 +43,9 @@ var useGetUserAccount = (params, options) => {
41
43
  const queryFn = ({
42
44
  signal
43
45
  }) => getUserAccount(params, requestOptions, signal);
44
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
45
- query.queryKey = queryKey;
46
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
47
+ const query = _reactquery.useQuery.call(void 0, customOptions);
48
+ query.queryKey = customOptions.queryKey;
46
49
  return query;
47
50
  };
48
51
  var patchUserAccount = (userAccountPatchBodyBody, options) => {
@@ -65,7 +68,7 @@ var patchUserAccount = (userAccountPatchBodyBody, options) => {
65
68
  userAccountPatchBodyBody.use_impersonation.toString()
66
69
  );
67
70
  }
68
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
71
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
69
72
  {
70
73
  url: `/user/account`,
71
74
  method: "patch",
@@ -84,7 +87,7 @@ var usePatchUserAccount = (options) => {
84
87
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
85
88
  };
86
89
  var getUserApiLog = (params, options, signal) => {
87
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
90
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
88
91
  { url: `/user/api-log`, method: "get", params, signal },
89
92
  options
90
93
  );
@@ -99,8 +102,9 @@ var useGetUserApiLog = (params, options) => {
99
102
  const queryFn = ({
100
103
  signal
101
104
  }) => getUserApiLog(params, requestOptions, signal);
102
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
103
- query.queryKey = queryKey;
105
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
106
+ const query = _reactquery.useQuery.call(void 0, customOptions);
107
+ query.queryKey = customOptions.queryKey;
104
108
  return query;
105
109
  };
106
110
 
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,OAAO;AAO1C,IAAM,cAAc,CAGzB,YAG4D;AAC5D,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,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF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BAAsB,CAGjC,YAQI;AACJ,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,YAKL,YAAY,eAAe;AAC/B;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,WAAiC;AAAA,EACxE;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,mBAAmB,CAI9B,QACA,YAQ2D;AAC3D,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,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.10.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.0\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 therefor do 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 = () => [`/user`];\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 { 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 const query = useQuery<Awaited<ReturnType<typeof getUsers>>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns a summary of your account\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 `/user/account`,\n ...(params ? [params] : []),\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 { 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 const query = useQuery<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Make changes to your user account\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 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 { 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 useMutation<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n >(mutationFn, 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 `/user/api-log`,\n ...(params ? [params] : []),\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 { 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 const query = useQuery<\n Awaited<ReturnType<typeof getUserApiLog>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
1
+ {"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAmC/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,OAAO;AAO1C,IAAM,cAAc,CAGzB,YAG4D;AAC5D,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,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ;AAAA,IACZ;AAAA,EACF;AAEA,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AAOO,IAAM,iBAAiB,CAC5B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,CAAC,WAAkC;AAAA,EAC1E;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,oBAAoB,CAI/B,QACA,YAQ2D;AAC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3B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,2BAA2B,CAAC,WAAiC;AAAA,EACxE;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,mBAAmB,CAI9B,QACA,YAQ2D;AAC3D,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,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\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.0\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\";\nimport { queryMutator } from \".././queryMutator\";\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 therefor do 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 = () => [`/user`];\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 { 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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getUsers>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Returns a summary of your account\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 `/user/account`,\n ...(params ? [params] : []),\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 { 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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Make changes to your user account\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 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 { 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 useMutation<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n >(mutationFn, 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 `/user/api-log`,\n ...(params ? [params] : []),\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 { 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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getUserApiLog>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"]}
package/user/user.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
3
- import { bI as customInstance, aW as UsersGetResponse, bJ as ErrorType, bE as DmError, a as GetUserAccountParams, ad as UserAccountDetail, Z as UserAccountPatchBodyBody, G as GetUserApiLogParams, aX as UserApiLogGetResponse } from '../custom-instance-5c7b6971.js';
3
+ import { bK as customInstance, aY as UsersGetResponse, bL as ErrorType, bG as DmError, a as GetUserAccountParams, ad as UserAccountDetail, Z as UserAccountPatchBodyBody, G as GetUserApiLogParams, aZ as UserApiLogGetResponse } from '../custom-instance-b5dd9223.js';
4
4
  import 'axios';
5
5
 
6
- declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
6
+ type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
7
7
  /**
8
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 therefor do not show up in methods like this
9
9
 
@@ -11,8 +11,8 @@ declare type SecondParameter<T extends (...args: any) => any> = T extends (confi
11
11
  */
12
12
  declare const getUsers: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UsersGetResponse>;
13
13
  declare const getGetUsersQueryKey: () => string[];
14
- declare type GetUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>;
15
- declare type GetUsersQueryError = ErrorType<void | DmError>;
14
+ type GetUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>;
15
+ type GetUsersQueryError = ErrorType<void | DmError>;
16
16
  declare const useGetUsers: <TData = UsersGetResponse, TError = ErrorType<void | DmError>>(options?: {
17
17
  query?: UseQueryOptions<UsersGetResponse, TError, TData, QueryKey> | undefined;
18
18
  request?: SecondParameter<typeof customInstance>;
@@ -26,8 +26,8 @@ declare const useGetUsers: <TData = UsersGetResponse, TError = ErrorType<void |
26
26
  */
27
27
  declare const getUserAccount: (params?: GetUserAccountParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UserAccountDetail>;
28
28
  declare const getGetUserAccountQueryKey: (params?: GetUserAccountParams) => (string | GetUserAccountParams)[];
29
- declare type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;
30
- declare type GetUserAccountQueryError = ErrorType<void | DmError>;
29
+ type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;
30
+ type GetUserAccountQueryError = ErrorType<void | DmError>;
31
31
  declare const useGetUserAccount: <TData = UserAccountDetail, TError = ErrorType<void | DmError>>(params?: GetUserAccountParams, options?: {
32
32
  query?: UseQueryOptions<UserAccountDetail, TError, TData, QueryKey> | undefined;
33
33
  request?: SecondParameter<typeof customInstance>;
@@ -40,9 +40,9 @@ declare const useGetUserAccount: <TData = UserAccountDetail, TError = ErrorType<
40
40
  * @summary Patch your account
41
41
  */
42
42
  declare const patchUserAccount: (userAccountPatchBodyBody: UserAccountPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
43
- declare type PatchUserAccountMutationResult = NonNullable<Awaited<ReturnType<typeof patchUserAccount>>>;
44
- declare type PatchUserAccountMutationBody = UserAccountPatchBodyBody;
45
- declare type PatchUserAccountMutationError = ErrorType<DmError>;
43
+ type PatchUserAccountMutationResult = NonNullable<Awaited<ReturnType<typeof patchUserAccount>>>;
44
+ type PatchUserAccountMutationBody = UserAccountPatchBodyBody;
45
+ type PatchUserAccountMutationError = ErrorType<DmError>;
46
46
  declare const usePatchUserAccount: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
47
47
  mutation?: UseMutationOptions<void, TError, {
48
48
  data: UserAccountPatchBodyBody;
@@ -58,8 +58,8 @@ declare const usePatchUserAccount: <TError = ErrorType<DmError>, TContext = unkn
58
58
  */
59
59
  declare const getUserApiLog: (params?: GetUserApiLogParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UserApiLogGetResponse>;
60
60
  declare const getGetUserApiLogQueryKey: (params?: GetUserApiLogParams) => (string | GetUserApiLogParams)[];
61
- declare type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>;
62
- declare type GetUserApiLogQueryError = ErrorType<void>;
61
+ type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>;
62
+ type GetUserApiLogQueryError = ErrorType<void>;
63
63
  declare const useGetUserApiLog: <TData = UserApiLogGetResponse, TError = ErrorType<void>>(params?: GetUserApiLogParams, options?: {
64
64
  query?: UseQueryOptions<UserApiLogGetResponse, TError, TData, QueryKey> | undefined;
65
65
  request?: SecondParameter<typeof customInstance>;
package/user/user.js CHANGED
@@ -1,6 +1,9 @@
1
+ import {
2
+ queryMutator
3
+ } from "../chunk-LT4O36DN.js";
1
4
  import {
2
5
  customInstance
3
- } from "../chunk-3O5KIRV4.js";
6
+ } from "../chunk-3RNIDX7T.js";
4
7
 
5
8
  // src/user/user.ts
6
9
  import { useQuery, useMutation } from "@tanstack/react-query";
@@ -17,12 +20,11 @@ var useGetUsers = (options) => {
17
20
  const queryFn = ({
18
21
  signal
19
22
  }) => getUsers(requestOptions, signal);
23
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
20
24
  const query = useQuery(
21
- queryKey,
22
- queryFn,
23
- queryOptions
25
+ customOptions
24
26
  );
25
- query.queryKey = queryKey;
27
+ query.queryKey = customOptions.queryKey;
26
28
  return query;
27
29
  };
28
30
  var getUserAccount = (params, options, signal) => {
@@ -41,8 +43,9 @@ var useGetUserAccount = (params, options) => {
41
43
  const queryFn = ({
42
44
  signal
43
45
  }) => getUserAccount(params, requestOptions, signal);
44
- const query = useQuery(queryKey, queryFn, queryOptions);
45
- query.queryKey = queryKey;
46
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
47
+ const query = useQuery(customOptions);
48
+ query.queryKey = customOptions.queryKey;
46
49
  return query;
47
50
  };
48
51
  var patchUserAccount = (userAccountPatchBodyBody, options) => {
@@ -99,8 +102,9 @@ var useGetUserApiLog = (params, options) => {
99
102
  const queryFn = ({
100
103
  signal
101
104
  }) => getUserApiLog(params, requestOptions, signal);
102
- const query = useQuery(queryKey, queryFn, queryOptions);
103
- query.queryKey = queryKey;
105
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
106
+ const query = useQuery(customOptions);
107
+ query.queryKey = customOptions.queryKey;
104
108
  return query;
105
109
  };
106
110
  export {
package/user/user.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.10.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.0\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 therefor do 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 = () => [`/user`];\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 { 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 const query = useQuery<Awaited<ReturnType<typeof getUsers>>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns a summary of your account\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 `/user/account`,\n ...(params ? [params] : []),\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 { 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 const query = useQuery<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Make changes to your user account\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 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 { 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 useMutation<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n >(mutationFn, 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 `/user/api-log`,\n ...(params ? [params] : []),\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 { 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 const query = useQuery<\n Awaited<ReturnType<typeof getUserApiLog>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = 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,OAAO;AAO1C,IAAM,cAAc,CAGzB,YAG4D;AAC5D,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,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,WAAW;AAEjB,SAAO;AACT;AAOO,IAAM,iBAAiB,CAC5B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,CAAC,WAAkC;AAAA,EAC1E;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,oBAAoB,CAI/B,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,0BAA0B,MAAM;AAE3E,QAAM,UAAqE,CAAC;AAAA,IAC1E;AAAA,EACF,MAAM,eAAe,QAAQ,gBAAgB,MAAM;AAEnD,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WA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AW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,yBAAyB,MAAM;AAE1E,QAAM,UAAoE,CAAC;AAAA,IACzE;AAAA,EACF,MAAM,cAAc,QAAQ,gBAAgB,MAAM;AAElD,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\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.0\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\";\nimport { queryMutator } from \".././queryMutator\";\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 therefor do 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 = () => [`/user`];\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 { 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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getUsers>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Returns a summary of your account\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 `/user/account`,\n ...(params ? [params] : []),\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 { 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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Make changes to your user account\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 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 { 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 useMutation<\n Awaited<ReturnType<typeof patchUserAccount>>,\n TError,\n { data: UserAccountPatchBodyBody },\n TContext\n >(mutationFn, 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 `/user/api-log`,\n ...(params ? [params] : []),\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 { 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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getUserApiLog>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAmC/B,IAAM,WAAW,CACtB,S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M,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/custom-instance.ts"],"names":[],"mappings":";AAUA,OAAO,WAA+C;AAE/C,IAAM,iBAAiB,MAAM,OAAO;AAOpC,IAAM,eAAe,CAAC,UAAkB;AAC7C,iBAAe,SAAS,QAAQ,OAAO,mBAAmB,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"]}