@squonk/data-manager-client 0.7.10 → 0.7.11-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounting/accounting.cjs +10 -8
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +9 -8
- package/accounting/accounting.js +10 -8
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +17 -17
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +13 -12
- package/admin/admin.js +17 -17
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +12 -8
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +9 -8
- package/application/application.js +12 -8
- package/application/application.js.map +1 -1
- package/{custom-instance-6e6b0801.d.ts → custom-instance-da4fff1f.d.ts} +144 -116
- package/dataset/dataset.cjs +42 -30
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +19 -18
- package/dataset/dataset.js +42 -30
- package/dataset/dataset.js.map +1 -1
- package/file/file.cjs +18 -14
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +11 -10
- package/file/file.js +18 -14
- package/file/file.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +35 -15
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +33 -10
- package/instance/instance.js +34 -14
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +12 -8
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +9 -8
- package/job/job.js +12 -8
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +18 -12
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +10 -9
- package/metadata/metadata.js +18 -12
- package/metadata/metadata.js.map +1 -1
- package/package.json +9 -9
- package/project/project.cjs +52 -25
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +35 -15
- package/project/project.js +51 -24
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +29 -25
- package/src/admin/admin.ts +55 -57
- package/src/application/application.ts +30 -29
- package/src/data-manager-api.schemas.ts +178 -180
- package/src/dataset/dataset.ts +113 -90
- package/src/file/file.ts +54 -47
- package/src/instance/instance.ts +118 -51
- package/src/job/job.ts +30 -25
- package/src/metadata/metadata.ts +50 -41
- package/src/project/project.ts +163 -78
- package/src/task/task.ts +40 -31
- package/src/type/type.ts +23 -20
- package/src/user/user.ts +55 -48
- package/task/task.cjs +14 -10
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +9 -8
- package/task/task.js +14 -10
- package/task/task.js.map +1 -1
- package/type/type.cjs +6 -4
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +7 -6
- package/type/type.js +6 -4
- package/type/type.js.map +1 -1
- package/user/user.cjs +20 -14
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +11 -10
- package/user/user.js +20 -14
- package/user/user.js.map +1 -1
package/dataset/dataset.cjs
CHANGED
|
@@ -37,9 +37,9 @@ var createDatasetFromFile = (datasetPutBodyBody, options) => {
|
|
|
37
37
|
}, options);
|
|
38
38
|
};
|
|
39
39
|
var useCreateDatasetFromFile = (options) => {
|
|
40
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
40
|
+
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
41
41
|
const mutationFn = (props) => {
|
|
42
|
-
const { data } = props
|
|
42
|
+
const { data } = _nullishCoalesce(props, () => ( {}));
|
|
43
43
|
return createDatasetFromFile(data, requestOptions);
|
|
44
44
|
};
|
|
45
45
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
@@ -70,37 +70,41 @@ var uploadDataset = (datasetPostBodyBody, options) => {
|
|
|
70
70
|
}, options);
|
|
71
71
|
};
|
|
72
72
|
var useUploadDataset = (options) => {
|
|
73
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
73
|
+
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
74
74
|
const mutationFn = (props) => {
|
|
75
|
-
const { data } = props
|
|
75
|
+
const { data } = _nullishCoalesce(props, () => ( {}));
|
|
76
76
|
return uploadDataset(data, requestOptions);
|
|
77
77
|
};
|
|
78
78
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
79
79
|
};
|
|
80
|
-
var getDatasets = (params, options) => {
|
|
81
|
-
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset`, method: "get", params }, options);
|
|
80
|
+
var getDatasets = (params, options, signal) => {
|
|
81
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset`, method: "get", signal, params }, options);
|
|
82
82
|
};
|
|
83
83
|
var getGetDatasetsQueryKey = (params) => [
|
|
84
84
|
`/dataset`,
|
|
85
85
|
...params ? [params] : []
|
|
86
86
|
];
|
|
87
87
|
var useGetDatasets = (params, options) => {
|
|
88
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
88
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
89
89
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetDatasetsQueryKey(params)));
|
|
90
|
-
const queryFn = (
|
|
90
|
+
const queryFn = ({
|
|
91
|
+
signal
|
|
92
|
+
}) => getDatasets(params, requestOptions, signal);
|
|
91
93
|
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
|
|
92
94
|
return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
|
|
93
95
|
queryKey
|
|
94
96
|
}, query);
|
|
95
97
|
};
|
|
96
|
-
var getVersions = (datasetId, params, options) => {
|
|
97
|
-
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset/${datasetId}/versions`, method: "get", params }, options);
|
|
98
|
+
var getVersions = (datasetId, params, options, signal) => {
|
|
99
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset/${datasetId}/versions`, method: "get", signal, params }, options);
|
|
98
100
|
};
|
|
99
101
|
var getGetVersionsQueryKey = (datasetId, params) => [`/dataset/${datasetId}/versions`, ...params ? [params] : []];
|
|
100
102
|
var useGetVersions = (datasetId, params, options) => {
|
|
101
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
103
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
102
104
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetVersionsQueryKey(datasetId, params)));
|
|
103
|
-
const queryFn = (
|
|
105
|
+
const queryFn = ({
|
|
106
|
+
signal
|
|
107
|
+
}) => getVersions(datasetId, params, requestOptions, signal);
|
|
104
108
|
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkNGBTCJWScjs.__spreadValues.call(void 0, { enabled: !!datasetId }, queryOptions));
|
|
105
109
|
return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
|
|
106
110
|
queryKey
|
|
@@ -114,21 +118,23 @@ var deleteDataset = (datasetId, datasetVersion, params, options) => {
|
|
|
114
118
|
}, options);
|
|
115
119
|
};
|
|
116
120
|
var useDeleteDataset = (options) => {
|
|
117
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
121
|
+
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
118
122
|
const mutationFn = (props) => {
|
|
119
|
-
const { datasetId, datasetVersion, params } = props
|
|
123
|
+
const { datasetId, datasetVersion, params } = _nullishCoalesce(props, () => ( {}));
|
|
120
124
|
return deleteDataset(datasetId, datasetVersion, params, requestOptions);
|
|
121
125
|
};
|
|
122
126
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
123
127
|
};
|
|
124
|
-
var downloadDataset = (datasetId, datasetVersion, options) => {
|
|
125
|
-
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset/${datasetId}/${datasetVersion}`, method: "get" }, options);
|
|
128
|
+
var downloadDataset = (datasetId, datasetVersion, options, signal) => {
|
|
129
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset/${datasetId}/${datasetVersion}`, method: "get", signal }, options);
|
|
126
130
|
};
|
|
127
131
|
var getDownloadDatasetQueryKey = (datasetId, datasetVersion) => [`/dataset/${datasetId}/${datasetVersion}`];
|
|
128
132
|
var useDownloadDataset = (datasetId, datasetVersion, options) => {
|
|
129
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
133
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
130
134
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getDownloadDatasetQueryKey(datasetId, datasetVersion)));
|
|
131
|
-
const queryFn = (
|
|
135
|
+
const queryFn = ({
|
|
136
|
+
signal
|
|
137
|
+
}) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);
|
|
132
138
|
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
|
|
133
139
|
enabled: !!(datasetId && datasetVersion)
|
|
134
140
|
}, queryOptions));
|
|
@@ -140,9 +146,9 @@ var removeEditorFromDataset = (datasetId, userId, options) => {
|
|
|
140
146
|
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset/${datasetId}/editor/${userId}`, method: "delete" }, options);
|
|
141
147
|
};
|
|
142
148
|
var useRemoveEditorFromDataset = (options) => {
|
|
143
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
149
|
+
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
144
150
|
const mutationFn = (props) => {
|
|
145
|
-
const { datasetId, userId } = props
|
|
151
|
+
const { datasetId, userId } = _nullishCoalesce(props, () => ( {}));
|
|
146
152
|
return removeEditorFromDataset(datasetId, userId, requestOptions);
|
|
147
153
|
};
|
|
148
154
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
@@ -151,36 +157,42 @@ var addEditorToDataset = (datasetId, userId, options) => {
|
|
|
151
157
|
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset/${datasetId}/editor/${userId}`, method: "put" }, options);
|
|
152
158
|
};
|
|
153
159
|
var useAddEditorToDataset = (options) => {
|
|
154
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
160
|
+
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
155
161
|
const mutationFn = (props) => {
|
|
156
|
-
const { datasetId, userId } = props
|
|
162
|
+
const { datasetId, userId } = _nullishCoalesce(props, () => ( {}));
|
|
157
163
|
return addEditorToDataset(datasetId, userId, requestOptions);
|
|
158
164
|
};
|
|
159
165
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
160
166
|
};
|
|
161
|
-
var getDatasetDigest = (datasetDigest, options) => {
|
|
162
|
-
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset/digest/${datasetDigest}`, method: "get" }, options);
|
|
167
|
+
var getDatasetDigest = (datasetDigest, options, signal) => {
|
|
168
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, { url: `/dataset/digest/${datasetDigest}`, method: "get", signal }, options);
|
|
163
169
|
};
|
|
164
170
|
var getGetDatasetDigestQueryKey = (datasetDigest) => [
|
|
165
171
|
`/dataset/digest/${datasetDigest}`
|
|
166
172
|
];
|
|
167
173
|
var useGetDatasetDigest = (datasetDigest, options) => {
|
|
168
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
174
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
169
175
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetDatasetDigestQueryKey(datasetDigest)));
|
|
170
|
-
const queryFn = () => getDatasetDigest(datasetDigest, requestOptions);
|
|
176
|
+
const queryFn = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);
|
|
171
177
|
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkNGBTCJWScjs.__spreadValues.call(void 0, { enabled: !!datasetDigest }, queryOptions));
|
|
172
178
|
return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
|
|
173
179
|
queryKey
|
|
174
180
|
}, query);
|
|
175
181
|
};
|
|
176
|
-
var getSchema = (datasetId, datasetVersion, options) => {
|
|
177
|
-
return _chunkNGBTCJWScjs.customInstance.call(void 0, {
|
|
182
|
+
var getSchema = (datasetId, datasetVersion, options, signal) => {
|
|
183
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, {
|
|
184
|
+
url: `/dataset/${datasetId}/schema/${datasetVersion}`,
|
|
185
|
+
method: "get",
|
|
186
|
+
signal
|
|
187
|
+
}, options);
|
|
178
188
|
};
|
|
179
189
|
var getGetSchemaQueryKey = (datasetId, datasetVersion) => [`/dataset/${datasetId}/schema/${datasetVersion}`];
|
|
180
190
|
var useGetSchema = (datasetId, datasetVersion, options) => {
|
|
181
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
191
|
+
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
182
192
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetSchemaQueryKey(datasetId, datasetVersion)));
|
|
183
|
-
const queryFn = (
|
|
193
|
+
const queryFn = ({
|
|
194
|
+
signal
|
|
195
|
+
}) => getSchema(datasetId, datasetVersion, requestOptions, signal);
|
|
184
196
|
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, _chunkNGBTCJWScjs.__spreadValues.call(void 0, { enabled: !!(datasetId && datasetVersion) }, queryOptions));
|
|
185
197
|
return _chunkNGBTCJWScjs.__spreadValues.call(void 0, {
|
|
186
198
|
queryKey
|
package/dataset/dataset.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/dataset/dataset.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAkDO,IAA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AAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,4BAA4B,aAAa;AAErE,QAAM,UAAmE,MACvE,iBAAiB,eAAe,cAAc;AAEhD,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,iBAAkB,aAAc;AAElE,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,YAAY,CACvB,WACA,gBACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,oBAAoB,kBAAkB,QAAQ,MAAM,GACvE,OACF;AACF;AAEO,IAAM,uBAAuB,CAClC,WACA,mBACG,CAAC,YAAY,oBAAoB,gBAAgB;AAO/C,IAAM,eAAe,CAI1B,WACA,gBACA,YAI2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,qBAAqB,WAAW,cAAc;AAE1E,QAAM,UAA4D,MAChE,UAAU,WAAW,gBAAgB,cAAc;AAErD,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAE,cAAa,mBAAoB,aACjD;AAEA,SAAO;AAAA,IACL;AAAA,KACG;AAEP","sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\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 DatasetPutPostResponse,\n DmError,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetSchemaGetResponse,\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 * Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nBehaves like the corresponding **POST** method except the file is expected to exist on a Project path.\n\n * @summary Create a Dataset from a file in a Project\n */\nexport const createDatasetFromFile = (\n datasetPutBodyBody: DatasetPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_type\", datasetPutBodyBody.dataset_type);\n if (datasetPutBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPutBodyBody.format_extra_variables\n );\n }\n if (datasetPutBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPutBodyBody.skip_molecule_load.toString()\n );\n }\n formData.append(\"project_id\", datasetPutBodyBody.project_id);\n formData.append(\"path\", datasetPutBodyBody.path);\n formData.append(\"file_name\", datasetPutBodyBody.file_name);\n if (datasetPutBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPutBodyBody.dataset_id);\n }\n if (datasetPutBodyBody.organisation_id !== undefined) {\n formData.append(\"organisation_id\", datasetPutBodyBody.organisation_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateDatasetFromFileMutationResult = NonNullable<\n AsyncReturnType<typeof createDatasetFromFile>\n>;\nexport type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;\nexport type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;\n\nexport const useCreateDatasetFromFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof createDatasetFromFile>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof createDatasetFromFile>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof createDatasetFromFile>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Uploads a dataset.\n\nDataset file-naming is strictly limited to a fixed set of extensions based on the Dataset **Type**. You can obtain the supported types (and their extensions) via the **\\/type** endpoint. Filenames that do not comply with the supported filename extensions will be rejected.\n\nDatasets can be uploaded in an uncompressed form, or uploaded pre-compressed using the `.gz` extension.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nDatasets undergo some processing in an asynchronous `task` after control returns to you. The unique identity of the assigned task (the `task id`) is presented to you in this endpoint's response. Before you can use an uploaded dataset, and before the dataset can be added to any pre-assigned projects, you must wait until the task is complete by making regular calls to the **\\/task/{task-id}** endpoint. A Dataset upload is complete when the corresponding `task.done` is **true** along with a `task.exit_code` of **0**. If the Dataset upload fails `task.done` will be **true** but the `task.exit_code` will be non-zero.\n\n * @summary Upload an external file as a Dataset\n */\nexport const uploadDataset = (\n datasetPostBodyBody: DatasetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_file\", datasetPostBodyBody.dataset_file);\n formData.append(\"dataset_type\", datasetPostBodyBody.dataset_type);\n if (datasetPostBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPostBodyBody.format_extra_variables\n );\n }\n if (datasetPostBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPostBodyBody.skip_molecule_load.toString()\n );\n }\n if (datasetPostBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n }\n if (datasetPostBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPostBodyBody.dataset_id);\n }\n formData.append(\"organisation_id\", datasetPostBodyBody.organisation_id);\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type UploadDatasetMutationResult = NonNullable<\n AsyncReturnType<typeof uploadDataset>\n>;\nexport type UploadDatasetMutationBody = DatasetPostBodyBody;\nexport type UploadDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useUploadDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof uploadDataset>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof uploadDataset>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof uploadDataset>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns datasets that you have access to, whether attached to a project or not.\n\nYou will not see Datasets while their upload is still in progress.\n\nDatasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `owners` (a subset of the above) 4. a list of `editors` (a subset of the above) 5. `Labels` or `Label/Value` pairs (a subset of the above)\n\nNote that if `editors` are combined with `owner username`, then the datasets will be filtered by owner username first followed by editors (so it's an AND). If `editors` are combined with `owners`, then the result will be datasets filtered by a combination of owners OR editors.\n\n * @summary Get datasets that are available to you\n */\nexport const getDatasets = (\n params?: GetDatasetsParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport type GetDatasetsQueryResult = NonNullable<\n AsyncReturnType<typeof getDatasets>\n>;\nexport type GetDatasetsQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasets = <\n TData = AsyncReturnType<typeof getDatasets>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getDatasets>, 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 ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasets>> = () =>\n getDatasets(params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getDatasets>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Returns a list of Dataset versions.\n\nYou will not see Datasets while their upload is still in progress.\n\n * @summary Gets all the versions of a specific Dataset\n */\nexport const getVersions = (\n datasetId: string,\n params?: GetVersionsParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetId}/versions`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetId: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetId}/versions`, ...(params ? [params] : [])];\n\nexport type GetVersionsQueryResult = NonNullable<\n AsyncReturnType<typeof getVersions>\n>;\nexport type GetVersionsQueryError = ErrorType<void | DmError>;\n\nexport const useGetVersions = <\n TData = AsyncReturnType<typeof getVersions>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getVersions>, 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 ?? getGetVersionsQueryKey(datasetId, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getVersions>> = () =>\n getVersions(datasetId, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getVersions>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!datasetId, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Given the Dataset `id` and `version` the Dataset will be removed. The API does not prevent you removing a Dataset that's been used in a **Project**. When removed using this endpoint the Dataset is automatically detached from any and all Projects that it was attached to and any corresponding Project Files relating to the Dataset are also removed.\n\nYou must be an `editor` or `owner` of the Dataset.\n\nYou cannot delete a Dataset until its upload is complete.\n\n * @summary Delete a dataset\n */\nexport const deleteDataset = (\n datasetId: string,\n datasetVersion: number,\n params?: DeleteDatasetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetVersionDeleteResponse>(\n {\n url: `/dataset/${datasetId}/${datasetVersion}`,\n method: \"delete\",\n params,\n },\n options\n );\n};\n\nexport type DeleteDatasetMutationResult = NonNullable<\n AsyncReturnType<typeof deleteDataset>\n>;\n\nexport type DeleteDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof deleteDataset>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof deleteDataset>,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams }\n > = (props) => {\n const { datasetId, datasetVersion, params } = props || {};\n\n return deleteDataset(datasetId, datasetVersion, params, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof deleteDataset>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `dataset_id` the dataset will be returned if available.\n\nYou cannot get a Dataset until its upload is complete.\n\n * @summary Download a dataset\n */\nexport const downloadDataset = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/${datasetVersion}`, method: \"get\" },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/${datasetVersion}`];\n\nexport type DownloadDatasetQueryResult = NonNullable<\n AsyncReturnType<typeof downloadDataset>\n>;\nexport type DownloadDatasetQueryError = ErrorType<DmError>;\n\nexport const useDownloadDataset = <\n TData = AsyncReturnType<typeof downloadDataset>,\n TError = ErrorType<DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof downloadDataset>,\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 ??\n getDownloadDatasetQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof downloadDataset>> = () =>\n downloadDataset(datasetId, datasetVersion, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof downloadDataset>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * The user is removed from the Dataset's `editor` list. The user is removed from all versions of a dataset. You can remove yourself but an `owner` (creator) will always have access to the dataset.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Remove a user's edit permission for a Dataset\n */\nexport const removeEditorFromDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromDatasetMutationResult = NonNullable<\n AsyncReturnType<typeof removeEditorFromDataset>\n>;\n\nexport type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof removeEditorFromDataset>,\n TError,\n { datasetId: 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 removeEditorFromDataset>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props || {};\n\n return removeEditorFromDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof removeEditorFromDataset>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The user is added to the dataset's editor list. The dataset `owner` is automatically an editor and so does not need to be added as an `editor`.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Give a user edit permission for a dataset\n */\nexport const addEditorToDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToDatasetMutationResult = NonNullable<\n AsyncReturnType<typeof addEditorToDataset>\n>;\n\nexport type AddEditorToDatasetMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addEditorToDataset>,\n TError,\n { datasetId: 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 addEditorToDataset>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props || {};\n\n return addEditorToDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addEditorToDataset>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a dataset ID and version of a dataset that matches the provided SHA256 digest, a 64-charcater hexstring.\n\n * @summary Gets the first Dataset that matches the provided digest\n */\nexport const getDatasetDigest = (\n datasetDigest: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetDigest}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetDigest: string) => [\n `/dataset/digest/${datasetDigest}`,\n];\n\nexport type GetDatasetDigestQueryResult = NonNullable<\n AsyncReturnType<typeof getDatasetDigest>\n>;\nexport type GetDatasetDigestQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasetDigest = <\n TData = AsyncReturnType<typeof getDatasetDigest>,\n TError = ErrorType<void | DmError>\n>(\n datasetDigest: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getDatasetDigest>,\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 ?? getGetDatasetDigestQueryKey(datasetDigest);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasetDigest>> = () =>\n getDatasetDigest(datasetDigest, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getDatasetDigest>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!datasetDigest, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Returns the property schema for a Dataset versions in JSON format (if available).\n\n * @summary Gets the property schema for a specific Dataset\n */\nexport const getSchema = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetSchemaGetResponse>(\n { url: `/dataset/${datasetId}/schema/${datasetVersion}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/schema/${datasetVersion}`];\n\nexport type GetSchemaQueryResult = NonNullable<\n AsyncReturnType<typeof getSchema>\n>;\nexport type GetSchemaQueryError = ErrorType<void | DmError>;\n\nexport const useGetSchema = <\n TData = AsyncReturnType<typeof getSchema>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getSchema>, 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 ?? getGetSchemaQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getSchema>> = () =>\n getSchema(datasetId, datasetVersion, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getSchema>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetId && datasetVersion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/dataset/dataset.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AA+CO,IAAM,wBAAwB,CACnC,oBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB,mBAAmB,YAAY;AAC/D,MAAI,mBAAmB,2BAA2B,QAAW;AAC3D,aAAS,OACP,0BACA,mBAAmB,sBACrB;AAAA,EACF;AACA,MAAI,mBAAmB,uBAAuB,QAAW;AACvD,aAAS,OACP,sBACA,mBAAmB,mBAAmB,SAAS,CACjD;AAAA,EACF;AACA,WAAS,OAAO,cAAc,mBAAmB,UAAU;AAC3D,WAAS,OAAO,QAAQ,mBAAmB,IAAI;AAC/C,WAAS,OAAO,aAAa,mBAAmB,SAAS;AACzD,MAAI,mBAAmB,eAAe,QAAW;AAC/C,aAAS,OAAO,cAAc,mBAAmB,UAAU;AAAA,EAC7D;AACA,MAAI,mBAAmB,oBAAoB,QAAW;AACpD,aAAS,OAAO,mBAAmB,mBAAmB,eAAe;AAAA,EACvE;AACA,MAAI,mBAAmB,YAAY,QAAW;AAC5C,aAAS,OAAO,WAAW,mBAAmB,OAAO;AAAA,EACvD;AAEA,SAAO,eACL;AAAA,IACE,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,IACjD,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,2BAA2B,CAGtC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS,CAAC;AAE3B,WAAO,sBAAsB,MAAM,cAAc;AAAA,EACnD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAcO,IAAM,gB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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 DatasetPutPostResponse,\n DmError,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetSchemaGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\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 * Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nBehaves like the corresponding **POST** method except the file is expected to exist on a Project path.\n\n * @summary Create a Dataset from a file in a Project\n */\nexport const createDatasetFromFile = (\n datasetPutBodyBody: DatasetPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_type\", datasetPutBodyBody.dataset_type);\n if (datasetPutBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPutBodyBody.format_extra_variables\n );\n }\n if (datasetPutBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPutBodyBody.skip_molecule_load.toString()\n );\n }\n formData.append(\"project_id\", datasetPutBodyBody.project_id);\n formData.append(\"path\", datasetPutBodyBody.path);\n formData.append(\"file_name\", datasetPutBodyBody.file_name);\n if (datasetPutBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPutBodyBody.dataset_id);\n }\n if (datasetPutBodyBody.organisation_id !== undefined) {\n formData.append(\"organisation_id\", datasetPutBodyBody.organisation_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateDatasetFromFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDatasetFromFile>>\n>;\nexport type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;\nexport type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;\n\nexport const useCreateDatasetFromFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Uploads a dataset.\n\nDataset file-naming is strictly limited to a fixed set of extensions based on the Dataset **Type**. You can obtain the supported types (and their extensions) via the **\\/type** endpoint. Filenames that do not comply with the supported filename extensions will be rejected.\n\nDatasets can be uploaded in an uncompressed form, or uploaded pre-compressed using the `.gz` extension.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nDatasets undergo some processing in an asynchronous `task` after control returns to you. The unique identity of the assigned task (the `task id`) is presented to you in this endpoint's response. Before you can use an uploaded dataset, and before the dataset can be added to any pre-assigned projects, you must wait until the task is complete by making regular calls to the **\\/task/{task-id}** endpoint. A Dataset upload is complete when the corresponding `task.done` is **true** along with a `task.exit_code` of **0**. If the Dataset upload fails `task.done` will be **true** but the `task.exit_code` will be non-zero.\n\n * @summary Upload an external file as a Dataset\n */\nexport const uploadDataset = (\n datasetPostBodyBody: DatasetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_file\", datasetPostBodyBody.dataset_file);\n formData.append(\"dataset_type\", datasetPostBodyBody.dataset_type);\n if (datasetPostBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPostBodyBody.format_extra_variables\n );\n }\n if (datasetPostBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPostBodyBody.skip_molecule_load.toString()\n );\n }\n if (datasetPostBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n }\n if (datasetPostBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPostBodyBody.dataset_id);\n }\n formData.append(\"organisation_id\", datasetPostBodyBody.organisation_id);\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type UploadDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof uploadDataset>>\n>;\nexport type UploadDatasetMutationBody = DatasetPostBodyBody;\nexport type UploadDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useUploadDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof uploadDataset>>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns datasets that you have access to, whether attached to a project or not.\n\nYou will not see Datasets while their upload is still in progress.\n\nDatasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `owners` (a subset of the above) 4. a list of `editors` (a subset of the above) 5. `Labels` or `Label/Value` pairs (a subset of the above)\n\nNote that if `editors` are combined with `owner username`, then the datasets will be filtered by owner username first followed by editors (so it's an AND). If `editors` are combined with `owners`, then the result will be datasets filtered by a combination of owners OR editors.\n\n * @summary Get datasets that are available to you\n */\nexport const getDatasets = (\n params?: GetDatasetsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", signal, params },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport type GetDatasetsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasets>>\n>;\nexport type GetDatasetsQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasets = <\n TData = Awaited<ReturnType<typeof getDatasets>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasets>>,\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 ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDatasets>>> = ({\n signal,\n }) => getDatasets(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasets>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Returns a list of Dataset versions.\n\nYou will not see Datasets while their upload is still in progress.\n\n * @summary Gets all the versions of a specific Dataset\n */\nexport const getVersions = (\n datasetId: string,\n params?: GetVersionsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetId}/versions`, method: \"get\", signal, params },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetId: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetId}/versions`, ...(params ? [params] : [])];\n\nexport type GetVersionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getVersions>>\n>;\nexport type GetVersionsQueryError = ErrorType<void | DmError>;\n\nexport const useGetVersions = <\n TData = Awaited<ReturnType<typeof getVersions>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersions>>,\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 ?? getGetVersionsQueryKey(datasetId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersions>>> = ({\n signal,\n }) => getVersions(datasetId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getVersions>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!datasetId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Given the Dataset `id` and `version` the Dataset will be removed. The API does not prevent you removing a Dataset that's been used in a **Project**. When removed using this endpoint the Dataset is automatically detached from any and all Projects that it was attached to and any corresponding Project Files relating to the Dataset are also removed.\n\nYou must be an `editor` or `owner` of the Dataset.\n\nYou cannot delete a Dataset until its upload is complete.\n\n * @summary Delete a dataset\n */\nexport const deleteDataset = (\n datasetId: string,\n datasetVersion: number,\n params?: DeleteDatasetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetVersionDeleteResponse>(\n {\n url: `/dataset/${datasetId}/${datasetVersion}`,\n method: \"delete\",\n params,\n },\n options\n );\n};\n\nexport type DeleteDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDataset>>\n>;\n\nexport type DeleteDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteDataset>>,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams }\n > = (props) => {\n const { datasetId, datasetVersion, params } = props ?? {};\n\n return deleteDataset(datasetId, datasetVersion, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `dataset_id` the dataset will be returned if available.\n\nYou cannot get a Dataset until its upload is complete.\n\n * @summary Download a dataset\n */\nexport const downloadDataset = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/${datasetVersion}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/${datasetVersion}`];\n\nexport type DownloadDatasetQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadDataset>>\n>;\nexport type DownloadDatasetQueryError = ErrorType<DmError>;\n\nexport const useDownloadDataset = <\n TData = Awaited<ReturnType<typeof downloadDataset>>,\n TError = ErrorType<DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadDataset>>,\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 ??\n getDownloadDatasetQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadDataset>>> = ({\n signal,\n }) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * The user is removed from the Dataset's `editor` list. The user is removed from all versions of a dataset. You can remove yourself but an `owner` (creator) will always have access to the dataset.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Remove a user's edit permission for a Dataset\n */\nexport const removeEditorFromDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromDataset>>\n>;\n\nexport type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: 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 Awaited<ReturnType<typeof removeEditorFromDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return removeEditorFromDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The user is added to the dataset's editor list. The dataset `owner` is automatically an editor and so does not need to be added as an `editor`.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Give a user edit permission for a dataset\n */\nexport const addEditorToDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToDataset>>\n>;\n\nexport type AddEditorToDatasetMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: 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 Awaited<ReturnType<typeof addEditorToDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return addEditorToDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a dataset ID and version of a dataset that matches the provided SHA256 digest, a 64-charcater hexstring.\n\n * @summary Gets the first Dataset that matches the provided digest\n */\nexport const getDatasetDigest = (\n datasetDigest: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetDigest}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetDigest: string) => [\n `/dataset/digest/${datasetDigest}`,\n];\n\nexport type GetDatasetDigestQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasetDigest>>\n>;\nexport type GetDatasetDigestQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasetDigest = <\n TData = Awaited<ReturnType<typeof getDatasetDigest>>,\n TError = ErrorType<void | DmError>\n>(\n datasetDigest: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasetDigest>>,\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 ?? getGetDatasetDigestQueryKey(datasetDigest);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getDatasetDigest>>\n > = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!datasetDigest, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Returns the property schema for a Dataset versions in JSON format (if available).\n\n * @summary Gets the property schema for a specific Dataset\n */\nexport const getSchema = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetSchemaGetResponse>(\n {\n url: `/dataset/${datasetId}/schema/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/schema/${datasetVersion}`];\n\nexport type GetSchemaQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSchema>>\n>;\nexport type GetSchemaQueryError = ErrorType<void | DmError>;\n\nexport const useGetSchema = <\n TData = Awaited<ReturnType<typeof getSchema>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getSchema>>,\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 ?? getGetSchemaQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSchema>>> = ({\n signal,\n }) => getSchema(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getSchema>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetId && datasetVersion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
|
package/dataset/dataset.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as DatasetPutBodyBody, bd as customInstance, b3 as DatasetPutPostResponse, be as ErrorType, b9 as DmError, V as DatasetPostBodyBody, j as GetDatasetsParams, aY as DatasetsGetResponse, h as GetVersionsParams, au as DatasetDetail, g as DeleteDatasetParams, a4 as TaskIdentity, b2 as DatasetDigestGetResponse, b0 as DatasetSchemaGetResponse } from '../custom-instance-da4fff1f.js';
|
|
2
2
|
import * as react_query from 'react-query';
|
|
3
3
|
import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
|
-
declare type
|
|
6
|
+
declare type AwaitedInput<T> = PromiseLike<T> | T;
|
|
7
|
+
declare type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
|
|
7
8
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
8
9
|
/**
|
|
9
10
|
* Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.
|
|
@@ -15,7 +16,7 @@ Behaves like the corresponding **POST** method except the file is expected to ex
|
|
|
15
16
|
* @summary Create a Dataset from a file in a Project
|
|
16
17
|
*/
|
|
17
18
|
declare const createDatasetFromFile: (datasetPutBodyBody: DatasetPutBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<DatasetPutPostResponse>;
|
|
18
|
-
declare type CreateDatasetFromFileMutationResult = NonNullable<
|
|
19
|
+
declare type CreateDatasetFromFileMutationResult = NonNullable<Awaited<ReturnType<typeof createDatasetFromFile>>>;
|
|
19
20
|
declare type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;
|
|
20
21
|
declare type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;
|
|
21
22
|
declare const useCreateDatasetFromFile: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
@@ -40,7 +41,7 @@ Datasets undergo some processing in an asynchronous `task` after control returns
|
|
|
40
41
|
* @summary Upload an external file as a Dataset
|
|
41
42
|
*/
|
|
42
43
|
declare const uploadDataset: (datasetPostBodyBody: DatasetPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<DatasetPutPostResponse>;
|
|
43
|
-
declare type UploadDatasetMutationResult = NonNullable<
|
|
44
|
+
declare type UploadDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof uploadDataset>>>;
|
|
44
45
|
declare type UploadDatasetMutationBody = DatasetPostBodyBody;
|
|
45
46
|
declare type UploadDatasetMutationError = ErrorType<void | DmError>;
|
|
46
47
|
declare const useUploadDataset: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
@@ -62,9 +63,9 @@ Note that if `editors` are combined with `owner username`, then the datasets wil
|
|
|
62
63
|
|
|
63
64
|
* @summary Get datasets that are available to you
|
|
64
65
|
*/
|
|
65
|
-
declare const getDatasets: (params?: GetDatasetsParams | undefined, options?: SecondParameter<typeof customInstance
|
|
66
|
+
declare const getDatasets: (params?: GetDatasetsParams | undefined, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<DatasetsGetResponse>;
|
|
66
67
|
declare const getGetDatasetsQueryKey: (params?: GetDatasetsParams | undefined) => (string | GetDatasetsParams)[];
|
|
67
|
-
declare type GetDatasetsQueryResult = NonNullable<
|
|
68
|
+
declare type GetDatasetsQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasets>>>;
|
|
68
69
|
declare type GetDatasetsQueryError = ErrorType<void | DmError>;
|
|
69
70
|
declare const useGetDatasets: <TData = DatasetsGetResponse, TError = ErrorType<void | DmError>>(params?: GetDatasetsParams | undefined, options?: {
|
|
70
71
|
query?: UseQueryOptions<DatasetsGetResponse, TError, TData, QueryKey> | undefined;
|
|
@@ -79,9 +80,9 @@ You will not see Datasets while their upload is still in progress.
|
|
|
79
80
|
|
|
80
81
|
* @summary Gets all the versions of a specific Dataset
|
|
81
82
|
*/
|
|
82
|
-
declare const getVersions: (datasetId: string, params?: GetVersionsParams | undefined, options?: SecondParameter<typeof customInstance
|
|
83
|
+
declare const getVersions: (datasetId: string, params?: GetVersionsParams | undefined, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<DatasetDetail>;
|
|
83
84
|
declare const getGetVersionsQueryKey: (datasetId: string, params?: GetVersionsParams | undefined) => (string | GetVersionsParams)[];
|
|
84
|
-
declare type GetVersionsQueryResult = NonNullable<
|
|
85
|
+
declare type GetVersionsQueryResult = NonNullable<Awaited<ReturnType<typeof getVersions>>>;
|
|
85
86
|
declare type GetVersionsQueryError = ErrorType<void | DmError>;
|
|
86
87
|
declare const useGetVersions: <TData = DatasetDetail, TError = ErrorType<void | DmError>>(datasetId: string, params?: GetVersionsParams | undefined, options?: {
|
|
87
88
|
query?: UseQueryOptions<DatasetDetail, TError, TData, QueryKey> | undefined;
|
|
@@ -99,7 +100,7 @@ You cannot delete a Dataset until its upload is complete.
|
|
|
99
100
|
* @summary Delete a dataset
|
|
100
101
|
*/
|
|
101
102
|
declare const deleteDataset: (datasetId: string, datasetVersion: number, params?: DeleteDatasetParams | undefined, options?: SecondParameter<typeof customInstance>) => Promise<TaskIdentity>;
|
|
102
|
-
declare type DeleteDatasetMutationResult = NonNullable<
|
|
103
|
+
declare type DeleteDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDataset>>>;
|
|
103
104
|
declare type DeleteDatasetMutationError = ErrorType<void | DmError>;
|
|
104
105
|
declare const useDeleteDataset: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
105
106
|
mutation?: UseMutationOptions<TaskIdentity, TError, {
|
|
@@ -120,9 +121,9 @@ You cannot get a Dataset until its upload is complete.
|
|
|
120
121
|
|
|
121
122
|
* @summary Download a dataset
|
|
122
123
|
*/
|
|
123
|
-
declare const downloadDataset: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance
|
|
124
|
+
declare const downloadDataset: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<void>;
|
|
124
125
|
declare const getDownloadDatasetQueryKey: (datasetId: string, datasetVersion: number) => string[];
|
|
125
|
-
declare type DownloadDatasetQueryResult = NonNullable<
|
|
126
|
+
declare type DownloadDatasetQueryResult = NonNullable<Awaited<ReturnType<typeof downloadDataset>>>;
|
|
126
127
|
declare type DownloadDatasetQueryError = ErrorType<DmError>;
|
|
127
128
|
declare const useDownloadDataset: <TData = void, TError = ErrorType<DmError>>(datasetId: string, datasetVersion: number, options?: {
|
|
128
129
|
query?: UseQueryOptions<void, TError, TData, QueryKey> | undefined;
|
|
@@ -140,7 +141,7 @@ You cannot modify Dataset editors until its upload is complete.
|
|
|
140
141
|
* @summary Remove a user's edit permission for a Dataset
|
|
141
142
|
*/
|
|
142
143
|
declare const removeEditorFromDataset: (datasetId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
143
|
-
declare type RemoveEditorFromDatasetMutationResult = NonNullable<
|
|
144
|
+
declare type RemoveEditorFromDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof removeEditorFromDataset>>>;
|
|
144
145
|
declare type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;
|
|
145
146
|
declare const useRemoveEditorFromDataset: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
146
147
|
mutation?: UseMutationOptions<void, TError, {
|
|
@@ -162,7 +163,7 @@ You cannot modify Dataset editors until its upload is complete.
|
|
|
162
163
|
* @summary Give a user edit permission for a dataset
|
|
163
164
|
*/
|
|
164
165
|
declare const addEditorToDataset: (datasetId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
165
|
-
declare type AddEditorToDatasetMutationResult = NonNullable<
|
|
166
|
+
declare type AddEditorToDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof addEditorToDataset>>>;
|
|
166
167
|
declare type AddEditorToDatasetMutationError = ErrorType<DmError>;
|
|
167
168
|
declare const useAddEditorToDataset: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
168
169
|
mutation?: UseMutationOptions<void, TError, {
|
|
@@ -179,9 +180,9 @@ declare const useAddEditorToDataset: <TError = ErrorType<DmError>, TContext = un
|
|
|
179
180
|
|
|
180
181
|
* @summary Gets the first Dataset that matches the provided digest
|
|
181
182
|
*/
|
|
182
|
-
declare const getDatasetDigest: (datasetDigest: string, options?: SecondParameter<typeof customInstance
|
|
183
|
+
declare const getDatasetDigest: (datasetDigest: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<DatasetDigestGetResponse>;
|
|
183
184
|
declare const getGetDatasetDigestQueryKey: (datasetDigest: string) => string[];
|
|
184
|
-
declare type GetDatasetDigestQueryResult = NonNullable<
|
|
185
|
+
declare type GetDatasetDigestQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasetDigest>>>;
|
|
185
186
|
declare type GetDatasetDigestQueryError = ErrorType<void | DmError>;
|
|
186
187
|
declare const useGetDatasetDigest: <TData = DatasetDigestGetResponse, TError = ErrorType<void | DmError>>(datasetDigest: string, options?: {
|
|
187
188
|
query?: UseQueryOptions<DatasetDigestGetResponse, TError, TData, QueryKey> | undefined;
|
|
@@ -194,9 +195,9 @@ declare const useGetDatasetDigest: <TData = DatasetDigestGetResponse, TError = E
|
|
|
194
195
|
|
|
195
196
|
* @summary Gets the property schema for a specific Dataset
|
|
196
197
|
*/
|
|
197
|
-
declare const getSchema: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance
|
|
198
|
+
declare const getSchema: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<DatasetSchemaGetResponse>;
|
|
198
199
|
declare const getGetSchemaQueryKey: (datasetId: string, datasetVersion: number) => string[];
|
|
199
|
-
declare type GetSchemaQueryResult = NonNullable<
|
|
200
|
+
declare type GetSchemaQueryResult = NonNullable<Awaited<ReturnType<typeof getSchema>>>;
|
|
200
201
|
declare type GetSchemaQueryError = ErrorType<void | DmError>;
|
|
201
202
|
declare const useGetSchema: <TData = DatasetSchemaGetResponse, TError = ErrorType<void | DmError>>(datasetId: string, datasetVersion: number, options?: {
|
|
202
203
|
query?: UseQueryOptions<DatasetSchemaGetResponse, TError, TData, QueryKey> | undefined;
|
|
@@ -205,4 +206,4 @@ declare const useGetSchema: <TData = DatasetSchemaGetResponse, TError = ErrorTyp
|
|
|
205
206
|
queryKey: QueryKey;
|
|
206
207
|
};
|
|
207
208
|
|
|
208
|
-
export { AddEditorToDatasetMutationError, AddEditorToDatasetMutationResult, CreateDatasetFromFileMutationBody, CreateDatasetFromFileMutationError, CreateDatasetFromFileMutationResult, DeleteDatasetMutationError, DeleteDatasetMutationResult, DownloadDatasetQueryError, DownloadDatasetQueryResult, GetDatasetDigestQueryError, GetDatasetDigestQueryResult, GetDatasetsQueryError, GetDatasetsQueryResult, GetSchemaQueryError, GetSchemaQueryResult, GetVersionsQueryError, GetVersionsQueryResult, RemoveEditorFromDatasetMutationError, RemoveEditorFromDatasetMutationResult, UploadDatasetMutationBody, UploadDatasetMutationError, UploadDatasetMutationResult, addEditorToDataset, createDatasetFromFile, deleteDataset, downloadDataset, getDatasetDigest, getDatasets, getDownloadDatasetQueryKey, getGetDatasetDigestQueryKey, getGetDatasetsQueryKey, getGetSchemaQueryKey, getGetVersionsQueryKey, getSchema, getVersions, removeEditorFromDataset, uploadDataset, useAddEditorToDataset, useCreateDatasetFromFile, useDeleteDataset, useDownloadDataset, useGetDatasetDigest, useGetDatasets, useGetSchema, useGetVersions, useRemoveEditorFromDataset, useUploadDataset };
|
|
209
|
+
export { AddEditorToDatasetMutationError, AddEditorToDatasetMutationResult, Awaited, AwaitedInput, CreateDatasetFromFileMutationBody, CreateDatasetFromFileMutationError, CreateDatasetFromFileMutationResult, DeleteDatasetMutationError, DeleteDatasetMutationResult, DownloadDatasetQueryError, DownloadDatasetQueryResult, GetDatasetDigestQueryError, GetDatasetDigestQueryResult, GetDatasetsQueryError, GetDatasetsQueryResult, GetSchemaQueryError, GetSchemaQueryResult, GetVersionsQueryError, GetVersionsQueryResult, RemoveEditorFromDatasetMutationError, RemoveEditorFromDatasetMutationResult, UploadDatasetMutationBody, UploadDatasetMutationError, UploadDatasetMutationResult, addEditorToDataset, createDatasetFromFile, deleteDataset, downloadDataset, getDatasetDigest, getDatasets, getDownloadDatasetQueryKey, getGetDatasetDigestQueryKey, getGetDatasetsQueryKey, getGetSchemaQueryKey, getGetVersionsQueryKey, getSchema, getVersions, removeEditorFromDataset, uploadDataset, useAddEditorToDataset, useCreateDatasetFromFile, useDeleteDataset, useDownloadDataset, useGetDatasetDigest, useGetDatasets, useGetSchema, useGetVersions, useRemoveEditorFromDataset, useUploadDataset };
|
package/dataset/dataset.js
CHANGED
|
@@ -37,9 +37,9 @@ var createDatasetFromFile = (datasetPutBodyBody, options) => {
|
|
|
37
37
|
}, options);
|
|
38
38
|
};
|
|
39
39
|
var useCreateDatasetFromFile = (options) => {
|
|
40
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
40
|
+
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
41
41
|
const mutationFn = (props) => {
|
|
42
|
-
const { data } = props
|
|
42
|
+
const { data } = props ?? {};
|
|
43
43
|
return createDatasetFromFile(data, requestOptions);
|
|
44
44
|
};
|
|
45
45
|
return useMutation(mutationFn, mutationOptions);
|
|
@@ -70,37 +70,41 @@ var uploadDataset = (datasetPostBodyBody, options) => {
|
|
|
70
70
|
}, options);
|
|
71
71
|
};
|
|
72
72
|
var useUploadDataset = (options) => {
|
|
73
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
73
|
+
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
74
74
|
const mutationFn = (props) => {
|
|
75
|
-
const { data } = props
|
|
75
|
+
const { data } = props ?? {};
|
|
76
76
|
return uploadDataset(data, requestOptions);
|
|
77
77
|
};
|
|
78
78
|
return useMutation(mutationFn, mutationOptions);
|
|
79
79
|
};
|
|
80
|
-
var getDatasets = (params, options) => {
|
|
81
|
-
return customInstance({ url: `/dataset`, method: "get", params }, options);
|
|
80
|
+
var getDatasets = (params, options, signal) => {
|
|
81
|
+
return customInstance({ url: `/dataset`, method: "get", signal, params }, options);
|
|
82
82
|
};
|
|
83
83
|
var getGetDatasetsQueryKey = (params) => [
|
|
84
84
|
`/dataset`,
|
|
85
85
|
...params ? [params] : []
|
|
86
86
|
];
|
|
87
87
|
var useGetDatasets = (params, options) => {
|
|
88
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
88
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
89
89
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetDatasetsQueryKey(params);
|
|
90
|
-
const queryFn = (
|
|
90
|
+
const queryFn = ({
|
|
91
|
+
signal
|
|
92
|
+
}) => getDatasets(params, requestOptions, signal);
|
|
91
93
|
const query = useQuery(queryKey, queryFn, queryOptions);
|
|
92
94
|
return __spreadValues({
|
|
93
95
|
queryKey
|
|
94
96
|
}, query);
|
|
95
97
|
};
|
|
96
|
-
var getVersions = (datasetId, params, options) => {
|
|
97
|
-
return customInstance({ url: `/dataset/${datasetId}/versions`, method: "get", params }, options);
|
|
98
|
+
var getVersions = (datasetId, params, options, signal) => {
|
|
99
|
+
return customInstance({ url: `/dataset/${datasetId}/versions`, method: "get", signal, params }, options);
|
|
98
100
|
};
|
|
99
101
|
var getGetVersionsQueryKey = (datasetId, params) => [`/dataset/${datasetId}/versions`, ...params ? [params] : []];
|
|
100
102
|
var useGetVersions = (datasetId, params, options) => {
|
|
101
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
103
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
102
104
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetVersionsQueryKey(datasetId, params);
|
|
103
|
-
const queryFn = (
|
|
105
|
+
const queryFn = ({
|
|
106
|
+
signal
|
|
107
|
+
}) => getVersions(datasetId, params, requestOptions, signal);
|
|
104
108
|
const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!datasetId }, queryOptions));
|
|
105
109
|
return __spreadValues({
|
|
106
110
|
queryKey
|
|
@@ -114,21 +118,23 @@ var deleteDataset = (datasetId, datasetVersion, params, options) => {
|
|
|
114
118
|
}, options);
|
|
115
119
|
};
|
|
116
120
|
var useDeleteDataset = (options) => {
|
|
117
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
121
|
+
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
118
122
|
const mutationFn = (props) => {
|
|
119
|
-
const { datasetId, datasetVersion, params } = props
|
|
123
|
+
const { datasetId, datasetVersion, params } = props ?? {};
|
|
120
124
|
return deleteDataset(datasetId, datasetVersion, params, requestOptions);
|
|
121
125
|
};
|
|
122
126
|
return useMutation(mutationFn, mutationOptions);
|
|
123
127
|
};
|
|
124
|
-
var downloadDataset = (datasetId, datasetVersion, options) => {
|
|
125
|
-
return customInstance({ url: `/dataset/${datasetId}/${datasetVersion}`, method: "get" }, options);
|
|
128
|
+
var downloadDataset = (datasetId, datasetVersion, options, signal) => {
|
|
129
|
+
return customInstance({ url: `/dataset/${datasetId}/${datasetVersion}`, method: "get", signal }, options);
|
|
126
130
|
};
|
|
127
131
|
var getDownloadDatasetQueryKey = (datasetId, datasetVersion) => [`/dataset/${datasetId}/${datasetVersion}`];
|
|
128
132
|
var useDownloadDataset = (datasetId, datasetVersion, options) => {
|
|
129
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
133
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
130
134
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getDownloadDatasetQueryKey(datasetId, datasetVersion);
|
|
131
|
-
const queryFn = (
|
|
135
|
+
const queryFn = ({
|
|
136
|
+
signal
|
|
137
|
+
}) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);
|
|
132
138
|
const query = useQuery(queryKey, queryFn, __spreadValues({
|
|
133
139
|
enabled: !!(datasetId && datasetVersion)
|
|
134
140
|
}, queryOptions));
|
|
@@ -140,9 +146,9 @@ var removeEditorFromDataset = (datasetId, userId, options) => {
|
|
|
140
146
|
return customInstance({ url: `/dataset/${datasetId}/editor/${userId}`, method: "delete" }, options);
|
|
141
147
|
};
|
|
142
148
|
var useRemoveEditorFromDataset = (options) => {
|
|
143
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
149
|
+
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
144
150
|
const mutationFn = (props) => {
|
|
145
|
-
const { datasetId, userId } = props
|
|
151
|
+
const { datasetId, userId } = props ?? {};
|
|
146
152
|
return removeEditorFromDataset(datasetId, userId, requestOptions);
|
|
147
153
|
};
|
|
148
154
|
return useMutation(mutationFn, mutationOptions);
|
|
@@ -151,36 +157,42 @@ var addEditorToDataset = (datasetId, userId, options) => {
|
|
|
151
157
|
return customInstance({ url: `/dataset/${datasetId}/editor/${userId}`, method: "put" }, options);
|
|
152
158
|
};
|
|
153
159
|
var useAddEditorToDataset = (options) => {
|
|
154
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
160
|
+
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
155
161
|
const mutationFn = (props) => {
|
|
156
|
-
const { datasetId, userId } = props
|
|
162
|
+
const { datasetId, userId } = props ?? {};
|
|
157
163
|
return addEditorToDataset(datasetId, userId, requestOptions);
|
|
158
164
|
};
|
|
159
165
|
return useMutation(mutationFn, mutationOptions);
|
|
160
166
|
};
|
|
161
|
-
var getDatasetDigest = (datasetDigest, options) => {
|
|
162
|
-
return customInstance({ url: `/dataset/digest/${datasetDigest}`, method: "get" }, options);
|
|
167
|
+
var getDatasetDigest = (datasetDigest, options, signal) => {
|
|
168
|
+
return customInstance({ url: `/dataset/digest/${datasetDigest}`, method: "get", signal }, options);
|
|
163
169
|
};
|
|
164
170
|
var getGetDatasetDigestQueryKey = (datasetDigest) => [
|
|
165
171
|
`/dataset/digest/${datasetDigest}`
|
|
166
172
|
];
|
|
167
173
|
var useGetDatasetDigest = (datasetDigest, options) => {
|
|
168
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
174
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
169
175
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetDatasetDigestQueryKey(datasetDigest);
|
|
170
|
-
const queryFn = () => getDatasetDigest(datasetDigest, requestOptions);
|
|
176
|
+
const queryFn = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);
|
|
171
177
|
const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!datasetDigest }, queryOptions));
|
|
172
178
|
return __spreadValues({
|
|
173
179
|
queryKey
|
|
174
180
|
}, query);
|
|
175
181
|
};
|
|
176
|
-
var getSchema = (datasetId, datasetVersion, options) => {
|
|
177
|
-
return customInstance({
|
|
182
|
+
var getSchema = (datasetId, datasetVersion, options, signal) => {
|
|
183
|
+
return customInstance({
|
|
184
|
+
url: `/dataset/${datasetId}/schema/${datasetVersion}`,
|
|
185
|
+
method: "get",
|
|
186
|
+
signal
|
|
187
|
+
}, options);
|
|
178
188
|
};
|
|
179
189
|
var getGetSchemaQueryKey = (datasetId, datasetVersion) => [`/dataset/${datasetId}/schema/${datasetVersion}`];
|
|
180
190
|
var useGetSchema = (datasetId, datasetVersion, options) => {
|
|
181
|
-
const { query: queryOptions, request: requestOptions } = options
|
|
191
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
182
192
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetSchemaQueryKey(datasetId, datasetVersion);
|
|
183
|
-
const queryFn = (
|
|
193
|
+
const queryFn = ({
|
|
194
|
+
signal
|
|
195
|
+
}) => getSchema(datasetId, datasetVersion, requestOptions, signal);
|
|
184
196
|
const query = useQuery(queryKey, queryFn, __spreadValues({ enabled: !!(datasetId && datasetVersion) }, queryOptions));
|
|
185
197
|
return __spreadValues({
|
|
186
198
|
queryKey
|