@squonk/data-manager-client 4.1.0 → 4.2.0

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.
@@ -53,6 +53,14 @@ export type AdminGetServiceErrorsParams = {
53
53
  include_acknowledged?: QIncludeAcknowledgedParameter;
54
54
  };
55
55
 
56
+ export type GetRunningWorkflowsParams = {
57
+ /**
58
+ * A workflow ID
59
+
60
+ */
61
+ workflow_id?: QWorkflowIdParameter;
62
+ };
63
+
56
64
  export type GetUserApiLogParams = {
57
65
  /**
58
66
  * A from (inclusive) date-time. If provided no API calls prior to this will be returned. UTC is assumed if no timezone is provided
@@ -82,10 +90,18 @@ archive?: QInstanceArchiveParameter;
82
90
  };
83
91
 
84
92
  export type GetInstancesParams = {
93
+ /**
94
+ * An Organisation identity
95
+ */
96
+ org_id?: QOrgIdParameter;
85
97
  /**
86
98
  * A Project identity
87
99
  */
88
100
  project_id?: QProjectIdParameter;
101
+ /**
102
+ * A Unit identity
103
+ */
104
+ unit_id?: QUnitIdParameter;
89
105
  };
90
106
 
91
107
  export type GetJobExchangeRatesParams = {
@@ -190,10 +206,18 @@ exclude_removal?: QExcludeRemovalParameter;
190
206
 
191
207
  */
192
208
  exclude_purpose?: QExcludePurposeParameter;
209
+ /**
210
+ * An Organisation identity
211
+ */
212
+ org_id?: QOrgIdParameter;
193
213
  /**
194
214
  * A Project identity
195
215
  */
196
216
  project_id?: QProjectIdParameter;
217
+ /**
218
+ * A Unit identity
219
+ */
220
+ unit_id?: QUnitIdParameter;
197
221
  /**
198
222
  * An instance callback context string
199
223
  */
@@ -385,6 +409,12 @@ project_id: QFileProjectIdParameter;
385
409
  path?: QFilePathParameter;
386
410
  };
387
411
 
