From bee14b554be9ef36e62748f14657fada8e66cad7 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 7 Oct 2025 12:17:05 -0300 Subject: [PATCH 1/4] Enhance LinearB component with new prop definitions for teams and services, add search incidents action, and update version to 0.2.0. Bump create incident action version to 0.0.3 and update dependencies. --- .../create-incident/create-incident.mjs | 16 +-- .../search-incidents/search-incidents.mjs | 106 ++++++++++++++++++ components/linearb/linearb.app.mjs | 53 ++++++++- components/linearb/package.json | 4 +- 4 files changed, 168 insertions(+), 11 deletions(-) create mode 100644 components/linearb/actions/search-incidents/search-incidents.mjs diff --git a/components/linearb/actions/create-incident/create-incident.mjs b/components/linearb/actions/create-incident/create-incident.mjs index db656a26fe4c7..3d5b1ef6633e3 100644 --- a/components/linearb/actions/create-incident/create-incident.mjs +++ b/components/linearb/actions/create-incident/create-incident.mjs @@ -4,7 +4,7 @@ export default { key: "linearb-create-incident", name: "Create Incident", description: "Create a new incident within the LinearB platform. [See the documentation](https://docs.linearb.io/api-incidents/#create-incident)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, @@ -52,15 +52,17 @@ export default { optional: true, }, teams: { - type: "string[]", - label: "Teams", - description: "The list of LinearB teams names related to this incident. (lowercase only)", + propDefinition: [ + app, + "teams", + ], optional: true, }, services: { - type: "string[]", - label: "Services", - description: "The list of LinearB services related to this incident.", + propDefinition: [ + app, + "services", + ], optional: true, }, repositoryUrls: { diff --git a/components/linearb/actions/search-incidents/search-incidents.mjs b/components/linearb/actions/search-incidents/search-incidents.mjs new file mode 100644 index 0000000000000..b1fe46a61a3d6 --- /dev/null +++ b/components/linearb/actions/search-incidents/search-incidents.mjs @@ -0,0 +1,106 @@ +import app from "../../linearb.app.mjs"; + +export default { + key: "linearb-search-incidents", + name: "Search Incidents", + description: "Search for incidents within the LinearB platform. [See the documentation](https://docs.linearb.io/api-incidents/#search-incidents)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + props: { + app, + teams: { + propDefinition: [ + app, + "teams", + ], + optional: true, + }, + services: { + propDefinition: [ + app, + "services", + ], + optional: true, + }, + repositoryUrls: { + type: "string[]", + label: "Repository URLs", + description: "The list of repos urls related to this incident. **Lowercase only**", + optional: true, + }, + issuedAtBefore: { + type: "string", + label: "Issued At Before", + description: "The specific time when the incident was logged and officially opened. (Format: `YYYY-MM-DD`)", + optional: true, + }, + issuedAtAfter: { + type: "string", + label: "Issued At After", + description: "The specific time when the incident was logged and officially opened. (Format: `YYYY-MM-DD`)", + optional: true, + }, + startedAt: { + type: "string", + label: "Started At", + description: "The specific time when work on the incident commenced. (Format: `YYYY-MM-DD`)", + optional: true, + }, + endedAt: { + type: "string", + label: "Ended At", + description: "The specific time when the incident was successfully resolved. (Format: `YYYY-MM-DD`)", + optional: true, + }, + statuses: { + type: "string[]", + label: "Statuses", + description: "A list of statuses of the incident", + options: [ + "open", + "in-progress", + "closed", + "deleted", + ], + optional: true, + }, + maxResults: { + type: "integer", + label: "Max Results", + description: "The maximum number of results to return", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.app.paginate({ + $, + resourceFn: this.app.getIncidents, + resourceName: "items", + resourceFnArgs: { + data: { + issued_at: { + before: this.issuedAtBefore, + after: this.issuedAtAfter, + }, + started_at: this.startedAt, + ended_at: this.endedAt, + statuses: this.statuses, + teams: this.teams, + services: this.services, + repository_urls: this.repositoryUrls, + }, + }, + max: this.maxResults, + }); + + $.export("$summary", `Successfully searched ${response.length} incident${response.length > 1 + ? "s" + : ""}`); + return response; + }, +}; diff --git a/components/linearb/linearb.app.mjs b/components/linearb/linearb.app.mjs index a347ab39012b2..6974b185d8250 100644 --- a/components/linearb/linearb.app.mjs +++ b/components/linearb/linearb.app.mjs @@ -5,12 +5,41 @@ import utils from "./common/utils.mjs"; export default { type: "app", app: "linearb", - propDefinitions: {}, + propDefinitions: { + teams: { + type: "string[]", + label: "Teams", + description: "The list of LinearB teams names related to this incident. (lowercase only)", + async options({ page }) { + const { items } = await this.getTeams({ + params: { + page, + }, + }); + + return items.map(({ name }) => name); + }, + }, + services: { + type: "string[]", + label: "Services", + description: "The list of LinearB services related to this incident. (lowercase only)", + async options({ page }) { + const { items } = await this.getServices({ + params: { + page, + }, + }); + + return items.map(({ name }) => name); + }, + }, + }, methods: { getUrl(path, versionPath = constants.VERSION_PATH.V1) { return `${constants.BASE_URL}${versionPath}${path}`; }, - getHeaders(headers) { + getHeaders(headers = {}) { return { "Content-Type": "application/json", "x-api-key": this.$auth.api_key, @@ -38,6 +67,26 @@ export default { ...args, }); }, + getTeams(args = {}) { + return this._makeRequest({ + path: "/teams", + versionPath: constants.VERSION_PATH.V2, + ...args, + }); + }, + getServices(args = {}) { + return this._makeRequest({ + path: "/services", + ...args, + }); + }, + getIncidents(args = {}) { + return this._makeRequest({ + method: "POST", + path: "/incidents/search", + ...args, + }); + }, async *getIterations({ resourceFn, resourceFnArgs, resourceName, max = constants.DEFAULT_MAX, diff --git a/components/linearb/package.json b/components/linearb/package.json index 99d4673846499..e6d61379c995c 100644 --- a/components/linearb/package.json +++ b/components/linearb/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/linearb", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream LinearB Components", "main": "linearb.app.mjs", "keywords": [ @@ -13,6 +13,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^1.6.0" + "@pipedream/platform": "^3.1.0" } } From ed64584e171f3d862209e1a06ab9eb09311aa169 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 7 Oct 2025 12:20:37 -0300 Subject: [PATCH 2/4] pnpm update --- pnpm-lock.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a6f3c9068b3b..29f659eafa48c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1924,8 +1924,7 @@ importers: components/braintree: {} - components/brandblast: - specifiers: {} + components/brandblast: {} components/brandfetch: {} @@ -8018,8 +8017,8 @@ importers: components/linearb: dependencies: '@pipedream/platform': - specifier: ^1.6.0 - version: 1.6.6 + specifier: ^3.1.0 + version: 3.1.0 components/linguapop: dependencies: From 6861b50fa419ff814bbe0eed63116e98edb7712e Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 7 Oct 2025 12:41:46 -0300 Subject: [PATCH 3/4] Update LinearB source to version 0.0.2 and adjust import order in new-deploy-created.mjs --- .../linearb/sources/new-deploy-created/new-deploy-created.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/linearb/sources/new-deploy-created/new-deploy-created.mjs b/components/linearb/sources/new-deploy-created/new-deploy-created.mjs index 40893a5aa200d..3f62669064d44 100644 --- a/components/linearb/sources/new-deploy-created/new-deploy-created.mjs +++ b/components/linearb/sources/new-deploy-created/new-deploy-created.mjs @@ -1,12 +1,12 @@ import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; -import app from "../../linearb.app.mjs"; import constants from "../../common/constants.mjs"; +import app from "../../linearb.app.mjs"; export default { key: "linearb-new-deploy-created", name: "New Deploy Created", description: "Emit new event when a new deploy is created in LinearB. [See the documentation](https://docs.linearb.io/api-deployments/)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", props: { From e39cb854af23eb49ebc5f4106ac37c6bb12f2389 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Thu, 9 Oct 2025 13:35:54 -0300 Subject: [PATCH 4/4] Update descriptions in search incidents action to clarify date format for issued and incident times --- .../linearb/actions/search-incidents/search-incidents.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/linearb/actions/search-incidents/search-incidents.mjs b/components/linearb/actions/search-incidents/search-incidents.mjs index b1fe46a61a3d6..8ec2a6f69f388 100644 --- a/components/linearb/actions/search-incidents/search-incidents.mjs +++ b/components/linearb/actions/search-incidents/search-incidents.mjs @@ -36,25 +36,25 @@ export default { issuedAtBefore: { type: "string", label: "Issued At Before", - description: "The specific time when the incident was logged and officially opened. (Format: `YYYY-MM-DD`)", + description: "The specific date when the incident was logged and officially opened. (Format: `YYYY-MM-DD`)", optional: true, }, issuedAtAfter: { type: "string", label: "Issued At After", - description: "The specific time when the incident was logged and officially opened. (Format: `YYYY-MM-DD`)", + description: "The specific date when the incident was logged and officially opened. (Format: `YYYY-MM-DD`)", optional: true, }, startedAt: { type: "string", label: "Started At", - description: "The specific time when work on the incident commenced. (Format: `YYYY-MM-DD`)", + description: "The specific date when work on the incident commenced. (Format: `YYYY-MM-DD`)", optional: true, }, endedAt: { type: "string", label: "Ended At", - description: "The specific time when the incident was successfully resolved. (Format: `YYYY-MM-DD`)", + description: "The specific date when the incident was successfully resolved. (Format: `YYYY-MM-DD`)", optional: true, }, statuses: {