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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/accounting/accounting.cjs +31 -13
  2. package/accounting/accounting.cjs.map +1 -1
  3. package/accounting/accounting.d.cts +77 -0
  4. package/accounting/accounting.d.ts +10 -1
  5. package/accounting/accounting.js +29 -11
  6. package/accounting/accounting.js.map +1 -1
  7. package/admin/admin.cjs +67 -27
  8. package/admin/admin.cjs.map +1 -1
  9. package/admin/admin.d.cts +324 -0
  10. package/admin/admin.d.ts +55 -22
  11. package/admin/admin.js +57 -17
  12. package/admin/admin.js.map +1 -1
  13. package/application/application.cjs +23 -13
  14. package/application/application.cjs.map +1 -1
  15. package/application/application.d.cts +57 -0
  16. package/application/application.d.ts +7 -1
  17. package/application/application.js +22 -12
  18. package/application/application.js.map +1 -1
  19. package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
  20. package/chunk-J22A7LHX.cjs.map +1 -0
  21. package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
  22. package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
  23. package/configuration/configuration.cjs +13 -7
  24. package/configuration/configuration.cjs.map +1 -1
  25. package/configuration/configuration.d.cts +29 -0
  26. package/configuration/configuration.d.ts +4 -1
  27. package/configuration/configuration.js +13 -7
  28. package/configuration/configuration.js.map +1 -1
  29. package/{custom-instance-50c9dd5d.d.ts → custom-instance-3d66fe97.d.ts} +826 -826
  30. package/dataset/dataset.cjs +71 -72
  31. package/dataset/dataset.cjs.map +1 -1
  32. package/dataset/dataset.d.cts +315 -0
  33. package/dataset/dataset.d.ts +46 -16
  34. package/dataset/dataset.js +62 -63
  35. package/dataset/dataset.js.map +1 -1
  36. package/exchange-rate/exchange-rate.cjs +43 -32
  37. package/exchange-rate/exchange-rate.cjs.map +1 -1
  38. package/exchange-rate/exchange-rate.d.cts +180 -0
  39. package/exchange-rate/exchange-rate.d.ts +25 -7
  40. package/exchange-rate/exchange-rate.js +38 -27
  41. package/exchange-rate/exchange-rate.js.map +1 -1
  42. package/file/file.cjs +38 -22
  43. package/file/file.cjs.map +1 -1
  44. package/file/file.d.cts +154 -0
  45. package/file/file.d.ts +25 -10
  46. package/file/file.js +34 -18
  47. package/file/file.js.map +1 -1
  48. package/index.cjs +10 -10
  49. package/index.cjs.map +1 -1
  50. package/index.d.cts +2 -0
  51. package/index.d.ts +1 -1
  52. package/index.js +9 -9
  53. package/index.js.map +1 -1
  54. package/instance/instance.cjs +47 -37
  55. package/instance/instance.cjs.map +1 -1
  56. package/instance/instance.d.cts +215 -0
  57. package/instance/instance.d.ts +33 -12
  58. package/instance/instance.js +41 -31
  59. package/instance/instance.js.map +1 -1
  60. package/job/job.cjs +36 -19
  61. package/job/job.cjs.map +1 -1
  62. package/job/job.d.cts +85 -0
  63. package/job/job.d.ts +10 -1
  64. package/job/job.js +34 -17
  65. package/job/job.js.map +1 -1
  66. package/metadata/metadata.cjs +23 -26
  67. package/metadata/metadata.cjs.map +1 -1
  68. package/metadata/metadata.d.cts +132 -0
  69. package/metadata/metadata.d.ts +19 -7
  70. package/metadata/metadata.js +20 -23
  71. package/metadata/metadata.js.map +1 -1
  72. package/package.json +12 -12
  73. package/project/project.cjs +70 -48
  74. package/project/project.cjs.map +1 -1
  75. package/project/project.d.cts +377 -0
  76. package/project/project.d.ts +61 -25
  77. package/project/project.js +59 -37
  78. package/project/project.js.map +1 -1
  79. package/src/accounting/accounting.ts +179 -194
  80. package/src/admin/admin.ts +590 -735
  81. package/src/application/application.ts +125 -141
  82. package/src/configuration/configuration.ts +72 -60
  83. package/src/data-manager-api.schemas.ts +941 -942
  84. package/src/dataset/dataset.ts +591 -770
  85. package/src/exchange-rate/exchange-rate.ts +362 -478
  86. package/src/file/file.ts +292 -357
  87. package/src/instance/instance.ts +427 -533
  88. package/src/job/job.ts +187 -198
  89. package/src/metadata/metadata.ts +247 -339
  90. package/src/project/project.ts +669 -860
  91. package/src/task/task.ts +181 -202
  92. package/src/type/type.ts +72 -68
  93. package/src/user/user.ts +248 -286
  94. package/task/task.cjs +31 -15
  95. package/task/task.cjs.map +1 -1
  96. package/task/task.d.cts +103 -0
  97. package/task/task.d.ts +10 -1
  98. package/task/task.js +29 -13
  99. package/task/task.js.map +1 -1
  100. package/type/type.cjs +13 -7
  101. package/type/type.cjs.map +1 -1
  102. package/type/type.d.cts +31 -0
  103. package/type/type.d.ts +4 -1
  104. package/type/type.js +13 -7
  105. package/type/type.js.map +1 -1
  106. package/user/user.cjs +39 -28
  107. package/user/user.cjs.map +1 -1
  108. package/user/user.d.cts +104 -0
  109. package/user/user.d.ts +16 -4
  110. package/user/user.js +36 -25
  111. package/user/user.js.map +1 -1
  112. package/chunk-UZTHSGDT.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/instance/instance.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n 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 const getCreateInstanceMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof createInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getCreateInstanceMutationOptions(options);\n\n return useMutation(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 [\"data-manager-api\", `/instance`, ...(params ? [params] : [])] as const;\n\nexport const getGetInstancesQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getInstances>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, ...queryOptions };\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 queryOptions = getGetInstancesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * 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 check 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 const getDryRunInstanceMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof dryRunInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getDryRunInstanceMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * @summary Get detailed information about an 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 [\"data-manager-api\", `/instance/${instanceId}`] as const;\n\nexport const getGetInstanceQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getInstance>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, enabled: !!instanceId, ...queryOptions };\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 queryOptions = getGetInstanceQueryOptions(instanceId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * 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 const getTerminateInstanceMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof terminateInstance>>,\n TError,\n { instanceId: string },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getTerminateInstanceMutationOptions(options);\n\n return useMutation(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 const getPatchInstanceMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof patchInstance>>,\n TError,\n { instanceId: string; params?: PatchInstanceParams },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getPatchInstanceMutationOptions(options);\n\n return useMutation(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 const getDeleteInstanceTokenMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n TError,\n { instanceId: string; token: string },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getDeleteInstanceTokenMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA0C/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,4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GpC,YAQI;AACJ,QAAM,kBAAkB,sCAAsC,OAAO;AAErE,SAAO,YAAY,eAAe;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../src/instance/instance.ts"],"sourcesContent":["/**\n * Generated by orval v6.20.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetInstancesParams,\n InstanceDryRunPostResponse,\n InstanceGetResponse,\n InstancePostBodyBody,\n InstancePostResponse,\n InstancesGetResponse,\n PatchInstanceParams,\n TaskIdentity\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n\n/**\n * 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();\nformData.append('application_id', instancePostBodyBody.application_id)\nif(instancePostBodyBody.application_version !== undefined) {\n formData.append('application_version', instancePostBodyBody.application_version)\n }\nformData.append('project_id', instancePostBodyBody.project_id)\nformData.append('as_name', instancePostBodyBody.as_name)\nif(instancePostBodyBody.callback_url !== undefined) {\n formData.append('callback_url', instancePostBodyBody.callback_url)\n }\nif(instancePostBodyBody.callback_context !== undefined) {\n formData.append('callback_context', instancePostBodyBody.callback_context)\n }\nif(instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append('generate_callback_token', instancePostBodyBody.generate_callback_token.toString())\n }\nif(instancePostBodyBody.callback_token !== undefined) {\n formData.append('callback_token', instancePostBodyBody.callback_token)\n }\nif(instancePostBodyBody.debug !== undefined) {\n formData.append('debug', instancePostBodyBody.debug)\n }\nif(instancePostBodyBody.specification !== undefined) {\n formData.append('specification', instancePostBodyBody.specification)\n }\n\n return customInstance<InstancePostResponse>(\n {url: `/instance`, method: 'post',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\nexport const getCreateInstanceMutationOptions = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createInstance>>, TError,{data: InstancePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createInstance>>, TError,{data: InstancePostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createInstance>>, {data: InstancePostBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createInstance(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof createInstance>>>\n export type CreateInstanceMutationBody = InstancePostBodyBody\n export type CreateInstanceMutationError = ErrorType<void | DmError>\n\n /**\n * @summary Creates a new Job or Application instance\n */\nexport const useCreateInstance = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createInstance>>, TError,{data: InstancePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateInstanceMutationOptions(options);\n\n return useMutation(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>,signal?: AbortSignal\n) => {\n \n \n return customInstance<InstancesGetResponse>(\n {url: `/instance`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams,) => {\n \n return [\"data-manager-api\", `/instance`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetInstancesQueryOptions = <TData = Awaited<ReturnType<typeof getInstances>>, TError = ErrorType<void | DmError>>(params?: GetInstancesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getInstances>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetInstancesQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstances>>> = ({ signal }) => getInstances(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getInstances>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetInstancesQueryResult = NonNullable<Awaited<ReturnType<typeof getInstances>>>\nexport type GetInstancesQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get summary information about all Job and Application instances\n */\nexport const useGetInstances = <TData = Awaited<ReturnType<typeof getInstances>>, TError = ErrorType<void | DmError>>(\n params?: GetInstancesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getInstances>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetInstancesQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * 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 check 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();\nformData.append('application_id', instancePostBodyBody.application_id)\nif(instancePostBodyBody.application_version !== undefined) {\n formData.append('application_version', instancePostBodyBody.application_version)\n }\nformData.append('project_id', instancePostBodyBody.project_id)\nformData.append('as_name', instancePostBodyBody.as_name)\nif(instancePostBodyBody.callback_url !== undefined) {\n formData.append('callback_url', instancePostBodyBody.callback_url)\n }\nif(instancePostBodyBody.callback_context !== undefined) {\n formData.append('callback_context', instancePostBodyBody.callback_context)\n }\nif(instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append('generate_callback_token', instancePostBodyBody.generate_callback_token.toString())\n }\nif(instancePostBodyBody.callback_token !== undefined) {\n formData.append('callback_token', instancePostBodyBody.callback_token)\n }\nif(instancePostBodyBody.debug !== undefined) {\n formData.append('debug', instancePostBodyBody.debug)\n }\nif(instancePostBodyBody.specification !== undefined) {\n formData.append('specification', instancePostBodyBody.specification)\n }\n\n return customInstance<InstanceDryRunPostResponse>(\n {url: `/instance/dry-run`, method: 'post',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\nexport const getDryRunInstanceMutationOptions = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dryRunInstance>>, TError,{data: InstancePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof dryRunInstance>>, TError,{data: InstancePostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof dryRunInstance>>, {data: InstancePostBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return dryRunInstance(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DryRunInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof dryRunInstance>>>\n export type DryRunInstanceMutationBody = InstancePostBodyBody\n export type DryRunInstanceMutationError = ErrorType<void | DmError>\n\n /**\n * @summary Used to check the execution of new Job or Application instance\n */\nexport const useDryRunInstance = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dryRunInstance>>, TError,{data: InstancePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDryRunInstanceMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * @summary Get detailed information about an Instance\n */\nexport const getInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<InstanceGetResponse>(\n {url: `/instance/${instanceId}`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetInstanceQueryKey = (instanceId: string,) => {\n \n return [\"data-manager-api\", `/instance/${instanceId}`] as const;\n }\n\n \nexport const getGetInstanceQueryOptions = <TData = Awaited<ReturnType<typeof getInstance>>, TError = ErrorType<void | DmError>>(instanceId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getInstance>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetInstanceQueryKey(instanceId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstance>>> = ({ signal }) => getInstance(instanceId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(instanceId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getInstance>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetInstanceQueryResult = NonNullable<Awaited<ReturnType<typeof getInstance>>>\nexport type GetInstanceQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get detailed information about an Instance\n */\nexport const useGetInstance = <TData = Awaited<ReturnType<typeof getInstance>>, TError = ErrorType<void | DmError>>(\n instanceId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getInstance>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetInstanceQueryOptions(instanceId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * 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 \n return customInstance<TaskIdentity>(\n {url: `/instance/${instanceId}`, method: 'delete'\n },\n options);\n }\n \n\n\nexport const getTerminateInstanceMutationOptions = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof terminateInstance>>, TError,{instanceId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof terminateInstance>>, TError,{instanceId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof terminateInstance>>, {instanceId: string}> = (props) => {\n const {instanceId} = props ?? {};\n\n return terminateInstance(instanceId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type TerminateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof terminateInstance>>>\n \n export type TerminateInstanceMutationError = ErrorType<void | DmError>\n\n /**\n * @summary Delete a Job or Application Instance\n */\nexport const useTerminateInstance = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof terminateInstance>>, TError,{instanceId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getTerminateInstanceMutationOptions(options);\n\n return useMutation(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 \n return customInstance<void>(\n {url: `/instance/${instanceId}`, method: 'patch',\n params\n },\n options);\n }\n \n\n\nexport const getPatchInstanceMutationOptions = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchInstance>>, TError,{instanceId: string;params?: PatchInstanceParams}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchInstance>>, TError,{instanceId: string;params?: PatchInstanceParams}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchInstance>>, {instanceId: string;params?: PatchInstanceParams}> = (props) => {\n const {instanceId,params} = props ?? {};\n\n return patchInstance(instanceId,params,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof patchInstance>>>\n \n export type PatchInstanceMutationError = ErrorType<DmError>\n\n /**\n * @summary Update a Job or Application Instance\n */\nexport const usePatchInstance = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchInstance>>, TError,{instanceId: string;params?: PatchInstanceParams}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchInstanceMutationOptions(options);\n\n return useMutation(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 \n return customInstance<void>(\n {url: `/instance/${instanceId}/token/${token}`, method: 'delete'\n },\n options);\n }\n \n\n\nexport const getDeleteInstanceTokenMutationOptions = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteInstanceToken>>, TError,{instanceId: string;token: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteInstanceToken>>, TError,{instanceId: string;token: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteInstanceToken>>, {instanceId: string;token: string}> = (props) => {\n const {instanceId,token} = props ?? {};\n\n return deleteInstanceToken(instanceId,token,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteInstanceTokenMutationResult = NonNullable<Awaited<ReturnType<typeof deleteInstanceToken>>>\n \n export type DeleteInstanceTokenMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete (revoke) the Instance Token\n */\nexport const useDeleteInstanceToken = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteInstanceToken>>, TError,{instanceId: string;token: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteInstanceTokenMutationOptions(options);\n\n return useMutation(mutationOptions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,CAAC;AAKpE,QAAM,aAA6H,CAAC,UAAU;AAC1I,UAAM,EAAC,YAAW,OAAM,IAAI,SAAS,CAAC;AAEtC,WAAQ,cAAc,YAAW,QAAO,cAAc;AAAA,EACxD;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,mBAAmB,CAER,YACnB;AAEC,QAAM,kBAAkB,gCAAgC,OAAO;AAE/D,SAAO,YAAY,eAAe;AACpC;AAUG,IAAM,sBAAsB,CAC/B,YACA,OACH,YAAsD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,aAAa,UAAU,UAAU,KAAK;AAAA,MAAI,QAAQ;AAAA,IAC1D;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,wCAAwC,CAE7B,YACuG;AAC9H,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAoH,CAAC,UAAU;AACjI,UAAM,EAAC,YAAW,MAAK,IAAI,SAAS,CAAC;AAErC,WAAQ,oBAAoB,YAAW,OAAM,cAAc;AAAA,EAC7D;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,yBAAyB,CAEd,YACnB;AAEC,QAAM,kBAAkB,sCAAsC,OAAO;AAErE,SAAO,YAAY,eAAe;AACpC;","names":[]}
package/job/job.cjs CHANGED
@@ -1,22 +1,29 @@
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 _chunkUZTHSGDTcjs = require('../chunk-UZTHSGDT.cjs');
3
+ var _chunkJ22A7LHXcjs = require('../chunk-J22A7LHX.cjs');
4
4
 
5
5
  // src/job/job.ts
6
+
7
+
6
8
  var _reactquery = require('@tanstack/react-query');
7
9
  var getJobs = (params, options, signal) => {
8
- return _chunkUZTHSGDTcjs.customInstance.call(void 0,
9
- { url: `/job`, method: "get", params, signal },
10
+ return _chunkJ22A7LHXcjs.customInstance.call(void 0,
11
+ {
12
+ url: `/job`,
13
+ method: "get",
14
+ params,
15
+ signal
16
+ },
10
17
  options
11
18
  );
12
19
  };
13
- var getGetJobsQueryKey = (params) => ["data-manager-api", `/job`, ...params ? [params] : []];
20
+ var getGetJobsQueryKey = (params) => {
21
+ return ["data-manager-api", `/job`, ...params ? [params] : []];
22
+ };
14
23
  var getGetJobsQueryOptions = (params, options) => {
15
24
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
16
25
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetJobsQueryKey(params)));
17
- const queryFn = ({
18
- signal
19
- }) => getJobs(params, requestOptions, signal);
26
+ const queryFn = ({ signal }) => getJobs(params, requestOptions, signal);
20
27
  return { queryKey, queryFn, ...queryOptions };
21
28
  };
