@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
@@ -1,9 +1,9 @@
1
- import { a4 as InstancePostBodyBody, bI as customInstance, bm as InstancePostResponse, bJ as ErrorType, bE as DmError, b as GetInstancesParams, bb as InstancesGetResponse, bn as InstanceDryRunPostResponse, bf as InstanceGetResponse, al as TaskIdentity, P as PatchInstanceParams } from '../custom-instance-5c7b6971.js';
1
+ import { a4 as InstancePostBodyBody, bK as customInstance, bo as InstancePostResponse, bL as ErrorType, bG as DmError, b as GetInstancesParams, bd as InstancesGetResponse, bp as InstanceDryRunPostResponse, bh as InstanceGetResponse, al as TaskIdentity, P as PatchInstanceParams } from '../custom-instance-b5dd9223.js';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
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
  * Launches a new Application or Job instance, returning an Instance and Task ID. The Task ID should be used against the `/task` endpoint to determine the availability of the the running instance.
9
9
 
@@ -16,9 +16,9 @@ A Job instance typically runs to completion, reaching the **TaskState** `SUCCESS
16
16
  * @summary Creates a new Job or Application instance
17
17
  */
18
18
  declare const createInstance: (instancePostBodyBody: InstancePostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<InstancePostResponse>;
19
- declare type CreateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof createInstance>>>;
20
- declare type CreateInstanceMutationBody = InstancePostBodyBody;
21
- declare type CreateInstanceMutationError = ErrorType<void | DmError>;
19
+ type CreateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof createInstance>>>;
20
+ type CreateInstanceMutationBody = InstancePostBodyBody;
21
+ type CreateInstanceMutationError = ErrorType<void | DmError>;
22
22
  declare const useCreateInstance: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
23
23
  mutation?: UseMutationOptions<InstancePostResponse, TError, {
24
24
  data: InstancePostBodyBody;
@@ -34,8 +34,8 @@ declare const useCreateInstance: <TError = ErrorType<void | DmError>, TContext =
34
34
  */
35
35
  declare const getInstances: (params?: GetInstancesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<InstancesGetResponse>;
36
36
  declare const getGetInstancesQueryKey: (params?: GetInstancesParams) => (string | GetInstancesParams)[];
37
- declare type GetInstancesQueryResult = NonNullable<Awaited<ReturnType<typeof getInstances>>>;
38
- declare type GetInstancesQueryError = ErrorType<void | DmError>;
37
+ type GetInstancesQueryResult = NonNullable<Awaited<ReturnType<typeof getInstances>>>;
38
+ type GetInstancesQueryError = ErrorType<void | DmError>;
39
39
  declare const useGetInstances: <TData = InstancesGetResponse, TError = ErrorType<void | DmError>>(params?: GetInstancesParams, options?: {
40
40
  query?: UseQueryOptions<InstancesGetResponse, TError, TData, QueryKey> | undefined;
41
41
  request?: SecondParameter<typeof customInstance>;
@@ -50,9 +50,9 @@ The test result is only valid at the time of the call, whether an actual instanc
50
50
  * @summary Used to attempt the execution of new Job or Application instance
51
51
  */
52
52
  declare const dryRunInstance: (instancePostBodyBody: InstancePostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<InstanceDryRunPostResponse>;
53
- declare type DryRunInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof dryRunInstance>>>;
54
- declare type DryRunInstanceMutationBody = InstancePostBodyBody;
55
- declare type DryRunInstanceMutationError = ErrorType<void | DmError>;
53
+ type DryRunInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof dryRunInstance>>>;
54
+ type DryRunInstanceMutationBody = InstancePostBodyBody;
55
+ type DryRunInstanceMutationError = ErrorType<void | DmError>;
56
56
  declare const useDryRunInstance: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
57
57
  mutation?: UseMutationOptions<InstanceDryRunPostResponse, TError, {
58
58
  data: InstancePostBodyBody;
@@ -68,8 +68,8 @@ declare const useDryRunInstance: <TError = ErrorType<void | DmError>, TContext =
68
68
  */
69
69
  declare const getInstance: (instanceId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<InstanceGetResponse>;
70
70
  declare const getGetInstanceQueryKey: (instanceId: string) => string[];
71
- declare type GetInstanceQueryResult = NonNullable<Awaited<ReturnType<typeof getInstance>>>;
72
- declare type GetInstanceQueryError = ErrorType<void | DmError>;
71
+ type GetInstanceQueryResult = NonNullable<Awaited<ReturnType<typeof getInstance>>>;
72
+ type GetInstanceQueryError = ErrorType<void | DmError>;
73
73
  declare const useGetInstance: <TData = InstanceGetResponse, TError = ErrorType<void | DmError>>(instanceId: string, options?: {
74
74
  query?: UseQueryOptions<InstanceGetResponse, TError, TData, QueryKey> | undefined;
75
75
  request?: SecondParameter<typeof customInstance>;
@@ -84,8 +84,8 @@ You must be the `owner` or an `editor` of the instance to delete it
84
84
  * @summary Delete a Job or Application instance
85
85
  */
86
86
  declare const terminateInstance: (instanceId: string, options?: SecondParameter<typeof customInstance>) => Promise<TaskIdentity>;
87
- declare type TerminateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof terminateInstance>>>;
88
- declare type TerminateInstanceMutationError = ErrorType<void | DmError>;
87
+ type TerminateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof terminateInstance>>>;
88
+ type TerminateInstanceMutationError = ErrorType<void | DmError>;
89
89
  declare const useTerminateInstance: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
90
90
  mutation?: UseMutationOptions<TaskIdentity, TError, {
91
91
  instanceId: string;
@@ -102,8 +102,8 @@ You must be the `owner` or an `editor` of the instance to patch it
102
102
  * @summary Update a Job or Application instance
103
103
  */
104
104
  declare const patchInstance: (instanceId: string, params?: PatchInstanceParams, options?: SecondParameter<typeof customInstance>) => Promise<void>;
105
- declare type PatchInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof patchInstance>>>;
106
- declare type PatchInstanceMutationError = ErrorType<DmError>;
105
+ type PatchInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof patchInstance>>>;
106
+ type PatchInstanceMutationError = ErrorType<DmError>;
107
107
  declare const usePatchInstance: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
108
108
  mutation?: UseMutationOptions<void, TError, {
109
109
  instanceId: string;
@@ -124,8 +124,8 @@ The remote system will revoke the token when it's finished with it
124
124
  * @summary Delete (revoke) the instance token
125
125
  */
126
126
  declare const deleteInstanceToken: (instanceId: string, token: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
127
- declare type DeleteInstanceTokenMutationResult = NonNullable<Awaited<ReturnType<typeof deleteInstanceToken>>>;
128
- declare type DeleteInstanceTokenMutationError = ErrorType<DmError>;
127
+ type DeleteInstanceTokenMutationResult = NonNullable<Awaited<ReturnType<typeof deleteInstanceToken>>>;
128
+ type DeleteInstanceTokenMutationError = ErrorType<DmError>;
129
129
  declare const useDeleteInstanceToken: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
130
130
  mutation?: UseMutationOptions<void, TError, {
131
131
  instanceId: string;
@@ -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/instance/instance.ts
6
9
  import { useQuery, useMutation } from "@tanstack/react-query";
@@ -70,8 +73,9 @@ var useGetInstances = (params, options) => {
70
73
  const queryFn = ({
71
74
  signal
72
75
  }) => getInstances(params, requestOptions, signal);
73
- const query = useQuery(queryKey, queryFn, queryOptions);
74
- query.queryKey = queryKey;
76
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
77
+ const query = useQuery(customOptions);
78
+ query.queryKey = customOptions.queryKey;
75
79
  return query;
76
80
  };
77
81
  var dryRunInstance = (instancePostBodyBody, options) => {
@@ -139,11 +143,9 @@ var useGetInstance = (instanceId, options) => {
139
143
  const queryFn = ({
140
144
  signal
141
145
  }) => getInstance(instanceId, requestOptions, signal);
142
- const query = useQuery(queryKey, queryFn, {
143
- enabled: !!instanceId,
144
- ...queryOptions
145
- });
146
- query.queryKey = queryKey;
146
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
147
+ const query = useQuery(customOptions);
148
+ query.queryKey = customOptions.queryKey;
147
149
  return query;
148
150
  };
149
151
  var terminateInstance = (instanceId, options) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/instance/instance.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 InstancePostResponse,\n DmError,\n InstancePostBodyBody,\n InstancesGetResponse,\n GetInstancesParams,\n InstanceDryRunPostResponse,\n InstanceGetResponse,\n InstanceDeleteResponse,\n PatchInstanceParams,\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 * Launches a new Application or Job instance, returning an Instance and Task ID. The Task ID should be used against the `/task` endpoint to determine the availability of the the running instance.\n\nInstance behaviour is controlled using the `specification`. You will need to consult individual applications to determine what can be placed in the specification. Applications typically provide a `template` describing its **options**.\n\nAn Application instance is not Ready for use until the corresponding **TaskState** is `STARTED`.\n\nA Job instance typically runs to completion, reaching the **TaskState** `SUCCESS` when successful and `FAILURE` is unsuccessful.\n\n * @summary Creates a new Job or Application instance\n */\nexport const createInstance = (\n instancePostBodyBody: InstancePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"application_id\", instancePostBodyBody.application_id);\n if (instancePostBodyBody.application_version !== undefined) {\n formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n }\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\n if (instancePostBodyBody.callback_url !== undefined) {\n formData.append(\"callback_url\", instancePostBodyBody.callback_url);\n }\n if (instancePostBodyBody.callback_context !== undefined) {\n formData.append(\"callback_context\", instancePostBodyBody.callback_context);\n }\n if (instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append(\n \"generate_callback_token\",\n instancePostBodyBody.generate_callback_token.toString()\n );\n }\n if (instancePostBodyBody.callback_token !== undefined) {\n formData.append(\"callback_token\", instancePostBodyBody.callback_token);\n }\n if (instancePostBodyBody.debug !== undefined) {\n formData.append(\"debug\", instancePostBodyBody.debug);\n }\n if (instancePostBodyBody.specification !== undefined) {\n formData.append(\"specification\", instancePostBodyBody.specification);\n }\n\n return customInstance<InstancePostResponse>(\n {\n url: `/instance`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof createInstance>>\n>;\nexport type CreateInstanceMutationBody = InstancePostBodyBody;\nexport type CreateInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useCreateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createInstance>>,\n TError,\n { data: InstancePostBodyBody },\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 createInstance>>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createInstance(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a summary of all running instances. Instances can be running as an Application or as a Job. The response will contain an `application_type` field that is either `job` or `application`\n\n * @summary Get summary information about all Job and Application instances\n */\nexport const getInstances = (\n params?: GetInstancesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<InstancesGetResponse>(\n { url: `/instance`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams) => [\n `/instance`,\n ...(params ? [params] : []),\n];\n\nexport type GetInstancesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getInstances>>\n>;\nexport type GetInstancesQueryError = ErrorType<void | DmError>;\n\nexport const useGetInstances = <\n TData = Awaited<ReturnType<typeof getInstances>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetInstancesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getInstances>>,\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 ?? getGetInstancesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstances>>> = ({\n signal,\n }) => getInstances(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getInstances>>,\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 * Similar to the `/instance [POST]` endpoint this one is used to check whether a new **Application** or **Job** instance can be launched. Rather than returning an **Instance** (or **Task**) ID this endpoint is simply used to ensure that the Job/Application is runnable while also returning the compiled `command` (if the Instance is a Job).\n\nThe test result is only valid at the time of the call, whether an actual instance would start or not will require an identical call to `/instance POST`.\n\n * @summary Used to attempt the execution of new Job or Application instance\n */\nexport const dryRunInstance = (\n instancePostBodyBody: InstancePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"application_id\", instancePostBodyBody.application_id);\n if (instancePostBodyBody.application_version !== undefined) {\n formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n }\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\n if (instancePostBodyBody.callback_url !== undefined) {\n formData.append(\"callback_url\", instancePostBodyBody.callback_url);\n }\n if (instancePostBodyBody.callback_context !== undefined) {\n formData.append(\"callback_context\", instancePostBodyBody.callback_context);\n }\n if (instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append(\n \"generate_callback_token\",\n instancePostBodyBody.generate_callback_token.toString()\n );\n }\n if (instancePostBodyBody.callback_token !== undefined) {\n formData.append(\"callback_token\", instancePostBodyBody.callback_token);\n }\n if (instancePostBodyBody.debug !== undefined) {\n formData.append(\"debug\", instancePostBodyBody.debug);\n }\n if (instancePostBodyBody.specification !== undefined) {\n formData.append(\"specification\", instancePostBodyBody.specification);\n }\n\n return customInstance<InstanceDryRunPostResponse>(\n {\n url: `/instance/dry-run`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type DryRunInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof dryRunInstance>>\n>;\nexport type DryRunInstanceMutationBody = InstancePostBodyBody;\nexport type DryRunInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useDryRunInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof dryRunInstance>>,\n TError,\n { data: InstancePostBodyBody },\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 dryRunInstance>>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return dryRunInstance(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof dryRunInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The instance information will be returned if available.\n\n * @summary Get detailed information about a specific instance\n */\nexport const getInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<InstanceGetResponse>(\n { url: `/instance/${instanceId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetInstanceQueryKey = (instanceId: string) => [\n `/instance/${instanceId}`,\n];\n\nexport type GetInstanceQueryResult = NonNullable<\n Awaited<ReturnType<typeof getInstance>>\n>;\nexport type GetInstanceQueryError = ErrorType<void | DmError>;\n\nexport const useGetInstance = <\n TData = Awaited<ReturnType<typeof getInstance>>,\n TError = ErrorType<void | DmError>\n>(\n instanceId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getInstance>>,\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 ?? getGetInstanceQueryKey(instanceId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstance>>> = ({\n signal,\n }) => getInstance(instanceId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getInstance>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!instanceId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * The Application or Job instance is terminated.\n\nYou must be the `owner` or an `editor` of the instance to delete it\n\n * @summary Delete a Job or Application instance\n */\nexport const terminateInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstanceDeleteResponse>(\n { url: `/instance/${instanceId}`, method: \"delete\" },\n options\n );\n};\n\nexport type TerminateInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof terminateInstance>>\n>;\n\nexport type TerminateInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useTerminateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof terminateInstance>>,\n TError,\n { instanceId: 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 terminateInstance>>,\n { instanceId: string }\n > = (props) => {\n const { instanceId } = props ?? {};\n\n return terminateInstance(instanceId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof terminateInstance>>,\n TError,\n { instanceId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The Application or Job instance is updated according to the patch parameters.\n\nYou must be the `owner` or an `editor` of the instance to patch it\n\n * @summary Update a Job or Application instance\n */\nexport const patchInstance = (\n instanceId: string,\n params?: PatchInstanceParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/instance/${instanceId}`, method: \"patch\", params },\n options\n );\n};\n\nexport type PatchInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchInstance>>\n>;\n\nexport type PatchInstanceMutationError = ErrorType<DmError>;\n\nexport const usePatchInstance = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchInstance>>,\n TError,\n { instanceId: string; params?: PatchInstanceParams },\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 patchInstance>>,\n { instanceId: string; params?: PatchInstanceParams }\n > = (props) => {\n const { instanceId, params } = props ?? {};\n\n return patchInstance(instanceId, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchInstance>>,\n TError,\n { instanceId: string; params?: PatchInstanceParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This revokes the instance **Token**, which was optionally generated when the instance was launched. No authentication is required to use this endpoint, which is typically used by a remote system driven by instance callbacks.\n\nTokens automatically expire after a period of time but can be revoked instantly with this endpoint.\n\nThe remote system will revoke the token when it's finished with it\n\n * @summary Delete (revoke) the instance token\n */\nexport const deleteInstanceToken = (\n instanceId: string,\n token: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/instance/${instanceId}/token/${token}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteInstanceTokenMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteInstanceToken>>\n>;\n\nexport type DeleteInstanceTokenMutationError = ErrorType<DmError>;\n\nexport const useDeleteInstanceToken = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n TError,\n { instanceId: string; token: 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 deleteInstanceToken>>,\n { instanceId: string; token: string }\n > = (props) => {\n const { instanceId, token } = props ?? {};\n\n return deleteInstanceToken(instanceId, token, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n TError,\n { instanceId: string; token: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA0C/B,IAAM,iBAAiB,CAC5B,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,CAGlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,IAAI,SAAS,CAAC;AAEjC,WAAO,kBAAkB,YAAY,cAAc;AAAA,EACrD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAQO,IAAM,gBAAgB,CAC3B,YACA,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,aAAa,cAAc,QAAQ,SAAS,OAAO;AAAA,IAC1D;AAAA,EACF;AACF;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,OAAO,IAAI,SAAS,CAAC;AAEzC,WAAO,cAAc,YAAY,QAAQ,cAAc;AAAA,EACzD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAUO,IAAM,sBAAsB,CACjC,YACA,OACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,aAAa,oBAAoB,SAAS,QAAQ,SAAS;AAAA,IAClE;AAAA,EACF;AACF;AAQO,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,MAAM,IAAI,SAAS,CAAC;AAExC,WAAO,oBAAoB,YAAY,OAAO,cAAc;AAAA,EAC9D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/instance/instance.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 InstancePostResponse,\n DmError,\n InstancePostBodyBody,\n InstancesGetResponse,\n GetInstancesParams,\n InstanceDryRunPostResponse,\n InstanceGetResponse,\n InstanceDeleteResponse,\n PatchInstanceParams,\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 * Launches a new Application or Job instance, returning an Instance and Task ID. The Task ID should be used against the `/task` endpoint to determine the availability of the the running instance.\n\nInstance behaviour is controlled using the `specification`. You will need to consult individual applications to determine what can be placed in the specification. Applications typically provide a `template` describing its **options**.\n\nAn Application instance is not Ready for use until the corresponding **TaskState** is `STARTED`.\n\nA Job instance typically runs to completion, reaching the **TaskState** `SUCCESS` when successful and `FAILURE` is unsuccessful.\n\n * @summary Creates a new Job or Application instance\n */\nexport const createInstance = (\n instancePostBodyBody: InstancePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"application_id\", instancePostBodyBody.application_id);\n if (instancePostBodyBody.application_version !== undefined) {\n formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n }\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\n if (instancePostBodyBody.callback_url !== undefined) {\n formData.append(\"callback_url\", instancePostBodyBody.callback_url);\n }\n if (instancePostBodyBody.callback_context !== undefined) {\n formData.append(\"callback_context\", instancePostBodyBody.callback_context);\n }\n if (instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append(\n \"generate_callback_token\",\n instancePostBodyBody.generate_callback_token.toString()\n );\n }\n if (instancePostBodyBody.callback_token !== undefined) {\n formData.append(\"callback_token\", instancePostBodyBody.callback_token);\n }\n if (instancePostBodyBody.debug !== undefined) {\n formData.append(\"debug\", instancePostBodyBody.debug);\n }\n if (instancePostBodyBody.specification !== undefined) {\n formData.append(\"specification\", instancePostBodyBody.specification);\n }\n\n return customInstance<InstancePostResponse>(\n {\n url: `/instance`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof createInstance>>\n>;\nexport type CreateInstanceMutationBody = InstancePostBodyBody;\nexport type CreateInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useCreateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createInstance>>,\n TError,\n { data: InstancePostBodyBody },\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 createInstance>>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createInstance(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a summary of all running instances. Instances can be running as an Application or as a Job. The response will contain an `application_type` field that is either `job` or `application`\n\n * @summary Get summary information about all Job and Application instances\n */\nexport const getInstances = (\n params?: GetInstancesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<InstancesGetResponse>(\n { url: `/instance`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams) => [\n `/instance`,\n ...(params ? [params] : []),\n];\n\nexport type GetInstancesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getInstances>>\n>;\nexport type GetInstancesQueryError = ErrorType<void | DmError>;\n\nexport const useGetInstances = <\n TData = Awaited<ReturnType<typeof getInstances>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetInstancesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getInstances>>,\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 ?? getGetInstancesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstances>>> = ({\n signal,\n }) => getInstances(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getInstances>>,\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 * Similar to the `/instance [POST]` endpoint this one is used to check whether a new **Application** or **Job** instance can be launched. Rather than returning an **Instance** (or **Task**) ID this endpoint is simply used to ensure that the Job/Application is runnable while also returning the compiled `command` (if the Instance is a Job).\n\nThe test result is only valid at the time of the call, whether an actual instance would start or not will require an identical call to `/instance POST`.\n\n * @summary Used to attempt the execution of new Job or Application instance\n */\nexport const dryRunInstance = (\n instancePostBodyBody: InstancePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"application_id\", instancePostBodyBody.application_id);\n if (instancePostBodyBody.application_version !== undefined) {\n formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n }\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\n if (instancePostBodyBody.callback_url !== undefined) {\n formData.append(\"callback_url\", instancePostBodyBody.callback_url);\n }\n if (instancePostBodyBody.callback_context !== undefined) {\n formData.append(\"callback_context\", instancePostBodyBody.callback_context);\n }\n if (instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append(\n \"generate_callback_token\",\n instancePostBodyBody.generate_callback_token.toString()\n );\n }\n if (instancePostBodyBody.callback_token !== undefined) {\n formData.append(\"callback_token\", instancePostBodyBody.callback_token);\n }\n if (instancePostBodyBody.debug !== undefined) {\n formData.append(\"debug\", instancePostBodyBody.debug);\n }\n if (instancePostBodyBody.specification !== undefined) {\n formData.append(\"specification\", instancePostBodyBody.specification);\n }\n\n return customInstance<InstanceDryRunPostResponse>(\n {\n url: `/instance/dry-run`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type DryRunInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof dryRunInstance>>\n>;\nexport type DryRunInstanceMutationBody = InstancePostBodyBody;\nexport type DryRunInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useDryRunInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof dryRunInstance>>,\n TError,\n { data: InstancePostBodyBody },\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 dryRunInstance>>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return dryRunInstance(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof dryRunInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The instance information will be returned if available.\n\n * @summary Get detailed information about a specific instance\n */\nexport const getInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<InstanceGetResponse>(\n { url: `/instance/${instanceId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetInstanceQueryKey = (instanceId: string) => [\n `/instance/${instanceId}`,\n];\n\nexport type GetInstanceQueryResult = NonNullable<\n Awaited<ReturnType<typeof getInstance>>\n>;\nexport type GetInstanceQueryError = ErrorType<void | DmError>;\n\nexport const useGetInstance = <\n TData = Awaited<ReturnType<typeof getInstance>>,\n TError = ErrorType<void | DmError>\n>(\n instanceId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getInstance>>,\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 ?? getGetInstanceQueryKey(instanceId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstance>>> = ({\n signal,\n }) => getInstance(instanceId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getInstance>>,\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 * The Application or Job instance is terminated.\n\nYou must be the `owner` or an `editor` of the instance to delete it\n\n * @summary Delete a Job or Application instance\n */\nexport const terminateInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstanceDeleteResponse>(\n { url: `/instance/${instanceId}`, method: \"delete\" },\n options\n );\n};\n\nexport type TerminateInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof terminateInstance>>\n>;\n\nexport type TerminateInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useTerminateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof terminateInstance>>,\n TError,\n { instanceId: 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 terminateInstance>>,\n { instanceId: string }\n > = (props) => {\n const { instanceId } = props ?? {};\n\n return terminateInstance(instanceId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof terminateInstance>>,\n TError,\n { instanceId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The Application or Job instance is updated according to the patch parameters.\n\nYou must be the `owner` or an `editor` of the instance to patch it\n\n * @summary Update a Job or Application instance\n */\nexport const patchInstance = (\n instanceId: string,\n params?: PatchInstanceParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/instance/${instanceId}`, method: \"patch\", params },\n options\n );\n};\n\nexport type PatchInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchInstance>>\n>;\n\nexport type PatchInstanceMutationError = ErrorType<DmError>;\n\nexport const usePatchInstance = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchInstance>>,\n TError,\n { instanceId: string; params?: PatchInstanceParams },\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 patchInstance>>,\n { instanceId: string; params?: PatchInstanceParams }\n > = (props) => {\n const { instanceId, params } = props ?? {};\n\n return patchInstance(instanceId, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchInstance>>,\n TError,\n { instanceId: string; params?: PatchInstanceParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This revokes the instance **Token**, which was optionally generated when the instance was launched. No authentication is required to use this endpoint, which is typically used by a remote system driven by instance callbacks.\n\nTokens automatically expire after a period of time but can be revoked instantly with this endpoint.\n\nThe remote system will revoke the token when it's finished with it\n\n * @summary Delete (revoke) the instance token\n */\nexport const deleteInstanceToken = (\n instanceId: string,\n token: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/instance/${instanceId}/token/${token}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteInstanceTokenMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteInstanceToken>>\n>;\n\nexport type DeleteInstanceTokenMutationError = ErrorType<DmError>;\n\nexport const useDeleteInstanceToken = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n TError,\n { instanceId: string; token: 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 deleteInstanceToken>>,\n { instanceId: string; token: string }\n > = (props) => {\n const { instanceId, token } = props ?? {};\n\n return deleteInstanceToken(instanceId, token, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n TError,\n { instanceId: string; token: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AA2C/B,IAAM,iBAAiB,CAC5B,sBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,kBAAkB,qBAAqB,cAAc;AACrE,MAAI,qBAAqB,wBAAwB,QAAW;AAC1D,aAAS;AAAA,MACP;AAAA,MACA,qBAAqB;AAAA,IACvB;AAAA,EACF;AACA,WAAS,OAAO,cAAc,qBAAqB,UAAU;AAC7D,WAAS,OAAO,WAAW,qBAAqB,OAAO;AACvD,MAAI,qBAAqB,iBAAiB,QAAW;AACnD,aAAS,OAAO,gBAAgB,qBAAqB,YAAY;AAAA,EACnE;AACA,MAAI,qBAAqB,qBAAqB,QAAW;AACvD,aAAS,OAAO,oBAAoB,qBAAqB,gBAAgB;AAAA,EAC3E;AACA,MAAI,qBAAqB,4BAA4B,QAAW;AAC9D,aAAS;AAAA,MACP;AAAA,MACA,qBAAqB,wBAAwB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C;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,OAAO,IAAI,SAAS,CAAC;AAEzC,WAAO,cAAc,YAAY,QAAQ,cAAc;AAAA,EACzD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAUO,IAAM,sBAAsB,CACjC,YACA,OACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,aAAa,oBAAoB,SAAS,QAAQ,SAAS;AAAA,IAClE;AAAA,EACF;AACF;AAQO,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,MAAM,IAAI,SAAS,CAAC;AAExC,WAAO,oBAAoB,YAAY,OAAO,cAAc;AAAA,EAC9D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
package/job/job.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/job/job.ts
6
9
  var _reactquery = require('@tanstack/react-query');
7
10
  var getJobs = (params, options, signal) => {
8
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
11
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
9
12
  { url: `/job`, method: "get", params, signal },
10
13
  options
11
14
  );
@@ -20,16 +23,15 @@ var useGetJobs = (params, options) => {
20
23
  const queryFn = ({
21
24
  signal
22
25
  }) => getJobs(params, requestOptions, signal);
26
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
23
27
  const query = _reactquery.useQuery.call(void 0,
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 getJobByVersion = (params, options, signal) => {
32
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
34
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
33
35
  { url: `/job/get-by-version`, method: "get", params, signal },
34
36
  options
35
37
  );
@@ -44,12 +46,13 @@ var useGetJobByVersion = (params, options) => {
44
46
  const queryFn = ({
45
47
  signal
46
48
  }) => getJobByVersion(params, requestOptions, signal);
47
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
48
- query.queryKey = queryKey;
49
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
50
+ const query = _reactquery.useQuery.call(void 0, customOptions);
51
+ query.queryKey = customOptions.queryKey;
49
52
  return query;
50
53
  };
51
54
  var getJob = (jobId, params, options, signal) => {
52
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
55
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
53
56
  { url: `/job/${jobId}`, method: "get", params, signal },
54
57
  options
55
58
  );
@@ -64,12 +67,11 @@ var useGetJob = (jobId, params, options) => {
64
67
  const queryFn = ({
65
68
  signal
66
69
  }) => getJob(jobId, params, requestOptions, signal);
70
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
67
71
  const query = _reactquery.useQuery.call(void 0,
68
- queryKey,
69
- queryFn,
70
- { enabled: !!jobId, ...queryOptions }
72
+ customOptions
71
73
  );
72
- query.queryKey = queryKey;
74
+ query.queryKey = customOptions.queryKey;
73
75
  return query;
74
76
  };
75
77
 
package/job/job.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/job/job.ts"],"names":[],"mappings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,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,oBAAoB,CAAC,OAAe,WAA0B;AAAA,EACzE,QAAQ;AAAA,EACR,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAKO,IAAM,YAAY,CAIvB,OACA,QACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,kBAAkB,OAAO,MAAM;AAE1E,QAAM,UAA6D,CAAC;AAAA,IAClE;AAAA,EACF,MAAM,OAAO,OAAO,QAAQ,gBAAgB,MAAM;AAElD,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA,EAAE,SAAS,CAAC,CAAC,OAAO,GAAG,aAAa;AAAA,EACtC;AAEA,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 {\n JobsGetResponse,\n DmError,\n GetJobsParams,\n JobGetResponse,\n GetJobByVersionParams,\n GetJobParams,\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 * Get a list of all jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (\n params?: GetJobsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobsQueryKey = (params?: GetJobsParams) => [\n `/job`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobs>>\n>;\nexport type GetJobsQueryError = ErrorType<DmError>;\n\nexport const useGetJobs = <\n TData = Awaited<ReturnType<typeof getJobs>>,\n TError = ErrorType<DmError>\n>(\n params?: GetJobsParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, 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 ?? getGetJobsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobs>>> = ({\n signal,\n }) => getJobs(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getJobs>>, 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 * Gets a Job based on its **collection**, **job** and **version**.\n\nJob availability will vary as Jobs are added to the cluster. Jobs that have been added are unlikely to be removed.\n\n * @summary Get a Job by its version\n */\nexport const getJobByVersion = (\n params: GetJobByVersionParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/get-by-version`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobByVersionQueryKey = (params: GetJobByVersionParams) => [\n `/job/get-by-version`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobByVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobByVersion>>\n>;\nexport type GetJobByVersionQueryError = ErrorType<DmError>;\n\nexport const useGetJobByVersion = <\n TData = Awaited<ReturnType<typeof getJobByVersion>>,\n TError = ErrorType<DmError>\n>(\n params: GetJobByVersionParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 ?? getGetJobByVersionQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobByVersion>>> = ({\n signal,\n }) => getJobByVersion(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 * Get details of a specific job available to you that can be instantiated.\n\nTo run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.\n\n * @summary Get details of a specific Job\n */\nexport const getJob = (\n jobId: number,\n params?: GetJobParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/${jobId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobQueryKey = (jobId: number, params?: GetJobParams) => [\n `/job/${jobId}`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>;\nexport type GetJobQueryError = ErrorType<void | DmError>;\n\nexport const useGetJob = <\n TData = Awaited<ReturnType<typeof getJob>>,\n TError = ErrorType<void | DmError>\n>(\n jobId: number,\n params?: GetJobParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJob>>, 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 ?? getGetJobQueryKey(jobId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJob>>> = ({\n signal,\n }) => getJob(jobId, params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getJob>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!jobId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
1
+ {"version":3,"sources":["../../src/job/job.ts"],"names":[],"mappings":";;;;;;;;AAUA,SAAS,gBAAgB;AAkClB,IAAM,UAAU,CACrB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,QAAQ,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC7C;AAAA,EACF;AACF;AAEO,IAAM,qBAAqB,CAAC,WAA2B;AAAA,EAC5D;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,aAAa,CAIxB,QACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,mBAAmB,MAAM;AAEpE,QAAM,UAA8D,CAAC;AAAA,IACnE;AAAA,EACF,MAAM,QAAQ,QAAQ,gBAAgB,MAAM;AAE5C,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ;AAAA,IACZ;AAAA,EACF;AAEA,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AASO,IAAM,kBAAkB,CAC7B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,uBAAuB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC5D;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CAAC,WAAkC;AAAA,EAC3E;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,qBAAqB,CAIhC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,2BAA2B,MAAM;AAE5E,QAAM,UAAsE,CAAC;AAAA,IAC3E;AAAA,EACF,MAAM,gBAAgB,QAAQ,gBAAgB,MAAM;AAEpD,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AASO,IAAM,SAAS,CACpB,OACA,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,QAAQ,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,oBAAoB,CAAC,OAAe,WAA0B;AAAA,EACzE,QAAQ;AAAA,EACR,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAKO,IAAM,YAAY,CAIvB,OACA,QACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,kBAAkB,OAAO,MAAM;AAE1E,QAAM,UAA6D,CAAC;AAAA,IAClE;AAAA,EACF,MAAM,OAAO,OAAO,QAAQ,gBAAgB,MAAM;AAElD,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ;AAAA,IACZ;AAAA,EACF;AAEA,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 {\n JobsGetResponse,\n DmError,\n GetJobsParams,\n JobGetResponse,\n GetJobByVersionParams,\n GetJobParams,\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 * Get a list of all jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (\n params?: GetJobsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobsQueryKey = (params?: GetJobsParams) => [\n `/job`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobs>>\n>;\nexport type GetJobsQueryError = ErrorType<DmError>;\n\nexport const useGetJobs = <\n TData = Awaited<ReturnType<typeof getJobs>>,\n TError = ErrorType<DmError>\n>(\n params?: GetJobsParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, 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 ?? getGetJobsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobs>>> = ({\n signal,\n }) => getJobs(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getJobs>>, 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 * Gets a Job based on its **collection**, **job** and **version**.\n\nJob availability will vary as Jobs are added to the cluster. Jobs that have been added are unlikely to be removed.\n\n * @summary Get a Job by its version\n */\nexport const getJobByVersion = (\n params: GetJobByVersionParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/get-by-version`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobByVersionQueryKey = (params: GetJobByVersionParams) => [\n `/job/get-by-version`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobByVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobByVersion>>\n>;\nexport type GetJobByVersionQueryError = ErrorType<DmError>;\n\nexport const useGetJobByVersion = <\n TData = Awaited<ReturnType<typeof getJobByVersion>>,\n TError = ErrorType<DmError>\n>(\n params: GetJobByVersionParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 ?? getGetJobByVersionQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobByVersion>>> = ({\n signal,\n }) => getJobByVersion(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 * Get details of a specific job available to you that can be instantiated.\n\nTo run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.\n\n * @summary Get details of a specific Job\n */\nexport const getJob = (\n jobId: number,\n params?: GetJobParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/${jobId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobQueryKey = (jobId: number, params?: GetJobParams) => [\n `/job/${jobId}`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>;\nexport type GetJobQueryError = ErrorType<void | DmError>;\n\nexport const useGetJob = <\n TData = Awaited<ReturnType<typeof getJob>>,\n TError = ErrorType<void | DmError>\n>(\n jobId: number,\n params?: GetJobParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJob>>, 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 ?? getGetJobQueryKey(jobId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJob>>> = ({\n signal,\n }) => getJob(jobId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getJob>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"]}
package/job/job.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
2
- import { g as GetJobsParams, bI as customInstance, b6 as JobsGetResponse, bJ as ErrorType, bE as DmError, f as GetJobByVersionParams, b8 as JobGetResponse, e as GetJobParams } from '../custom-instance-5c7b6971.js';
2
+ import { g as GetJobsParams, bK as customInstance, b8 as JobsGetResponse, bL as ErrorType, bG as DmError, f as GetJobByVersionParams, ba as JobGetResponse, e as GetJobParams } 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
  * Get a list of all jobs available to you that can be instantiated via the `/instance` endpoint.
8
8
 
@@ -12,8 +12,8 @@ Job availability will vary as Jobs are added to the cluster.
12
12
  */
13
13
  declare const getJobs: (params?: GetJobsParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<JobsGetResponse>;
14
14
  declare const getGetJobsQueryKey: (params?: GetJobsParams) => (string | GetJobsParams)[];
15
- declare type GetJobsQueryResult = NonNullable<Awaited<ReturnType<typeof getJobs>>>;
16
- declare type GetJobsQueryError = ErrorType<DmError>;
15
+ type GetJobsQueryResult = NonNullable<Awaited<ReturnType<typeof getJobs>>>;
16
+ type GetJobsQueryError = ErrorType<DmError>;
17
17
  declare const useGetJobs: <TData = JobsGetResponse, TError = ErrorType<DmError>>(params?: GetJobsParams, options?: {
18
18
  query?: UseQueryOptions<JobsGetResponse, TError, TData, QueryKey> | undefined;
19
19
  request?: SecondParameter<typeof customInstance>;
@@ -29,8 +29,8 @@ Job availability will vary as Jobs are added to the cluster. Jobs that have been
29
29
  */
30
30
  declare const getJobByVersion: (params: GetJobByVersionParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<JobGetResponse>;
31
31
  declare const getGetJobByVersionQueryKey: (params: GetJobByVersionParams) => (string | GetJobByVersionParams)[];
32
- declare type GetJobByVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getJobByVersion>>>;
33
- declare type GetJobByVersionQueryError = ErrorType<DmError>;
32
+ type GetJobByVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getJobByVersion>>>;
33
+ type GetJobByVersionQueryError = ErrorType<DmError>;
34
34
  declare const useGetJobByVersion: <TData = JobGetResponse, TError = ErrorType<DmError>>(params: GetJobByVersionParams, options?: {
35
35
  query?: UseQueryOptions<JobGetResponse, TError, TData, QueryKey> | undefined;
36
36
  request?: SecondParameter<typeof customInstance>;
@@ -46,8 +46,8 @@ To run a job you need to use the `/instance` endpoint. The Job is controlled thr
46
46
  */
47
47
  declare const getJob: (jobId: number, params?: GetJobParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<JobGetResponse>;
48
48
  declare const getGetJobQueryKey: (jobId: number, params?: GetJobParams) => (string | GetJobParams)[];
49
- declare type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>;
50
- declare type GetJobQueryError = ErrorType<void | DmError>;
49
+ type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>;
50
+ type GetJobQueryError = ErrorType<void | DmError>;
51
51
  declare const useGetJob: <TData = JobGetResponse, TError = ErrorType<void | DmError>>(jobId: number, params?: GetJobParams, options?: {
52
52
  query?: UseQueryOptions<JobGetResponse, TError, TData, QueryKey> | undefined;
53
53
  request?: SecondParameter<typeof customInstance>;
package/job/job.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/job/job.ts
6
9
  import { useQuery } from "@tanstack/react-query";
@@ -20,12 +23,11 @@ var useGetJobs = (params, options) => {
20
23
  const queryFn = ({
21
24
  signal
22
25
  }) => getJobs(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 getJobByVersion = (params, options, signal) => {
@@ -44,8 +46,9 @@ var useGetJobByVersion = (params, options) => {
44
46
  const queryFn = ({
45
47
  signal
46
48
  }) => getJobByVersion(params, requestOptions, signal);
47
- const query = useQuery(queryKey, queryFn, queryOptions);
48
- query.queryKey = queryKey;
49
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
50
+ const query = useQuery(customOptions);
51
+ query.queryKey = customOptions.queryKey;
49
52
  return query;
50
53
  };
51
54
  var getJob = (jobId, params, options, signal) => {
@@ -64,12 +67,11 @@ var useGetJob = (jobId, params, options) => {
64
67
  const queryFn = ({
65
68
  signal
66
69
  }) => getJob(jobId, params, requestOptions, signal);
70
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
67
71
  const query = useQuery(
68
- queryKey,
69
- queryFn,
70
- { enabled: !!jobId, ...queryOptions }
72
+ customOptions
71
73
  );
72
- query.queryKey = queryKey;
74
+ query.queryKey = customOptions.queryKey;
73
75
  return query;
74
76
  };
75
77
  export {
package/job/job.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/job/job.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 {\n JobsGetResponse,\n DmError,\n GetJobsParams,\n JobGetResponse,\n GetJobByVersionParams,\n GetJobParams,\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 * Get a list of all jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (\n params?: GetJobsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobsQueryKey = (params?: GetJobsParams) => [\n `/job`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobs>>\n>;\nexport type GetJobsQueryError = ErrorType<DmError>;\n\nexport const useGetJobs = <\n TData = Awaited<ReturnType<typeof getJobs>>,\n TError = ErrorType<DmError>\n>(\n params?: GetJobsParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, 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 ?? getGetJobsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobs>>> = ({\n signal,\n }) => getJobs(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getJobs>>, 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 * Gets a Job based on its **collection**, **job** and **version**.\n\nJob availability will vary as Jobs are added to the cluster. Jobs that have been added are unlikely to be removed.\n\n * @summary Get a Job by its version\n */\nexport const getJobByVersion = (\n params: GetJobByVersionParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/get-by-version`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobByVersionQueryKey = (params: GetJobByVersionParams) => [\n `/job/get-by-version`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobByVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobByVersion>>\n>;\nexport type GetJobByVersionQueryError = ErrorType<DmError>;\n\nexport const useGetJobByVersion = <\n TData = Awaited<ReturnType<typeof getJobByVersion>>,\n TError = ErrorType<DmError>\n>(\n params: GetJobByVersionParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 ?? getGetJobByVersionQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobByVersion>>> = ({\n signal,\n }) => getJobByVersion(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 * Get details of a specific job available to you that can be instantiated.\n\nTo run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.\n\n * @summary Get details of a specific Job\n */\nexport const getJob = (\n jobId: number,\n params?: GetJobParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/${jobId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobQueryKey = (jobId: number, params?: GetJobParams) => [\n `/job/${jobId}`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>;\nexport type GetJobQueryError = ErrorType<void | DmError>;\n\nexport const useGetJob = <\n TData = Awaited<ReturnType<typeof getJob>>,\n TError = ErrorType<void | DmError>\n>(\n jobId: number,\n params?: GetJobParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJob>>, 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 ?? getGetJobQueryKey(jobId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJob>>> = ({\n signal,\n }) => getJob(jobId, params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getJob>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!jobId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,gBAAgB;AAiClB,IAAM,UAAU,CACrB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,QAAQ,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC7C;AAAA,EACF;AACF;AAEO,IAAM,qBAAqB,CAAC,WAA2B;AAAA,EAC5D;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,aAAa,CAIxB,QACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,mBAAmB,MAAM;AAEpE,QAAM,UAA8D,CAAC;AAAA,IACnE;AAAA,EACF,MAAM,QAAQ,QAAQ,gBAAgB,MAAM;AAE5C,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,WAAW;AAEjB,SAAO;AACT;AASO,IAAM,kBAAkB,CAC7B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,uBAAuB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC5D;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CAAC,WAAkC;AAAA,EAC3E;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,qBAAqB,CAIhC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,2BAA2B,MAAM;AAE5E,QAAM,UAAsE,CAAC;AAAA,IAC3E;AAAA,EACF,MAAM,gBAAgB,QAAQ,gBAAgB,MAAM;AAEpD,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT;AASO,IAAM,SAAS,CACpB,OACA,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,QAAQ,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,oBAAoB,CAAC,OAAe,WAA0B;AAAA,EACzE,QAAQ;AAAA,EACR,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAKO,IAAM,YAAY,CAIvB,OACA,QACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,kBAAkB,OAAO,MAAM;AAE1E,QAAM,UAA6D,CAAC;AAAA,IAClE;AAAA,EACF,MAAM,OAAO,OAAO,QAAQ,gBAAgB,MAAM;AAElD,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA,EAAE,SAAS,CAAC,CAAC,OAAO,GAAG,aAAa;AAAA,EACtC;AAEA,QAAM,WAAW;AAEjB,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/job/job.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 {\n JobsGetResponse,\n DmError,\n GetJobsParams,\n JobGetResponse,\n GetJobByVersionParams,\n GetJobParams,\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 * Get a list of all jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (\n params?: GetJobsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobsQueryKey = (params?: GetJobsParams) => [\n `/job`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobs>>\n>;\nexport type GetJobsQueryError = ErrorType<DmError>;\n\nexport const useGetJobs = <\n TData = Awaited<ReturnType<typeof getJobs>>,\n TError = ErrorType<DmError>\n>(\n params?: GetJobsParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, 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 ?? getGetJobsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobs>>> = ({\n signal,\n }) => getJobs(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getJobs>>, 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 * Gets a Job based on its **collection**, **job** and **version**.\n\nJob availability will vary as Jobs are added to the cluster. Jobs that have been added are unlikely to be removed.\n\n * @summary Get a Job by its version\n */\nexport const getJobByVersion = (\n params: GetJobByVersionParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/get-by-version`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobByVersionQueryKey = (params: GetJobByVersionParams) => [\n `/job/get-by-version`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobByVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobByVersion>>\n>;\nexport type GetJobByVersionQueryError = ErrorType<DmError>;\n\nexport const useGetJobByVersion = <\n TData = Awaited<ReturnType<typeof getJobByVersion>>,\n TError = ErrorType<DmError>\n>(\n params: GetJobByVersionParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 ?? getGetJobByVersionQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobByVersion>>> = ({\n signal,\n }) => getJobByVersion(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 * Get details of a specific job available to you that can be instantiated.\n\nTo run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.\n\n * @summary Get details of a specific Job\n */\nexport const getJob = (\n jobId: number,\n params?: GetJobParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/${jobId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobQueryKey = (jobId: number, params?: GetJobParams) => [\n `/job/${jobId}`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>;\nexport type GetJobQueryError = ErrorType<void | DmError>;\n\nexport const useGetJob = <\n TData = Awaited<ReturnType<typeof getJob>>,\n TError = ErrorType<void | DmError>\n>(\n jobId: number,\n params?: GetJobParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJob>>, 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 ?? getGetJobQueryKey(jobId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJob>>> = ({\n signal,\n }) => getJob(jobId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getJob>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,gBAAgB;AAkClB,IAAM,UAAU,CACrB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,QAAQ,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC7C;AAAA,EACF;AACF;AAEO,IAAM,qBAAqB,CAAC,WAA2B;AAAA,EAC5D;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,aAAa,CAIxB,QACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,mBAAmB,MAAM;AAEpE,QAAM,UAA8D,CAAC;AAAA,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1E,QAAM,UAA6D,CAAC;AAAA,IAClE;AAAA,EACF,MAAM,OAAO,OAAO,QAAQ,gBAAgB,MAAM;AAElD,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ;AAAA,IACZ;AAAA,EACF;AAEA,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;","names":[]}
@@ -1,6 +1,9 @@
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/metadata/metadata.ts
6
9
  var _reactquery = require('@tanstack/react-query');
@@ -15,7 +18,7 @@ var addMetadataVersion = (datasetId, datasetVersion, datasetVersionMetaPostBodyB
15
18
  if (datasetVersionMetaPostBodyBody.annotations !== void 0) {
16
19
  formData.append("annotations", datasetVersionMetaPostBodyBody.annotations);
17
20
  }
18
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
21
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
19
22
  {
20
23
  url: `/dataset/${datasetId}/meta/${datasetVersion}`,
21
24
  method: "post",
@@ -34,7 +37,7 @@ var useAddMetadataVersion = (options) => {
34
37
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
35
38
  };
36
39
  var getMetadataVersion = (datasetId, datasetVersion, options, signal) => {
37
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
40
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
38
41
  {
39
42
  url: `/dataset/${datasetId}/meta/${datasetVersion}`,
40
43
  method: "get",
@@ -48,11 +51,9 @@ var useGetMetadataVersion = (datasetId, datasetVersion, options) => {
48
51
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
49
52
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetMetadataVersionQueryKey(datasetId, datasetVersion)));
50
53
  const queryFn = ({ signal }) => getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);
51
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
52
- enabled: !!(datasetId && datasetVersion),
53
- ...queryOptions
54
- });
55
- query.queryKey = queryKey;
54
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
55
+ const query = _reactquery.useQuery.call(void 0, customOptions);
56
+ query.queryKey = customOptions.queryKey;
56
57
  return query;
57
58
  };
58
59
  var addMetadata = (datasetId, datasetMetaPostBodyBody, options) => {
@@ -63,7 +64,7 @@ var addMetadata = (datasetId, datasetMetaPostBodyBody, options) => {
63
64
  if (datasetMetaPostBodyBody.labels !== void 0) {
64
65
  formData.append("labels", datasetMetaPostBodyBody.labels);
65
66
  }
66
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
67
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
67
68
  {
68
69
  url: `/dataset/${datasetId}/meta`,
69
70
  method: "post",
@@ -82,7 +83,7 @@ var useAddMetadata = (options) => {
82
83
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
83
84
  };
84
85
  var getMetadata = (datasetId, options, signal) => {
85
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
86
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
86
87
  { url: `/dataset/${datasetId}/meta`, method: "get", signal },
87
88
  options
88
89
  );
@@ -96,11 +97,9 @@ var useGetMetadata = (datasetId, options) => {
96
97
  const queryFn = ({
97
98
  signal
98
99
  }) => getMetadata(datasetId, requestOptions, signal);
99
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
100
- enabled: !!datasetId,
101
- ...queryOptions
102
- });
103
- query.queryKey = queryKey;
100
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
101
+ const query = _reactquery.useQuery.call(void 0, customOptions);
102
+ query.queryKey = customOptions.queryKey;
104
103
  return query;
105
104
  };
106
105