@squonk/data-manager-client 1.0.26 → 1.0.27
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.d.ts +1 -1
- package/admin/admin.d.ts +1 -1
- package/application/application.d.ts +1 -1
- package/{custom-instance-36125733.d.ts → custom-instance-fef08cd2.d.ts} +6 -1
- package/dataset/dataset.d.ts +1 -1
- package/exchange-rate/exchange-rate.d.ts +1 -1
- package/file/file.d.ts +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +50 -1
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +21 -2
- package/instance/instance.js +49 -0
- package/instance/instance.js.map +1 -1
- package/job/job.d.ts +1 -1
- package/metadata/metadata.d.ts +1 -1
- package/package.json +1 -1
- package/project/project.d.ts +1 -1
- package/src/data-manager-api.schemas.ts +6 -0
- package/src/instance/instance.ts +88 -0
- package/task/task.d.ts +1 -1
- package/type/type.d.ts +1 -1
- package/user/user.d.ts +1 -1
package/instance/instance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/instance/instance.ts"],"sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n InstancePostResponse,\n DmError,\n InstancePostBodyBody,\n InstancesGetResponse,\n GetInstancesParams,\n 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.debug !== undefined) {\n formData.append(\"debug\", instancePostBodyBody.debug);\n }\n if (instancePostBodyBody.specification !== undefined) {\n formData.append(\"specification\", instancePostBodyBody.specification);\n }\n\n return customInstance<InstancePostResponse>(\n {\n url: `/instance`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof createInstance>>\n>;\nexport type CreateInstanceMutationBody = InstancePostBodyBody;\nexport type CreateInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useCreateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createInstance>>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createInstance(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a summary of all running instances. Instances can be running as an Application or as a Job. The response will contain an `application_type` field that is either `job` or `application`\n\n * @summary Get summary information about all Job and Application instances\n */\nexport const getInstances = (\n params?: GetInstancesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<InstancesGetResponse>(\n { url: `/instance`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams) => [\n `/instance`,\n ...(params ? [params] : []),\n];\n\nexport type GetInstancesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getInstances>>\n>;\nexport type GetInstancesQueryError = ErrorType<void | DmError>;\n\nexport const useGetInstances = <\n TData = Awaited<ReturnType<typeof getInstances>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetInstancesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getInstances>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetInstancesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstances>>> = ({\n signal,\n }) => getInstances(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getInstances>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * The instance information will be returned if available.\n\n * @summary Get detailed information about a specific instance\n */\nexport const getInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<InstanceGetResponse>(\n { url: `/instance/${instanceId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetInstanceQueryKey = (instanceId: string) => [\n `/instance/${instanceId}`,\n];\n\nexport type GetInstanceQueryResult = NonNullable<\n Awaited<ReturnType<typeof getInstance>>\n>;\nexport type GetInstanceQueryError = ErrorType<void | DmError>;\n\nexport const useGetInstance = <\n TData = Awaited<ReturnType<typeof getInstance>>,\n TError = ErrorType<void | DmError>\n>(\n instanceId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getInstance>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetInstanceQueryKey(instanceId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstance>>> = ({\n signal,\n }) => getInstance(instanceId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getInstance>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!instanceId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * The Application or Job instance is terminated.\n\nYou must be the `owner` or an `editor` of the instance to delete it\n\n * @summary Delete a Job or Application instance\n */\nexport const terminateInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstanceDeleteResponse>(\n { url: `/instance/${instanceId}`, method: \"delete\" },\n options\n );\n};\n\nexport type TerminateInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof terminateInstance>>\n>;\n\nexport type TerminateInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useTerminateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof terminateInstance>>,\n TError,\n { instanceId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof terminateInstance>>,\n { instanceId: string }\n > = (props) => {\n const { instanceId } = props ?? {};\n\n return terminateInstance(instanceId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof terminateInstance>>,\n TError,\n { instanceId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The Application or Job instance is updated according to the patch parameters.\n\nYou must be the `owner` or an `editor` of the instance to patch it\n\n * @summary Update a Job or Application instance\n */\nexport const patchInstance = (\n instanceId: string,\n params?: PatchInstanceParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/instance/${instanceId}`, method: \"patch\", params },\n options\n );\n};\n\nexport type PatchInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchInstance>>\n>;\n\nexport type PatchInstanceMutationError = ErrorType<DmError>;\n\nexport const usePatchInstance = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchInstance>>,\n TError,\n { instanceId: string; params?: PatchInstanceParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchInstance>>,\n { instanceId: string; params?: PatchInstanceParams }\n > = (props) => {\n const { instanceId, params } = props ?? {};\n\n return patchInstance(instanceId, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchInstance>>,\n TError,\n { instanceId: string; params?: PatchInstanceParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This revokes the instance **Token**, which was optionally generated when the instance was launched. No authentication is required to use this endpoint, which is typically used by a remote system driven by instance callbacks.\n\nTokens automatically expire after a period of time but can be revoked instantly with this endpoint.\n\nThe remote system will revoke the token when it's finished with it\n\n * @summary Delete (revoke) the instance token\n */\nexport const deleteInstanceToken = (\n instanceId: string,\n token: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/instance/${instanceId}/token/${token}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteInstanceTokenMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteInstanceToken>>\n>;\n\nexport type DeleteInstanceTokenMutationError = ErrorType<DmError>;\n\nexport const useDeleteInstanceToken = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n TError,\n { instanceId: string; token: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n { instanceId: string; token: string }\n > = (props) => {\n const { instanceId, token } = props ?? {};\n\n return deleteInstanceToken(instanceId, token, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n TError,\n { instanceId: string; token: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAyC/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,qBAAq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B,CAC3B,YACA,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,aAAa,cAAc,QAAQ,SAAS,OAAO;AAAA,IAC1D;AAAA,EACF;AACF;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,OAAO,IAAI,SAAS,CAAC;AAEzC,WAAO,cAAc,YAAY,QAAQ,cAAc;AAAA,EACzD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAUO,IAAM,sBAAsB,CACjC,YACA,OACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,aAAa,oBAAoB,SAAS,QAAQ,SAAS;AAAA,IAClE;AAAA,EACF;AACF;AAQO,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,MAAM,IAAI,SAAS,CAAC;AAExC,WAAO,oBAAoB,YAAY,OAAO,cAAc;AAAA,EAC9D;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/instance/instance.ts"],"sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n InstancePostResponse,\n DmError,\n InstancePostBodyBody,\n InstancesGetResponse,\n GetInstancesParams,\n InstanceDryRunPostResponse,\n InstanceGetResponse,\n InstanceDeleteResponse,\n PatchInstanceParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Launches a new Application or Job instance, returning an Instance and Task ID. The Task ID should be used against the `/task` endpoint to determine the availability of the the running instance.\n\nInstance behaviour is controlled using the `specification`. You will need to consult individual applications to determine what can be placed in the specification. Applications typically provide a `template` describing its **options**.\n\nAn Application instance is not Ready for use until the corresponding **TaskState** is `STARTED`.\n\nA Job instance typically runs to completion, reaching the **TaskState** `SUCCESS` when successful and `FAILURE` is unsuccessful.\n\n * @summary Creates a new Job or Application instance\n */\nexport const createInstance = (\n instancePostBodyBody: InstancePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"application_id\", instancePostBodyBody.application_id);\n if (instancePostBodyBody.application_version !== undefined) {\n formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n }\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\n if (instancePostBodyBody.callback_url !== undefined) {\n formData.append(\"callback_url\", instancePostBodyBody.callback_url);\n }\n if (instancePostBodyBody.callback_context !== undefined) {\n formData.append(\"callback_context\", instancePostBodyBody.callback_context);\n }\n if (instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append(\n \"generate_callback_token\",\n instancePostBodyBody.generate_callback_token.toString()\n );\n }\n if (instancePostBodyBody.debug !== undefined) {\n formData.append(\"debug\", instancePostBodyBody.debug);\n }\n if (instancePostBodyBody.specification !== undefined) {\n formData.append(\"specification\", instancePostBodyBody.specification);\n }\n\n return customInstance<InstancePostResponse>(\n {\n url: `/instance`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof createInstance>>\n>;\nexport type CreateInstanceMutationBody = InstancePostBodyBody;\nexport type CreateInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useCreateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createInstance>>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createInstance(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a summary of all running instances. Instances can be running as an Application or as a Job. The response will contain an `application_type` field that is either `job` or `application`\n\n * @summary Get summary information about all Job and Application instances\n */\nexport const getInstances = (\n params?: GetInstancesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<InstancesGetResponse>(\n { url: `/instance`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams) => [\n `/instance`,\n ...(params ? [params] : []),\n];\n\nexport type GetInstancesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getInstances>>\n>;\nexport type GetInstancesQueryError = ErrorType<void | DmError>;\n\nexport const useGetInstances = <\n TData = Awaited<ReturnType<typeof getInstances>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetInstancesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getInstances>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetInstancesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstances>>> = ({\n signal,\n }) => getInstances(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getInstances>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Similar to the `/instance [POST]` endpoint this one is used to check whether a new **Application** or **Job** instance can be launched. Rather than returning an **Instance** (or **Task**) ID this endpoint is simply used to ensure that the Job/Application is runnable while also returning the compiled `command` (if the Instance is a Job).\n\nThe test result is only valid at the time of the call, whether an actual instance would start or not will require an identical call to `/instance POST`.\n\n * @summary Used to attempt the execution of new Job or Application instance\n */\nexport const dryRunInstance = (\n instancePostBodyBody: InstancePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"application_id\", instancePostBodyBody.application_id);\n if (instancePostBodyBody.application_version !== undefined) {\n formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n }\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\n if (instancePostBodyBody.callback_url !== undefined) {\n formData.append(\"callback_url\", instancePostBodyBody.callback_url);\n }\n if (instancePostBodyBody.callback_context !== undefined) {\n formData.append(\"callback_context\", instancePostBodyBody.callback_context);\n }\n if (instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append(\n \"generate_callback_token\",\n instancePostBodyBody.generate_callback_token.toString()\n );\n }\n if (instancePostBodyBody.debug !== undefined) {\n formData.append(\"debug\", instancePostBodyBody.debug);\n }\n if (instancePostBodyBody.specification !== undefined) {\n formData.append(\"specification\", instancePostBodyBody.specification);\n }\n\n return customInstance<InstanceDryRunPostResponse>(\n {\n url: `/instance/dry-run`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type DryRunInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof dryRunInstance>>\n>;\nexport type DryRunInstanceMutationBody = InstancePostBodyBody;\nexport type DryRunInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useDryRunInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof dryRunInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof dryRunInstance>>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return dryRunInstance(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof dryRunInstance>>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The instance information will be returned if available.\n\n * @summary Get detailed information about a specific instance\n */\nexport const getInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<InstanceGetResponse>(\n { url: `/instance/${instanceId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetInstanceQueryKey = (instanceId: string) => [\n `/instance/${instanceId}`,\n];\n\nexport type GetInstanceQueryResult = NonNullable<\n Awaited<ReturnType<typeof getInstance>>\n>;\nexport type GetInstanceQueryError = ErrorType<void | DmError>;\n\nexport const useGetInstance = <\n TData = Awaited<ReturnType<typeof getInstance>>,\n TError = ErrorType<void | DmError>\n>(\n instanceId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getInstance>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetInstanceQueryKey(instanceId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstance>>> = ({\n signal,\n }) => getInstance(instanceId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getInstance>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!instanceId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * The Application or Job instance is terminated.\n\nYou must be the `owner` or an `editor` of the instance to delete it\n\n * @summary Delete a Job or Application instance\n */\nexport const terminateInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstanceDeleteResponse>(\n { url: `/instance/${instanceId}`, method: \"delete\" },\n options\n );\n};\n\nexport type TerminateInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof terminateInstance>>\n>;\n\nexport type TerminateInstanceMutationError = ErrorType<void | DmError>;\n\nexport const useTerminateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof terminateInstance>>,\n TError,\n { instanceId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof terminateInstance>>,\n { instanceId: string }\n > = (props) => {\n const { instanceId } = props ?? {};\n\n return terminateInstance(instanceId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof terminateInstance>>,\n TError,\n { instanceId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The Application or Job instance is updated according to the patch parameters.\n\nYou must be the `owner` or an `editor` of the instance to patch it\n\n * @summary Update a Job or Application instance\n */\nexport const patchInstance = (\n instanceId: string,\n params?: PatchInstanceParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/instance/${instanceId}`, method: \"patch\", params },\n options\n );\n};\n\nexport type PatchInstanceMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchInstance>>\n>;\n\nexport type PatchInstanceMutationError = ErrorType<DmError>;\n\nexport const usePatchInstance = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchInstance>>,\n TError,\n { instanceId: string; params?: PatchInstanceParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchInstance>>,\n { instanceId: string; params?: PatchInstanceParams }\n > = (props) => {\n const { instanceId, params } = props ?? {};\n\n return patchInstance(instanceId, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchInstance>>,\n TError,\n { instanceId: string; params?: PatchInstanceParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This revokes the instance **Token**, which was optionally generated when the instance was launched. No authentication is required to use this endpoint, which is typically used by a remote system driven by instance callbacks.\n\nTokens automatically expire after a period of time but can be revoked instantly with this endpoint.\n\nThe remote system will revoke the token when it's finished with it\n\n * @summary Delete (revoke) the instance token\n */\nexport const deleteInstanceToken = (\n instanceId: string,\n token: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/instance/${instanceId}/token/${token}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteInstanceTokenMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteInstanceToken>>\n>;\n\nexport type DeleteInstanceTokenMutationError = ErrorType<DmError>;\n\nexport const useDeleteInstanceToken = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n TError,\n { instanceId: string; token: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n { instanceId: string; token: string }\n > = (props) => {\n const { instanceId, token } = props ?? {};\n\n return deleteInstanceToken(instanceId, token, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteInstanceToken>>,\n TError,\n { instanceId: string; token: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA0C/B,IAAM,iBAAiB,CAC5B,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,UAAU,QAAW;AAC5C,aAAS,OAAO,SAAS,qBAAqB,KAAK;AAAA,EACrD;AACA,MAAI,qBAAqB,kBAAkB,QAAW;AACpD,aAAS,OAAO,iBAAiB,qBAAqB,aAAa;AAAA,EACrE;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,oBAAoB,CAG/B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;A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|
2
|
-
import { g as GetJobsParams,
|
|
2
|
+
import { g as GetJobsParams, bI as customInstance, b6 as JobsGetResponse, bJ as ErrorType, bE as DmError, f as GetJobByVersionParams, b8 as JobGetResponse, e as GetJobParams } from '../custom-instance-fef08cd2.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
5
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
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 { a7 as DatasetVersionMetaPostBodyBody,
|
|
3
|
+
import { a7 as DatasetVersionMetaPostBodyBody, bI as customInstance, bu as DatasetMetaGetResponse, bJ as ErrorType, bE as DmError, a8 as DatasetMetaPostBodyBody } from '../custom-instance-fef08cd2.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/package.json
CHANGED
package/project/project.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bI as customInstance, b2 as ProjectsGetResponse, bJ as ErrorType, bE as DmError, _ as ProjectPostBodyBody, b3 as ProjectPostResponse, ar as ProjectDetail, $ as ProjectPatchBodyBody, al as TaskIdentity, q as GetProjectFileParams, a0 as ProjectFilePutBodyBody, p as GetProjectFileWithTokenParams } from '../custom-instance-fef08cd2.js';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
4
4
|
import 'axios';
|
|
@@ -1724,6 +1724,12 @@ export interface InstancePostResponse {
|
|
|
1724
1724
|
command?: string;
|
|
1725
1725
|
}
|
|
1726
1726
|
|
|
1727
|
+
export interface InstanceDryRunPostResponse {
|
|
1728
|
+
/** The instance expanded command. Applies only to Job instances.
|
|
1729
|
+
*/
|
|
1730
|
+
command?: string;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1727
1733
|
export type InstanceDeleteResponse = TaskIdentity;
|
|
1728
1734
|
|
|
1729
1735
|
export interface DatasetsGetResponse {
|
package/src/instance/instance.ts
CHANGED
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
InstancePostBodyBody,
|
|
24
24
|
InstancesGetResponse,
|
|
25
25
|
GetInstancesParams,
|
|
26
|
+
InstanceDryRunPostResponse,
|
|
26
27
|
InstanceGetResponse,
|
|
27
28
|
InstanceDeleteResponse,
|
|
28
29
|
PatchInstanceParams,
|
|
@@ -190,6 +191,93 @@ export const useGetInstances = <
|
|
|
190
191
|
return query;
|
|
191
192
|
};
|
|
192
193
|
|
|
194
|
+
/**
|
|
195
|
+
* 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).
|
|
196
|
+
|
|
197
|
+
The 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`.
|
|
198
|
+
|
|
199
|
+
* @summary Used to attempt the execution of new Job or Application instance
|
|
200
|
+
*/
|
|
201
|
+
export const dryRunInstance = (
|
|
202
|
+
instancePostBodyBody: InstancePostBodyBody,
|
|
203
|
+
options?: SecondParameter<typeof customInstance>
|
|
204
|
+
) => {
|
|
205
|
+
const formData = new FormData();
|
|
206
|
+
formData.append("application_id", instancePostBodyBody.application_id);
|
|
207
|
+
if (instancePostBodyBody.application_version !== undefined) {
|
|
208
|
+
formData.append(
|
|
209
|
+
"application_version",
|
|
210
|
+
instancePostBodyBody.application_version
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
formData.append("project_id", instancePostBodyBody.project_id);
|
|
214
|
+
formData.append("as_name", instancePostBodyBody.as_name);
|
|
215
|
+
if (instancePostBodyBody.callback_url !== undefined) {
|
|
216
|
+
formData.append("callback_url", instancePostBodyBody.callback_url);
|
|
217
|
+
}
|
|
218
|
+
if (instancePostBodyBody.callback_context !== undefined) {
|
|
219
|
+
formData.append("callback_context", instancePostBodyBody.callback_context);
|
|
220
|
+
}
|
|
221
|
+
if (instancePostBodyBody.generate_callback_token !== undefined) {
|
|
222
|
+
formData.append(
|
|
223
|
+
"generate_callback_token",
|
|
224
|
+
instancePostBodyBody.generate_callback_token.toString()
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
if (instancePostBodyBody.debug !== undefined) {
|
|
228
|
+
formData.append("debug", instancePostBodyBody.debug);
|
|
229
|
+
}
|
|
230
|
+
if (instancePostBodyBody.specification !== undefined) {
|
|
231
|
+
formData.append("specification", instancePostBodyBody.specification);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return customInstance<InstanceDryRunPostResponse>(
|
|
235
|
+
{
|
|
236
|
+
url: `/instance/dry-run`,
|
|
237
|
+
method: "post",
|
|
238
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
239
|
+
data: formData,
|
|
240
|
+
},
|
|
241
|
+
options
|
|
242
|
+
);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export type DryRunInstanceMutationResult = NonNullable<
|
|
246
|
+
Awaited<ReturnType<typeof dryRunInstance>>
|
|
247
|
+
>;
|
|
248
|
+
export type DryRunInstanceMutationBody = InstancePostBodyBody;
|
|
249
|
+
export type DryRunInstanceMutationError = ErrorType<void | DmError>;
|
|
250
|
+
|
|
251
|
+
export const useDryRunInstance = <
|
|
252
|
+
TError = ErrorType<void | DmError>,
|
|
253
|
+
TContext = unknown
|
|
254
|
+
>(options?: {
|
|
255
|
+
mutation?: UseMutationOptions<
|
|
256
|
+
Awaited<ReturnType<typeof dryRunInstance>>,
|
|
257
|
+
TError,
|
|
258
|
+
{ data: InstancePostBodyBody },
|
|
259
|
+
TContext
|
|
260
|
+
>;
|
|
261
|
+
request?: SecondParameter<typeof customInstance>;
|
|
262
|
+
}) => {
|
|
263
|
+
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
264
|
+
|
|
265
|
+
const mutationFn: MutationFunction<
|
|
266
|
+
Awaited<ReturnType<typeof dryRunInstance>>,
|
|
267
|
+
{ data: InstancePostBodyBody }
|
|
268
|
+
> = (props) => {
|
|
269
|
+
const { data } = props ?? {};
|
|
270
|
+
|
|
271
|
+
return dryRunInstance(data, requestOptions);
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
return useMutation<
|
|
275
|
+
Awaited<ReturnType<typeof dryRunInstance>>,
|
|
276
|
+
TError,
|
|
277
|
+
{ data: InstancePostBodyBody },
|
|
278
|
+
TContext
|
|
279
|
+
>(mutationFn, mutationOptions);
|
|
280
|
+
};
|
|
193
281
|
/**
|
|
194
282
|
* The instance information will be returned if available.
|
|
195
283
|
|
package/task/task.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import { k as GetTasksParams,
|
|
3
|
+
import { k as GetTasksParams, bI as customInstance, a_ as TasksGetResponse, bJ as ErrorType, bE as DmError, j as GetTaskParams, b0 as TaskGetResponse } from '../custom-instance-fef08cd2.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/type/type.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { bI as customInstance, aZ as TypesGetResponse, bJ as ErrorType, bE as DmError } from '../custom-instance-fef08cd2.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
5
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/user/user.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { bI as customInstance, aW as UsersGetResponse, bJ as ErrorType, bE as DmError, a as GetUserAccountParams, ad as UserAccountDetail, Z as UserAccountPatchBodyBody, G as GetUserApiLogParams, aX as UserApiLogGetResponse } from '../custom-instance-fef08cd2.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|