Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/seqera/actions/create-action/create-action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "seqera-create-action",
name: "Create Pipeline Action",
description: "Creates a new pipeline action in Seqera. [See the documentation](https://docs.seqera.io/platform/23.3.0/api/overview)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "seqera-create-compute-environment",
name: "Create Compute Environment",
description: "Creates a new compute environment in Seqera Tower. [See the documentation](https://docs.seqera.io/platform/23.3.0/api/overview)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "seqera-create-pipeline",
name: "Create Pipeline",
description: "Creates a new pipeline in a user context. [See the documentation](https://docs.seqera.io/platform/23.3.0/api/overview)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
5 changes: 4 additions & 1 deletion components/seqera/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/seqera",
"version": "0.1.0",
"version": "0.1.1",
"description": "Pipedream Seqera Components",
"main": "seqera.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,8 @@
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
}
}
22 changes: 12 additions & 10 deletions components/seqera/seqera.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ export default {
...args,
});
},
listRuns(args = {}) {
listWorkflows({
workspaceId, ...args
}) {
return this._makeRequest({
path: "/ga4gh/wes/v1/runs",
path: `/workflow?workspaceId=${workspaceId}`,
...args,
});
},
Expand All @@ -177,18 +179,18 @@ export default {
resourceName,
max = constants.DEFAULT_MAX,
}) {
let nextPageToken;
const params = {
...resourcesFnArgs?.params,
max: constants.DEFAULT_LIMIT,
offset: 0,
};
let resourcesCount = 0;

while (true) {
const response =
await resourcesFn({
...resourcesFnArgs,
params: {
...resourcesFnArgs?.params,
page_size: constants.DEFAULT_LIMIT,
page_token: nextPageToken,
},
params,
});

const nextResources = resourceName && response[resourceName] || response;
Expand All @@ -207,12 +209,12 @@ export default {
}
}

if (Number(response.next_page_token) === 0) {
if (resourcesCount >= response.totalSize) {
console.log("No more pages found");
return;
}

nextPageToken = response.next_page_token;
params.offset += params.max;
}
},
paginate(args = {}) {
Expand Down
25 changes: 17 additions & 8 deletions components/seqera/sources/new-run-created/new-run-created.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "seqera-new-run-created",
name: "New Run Created",
description: "Emit new event when a new run is created in Seqera. [See the documentation](https://docs.seqera.io/platform/23.3.0/api/overview)",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
props: {
Expand All @@ -18,22 +18,31 @@ export default {
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
},
},
workspaceId: {
propDefinition: [
app,
"workspaceId",
],
optional: false,
},
},
methods: {
getResourceName() {
return "runs";
return "workflows";
},
getResourcesFn() {
return this.app.listRuns;
return this.app.listWorkflows;
},
getResourcesFnArgs() {
return;
return {
workspaceId: this.workspaceId,
};
},
generateMeta(resource) {
generateMeta({ workflow }) {
return {
id: resource.run_id,
summary: `New Run: ${resource.run_id}`,
ts: Date.now(),
id: workflow.id,
summary: `New Run: ${workflow.id}`,
ts: Date.parse(workflow.dateCreated),
};
},
processResource(resource) {
Expand Down
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading