@squonk/data-manager-client 1.2.8 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/accounting/accounting.cjs +51 -8
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +61 -10
- package/accounting/accounting.d.ts +61 -10
- package/accounting/accounting.js +49 -6
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +67 -24
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +75 -24
- package/admin/admin.d.ts +75 -24
- package/admin/admin.js +56 -13
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +35 -6
- package/application/application.cjs.map +1 -1
- package/application/application.d.cts +42 -8
- package/application/application.d.ts +42 -8
- package/application/application.js +34 -5
- package/application/application.js.map +1 -1
- package/{chunk-UKA7G3OB.js → chunk-EBOQPVLG.js} +2 -2
- package/{chunk-UKA7G3OB.js.map → chunk-EBOQPVLG.js.map} +1 -1
- package/{chunk-J22A7LHX.cjs → chunk-TKLTUR4R.cjs} +2 -2
- package/chunk-TKLTUR4R.cjs.map +1 -0
- package/configuration/configuration.cjs +19 -4
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +23 -6
- package/configuration/configuration.d.ts +23 -6
- package/configuration/configuration.js +19 -4
- package/configuration/configuration.js.map +1 -1
- package/dataset/dataset.cjs +93 -22
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.cts +105 -20
- package/dataset/dataset.d.ts +105 -20
- package/dataset/dataset.js +83 -12
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +71 -14
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.cts +83 -15
- package/exchange-rate/exchange-rate.d.ts +83 -15
- package/exchange-rate/exchange-rate.js +65 -8
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file-and-path/file-and-path.cjs +45 -16
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +48 -14
- package/file-and-path/file-and-path.d.ts +48 -14
- package/file-and-path/file-and-path.js +39 -10
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs +9 -2
- package/index.cjs.map +1 -1
- package/index.d.cts +2033 -2
- package/index.d.ts +2033 -2
- package/index.js +8 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +45 -16
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.cts +48 -14
- package/instance/instance.d.ts +48 -14
- package/instance/instance.js +38 -9
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +51 -8
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +61 -10
- package/job/job.d.ts +61 -10
- package/job/job.js +49 -6
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +39 -10
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.cts +45 -11
- package/metadata/metadata.d.ts +45 -11
- package/metadata/metadata.js +36 -7
- package/metadata/metadata.js.map +1 -1
- package/package.json +11 -11
- package/project/project.cjs +83 -26
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +89 -21
- package/project/project.d.ts +89 -21
- package/project/project.js +71 -14
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +136 -22
- package/src/admin/admin.ts +148 -50
- package/src/application/application.ts +93 -18
- package/src/configuration/configuration.ts +50 -14
- package/src/custom-instance.ts +3 -4
- package/src/data-manager-api.schemas.ts +59 -33
- package/src/dataset/dataset.ts +233 -45
- package/src/exchange-rate/exchange-rate.ts +185 -32
- package/src/file-and-path/file-and-path.ts +98 -33
- package/src/instance/instance.ts +98 -33
- package/src/job/job.ts +138 -22
- package/src/metadata/metadata.ts +97 -24
- package/src/project/project.ts +191 -50
- package/src/task/task.ts +96 -21
- package/src/type/type.ts +50 -14
- package/src/user/user.ts +137 -25
- package/task/task.cjs +37 -8
- package/task/task.cjs.map +1 -1
- package/task/task.d.cts +44 -10
- package/task/task.d.ts +44 -10
- package/task/task.js +35 -6
- package/task/task.js.map +1 -1
- package/type/type.cjs +19 -4
- package/type/type.cjs.map +1 -1
- package/type/type.d.cts +23 -6
- package/type/type.d.ts +23 -6
- package/type/type.js +19 -4
- package/type/type.js.map +1 -1
- package/user/user.cjs +53 -10
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +63 -12
- package/user/user.d.ts +63 -12
- package/user/user.js +49 -6
- package/user/user.js.map +1 -1
- package/chunk-J22A7LHX.cjs.map +0 -1
- package/custom-instance-37ed2460.d.ts +0 -2014
package/task/task.cjs
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
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
|
|
3
|
+
var _chunkTKLTUR4Rcjs = require('../chunk-TKLTUR4R.cjs');
|
|
4
4
|
|
|
5
5
|
// src/task/task.ts
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
|
|
9
10
|
var _reactquery = require('@tanstack/react-query');
|
|
10
11
|
var getTasks = (params, options, signal) => {
|
|
11
|
-
return
|
|
12
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
12
13
|
{
|
|
13
14
|
url: `/task`,
|
|
14
|
-
method: "
|
|
15
|
+
method: "GET",
|
|
15
16
|
params,
|
|
16
17
|
signal
|
|
17
18
|
},
|
|
@@ -33,11 +34,23 @@ var useGetTasks = (params, options) => {
|
|
|
33
34
|
query.queryKey = queryOptions.queryKey;
|
|
34
35
|
return query;
|
|
35
36
|
};
|
|
37
|
+
var getGetTasksSuspenseQueryOptions = (params, options) => {
|
|
38
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
39
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetTasksQueryKey(params)));
|
|
40
|
+
const queryFn = ({ signal }) => getTasks(params, requestOptions, signal);
|
|
41
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
42
|
+
};
|
|
43
|
+
var useGetTasksSuspense = (params, options) => {
|
|
44
|
+
const queryOptions = getGetTasksSuspenseQueryOptions(params, options);
|
|
45
|
+
const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
|
|
46
|
+
query.queryKey = queryOptions.queryKey;
|
|
47
|
+
return query;
|
|
48
|
+
};
|
|
36
49
|
var getTask = (taskId, params, options, signal) => {
|
|
37
|
-
return
|
|
50
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
38
51
|
{
|
|
39
52
|
url: `/task/${taskId}`,
|
|
40
|
-
method: "
|
|
53
|
+
method: "GET",
|
|
41
54
|
params,
|
|
42
55
|
signal
|
|
43
56
|
},
|
|
@@ -59,11 +72,23 @@ var useGetTask = (taskId, params, options) => {
|
|
|
59
72
|
query.queryKey = queryOptions.queryKey;
|
|
60
73
|
return query;
|
|
61
74
|
};
|
|
75
|
+
var getGetTaskSuspenseQueryOptions = (taskId, params, options) => {
|
|
76
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
77
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetTaskQueryKey(taskId, params)));
|
|
78
|
+
const queryFn = ({ signal }) => getTask(taskId, params, requestOptions, signal);
|
|
79
|
+
return { queryKey, queryFn, enabled: !!taskId, ...queryOptions };
|
|
80
|
+
};
|
|
81
|
+
var useGetTaskSuspense = (taskId, params, options) => {
|
|
82
|
+
const queryOptions = getGetTaskSuspenseQueryOptions(taskId, params, options);
|
|
83
|
+
const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
|
|
84
|
+
query.queryKey = queryOptions.queryKey;
|
|
85
|
+
return query;
|
|
86
|
+
};
|
|
62
87
|
var deleteTask = (taskId, options) => {
|
|
63
|
-
return
|
|
88
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
64
89
|
{
|
|
65
90
|
url: `/task/${taskId}`,
|
|
66
|
-
method: "
|
|
91
|
+
method: "DELETE"
|
|
67
92
|
},
|
|
68
93
|
options
|
|
69
94
|
);
|
|
@@ -92,5 +117,9 @@ var useDeleteTask = (options) => {
|
|
|
92
117
|
|
|
93
118
|
|
|
94
119
|
|
|
95
|
-
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
exports.deleteTask = deleteTask; exports.getDeleteTaskMutationOptions = getDeleteTaskMutationOptions; exports.getGetTaskQueryKey = getGetTaskQueryKey; exports.getGetTaskQueryOptions = getGetTaskQueryOptions; exports.getGetTaskSuspenseQueryOptions = getGetTaskSuspenseQueryOptions; exports.getGetTasksQueryKey = getGetTasksQueryKey; exports.getGetTasksQueryOptions = getGetTasksQueryOptions; exports.getGetTasksSuspenseQueryOptions = getGetTasksSuspenseQueryOptions; exports.getTask = getTask; exports.getTasks = getTasks; exports.useDeleteTask = useDeleteTask; exports.useGetTask = useGetTask; exports.useGetTaskSuspense = useGetTaskSuspense; exports.useGetTasks = useGetTasks; exports.useGetTasksSuspense = useGetTasksSuspense;
|
|
96
125
|
//# sourceMappingURL=task.cjs.map
|
package/task/task.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/task/task.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAkCA,IAAM,WAAW,CACpB,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MACrB;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,CAAC,WAA6B;AAE7D,SAAO,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AAC/D;AAGG,IAAM,0BAA0B,CAAmF,QAAyB,YAC9I;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,oBAAoB,MAAM;AAIpE,QAAM,UAA+D,CAAC,EAAE,OAAO,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,cAAc,CAC1B,QAAyB,YAEsC;AAE9D,QAAM,eAAe,wBAAwB,QAAO,OAAO;AAE3D,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAyBO,IAAM,UAAU,CACnB,QACA,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS,MAAM;AAAA,MAAI,QAAQ;AAAA,MAC/B;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,qBAAqB,CAAC,QAC/B,WAA4B;AAE5B,SAAO,CAAC,oBAAoB,SAAS,MAAM,IAAI,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AACzE;AAGG,IAAM,yBAAyB,CAAkF,QACpH,QAAwB,YACvB;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,mBAAmB,QAAO,MAAM;AAI1E,QAAM,UAA8D,CAAC,EAAE,OAAO,MAAM,QAAQ,QAAO,QAAQ,gBAAgB,MAAM;AAMlI,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,QAAS,GAAG,aAAY;AACpE;AAQO,IAAM,aAAa,CACzB,QACG,QAAwB,YAEoC;AAE9D,QAAM,eAAe,uBAAuB,QAAO,QAAO,OAAO;AAEjE,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAaO,IAAM,aAAa,CACtB,QACH,YAAsD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS,MAAM;AAAA,MAAI,QAAQ;AAAA,IACnC;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,+BAA+B,CAEpB,YAC4E;AACnG,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAyF,CAAC,UAAU;AACtG,UAAM,EAAC,OAAM,IAAI,SAAS,CAAC;AAE3B,WAAQ,WAAW,QAAO,cAAc;AAAA,EAC1C;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,gBAAgB,CAEL,YACnB;AAEC,QAAM,kBAAkB,6BAA6B,OAAO;AAE5D,SAAO,YAAY,eAAe;AACpC","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 GetTaskParams,\n GetTasksParams,\n TaskGetResponse,\n TasksGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n\n/**\n * Returns a list of Tasks that you have access to.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TasksGetResponse>(\n {url: `/task`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTasksQueryKey = (params?: GetTasksParams,) => {\n \n return [\"data-manager-api\", `/task`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTasksQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksQueryOptions(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 * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you have access to it. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating Datasets and launching **Applications** and **Jobs**.\n\nTasks contain of a list of `states` and `events`. A Task will always have `states` but may not have `events`.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 500 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** Tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The Dataset is available when the Task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the Task is `done` but you have a non-zero `exit_code`, the Dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you must wait until you find the _STARTED_ state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TaskGetResponse>(\n {url: `/task/${taskId}`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTaskQueryKey = (taskId: string,\n params?: GetTaskParams,) => {\n \n return [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTaskQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskQueryOptions(taskId,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 * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an `owner` of the Task to delete it. For example you must be the `owner` of the Dataset to delete **DATASET** Tasks and an `owner` of the ProjectFile to delete **FILE** Tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/task/${taskId}`, method: 'delete'\n },\n options);\n }\n \n\n\nexport const getDeleteTaskMutationOptions = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {\n const {taskId} = props ?? {};\n\n return deleteTask(taskId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>\n \n export type DeleteTaskMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete a Task entry\n */\nexport const useDeleteTask = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "]}
|
|
1
|
+
{"version":3,"sources":["../../src/task/task.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Generated by orval v6.25.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 useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetTaskParams,\n GetTasksParams,\n TaskGetResponse,\n TasksGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns a list of Tasks that you have access to.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TasksGetResponse>(\n {url: `/task`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTasksQueryKey = (params?: GetTasksParams,) => {\n return [\"data-manager-api\", `/task`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTasksQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksQueryOptions(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\nexport const getGetTasksSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasksSuspense = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksSuspenseQueryOptions(params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you have access to it. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating Datasets and launching **Applications** and **Jobs**.\n\nTasks contain of a list of `states` and `events`. A Task will always have `states` but may not have `events`.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 500 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** Tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The Dataset is available when the Task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the Task is `done` but you have a non-zero `exit_code`, the Dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you must wait until you find the _STARTED_ state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TaskGetResponse>(\n {url: `/task/${taskId}`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTaskQueryKey = (taskId: string,\n params?: GetTaskParams,) => {\n return [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTaskQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskQueryOptions(taskId,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\nexport const getGetTaskSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTaskSuspense = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskSuspenseQueryOptions(taskId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an `owner` of the Task to delete it. For example you must be the `owner` of the Dataset to delete **DATASET** Tasks and an `owner` of the ProjectFile to delete **FILE** Tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/task/${taskId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteTaskMutationOptions = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {\n const {taskId} = props ?? {};\n\n return deleteTask(taskId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>\n \n export type DeleteTaskMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete a Task entry\n */\nexport const useDeleteTask = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "]}
|
package/task/task.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
1
|
+
import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
|
|
2
|
+
import { UseQueryOptions, QueryKey, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
+
import { GetTasksParams, customInstance, TasksGetResponse, ErrorType, DmError, GetTaskParams, TaskGetResponse } from '../index.cjs';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
|
-
type SecondParameter<T extends (...args: any) => any> = T
|
|
6
|
+
type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
7
7
|
/**
|
|
8
8
|
* Returns a list of Tasks that you have access to.
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (config: any,
|
|
|
12
12
|
declare const getTasks: (params?: GetTasksParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<TasksGetResponse>;
|
|
13
13
|
declare const getGetTasksQueryKey: (params?: GetTasksParams) => readonly ["data-manager-api", "/task", ...GetTasksParams[]];
|
|
14
14
|
declare const getGetTasksQueryOptions: <TData = TasksGetResponse, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: {
|
|
15
|
-
query?: UseQueryOptions<TasksGetResponse, TError, TData, QueryKey
|
|
15
|
+
query?: Partial<UseQueryOptions<TasksGetResponse, TError, TData, QueryKey>> | undefined;
|
|
16
16
|
request?: SecondParameter<typeof customInstance>;
|
|
17
17
|
} | undefined) => UseQueryOptions<TasksGetResponse, TError, TData, QueryKey> & {
|
|
18
18
|
queryKey: QueryKey;
|
|
@@ -23,11 +23,28 @@ type GetTasksQueryError = ErrorType<void | DmError>;
|
|
|
23
23
|
* @summary Returns a list of Tasks
|
|
24
24
|
*/
|
|
25
25
|
declare const useGetTasks: <TData = TasksGetResponse, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: {
|
|
26
|
-
query?: UseQueryOptions<TasksGetResponse, TError, TData, QueryKey
|
|
26
|
+
query?: Partial<UseQueryOptions<TasksGetResponse, TError, TData, QueryKey>> | undefined;
|
|
27
27
|
request?: SecondParameter<typeof customInstance>;
|
|
28
28
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
29
29
|
queryKey: QueryKey;
|
|
30
30
|
};
|
|
31
|
+
declare const getGetTasksSuspenseQueryOptions: <TData = TasksGetResponse, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: {
|
|
32
|
+
query?: Partial<UseSuspenseQueryOptions<TasksGetResponse, TError, TData, QueryKey>> | undefined;
|
|
33
|
+
request?: SecondParameter<typeof customInstance>;
|
|
34
|
+
} | undefined) => UseSuspenseQueryOptions<TasksGetResponse, TError, TData, QueryKey> & {
|
|
35
|
+
queryKey: QueryKey;
|
|
36
|
+
};
|
|
37
|
+
type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>;
|
|
38
|
+
type GetTasksSuspenseQueryError = ErrorType<void | DmError>;
|
|
39
|
+
/**
|
|
40
|
+
* @summary Returns a list of Tasks
|
|
41
|
+
*/
|
|
42
|
+
declare const useGetTasksSuspense: <TData = TasksGetResponse, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: {
|
|
43
|
+
query?: Partial<UseSuspenseQueryOptions<TasksGetResponse, TError, TData, QueryKey>> | undefined;
|
|
44
|
+
request?: SecondParameter<typeof customInstance>;
|
|
45
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
46
|
+
queryKey: QueryKey;
|
|
47
|
+
};
|
|
31
48
|
/**
|
|
32
49
|
* Returns Task information including its states and events.
|
|
33
50
|
|
|
@@ -52,7 +69,7 @@ For Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you
|
|
|
52
69
|
declare const getTask: (taskId: string, params?: GetTaskParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<TaskGetResponse>;
|
|
53
70
|
declare const getGetTaskQueryKey: (taskId: string, params?: GetTaskParams) => readonly ["data-manager-api", `/task/${string}`, ...GetTaskParams[]];
|
|
54
71
|
declare const getGetTaskQueryOptions: <TData = TaskGetResponse, TError = ErrorType<void | DmError>>(taskId: string, params?: GetTaskParams, options?: {
|
|
55
|
-
query?: UseQueryOptions<TaskGetResponse, TError, TData, QueryKey
|
|
72
|
+
query?: Partial<UseQueryOptions<TaskGetResponse, TError, TData, QueryKey>> | undefined;
|
|
56
73
|
request?: SecondParameter<typeof customInstance>;
|
|
57
74
|
} | undefined) => UseQueryOptions<TaskGetResponse, TError, TData, QueryKey> & {
|
|
58
75
|
queryKey: QueryKey;
|
|
@@ -63,11 +80,28 @@ type GetTaskQueryError = ErrorType<void | DmError>;
|
|
|
63
80
|
* @summary Returns Task information
|
|
64
81
|
*/
|
|
65
82
|
declare const useGetTask: <TData = TaskGetResponse, TError = ErrorType<void | DmError>>(taskId: string, params?: GetTaskParams, options?: {
|
|
66
|
-
query?: UseQueryOptions<TaskGetResponse, TError, TData, QueryKey
|
|
83
|
+
query?: Partial<UseQueryOptions<TaskGetResponse, TError, TData, QueryKey>> | undefined;
|
|
67
84
|
request?: SecondParameter<typeof customInstance>;
|
|
68
85
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
69
86
|
queryKey: QueryKey;
|
|
70
87
|
};
|
|
88
|
+
declare const getGetTaskSuspenseQueryOptions: <TData = TaskGetResponse, TError = ErrorType<void | DmError>>(taskId: string, params?: GetTaskParams, options?: {
|
|
89
|
+
query?: Partial<UseSuspenseQueryOptions<TaskGetResponse, TError, TData, QueryKey>> | undefined;
|
|
90
|
+
request?: SecondParameter<typeof customInstance>;
|
|
91
|
+
} | undefined) => UseSuspenseQueryOptions<TaskGetResponse, TError, TData, QueryKey> & {
|
|
92
|
+
queryKey: QueryKey;
|
|
93
|
+
};
|
|
94
|
+
type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>;
|
|
95
|
+
type GetTaskSuspenseQueryError = ErrorType<void | DmError>;
|
|
96
|
+
/**
|
|
97
|
+
* @summary Returns Task information
|
|
98
|
+
*/
|
|
99
|
+
declare const useGetTaskSuspense: <TData = TaskGetResponse, TError = ErrorType<void | DmError>>(taskId: string, params?: GetTaskParams, options?: {
|
|
100
|
+
query?: Partial<UseSuspenseQueryOptions<TaskGetResponse, TError, TData, QueryKey>> | undefined;
|
|
101
|
+
request?: SecondParameter<typeof customInstance>;
|
|
102
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
103
|
+
queryKey: QueryKey;
|
|
104
|
+
};
|
|
71
105
|
/**
|
|
72
106
|
* Given a `task_id` the Task will be removed.
|
|
73
107
|
|
|
@@ -96,8 +130,8 @@ declare const useDeleteTask: <TError = ErrorType<DmError>, TContext = unknown>(o
|
|
|
96
130
|
taskId: string;
|
|
97
131
|
}, TContext> | undefined;
|
|
98
132
|
request?: SecondParameter<typeof customInstance>;
|
|
99
|
-
} | undefined) =>
|
|
133
|
+
} | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<void, TError, {
|
|
100
134
|
taskId: string;
|
|
101
135
|
}, TContext>;
|
|
102
136
|
|
|
103
|
-
export { DeleteTaskMutationError, DeleteTaskMutationResult, GetTaskQueryError, GetTaskQueryResult, GetTasksQueryError, GetTasksQueryResult, deleteTask, getDeleteTaskMutationOptions, getGetTaskQueryKey, getGetTaskQueryOptions, getGetTasksQueryKey, getGetTasksQueryOptions, getTask, getTasks, useDeleteTask, useGetTask, useGetTasks };
|
|
137
|
+
export { type DeleteTaskMutationError, type DeleteTaskMutationResult, type GetTaskQueryError, type GetTaskQueryResult, type GetTaskSuspenseQueryError, type GetTaskSuspenseQueryResult, type GetTasksQueryError, type GetTasksQueryResult, type GetTasksSuspenseQueryError, type GetTasksSuspenseQueryResult, deleteTask, getDeleteTaskMutationOptions, getGetTaskQueryKey, getGetTaskQueryOptions, getGetTaskSuspenseQueryOptions, getGetTasksQueryKey, getGetTasksQueryOptions, getGetTasksSuspenseQueryOptions, getTask, getTasks, useDeleteTask, useGetTask, useGetTaskSuspense, useGetTasks, useGetTasksSuspense };
|
package/task/task.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
1
|
+
import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
|
|
2
|
+
import { UseQueryOptions, QueryKey, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
+
import { GetTasksParams, customInstance, TasksGetResponse, ErrorType, DmError, GetTaskParams, TaskGetResponse } from '../index.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
|
-
type SecondParameter<T extends (...args: any) => any> = T
|
|
6
|
+
type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
7
7
|
/**
|
|
8
8
|
* Returns a list of Tasks that you have access to.
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (config: any,
|
|
|
12
12
|
declare const getTasks: (params?: GetTasksParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<TasksGetResponse>;
|
|
13
13
|
declare const getGetTasksQueryKey: (params?: GetTasksParams) => readonly ["data-manager-api", "/task", ...GetTasksParams[]];
|
|
14
14
|
declare const getGetTasksQueryOptions: <TData = TasksGetResponse, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: {
|
|
15
|
-
query?: UseQueryOptions<TasksGetResponse, TError, TData, QueryKey
|
|
15
|
+
query?: Partial<UseQueryOptions<TasksGetResponse, TError, TData, QueryKey>> | undefined;
|
|
16
16
|
request?: SecondParameter<typeof customInstance>;
|
|
17
17
|
} | undefined) => UseQueryOptions<TasksGetResponse, TError, TData, QueryKey> & {
|
|
18
18
|
queryKey: QueryKey;
|
|
@@ -23,11 +23,28 @@ type GetTasksQueryError = ErrorType<void | DmError>;
|
|
|
23
23
|
* @summary Returns a list of Tasks
|
|
24
24
|
*/
|
|
25
25
|
declare const useGetTasks: <TData = TasksGetResponse, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: {
|
|
26
|
-
query?: UseQueryOptions<TasksGetResponse, TError, TData, QueryKey
|
|
26
|
+
query?: Partial<UseQueryOptions<TasksGetResponse, TError, TData, QueryKey>> | undefined;
|
|
27
27
|
request?: SecondParameter<typeof customInstance>;
|
|
28
28
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
29
29
|
queryKey: QueryKey;
|
|
30
30
|
};
|
|
31
|
+
declare const getGetTasksSuspenseQueryOptions: <TData = TasksGetResponse, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: {
|
|
32
|
+
query?: Partial<UseSuspenseQueryOptions<TasksGetResponse, TError, TData, QueryKey>> | undefined;
|
|
33
|
+
request?: SecondParameter<typeof customInstance>;
|
|
34
|
+
} | undefined) => UseSuspenseQueryOptions<TasksGetResponse, TError, TData, QueryKey> & {
|
|
35
|
+
queryKey: QueryKey;
|
|
36
|
+
};
|
|
37
|
+
type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>;
|
|
38
|
+
type GetTasksSuspenseQueryError = ErrorType<void | DmError>;
|
|
39
|
+
/**
|
|
40
|
+
* @summary Returns a list of Tasks
|
|
41
|
+
*/
|
|
42
|
+
declare const useGetTasksSuspense: <TData = TasksGetResponse, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: {
|
|
43
|
+
query?: Partial<UseSuspenseQueryOptions<TasksGetResponse, TError, TData, QueryKey>> | undefined;
|
|
44
|
+
request?: SecondParameter<typeof customInstance>;
|
|
45
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
46
|
+
queryKey: QueryKey;
|
|
47
|
+
};
|
|
31
48
|
/**
|
|
32
49
|
* Returns Task information including its states and events.
|
|
33
50
|
|
|
@@ -52,7 +69,7 @@ For Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you
|
|
|
52
69
|
declare const getTask: (taskId: string, params?: GetTaskParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<TaskGetResponse>;
|
|
53
70
|
declare const getGetTaskQueryKey: (taskId: string, params?: GetTaskParams) => readonly ["data-manager-api", `/task/${string}`, ...GetTaskParams[]];
|
|
54
71
|
declare const getGetTaskQueryOptions: <TData = TaskGetResponse, TError = ErrorType<void | DmError>>(taskId: string, params?: GetTaskParams, options?: {
|
|
55
|
-
query?: UseQueryOptions<TaskGetResponse, TError, TData, QueryKey
|
|
72
|
+
query?: Partial<UseQueryOptions<TaskGetResponse, TError, TData, QueryKey>> | undefined;
|
|
56
73
|
request?: SecondParameter<typeof customInstance>;
|
|
57
74
|
} | undefined) => UseQueryOptions<TaskGetResponse, TError, TData, QueryKey> & {
|
|
58
75
|
queryKey: QueryKey;
|
|
@@ -63,11 +80,28 @@ type GetTaskQueryError = ErrorType<void | DmError>;
|
|
|
63
80
|
* @summary Returns Task information
|
|
64
81
|
*/
|
|
65
82
|
declare const useGetTask: <TData = TaskGetResponse, TError = ErrorType<void | DmError>>(taskId: string, params?: GetTaskParams, options?: {
|
|
66
|
-
query?: UseQueryOptions<TaskGetResponse, TError, TData, QueryKey
|
|
83
|
+
query?: Partial<UseQueryOptions<TaskGetResponse, TError, TData, QueryKey>> | undefined;
|
|
67
84
|
request?: SecondParameter<typeof customInstance>;
|
|
68
85
|
} | undefined) => UseQueryResult<TData, TError> & {
|
|
69
86
|
queryKey: QueryKey;
|
|
70
87
|
};
|
|
88
|
+
declare const getGetTaskSuspenseQueryOptions: <TData = TaskGetResponse, TError = ErrorType<void | DmError>>(taskId: string, params?: GetTaskParams, options?: {
|
|
89
|
+
query?: Partial<UseSuspenseQueryOptions<TaskGetResponse, TError, TData, QueryKey>> | undefined;
|
|
90
|
+
request?: SecondParameter<typeof customInstance>;
|
|
91
|
+
} | undefined) => UseSuspenseQueryOptions<TaskGetResponse, TError, TData, QueryKey> & {
|
|
92
|
+
queryKey: QueryKey;
|
|
93
|
+
};
|
|
94
|
+
type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>;
|
|
95
|
+
type GetTaskSuspenseQueryError = ErrorType<void | DmError>;
|
|
96
|
+
/**
|
|
97
|
+
* @summary Returns Task information
|
|
98
|
+
*/
|
|
99
|
+
declare const useGetTaskSuspense: <TData = TaskGetResponse, TError = ErrorType<void | DmError>>(taskId: string, params?: GetTaskParams, options?: {
|
|
100
|
+
query?: Partial<UseSuspenseQueryOptions<TaskGetResponse, TError, TData, QueryKey>> | undefined;
|
|
101
|
+
request?: SecondParameter<typeof customInstance>;
|
|
102
|
+
} | undefined) => UseSuspenseQueryResult<TData, TError> & {
|
|
103
|
+
queryKey: QueryKey;
|
|
104
|
+
};
|
|
71
105
|
/**
|
|
72
106
|
* Given a `task_id` the Task will be removed.
|
|
73
107
|
|
|
@@ -96,8 +130,8 @@ declare const useDeleteTask: <TError = ErrorType<DmError>, TContext = unknown>(o
|
|
|
96
130
|
taskId: string;
|
|
97
131
|
}, TContext> | undefined;
|
|
98
132
|
request?: SecondParameter<typeof customInstance>;
|
|
99
|
-
} | undefined) =>
|
|
133
|
+
} | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<void, TError, {
|
|
100
134
|
taskId: string;
|
|
101
135
|
}, TContext>;
|
|
102
136
|
|
|
103
|
-
export { DeleteTaskMutationError, DeleteTaskMutationResult, GetTaskQueryError, GetTaskQueryResult, GetTasksQueryError, GetTasksQueryResult, deleteTask, getDeleteTaskMutationOptions, getGetTaskQueryKey, getGetTaskQueryOptions, getGetTasksQueryKey, getGetTasksQueryOptions, getTask, getTasks, useDeleteTask, useGetTask, useGetTasks };
|
|
137
|
+
export { type DeleteTaskMutationError, type DeleteTaskMutationResult, type GetTaskQueryError, type GetTaskQueryResult, type GetTaskSuspenseQueryError, type GetTaskSuspenseQueryResult, type GetTasksQueryError, type GetTasksQueryResult, type GetTasksSuspenseQueryError, type GetTasksSuspenseQueryResult, deleteTask, getDeleteTaskMutationOptions, getGetTaskQueryKey, getGetTaskQueryOptions, getGetTaskSuspenseQueryOptions, getGetTasksQueryKey, getGetTasksQueryOptions, getGetTasksSuspenseQueryOptions, getTask, getTasks, useDeleteTask, useGetTask, useGetTaskSuspense, useGetTasks, useGetTasksSuspense };
|
package/task/task.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
customInstance
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-EBOQPVLG.js";
|
|
4
4
|
|
|
5
5
|
// src/task/task.ts
|
|
6
6
|
import {
|
|
7
7
|
useMutation,
|
|
8
|
-
useQuery
|
|
8
|
+
useQuery,
|
|
9
|
+
useSuspenseQuery
|
|
9
10
|
} from "@tanstack/react-query";
|
|
10
11
|
var getTasks = (params, options, signal) => {
|
|
11
12
|
return customInstance(
|
|
12
13
|
{
|
|
13
14
|
url: `/task`,
|
|
14
|
-
method: "
|
|
15
|
+
method: "GET",
|
|
15
16
|
params,
|
|
16
17
|
signal
|
|
17
18
|
},
|
|
@@ -33,11 +34,23 @@ var useGetTasks = (params, options) => {
|
|
|
33
34
|
query.queryKey = queryOptions.queryKey;
|
|
34
35
|
return query;
|
|
35
36
|
};
|
|
37
|
+
var getGetTasksSuspenseQueryOptions = (params, options) => {
|
|
38
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
39
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetTasksQueryKey(params);
|
|
40
|
+
const queryFn = ({ signal }) => getTasks(params, requestOptions, signal);
|
|
41
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
42
|
+
};
|
|
43
|
+
var useGetTasksSuspense = (params, options) => {
|
|
44
|
+
const queryOptions = getGetTasksSuspenseQueryOptions(params, options);
|
|
45
|
+
const query = useSuspenseQuery(queryOptions);
|
|
46
|
+
query.queryKey = queryOptions.queryKey;
|
|
47
|
+
return query;
|
|
48
|
+
};
|
|
36
49
|
var getTask = (taskId, params, options, signal) => {
|
|
37
50
|
return customInstance(
|
|
38
51
|
{
|
|
39
52
|
url: `/task/${taskId}`,
|
|
40
|
-
method: "
|
|
53
|
+
method: "GET",
|
|
41
54
|
params,
|
|
42
55
|
signal
|
|
43
56
|
},
|
|
@@ -59,11 +72,23 @@ var useGetTask = (taskId, params, options) => {
|
|
|
59
72
|
query.queryKey = queryOptions.queryKey;
|
|
60
73
|
return query;
|
|
61
74
|
};
|
|
75
|
+
var getGetTaskSuspenseQueryOptions = (taskId, params, options) => {
|
|
76
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
77
|
+
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetTaskQueryKey(taskId, params);
|
|
78
|
+
const queryFn = ({ signal }) => getTask(taskId, params, requestOptions, signal);
|
|
79
|
+
return { queryKey, queryFn, enabled: !!taskId, ...queryOptions };
|
|
80
|
+
};
|
|
81
|
+
var useGetTaskSuspense = (taskId, params, options) => {
|
|
82
|
+
const queryOptions = getGetTaskSuspenseQueryOptions(taskId, params, options);
|
|
83
|
+
const query = useSuspenseQuery(queryOptions);
|
|
84
|
+
query.queryKey = queryOptions.queryKey;
|
|
85
|
+
return query;
|
|
86
|
+
};
|
|
62
87
|
var deleteTask = (taskId, options) => {
|
|
63
88
|
return customInstance(
|
|
64
89
|
{
|
|
65
90
|
url: `/task/${taskId}`,
|
|
66
|
-
method: "
|
|
91
|
+
method: "DELETE"
|
|
67
92
|
},
|
|
68
93
|
options
|
|
69
94
|
);
|
|
@@ -85,12 +110,16 @@ export {
|
|
|
85
110
|
getDeleteTaskMutationOptions,
|
|
86
111
|
getGetTaskQueryKey,
|
|
87
112
|
getGetTaskQueryOptions,
|
|
113
|
+
getGetTaskSuspenseQueryOptions,
|
|
88
114
|
getGetTasksQueryKey,
|
|
89
115
|
getGetTasksQueryOptions,
|
|
116
|
+
getGetTasksSuspenseQueryOptions,
|
|
90
117
|
getTask,
|
|
91
118
|
getTasks,
|
|
92
119
|
useDeleteTask,
|
|
93
120
|
useGetTask,
|
|
94
|
-
|
|
121
|
+
useGetTaskSuspense,
|
|
122
|
+
useGetTasks,
|
|
123
|
+
useGetTasksSuspense
|
|
95
124
|
};
|
|
96
125
|
//# sourceMappingURL=task.js.map
|
package/task/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/task/task.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 GetTaskParams,\n GetTasksParams,\n TaskGetResponse,\n TasksGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n\n/**\n * Returns a list of Tasks that you have access to.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TasksGetResponse>(\n {url: `/task`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTasksQueryKey = (params?: GetTasksParams,) => {\n \n return [\"data-manager-api\", `/task`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTasksQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksQueryOptions(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 * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you have access to it. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating Datasets and launching **Applications** and **Jobs**.\n\nTasks contain of a list of `states` and `events`. A Task will always have `states` but may not have `events`.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 500 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** Tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The Dataset is available when the Task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the Task is `done` but you have a non-zero `exit_code`, the Dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you must wait until you find the _STARTED_ state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TaskGetResponse>(\n {url: `/task/${taskId}`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTaskQueryKey = (taskId: string,\n params?: GetTaskParams,) => {\n \n return [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTaskQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskQueryOptions(taskId,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 * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an `owner` of the Task to delete it. For example you must be the `owner` of the Dataset to delete **DATASET** Tasks and an `owner` of the ProjectFile to delete **FILE** Tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/task/${taskId}`, method: 'delete'\n },\n options);\n }\n \n\n\nexport const getDeleteTaskMutationOptions = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {\n const {taskId} = props ?? {};\n\n return deleteTask(taskId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>\n \n export type DeleteTaskMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete a Task entry\n */\nexport const useDeleteTask = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAkCA,IAAM,WAAW,CACpB,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MACrB;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,CAAC,WAA6B;AAE7D,SAAO,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AAC/D;AAGG,IAAM,0BAA0B,CAAmF,QAAyB,YAC9I;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,oBAAoB,MAAM;AAIpE,QAAM,UAA+D,CAAC,EAAE,OAAO,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,cAAc,CAC1B,QAAyB,YAEsC;AAE9D,QAAM,eAAe,wBAAwB,QAAO,OAAO;AAE3D,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAyBO,IAAM,UAAU,CACnB,QACA,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS,MAAM;AAAA,MAAI,QAAQ;AAAA,MAC/B;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,qBAAqB,CAAC,QAC/B,WAA4B;AAE5B,SAAO,CAAC,oBAAoB,SAAS,MAAM,IAAI,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AACzE;AAGG,IAAM,yBAAyB,CAAkF,QACpH,QAAwB,YACvB;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,mBAAmB,QAAO,MAAM;AAI1E,QAAM,UAA8D,CAAC,EAAE,OAAO,MAAM,QAAQ,QAAO,QAAQ,gBAAgB,MAAM;AAMlI,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,QAAS,GAAG,aAAY;AACpE;AAQO,IAAM,aAAa,CACzB,QACG,QAAwB,YAEoC;AAE9D,QAAM,eAAe,uBAAuB,QAAO,QAAO,OAAO;AAEjE,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAaO,IAAM,aAAa,CACtB,QACH,YAAsD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS,MAAM;AAAA,MAAI,QAAQ;AAAA,IACnC;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,+BAA+B,CAEpB,YAC4E;AACnG,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAyF,CAAC,UAAU;AACtG,UAAM,EAAC,OAAM,IAAI,SAAS,CAAC;AAE3B,WAAQ,WAAW,QAAO,cAAc;AAAA,EAC1C;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,gBAAgB,CAEL,YACnB;AAEC,QAAM,kBAAkB,6BAA6B,OAAO;AAE5D,SAAO,YAAY,eAAe;AACpC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/task/task.ts"],"sourcesContent":["/**\n * Generated by orval v6.25.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 useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetTaskParams,\n GetTasksParams,\n TaskGetResponse,\n TasksGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns a list of Tasks that you have access to.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TasksGetResponse>(\n {url: `/task`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTasksQueryKey = (params?: GetTasksParams,) => {\n return [\"data-manager-api\", `/task`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTasksQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksQueryOptions(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\nexport const getGetTasksSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasksSuspense = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksSuspenseQueryOptions(params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you have access to it. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating Datasets and launching **Applications** and **Jobs**.\n\nTasks contain of a list of `states` and `events`. A Task will always have `states` but may not have `events`.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 500 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** Tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The Dataset is available when the Task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the Task is `done` but you have a non-zero `exit_code`, the Dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you must wait until you find the _STARTED_ state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TaskGetResponse>(\n {url: `/task/${taskId}`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTaskQueryKey = (taskId: string,\n params?: GetTaskParams,) => {\n return [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTaskQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskQueryOptions(taskId,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\nexport const getGetTaskSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTaskSuspense = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskSuspenseQueryOptions(taskId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an `owner` of the Task to delete it. For example you must be the `owner` of the Dataset to delete **DATASET** Tasks and an `owner` of the ProjectFile to delete **FILE** Tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/task/${taskId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteTaskMutationOptions = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {\n const {taskId} = props ?? {};\n\n return deleteTask(taskId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>\n \n export type DeleteTaskMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete a Task entry\n */\nexport const useDeleteTask = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "],"mappings":"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","names":[]}
|
package/type/type.cjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
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
|
|
3
|
+
var _chunkTKLTUR4Rcjs = require('../chunk-TKLTUR4R.cjs');
|
|
4
4
|
|
|
5
5
|
// src/type/type.ts
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
var _reactquery = require('@tanstack/react-query');
|
|
9
10
|
var getFileTypes = (options, signal) => {
|
|
10
|
-
return
|
|
11
|
+
return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
|
|
11
12
|
{
|
|
12
13
|
url: `/type`,
|
|
13
|
-
method: "
|
|
14
|
+
method: "GET",
|
|
14
15
|
signal
|
|
15
16
|
},
|
|
16
17
|
options
|
|
@@ -31,10 +32,24 @@ var useGetFileTypes = (options) => {
|
|
|
31
32
|
query.queryKey = queryOptions.queryKey;
|
|
32
33
|
return query;
|
|
33
34
|
};
|
|
35
|
+
var getGetFileTypesSuspenseQueryOptions = (options) => {
|
|
36
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
37
|
+
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetFileTypesQueryKey()));
|
|
38
|
+
const queryFn = ({ signal }) => getFileTypes(requestOptions, signal);
|
|
39
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
40
|
+
};
|
|
41
|
+
var useGetFileTypesSuspense = (options) => {
|
|
42
|
+
const queryOptions = getGetFileTypesSuspenseQueryOptions(options);
|
|
43
|
+
const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
|
|
44
|
+
query.queryKey = queryOptions.queryKey;
|
|
45
|
+
return query;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
|
|
34
49
|
|
|
35
50
|
|
|
36
51
|
|
|
37
52
|
|
|
38
53
|
|
|
39
|
-
exports.getFileTypes = getFileTypes; exports.getGetFileTypesQueryKey = getGetFileTypesQueryKey; exports.getGetFileTypesQueryOptions = getGetFileTypesQueryOptions; exports.useGetFileTypes = useGetFileTypes;
|
|
54
|
+
exports.getFileTypes = getFileTypes; exports.getGetFileTypesQueryKey = getGetFileTypesQueryKey; exports.getGetFileTypesQueryOptions = getGetFileTypesQueryOptions; exports.getGetFileTypesSuspenseQueryOptions = getGetFileTypesSuspenseQueryOptions; exports.useGetFileTypes = useGetFileTypes; exports.useGetFileTypesSuspense = useGetFileTypesSuspense;
|
|
40
55
|
//# sourceMappingURL=type.cjs.map
|
package/type/type.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/type/type.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,OACK;
|
|
1
|
+
{"version":3,"sources":["../../src/type/type.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAyBA,IAAM,eAAe,CAE3B,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MAAO;AAAA,IAChC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,0BAA0B,MAAM;AACzC,SAAO,CAAC,oBAAoB,OAAO;AACnC;AAGG,IAAM,8BAA8B,CAAwF,YAC9H;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,wBAAwB;AAIlE,QAAM,UAAmE,CAAC,EAAE,OAAO,MAAM,aAAa,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,kBAAkB,CAC7B,YAE8D;AAE9D,QAAM,eAAe,4BAA4B,OAAO;AAExD,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,sCAAsC,CAAwF,YACtI;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,wBAAwB;AAIlE,QAAM,UAAmE,CAAC,EAAE,OAAO,MAAM,aAAa,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,0BAA0B,CACrC,YAEsE;AAEtE,QAAM,eAAe,oCAAoC,OAAO;AAEhE,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.25.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 useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n QueryFunction,\n QueryKey,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n TypesGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns the supported Dataset and File (MIME) Types\n\n * @summary Get the supported File Types\n */\nexport const getFileTypes = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TypesGetResponse>(\n {url: `/type`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetFileTypesQueryKey = () => {\n return [\"data-manager-api\", `/type`] as const;\n }\n\n \nexport const getGetFileTypesQueryOptions = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFileTypesQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFileTypes>>> = ({ signal }) => getFileTypes(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetFileTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getFileTypes>>>\nexport type GetFileTypesQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get the supported File Types\n */\nexport const useGetFileTypes = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetFileTypesQueryOptions(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\nexport const getGetFileTypesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFileTypesQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFileTypes>>> = ({ signal }) => getFileTypes(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetFileTypesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getFileTypes>>>\nexport type GetFileTypesSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get the supported File Types\n */\nexport const useGetFileTypesSuspense = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetFileTypesSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"]}
|