22
29
  var useGetJobs = (params, options) => {
@@ -26,18 +33,23 @@ var useGetJobs = (params, options) => {
26
33
  return query;
27
34
  };
28
35
  var getJobByVersion = (params, options, signal) => {
29
- return _chunkUZTHSGDTcjs.customInstance.call(void 0,
30
- { url: `/job/get-by-version`, method: "get", params, signal },
36
+ return _chunkJ22A7LHXcjs.customInstance.call(void 0,
37
+ {
38
+ url: `/job/get-by-version`,
39
+ method: "get",
40
+ params,
41
+ signal
42
+ },
31
43
  options
32
44
  );
33
45
  };
34
- var getGetJobByVersionQueryKey = (params) => ["data-manager-api", `/job/get-by-version`, ...params ? [params] : []];
46
+ var getGetJobByVersionQueryKey = (params) => {
47
+ return ["data-manager-api", `/job/get-by-version`, ...params ? [params] : []];
48
+ };
35
49
  var getGetJobByVersionQueryOptions = (params, options) => {
36
50
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
37
51
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetJobByVersionQueryKey(params)));
38
- const queryFn = ({
39
- signal
40
- }) => getJobByVersion(params, requestOptions, signal);
52
+ const queryFn = ({ signal }) => getJobByVersion(params, requestOptions, signal);
41
53
  return { queryKey, queryFn, ...queryOptions };
42
54
  };
