@squonk/data-manager-client 1.2.3 → 1.2.4-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounting/accounting.cjs +31 -13
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +77 -0
- package/accounting/accounting.d.ts +10 -1
- package/accounting/accounting.js +29 -11
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +67 -27
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +324 -0
- package/admin/admin.d.ts +55 -22
- package/admin/admin.js +57 -17
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +23 -13
- package/application/application.cjs.map +1 -1
- package/application/application.d.cts +57 -0
- package/application/application.d.ts +7 -1
- package/application/application.js +22 -12
- package/application/application.js.map +1 -1
- package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
- package/chunk-J22A7LHX.cjs.map +1 -0
- package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
- package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
- package/configuration/configuration.cjs +13 -7
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +29 -0
- package/configuration/configuration.d.ts +4 -1
- package/configuration/configuration.js +13 -7
- package/configuration/configuration.js.map +1 -1
- package/{custom-instance-50c9dd5d.d.ts → custom-instance-3d66fe97.d.ts} +826 -826
- package/dataset/dataset.cjs +71 -72
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.cts +315 -0
- package/dataset/dataset.d.ts +46 -16
- package/dataset/dataset.js +62 -63
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +43 -32
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.cts +180 -0
- package/exchange-rate/exchange-rate.d.ts +25 -7
- package/exchange-rate/exchange-rate.js +38 -27
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +38 -22
- package/file/file.cjs.map +1 -1
- package/file/file.d.cts +154 -0
- package/file/file.d.ts +25 -10
- package/file/file.js +34 -18
- package/file/file.js.map +1 -1
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -0
- package/index.d.ts +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/instance/instance.cjs +47 -37
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.cts +215 -0
- package/instance/instance.d.ts +33 -12
- package/instance/instance.js +41 -31
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +36 -19
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +85 -0
- package/job/job.d.ts +10 -1
- package/job/job.js +34 -17
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +23 -26
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.cts +132 -0
- package/metadata/metadata.d.ts +19 -7
- package/metadata/metadata.js +20 -23
- package/metadata/metadata.js.map +1 -1
- package/package.json +12 -12
- package/project/project.cjs +70 -48
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +377 -0
- package/project/project.d.ts +61 -25
- package/project/project.js +59 -37
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +179 -194
- package/src/admin/admin.ts +590 -735
- package/src/application/application.ts +125 -141
- package/src/configuration/configuration.ts +72 -60
- package/src/data-manager-api.schemas.ts +941 -942
- package/src/dataset/dataset.ts +591 -770
- package/src/exchange-rate/exchange-rate.ts +362 -478
- package/src/file/file.ts +292 -357
- package/src/instance/instance.ts +427 -533
- package/src/job/job.ts +187 -198
- package/src/metadata/metadata.ts +247 -339
- package/src/project/project.ts +669 -860
- package/src/task/task.ts +181 -202
- package/src/type/type.ts +72 -68
- package/src/user/user.ts +248 -286
- package/task/task.cjs +31 -15
- package/task/task.cjs.map +1 -1
- package/task/task.d.cts +103 -0
- package/task/task.d.ts +10 -1
- package/task/task.js +29 -13
- package/task/task.js.map +1 -1
- package/type/type.cjs +13 -7
- package/type/type.cjs.map +1 -1
- package/type/type.d.cts +31 -0
- package/type/type.d.ts +4 -1
- package/type/type.js +13 -7
- package/type/type.js.map +1 -1
- package/user/user.cjs +39 -28
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +104 -0
- package/user/user.d.ts +16 -4
- package/user/user.js +36 -25
- package/user/user.js.map +1 -1
- package/chunk-UZTHSGDT.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/instance/instance.ts"],"names":[],"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;AAAA,EACrD;AACA,MAAI,qBAAqB,kBAAkB,QAAW;AACpD,aAAS,OAAO,iBAAiB,qBAAqB,aAAa;AAAA,EACrE;AAEA,SAAO;AAAA,IACL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,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","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"]}
|
|
1
|
+
{"version":3,"sources":["../../src/instance/instance.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AA4CA,IAAM,iBAAiB,CAC1B,sBACH,YAAsD;AAEjD,QAAM,WAAW,IAAI,SAAS;AACpC,WAAS,OA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AQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,mBAAmB,CAER,YACnB;AAEC,QAAM,kBAAkB,gCAAgC,OAAO;AAE/D,SAAO,YAAY,eAAe;AACpC;AAUG,IAAM,sBAAsB,CAC/B,YACA,OACH,YAAsD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,aAAa,UAAU,UAAU,KAAK;AAAA,MAAI,QAAQ;AAAA,IAC1D;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,wCAAwC,CAE7B,YACuG;AAC9H,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAoH,CAAC,UAAU;AACjI,UAAM,EAAC,YAAW,MAAK,IAAI,SAAS,CAAC;AAErC,WAAQ,oBAAoB,YAAW,OAAM,cAAc;AAAA,EAC7D;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,yBAAyB,CAEd,YACnB;AAEC,QAAM,kBAAkB,sCAAsC,OAAO;AAErE,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.20.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport {\n useMutation,\n useQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetInstancesParams,\n InstanceDryRunPostResponse,\n InstanceGetResponse,\n InstancePostBodyBody,\n InstancePostResponse,\n InstancesGetResponse,\n PatchInstanceParams,\n TaskIdentity\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n\n/**\n * Launches a new Application or Job instance, returning an Instance and Task ID. The Task ID should be used against the `/task` endpoint to determine the availability of the the running instance.\n\nInstance behaviour is controlled using the `specification`. You will need to consult individual applications to determine what can be placed in the specification. Applications typically provide a `template` describing its **options**.\n\nAn Application instance is not Ready for use until the corresponding **TaskState** is _STARTED_.\n\nA Job instance typically runs to completion, reaching the **TaskState** _SUCCESS_ when successful and _FAILURE_ is unsuccessful.\n\n * @summary Creates a new Job or Application instance\n */\nexport const createInstance = (\n instancePostBodyBody: InstancePostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n const formData = new FormData();\nformData.append('application_id', instancePostBodyBody.application_id)\nif(instancePostBodyBody.application_version !== undefined) {\n formData.append('application_version', instancePostBodyBody.application_version)\n }\nformData.append('project_id', instancePostBodyBody.project_id)\nformData.append('as_name', instancePostBodyBody.as_name)\nif(instancePostBodyBody.callback_url !== undefined) {\n formData.append('callback_url', instancePostBodyBody.callback_url)\n }\nif(instancePostBodyBody.callback_context !== undefined) {\n formData.append('callback_context', instancePostBodyBody.callback_context)\n }\nif(instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append('generate_callback_token', instancePostBodyBody.generate_callback_token.toString())\n }\nif(instancePostBodyBody.callback_token !== undefined) {\n formData.append('callback_token', instancePostBodyBody.callback_token)\n }\nif(instancePostBodyBody.debug !== undefined) {\n formData.append('debug', instancePostBodyBody.debug)\n }\nif(instancePostBodyBody.specification !== undefined) {\n formData.append('specification', instancePostBodyBody.specification)\n }\n\n return customInstance<InstancePostResponse>(\n {url: `/instance`, method: 'post',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\nexport const getCreateInstanceMutationOptions = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createInstance>>, TError,{data: InstancePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createInstance>>, TError,{data: InstancePostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createInstance>>, {data: InstancePostBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createInstance(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof createInstance>>>\n export type CreateInstanceMutationBody = InstancePostBodyBody\n export type CreateInstanceMutationError = ErrorType<void | DmError>\n\n /**\n * @summary Creates a new Job or Application instance\n */\nexport const useCreateInstance = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createInstance>>, TError,{data: InstancePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateInstanceMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Returns a summary of all running instances. Instances can be running as an Application or as a Job. The response will contain an `application_type` field that is either `job` or `application`\n\n * @summary Get summary information about all Job and Application instances\n */\nexport const getInstances = (\n params?: GetInstancesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<InstancesGetResponse>(\n {url: `/instance`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams,) => {\n \n return [\"data-manager-api\", `/instance`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetInstancesQueryOptions = <TData = Awaited<ReturnType<typeof getInstances>>, TError = ErrorType<void | DmError>>(params?: GetInstancesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getInstances>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetInstancesQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstances>>> = ({ signal }) => getInstances(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getInstances>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetInstancesQueryResult = NonNullable<Awaited<ReturnType<typeof getInstances>>>\nexport type GetInstancesQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get summary information about all Job and Application instances\n */\nexport const useGetInstances = <TData = Awaited<ReturnType<typeof getInstances>>, TError = ErrorType<void | DmError>>(\n params?: GetInstancesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getInstances>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetInstancesQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Similar to the `/instance [POST]` endpoint this one is used to check whether a new **Application** or **Job** instance can be launched. Rather than returning an **Instance** (or **Task**) ID this endpoint is simply used to ensure that the Job/Application is runnable while also returning the compiled `command` (if the Instance is a Job).\n\nThe test result is only valid at the time of the call, whether an actual instance would start or not will require an identical call to `/instance POST`.\n\n * @summary Used to check the execution of new Job or Application instance\n */\nexport const dryRunInstance = (\n instancePostBodyBody: InstancePostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n const formData = new FormData();\nformData.append('application_id', instancePostBodyBody.application_id)\nif(instancePostBodyBody.application_version !== undefined) {\n formData.append('application_version', instancePostBodyBody.application_version)\n }\nformData.append('project_id', instancePostBodyBody.project_id)\nformData.append('as_name', instancePostBodyBody.as_name)\nif(instancePostBodyBody.callback_url !== undefined) {\n formData.append('callback_url', instancePostBodyBody.callback_url)\n }\nif(instancePostBodyBody.callback_context !== undefined) {\n formData.append('callback_context', instancePostBodyBody.callback_context)\n }\nif(instancePostBodyBody.generate_callback_token !== undefined) {\n formData.append('generate_callback_token', instancePostBodyBody.generate_callback_token.toString())\n }\nif(instancePostBodyBody.callback_token !== undefined) {\n formData.append('callback_token', instancePostBodyBody.callback_token)\n }\nif(instancePostBodyBody.debug !== undefined) {\n formData.append('debug', instancePostBodyBody.debug)\n }\nif(instancePostBodyBody.specification !== undefined) {\n formData.append('specification', instancePostBodyBody.specification)\n }\n\n return customInstance<InstanceDryRunPostResponse>(\n {url: `/instance/dry-run`, method: 'post',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\nexport const getDryRunInstanceMutationOptions = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dryRunInstance>>, TError,{data: InstancePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof dryRunInstance>>, TError,{data: InstancePostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof dryRunInstance>>, {data: InstancePostBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return dryRunInstance(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DryRunInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof dryRunInstance>>>\n export type DryRunInstanceMutationBody = InstancePostBodyBody\n export type DryRunInstanceMutationError = ErrorType<void | DmError>\n\n /**\n * @summary Used to check the execution of new Job or Application instance\n */\nexport const useDryRunInstance = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dryRunInstance>>, TError,{data: InstancePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDryRunInstanceMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * @summary Get detailed information about an Instance\n */\nexport const getInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<InstanceGetResponse>(\n {url: `/instance/${instanceId}`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetInstanceQueryKey = (instanceId: string,) => {\n \n return [\"data-manager-api\", `/instance/${instanceId}`] as const;\n }\n\n \nexport const getGetInstanceQueryOptions = <TData = Awaited<ReturnType<typeof getInstance>>, TError = ErrorType<void | DmError>>(instanceId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getInstance>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetInstanceQueryKey(instanceId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getInstance>>> = ({ signal }) => getInstance(instanceId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(instanceId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getInstance>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetInstanceQueryResult = NonNullable<Awaited<ReturnType<typeof getInstance>>>\nexport type GetInstanceQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get detailed information about an Instance\n */\nexport const useGetInstance = <TData = Awaited<ReturnType<typeof getInstance>>, TError = ErrorType<void | DmError>>(\n instanceId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getInstance>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetInstanceQueryOptions(instanceId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * The Application or Job Instance is terminated.\n\nYou must be the `owner` or an `editor` of the Instance to delete it\n\n * @summary Delete a Job or Application Instance\n */\nexport const terminateInstance = (\n instanceId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<TaskIdentity>(\n {url: `/instance/${instanceId}`, method: 'delete'\n },\n options);\n }\n \n\n\nexport const getTerminateInstanceMutationOptions = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof terminateInstance>>, TError,{instanceId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof terminateInstance>>, TError,{instanceId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof terminateInstance>>, {instanceId: string}> = (props) => {\n const {instanceId} = props ?? {};\n\n return terminateInstance(instanceId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type TerminateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof terminateInstance>>>\n \n export type TerminateInstanceMutationError = ErrorType<void | DmError>\n\n /**\n * @summary Delete a Job or Application Instance\n */\nexport const useTerminateInstance = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof terminateInstance>>, TError,{instanceId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getTerminateInstanceMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * The Application or Job Instance is updated according to the patch parameters.\n\nYou must be the `owner` or an `editor` of the Instance to patch it\n\n * @summary Update a Job or Application Instance\n */\nexport const patchInstance = (\n instanceId: string,\n params?: PatchInstanceParams,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/instance/${instanceId}`, method: 'patch',\n params\n },\n options);\n }\n \n\n\nexport const getPatchInstanceMutationOptions = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchInstance>>, TError,{instanceId: string;params?: PatchInstanceParams}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchInstance>>, TError,{instanceId: string;params?: PatchInstanceParams}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchInstance>>, {instanceId: string;params?: PatchInstanceParams}> = (props) => {\n const {instanceId,params} = props ?? {};\n\n return patchInstance(instanceId,params,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof patchInstance>>>\n \n export type PatchInstanceMutationError = ErrorType<DmError>\n\n /**\n * @summary Update a Job or Application Instance\n */\nexport const usePatchInstance = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchInstance>>, TError,{instanceId: string;params?: PatchInstanceParams}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchInstanceMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * This revokes the instance **Token**, which was optionally generated when the instance was launched. No authentication is required to use this endpoint, which is typically used by a remote system driven by instance callbacks.\n\nTokens automatically expire after a period of time but can be revoked instantly with this endpoint.\n\nThe remote system will revoke the token when it's finished with it\n\n * @summary Delete (revoke) the Instance Token\n */\nexport const deleteInstanceToken = (\n instanceId: string,\n token: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/instance/${instanceId}/token/${token}`, method: 'delete'\n },\n options);\n }\n \n\n\nexport const getDeleteInstanceTokenMutationOptions = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteInstanceToken>>, TError,{instanceId: string;token: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteInstanceToken>>, TError,{instanceId: string;token: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteInstanceToken>>, {instanceId: string;token: string}> = (props) => {\n const {instanceId,token} = props ?? {};\n\n return deleteInstanceToken(instanceId,token,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteInstanceTokenMutationResult = NonNullable<Awaited<ReturnType<typeof deleteInstanceToken>>>\n \n export type DeleteInstanceTokenMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete (revoke) the Instance Token\n */\nexport const useDeleteInstanceToken = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteInstanceToken>>, TError,{instanceId: string;token: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteInstanceTokenMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "]}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
+
import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { ac as InstancePostBodyBody, bX as customInstance, bA as InstancePostResponse, bY as ErrorType, bT as DmError, d as GetInstancesParams, bp as InstancesGetResponse, bB as InstanceDryRunPostResponse, bt as InstanceGetResponse, at as TaskIdentity, P as PatchInstanceParams } from '../custom-instance-3d66fe97.js';
|
|
4
|
+
import 'axios';
|
|
5
|
+
|
|
6
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
7
|
+
/**
|
|
8
|
+
* Launches a new Application or Job instance, returning an Instance and Task ID. The Task ID should be used against the `/task` endpoint to determine the availability of the the running instance.
|
|
9
|
+
|
|
10
|
+
Instance 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**.
|
|
11
|
+
|
|
12
|
+
An Application instance is not Ready for use until the corresponding **TaskState** is _STARTED_.
|
|
13
|
+
|
|
14
|
+
A Job instance typically runs to completion, reaching the **TaskState** _SUCCESS_ when successful and _FAILURE_ is unsuccessful.
|
|
15
|
+
|
|
16
|
+
* @summary Creates a new Job or Application instance
|
|
17
|
+
*/
|
|
18
|
+
declare const createInstance: (instancePostBodyBody: InstancePostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<InstancePostResponse>;
|
|
19
|
+
declare const getCreateInstanceMutationOptions: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
20
|
+
mutation?: UseMutationOptions<InstancePostResponse, TError, {
|
|
21
|
+
data: InstancePostBodyBody;
|
|
22
|
+
}, TContext> | undefined;
|
|
23
|
+
request?: SecondParameter<typeof customInstance>;
|
|
24
|
+
} | undefined) => UseMutationOptions<InstancePostResponse, TError, {
|
|
25
|
+
data: InstancePostBodyBody;
|
|
26
|
+
}, TContext>;
|
|
27
|
+
type CreateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof createInstance>>>;
|
|
28
|
+
type CreateInstanceMutationBody = InstancePostBodyBody;
|
|
29
|
+
type CreateInstanceMutationError = ErrorType<void | DmError>;
|
|
30
|
+
/**
|
|
31
|
+
* @summary Creates a new Job or Application instance
|
|
32
|
+
*/
|
|
33
|
+
declare const useCreateInstance: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
34
|
+
mutation?: UseMutationOptions<InstancePostResponse, TError, {
|
|
35
|
+
data: InstancePostBodyBody;
|
|
36
|
+
}, TContext> | undefined;
|
|
37
|
+
request?: SecondParameter<typeof customInstance>;
|
|
38
|
+
} | undefined) => _tanstack_react_query.UseMutationResult<InstancePostResponse, TError, {
|
|
39
|
+
data: InstancePostBodyBody;
|
|
40
|
+
}, TContext>;
|
|
41
|
+
/**
|
|
42
|
+
* 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`
|
|
43
|
+
|
|
44
|
+
* @summary Get summary information about all Job and Application instances
|
|
45
|
+
*/
|
|
46
|
+
declare const getInstances: (params?: GetInstancesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<InstancesGetResponse>;
|
|
47
|
+
declare const getGetInstancesQueryKey: (params?: GetInstancesParams) => readonly ["data-manager-api", "/instance", ...GetInstancesParams[]];
|
|
48
|
+
declare const getGetInstancesQueryOptions: <TData = InstancesGetResponse, TError = ErrorType<void | DmError>>(params?: GetInstancesParams, options?: {
|
|
49
|
+
query?: UseQueryOptions<InstancesGetResponse, TError, TData, QueryKey> | undefined;
|
|
50
|
+
request?: SecondParameter<typeof customInstance>;
|
|
51
|
+
} | undefined) => UseQueryOptions<InstancesGetResponse, TError, TData, QueryKey> & {
|
|
52
|
+
queryKey: QueryKey;
|
|
53
|
+
};
|
|
54
|
+
type GetInstancesQueryResult = NonNullable<Awaited<ReturnType<typeof getInstances>>>;
|
|
55
|
+
type GetInstancesQueryError = ErrorType<void | DmError>;
|
|
56
|
+
/**
|
|
57
|
+
* @summary Get summary information about all Job and Application instances
|
|
58
|
+
*/
|
|
59
|
+
declare const useGetInstances: <TData = InstancesGetResponse, TError = ErrorType<void | DmError>>(params?: GetInstancesParams, options?: {
|
|
60
|
+
query?: UseQueryOptions<InstancesGetResponse, TError, TData, QueryKey> | undefined;
|
|
61
|
+
request?: SecondParameter<typeof customInstance>;
|
|
62
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
63
|
+
queryKey: QueryKey;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* 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).
|
|
67
|
+
|
|
68
|
+
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`.
|
|
69
|
+
|
|
70
|
+
* @summary Used to check the execution of new Job or Application instance
|
|
71
|
+
*/
|
|
72
|
+
declare const dryRunInstance: (instancePostBodyBody: InstancePostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<InstanceDryRunPostResponse>;
|
|
73
|
+
declare const getDryRunInstanceMutationOptions: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
74
|
+
mutation?: UseMutationOptions<InstanceDryRunPostResponse, TError, {
|
|
75
|
+
data: InstancePostBodyBody;
|
|
76
|
+
}, TContext> | undefined;
|
|
77
|
+
request?: SecondParameter<typeof customInstance>;
|
|
78
|
+
} | undefined) => UseMutationOptions<InstanceDryRunPostResponse, TError, {
|
|
79
|
+
data: InstancePostBodyBody;
|
|
80
|
+
}, TContext>;
|
|
81
|
+
type DryRunInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof dryRunInstance>>>;
|
|
82
|
+
type DryRunInstanceMutationBody = InstancePostBodyBody;
|
|
83
|
+
type DryRunInstanceMutationError = ErrorType<void | DmError>;
|
|
84
|
+
/**
|
|
85
|
+
* @summary Used to check the execution of new Job or Application instance
|
|
86
|
+
*/
|
|
87
|
+
declare const useDryRunInstance: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
88
|
+
mutation?: UseMutationOptions<InstanceDryRunPostResponse, TError, {
|
|
89
|
+
data: InstancePostBodyBody;
|
|
90
|
+
}, TContext> | undefined;
|
|
91
|
+
request?: SecondParameter<typeof customInstance>;
|
|
92
|
+
} | undefined) => _tanstack_react_query.UseMutationResult<InstanceDryRunPostResponse, TError, {
|
|
93
|
+
data: InstancePostBodyBody;
|
|
94
|
+
}, TContext>;
|
|
95
|
+
/**
|
|
96
|
+
* @summary Get detailed information about an Instance
|
|
97
|
+
*/
|
|
98
|
+
declare const getInstance: (instanceId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<InstanceGetResponse>;
|
|
99
|
+
declare const getGetInstanceQueryKey: (instanceId: string) => readonly ["data-manager-api", `/instance/${string}`];
|
|
100
|
+
declare const getGetInstanceQueryOptions: <TData = InstanceGetResponse, TError = ErrorType<void | DmError>>(instanceId: string, options?: {
|
|
101
|
+
query?: UseQueryOptions<InstanceGetResponse, TError, TData, QueryKey> | undefined;
|
|
102
|
+
request?: SecondParameter<typeof customInstance>;
|
|
103
|
+
} | undefined) => UseQueryOptions<InstanceGetResponse, TError, TData, QueryKey> & {
|
|
104
|
+
queryKey: QueryKey;
|
|
105
|
+
};
|
|
106
|
+
type GetInstanceQueryResult = NonNullable<Awaited<ReturnType<typeof getInstance>>>;
|
|
107
|
+
type GetInstanceQueryError = ErrorType<void | DmError>;
|
|
108
|
+
/**
|
|
109
|
+
* @summary Get detailed information about an Instance
|
|
110
|
+
*/
|
|
111
|
+
declare const useGetInstance: <TData = InstanceGetResponse, TError = ErrorType<void | DmError>>(instanceId: string, options?: {
|
|
112
|
+
query?: UseQueryOptions<InstanceGetResponse, TError, TData, QueryKey> | undefined;
|
|
113
|
+
request?: SecondParameter<typeof customInstance>;
|
|
114
|
+
} | undefined) => UseQueryResult<TData, TError> & {
|
|
115
|
+
queryKey: QueryKey;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* The Application or Job Instance is terminated.
|
|
119
|
+
|
|
120
|
+
You must be the `owner` or an `editor` of the Instance to delete it
|
|
121
|
+
|
|
122
|
+
* @summary Delete a Job or Application Instance
|
|
123
|
+
*/
|
|
124
|
+
declare const terminateInstance: (instanceId: string, options?: SecondParameter<typeof customInstance>) => Promise<TaskIdentity>;
|
|
125
|
+
declare const getTerminateInstanceMutationOptions: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
126
|
+
mutation?: UseMutationOptions<TaskIdentity, TError, {
|
|
127
|
+
instanceId: string;
|
|
128
|
+
}, TContext> | undefined;
|
|
129
|
+
request?: SecondParameter<typeof customInstance>;
|
|
130
|
+
} | undefined) => UseMutationOptions<TaskIdentity, TError, {
|
|
131
|
+
instanceId: string;
|
|
132
|
+
}, TContext>;
|
|
133
|
+
type TerminateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof terminateInstance>>>;
|
|
134
|
+
type TerminateInstanceMutationError = ErrorType<void | DmError>;
|
|
135
|
+
/**
|
|
136
|
+
* @summary Delete a Job or Application Instance
|
|
137
|
+
*/
|
|
138
|
+
declare const useTerminateInstance: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
139
|
+
mutation?: UseMutationOptions<TaskIdentity, TError, {
|
|
140
|
+
instanceId: string;
|
|
141
|
+
}, TContext> | undefined;
|
|
142
|
+
request?: SecondParameter<typeof customInstance>;
|
|
143
|
+
} | undefined) => _tanstack_react_query.UseMutationResult<TaskIdentity, TError, {
|
|
144
|
+
instanceId: string;
|
|
145
|
+
}, TContext>;
|
|
146
|
+
/**
|
|
147
|
+
* The Application or Job Instance is updated according to the patch parameters.
|
|
148
|
+
|
|
149
|
+
You must be the `owner` or an `editor` of the Instance to patch it
|
|
150
|
+
|
|
151
|
+
* @summary Update a Job or Application Instance
|
|
152
|
+
*/
|
|
153
|
+
declare const patchInstance: (instanceId: string, params?: PatchInstanceParams, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
154
|
+
declare const getPatchInstanceMutationOptions: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
155
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
156
|
+
instanceId: string;
|
|
157
|
+
params?: PatchInstanceParams | undefined;
|
|
158
|
+
}, TContext> | undefined;
|
|
159
|
+
request?: SecondParameter<typeof customInstance>;
|
|
160
|
+
} | undefined) => UseMutationOptions<void, TError, {
|
|
161
|
+
instanceId: string;
|
|
162
|
+
params?: PatchInstanceParams | undefined;
|
|
163
|
+
}, TContext>;
|
|
164
|
+
type PatchInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof patchInstance>>>;
|
|
165
|
+
type PatchInstanceMutationError = ErrorType<DmError>;
|
|
166
|
+
/**
|
|
167
|
+
* @summary Update a Job or Application Instance
|
|
168
|
+
*/
|
|
169
|
+
declare const usePatchInstance: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
170
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
171
|
+
instanceId: string;
|
|
172
|
+
params?: PatchInstanceParams | undefined;
|
|
173
|
+
}, TContext> | undefined;
|
|
174
|
+
request?: SecondParameter<typeof customInstance>;
|
|
175
|
+
} | undefined) => _tanstack_react_query.UseMutationResult<void, TError, {
|
|
176
|
+
instanceId: string;
|
|
177
|
+
params?: PatchInstanceParams | undefined;
|
|
178
|
+
}, TContext>;
|
|
179
|
+
/**
|
|
180
|
+
* 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.
|
|
181
|
+
|
|
182
|
+
Tokens automatically expire after a period of time but can be revoked instantly with this endpoint.
|
|
183
|
+
|
|
184
|
+
The remote system will revoke the token when it's finished with it
|
|
185
|
+
|
|
186
|
+
* @summary Delete (revoke) the Instance Token
|
|
187
|
+
*/
|
|
188
|
+
declare const deleteInstanceToken: (instanceId: string, token: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
189
|
+
declare const getDeleteInstanceTokenMutationOptions: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
190
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
191
|
+
instanceId: string;
|
|
192
|
+
token: string;
|
|
193
|
+
}, TContext> | undefined;
|
|
194
|
+
request?: SecondParameter<typeof customInstance>;
|
|
195
|
+
} | undefined) => UseMutationOptions<void, TError, {
|
|
196
|
+
instanceId: string;
|
|
197
|
+
token: string;
|
|
198
|
+
}, TContext>;
|
|
199
|
+
type DeleteInstanceTokenMutationResult = NonNullable<Awaited<ReturnType<typeof deleteInstanceToken>>>;
|
|
200
|
+
type DeleteInstanceTokenMutationError = ErrorType<DmError>;
|
|
201
|
+
/**
|
|
202
|
+
* @summary Delete (revoke) the Instance Token
|
|
203
|
+
*/
|
|
204
|
+
declare const useDeleteInstanceToken: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
205
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
206
|
+
instanceId: string;
|
|
207
|
+
token: string;
|
|
208
|
+
}, TContext> | undefined;
|
|
209
|
+
request?: SecondParameter<typeof customInstance>;
|
|
210
|
+
} | undefined) => _tanstack_react_query.UseMutationResult<void, TError, {
|
|
211
|
+
instanceId: string;
|
|
212
|
+
token: string;
|
|
213
|
+
}, TContext>;
|
|
214
|
+
|
|
215
|
+
export { CreateInstanceMutationBody, CreateInstanceMutationError, CreateInstanceMutationResult, DeleteInstanceTokenMutationError, DeleteInstanceTokenMutationResult, DryRunInstanceMutationBody, DryRunInstanceMutationError, DryRunInstanceMutationResult, GetInstanceQueryError, GetInstanceQueryResult, GetInstancesQueryError, GetInstancesQueryResult, PatchInstanceMutationError, PatchInstanceMutationResult, TerminateInstanceMutationError, TerminateInstanceMutationResult, createInstance, deleteInstanceToken, dryRunInstance, getCreateInstanceMutationOptions, getDeleteInstanceTokenMutationOptions, getDryRunInstanceMutationOptions, getGetInstanceQueryKey, getGetInstanceQueryOptions, getGetInstancesQueryKey, getGetInstancesQueryOptions, getInstance, getInstances, getPatchInstanceMutationOptions, getTerminateInstanceMutationOptions, patchInstance, terminateInstance, useCreateInstance, useDeleteInstanceToken, useDryRunInstance, useGetInstance, useGetInstances, usePatchInstance, useTerminateInstance };
|
package/instance/instance.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ac as InstancePostBodyBody, bX as customInstance, bA as InstancePostResponse, bY as ErrorType, bT as DmError, d as GetInstancesParams, bp as InstancesGetResponse, bB as InstanceDryRunPostResponse, bt as InstanceGetResponse, at as TaskIdentity, P as PatchInstanceParams } from '../custom-instance-50c9dd5d.js';
|
|
2
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
2
|
import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
|
|
3
|
+
import { ac as InstancePostBodyBody, bX as customInstance, bA as InstancePostResponse, bY as ErrorType, bT as DmError, d as GetInstancesParams, bp as InstancesGetResponse, bB as InstanceDryRunPostResponse, bt as InstanceGetResponse, at as TaskIdentity, P as PatchInstanceParams } from '../custom-instance-3d66fe97.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;
|
|
@@ -27,6 +27,9 @@ declare const getCreateInstanceMutationOptions: <TError = ErrorType<void | DmErr
|
|
|
27
27
|
type CreateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof createInstance>>>;
|
|
28
28
|
type CreateInstanceMutationBody = InstancePostBodyBody;
|
|
29
29
|
type CreateInstanceMutationError = ErrorType<void | DmError>;
|
|
30
|
+
/**
|
|
31
|
+
* @summary Creates a new Job or Application instance
|
|
32
|
+
*/
|
|
30
33
|
declare const useCreateInstance: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
31
34
|
mutation?: UseMutationOptions<InstancePostResponse, TError, {
|
|
32
35
|
data: InstancePostBodyBody;
|
|
@@ -36,10 +39,10 @@ declare const useCreateInstance: <TError = ErrorType<void | DmError>, TContext =
|
|
|
36
39
|
data: InstancePostBodyBody;
|
|
37
40
|
}, TContext>;
|
|
38
41
|
/**
|
|
39
|
-
|
|
42
|
+
* 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`
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
* @summary Get summary information about all Job and Application instances
|
|
45
|
+
*/
|
|
43
46
|
declare const getInstances: (params?: GetInstancesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<InstancesGetResponse>;
|
|
44
47
|
declare const getGetInstancesQueryKey: (params?: GetInstancesParams) => readonly ["data-manager-api", "/instance", ...GetInstancesParams[]];
|
|
45
48
|
declare const getGetInstancesQueryOptions: <TData = InstancesGetResponse, TError = ErrorType<void | DmError>>(params?: GetInstancesParams, options?: {
|
|
@@ -50,6 +53,9 @@ declare const getGetInstancesQueryOptions: <TData = InstancesGetResponse, TError
|
|
|
50
53
|
};
|
|
51
54
|
type GetInstancesQueryResult = NonNullable<Awaited<ReturnType<typeof getInstances>>>;
|
|
52
55
|
type GetInstancesQueryError = ErrorType<void | DmError>;
|
|
56
|
+
/**
|
|
57
|
+
* @summary Get summary information about all Job and Application instances
|
|
58
|
+
*/
|
|
53
59
|
declare const useGetInstances: <TData = InstancesGetResponse, TError = ErrorType<void | DmError>>(params?: GetInstancesParams, options?: {
|
|
54
60
|
query?: UseQueryOptions<InstancesGetResponse, TError, TData, QueryKey> | undefined;
|
|
55
61
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -75,6 +81,9 @@ declare const getDryRunInstanceMutationOptions: <TError = ErrorType<void | DmErr
|
|
|
75
81
|
type DryRunInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof dryRunInstance>>>;
|
|
76
82
|
type DryRunInstanceMutationBody = InstancePostBodyBody;
|
|
77
83
|
type DryRunInstanceMutationError = ErrorType<void | DmError>;
|
|
84
|
+
/**
|
|
85
|
+
* @summary Used to check the execution of new Job or Application instance
|
|
86
|
+
*/
|
|
78
87
|
declare const useDryRunInstance: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
79
88
|
mutation?: UseMutationOptions<InstanceDryRunPostResponse, TError, {
|
|
80
89
|
data: InstancePostBodyBody;
|
|
@@ -84,8 +93,8 @@ declare const useDryRunInstance: <TError = ErrorType<void | DmError>, TContext =
|
|
|
84
93
|
data: InstancePostBodyBody;
|
|
85
94
|
}, TContext>;
|
|
86
95
|
/**
|
|
87
|
-
|
|
88
|
-
|
|
96
|
+
* @summary Get detailed information about an Instance
|
|
97
|
+
*/
|
|
89
98
|
declare const getInstance: (instanceId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<InstanceGetResponse>;
|
|
90
99
|
declare const getGetInstanceQueryKey: (instanceId: string) => readonly ["data-manager-api", `/instance/${string}`];
|
|
91
100
|
declare const getGetInstanceQueryOptions: <TData = InstanceGetResponse, TError = ErrorType<void | DmError>>(instanceId: string, options?: {
|
|
@@ -96,6 +105,9 @@ declare const getGetInstanceQueryOptions: <TData = InstanceGetResponse, TError =
|
|
|
96
105
|
};
|
|
97
106
|
type GetInstanceQueryResult = NonNullable<Awaited<ReturnType<typeof getInstance>>>;
|
|
98
107
|
type GetInstanceQueryError = ErrorType<void | DmError>;
|
|
108
|
+
/**
|
|
109
|
+
* @summary Get detailed information about an Instance
|
|
110
|
+
*/
|
|
99
111
|
declare const useGetInstance: <TData = InstanceGetResponse, TError = ErrorType<void | DmError>>(instanceId: string, options?: {
|
|
100
112
|
query?: UseQueryOptions<InstanceGetResponse, TError, TData, QueryKey> | undefined;
|
|
101
113
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -120,6 +132,9 @@ declare const getTerminateInstanceMutationOptions: <TError = ErrorType<void | Dm
|
|
|
120
132
|
}, TContext>;
|
|
121
133
|
type TerminateInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof terminateInstance>>>;
|
|
122
134
|
type TerminateInstanceMutationError = ErrorType<void | DmError>;
|
|
135
|
+
/**
|
|
136
|
+
* @summary Delete a Job or Application Instance
|
|
137
|
+
*/
|
|
123
138
|
declare const useTerminateInstance: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
124
139
|
mutation?: UseMutationOptions<TaskIdentity, TError, {
|
|
125
140
|
instanceId: string;
|
|
@@ -129,12 +144,12 @@ declare const useTerminateInstance: <TError = ErrorType<void | DmError>, TContex
|
|
|
129
144
|
instanceId: string;
|
|
130
145
|
}, TContext>;
|
|
131
146
|
/**
|
|
132
|
-
|
|
147
|
+
* The Application or Job Instance is updated according to the patch parameters.
|
|
133
148
|
|
|
134
149
|
You must be the `owner` or an `editor` of the Instance to patch it
|
|
135
150
|
|
|
136
|
-
|
|
137
|
-
|
|
151
|
+
* @summary Update a Job or Application Instance
|
|
152
|
+
*/
|
|
138
153
|
declare const patchInstance: (instanceId: string, params?: PatchInstanceParams, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
139
154
|
declare const getPatchInstanceMutationOptions: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
140
155
|
mutation?: UseMutationOptions<void, TError, {
|
|
@@ -148,6 +163,9 @@ declare const getPatchInstanceMutationOptions: <TError = ErrorType<DmError>, TCo
|
|
|
148
163
|
}, TContext>;
|
|
149
164
|
type PatchInstanceMutationResult = NonNullable<Awaited<ReturnType<typeof patchInstance>>>;
|
|
150
165
|
type PatchInstanceMutationError = ErrorType<DmError>;
|
|
166
|
+
/**
|
|
167
|
+
* @summary Update a Job or Application Instance
|
|
168
|
+
*/
|
|
151
169
|
declare const usePatchInstance: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
152
170
|
mutation?: UseMutationOptions<void, TError, {
|
|
153
171
|
instanceId: string;
|
|
@@ -159,14 +177,14 @@ declare const usePatchInstance: <TError = ErrorType<DmError>, TContext = unknown
|
|
|
159
177
|
params?: PatchInstanceParams | undefined;
|
|
160
178
|
}, TContext>;
|
|
161
179
|
/**
|
|
162
|
-
|
|
180
|
+
* 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.
|
|
163
181
|
|
|
164
182
|
Tokens automatically expire after a period of time but can be revoked instantly with this endpoint.
|
|
165
183
|
|
|
166
184
|
The remote system will revoke the token when it's finished with it
|
|
167
185
|
|
|
168
|
-
|
|
169
|
-
|
|
186
|
+
* @summary Delete (revoke) the Instance Token
|
|
187
|
+
*/
|
|
170
188
|
declare const deleteInstanceToken: (instanceId: string, token: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
171
189
|
declare const getDeleteInstanceTokenMutationOptions: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
172
190
|
mutation?: UseMutationOptions<void, TError, {
|
|
@@ -180,6 +198,9 @@ declare const getDeleteInstanceTokenMutationOptions: <TError = ErrorType<DmError
|
|
|
180
198
|
}, TContext>;
|
|
181
199
|
type DeleteInstanceTokenMutationResult = NonNullable<Awaited<ReturnType<typeof deleteInstanceToken>>>;
|
|
182
200
|
type DeleteInstanceTokenMutationError = ErrorType<DmError>;
|
|
201
|
+
/**
|
|
202
|
+
* @summary Delete (revoke) the Instance Token
|
|
203
|
+
*/
|
|
183
204
|
declare const useDeleteInstanceToken: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
184
205
|
mutation?: UseMutationOptions<void, TError, {
|
|
185
206
|
instanceId: string;
|
package/instance/instance.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
customInstance
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-UKA7G3OB.js";
|
|
4
4
|
|
|
5
5
|
// src/instance/instance.ts
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
useMutation,
|
|
8
|
+
useQuery
|
|
9
|
+
} from "@tanstack/react-query";
|
|
7
10
|
var createInstance = (instancePostBodyBody, options) => {
|
|
8
11
|
const formData = new FormData();
|
|
9
12
|
formData.append("application_id", instancePostBodyBody.application_id);
|
|
10
13
|
if (instancePostBodyBody.application_version !== void 0) {
|
|
11
|
-
formData.append(
|
|
12
|
-
"application_version",
|
|
13
|
-
instancePostBodyBody.application_version
|
|
14
|
-
);
|
|
14
|
+
formData.append("application_version", instancePostBodyBody.application_version);
|
|
15
15
|
}
|
|
16
16
|
formData.append("project_id", instancePostBodyBody.project_id);
|
|
17
17
|
formData.append("as_name", instancePostBodyBody.as_name);
|
|
@@ -22,10 +22,7 @@ var createInstance = (instancePostBodyBody, options) => {
|
|
|
22
22
|
formData.append("callback_context", instancePostBodyBody.callback_context);
|
|
23
23
|
}
|
|
24
24
|
if (instancePostBodyBody.generate_callback_token !== void 0) {
|
|
25
|
-
formData.append(
|
|
26
|
-
"generate_callback_token",
|
|
27
|
-
instancePostBodyBody.generate_callback_token.toString()
|
|
28
|
-
);
|
|
25
|
+
formData.append("generate_callback_token", instancePostBodyBody.generate_callback_token.toString());
|
|
29
26
|
}
|
|
30
27
|
if (instancePostBodyBody.callback_token !== void 0) {
|
|
31
28
|
formData.append("callback_token", instancePostBodyBody.callback_token);
|
|
@@ -60,17 +57,22 @@ var useCreateInstance = (options) => {
|
|
|
60
57
|
};
|
|
61
58
|
var getInstances = (params, options, signal) => {
|
|
62
59
|
return customInstance(
|
|
63
|
-
{
|
|
60
|
+
{
|
|
61
|
+
url: `/instance`,
|
|
62
|
+
method: "get",
|
|
63
|
+
params,
|
|
64
|
+
signal
|
|
65
|
+
},
|
|
64
66
|
options
|
|
65
67
|
);
|
|
66
68
|
};
|
|
67
|
-
var getGetInstancesQueryKey = (params) =>
|
|
69
|
+
var getGetInstancesQueryKey = (params) => {
|
|
70
|
+
return ["data-manager-api", `/instance`, ...params ? [params] : []];
|
|
71
|
+
};
|
|
68
72
|
var getGetInstancesQueryOptions = (params, options) => {
|
|
69
73
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
70
74
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetInstancesQueryKey(params);
|
|
71
|
-
const queryFn = ({
|
|
72
|
-
signal
|
|
73
|
-
}) => getInstances(params, requestOptions, signal);
|
|
75
|
+
const queryFn = ({ signal }) => getInstances(params, requestOptions, signal);
|
|
74
76
|
return { queryKey, queryFn, ...queryOptions };
|
|
75
77
|
};
|
|
76
78
|
var useGetInstances = (params, options) => {
|
|
@@ -83,10 +85,7 @@ var dryRunInstance = (instancePostBodyBody, options) => {
|
|
|
83
85
|
const formData = new FormData();
|
|
84
86
|
formData.append("application_id", instancePostBodyBody.application_id);
|
|
85
87
|
if (instancePostBodyBody.application_version !== void 0) {
|
|
86
|
-
formData.append(
|
|
87
|
-
"application_version",
|
|
88
|
-
instancePostBodyBody.application_version
|
|
89
|
-
);
|
|
88
|
+
formData.append("application_version", instancePostBodyBody.application_version);
|
|
90
89
|
}
|
|
91
90
|
formData.append("project_id", instancePostBodyBody.project_id);
|
|
92
91
|
formData.append("as_name", instancePostBodyBody.as_name);
|
|
@@ -97,10 +96,7 @@ var dryRunInstance = (instancePostBodyBody, options) => {
|
|
|
97
96
|
formData.append("callback_context", instancePostBodyBody.callback_context);
|
|
98
97
|
}
|
|
99
98
|
if (instancePostBodyBody.generate_callback_token !== void 0) {
|
|
100
|
-
formData.append(
|
|
101
|
-
"generate_callback_token",
|
|
102
|
-
instancePostBodyBody.generate_callback_token.toString()
|
|
103
|
-
);
|
|
99
|
+
formData.append("generate_callback_token", instancePostBodyBody.generate_callback_token.toString());
|
|
104
100
|
}
|
|
105
101
|
if (instancePostBodyBody.callback_token !== void 0) {
|
|
106
102
|
formData.append("callback_token", instancePostBodyBody.callback_token);
|
|
@@ -135,17 +131,21 @@ var useDryRunInstance = (options) => {
|
|
|
135
131
|
};
|
|
136
132
|
var getInstance = (instanceId, options, signal) => {
|
|
137
133
|
return customInstance(
|
|
138
|
-
{
|
|
134
|
+
{
|
|
135
|
+
url: `/instance/${instanceId}`,
|
|
136
|
+
method: "get",
|
|
137
|
+
signal
|
|
138
|
+
},
|
|
139
139
|
options
|
|
140
140
|
);
|
|
141
141
|
};
|
|
142
|
-
var getGetInstanceQueryKey = (instanceId) =>
|
|
142
|
+
var getGetInstanceQueryKey = (instanceId) => {
|
|
143
|
+
return ["data-manager-api", `/instance/${instanceId}`];
|
|
144
|
+
};
|
|
143
145
|
var getGetInstanceQueryOptions = (instanceId, options) => {
|
|
144
146
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
145
147
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetInstanceQueryKey(instanceId);
|
|
146
|
-
const queryFn = ({
|
|
147
|
-
signal
|
|
148
|
-
}) => getInstance(instanceId, requestOptions, signal);
|
|
148
|
+
const queryFn = ({ signal }) => getInstance(instanceId, requestOptions, signal);
|
|
149
149
|
return { queryKey, queryFn, enabled: !!instanceId, ...queryOptions };
|
|
150
150
|
};
|
|
151
151
|
var useGetInstance = (instanceId, options) => {
|
|
@@ -156,7 +156,10 @@ var useGetInstance = (instanceId, options) => {
|
|
|
156
156
|
};
|
|
157
157
|
var terminateInstance = (instanceId, options) => {
|
|
158
158
|
return customInstance(
|
|
159
|
-
{
|
|
159
|
+
{
|
|
160
|
+
url: `/instance/${instanceId}`,
|
|
161
|
+
method: "delete"
|
|
162
|
+
},
|
|
160
163
|
options
|
|
161
164
|
);
|
|
162
165
|
};
|
|
@@ -174,7 +177,11 @@ var useTerminateInstance = (options) => {
|
|
|
174
177
|
};
|
|
175
178
|
var patchInstance = (instanceId, params, options) => {
|
|
176
179
|
return customInstance(
|
|
177
|
-
{
|
|
180
|
+
{
|
|
181
|
+
url: `/instance/${instanceId}`,
|
|
182
|
+
method: "patch",
|
|
183
|
+
params
|
|
184
|
+
},
|
|
178
185
|
options
|
|
179
186
|
);
|
|
180
187
|
};
|
|
@@ -192,7 +199,10 @@ var usePatchInstance = (options) => {
|
|
|
192
199
|
};
|
|
193
200
|
var deleteInstanceToken = (instanceId, token, options) => {
|
|
194
201
|
return customInstance(
|
|
195
|
-
{
|
|
202
|
+
{
|
|
203
|
+
url: `/instance/${instanceId}/token/${token}`,
|
|
204
|
+
method: "delete"
|
|
205
|
+
},
|
|
196
206
|
options
|
|
197
207
|
);
|
|
198
208
|
};
|