412
+ /**
413
+ * A workflow ID
414
+
415
+ */
416
+ export type QWorkflowIdParameter = string;
417
+
388
418
  /**
389
419
  * A comma-separated list of editors
390
420
 
@@ -1278,6 +1308,23 @@ export interface RunningWorkflowWorkflow {
1278
1308
  name?: string;
1279
1309
  }
1280
1310
 
1311
+ /**
1312
+ * The processing stage.
1313
+
1314
+ */
1315
+ export type ProjectFileDetailProcessingStage = typeof ProjectFileDetailProcessingStage[keyof typeof ProjectFileDetailProcessingStage];
1316
+
1317
+
1318
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
1319
+ export const ProjectFileDetailProcessingStage = {
1320
+ COPYING: 'COPYING',
1321
+ FAILED: 'FAILED',
1322
+ FORMATTING: 'FORMATTING',
1323
+ LOADING: 'LOADING',
1324
+ DELETING: 'DELETING',
1325
+ DONE: 'DONE',
1326
+ } as const;
1327
+
1281
1328
  export interface ProjectFileDetail {
1282
1329
  /** The code obtained from the Account Server
1283
1330
  */
@@ -1297,6 +1344,9 @@ export interface ProjectFileDetail {
1297
1344
  /** The ProjectFile's path within the Project volume
1298
1345
  */
1299
1346
  file_path: string;
1347
+ /** The processing stage.
1348
+ */
1349
+ processing_stage?: ProjectFileDetailProcessingStage;
1300
1350
  /** True if the ProjectFile cannot be modified while in the Project
1301
1351
  */
1302
1352
  immutable: boolean;
@@ -2043,9 +2093,17 @@ export interface RunningWorkflowSummary {
2043
2093
  /** The name attached to this running workflow
2044
2094
  */
2045
2095
  name: string;
2096
+ error_num?: number;
2097
+ error_msg?: string;
2046
2098
  /** The status of the running workflow */
2047
- status?: RunningWorkflowSummaryStatus;
2048
- workflow?: RunningWorkflowWorkflow;
2099
+ status: RunningWorkflowSummaryStatus;
2100
+ /** The date and time the running workflow was started */
2101
+ started?: string;
2102
+ /** The date and time the running workflow was stopped
2103
+ */
2104
+ stopped?: string;
2105
+ workflow: RunningWorkflowWorkflow;
2106
+ project: RunningWorkflowProject;
2049
2107
  }
2050
2108
 
2051
2109
  export interface PriorRunningWorkflowStep {
@@ -2066,13 +2124,19 @@ export interface WorkflowVersionPutResponse {
2066
2124
  id: string;
2067
2125
  }
2068
2126
 
2127
+ /**
2128
+ * The step specification
2129
+
2130
+ */
2131
+ export type WorkflowStepSummarySpecification = { [key: string]: unknown };
2132
+
2069
2133
  export interface WorkflowStepSummary {
2070
2134
  /** The name of the step
2071
2135
  */
2072
2136
  name: string;
2073
- /** The JSON string representation of the step specification
2137
+ /** The step specification
2074
2138
  */
2075
- specification: string;
2139
+ specification: WorkflowStepSummarySpecification;
2076
2140
  }
2077
2141
 
2078
2142
  export interface WorkflowRunPostResponse {
@@ -2085,6 +2149,11 @@ export interface WorkflowDefinitionGetResponse {
2085
2149
  definition: string;
2086
2150
  }
2087
2151
 
2152
+ /**
2153
+ * The workflow control variables
2154
+ */
2155
+ export type WorkflowGetResponseVariables = { [key: string]: unknown };
2156
+
2088
2157
  /**
2089
2158
  * The scope of the workflow.
2090
2159
  */
@@ -2131,6 +2200,8 @@ export interface WorkflowGetResponse {
2131
2200
  /** A list of validation errors. Only present if the workflow has been validated and errors were found.
2132
2201
  */
2133
2202
  validation_error_msg?: string[];
2203
+ /** The workflow control variables */
2204
+ variables?: WorkflowGetResponseVariables;
2134
2205
  /** The steps, if the Workflow has been validated and has no errors.
2135
2206
  */
2136
2207
  steps?: WorkflowStepSummary[];
@@ -2196,7 +2267,7 @@ export interface WorkflowGetAllResponse {
2196
2267
  }
2197
2268
 
2198
2269
  export interface VersionGetResponse {
2199
- /** The Data Manager version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined
2270
+ /** A Data Manager version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined
2200
2271
  */
2201
2272
  version: string;
2202
2273
  }
@@ -143,6 +143,8 @@ export const useCreateInstance = <TData = Awaited<ReturnType<typeof createInstan
143
143
  /**
144
144
  * 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`
145
145
 
146
+ Results can be filtered by **Project**, **Unit** or **Organisation**.
147
+
146
148
  * @summary Get summary information about all Job and Application instances
147
149
  */
148
150
  export const getInstances = (
@@ -31,6 +31,7 @@ import type {
31
31
  } from '@tanstack/react-query'
32
32
  import type {
33
33
  DmError,
34
+ GetRunningWorkflowsParams,
34
35
  RunningWorkflowGetAllResponse,
35
36
  RunningWorkflowGetResponse,
36
37
  RunningWorkflowStepsGetResponse,
@@ -847,36 +848,39 @@ export const useVersionWorkflow = <TData = Awaited<ReturnType<typeof versionWork
847
848
  /**
848
849
  * Get a list of all Running Workflows available to you. The Running Workflows are listed in chronological order of the start time, where the first that was executed is the first in the list.
849
850
 
851
+ By providing a workflow ID you will only see Running Workflows for that Workflow.
852
+
850
853
  * @summary Get all Running Workflows available to you
851
854
  */
852
855
  export const getRunningWorkflows = (
853
-
856
+ params?: GetRunningWorkflowsParams,
854
857
  options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
855
858
  ) => {
856
859
 
857
860
 
858
861
  return customInstance<RunningWorkflowGetAllResponse>(
859
- {url: `/running-workflow`, method: 'GET', signal
862
+ {url: `/running-workflow`, method: 'GET',
863
+ params, signal
860
864
  },
861
865
  options);
862
866
  }
863
867
 
864
868
 
865
- export const getGetRunningWorkflowsQueryKey = () => {
866
- return ["data-manager-api", `/running-workflow`] as const;
869
+ export const getGetRunningWorkflowsQueryKey = (params?: GetRunningWorkflowsParams,) => {
870
+ return ["data-manager-api", `/running-workflow`, ...(params ? [params]: [])] as const;
867
871
  }
868
872
 
869
873
 
870
- export const getGetRunningWorkflowsQueryOptions = <TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
874
+ export const getGetRunningWorkflowsQueryOptions = <TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(params?: GetRunningWorkflowsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
871
875
  ) => {
872
876
 
873
877
  const {query: queryOptions, request: requestOptions} = options ?? {};
874
878
 
875
- const queryKey = queryOptions?.queryKey ?? getGetRunningWorkflowsQueryKey();
879
+ const queryKey = queryOptions?.queryKey ?? getGetRunningWorkflowsQueryKey(params);
876
880
 
877
881
 
878
882
 
879
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getRunningWorkflows>>> = ({ signal }) => getRunningWorkflows(requestOptions, signal);
883
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getRunningWorkflows>>> = ({ signal }) => getRunningWorkflows(params, requestOptions, signal);
880
884
 
881
885
 
882
886
 
@@ -890,7 +894,7 @@ export type GetRunningWorkflowsQueryError = ErrorType<void>
890
894
 
891
895
 
892
896
  export function useGetRunningWorkflows<TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(
893
- options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>> & Pick<
897
+ params: undefined | GetRunningWorkflowsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>> & Pick<
894
898
  DefinedInitialDataOptions<
895
899
  Awaited<ReturnType<typeof getRunningWorkflows>>,
896
900
  TError,
@@ -900,7 +904,7 @@ export function useGetRunningWorkflows<TData = Awaited<ReturnType<typeof getRunn
900
904
 
901
905
  ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
902
906
  export function useGetRunningWorkflows<TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(
903
- options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>> & Pick<
907
+ params?: GetRunningWorkflowsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>> & Pick<
904
908
  UndefinedInitialDataOptions<
905
909
  Awaited<ReturnType<typeof getRunningWorkflows>>,
906
910
  TError,
@@ -910,7 +914,7 @@ export function useGetRunningWorkflows<TData = Awaited<ReturnType<typeof getRunn
910
914
 
911
915
  ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
912
916
  export function useGetRunningWorkflows<TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(
913
- options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
917
+ params?: GetRunningWorkflowsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
914
918
 
915
919
  ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
916
920
  /**
@@ -918,11 +922,11 @@ export function useGetRunningWorkflows<TData = Awaited<ReturnType<typeof getRunn
918
922
  */
919
923
 
920
924
  export function useGetRunningWorkflows<TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(
921
- options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
925
+ params?: GetRunningWorkflowsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
922
926
 
923
927
  ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
924
928
 
925
- const queryOptions = getGetRunningWorkflowsQueryOptions(options)
929
+ const queryOptions = getGetRunningWorkflowsQueryOptions(params,options)
926
930
 
927
931
  const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
928
932
 
@@ -933,16 +937,16 @@ export function useGetRunningWorkflows<TData = Awaited<ReturnType<typeof getRunn
933
937
 
934
938
 
935
939
 
936
- export const getGetRunningWorkflowsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
940
+ export const getGetRunningWorkflowsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(params?: GetRunningWorkflowsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
937
941
  ) => {
938
942
 
939
943
  const {query: queryOptions, request: requestOptions} = options ?? {};
940
944
 
941
- const queryKey = queryOptions?.queryKey ?? getGetRunningWorkflowsQueryKey();
945
+ const queryKey = queryOptions?.queryKey ?? getGetRunningWorkflowsQueryKey(params);
942
946
 
943
947
 
944
948
 
945
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getRunningWorkflows>>> = ({ signal }) => getRunningWorkflows(requestOptions, signal);
949
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getRunningWorkflows>>> = ({ signal }) => getRunningWorkflows(params, requestOptions, signal);
946
950
 
947
951
 
948
952
 
@@ -956,15 +960,15 @@ export type GetRunningWorkflowsSuspenseQueryError = ErrorType<void>
956
960
 
957
961
 
958
962
  export function useGetRunningWorkflowsSuspense<TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(
959
- options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
963
+ params: undefined | GetRunningWorkflowsParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
960
964
 
961
965
  ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
962
966
  export function useGetRunningWorkflowsSuspense<TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(
963
- options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
967
+ params?: GetRunningWorkflowsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
964
968
 
965
969
  ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
966
970
  export function useGetRunningWorkflowsSuspense<TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(
967
- options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
971
+ params?: GetRunningWorkflowsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
968
972
 
969
973
  ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
970
974
  /**
@@ -972,11 +976,11 @@ export function useGetRunningWorkflowsSuspense<TData = Awaited<ReturnType<typeof
972
976
  */
973
977
 
974
978
  export function useGetRunningWorkflowsSuspense<TData = Awaited<ReturnType<typeof getRunningWorkflows>>, TError = ErrorType<void>>(
975
- options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
979
+ params?: GetRunningWorkflowsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getRunningWorkflows>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
976
980
 
977
981
  ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
978
982
 
979
- const queryOptions = getGetRunningWorkflowsSuspenseQueryOptions(options)
983
+ const queryOptions = getGetRunningWorkflowsSuspenseQueryOptions(params,options)
980
984
 
981
985
  const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
982
986
 
@@ -272,39 +272,40 @@ var useVersionWorkflow = (options) => {
272
272
  const mutationOptions = getVersionWorkflowMutationOptions(options);
273
273
  return _reactquery.useMutation.call(void 0, mutationOptions);
274
274
  };
275
- var getRunningWorkflows = (options, signal) => {
275
+ var getRunningWorkflows = (params, options, signal) => {
276
276
  return _chunkTKLTUR4Rcjs.customInstance.call(void 0,
277
277
  {
278
278
  url: `/running-workflow`,
279
279
  method: "GET",
280
+ params,
280
281
  signal
281
282
  },
282
283
  options
283
284
  );
284
285
  };
285
- var getGetRunningWorkflowsQueryKey = () => {
286
- return ["data-manager-api", `/running-workflow`];
286
+ var getGetRunningWorkflowsQueryKey = (params) => {
287
+ return ["data-manager-api", `/running-workflow`, ...params ? [params] : []];
287
288
  };
288
- var getGetRunningWorkflowsQueryOptions = (options) => {
289
+ var getGetRunningWorkflowsQueryOptions = (params, options) => {
289
290
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
290
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetRunningWorkflowsQueryKey()));
291
- const queryFn = ({ signal }) => getRunningWorkflows(requestOptions, signal);
291
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetRunningWorkflowsQueryKey(params)));
292
+ const queryFn = ({ signal }) => getRunningWorkflows(params, requestOptions, signal);
292
293
  return { queryKey, queryFn, ...queryOptions };
293
294
  };
294
- function useGetRunningWorkflows(options) {
295
- const queryOptions = getGetRunningWorkflowsQueryOptions(options);
295
+ function useGetRunningWorkflows(params, options) {
296
+ const queryOptions = getGetRunningWorkflowsQueryOptions(params, options);
296
297
  const query = _reactquery.useQuery.call(void 0, queryOptions);
297
298
  query.queryKey = queryOptions.queryKey;
298
299
  return query;
299
300
  }
300
- var getGetRunningWorkflowsSuspenseQueryOptions = (options) => {
301
+ var getGetRunningWorkflowsSuspenseQueryOptions = (params, options) => {
301
302
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
302
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetRunningWorkflowsQueryKey()));
303
- const queryFn = ({ signal }) => getRunningWorkflows(requestOptions, signal);
303
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetRunningWorkflowsQueryKey(params)));
304
+ const queryFn = ({ signal }) => getRunningWorkflows(params, requestOptions, signal);
304
305
  return { queryKey, queryFn, ...queryOptions };
305
306
  };
306
- function useGetRunningWorkflowsSuspense(options) {
307
- const queryOptions = getGetRunningWorkflowsSuspenseQueryOptions(options);
307
+ function useGetRunningWorkflowsSuspense(params, options) {
308
+ const queryOptions = getGetRunningWorkflowsSuspenseQueryOptions(params, options);
308
309
  const query = _reactquery.useSuspenseQuery.call(void 0, queryOptions);
309
310
  query.queryKey = queryOptions.queryKey;
310
311
  return query;