43
55
  var useGetJobByVersion = (params, options) => {
@@ -47,18 +59,23 @@ var useGetJobByVersion = (params, options) => {
47
59
  return query;
48
60
  };
49
61
  var getJob = (jobId, params, options, signal) => {
50
- return _chunkUZTHSGDTcjs.customInstance.call(void 0,
51
- { url: `/job/${jobId}`, method: "get", params, signal },
62
+ return _chunkJ22A7LHXcjs.customInstance.call(void 0,
63
+ {
64
+ url: `/job/${jobId}`,
65
+ method: "get",
66
+ params,
67
+ signal
68
+ },
52
69
  options
53
70
  );
54
71
  };
55
- var getGetJobQueryKey = (jobId, params) => ["data-manager-api", `/job/${jobId}`, ...params ? [params] : []];
72
+ var getGetJobQueryKey = (jobId, params) => {
73
+ return ["data-manager-api", `/job/${jobId}`, ...params ? [params] : []];
74
+ };
56
75
  var getGetJobQueryOptions = (jobId, params, options) => {
57
76
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
58
77
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetJobQueryKey(jobId, params)));
59
- const queryFn = ({
60
- signal
61
- }) => getJob(jobId, params, requestOptions, signal);
78
+ const queryFn = ({ signal }) => getJob(jobId, params, requestOptions, signal);
62
79
  return { queryKey, queryFn, enabled: !!jobId, ...queryOptions };
63
80
  };
