@squonk/data-manager-client 0.6.28-rc.6 → 0.7.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/accounting/accounting.cjs +30 -0
  2. package/accounting/accounting.cjs.map +1 -0
  3. package/accounting/accounting.d.ts +31 -0
  4. package/accounting/accounting.js +30 -0
  5. package/accounting/accounting.js.map +1 -0
  6. package/accounting/package.json +7 -0
  7. package/admin/admin.cjs +22 -1
  8. package/admin/admin.cjs.map +1 -1
  9. package/admin/admin.d.ts +20 -2
  10. package/admin/admin.js +21 -0
  11. package/admin/admin.js.map +1 -1
  12. package/annotation/annotation.cjs +64 -0
  13. package/annotation/annotation.cjs.map +1 -0
  14. package/annotation/annotation.d.ts +58 -0
  15. package/annotation/annotation.js +64 -0
  16. package/annotation/annotation.js.map +1 -0
  17. package/annotation/package.json +7 -0
  18. package/application/application.cjs.map +1 -1
  19. package/application/application.d.ts +2 -2
  20. package/application/application.js.map +1 -1
  21. package/{custom-instance-3c2397cc.d.ts → custom-instance-fcf163c4.d.ts} +59 -59
  22. package/dataset/dataset.cjs +7 -62
  23. package/dataset/dataset.cjs.map +1 -1
  24. package/dataset/dataset.d.ts +4 -54
  25. package/dataset/dataset.js +6 -61
  26. package/dataset/dataset.js.map +1 -1
  27. package/file/file.cjs.map +1 -1
  28. package/file/file.d.ts +1 -1
  29. package/file/file.js.map +1 -1
  30. package/index.cjs +5 -8
  31. package/index.cjs.map +1 -1
  32. package/index.d.ts +1 -1
  33. package/index.js +5 -8
  34. package/index.js.map +1 -1
  35. package/instance/instance.cjs +8 -6
  36. package/instance/instance.cjs.map +1 -1
  37. package/instance/instance.d.ts +4 -4
  38. package/instance/instance.js +8 -6
  39. package/instance/instance.js.map +1 -1
  40. package/job/job.cjs.map +1 -1
  41. package/job/job.d.ts +2 -2
  42. package/job/job.js.map +1 -1
  43. package/package.json +1 -1
  44. package/project/project.cjs.map +1 -1
  45. package/project/project.d.ts +1 -1
  46. package/project/project.js.map +1 -1
  47. package/src/accounting/accounting.ts +87 -0
  48. package/src/admin/admin.ts +60 -1
  49. package/src/annotation/annotation.ts +217 -0
  50. package/src/application/application.ts +1 -1
  51. package/src/data-manager-api.schemas.ts +66 -69
  52. package/src/dataset/dataset.ts +9 -196
  53. package/src/file/file.ts +1 -1
  54. package/src/instance/instance.ts +7 -12
  55. package/src/job/job.ts +1 -1
  56. package/src/project/project.ts +1 -1
  57. package/src/task/task.ts +1 -1
  58. package/src/type/type.ts +1 -1
  59. package/src/user/user.ts +1 -1
  60. package/task/task.cjs.map +1 -1
  61. package/task/task.d.ts +1 -1
  62. package/task/task.js.map +1 -1
  63. package/type/type.cjs.map +1 -1
  64. package/type/type.d.ts +2 -2
  65. package/type/type.js.map +1 -1
  66. package/user/user.cjs.map +1 -1
  67. package/user/user.d.ts +1 -1
  68. package/user/user.js.map +1 -1
@@ -46,14 +46,16 @@ var useGetInstances = (params, options) => {
46
46
  queryKey
47
47
  }, query);
48
48
  };
49
- var getInstance = (instanceid, params, options) => {
50
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/instance/${instanceid}`, method: "get", params }, options);
49
+ var getInstance = (instanceid, options) => {
50
+ return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/instance/${instanceid}`, method: "get" }, options);
51
51
  };
52
- var getGetInstanceQueryKey = (instanceid, params) => [`/instance/${instanceid}`, ...params ? [params] : []];
53
- var useGetInstance = (instanceid, params, options) => {
52
+ var getGetInstanceQueryKey = (instanceid) => [
53
+ `/instance/${instanceid}`
54
+ ];
55
+ var useGetInstance = (instanceid, options) => {
54
56
  const { query: queryOptions, request: requestOptions } = options || {};
55
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetInstanceQueryKey(instanceid, params)));
56
- const queryFn = () => getInstance(instanceid, params, requestOptions);
57
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetInstanceQueryKey(instanceid)));
58
+ const queryFn = () => getInstance(instanceid, requestOptions);
57
59
  const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunk3DXYUDZHcjs.__spreadValues.call(void 0, { enabled: !!instanceid }, queryOptions));
58
60
  return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
