@squonk/data-manager-client 1.0.0-rc.4 → 1.0.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounting/accounting.d.ts +1 -1
- package/admin/admin.cjs +19 -1
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +23 -6
- package/admin/admin.js +18 -0
- package/admin/admin.js.map +1 -1
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +3 -3
- package/application/application.js.map +1 -1
- package/{custom-instance-f73fb7dc.d.ts → custom-instance-3a73945d.d.ts} +49 -12
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +5 -5
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +1 -1
- package/file/file.d.ts +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +5 -5
- package/instance/instance.js.map +1 -1
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +3 -3
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +3 -3
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +13 -13
- package/project/project.js.map +1 -1
- package/src/admin/admin.ts +61 -4
- package/src/application/application.ts +2 -2
- package/src/data-manager-api.schemas.ts +52 -13
- package/src/dataset/dataset.ts +4 -4
- package/src/instance/instance.ts +4 -4
- package/src/job/job.ts +2 -2
- package/src/metadata/metadata.ts +2 -2
- package/src/project/project.ts +12 -12
- package/src/task/task.ts +2 -2
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +3 -3
- package/task/task.js.map +1 -1
- package/type/type.d.ts +1 -1
- package/user/user.d.ts +1 -1
package/src/admin/admin.ts
CHANGED
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
AdminGetServiceErrorsParams,
|
|
24
24
|
AdminUserPutResponse,
|
|
25
25
|
UserPatchBodyBody,
|
|
26
|
+
AdminJobManifestGetResponse,
|
|
26
27
|
AdminJobManifestLoadPutResponse,
|
|
27
28
|
JobManifestPutBodyBody,
|
|
28
29
|
JobManifestLoadPutBodyBody,
|
|
@@ -378,13 +379,69 @@ export const useAdminPatchUser = <
|
|
|
378
379
|
>(mutationFn, mutationOptions);
|
|
379
380
|
};
|
|
380
381
|
/**
|
|
381
|
-
*
|
|
382
|
+
* Returns the list of known **Job Manifests** including the time the manifest was last loaded and its load status, a message indicating success or failure.
|
|
383
|
+
|
|
384
|
+
You will need **admin** rights to use this endpoint
|
|
385
|
+
|
|
386
|
+
* @summary Get Job Manifests
|
|
387
|
+
*/
|
|
388
|
+
export const adminGetJobManifests = (
|
|
389
|
+
options?: SecondParameter<typeof customInstance>,
|
|
390
|
+
signal?: AbortSignal
|
|
391
|
+
) => {
|
|
392
|
+
return customInstance<AdminJobManifestGetResponse>(
|
|
393
|
+
{ url: `/admin/job-manifest`, method: "get", signal },
|
|
394
|
+
options
|
|
395
|
+
);
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
export const getAdminGetJobManifestsQueryKey = () => [`/admin/job-manifest`];
|
|
399
|
+
|
|
400
|
+
export type AdminGetJobManifestsQueryResult = NonNullable<
|
|
401
|
+
Awaited<ReturnType<typeof adminGetJobManifests>>
|
|
402
|
+
>;
|
|
403
|
+
export type AdminGetJobManifestsQueryError = ErrorType<void | DmError>;
|
|
404
|
+
|
|
405
|
+
export const useAdminGetJobManifests = <
|
|
406
|
+
TData = Awaited<ReturnType<typeof adminGetJobManifests>>,
|
|
407
|
+
TError = ErrorType<void | DmError>
|
|
408
|
+
>(options?: {
|
|
409
|
+
query?: UseQueryOptions<
|
|
410
|
+
Awaited<ReturnType<typeof adminGetJobManifests>>,
|
|
411
|
+
TError,
|
|
412
|
+
TData
|
|
413
|
+
>;
|
|
414
|
+
request?: SecondParameter<typeof customInstance>;
|
|
415
|
+
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
416
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
417
|
+
|
|
418
|
+
const queryKey = queryOptions?.queryKey ?? getAdminGetJobManifestsQueryKey();
|
|
419
|
+
|
|
420
|
+
const queryFn: QueryFunction<
|
|
421
|
+
Awaited<ReturnType<typeof adminGetJobManifests>>
|
|
422
|
+
> = ({ signal }) => adminGetJobManifests(requestOptions, signal);
|
|
423
|
+
|
|
424
|
+
const query = useQuery<
|
|
425
|
+
Awaited<ReturnType<typeof adminGetJobManifests>>,
|
|
426
|
+
TError,
|
|
427
|
+
TData
|
|
428
|
+
>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
|
|
429
|
+
queryKey: QueryKey;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
query.queryKey = queryKey;
|
|
433
|
+
|
|
434
|
+
return query;
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* This endpoint is used to add (or update an existing **Job Manifest**). Manifests are the source of Job definitions. Once added the manifest is inspected and any Jobs it refers to are loaded.
|
|
382
439
|
|
|
383
440
|
A limited number of manifest origins (URLs) are supported. At the moment we support basic GitHib and GitLab URLs, i.e. those that begin `https://raw.githubusercontent.com/` and `https://gitlab.com/api/v4/projects/`.
|
|
384
441
|
|
|
385
442
|
You will need **admin** rights to use this endpoint
|
|
386
443
|
|
|
387
|
-
* @summary Adds a
|
|
444
|
+
* @summary Adds a Job Manifest and triggers the download of its Job Definitions
|
|
388
445
|
*/
|
|
389
446
|
export const adminJobManifestPut = (
|
|
390
447
|
jobManifestPutBodyBody: JobManifestPutBodyBody,
|
|
@@ -447,11 +504,11 @@ export const useAdminJobManifestPut = <
|
|
|
447
504
|
>(mutationFn, mutationOptions);
|
|
448
505
|
};
|
|
449
506
|
/**
|
|
450
|
-
* This endpoint is used to trigger the Data Manager to re-inspect the internal Job
|
|
507
|
+
* This endpoint is used to trigger the Data Manager to re-inspect the internal **Job Manifest** table and download the manifests and reprocess the related job definitions. This is normally done by an administrator when the Manifest table has been modified or if external job definitions are known to have changed in the referenced repositories.
|
|
451
508
|
|
|
452
509
|
You will need **admin** rights to use this endpoint
|
|
453
510
|
|
|
454
|
-
* @summary Trigger a download of
|
|
511
|
+
* @summary Trigger a download of Job Definitions using existing Job Manifests
|
|
455
512
|
*/
|
|
456
513
|
export const adminJobManifestLoad = (
|
|
457
514
|
jobManifestLoadPutBodyBody: JobManifestLoadPutBodyBody,
|
|
@@ -88,9 +88,9 @@ export const useGetApplications = <
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
* Get details of a specific
|
|
91
|
+
* Get details of a specific Application available to you that can be instantiated.
|
|
92
92
|
|
|
93
|
-
* @summary Get details of a specific
|
|
93
|
+
* @summary Get details of a specific Application
|
|
94
94
|
*/
|
|
95
95
|
export const getApplication = (
|
|
96
96
|
applicationId: string,
|
|
@@ -54,6 +54,18 @@ export type GetTasksParams = {
|
|
|
54
54
|
project_id?: QProjectIdParameter;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* A project path. If provided it must begin `/` and refers to a path where `/` represents the project's root directory
|
|
59
|
+
|
|
60
|
+
*/
|
|
61
|
+
export type QFilePathParameter = string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A project file.
|
|
65
|
+
|
|
66
|
+
*/
|
|
67
|
+
export type QFileParameter = string;
|
|
68
|
+
|
|
57
69
|
export type DeleteUnmanagedFileParams = {
|
|
58
70
|
file: QFileParameter;
|
|
59
71
|
path?: QFilePathParameter;
|
|
@@ -200,18 +212,6 @@ export type QFromParameter = string;
|
|
|
200
212
|
*/
|
|
201
213
|
export type QFileProjectIdParameter = string;
|
|
202
214
|
|
|
203
|
-
/**
|
|
204
|
-
* A project path. If provided it must begin `/` and refers to a path where `/` represents the project's root directory
|
|
205
|
-
|
|
206
|
-
*/
|
|
207
|
-
export type QFilePathParameter = string;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* A project file.
|
|
211
|
-
|
|
212
|
-
*/
|
|
213
|
-
export type QFileParameter = string;
|
|
214
|
-
|
|
215
215
|
/**
|
|
216
216
|
* Set to a dot-separated string of purpose enumerations, i.e. `INSTANCE`, `FILE` or `DATASET`. To exclude file and dataset tasks set to `FILE.DATASET`
|
|
217
217
|
|
|
@@ -335,7 +335,9 @@ Jobs in the collection `im-test` are not removed */
|
|
|
335
335
|
|
|
336
336
|
export type InstancePostBodyBody = {
|
|
337
337
|
/** A supported application. Applications instances are managed using pre-deployed Kubernetes **Operators**. The application ID is a combination of the operator _plural_ and _group_.
|
|
338
|
-
|
|
338
|
+
|
|
339
|
+
Application IDs currently supported include ``datamanagerjobs.squonk.it`` and ``jupyternotebooks.squonk.it``
|
|
340
|
+
*/
|
|
339
341
|
application_id: string;
|
|
340
342
|
/** A supported application version to launch.
|
|
341
343
|
|
|
@@ -375,6 +377,8 @@ When launching a Data Manager **Job** Application you must identify the Job usin
|
|
|
375
377
|
Jobs that offer commands will often advertise a series of **inputs** and **options** where the values can be provided using a **variables** map in the specification. Something like `"variables":{"x":7}`.
|
|
376
378
|
|
|
377
379
|
Jobs start in a Job-specific **working directory** but the starting directory for any Job can be adjusted by defining a `sub_path` to the root specification. For example, if you want the Job to start in the path `foo/bar` (inside the Job's built-in working directory) you can add `"sub_path":"foo/bar"` to the specification. You can only use a sub-path for a Job if the Job defines a working directory and `sub-path` cannot begin or end with a path separator (`/`).
|
|
380
|
+
|
|
381
|
+
Applications also support `variables`. The Jupyter notebook application supports the definition of the notebook image (i.e. `"image:":"tensorflow"`), `"cpu"` and `"memory"`. A full Jupyter notebook specification might look like `{"variables":{"image":"tensorflow","cpu":2,"memory":"4Gi"}}`. `memory` is limited to `Gi` as a suffix.
|
|
378
382
|
*/
|
|
379
383
|
specification?: string;
|
|
380
384
|
};
|
|
@@ -814,6 +818,35 @@ export interface JobSummary {
|
|
|
814
818
|
doc_url?: string;
|
|
815
819
|
}
|
|
816
820
|
|
|
821
|
+
export interface JobManifestDetail {
|
|
822
|
+
/** The Job Manifest record ID */
|
|
823
|
+
id: number;
|
|
824
|
+
url: string;
|
|
825
|
+
header?: string;
|
|
826
|
+
params?: string;
|
|
827
|
+
/** The Date (and time) the manifest was created
|
|
828
|
+
*/
|
|
829
|
+
created: string;
|
|
830
|
+
/** The (admin) user who created the manifest
|
|
831
|
+
*/
|
|
832
|
+
creator?: string;
|
|
833
|
+
/** The number of job definition files loaded during the most recent successful load
|
|
834
|
+
*/
|
|
835
|
+
job_definition_files_loaded?: number;
|
|
836
|
+
/** The number of job definitions loaded during the most recent successful load
|
|
837
|
+
*/
|
|
838
|
+
job_definitions_loaded?: number;
|
|
839
|
+
/** The Date (and time) the manifest was last loaded successfully
|
|
840
|
+
*/
|
|
841
|
+
last_successful_load_time?: string;
|
|
842
|
+
/** The Date (and time) the manifest was last loaded, successfully or otherwise. If the manifest (or any of the Job definition files it refers to) fails to load the `load_status` should provide some diagnostic feedback
|
|
843
|
+
*/
|
|
844
|
+
last_load_time?: string;
|
|
845
|
+
/** The status of the time the manifest was last loaded. If the load was successful this will be `SUCCESS` and `last_successful_load` will be the same as `last_load`
|
|
846
|
+
*/
|
|
847
|
+
last_load_status: string;
|
|
848
|
+
}
|
|
849
|
+
|
|
817
850
|
export interface JobApplication {
|
|
818
851
|
/** The Job's operator ID */
|
|
819
852
|
id: string;
|
|
@@ -1717,6 +1750,12 @@ export interface AdminJobManifestLoadPutResponse {
|
|
|
1717
1750
|
jobs_purged?: number;
|
|
1718
1751
|
}
|
|
1719
1752
|
|
|
1753
|
+
export interface AdminJobManifestGetResponse {
|
|
1754
|
+
/** The list of known Job manifests
|
|
1755
|
+
*/
|
|
1756
|
+
job_manifests: JobManifestDetail[];
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1720
1759
|
export interface AccountServerGetNamespaceResponse {
|
|
1721
1760
|
/** The configured Account Server namespace, which will be an empty string if one is not configured. The AS API is expected as the service `as-api` in this namespace.
|
|
1722
1761
|
*/
|
package/src/dataset/dataset.ts
CHANGED
|
@@ -222,7 +222,7 @@ Datasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `
|
|
|
222
222
|
|
|
223
223
|
Note 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.
|
|
224
224
|
|
|
225
|
-
* @summary Get
|
|
225
|
+
* @summary Get Datasets that are available to you
|
|
226
226
|
*/
|
|
227
227
|
export const getDatasets = (
|
|
228
228
|
params?: GetDatasetsParams,
|
|
@@ -354,7 +354,7 @@ You must be an `editor` or `owner` of the Dataset.
|
|
|
354
354
|
|
|
355
355
|
You cannot delete a Dataset until its upload is complete.
|
|
356
356
|
|
|
357
|
-
* @summary Delete a
|
|
357
|
+
* @summary Delete a Dataset
|
|
358
358
|
*/
|
|
359
359
|
export const deleteDataset = (
|
|
360
360
|
datasetId: string,
|
|
@@ -413,7 +413,7 @@ export const useDeleteDataset = <
|
|
|
413
413
|
|
|
414
414
|
You cannot get a Dataset until its upload is complete.
|
|
415
415
|
|
|
416
|
-
* @summary Download a
|
|
416
|
+
* @summary Download a Dataset
|
|
417
417
|
*/
|
|
418
418
|
export const downloadDataset = (
|
|
419
419
|
datasetId: string,
|
|
@@ -539,7 +539,7 @@ You must be an `editor` or `owner` of the dataset.
|
|
|
539
539
|
|
|
540
540
|
You cannot modify Dataset editors until its upload is complete.
|
|
541
541
|
|
|
542
|
-
* @summary Give a user edit permission for a
|
|
542
|
+
* @summary Give a user edit permission for a Dataset
|
|
543
543
|
*/
|
|
544
544
|
export const addEditorToDataset = (
|
|
545
545
|
datasetId: string,
|
package/src/instance/instance.ts
CHANGED
|
@@ -47,7 +47,7 @@ An Application instance is not Ready for use until the corresponding **TaskState
|
|
|
47
47
|
|
|
48
48
|
A Job instance typically runs to completion, reaching the **TaskState** `SUCCESS` when successful and `FAILURE` is unsuccessful.
|
|
49
49
|
|
|
50
|
-
* @summary Creates a new
|
|
50
|
+
* @summary Creates a new Job or Application instance
|
|
51
51
|
*/
|
|
52
52
|
export const createInstance = (
|
|
53
53
|
instancePostBodyBody: InstancePostBodyBody,
|
|
@@ -132,7 +132,7 @@ export const useCreateInstance = <
|
|
|
132
132
|
/**
|
|
133
133
|
* Returns a summary of all running instances. Instances can be running as an Application or as a Job. The response will contain an `application_type` field that is either `job` or `application`
|
|
134
134
|
|
|
135
|
-
* @summary Get summary information about all
|
|
135
|
+
* @summary Get summary information about all Job and Application instances
|
|
136
136
|
*/
|
|
137
137
|
export const getInstances = (
|
|
138
138
|
params?: GetInstancesParams,
|
|
@@ -256,7 +256,7 @@ export const useGetInstance = <
|
|
|
256
256
|
|
|
257
257
|
You must be the `owner` or an `editor` of the instance to delete it
|
|
258
258
|
|
|
259
|
-
* @summary Delete
|
|
259
|
+
* @summary Delete a Job or Application instance
|
|
260
260
|
*/
|
|
261
261
|
export const terminateInstance = (
|
|
262
262
|
instanceId: string,
|
|
@@ -309,7 +309,7 @@ export const useTerminateInstance = <
|
|
|
309
309
|
|
|
310
310
|
You must be the `owner` or an `editor` of the instance to patch it
|
|
311
311
|
|
|
312
|
-
* @summary Update
|
|
312
|
+
* @summary Update a Job or Application instance
|
|
313
313
|
*/
|
|
314
314
|
export const patchInstance = (
|
|
315
315
|
instanceId: string,
|
package/src/job/job.ts
CHANGED
|
@@ -83,9 +83,9 @@ export const useGetJobs = <
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* Gets a Job based on
|
|
86
|
+
* Gets a Job based on its **collection**, **job** and **version**.
|
|
87
87
|
|
|
88
|
-
Job availability will vary as Jobs are added to the cluster.
|
|
88
|
+
Job availability will vary as Jobs are added to the cluster. Jobs that have been added are unlikely to be removed.
|
|
89
89
|
|
|
90
90
|
* @summary Get a Job by its version
|
|
91
91
|
*/
|
package/src/metadata/metadata.ts
CHANGED
|
@@ -122,7 +122,7 @@ export const useAddMetadataVersion = <
|
|
|
122
122
|
/**
|
|
123
123
|
* Returns the metadata for a Dataset version in JSON format.
|
|
124
124
|
|
|
125
|
-
* @summary Gets the
|
|
125
|
+
* @summary Gets the Metadata for a specific Dataset version
|
|
126
126
|
*/
|
|
127
127
|
export const getMetadataVersion = (
|
|
128
128
|
datasetId: string,
|
|
@@ -260,7 +260,7 @@ export const useAddMetadata = <
|
|
|
260
260
|
/**
|
|
261
261
|
* Returns the metadata for a Dataset in JSON format.
|
|
262
262
|
|
|
263
|
-
* @summary Gets the
|
|
263
|
+
* @summary Gets the Metadata for a specific Dataset
|
|
264
264
|
*/
|
|
265
265
|
export const getMetadata = (
|
|
266
266
|
datasetId: string,
|
package/src/project/project.ts
CHANGED
|
@@ -41,9 +41,9 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
41
41
|
: never;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Get a list of all
|
|
44
|
+
* Get a list of all Projects available to you.
|
|
45
45
|
|
|
46
|
-
* @summary Get all
|
|
46
|
+
* @summary Get all Pojects available to you
|
|
47
47
|
*/
|
|
48
48
|
export const getProjects = (
|
|
49
49
|
options?: SecondParameter<typeof customInstance>,
|
|
@@ -95,7 +95,7 @@ export const useGetProjects = <
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
* Creates a new
|
|
98
|
+
* Creates a new Project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.
|
|
99
99
|
|
|
100
100
|
To create a Project you will need an uncommitted Project product.
|
|
101
101
|
|
|
@@ -103,7 +103,7 @@ As the project `owner` (creator) you are also automatically an `editor` of the p
|
|
|
103
103
|
|
|
104
104
|
The 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.
|
|
105
105
|
|
|
106
|
-
* @summary Create a new
|
|
106
|
+
* @summary Create a new Project
|
|
107
107
|
*/
|
|
108
108
|
export const createProject = (
|
|
109
109
|
projectPostBodyBody: ProjectPostBodyBody,
|
|
@@ -166,7 +166,7 @@ export const useCreateProject = <
|
|
|
166
166
|
/**
|
|
167
167
|
* Gets the details of a project that is available to you.
|
|
168
168
|
|
|
169
|
-
* @summary Get a
|
|
169
|
+
* @summary Get a Project
|
|
170
170
|
*/
|
|
171
171
|
export const getProject = (
|
|
172
172
|
projectId: string,
|
|
@@ -222,9 +222,9 @@ export const useGetProject = <
|
|
|
222
222
|
};
|
|
223
223
|
|
|
224
224
|
/**
|
|
225
|
-
* Used to update some adjustable parameters of a
|
|
225
|
+
* 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
|
|
226
226
|
|
|
227
|
-
* @summary Adjust an existing
|
|
227
|
+
* @summary Adjust an existing Project
|
|
228
228
|
*/
|
|
229
229
|
export const patchProject = (
|
|
230
230
|
projectId: string,
|
|
@@ -293,7 +293,7 @@ You must be an `editor` or the `owner` of the project.
|
|
|
293
293
|
|
|
294
294
|
Once deleted all **Files**, working directories and material in the project will also be removed
|
|
295
295
|
|
|
296
|
-
* @summary Delete a
|
|
296
|
+
* @summary Delete a Project
|
|
297
297
|
*/
|
|
298
298
|
export const deleteProject = (
|
|
299
299
|
projectId: string,
|
|
@@ -348,7 +348,7 @@ An `editor` of a project is not automatically an `editor` of any datasets the pr
|
|
|
348
348
|
|
|
349
349
|
You must be an `editor` or the `owner` of the project
|
|
350
350
|
|
|
351
|
-
* @summary Add a
|
|
351
|
+
* @summary Add a Project Editor
|
|
352
352
|
*/
|
|
353
353
|
export const addEditorToProject = (
|
|
354
354
|
projectId: string,
|
|
@@ -404,7 +404,7 @@ A project must always have one `editor` so you will not be able to delete the la
|
|
|
404
404
|
|
|
405
405
|
You must be an `editor` or the `owner` of the project
|
|
406
406
|
|
|
407
|
-
* @summary Delete a
|
|
407
|
+
* @summary Delete a Project Editor
|
|
408
408
|
*/
|
|
409
409
|
export const removeEditorFromProject = (
|
|
410
410
|
projectId: string,
|
|
@@ -460,7 +460,7 @@ For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
|
460
460
|
|
|
461
461
|
You must be an `editor` or the `owner` of the project if the project is private
|
|
462
462
|
|
|
463
|
-
* @summary Download a
|
|
463
|
+
* @summary Download a Project file
|
|
464
464
|
*/
|
|
465
465
|
export const getProjectFile = (
|
|
466
466
|
projectId: string,
|
|
@@ -597,7 +597,7 @@ For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
|
597
597
|
|
|
598
598
|
As there is no security You must provide a valid token. The token must be a token valid for the project, usually generated when an Instance has been launched in the Project. If the token is not valid ou will receive a `403` error
|
|
599
599
|
|
|
600
|
-
* @summary Download a
|
|
600
|
+
* @summary Download a Project file using a Token
|
|
601
601
|
*/
|
|
602
602
|
export const getProjectFileWithToken = (
|
|
603
603
|
projectId: string,
|
package/src/task/task.ts
CHANGED
|
@@ -38,7 +38,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
38
38
|
/**
|
|
39
39
|
* Returns a list of tasks that you have access to. These will be Tasks that you **own**. Being an editor of the related object does not allow you to see its task.
|
|
40
40
|
|
|
41
|
-
* @summary Returns a list of
|
|
41
|
+
* @summary Returns a list of Tasks
|
|
42
42
|
*/
|
|
43
43
|
export const getTasks = (
|
|
44
44
|
params?: GetTasksParams,
|
|
@@ -113,7 +113,7 @@ For **Dataset** tasks, where the task `purpose` is `DATASET`, you must wait unti
|
|
|
113
113
|
|
|
114
114
|
For Application **Instance** tasks, where the task `purpose` is `INSTANCE`, you must wait until you find the `STARTED` state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.
|
|
115
115
|
|
|
116
|
-
* @summary Returns
|
|
116
|
+
* @summary Returns Task information
|
|
117
117
|
*/
|
|
118
118
|
export const getTask = (
|
|
119
119
|
taskId: string,
|
package/task/task.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/task/task.ts"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,QAAM,WAAW;AAEjB,SAAO;AACT;AAWO,IAAM,aAAa,CACxB,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;AAQO,IAAM,gBAAgB,CAG3B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.9.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: 1.0\n */\nimport { useQuery, useMutation } from \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n TasksGetResponse,\n DmError,\n GetTasksParams,\n TaskGetResponse,\n GetTaskParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a list of tasks that you have access to. These will be Tasks that you **own**. Being an editor of the related object does not allow you to see its task.\n\n * @summary Returns a list of
|
|
1
|
+
{"version":3,"sources":["../../src/task/task.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAgC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO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AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.9.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: 1.0\n */\nimport { useQuery, useMutation } from \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n TasksGetResponse,\n DmError,\n GetTasksParams,\n TaskGetResponse,\n GetTaskParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a list of tasks that you have access to. These will be Tasks that you **own**. Being an editor of the related object does not allow you to see its task.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TasksGetResponse>(\n { url: `/task`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTasksQueryKey = (params?: GetTasksParams) => [\n `/task`,\n ...(params ? [params] : []),\n];\n\nexport type GetTasksQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTasks>>\n>;\nexport type GetTasksQueryError = ErrorType<void | DmError>;\n\nexport const useGetTasks = <\n TData = Awaited<ReturnType<typeof getTasks>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetTasksParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getTasks>>,\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 ?? getGetTasksQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({\n signal,\n }) => getTasks(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getTasks>>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you are its **owner**. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating datasets and launching applications.\n\nTasks contain of a list of `states` and `events`. A task will always have states but may not have events.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 100 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect a it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The dataset is available when the task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the task is `done` but you have a non-zero `exit_code`, the dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** tasks, where the task `purpose` is `INSTANCE`, you must wait until you find the `STARTED` state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TaskGetResponse>(\n { url: `/task/${taskId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTaskQueryKey = (taskId: string, params?: GetTaskParams) => [\n `/task/${taskId}`,\n ...(params ? [params] : []),\n];\n\nexport type GetTaskQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTask>>\n>;\nexport type GetTaskQueryError = ErrorType<void | DmError>;\n\nexport const useGetTask = <\n TData = Awaited<ReturnType<typeof getTask>>,\n TError = ErrorType<void | DmError>\n>(\n taskId: string,\n params?: GetTaskParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getTask>>, 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 ?? getGetTaskQueryKey(taskId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({\n signal,\n }) => getTask(taskId, params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getTask>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!taskId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an **owner** of the Task action to delete it. For example you must be the owner of the Dataset to delete **DATASET** tasks and an owner of the ProjectFile to delete **FILE** tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/task/${taskId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteTaskMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteTask>>\n>;\n\nexport type DeleteTaskMutationError = ErrorType<DmError>;\n\nexport const useDeleteTask = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: 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 deleteTask>>,\n { taskId: string }\n > = (props) => {\n const { taskId } = props ?? {};\n\n return deleteTask(taskId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
|
package/task/task.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { i as GetTasksParams,
|
|
3
|
+
import { i as GetTasksParams, bB as customInstance, aV as TasksGetResponse, bC as ErrorType, bx as DmError, h as GetTaskParams, aX as TaskGetResponse } from '../custom-instance-3a73945d.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
7
7
|
/**
|
|
8
8
|
* Returns a list of tasks that you have access to. These will be Tasks that you **own**. Being an editor of the related object does not allow you to see its task.
|
|
9
9
|
|
|
10
|
-
* @summary Returns a list of
|
|
10
|
+
* @summary Returns a list of Tasks
|
|
11
11
|
*/
|
|
12
12
|
declare const getTasks: (params?: GetTasksParams | undefined, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<TasksGetResponse>;
|
|
13
13
|
declare const getGetTasksQueryKey: (params?: GetTasksParams | undefined) => (string | GetTasksParams)[];
|
|
@@ -38,7 +38,7 @@ For **Dataset** tasks, where the task `purpose` is `DATASET`, you must wait unti
|
|
|
38
38
|
|
|
39
39
|
For Application **Instance** tasks, where the task `purpose` is `INSTANCE`, you must wait until you find the `STARTED` state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.
|
|
40
40
|
|
|
41
|
-
* @summary Returns
|
|
41
|
+
* @summary Returns Task information
|
|
42
42
|
*/
|
|
43
43
|
declare const getTask: (taskId: string, params?: GetTaskParams | undefined, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<TaskGetResponse>;
|
|
44
44
|
declare const getGetTaskQueryKey: (taskId: string, params?: GetTaskParams | undefined) => (string | GetTaskParams)[];
|
package/task/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/task/task.ts"],"sourcesContent":["/**\n * Generated by orval v6.9.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: 1.0\n */\nimport { useQuery, useMutation } from \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n TasksGetResponse,\n DmError,\n GetTasksParams,\n TaskGetResponse,\n GetTaskParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a list of tasks that you have access to. These will be Tasks that you **own**. Being an editor of the related object does not allow you to see its task.\n\n * @summary Returns a list of
|
|
1
|
+
{"version":3,"sources":["../../src/task/task.ts"],"sourcesContent":["/**\n * Generated by orval v6.9.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: 1.0\n */\nimport { useQuery, useMutation } from \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n TasksGetResponse,\n DmError,\n GetTasksParams,\n TaskGetResponse,\n GetTaskParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a list of tasks that you have access to. These will be Tasks that you **own**. Being an editor of the related object does not allow you to see its task.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TasksGetResponse>(\n { url: `/task`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTasksQueryKey = (params?: GetTasksParams) => [\n `/task`,\n ...(params ? [params] : []),\n];\n\nexport type GetTasksQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTasks>>\n>;\nexport type GetTasksQueryError = ErrorType<void | DmError>;\n\nexport const useGetTasks = <\n TData = Awaited<ReturnType<typeof getTasks>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetTasksParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getTasks>>,\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 ?? getGetTasksQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({\n signal,\n }) => getTasks(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getTasks>>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you are its **owner**. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating datasets and launching applications.\n\nTasks contain of a list of `states` and `events`. A task will always have states but may not have events.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 100 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect a it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The dataset is available when the task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the task is `done` but you have a non-zero `exit_code`, the dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** tasks, where the task `purpose` is `INSTANCE`, you must wait until you find the `STARTED` state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<TaskGetResponse>(\n { url: `/task/${taskId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTaskQueryKey = (taskId: string, params?: GetTaskParams) => [\n `/task/${taskId}`,\n ...(params ? [params] : []),\n];\n\nexport type GetTaskQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTask>>\n>;\nexport type GetTaskQueryError = ErrorType<void | DmError>;\n\nexport const useGetTask = <\n TData = Awaited<ReturnType<typeof getTask>>,\n TError = ErrorType<void | DmError>\n>(\n taskId: string,\n params?: GetTaskParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getTask>>, 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 ?? getGetTaskQueryKey(taskId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({\n signal,\n }) => getTask(taskId, params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getTask>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!taskId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an **owner** of the Task action to delete it. For example you must be the owner of the Dataset to delete **DATASET** tasks and an owner of the ProjectFile to delete **FILE** tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/task/${taskId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteTaskMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteTask>>\n>;\n\nexport type DeleteTaskMutationError = ErrorType<DmError>;\n\nexport const useDeleteTask = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: 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 deleteTask>>,\n { taskId: string }\n > = (props) => {\n const { taskId } = props ?? {};\n\n return deleteTask(taskId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAgC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;A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QI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
|
package/type/type.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { bB as customInstance, aU as TypesGetResponse, bC as ErrorType, bx as DmError } from '../custom-instance-3a73945d.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
5
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/user/user.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { bB as customInstance, aR as UsersGetResponse, bC as ErrorType, bx as DmError, a as GetUserAccountParams, aa as UserAccountDetail, X as UserAccountPatchBodyBody, G as GetUserApiLogParams, aS as UserApiLogGetResponse } from '../custom-instance-3a73945d.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|