64
81
  var useGetJob = (jobId, params, options) => {
package/job/job.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/job/job.ts"],"names":[],"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,WACjC,CAAC,oBAAoB,QAAQ,GAAI,SAAS,CAAC,MA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QAAQ,OAAO;AAAA,IACtD;AAAA,EACF;AACF;AAEO,IAAM,oBAAoB,CAAC,OAAe,WAC/C,CAAC,oBAAoB,QAAQ,SAAS,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE5D,IAAM,wBAAwB,CAInC,OACA,QACA,YAMG;AACH,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,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,OAAO,GAAG,aAAa;AAChE;AAKO,IAAM,YAAY,CAIvB,OACA,QACA,YAI2D;AAC3D,QAAM,eAAe,sBAAsB,OAAO,QAAQ,OAAO;AAEjE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport { useQuery } 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 service.\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 [\"data-manager-api\", `/job`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobsQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, ...queryOptions };\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 queryOptions = getGetJobsQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets a Job based on its **collection**, **job** and **version**.\n\nJob availability will vary as Jobs are added to the service. 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 [\"data-manager-api\", `/job/get-by-version`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobByVersionQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getJobByVersion>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\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 queryOptions = getGetJobByVersionQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * 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 [\"data-manager-api\", `/job/${jobId}`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getJob>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, enabled: !!jobId, ...queryOptions };\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 queryOptions = getGetJobQueryOptions(jobId, params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.query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AAM,YAAY,6CAAc,aAAY,2BAA2B,MAAM;AAI3E,QAAM,UAAsE,CAAC,EAAE,OAAO,MAAM,gBAAgB,QAAQ,gBAAgB,MAAM;AAM3I,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,qBAAqB,CACjC,QAA+B,YAEgC;AAE9D,QAAM,eAAe,+BAA+B,QAAO,OAAO;AAElE,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAWO,IAAM,SAAS,CAClB,OACA,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,QAAQ,KAAK;AAAA,MAAI,QAAQ;AAAA,MAC7B;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,oBAAoB,CAAC,OAC9B,WAA2B;AAE3B,SAAO,CAAC,oBAAoB,QAAQ,KAAK,IAAI,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AACvE;AAGG,IAAM,wBAAwB,CAAiF,OAClH,QAAuB,YACtB;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,kBAAkB,OAAM,MAAM;AAIxE,QAAM,UAA6D,CAAC,EAAE,OAAO,MAAM,OAAO,OAAM,QAAQ,gBAAgB,MAAM;AAM/H,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,OAAQ,GAAG,aAAY;AACnE;AAQO,IAAM,YAAY,CACxB,OACG,QAAuB,YAEqC;AAE9D,QAAM,eAAe,sBAAsB,OAAM,QAAO,OAAO;AAE/D,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.20.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport {\n useQuery\n} from '@tanstack/react-query'\nimport type {\n QueryFunction,\n QueryKey,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetJobByVersionParams,\n GetJobParams,\n GetJobsParams,\n JobGetResponse,\n JobsGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n\n/**\n * 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 service.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (\n params?: GetJobsParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<JobsGetResponse>(\n {url: `/job`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetJobsQueryKey = (params?: GetJobsParams,) => {\n \n return [\"data-manager-api\", `/job`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetJobsQueryOptions = <TData = Awaited<ReturnType<typeof getJobs>>, TError = ErrorType<DmError>>(params?: GetJobsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobsQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobs>>> = ({ signal }) => getJobs(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetJobsQueryResult = NonNullable<Awaited<ReturnType<typeof getJobs>>>\nexport type GetJobsQueryError = ErrorType<DmError>\n\n/**\n * @summary Get all Jobs available to you\n */\nexport const useGetJobs = <TData = Awaited<ReturnType<typeof getJobs>>, TError = ErrorType<DmError>>(\n params?: GetJobsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetJobsQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets a Job based on its **collection**, **job** and **version**.\n\nJob availability will vary as Jobs are added to the service. 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>,signal?: AbortSignal\n) => {\n \n \n return customInstance<JobGetResponse>(\n {url: `/job/get-by-version`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetJobByVersionQueryKey = (params: GetJobByVersionParams,) => {\n \n return [\"data-manager-api\", `/job/get-by-version`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetJobByVersionQueryOptions = <TData = Awaited<ReturnType<typeof getJobByVersion>>, TError = ErrorType<DmError>>(params: GetJobByVersionParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJobByVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobByVersionQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobByVersion>>> = ({ signal }) => getJobByVersion(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getJobByVersion>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetJobByVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getJobByVersion>>>\nexport type GetJobByVersionQueryError = ErrorType<DmError>\n\n/**\n * @summary Get a Job by its version\n */\nexport const useGetJobByVersion = <TData = Awaited<ReturnType<typeof getJobByVersion>>, TError = ErrorType<DmError>>(\n params: GetJobByVersionParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJobByVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetJobByVersionQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * 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>,signal?: AbortSignal\n) => {\n \n \n return customInstance<JobGetResponse>(\n {url: `/job/${jobId}`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetJobQueryKey = (jobId: number,\n params?: GetJobParams,) => {\n \n return [\"data-manager-api\", `/job/${jobId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetJobQueryOptions = <TData = Awaited<ReturnType<typeof getJob>>, TError = ErrorType<void | DmError>>(jobId: number,\n params?: GetJobParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJob>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobQueryKey(jobId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJob>>> = ({ signal }) => getJob(jobId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(jobId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getJob>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>\nexport type GetJobQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get details of a specific Job\n */\nexport const useGetJob = <TData = Awaited<ReturnType<typeof getJob>>, TError = ErrorType<void | DmError>>(\n jobId: number,\n params?: GetJobParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJob>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetJobQueryOptions(jobId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"]}
package/job/job.d.cts ADDED
@@ -0,0 +1,85 @@
1
+ import { UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
2
+ import { i as GetJobsParams, bX as customInstance, bk as JobsGetResponse, bY as ErrorType, bT as DmError, h as GetJobByVersionParams, bm as JobGetResponse, g as GetJobParams } from '../custom-instance-3d66fe97.js';
3
+ import 'axios';
4
+
5
+ type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
6
+ /**
7
+ * Get a list of all Jobs available to you that can be instantiated via the `/instance` endpoint.
8
+
9
+ Job availability will vary as Jobs are added to the service.
10
+
11
+ * @summary Get all Jobs available to you
12
+ */
13
+ declare const getJobs: (params?: GetJobsParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<JobsGetResponse>;
14
+ declare const getGetJobsQueryKey: (params?: GetJobsParams) => readonly ["data-manager-api", "/job", ...GetJobsParams[]];
15
+ declare const getGetJobsQueryOptions: <TData = JobsGetResponse, TError = ErrorType<DmError>>(params?: GetJobsParams, options?: {
16
+ query?: UseQueryOptions<JobsGetResponse, TError, TData, QueryKey> | undefined;
17
+ request?: SecondParameter<typeof customInstance>;
18
+ } | undefined) => UseQueryOptions<JobsGetResponse, TError, TData, QueryKey> & {
19
+ queryKey: QueryKey;
20
+ };
21
+ type GetJobsQueryResult = NonNullable<Awaited<ReturnType<typeof getJobs>>>;
22
+ type GetJobsQueryError = ErrorType<DmError>;
23
+ /**
24
+ * @summary Get all Jobs available to you
25
+ */
26
+ declare const useGetJobs: <TData = JobsGetResponse, TError = ErrorType<DmError>>(params?: GetJobsParams, options?: {
27
+ query?: UseQueryOptions<JobsGetResponse, TError, TData, QueryKey> | undefined;
28
+ request?: SecondParameter<typeof customInstance>;
29
+ } | undefined) => UseQueryResult<TData, TError> & {
30
+ queryKey: QueryKey;
31
+ };
32
+ /**
33
+ * Gets a Job based on its **collection**, **job** and **version**.
34
+
35
+ Job availability will vary as Jobs are added to the service. Jobs that have been added are unlikely to be removed.
36
+
37
+ * @summary Get a Job by its version
38
+ */
39
+ declare const getJobByVersion: (params: GetJobByVersionParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<JobGetResponse>;
40
+ declare const getGetJobByVersionQueryKey: (params: GetJobByVersionParams) => readonly ["data-manager-api", "/job/get-by-version", ...GetJobByVersionParams[]];
41
+ declare const getGetJobByVersionQueryOptions: <TData = JobGetResponse, TError = ErrorType<DmError>>(params: GetJobByVersionParams, options?: {
42
+ query?: UseQueryOptions<JobGetResponse, TError, TData, QueryKey> | undefined;
43
+ request?: SecondParameter<typeof customInstance>;
44
+ } | undefined) => UseQueryOptions<JobGetResponse, TError, TData, QueryKey> & {
45
+ queryKey: QueryKey;
46
+ };
47
+ type GetJobByVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getJobByVersion>>>;
48
+ type GetJobByVersionQueryError = ErrorType<DmError>;
49
+ /**
50
+ * @summary Get a Job by its version
51
+ */
52
+ declare const useGetJobByVersion: <TData = JobGetResponse, TError = ErrorType<DmError>>(params: GetJobByVersionParams, options?: {
53
+ query?: UseQueryOptions<JobGetResponse, TError, TData, QueryKey> | undefined;
54
+ request?: SecondParameter<typeof customInstance>;
55
+ } | undefined) => UseQueryResult<TData, TError> & {
56
+ queryKey: QueryKey;
57
+ };
58
+ /**
59
+ * Get details of a specific Job available to you that can be instantiated.
60
+
61
+ To 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.
62
+
63
+ * @summary Get details of a specific Job
64
+ */
65
+ declare const getJob: (jobId: number, params?: GetJobParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<JobGetResponse>;
66
+ declare const getGetJobQueryKey: (jobId: number, params?: GetJobParams) => readonly ["data-manager-api", `/job/${number}`, ...GetJobParams[]];
67
+ declare const getGetJobQueryOptions: <TData = JobGetResponse, TError = ErrorType<void | DmError>>(jobId: number, params?: GetJobParams, options?: {
68
+ query?: UseQueryOptions<JobGetResponse, TError, TData, QueryKey> | undefined;
69
+ request?: SecondParameter<typeof customInstance>;
70
+ } | undefined) => UseQueryOptions<JobGetResponse, TError, TData, QueryKey> & {
71
+ queryKey: QueryKey;
72
+ };
73
+ type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>;
74
+ type GetJobQueryError = ErrorType<void | DmError>;
75
+ /**
76
+ * @summary Get details of a specific Job
77
+ */
78
+ declare const useGetJob: <TData = JobGetResponse, TError = ErrorType<void | DmError>>(jobId: number, params?: GetJobParams, options?: {
79
+ query?: UseQueryOptions<JobGetResponse, TError, TData, QueryKey> | undefined;
80
+ request?: SecondParameter<typeof customInstance>;
81
+ } | undefined) => UseQueryResult<TData, TError> & {
82
+ queryKey: QueryKey;
83
+ };
84
+
85
+ export { GetJobByVersionQueryError, GetJobByVersionQueryResult, GetJobQueryError, GetJobQueryResult, GetJobsQueryError, GetJobsQueryResult, getGetJobByVersionQueryKey, getGetJobByVersionQueryOptions, getGetJobQueryKey, getGetJobQueryOptions, getGetJobsQueryKey, getGetJobsQueryOptions, getJob, getJobByVersion, getJobs, useGetJob, useGetJobByVersion, useGetJobs };
package/job/job.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
2
- import { i as GetJobsParams, bX as customInstance, bk as JobsGetResponse, bY as ErrorType, bT as DmError, h as GetJobByVersionParams, bm as JobGetResponse, g as GetJobParams } from '../custom-instance-50c9dd5d.js';
2
+ import { i as GetJobsParams, bX as customInstance, bk as JobsGetResponse, bY as ErrorType, bT as DmError, h as GetJobByVersionParams, bm as JobGetResponse, g as GetJobParams } from '../custom-instance-3d66fe97.js';
3
3
  import 'axios';
4
4
 
5
5
  type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
@@ -20,6 +20,9 @@ declare const getGetJobsQueryOptions: <TData = JobsGetResponse, TError = ErrorTy
20
20
  };
21
21
  type GetJobsQueryResult = NonNullable<Awaited<ReturnType<typeof getJobs>>>;
22
22
  type GetJobsQueryError = ErrorType<DmError>;
23
+ /**
24
+ * @summary Get all Jobs available to you
25
+ */
23
26
  declare const useGetJobs: <TData = JobsGetResponse, TError = ErrorType<DmError>>(params?: GetJobsParams, options?: {
24
27
  query?: UseQueryOptions<JobsGetResponse, TError, TData, QueryKey> | undefined;
25
28
  request?: SecondParameter<typeof customInstance>;
@@ -43,6 +46,9 @@ declare const getGetJobByVersionQueryOptions: <TData = JobGetResponse, TError =
43
46
  };
44
47
  type GetJobByVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getJobByVersion>>>;
45
48
  type GetJobByVersionQueryError = ErrorType<DmError>;
49
+ /**
50
+ * @summary Get a Job by its version
51
+ */
46
52
  declare const useGetJobByVersion: <TData = JobGetResponse, TError = ErrorType<DmError>>(params: GetJobByVersionParams, options?: {
47
53
  query?: UseQueryOptions<JobGetResponse, TError, TData, QueryKey> | undefined;
48
54
  request?: SecondParameter<typeof customInstance>;
@@ -66,6 +72,9 @@ declare const getGetJobQueryOptions: <TData = JobGetResponse, TError = ErrorType
66
72
  };
67
73
  type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>;
68
74
  type GetJobQueryError = ErrorType<void | DmError>;
75
+ /**
76
+ * @summary Get details of a specific Job
77
+ */
69
78
  declare const useGetJob: <TData = JobGetResponse, TError = ErrorType<void | DmError>>(jobId: number, params?: GetJobParams, options?: {
70
79
  query?: UseQueryOptions<JobGetResponse, TError, TData, QueryKey> | undefined;
71
80
  request?: SecondParameter<typeof customInstance>;
package/job/job.js CHANGED
@@ -1,22 +1,29 @@
1
1
  import {
2
2
  customInstance
3
- } from "../chunk-3RNIDX7T.js";
3
+ } from "../chunk-UKA7G3OB.js";
4
4
 
5
5
  // src/job/job.ts
6
- import { useQuery } from "@tanstack/react-query";
6
+ import {
7
+ useQuery
8
+ } from "@tanstack/react-query";
7
9
  var getJobs = (params, options, signal) => {
8
10
  return customInstance(
9
- { url: `/job`, method: "get", params, signal },
11
+ {
12
+ url: `/job`,
13
+ method: "get",
14
+ params,
15
+ signal
16
+ },
10
17
  options
11
18
  );
12
19
  };
13
- var getGetJobsQueryKey = (params) => ["data-manager-api", `/job`, ...params ? [params] : []];
20
+ var getGetJobsQueryKey = (params) => {
21
+ return ["data-manager-api", `/job`, ...params ? [params] : []];
22
+ };
14
23
  var getGetJobsQueryOptions = (params, options) => {
15
24
  const { query: queryOptions, request: requestOptions } = options ?? {};
16
25
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetJobsQueryKey(params);
17
- const queryFn = ({
18
- signal
19
- }) => getJobs(params, requestOptions, signal);
26
+ const queryFn = ({ signal }) => getJobs(params, requestOptions, signal);
20
27
  return { queryKey, queryFn, ...queryOptions };
21
28
  };
22
29
  var useGetJobs = (params, options) => {
@@ -27,17 +34,22 @@ var useGetJobs = (params, options) => {
27
34
  };
28
35
  var getJobByVersion = (params, options, signal) => {
29
36
  return customInstance(
30
- { url: `/job/get-by-version`, method: "get", params, signal },
37
+ {
38
+ url: `/job/get-by-version`,
39
+ method: "get",
40
+ params,
41
+ signal
42
+ },
31
43
  options
32
44
  );
33
45
  };
34
- var getGetJobByVersionQueryKey = (params) => ["data-manager-api", `/job/get-by-version`, ...params ? [params] : []];
46
+ var getGetJobByVersionQueryKey = (params) => {
47
+ return ["data-manager-api", `/job/get-by-version`, ...params ? [params] : []];
48
+ };
35
49
  var getGetJobByVersionQueryOptions = (params, options) => {
36
50
  const { query: queryOptions, request: requestOptions } = options ?? {};
37
51
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetJobByVersionQueryKey(params);
38
- const queryFn = ({
39
- signal
40
- }) => getJobByVersion(params, requestOptions, signal);
52
+ const queryFn = ({ signal }) => getJobByVersion(params, requestOptions, signal);
41
53
  return { queryKey, queryFn, ...queryOptions };
42
54
  };
43
55
  var useGetJobByVersion = (params, options) => {
@@ -48,17 +60,22 @@ var useGetJobByVersion = (params, options) => {
48
60
  };
49
61
  var getJob = (jobId, params, options, signal) => {
50
62
  return customInstance(
51
- { url: `/job/${jobId}`, method: "get", params, signal },
63
+ {
64
+ url: `/job/${jobId}`,
65
+ method: "get",
66
+ params,
67
+ signal
68
+ },
52
69
  options
53
70
  );
54
71
  };
55
- var getGetJobQueryKey = (jobId, params) => ["data-manager-api", `/job/${jobId}`, ...params ? [params] : []];
72
+ var getGetJobQueryKey = (jobId, params) => {
73
+ return ["data-manager-api", `/job/${jobId}`, ...params ? [params] : []];
74
+ };
56
75
  var getGetJobQueryOptions = (jobId, params, options) => {
57
76
  const { query: queryOptions, request: requestOptions } = options ?? {};
58
77
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetJobQueryKey(jobId, params);
59
- const queryFn = ({
60
- signal
61
- }) => getJob(jobId, params, requestOptions, signal);
78
+ const queryFn = ({ signal }) => getJob(jobId, params, requestOptions, signal);
62
79
  return { queryKey, queryFn, enabled: !!jobId, ...queryOptions };
63
80
  };
64
81
  var useGetJob = (jobId, params, options) => {
package/job/job.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/job/job.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport { useQuery } 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 service.\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 [\"data-manager-api\", `/job`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobsQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, ...queryOptions };\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 queryOptions = getGetJobsQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets a Job based on its **collection**, **job** and **version**.\n\nJob availability will vary as Jobs are added to the service. 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 [\"data-manager-api\", `/job/get-by-version`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobByVersionQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getJobByVersion>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\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 queryOptions = getGetJobByVersionQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * 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 [\"data-manager-api\", `/job/${jobId}`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getJob>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, enabled: !!jobId, ...queryOptions };\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 queryOptions = getGetJobQueryOptions(jobId, params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,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,WACjC,CAAC,oBAAoB,QAAQ,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEnD,IAAM,yBAAyB,CAIpC,QACA,YAMG;AACH,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,SAAO,EAAE,UAAU,SAAS,GA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kBAAkB,OAAO,MAAM;AAE1E,QAAM,UAA6D,CAAC;AAAA,IAClE;AAAA,EACF,MAAM,OAAO,OAAO,QAAQ,gBAAgB,MAAM;AAElD,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,OAAO,GAAG,aAAa;AAChE;AAKO,IAAM,YAAY,CAIvB,OACA,QACA,YAI2D;AAC3D,QAAM,eAAe,sBAAsB,OAAO,QAAQ,OAAO;AAEjE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/job/job.ts"],"sourcesContent":["/**\n * Generated by orval v6.20.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport {\n useQuery\n} from '@tanstack/react-query'\nimport type {\n QueryFunction,\n QueryKey,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetJobByVersionParams,\n GetJobParams,\n GetJobsParams,\n JobGetResponse,\n JobsGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n\n/**\n * 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 service.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (\n params?: GetJobsParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<JobsGetResponse>(\n {url: `/job`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetJobsQueryKey = (params?: GetJobsParams,) => {\n \n return [\"data-manager-api\", `/job`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetJobsQueryOptions = <TData = Awaited<ReturnType<typeof getJobs>>, TError = ErrorType<DmError>>(params?: GetJobsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobsQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobs>>> = ({ signal }) => getJobs(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetJobsQueryResult = NonNullable<Awaited<ReturnType<typeof getJobs>>>\nexport type GetJobsQueryError = ErrorType<DmError>\n\n/**\n * @summary Get all Jobs available to you\n */\nexport const useGetJobs = <TData = Awaited<ReturnType<typeof getJobs>>, TError = ErrorType<DmError>>(\n params?: GetJobsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetJobsQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets a Job based on its **collection**, **job** and **version**.\n\nJob availability will vary as Jobs are added to the service. 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>,signal?: AbortSignal\n) => {\n \n \n return customInstance<JobGetResponse>(\n {url: `/job/get-by-version`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetJobByVersionQueryKey = (params: GetJobByVersionParams,) => {\n \n return [\"data-manager-api\", `/job/get-by-version`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetJobByVersionQueryOptions = <TData = Awaited<ReturnType<typeof getJobByVersion>>, TError = ErrorType<DmError>>(params: GetJobByVersionParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJobByVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobByVersionQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobByVersion>>> = ({ signal }) => getJobByVersion(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getJobByVersion>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetJobByVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getJobByVersion>>>\nexport type GetJobByVersionQueryError = ErrorType<DmError>\n\n/**\n * @summary Get a Job by its version\n */\nexport const useGetJobByVersion = <TData = Awaited<ReturnType<typeof getJobByVersion>>, TError = ErrorType<DmError>>(\n params: GetJobByVersionParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJobByVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetJobByVersionQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * 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>,signal?: AbortSignal\n) => {\n \n \n return customInstance<JobGetResponse>(\n {url: `/job/${jobId}`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetJobQueryKey = (jobId: number,\n params?: GetJobParams,) => {\n \n return [\"data-manager-api\", `/job/${jobId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetJobQueryOptions = <TData = Awaited<ReturnType<typeof getJob>>, TError = ErrorType<void | DmError>>(jobId: number,\n params?: GetJobParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJob>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobQueryKey(jobId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJob>>> = ({ signal }) => getJob(jobId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(jobId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getJob>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>\nexport type GetJobQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get details of a specific Job\n */\nexport const useGetJob = <TData = Awaited<ReturnType<typeof getJob>>, TError = ErrorType<void | DmError>>(\n jobId: number,\n params?: GetJobParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getJob>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetJobQueryOptions(jobId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,OACK;AAmCA,IAAM,UAAU,CACnB,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAQ,QAAQ;AAAA,MACpB;AAAA,MAAQ;AAAA,IACZ;AAA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