59
61
  queryKey
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/instance/instance.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAiDO,IAAM,iBAAiB,CAC5B,sBACA,YACG;AACH,QAAM,WAAW,IAAI;AACrB,WAAS,OAAO,kBAAkB,qBAAqB;AACvD,WAAS,OACP,uBACA,qBAAqB;AAEvB,WAAS,OAAO,cAAc,qBAAqB;AACnD,WAAS,OAAO,WAAW,qBAAqB;AAChD,MAAI,qBAAqB,UAAU,QAAW;AAC5C,aAAS,OAAO,SAAS,qBAAqB;AAAA;AAEhD,MAAI,qBAAqB,kBAAkB,QAAW;AACpD,aAAS,OAAO,iBAAiB,qBAAqB;AAAA;AAGxD,SAAO,eACL,EAAE,KAAK,aAAa,QAAQ,QAAQ,MAAM,YAC1C;AAAA;AAIG,IAAM,oBAAoB,CAG/B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS;AAE1B,WAAO,eAAe,MAAM;AAAA;AAG9B,SAAO,YAKL,YAAY;AAAA;AAOT,IAAM,eAAe,CAC1B,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,aAAa,QAAQ,OAAO,UACnC;AAAA;AAIG,IAAM,0BAA0B,CAAC,WAAgC;AAAA,EACtE;AAAA,EACA,GAAI,SAAS,CAAC,UAAU;AAAA;AAGnB,IAAM,kBAAkB,CAI7B,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8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AKL,YAAY;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.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: 0.6\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n InstancePostResponse,\n DmError,\n InstancePostBodyBody,\n InstancesGetResponse,\n GetInstancesParams,\n InstanceGetResponse,\n GetInstanceParams,\n InstanceDeleteResponse,\n PatchInstanceParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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, reahcing the **TaskState** `SUCCESS` when successful and `FAILURE` is unsuccessul.\n\n * @summary Creates a new 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 formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\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 { url: `/instance`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useCreateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof createInstance>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createInstance(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createInstance>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a summary of all running instances. Insatnces 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 application instances\n */\nexport const getInstances = (\n params?: GetInstancesParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstancesGetResponse>(\n { url: `/instance`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams) => [\n `/instance`,\n ...(params ? [params] : []),\n];\n\nexport const useGetInstances = <\n TData = AsyncReturnType<typeof getInstances>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetInstancesParams,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<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<AsyncReturnType<typeof getInstances>> = () =>\n getInstances(params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getInstances>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\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 params?: GetInstanceParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstanceGetResponse>(\n { url: `/instance/${instanceid}`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetInstanceQueryKey = (\n instanceid: string,\n params?: GetInstanceParams\n) => [`/instance/${instanceid}`, ...(params ? [params] : [])];\n\nexport const useGetInstance = <\n TData = AsyncReturnType<typeof getInstance>,\n TError = ErrorType<void | DmError>\n>(\n instanceid: string,\n params?: GetInstanceParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getInstance>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetInstanceQueryKey(instanceid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getInstance>> = () =>\n getInstance(instanceid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getInstance>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!instanceid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\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 an 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 useTerminateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof terminateInstance>,\n { instanceid: string }\n > = (props) => {\n const { instanceid } = props || {};\n\n return terminateInstance(instanceid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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 an 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 usePatchInstance = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<typeof patchInstance>,\n TError,\n { instanceid: string; params?: PatchInstanceParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
1
+ {"version":3,"sources":["../../src/instance/instance.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAgDO,IAAM,iBAAiB,CAC5B,sBACA,YACG;AACH,QAAM,WAAW,IAAI;AACrB,WAAS,OAAO,kBAAkB,qBAAqB;AACvD,WAAS,OACP,uBACA,qBAAqB;AAEvB,WAAS,OAAO,cAAc,qBAAqB;AACnD,WAAS,OAAO,WAAW,qBAAqB;AAChD,MAAI,qBAAqB,UA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SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAWA,IAAM,oBAAoB,CAC/B,YACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,aAAa,cAAc,QAAQ,YAC1C;AAAA;AAIG,IAAM,uBAAuB,CAGlC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,eAAe,SAAS;AAEhC,WAAO,kBAAkB,YAAY;AAAA;AAGvC,SAAO,YAKL,YAAY;AAAA;AAST,IAAM,gBAAgB,CAC3B,YACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,aAAa,cAAc,QAAQ,SAAS,UACnD;AAAA;AAIG,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,WAAW,SAAS;AAExC,WAAO,cAAc,YAAY,QAAQ;AAAA;AAG3C,SAAO,YAKL,YAAY;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"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, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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, reahcing the **TaskState** `SUCCESS` when successful and `FAILURE` is unsuccessul.\n\n * @summary Creates a new 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 formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\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 { url: `/instance`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useCreateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof createInstance>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createInstance(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createInstance>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a summary of all running instances. Insatnces 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 application instances\n */\nexport const getInstances = (\n params?: GetInstancesParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstancesGetResponse>(\n { url: `/instance`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams) => [\n `/instance`,\n ...(params ? [params] : []),\n];\n\nexport const useGetInstances = <\n TData = AsyncReturnType<typeof getInstances>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetInstancesParams,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<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<AsyncReturnType<typeof getInstances>> = () =>\n getInstances(params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getInstances>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\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) => {\n return customInstance<InstanceGetResponse>(\n { url: `/instance/${instanceid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetInstanceQueryKey = (instanceid: string) => [\n `/instance/${instanceid}`,\n];\n\nexport const useGetInstance = <\n TData = AsyncReturnType<typeof getInstance>,\n TError = ErrorType<void | DmError>\n>(\n instanceid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getInstance>, TError, TData>;\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<AsyncReturnType<typeof getInstance>> = () =>\n getInstance(instanceid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getInstance>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!instanceid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\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 an 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 useTerminateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof terminateInstance>,\n { instanceid: string }\n > = (props) => {\n const { instanceid } = props || {};\n\n return terminateInstance(instanceid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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 an 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 usePatchInstance = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<typeof patchInstance>,\n TError,\n { instanceid: string; params?: PatchInstanceParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { L as InstancePostBodyBody, b6 as customInstance, aP as InstancePostResponse, b7 as ErrorType, b2 as DmError, b as GetInstancesParams, aK as InstancesGetResponse, C as GetInstanceParams, aM as InstanceGetResponse, a1 as TaskIdentity, P as PatchInstanceParams } from '../custom-instance-3c2397cc';
1
+ import { L as InstancePostBodyBody, b8 as customInstance, aQ as InstancePostResponse, b9 as ErrorType, b4 as DmError, b as GetInstancesParams, aL as InstancesGetResponse, aN as InstanceGetResponse, a1 as TaskIdentity, P as PatchInstanceParams } from '../custom-instance-fcf163c4';
2
2
  import * as react_query from 'react-query';
3
3
  import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
4
4
  import 'axios';
@@ -42,9 +42,9 @@ declare const useGetInstances: <TData = InstancesGetResponse, TError = ErrorType
42
42
 
43
43
  * @summary Get detailed information about a specific instance
44
44
  */
45
- declare const getInstance: (instanceid: string, params?: GetInstanceParams | undefined, options?: SecondParameter<typeof customInstance>) => Promise<InstanceGetResponse>;
46
- declare const getGetInstanceQueryKey: (instanceid: string, params?: GetInstanceParams | undefined) => (string | GetInstanceParams)[];
47
- declare const useGetInstance: <TData = InstanceGetResponse, TError = ErrorType<void | DmError>>(instanceid: string, params?: GetInstanceParams | undefined, options?: {
45
+ declare const getInstance: (instanceid: string, options?: SecondParameter<typeof customInstance>) => Promise<InstanceGetResponse>;
46
+ declare const getGetInstanceQueryKey: (instanceid: string) => string[];
47
+ declare const useGetInstance: <TData = InstanceGetResponse, TError = ErrorType<void | DmError>>(instanceid: string, options?: {
48
48
  query?: UseQueryOptions<InstanceGetResponse, TError, TData, QueryKey> | undefined;
49
49
  request?: SecondParameter<typeof customInstance>;
50
50
  } | undefined) => UseQueryResult<TData, TError> & {
@@ -46,14 +46,16 @@ var useGetInstances = (params, options) => {
46
46
  queryKey
47
47
  }, query);
48
48
  };
49
- var getInstance = (instanceid, params, options) => {
50
- return customInstance({ url: `/instance/${instanceid}`, method: "get", params }, options);
49
+ var getInstance = (instanceid, options) => {
50
+ return customInstance({ url: `/instance/${instanceid}`, method: "get" }, options);
51
51
  };
52
- var getGetInstanceQueryKey = (instanceid, params) => [`/instance/${instanceid}`, ...params ? [params] : []];
53
- var useGetInstance = (instanceid, params, options) => {
52
+ var getGetInstanceQueryKey = (instanceid) => [
53
+ `/instance/${instanceid}`
54
+ ];
55
+ var useGetInstance = (instanceid, options) => {
54
56
  const { query: queryOptions, request: requestOptions } = options || {};
55
- const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetInstanceQueryKey(instanceid, params);
56
- const queryFn = () => getInstance(instanceid, params, requestOptions);
57
+ const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetInstanceQueryKey(instanceid);
58
+ const queryFn = () => getInstance(instanceid, requestOptions);
57
59
  const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!instanceid }, queryOptions));
58
60
  return __spreadValues({
59
61
  queryKey
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/instance/instance.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.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: 0.6\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n InstancePostResponse,\n DmError,\n InstancePostBodyBody,\n InstancesGetResponse,\n GetInstancesParams,\n InstanceGetResponse,\n GetInstanceParams,\n InstanceDeleteResponse,\n PatchInstanceParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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, reahcing the **TaskState** `SUCCESS` when successful and `FAILURE` is unsuccessul.\n\n * @summary Creates a new 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 formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\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 { url: `/instance`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useCreateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof createInstance>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createInstance(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createInstance>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a summary of all running instances. Insatnces 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 application instances\n */\nexport const getInstances = (\n params?: GetInstancesParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstancesGetResponse>(\n { url: `/instance`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams) => [\n `/instance`,\n ...(params ? [params] : []),\n];\n\nexport const useGetInstances = <\n TData = AsyncReturnType<typeof getInstances>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetInstancesParams,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<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<AsyncReturnType<typeof getInstances>> = () =>\n getInstances(params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getInstances>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\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 params?: GetInstanceParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstanceGetResponse>(\n { url: `/instance/${instanceid}`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetInstanceQueryKey = (\n instanceid: string,\n params?: GetInstanceParams\n) => [`/instance/${instanceid}`, ...(params ? [params] : [])];\n\nexport const useGetInstance = <\n TData = AsyncReturnType<typeof getInstance>,\n TError = ErrorType<void | DmError>\n>(\n instanceid: string,\n params?: GetInstanceParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getInstance>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetInstanceQueryKey(instanceid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getInstance>> = () =>\n getInstance(instanceid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getInstance>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!instanceid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\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 an 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 useTerminateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof terminateInstance>,\n { instanceid: string }\n > = (props) => {\n const { instanceid } = props || {};\n\n return terminateInstance(instanceid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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 an 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 usePatchInstance = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<typeof patchInstance>,\n TError,\n { instanceid: string; params?: PatchInstanceParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAiDO,IAAM,iBAAiB,CAC5B,sBACA,YACG;AACH,QAAM,WAAW,IAAI;AACrB,WAAS,OAAO,kBAAkB,qBAAqB;AACvD,WAAS,OACP,uBACA,qBAAqB;AAEvB,WAAS,OAAO,cAAc,qBAAqB;AACnD,WAAS,OAAO,WAAW,qBAAqB;AAChD,MAAI,qBAAqB,UAAU,QAAW;AAC5C,aAAS,OAAO,SAAS,qBAAqB;AAAA;AAEhD,MAAI,qBAAqB,kBAAkB,QAAW;AACpD,aAAS,OAAO,iBAAiB,qBAAqB;AAAA;AAGxD,SAAO,eACL,EAAE,KAAK,aAAa,QAAQ,QAAQ,MAAM,YAC1C;AAAA;AAIG,IAAM,oBAAoB,CAG/B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS;AAE1B,WAAO,eAAe,MAAM;AAAA;AAG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YAAY;AAAA;AAST,IAAM,gBAAgB,CAC3B,YACA,QACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,aAAa,cAAc,QAAQ,SAAS,UACnD;AAAA;AAIG,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,WAAW,SAAS;AAExC,WAAO,cAAc,YAAY,QAAQ;AAAA;AAG3C,SAAO,YAKL,YAAY;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/instance/instance.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"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, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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, reahcing the **TaskState** `SUCCESS` when successful and `FAILURE` is unsuccessul.\n\n * @summary Creates a new 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 formData.append(\n \"application_version\",\n instancePostBodyBody.application_version\n );\n formData.append(\"project_id\", instancePostBodyBody.project_id);\n formData.append(\"as_name\", instancePostBodyBody.as_name);\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 { url: `/instance`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useCreateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof createInstance>,\n { data: InstancePostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createInstance(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createInstance>,\n TError,\n { data: InstancePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a summary of all running instances. Insatnces 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 application instances\n */\nexport const getInstances = (\n params?: GetInstancesParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<InstancesGetResponse>(\n { url: `/instance`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetInstancesQueryKey = (params?: GetInstancesParams) => [\n `/instance`,\n ...(params ? [params] : []),\n];\n\nexport const useGetInstances = <\n TData = AsyncReturnType<typeof getInstances>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetInstancesParams,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<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<AsyncReturnType<typeof getInstances>> = () =>\n getInstances(params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getInstances>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\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) => {\n return customInstance<InstanceGetResponse>(\n { url: `/instance/${instanceid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetInstanceQueryKey = (instanceid: string) => [\n `/instance/${instanceid}`,\n];\n\nexport const useGetInstance = <\n TData = AsyncReturnType<typeof getInstance>,\n TError = ErrorType<void | DmError>\n>(\n instanceid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getInstance>, TError, TData>;\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<AsyncReturnType<typeof getInstance>> = () =>\n getInstance(instanceid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getInstance>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!instanceid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\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 an 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 useTerminateInstance = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof terminateInstance>,\n { instanceid: string }\n > = (props) => {\n const { instanceid } = props || {};\n\n return terminateInstance(instanceid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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 an 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 usePatchInstance = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<typeof patchInstance>,\n TError,\n { instanceid: string; params?: PatchInstanceParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA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QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA0D,MAC9D,QAAQ;AAEV,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAWA,IAAM,SAAS,CACpB,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,QAAQ,SAAS,QAAQ,SAChC;AAAA;AAIG,IAAM,oBAAoB,CAAC,UAAkB,CAAC,QAAQ;AAEtD,IAAM,YAAY,CAIvB,OACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY,kBAAkB;AAE7D,QAAM,UAAyD,MAC7D,OAAO,OAAO;AAEhB,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAC,SAAU;AAGzB,SAAO;AAAA,IACL;AAAA,KACG;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.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: 0.6\n */\nimport {\n useQuery,\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n JobsGetResponse,\n DmError,\n JobGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (options?: SecondParameter<typeof customInstance>) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\" },\n options\n );\n};\n\nexport const getGetJobsQueryKey = () => [`/job`];\n\nexport const useGetJobs = <\n TData = AsyncReturnType<typeof getJobs>,\n TError = ErrorType<DmError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getJobs>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getJobs>> = () =>\n getJobs(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getJobs>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Get details of a specific job available to you that can be instantiated.\n\nTo run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.\n\n * @summary Get details of a specific Job\n */\nexport const getJob = (\n jobid: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/${jobid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetJobQueryKey = (jobid: number) => [`/job/${jobid}`];\n\nexport const useGetJob = <\n TData = AsyncReturnType<typeof getJob>,\n TError = ErrorType<void | DmError>\n>(\n jobid: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getJob>, TError, TData>;\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 ?? getGetJobQueryKey(jobid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getJob>> = () =>\n getJob(jobid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getJob>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!jobid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
1
+ {"version":3,"sources":["../../src/job/job.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAoCO,IAAM,UAAU,CAAC,YAAqD;AAC3E,SAAO,eACL,EAAE,KAAK,QAAQ,QAAQ,SACvB;AAAA;AAIG,IAAM,qBAAqB,MAAM,CAAC;AAElC,IAAM,aAAa,CAGxB,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA0D,MAC9D,QAAQ;AAEV,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAWA,IAAM,SAAS,CACpB,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,QAAQ,SAAS,QAAQ,SAChC;AAAA;AAIG,IAAM,oBAAoB,CAAC,UAAkB,CAAC,QAAQ;AAEtD,IAAM,YAAY,CAIvB,OACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY,kBAAkB;AAE7D,QAAM,UAAyD,MAC7D,OAAO,OAAO;AAEhB,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAC,SAAU;AAGzB,SAAO;AAAA,IACL;AAAA,KACG;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.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: 0.7\n */\nimport {\n useQuery,\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n JobsGetResponse,\n DmError,\n JobGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (options?: SecondParameter<typeof customInstance>) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\" },\n options\n );\n};\n\nexport const getGetJobsQueryKey = () => [`/job`];\n\nexport const useGetJobs = <\n TData = AsyncReturnType<typeof getJobs>,\n TError = ErrorType<DmError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getJobs>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getJobs>> = () =>\n getJobs(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getJobs>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Get details of a specific job available to you that can be instantiated.\n\nTo run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.\n\n * @summary Get details of a specific Job\n */\nexport const getJob = (\n jobid: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/${jobid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetJobQueryKey = (jobid: number) => [`/job/${jobid}`];\n\nexport const useGetJob = <\n TData = AsyncReturnType<typeof getJob>,\n TError = ErrorType<void | DmError>\n>(\n jobid: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getJob>, TError, TData>;\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 ?? getGetJobQueryKey(jobid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getJob>> = () =>\n getJob(jobid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getJob>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!jobid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
package/job/job.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
2
- import { b6 as customInstance, aH as JobsGetResponse, b7 as ErrorType, b2 as DmError, aJ as JobGetResponse } from '../custom-instance-3c2397cc';
2
+ import { b8 as customInstance, aG as JobsGetResponse, b9 as ErrorType, b4 as DmError, aI as JobGetResponse } from '../custom-instance-fcf163c4';
3
3
  import 'axios';
4
4
 
5
5
  /**
@@ -10,7 +10,7 @@ import 'axios';
10
10
 
11
11
  A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
12
12
 
13
- * OpenAPI spec version: 0.6
13
+ * OpenAPI spec version: 0.7
14
14
  */
15
15
 
16
16
  declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
package/job/job.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/job/job.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.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: 0.6\n */\nimport {\n useQuery,\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n JobsGetResponse,\n DmError,\n JobGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (options?: SecondParameter<typeof customInstance>) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\" },\n options\n );\n};\n\nexport const getGetJobsQueryKey = () => [`/job`];\n\nexport const useGetJobs = <\n TData = AsyncReturnType<typeof getJobs>,\n TError = ErrorType<DmError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getJobs>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getJobs>> = () =>\n getJobs(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getJobs>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Get details of a specific job available to you that can be instantiated.\n\nTo run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.\n\n * @summary Get details of a specific Job\n */\nexport const getJob = (\n jobid: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/${jobid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetJobQueryKey = (jobid: number) => [`/job/${jobid}`];\n\nexport const useGetJob = <\n TData = AsyncReturnType<typeof getJob>,\n TError = ErrorType<void | DmError>\n>(\n jobid: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getJob>, TError, TData>;\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 ?? getGetJobQueryKey(jobid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getJob>> = () =>\n getJob(jobid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getJob>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!jobid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAoCO,IAAM,UAAU,CAAC,YAAqD;AAC3E,SAAO,eACL,EAAE,KAAK,QAAQ,QAAQ,SACvB;AAAA;AAIG,IAAM,qBAAqB,MAAM,CAAC;AAElC,IAAM,aAAa,CAGxB,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA0D,MAC9D,QAAQ;AAEV,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAWA,IAAM,SAAS,CACpB,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,QAAQ,SAAS,QAAQ,SAChC;AAAA;AAIG,IAAM,oBAAoB,CAAC,UAAkB,CAAC,QAAQ;AAEtD,IAAM,YAAY,CAIvB,OACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY,kBAAkB;AAE7D,QAAM,UAAyD,MAC7D,OAAO,OAAO;AAEhB,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAC,SAAU;AAGzB,SAAO;AAAA,IACL;AAAA,KACG;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/job/job.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.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: 0.7\n */\nimport {\n useQuery,\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n JobsGetResponse,\n DmError,\n JobGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (options?: SecondParameter<typeof customInstance>) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\" },\n options\n );\n};\n\nexport const getGetJobsQueryKey = () => [`/job`];\n\nexport const useGetJobs = <\n TData = AsyncReturnType<typeof getJobs>,\n TError = ErrorType<DmError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getJobs>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getJobs>> = () =>\n getJobs(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getJobs>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Get details of a specific job available to you that can be instantiated.\n\nTo run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.\n\n * @summary Get details of a specific Job\n */\nexport const getJob = (\n jobid: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/${jobid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetJobQueryKey = (jobid: number) => [`/job/${jobid}`];\n\nexport const useGetJob = <\n TData = AsyncReturnType<typeof getJob>,\n TError = ErrorType<void | DmError>\n>(\n jobid: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getJob>, TError, TData>;\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 ?? getGetJobQueryKey(jobid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getJob>> = () =>\n getJob(jobid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getJob>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!jobid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAoCO,IAAM,UAAU,CAAC,YAAqD;AAC3E,SAAO,eACL,EAAE,KAAK,QAAQ,QAAQ,SACvB;AAAA;AAIG,IAAM,qBAAqB,MAAM,CAAC;AAElC,IAAM,aAAa,CAGxB,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA0D,MAC9D,QAAQ;AAEV,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAWA,IAAM,SAAS,CACpB,OACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,QAAQ,SAAS,QAAQ,SAChC;AAAA;AAIG,IAAM,oBAAoB,CAAC,UAAkB,CAAC,QAAQ;AAEtD,IAAM,YAAY,CAIvB,OACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY,kBAAkB;AAE7D,QAAM,UAAyD,MAC7D,OAAO,OAAO;AAEhB,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAC,SAAU;AAGzB,SAAO;AAAA,IACL;AAAA,KACG;AAAA;","names":[]}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.28-rc.6",
2
+ "version": "0.7.0-alpha.2",
3
3
  "author": "Oliver Dudgeon",
4
4
  "name": "@squonk/data-manager-client",
5
5
  "private": false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/project/project.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AA2CO,IAAM,cAAc,CACzB,YACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,SAC3B;AAAA;AAIG,IAAM,yBAAyB,MAAM,CAAC;AAEtC,IAAM,iBAAiB,CAG5B,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA8D,MAClE,YAAY;AAEd,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAeA,IAAM,gBAAgB,CAC3B,qBACA,YACG;AACH,QAAM,WAAW,IAAI;AACrB,WAAS,OAAO,QAAQ,oBAAoB;AAC5C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O,UACpD;AAAA;AAIG,IAAM,4BAA4B,CACvC,WACA,WACG,CAAC,YAAY,kBAAkB,GAAI,SAAS,CAAC,UAAU;AAErD,IAAM,oBAAoB,CAI/B,WACA,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,0BAA0B,WAAW;AAEjE,QAAM,UAAiE,MACrE,eAAe,WAAW,QAAQ;AAEpC,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAC,aAAc;AAG7B,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAWA,IAAM,mBAAmB,CAC9B,WACA,wBACA,YACG;AACH,QAAM,WAAW,IAAI;AACrB,WAAS,OAAO,QAAQ,uBAAuB;AAC/C,MAAI,uBAAuB,gBAAgB,QAAW;AACpD,aAAS,OAAO,eAAe,uBAAuB;AAAA;AAExD,MAAI,uBAAuB,SAAS,QAAW;AAC7C,aAAS,OAAO,QAAQ,uBAAuB;AAAA;AAGjD,SAAO,eACL,EAAE,KAAK,YAAY,kBAAkB,QAAQ,OAAO,MAAM,YAC1D;AAAA;AAIG,IAAM,sBAAsB,CAGjC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,SAAS,SAAS;AAErC,WAAO,iBAAiB,WAAW,MAAM;AAAA;AAG3C,SAAO,YAKL,YAAY;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.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: 0.6\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all projects available to you.\n\n * @summary Get all projects available to you\n */\nexport const getProjects = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\nexport const useGetProjects = <\n TData = AsyncReturnType<typeof getProjects>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProjects>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProjects>> = () =>\n getProjects(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProjects>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new project, assigning and returning a unique **ID**. A peristent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"organisation_id\", projectPostBodyBody.organisation_id);\n formData.append(\"unit_id\", projectPostBodyBody.unit_id);\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n { url: `/project`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createProject>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createProject>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createProject(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createProject>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the details of a project that is available to you.\n\n * @summary Get a project\n */\nexport const getProject = (\n projectid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectid: string) => [\n `/project/${projectid}`,\n];\n\nexport const useGetProject = <\n TData = AsyncReturnType<typeof getProject>,\n TError = ErrorType<void | DmError>\n>(\n projectid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProject>, TError, TData>;\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 ?? getGetProjectQueryKey(projectid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProject>> = () =>\n getProject(projectid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProject>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used to update some adjustable parameters of a project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing project\n */\nexport const patchProject = (\n projectid: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n { url: `/project/${projectid}`, method: \"patch\", data: formData },\n options\n );\n};\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof patchProject>,\n TError,\n { projectid: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof patchProject>,\n { projectid: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectid, data } = props || {};\n\n return patchProject(projectid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof patchProject>,\n TError,\n { projectid: string; data: ProjectPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a project\n */\nexport const deleteProject = (\n projectid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteProject>,\n TError,\n { projectid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteProject>,\n { projectid: string }\n > = (props) => {\n const { projectid } = props || {};\n\n return deleteProject(projectid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteProject>,\n TError,\n { projectid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a project editor\n */\nexport const addEditorToProject = (\n projectid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/editor/${userid}`, method: \"put\" },\n options\n );\n};\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addEditorToProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addEditorToProject>,\n { projectid: string; userid: string }\n > = (props) => {\n const { projectid, userid } = props || {};\n\n return addEditorToProject(projectid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addEditorToProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a project editor\n */\nexport const removeEditorFromProject = (\n projectid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/editor/${userid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof removeEditorFromProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof removeEditorFromProject>,\n { projectid: string; userid: string }\n > = (props) => {\n const { projectid, userid } = props || {};\n\n return removeEditorFromProject(projectid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof removeEditorFromProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a project file\n */\nexport const getProjectFile = (\n projectid: string,\n params?: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/file`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectid: string,\n params?: GetProjectFileParams\n) => [`/project/${projectid}/file`, ...(params ? [params] : [])];\n\nexport const useGetProjectFile = <\n TData = AsyncReturnType<typeof getProjectFile>,\n TError = ErrorType<DmError>\n>(\n projectid: string,\n params?: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getProjectFile>,\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 =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProjectFile>> = () =>\n getProjectFile(projectid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProjectFile>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectid: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n { url: `/project/${projectid}/file`, method: \"put\", data: formData },\n options\n );\n};\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addFileToProject>,\n TError,\n { projectid: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addFileToProject>,\n { projectid: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectid, data } = props || {};\n\n return addFileToProject(projectid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addFileToProject>,\n TError,\n { projectid: string; data: ProjectFilePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
1
+ {"version":3,"sources":["../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sBAAsB,CAGjC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,SAAS,SAAS;AAErC,WAAO,iBAAiB,WAAW,MAAM;AAAA;AAG3C,SAAO,YAKL,YAAY;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all projects available to you.\n\n * @summary Get all projects available to you\n */\nexport const getProjects = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\nexport const useGetProjects = <\n TData = AsyncReturnType<typeof getProjects>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProjects>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProjects>> = () =>\n getProjects(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProjects>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new project, assigning and returning a unique **ID**. A peristent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"organisation_id\", projectPostBodyBody.organisation_id);\n formData.append(\"unit_id\", projectPostBodyBody.unit_id);\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n { url: `/project`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createProject>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createProject>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createProject(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createProject>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the details of a project that is available to you.\n\n * @summary Get a project\n */\nexport const getProject = (\n projectid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectid: string) => [\n `/project/${projectid}`,\n];\n\nexport const useGetProject = <\n TData = AsyncReturnType<typeof getProject>,\n TError = ErrorType<void | DmError>\n>(\n projectid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProject>, TError, TData>;\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 ?? getGetProjectQueryKey(projectid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProject>> = () =>\n getProject(projectid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProject>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used to update some adjustable parameters of a project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing project\n */\nexport const patchProject = (\n projectid: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n { url: `/project/${projectid}`, method: \"patch\", data: formData },\n options\n );\n};\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof patchProject>,\n TError,\n { projectid: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof patchProject>,\n { projectid: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectid, data } = props || {};\n\n return patchProject(projectid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof patchProject>,\n TError,\n { projectid: string; data: ProjectPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a project\n */\nexport const deleteProject = (\n projectid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteProject>,\n TError,\n { projectid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteProject>,\n { projectid: string }\n > = (props) => {\n const { projectid } = props || {};\n\n return deleteProject(projectid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteProject>,\n TError,\n { projectid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a project editor\n */\nexport const addEditorToProject = (\n projectid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/editor/${userid}`, method: \"put\" },\n options\n );\n};\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addEditorToProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addEditorToProject>,\n { projectid: string; userid: string }\n > = (props) => {\n const { projectid, userid } = props || {};\n\n return addEditorToProject(projectid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addEditorToProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a project editor\n */\nexport const removeEditorFromProject = (\n projectid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/editor/${userid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof removeEditorFromProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof removeEditorFromProject>,\n { projectid: string; userid: string }\n > = (props) => {\n const { projectid, userid } = props || {};\n\n return removeEditorFromProject(projectid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof removeEditorFromProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a project file\n */\nexport const getProjectFile = (\n projectid: string,\n params?: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/file`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectid: string,\n params?: GetProjectFileParams\n) => [`/project/${projectid}/file`, ...(params ? [params] : [])];\n\nexport const useGetProjectFile = <\n TData = AsyncReturnType<typeof getProjectFile>,\n TError = ErrorType<DmError>\n>(\n projectid: string,\n params?: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getProjectFile>,\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 =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProjectFile>> = () =>\n getProjectFile(projectid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProjectFile>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectid: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n { url: `/project/${projectid}/file`, method: \"put\", data: formData },\n options\n );\n};\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addFileToProject>,\n TError,\n { projectid: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addFileToProject>,\n { projectid: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectid, data } = props || {};\n\n return addFileToProject(projectid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addFileToProject>,\n TError,\n { projectid: string; data: ProjectFilePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { b6 as customInstance, aD as ProjectsGetResponse, b7 as ErrorType, b2 as DmError, I as ProjectPostBodyBody, aE as ProjectPostResponse, a7 as ProjectDetail, J as ProjectPatchBodyBody, a1 as TaskIdentity, g as GetProjectFileParams, K as ProjectFilePutBodyBody } from '../custom-instance-3c2397cc';
1
+ import { b8 as customInstance, aC as ProjectsGetResponse, b9 as ErrorType, b4 as DmError, H as ProjectPostBodyBody, aD as ProjectPostResponse, a7 as ProjectDetail, I as ProjectPatchBodyBody, a1 as TaskIdentity, h as GetProjectFileParams, J as ProjectFilePutBodyBody } from '../custom-instance-fcf163c4';
2
2
  import * as react_query from 'react-query';
3
3
  import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
4
4
  import 'axios';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/project/project.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.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: 0.6\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all projects available to you.\n\n * @summary Get all projects available to you\n */\nexport const getProjects = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\nexport const useGetProjects = <\n TData = AsyncReturnType<typeof getProjects>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProjects>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProjects>> = () =>\n getProjects(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProjects>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new project, assigning and returning a unique **ID**. A peristent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"organisation_id\", projectPostBodyBody.organisation_id);\n formData.append(\"unit_id\", projectPostBodyBody.unit_id);\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n { url: `/project`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createProject>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createProject>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createProject(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createProject>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the details of a project that is available to you.\n\n * @summary Get a project\n */\nexport const getProject = (\n projectid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectid: string) => [\n `/project/${projectid}`,\n];\n\nexport const useGetProject = <\n TData = AsyncReturnType<typeof getProject>,\n TError = ErrorType<void | DmError>\n>(\n projectid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProject>, TError, TData>;\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 ?? getGetProjectQueryKey(projectid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProject>> = () =>\n getProject(projectid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProject>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used to update some adjustable parameters of a project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing project\n */\nexport const patchProject = (\n projectid: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n { url: `/project/${projectid}`, method: \"patch\", data: formData },\n options\n );\n};\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof patchProject>,\n TError,\n { projectid: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof patchProject>,\n { projectid: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectid, data } = props || {};\n\n return patchProject(projectid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof patchProject>,\n TError,\n { projectid: string; data: ProjectPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a project\n */\nexport const deleteProject = (\n projectid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteProject>,\n TError,\n { projectid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteProject>,\n { projectid: string }\n > = (props) => {\n const { projectid } = props || {};\n\n return deleteProject(projectid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteProject>,\n TError,\n { projectid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a project editor\n */\nexport const addEditorToProject = (\n projectid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/editor/${userid}`, method: \"put\" },\n options\n );\n};\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addEditorToProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addEditorToProject>,\n { projectid: string; userid: string }\n > = (props) => {\n const { projectid, userid } = props || {};\n\n return addEditorToProject(projectid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addEditorToProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a project editor\n */\nexport const removeEditorFromProject = (\n projectid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/editor/${userid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof removeEditorFromProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof removeEditorFromProject>,\n { projectid: string; userid: string }\n > = (props) => {\n const { projectid, userid } = props || {};\n\n return removeEditorFromProject(projectid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof removeEditorFromProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a project file\n */\nexport const getProjectFile = (\n projectid: string,\n params?: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/file`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectid: string,\n params?: GetProjectFileParams\n) => [`/project/${projectid}/file`, ...(params ? [params] : [])];\n\nexport const useGetProjectFile = <\n TData = AsyncReturnType<typeof getProjectFile>,\n TError = ErrorType<DmError>\n>(\n projectid: string,\n params?: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getProjectFile>,\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 =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProjectFile>> = () =>\n getProjectFile(projectid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProjectFile>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectid: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n { url: `/project/${projectid}/file`, method: \"put\", data: formData },\n options\n );\n};\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addFileToProject>,\n TError,\n { projectid: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addFileToProject>,\n { projectid: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectid, data } = props || {};\n\n return addFileToProject(projectid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addFileToProject>,\n TError,\n { project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,OAAO,MAAM,YAC1D;AAAA;AAIG,IAAM,sBAAsB,CAGjC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,SAAS,SAAS;AAErC,WAAO,iBAAiB,WAAW,MAAM;AAAA;AAG3C,SAAO,YAKL,YAAY;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/project/project.ts"],"sourcesContent":["/**\n * Generated by orval v6.6.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all projects available to you.\n\n * @summary Get all projects available to you\n */\nexport const getProjects = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\nexport const useGetProjects = <\n TData = AsyncReturnType<typeof getProjects>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProjects>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProjects>> = () =>\n getProjects(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProjects>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new project, assigning and returning a unique **ID**. A peristent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"organisation_id\", projectPostBodyBody.organisation_id);\n formData.append(\"unit_id\", projectPostBodyBody.unit_id);\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n { url: `/project`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createProject>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createProject>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createProject(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createProject>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the details of a project that is available to you.\n\n * @summary Get a project\n */\nexport const getProject = (\n projectid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectid}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectid: string) => [\n `/project/${projectid}`,\n];\n\nexport const useGetProject = <\n TData = AsyncReturnType<typeof getProject>,\n TError = ErrorType<void | DmError>\n>(\n projectid: string,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getProject>, TError, TData>;\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 ?? getGetProjectQueryKey(projectid);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProject>> = () =>\n getProject(projectid, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProject>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used to update some adjustable parameters of a project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing project\n */\nexport const patchProject = (\n projectid: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n { url: `/project/${projectid}`, method: \"patch\", data: formData },\n options\n );\n};\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof patchProject>,\n TError,\n { projectid: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof patchProject>,\n { projectid: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectid, data } = props || {};\n\n return patchProject(projectid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof patchProject>,\n TError,\n { projectid: string; data: ProjectPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a project\n */\nexport const deleteProject = (\n projectid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteProject>,\n TError,\n { projectid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteProject>,\n { projectid: string }\n > = (props) => {\n const { projectid } = props || {};\n\n return deleteProject(projectid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteProject>,\n TError,\n { projectid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a project editor\n */\nexport const addEditorToProject = (\n projectid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/editor/${userid}`, method: \"put\" },\n options\n );\n};\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addEditorToProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addEditorToProject>,\n { projectid: string; userid: string }\n > = (props) => {\n const { projectid, userid } = props || {};\n\n return addEditorToProject(projectid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addEditorToProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a project editor\n */\nexport const removeEditorFromProject = (\n projectid: string,\n userid: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/editor/${userid}`, method: \"delete\" },\n options\n );\n};\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof removeEditorFromProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof removeEditorFromProject>,\n { projectid: string; userid: string }\n > = (props) => {\n const { projectid, userid } = props || {};\n\n return removeEditorFromProject(projectid, userid, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof removeEditorFromProject>,\n TError,\n { projectid: string; userid: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a project file\n */\nexport const getProjectFile = (\n projectid: string,\n params?: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectid}/file`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectid: string,\n params?: GetProjectFileParams\n) => [`/project/${projectid}/file`, ...(params ? [params] : [])];\n\nexport const useGetProjectFile = <\n TData = AsyncReturnType<typeof getProjectFile>,\n TError = ErrorType<DmError>\n>(\n projectid: string,\n params?: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getProjectFile>,\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 =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getProjectFile>> = () =>\n getProjectFile(projectid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getProjectFile>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectid: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n { url: `/project/${projectid}/file`, method: \"put\", data: formData },\n options\n );\n};\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addFileToProject>,\n TError,\n { projectid: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addFileToProject>,\n { projectid: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectid, data } = props || {};\n\n return addFileToProject(projectid, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addFileToProject>,\n TError,\n { projectid: string; data: ProjectFilePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AA2CO,IAAM,cAAc,CACzB,YACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,SAC3B;AAAA;AAIG,IAAM,yBAAyB,MAAM,CAAC;AAEtC,IAAM,iBAAiB,CAG5B,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA8D,MAClE,YAAY;AAEd,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAeA,IAAM,gBAAgB,CAC3B,qBACA,YACG;AACH,QAAM,WAAW,IAAI;AACrB,WAAS,OAAO,QAAQ,oBAAoB;AAC5C,MAAI,oBAAoB,YAAY,QAAW;AAC7C,aAAS,OAAO,WAAW,oBAAoB,QAAQ;AAAA;AAEzD,WAAS,OAAO,mBAAmB,oBAAoB;AACvD,WAAS,OAAO,WAAW,oBAAoB;AAC/C,WAAS,OAAO,mBAAmB,oBAAoB;AAEvD,S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AAW;AAEpE,QAAM,WACJ,8CAAc,aAAY,0BAA0B,WAAW;AAEjE,QAAM,UAAiE,MACrE,eAAe,WAAW,QAAQ;AAEpC,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAC,aAAc;AAG7B,SAAO;AAAA,IACL;AAAA,KACG;AAAA;AAWA,IAAM,mBAAmB,CAC9B,WACA,wBACA,YACG;AACH,QAAM,WAAW,IAAI;AACrB,WAAS,OAAO,QAAQ,uBAAuB;AAC/C,MAAI,uBAAuB,gBAAgB,QAAW;AACpD,aAAS,OAAO,eAAe,uBAAuB;AAAA;AAExD,MAAI,uBAAuB,SAAS,QAAW;AAC7C,aAAS,OAAO,QAAQ,uBAAuB;AAAA;AAGjD,SAAO,eACL,EAAE,KAAK,YAAY,kBAAkB,QAAQ,OAAO,MAAM,YAC1D;AAAA;AAIG,IAAM,sBAAsB,CAGjC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW;AAE1E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,SAAS,SAAS;AAErC,WAAO,iBAAiB,WAAW,MAAM;AAAA;AAG3C,SAAO,YAKL,YAAY;AAAA;","names":[]}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Generated by orval v6.6.0 🍺
3
+ * Do not edit manually.
4
+ * Dataset Manager API
5
+ * The Dataset Manager API service.
6
+
7
+ A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
8
+
9
+ * OpenAPI spec version: 0.7
10
+ */
11
+ import {
12
+ useQuery,
13
+ UseQueryOptions,
14
+ QueryFunction,
15
+ UseQueryResult,
16
+ QueryKey,
17
+ } from "react-query";
18
+ import type {
19
+ AccountServerGetNamespaceResponse,
20
+ DmError,
21
+ } from "../data-manager-api.schemas";
22
+ import { customInstance, ErrorType } from ".././custom-instance";
23
+
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
26
+ ...args: any
27
+ ) => Promise<infer R>
28
+ ? R
29
+ : any;
30
+
31
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ type SecondParameter<T extends (...args: any) => any> = T extends (
33
+ config: any,
34
+ args: infer P
35
+ ) => any
36
+ ? P
37
+ : never;
38
+
39
+ /**
40
+ * If an Account Server is configured its namespace, e.g. `account-server`, is returned, otherwise an empty string is returned
41
+
42
+ * @summary Gets the Account Server cluster namespace
43
+ */
44
+ export const getAccountServerNamespace = (
45
+ options?: SecondParameter<typeof customInstance>
46
+ ) => {
47
+ return customInstance<AccountServerGetNamespaceResponse>(
48
+ { url: `/account-server/namespace`, method: "get" },
49
+ options
50
+ );
51
+ };
52
+
53
+ export const getGetAccountServerNamespaceQueryKey = () => [
54
+ `/account-server/namespace`,
55
+ ];
56
+
57
+ export const useGetAccountServerNamespace = <
58
+ TData = AsyncReturnType<typeof getAccountServerNamespace>,
59
+ TError = ErrorType<void | DmError>
60
+ >(options?: {
61
+ query?: UseQueryOptions<
62
+ AsyncReturnType<typeof getAccountServerNamespace>,
63
+ TError,
64
+ TData
65
+ >;
66
+ request?: SecondParameter<typeof customInstance>;
67
+ }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
68
+ const { query: queryOptions, request: requestOptions } = options || {};
69
+
70
+ const queryKey =
71
+ queryOptions?.queryKey ?? getGetAccountServerNamespaceQueryKey();
72
+
73
+ const queryFn: QueryFunction<
74
+ AsyncReturnType<typeof getAccountServerNamespace>
75
+ > = () => getAccountServerNamespace(requestOptions);
76
+
77
+ const query = useQuery<
78
+ AsyncReturnType<typeof getAccountServerNamespace>,
79
+ TError,
80
+ TData
81
+ >(queryKey, queryFn, queryOptions);
82
+
83
+ return {
84
+ queryKey,
85
+ ...query,
86
+ };
87
+ };