@narrative.io/data-collaboration-sdk-ts 4.0.0-beta.0 → 4.0.0-beta.1
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/build/workflows/index.js
CHANGED
|
@@ -14,7 +14,10 @@ class WorkflowsApi extends BaseApi {
|
|
|
14
14
|
* @returns {Promise<ListWorkflowsResponse>} A promise that resolves to a paginated list of workflows.
|
|
15
15
|
*/
|
|
16
16
|
async listWorkflows(params) {
|
|
17
|
-
|
|
17
|
+
// Spread so the argument is an anonymous object type rather than an
|
|
18
|
+
// interface: only the former satisfies `get`'s index-signature constraint.
|
|
19
|
+
// See {@link ListRunsParams} on why these params carry no index signature.
|
|
20
|
+
return await this.get(resourceName, params && { ...params });
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* Create a new workflow from a YAML specification.
|
|
@@ -73,7 +76,8 @@ class WorkflowsApi extends BaseApi {
|
|
|
73
76
|
* @returns {Promise<ListRunsResponse>} A promise that resolves to a paginated list of workflow runs.
|
|
74
77
|
*/
|
|
75
78
|
async listWorkflowRuns(workflowId, params) {
|
|
76
|
-
|
|
79
|
+
// See the spread in `listWorkflows`.
|
|
80
|
+
return await this.get(`${resourceName}/${workflowId}/runs`, params && { ...params });
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
export { WorkflowsApi, };
|
|
@@ -53,13 +53,21 @@ export interface ListRunsResponse {
|
|
|
53
53
|
runs: WorkflowRun[];
|
|
54
54
|
next_page_token?: string | null;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Query parameters for `GET /workflows/{id}/runs`.
|
|
58
|
+
*
|
|
59
|
+
* Deliberately has no index signature: an index signature would silently accept
|
|
60
|
+
* misspelled or legacy parameter names (e.g. `pageSize`/`pageToken`), which the
|
|
61
|
+
* server ignores — the request succeeds and pagination just never advances.
|
|
62
|
+
*/
|
|
63
|
+
export interface ListRunsParams {
|
|
57
64
|
/** Maximum number of runs to return per page (`per_page` query param). Defaults to 10. */
|
|
58
65
|
per_page?: number;
|
|
59
66
|
/** Opaque token from a previous response (`page_token` query param). */
|
|
60
67
|
page_token?: string;
|
|
61
68
|
}
|
|
62
|
-
|
|
69
|
+
/** Query parameters for `GET /workflows`. See {@link ListRunsParams} on why there's no index signature. */
|
|
70
|
+
export interface ListWorkflowsParams extends PaginationOptions {
|
|
63
71
|
/** Narrow results to workflows on this data plane. */
|
|
64
72
|
data_plane_id?: string;
|
|
65
73
|
}
|