@squonk/data-manager-client 1.1.11 → 1.2.0
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/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +1 -1
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +26 -1
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +23 -2
- package/admin/admin.js +25 -0
- package/admin/admin.js.map +1 -1
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +1 -1
- package/application/application.js.map +1 -1
- package/{custom-instance-f006607a.d.ts → custom-instance-e5540c3b.d.ts} +43 -10
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +1 -1
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +1 -1
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +1 -1
- package/file/file.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +1 -1
- package/instance/instance.js.map +1 -1
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +1 -1
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +1 -1
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +1 -1
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +1 -1
- package/src/admin/admin.ts +79 -1
- package/src/application/application.ts +1 -1
- package/src/data-manager-api.schemas.ts +47 -10
- package/src/dataset/dataset.ts +1 -1
- package/src/exchange-rate/exchange-rate.ts +1 -1
- package/src/file/file.ts +1 -1
- package/src/instance/instance.ts +1 -1
- package/src/job/job.ts +1 -1
- package/src/metadata/metadata.ts +1 -1
- package/src/project/project.ts +1 -1
- package/src/task/task.ts +1 -1
- package/src/type/type.ts +1 -1
- package/src/user/user.ts +1 -1
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +1 -1
- package/task/task.js.map +1 -1
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +1 -1
- package/type/type.js.map +1 -1
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +1 -1
- package/user/user.js.map +1 -1
package/instance/instance.js.map
CHANGED
|
@@ -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.1\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,4BAA4B,QAAW;AAC9D,aAAS;AAAA,MACP;AAAA,MACA,qBAAqB,wBAAwB,SAAS;AAAA,IACxD;AAAA,EACF;AACA,MAAI,qBAAqB,mBAAmB,QAAW;AACrD,aAAS,OAAO,kBAAkB,qBAAqB,cAAc;AAAA,EACvE;AACA,MAAI,qBAAqB,UAAU,QAAW;AAC5C,aAAS,OAAO,SAAS,qBAAqB,KAAK;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oCAAoC,OAAO;AAEnE,SAAO,YAAY,eAAe;AACpC;AAQO,IAAM,gBAAgB,CAC3B,YACA,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,aAAa,cAAc,QAAQ,SAAS,OAAO;AAAA,IAC1D;AAAA,EACF;AACF;AAEO,IAAM,kCAAkC,CAG7C,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,OAAO,IAAI,SAAS,CAAC;AAEzC,WAAO,cAAc,YAAY,QAAQ,cAAc;AAAA,EACzD;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,kBAAkB,gCAAgC,OAAO;AAE/D,SAAO,YAAY,eAAe;AACpC;AAUO,IAAM,sBAAsB,CACjC,YACA,OACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,aAAa,oBAAoB,SAAS,QAAQ,SAAS;AAAA,IAClE;AAAA,EACF;AACF;AAEO,IAAM,wCAAwC,CAGnD,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,MAAM,IAAI,SAAS,CAAC;AAExC,WAAO,oBAAoB,YAAY,OAAO,cAAc;AAAA,EAC9D;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,yBAAyB,CAGpC,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.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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AE1E,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.
|
|
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,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,GAAG,aAAa;AAC9C;AAOO,IAAM,aAAa,CAIxB,QACA,YAI2D;AAC3D,QAAM,eAAe,uBAAuB,QAAQ,OAAO;AAE3D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;A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AG,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.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
package/job/job.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { h as GetJobsParams, bV as customInstance, bi as JobsGetResponse, bW as ErrorType, bR as DmError, g as GetJobByVersionParams, bk as JobGetResponse, f as GetJobParams } from '../custom-instance-e5540c3b.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;
|
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.
|
|
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;AAEr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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.1\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 DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody,\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 * Update parameters or add new annotations of the specified type(s) and to the Metadata for a **Dataset Version**.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library.\n\n * @summary Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\n \"meta_properties\",\n datasetVersionMetaPostBodyBody.meta_properties\n );\n }\n if (datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append(\"annotations\", datasetVersionMetaPostBodyBody.annotations);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddMetadataVersionMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n }\n > = (props) => {\n const { datasetId, datasetVersion, data } = props ?? {};\n\n return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddMetadataVersionMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadataVersion>>\n>;\nexport type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;\nexport type AddMetadataVersionMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadataVersion = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddMetadataVersionMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns the Metadata for a **Dataset Version** in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset Version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetMetadataVersionQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [\"data-manager-api\", `/dataset/${datasetId}/meta/${datasetVersion}`] as const;\n\nexport const getGetMetadataVersionQueryOptions = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetMetadataVersionQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getMetadataVersion>>\n > = ({ signal }) =>\n getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);\n\n return {\n queryKey,\n queryFn,\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n };\n};\n\nexport type GetMetadataVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadataVersion>>\n>;\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadataVersion = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetMetadataVersionQueryOptions(\n datasetId,\n datasetVersion,\n options\n );\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 * Update default parameters or add new labels to the Metadata for the Dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\"meta_properties\", datasetMetaPostBodyBody.meta_properties);\n }\n if (datasetMetaPostBodyBody.labels !== undefined) {\n formData.append(\"labels\", datasetMetaPostBodyBody.labels);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddMetadataMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadata>>,\n { datasetId: string; data: DatasetMetaPostBodyBody }\n > = (props) => {\n const { datasetId, data } = props ?? {};\n\n return addMetadata(datasetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddMetadataMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadata>>\n>;\nexport type AddMetadataMutationBody = DatasetMetaPostBodyBody;\nexport type AddMetadataMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadata = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddMetadataMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns the Metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetId}/meta`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (datasetId: string) =>\n [\"data-manager-api\", `/dataset/${datasetId}/meta`] as const;\n\nexport const getGetMetadataQueryOptions = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({\n signal,\n }) => getMetadata(datasetId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!datasetId, ...queryOptions };\n};\n\nexport type GetMetadataQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadata>>\n>;\nexport type GetMetadataQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadata = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetMetadataQueryOptions(datasetId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/metadata/metadata.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAmC/B,IAAM,qBAAqB,CAChC,WACA,gBACA,gCACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,MAAI,+BAA+B,oBAAoB,QAAW;AAChE,aAAS;AAAA,MACP;AAAA,MACA,+BAA+B;AAAA,IACjC;AAAA,EACF;AACA,MAAI,+BAA+B,gBAAgB,QAAW;AAC5D,aAAS,OAAO,eAAe,+BAA+B,WAAW;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,kBAAkB;AAAA,MACnC,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,uCAAuC,CAGlD,YAqBG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAOF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,gBAAgB,KAAK,IAAI,SAAS,CAAC;AAEtD,WAAO,mBAAmB,WAAW,gBAAgB,MAAM,cAAc;AAAA,EAC3E;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,wBAAwB,CAGnC,YAYI;AACJ,QAAM,kBAAkB,qCAAqC,OAAO;AAEpE,SAAO,YAAY,eAAe;AACpC;AAMO,IAAM,qBAAqB,CAChC,WACA,gBACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,kBAAkB;AAAA,MACnC,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,gCAAgC,CAC3C,WACA,mBACG,CAAC,oBAAoB,YAAY,kBAAkB,gBAAgB;AAEj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AAM,kBAAkB,8BAA8B,OAAO;AAE7D,SAAO,YAAY,eAAe;AACpC;AAMO,IAAM,cAAc,CACzB,WACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,kBAAkB,QAAQ,OAAO,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAEO,IAAM,yBAAyB,CAAC,cACrC,CAAC,oBAAoB,YAAY,gBAAgB;AAE5C,IAAM,6BAA6B,CAIxC,WACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB,SAAS;AAE3E,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,WAAW,gBAAgB,MAAM;AAEnD,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,WAAW,GAAG,aAAa;AACpE;AAOO,IAAM,iBAAiB,CAI5B,WACA,YAQ2D;AAC3D,QAAM,eAAe,2BAA2B,WAAW,OAAO;AAElE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody,\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 * Update parameters or add new annotations of the specified type(s) and to the Metadata for a **Dataset Version**.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library.\n\n * @summary Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\n \"meta_properties\",\n datasetVersionMetaPostBodyBody.meta_properties\n );\n }\n if (datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append(\"annotations\", datasetVersionMetaPostBodyBody.annotations);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddMetadataVersionMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n }\n > = (props) => {\n const { datasetId, datasetVersion, data } = props ?? {};\n\n return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddMetadataVersionMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadataVersion>>\n>;\nexport type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;\nexport type AddMetadataVersionMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadataVersion = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddMetadataVersionMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns the Metadata for a **Dataset Version** in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset Version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetMetadataVersionQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [\"data-manager-api\", `/dataset/${datasetId}/meta/${datasetVersion}`] as const;\n\nexport const getGetMetadataVersionQueryOptions = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetMetadataVersionQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getMetadataVersion>>\n > = ({ signal }) =>\n getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);\n\n return {\n queryKey,\n queryFn,\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n };\n};\n\nexport type GetMetadataVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadataVersion>>\n>;\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadataVersion = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetMetadataVersionQueryOptions(\n datasetId,\n datasetVersion,\n options\n );\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 * Update default parameters or add new labels to the Metadata for the Dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\"meta_properties\", datasetMetaPostBodyBody.meta_properties);\n }\n if (datasetMetaPostBodyBody.labels !== undefined) {\n formData.append(\"labels\", datasetMetaPostBodyBody.labels);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddMetadataMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadata>>,\n { datasetId: string; data: DatasetMetaPostBodyBody }\n > = (props) => {\n const { datasetId, data } = props ?? {};\n\n return addMetadata(datasetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddMetadataMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadata>>\n>;\nexport type AddMetadataMutationBody = DatasetMetaPostBodyBody;\nexport type AddMetadataMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadata = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddMetadataMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns the Metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetId}/meta`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (datasetId: string) =>\n [\"data-manager-api\", `/dataset/${datasetId}/meta`] as const;\n\nexport const getGetMetadataQueryOptions = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({\n signal,\n }) => getMetadata(datasetId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!datasetId, ...queryOptions };\n};\n\nexport type GetMetadataQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadata>>\n>;\nexport type GetMetadataQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadata = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetMetadataQueryOptions(datasetId, 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"]}
|
package/metadata/metadata.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { ae as DatasetVersionMetaPostBodyBody, bV as customInstance, bG as DatasetMetaGetResponse, bW as ErrorType, bR as DmError, af as DatasetMetaPostBodyBody } from '../custom-instance-e5540c3b.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/metadata/metadata.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/metadata/metadata.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.1\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 DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody,\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 * Update parameters or add new annotations of the specified type(s) and to the Metadata for a **Dataset Version**.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library.\n\n * @summary Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\n \"meta_properties\",\n datasetVersionMetaPostBodyBody.meta_properties\n );\n }\n if (datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append(\"annotations\", datasetVersionMetaPostBodyBody.annotations);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddMetadataVersionMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n }\n > = (props) => {\n const { datasetId, datasetVersion, data } = props ?? {};\n\n return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddMetadataVersionMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadataVersion>>\n>;\nexport type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;\nexport type AddMetadataVersionMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadataVersion = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddMetadataVersionMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns the Metadata for a **Dataset Version** in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset Version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetMetadataVersionQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [\"data-manager-api\", `/dataset/${datasetId}/meta/${datasetVersion}`] as const;\n\nexport const getGetMetadataVersionQueryOptions = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetMetadataVersionQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getMetadataVersion>>\n > = ({ signal }) =>\n getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);\n\n return {\n queryKey,\n queryFn,\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n };\n};\n\nexport type GetMetadataVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadataVersion>>\n>;\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadataVersion = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetMetadataVersionQueryOptions(\n datasetId,\n datasetVersion,\n options\n );\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 * Update default parameters or add new labels to the Metadata for the Dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\"meta_properties\", datasetMetaPostBodyBody.meta_properties);\n }\n if (datasetMetaPostBodyBody.labels !== undefined) {\n formData.append(\"labels\", datasetMetaPostBodyBody.labels);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddMetadataMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadata>>,\n { datasetId: string; data: DatasetMetaPostBodyBody }\n > = (props) => {\n const { datasetId, data } = props ?? {};\n\n return addMetadata(datasetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddMetadataMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadata>>\n>;\nexport type AddMetadataMutationBody = DatasetMetaPostBodyBody;\nexport type AddMetadataMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadata = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddMetadataMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns the Metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetId}/meta`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (datasetId: string) =>\n [\"data-manager-api\", `/dataset/${datasetId}/meta`] as const;\n\nexport const getGetMetadataQueryOptions = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({\n signal,\n }) => getMetadata(datasetId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!datasetId, ...queryOptions };\n};\n\nexport type GetMetadataQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadata>>\n>;\nexport type GetMetadataQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadata = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetMetadataQueryOptions(datasetId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAmC/B,IAAM,qBAAqB,CAChC,WACA,gBACA,gCACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,MAAI,+BAA+B,oBAAoB,QAAW;AAChE,aAAS;AAAA,MACP;AAAA,MACA,+BAA+B;AAAA,IACjC;AAAA,EACF;AACA,MAAI,+BAA+B,gBAAgB,QAAW;AAC5D,aAAS,OAAO,eAAe,+BAA+B,WAAW;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,kBAAkB;AAAA,MACnC,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,uCAAuC,CAGlD,YAqBG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAOF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,gBAAgB,KAAK,IAAI,SAAS,CAAC;AAEtD,WAAO,mBAAmB,WAAW,gBAAgB,MAAM,cAAc;AAAA,EAC3E;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,wBAAwB,CAGnC,YAYI;AACJ,QAAM,kBAAkB,qCAAqC,OAAO;AAEpE,SAAO,YAAY,eAAe;AACpC;AAMO,IAAM,qBAAqB,CAChC,WACA,gBACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,kBAAkB;AAAA,MACnC,QAAQ;AAAA,MACR;AAAA,IACF;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M,cAAc;AAAA,EACpD;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,kBAAkB,8BAA8B,OAAO;AAE7D,SAAO,YAAY,eAAe;AACpC;AAMO,IAAM,cAAc,CACzB,WACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,kBAAkB,QAAQ,OAAO,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAEO,IAAM,yBAAyB,CAAC,cACrC,CAAC,oBAAoB,YAAY,gBAAgB;AAE5C,IAAM,6BAA6B,CAIxC,WACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB,SAAS;AAE3E,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,WAAW,gBAAgB,MAAM;AAEnD,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,WAAW,GAAG,aAAa;AACpE;AAOO,IAAM,iBAAiB,CAI5B,WACA,YAQ2D;AAC3D,QAAM,eAAe,2BAA2B,WAAW,OAAO;AAElE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/metadata/metadata.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 DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody,\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 * Update parameters or add new annotations of the specified type(s) and to the Metadata for a **Dataset Version**.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library.\n\n * @summary Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\n \"meta_properties\",\n datasetVersionMetaPostBodyBody.meta_properties\n );\n }\n if (datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append(\"annotations\", datasetVersionMetaPostBodyBody.annotations);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddMetadataVersionMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n }\n > = (props) => {\n const { datasetId, datasetVersion, data } = props ?? {};\n\n return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddMetadataVersionMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadataVersion>>\n>;\nexport type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;\nexport type AddMetadataVersionMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadataVersion = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddMetadataVersionMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns the Metadata for a **Dataset Version** in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset Version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetMetadataVersionQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [\"data-manager-api\", `/dataset/${datasetId}/meta/${datasetVersion}`] as const;\n\nexport const getGetMetadataVersionQueryOptions = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetMetadataVersionQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getMetadataVersion>>\n > = ({ signal }) =>\n getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);\n\n return {\n queryKey,\n queryFn,\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n };\n};\n\nexport type GetMetadataVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadataVersion>>\n>;\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadataVersion = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetMetadataVersionQueryOptions(\n datasetId,\n datasetVersion,\n options\n );\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 * Update default parameters or add new labels to the Metadata for the Dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\"meta_properties\", datasetMetaPostBodyBody.meta_properties);\n }\n if (datasetMetaPostBodyBody.labels !== undefined) {\n formData.append(\"labels\", datasetMetaPostBodyBody.labels);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddMetadataMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadata>>,\n { datasetId: string; data: DatasetMetaPostBodyBody }\n > = (props) => {\n const { datasetId, data } = props ?? {};\n\n return addMetadata(datasetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddMetadataMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadata>>\n>;\nexport type AddMetadataMutationBody = DatasetMetaPostBodyBody;\nexport type AddMetadataMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadata = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddMetadataMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Returns the Metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetId}/meta`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (datasetId: string) =>\n [\"data-manager-api\", `/dataset/${datasetId}/meta`] as const;\n\nexport const getGetMetadataQueryOptions = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({\n signal,\n }) => getMetadata(datasetId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!datasetId, ...queryOptions };\n};\n\nexport type GetMetadataQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadata>>\n>;\nexport type GetMetadataQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadata = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetMetadataQueryOptions(datasetId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAmC/B,IAAM,qBAAqB,CAChC,WACA,gBACA,gCACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,MAAI,+BAA+B,oBAAoB,QAAW;AAChE,aAAS;AAAA,MACP;AAAA,MACA,+BAA+B;AAAA,IACjC;AAAA,EACF;AACA,MAAI,+BAA+B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E,QAAM,YAAW,6CAAc,aAAY,uBAAuB,SAAS;AAE3E,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,WAAW,gBAAgB,MAAM;AAEnD,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,WAAW,GAAG,aAAa;AACpE;AAOO,IAAM,iBAAiB,CAI5B,WACA,YAQ2D;AAC3D,QAAM,eAAe,2BAA2B,WAAW,OAAO;AAElE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
|
package/package.json
CHANGED
package/project/project.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/project/project.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAoC/B,IAAM,cAAc,CACzB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACjD;AAAA,EACF;AACF;AAEO,IAAM,yBAAyB,CAAC,WACrC,CAAC,oBAAoB,YAAY,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEvD,IAAM,6BAA6B,CAIxC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB,MAAM;AAExE,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,QAAQ,gBAAgB,MAAM;AAEhD,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,iBAAiB,CAI5B,QACA,YAQ2D;AAC3D,QAAM,eAAe,2BAA2B,QAAQ,OAAO;AAE/D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAaO,IAAM,gBAAgB,CAC3B,qBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;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OAAO;AAElE,SAAO,YAAY,eAAe;AACpC;AAUO,IAAM,0BAA0B,CACrC,WACA,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY;AAAA,MACjB,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,qCAAqC,CAChD,WACA,WAEA;AAAA,EACM;AAAA,EACA,YAAY;AAAA,EAChB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAEK,IAAM,yCAAyC,CAIpD,WACA,QACA,YAY4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aACd,mCAAmC,WAAW,MAAM;AAEtD,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,wBAAwB,WAAW,QAAQ,gBAAgB,MAAM;AAEnE,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,WAAW,GAAG,aAAa;AACpE;AAOO,IAAM,6BAA6B,CAIxC,WACA,QACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,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.1\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 ProjectsGetResponse,\n DmError,\n GetProjectsParams,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n GetProjectFileWithTokenParams,\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 * @summary Get all Projects available to you\n */\nexport const getProjects = (\n params?: GetProjectsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = (params?: GetProjectsParams) =>\n [\"data-manager-api\", `/project`, ...(params ? [params] : [])] as const;\n\nexport const getGetProjectsQueryOptions = <\n TData = Awaited<ReturnType<typeof getProjects>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetProjectsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({\n signal,\n }) => getProjects(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetProjectsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjects>>\n>;\nexport type GetProjectsQueryError = ErrorType<void | DmError>;\n\nexport const useGetProjects = <\n TData = Awaited<ReturnType<typeof getProjects>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetProjectsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProjectsQueryOptions(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 * Creates a new Project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project when an **Account Server** is configured you will need a **Product**.\n\nAs the Project `owner` (creator) you are also automatically an `editor` of the Project and can add other users as **Editors** so that they can also manipulate the project. An **Editor** of a project can also delete it.\n\nThe name you give the Project is free-form text (can contain spaces etc.) but the name you use must be unique amongst all the Projects you create.\n\n * @summary Create a new Project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n {\n url: `/project`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getCreateProjectMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createProject>>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createProject(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof createProject>>\n>;\nexport type CreateProjectMutationBody = ProjectPostBodyBody;\nexport type CreateProjectMutationError = ErrorType<DmError | void>;\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets the details of a Project that is available to you.\n\n * @summary Get a Project\n */\nexport const getProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectId: string) =>\n [\"data-manager-api\", `/project/${projectId}`] as const;\n\nexport const getGetProjectQueryOptions = <\n TData = Awaited<ReturnType<typeof getProject>>,\n TError = ErrorType<void | DmError>\n>(\n projectId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProject>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({\n signal,\n }) => getProject(projectId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!projectId, ...queryOptions };\n};\n\nexport type GetProjectQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProject>>\n>;\nexport type GetProjectQueryError = ErrorType<void | DmError>;\n\nexport const useGetProject = <\n TData = Awaited<ReturnType<typeof getProject>>,\n TError = ErrorType<void | DmError>\n>(\n projectId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProject>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProjectQueryOptions(projectId, 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 * Used to update some adjustable parameters of a Project, i.e. to make it `private` or make it `public``. What can be adjusted will depend on the purchased **Product**\n\n * @summary Adjust an existing Project\n */\nexport const patchProject = (\n projectId: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getPatchProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProject>>,\n { projectId: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return patchProject(projectId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProject>>\n>;\nexport type PatchProjectMutationBody = ProjectPatchBodyBody;\nexport type PatchProjectMutationError = ErrorType<DmError>;\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes an existing Project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the Project will also be removed\n\n * @summary Delete a Project\n */\nexport const deleteProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteProjectMutationOptions = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProject>>,\n { projectId: string }\n > = (props) => {\n const { projectId } = props ?? {};\n\n return deleteProject(projectId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProject>>\n>;\n\nexport type DeleteProjectMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Adds a user to a Project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a Project Editor\n */\nexport const addEditorToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddEditorToProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addEditorToProject(projectId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddEditorToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToProject>>\n>;\n\nexport type AddEditorToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddEditorToProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you.\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a Project Editor\n */\nexport const removeEditorFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getRemoveEditorFromProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeEditorFromProject(projectId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type RemoveEditorFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromProject>>\n>;\n\nexport type RemoveEditorFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getRemoveEditorFromProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Adds a user to a project as an `observer`. Observers can view Projects and download files but they cannot modify Project data or run **Applications** or **Jobs**.\n\nYou must be an `editor` or the `owner` of the Project to add Observers\n\n * @summary Add a Project Observer\n */\nexport const addObserverToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/observer/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddObserverToProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addObserverToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addObserverToProject(projectId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddObserverToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addObserverToProject>>\n>;\n\nexport type AddObserverToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddObserverToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddObserverToProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a project `observer`.\n\nYou must be an `editor` or the `owner` of the Project to remove Observers\n\n * @summary Delete a Project Observer\n */\nexport const removeObserverFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/observer/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getRemoveObserverFromProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeObserverFromProject(projectId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type RemoveObserverFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeObserverFromProject>>\n>;\n\nexport type RemoveObserverFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveObserverFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getRemoveObserverFromProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the Project if the Project is `private`\n\n * @summary Download a Project file\n */\nexport const getProjectFile = (\n projectId: string,\n params: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectId: string,\n params: GetProjectFileParams\n) => [\"data-manager-api\", `/project/${projectId}/file`, ...(params ? [params] : [])] as const;\n\nexport const getGetProjectFileQueryOptions = <\n TData = Awaited<ReturnType<typeof getProjectFile>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({\n signal,\n }) => getProjectFile(projectId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!projectId, ...queryOptions };\n};\n\nexport type GetProjectFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFile>>\n>;\nexport type GetProjectFileQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFile = <\n TData = Awaited<ReturnType<typeof getProjectFile>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProjectFileQueryOptions(\n projectId,\n params,\n options\n );\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 user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectId: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}/file`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddFileToProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addFileToProject>>,\n { projectId: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return addFileToProject(projectId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddFileToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addFileToProject>>\n>;\nexport type AddFileToProjectMutationBody = ProjectFilePutBodyBody;\nexport type AddFileToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddFileToProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nAs there is no authentication for this endpoint you must provide a valid token. The token must be a token valid for the project, usually generated when an **Instance** has been launched in the Project.\n\n * @summary Download a Project file using a Token\n */\nexport const getProjectFileWithToken = (\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n {\n url: `/project/${projectId}/file-with-token`,\n method: \"get\",\n params,\n signal,\n },\n options\n );\n};\n\nexport const getGetProjectFileWithTokenQueryKey = (\n projectId: string,\n params: GetProjectFileWithTokenParams\n) =>\n [\n \"data-manager-api\",\n `/project/${projectId}/file-with-token`,\n ...(params ? [params] : []),\n ] as const;\n\nexport const getGetProjectFileWithTokenQueryOptions = <\n TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetProjectFileWithTokenQueryKey(projectId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n > = ({ signal }) =>\n getProjectFileWithToken(projectId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!projectId, ...queryOptions };\n};\n\nexport type GetProjectFileWithTokenQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n>;\nexport type GetProjectFileWithTokenQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFileWithToken = <\n TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProjectFileWithTokenQueryOptions(\n projectId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/project/project.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAoC/B,IAAM,cAAc,CACzB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACjD;AAAA,EACF;AACF;AAEO,IAAM,yBAAyB,CAAC,WACrC,CAAC,oBAAoB,YAAY,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEvD,IAAM,6BAA6B,CAIxC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB,MAAM;AAExE,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,QAAQ,gBAAgB,MAAM;AAEhD,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,iBAAiB,CAI5B,QACA,YAQ2D;AAC3D,QAAM,eAAe,2BAA2B,QAAQ,OAAO;AAE/D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAaO,IAAM,gBAAgB,CAC3B,qBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,oBAAoB,IAAI;AAChD,MAAI,oBAAoB,YAAY,QAAW;AAC7C,aAAS,OAAO,WAAW,oBAAoB,QAAQ,SAAS,CAAC;AAAA,EACnE;AACA,WAAS,OAAO,mBAAmB,oBAAoB,eAAe;AAEtE,SAAO;AAAA,IACL;AAAA,MACE,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;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EK,IAAM,yCAAyC,CAIpD,WACA,QACA,YAY4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aACd,mCAAmC,WAAW,MAAM;AAEtD,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,wBAAwB,WAAW,QAAQ,gBAAgB,MAAM;AAEnE,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,WAAW,GAAG,aAAa;AACpE;AAOO,IAAM,6BAA6B,CAIxC,WACA,QACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ProjectsGetResponse,\n DmError,\n GetProjectsParams,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n GetProjectFileWithTokenParams,\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 * @summary Get all Projects available to you\n */\nexport const getProjects = (\n params?: GetProjectsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = (params?: GetProjectsParams) =>\n [\"data-manager-api\", `/project`, ...(params ? [params] : [])] as const;\n\nexport const getGetProjectsQueryOptions = <\n TData = Awaited<ReturnType<typeof getProjects>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetProjectsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({\n signal,\n }) => getProjects(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetProjectsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjects>>\n>;\nexport type GetProjectsQueryError = ErrorType<void | DmError>;\n\nexport const useGetProjects = <\n TData = Awaited<ReturnType<typeof getProjects>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetProjectsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProjectsQueryOptions(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 * Creates a new Project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project when an **Account Server** is configured you will need a **Product**.\n\nAs the Project `owner` (creator) you are also automatically an `editor` of the Project and can add other users as **Editors** so that they can also manipulate the project. An **Editor** of a project can also delete it.\n\nThe name you give the Project is free-form text (can contain spaces etc.) but the name you use must be unique amongst all the Projects you create.\n\n * @summary Create a new Project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n {\n url: `/project`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getCreateProjectMutationOptions = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createProject>>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createProject(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof createProject>>\n>;\nexport type CreateProjectMutationBody = ProjectPostBodyBody;\nexport type CreateProjectMutationError = ErrorType<DmError | void>;\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets the details of a Project that is available to you.\n\n * @summary Get a Project\n */\nexport const getProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectId: string) =>\n [\"data-manager-api\", `/project/${projectId}`] as const;\n\nexport const getGetProjectQueryOptions = <\n TData = Awaited<ReturnType<typeof getProject>>,\n TError = ErrorType<void | DmError>\n>(\n projectId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProject>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({\n signal,\n }) => getProject(projectId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!projectId, ...queryOptions };\n};\n\nexport type GetProjectQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProject>>\n>;\nexport type GetProjectQueryError = ErrorType<void | DmError>;\n\nexport const useGetProject = <\n TData = Awaited<ReturnType<typeof getProject>>,\n TError = ErrorType<void | DmError>\n>(\n projectId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProject>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProjectQueryOptions(projectId, 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 * Used to update some adjustable parameters of a Project, i.e. to make it `private` or make it `public``. What can be adjusted will depend on the purchased **Product**\n\n * @summary Adjust an existing Project\n */\nexport const patchProject = (\n projectId: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getPatchProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProject>>,\n { projectId: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return patchProject(projectId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProject>>\n>;\nexport type PatchProjectMutationBody = ProjectPatchBodyBody;\nexport type PatchProjectMutationError = ErrorType<DmError>;\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getPatchProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes an existing Project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the Project will also be removed\n\n * @summary Delete a Project\n */\nexport const deleteProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteProjectMutationOptions = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProject>>,\n { projectId: string }\n > = (props) => {\n const { projectId } = props ?? {};\n\n return deleteProject(projectId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProject>>\n>;\n\nexport type DeleteProjectMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Adds a user to a Project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a Project Editor\n */\nexport const addEditorToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddEditorToProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addEditorToProject(projectId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddEditorToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToProject>>\n>;\n\nexport type AddEditorToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddEditorToProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you.\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a Project Editor\n */\nexport const removeEditorFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getRemoveEditorFromProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeEditorFromProject(projectId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type RemoveEditorFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromProject>>\n>;\n\nexport type RemoveEditorFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getRemoveEditorFromProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Adds a user to a project as an `observer`. Observers can view Projects and download files but they cannot modify Project data or run **Applications** or **Jobs**.\n\nYou must be an `editor` or the `owner` of the Project to add Observers\n\n * @summary Add a Project Observer\n */\nexport const addObserverToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/observer/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddObserverToProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addObserverToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addObserverToProject(projectId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddObserverToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addObserverToProject>>\n>;\n\nexport type AddObserverToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddObserverToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddObserverToProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a project `observer`.\n\nYou must be an `editor` or the `owner` of the Project to remove Observers\n\n * @summary Delete a Project Observer\n */\nexport const removeObserverFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/observer/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getRemoveObserverFromProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeObserverFromProject(projectId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type RemoveObserverFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeObserverFromProject>>\n>;\n\nexport type RemoveObserverFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveObserverFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getRemoveObserverFromProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the Project if the Project is `private`\n\n * @summary Download a Project file\n */\nexport const getProjectFile = (\n projectId: string,\n params: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectId: string,\n params: GetProjectFileParams\n) => [\"data-manager-api\", `/project/${projectId}/file`, ...(params ? [params] : [])] as const;\n\nexport const getGetProjectFileQueryOptions = <\n TData = Awaited<ReturnType<typeof getProjectFile>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({\n signal,\n }) => getProjectFile(projectId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!projectId, ...queryOptions };\n};\n\nexport type GetProjectFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFile>>\n>;\nexport type GetProjectFileQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFile = <\n TData = Awaited<ReturnType<typeof getProjectFile>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProjectFileQueryOptions(\n projectId,\n params,\n options\n );\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 user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectId: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}/file`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAddFileToProjectMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addFileToProject>>,\n { projectId: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return addFileToProject(projectId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddFileToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addFileToProject>>\n>;\nexport type AddFileToProjectMutationBody = ProjectFilePutBodyBody;\nexport type AddFileToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddFileToProjectMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nAs there is no authentication for this endpoint you must provide a valid token. The token must be a token valid for the project, usually generated when an **Instance** has been launched in the Project.\n\n * @summary Download a Project file using a Token\n */\nexport const getProjectFileWithToken = (\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n {\n url: `/project/${projectId}/file-with-token`,\n method: \"get\",\n params,\n signal,\n },\n options\n );\n};\n\nexport const getGetProjectFileWithTokenQueryKey = (\n projectId: string,\n params: GetProjectFileWithTokenParams\n) =>\n [\n \"data-manager-api\",\n `/project/${projectId}/file-with-token`,\n ...(params ? [params] : []),\n ] as const;\n\nexport const getGetProjectFileWithTokenQueryOptions = <\n TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetProjectFileWithTokenQueryKey(projectId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n > = ({ signal }) =>\n getProjectFileWithToken(projectId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!projectId, ...queryOptions };\n};\n\nexport type GetProjectFileWithTokenQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n>;\nexport type GetProjectFileWithTokenQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFileWithToken = <\n TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetProjectFileWithTokenQueryOptions(\n projectId,\n params,\n options\n );\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"]}
|