From 0a778d8d4dafe9fd0ec4976ec8ea6de0ac3bfc5c Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 29 Sep 2025 19:42:01 -0300 Subject: [PATCH 1/2] Update @pipedream/the_official_board to version 0.1.0, add new actions for exporting org charts as PDF and XLSX, and retrieving executive and org chart information. --- .../create-orgchart-pdf-file.mjs | 49 ++++++++++++ .../create-orgchart-xlsx-file.mjs | 49 ++++++++++++ .../get-executive-info/get-executive-info.mjs | 29 +++++++ .../get-orgchart-info/get-orgchart-info.mjs | 30 ++++++++ .../search-company-org-chart-id.mjs | 35 +++++++++ .../search-executive-by-name.mjs | 28 +++++++ components/the_official_board/package.json | 7 +- .../the_official_board.app.mjs | 76 ++++++++++++++++++- 8 files changed, 297 insertions(+), 6 deletions(-) create mode 100644 components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs create mode 100644 components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs create mode 100644 components/the_official_board/actions/get-executive-info/get-executive-info.mjs create mode 100644 components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs create mode 100644 components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs create mode 100644 components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs diff --git a/components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs b/components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs new file mode 100644 index 0000000000000..851613420e4bb --- /dev/null +++ b/components/the_official_board/actions/create-orgchart-pdf-file/create-orgchart-pdf-file.mjs @@ -0,0 +1,49 @@ +import fs from "fs"; +import app from "../../the_official_board.app.mjs"; + +export default { + key: "the_official_board-create-orgchart-pdf-file", + name: "Create Orgchart PDF File", + description: "Export organization chart as PDF file. [See the documentation](https://rest.theofficialboard.com/rest/api/doc/#/Companies/get_export_orgchart_pdf)", + version: "0.0.1", + type: "action", + props: { + app, + companyId: { + propDefinition: [ + app, + "companyId", + ], + description: "The ID of the company to export orgchart for", + }, + filename: { + type: "string", + label: "Target Filename", + description: "The filename that will be used to save in /tmp", + }, + syncDir: { + type: "dir", + accessMode: "write", + sync: true, + }, + }, + async run({ $ }) { + const response = await this.app.exportOrgchartPdf({ + $, + params: { + id: this.companyId, + }, + }); + + const filePath = `/tmp/${this.filename}`; + fs.writeFileSync(filePath, response); + + $.export("$summary", `Successfully exported orgchart for company with ID ${this.companyId}`); + + return { + filename: this.filename, + filePath, + contentType: "application/pdf", + }; + }, +}; diff --git a/components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs b/components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs new file mode 100644 index 0000000000000..17ad56a572e28 --- /dev/null +++ b/components/the_official_board/actions/create-orgchart-xlsx-file/create-orgchart-xlsx-file.mjs @@ -0,0 +1,49 @@ +import fs from "fs"; +import app from "../../the_official_board.app.mjs"; + +export default { + key: "the_official_board-create-orgchart-xlsx-file", + name: "Create Orgchart XLSX File", + description: "Export organization chart as XLSX file. [See the documentation](https://rest.theofficialboard.com/rest/api/doc/#/Companies/get_export_orgchart_excel)", + version: "0.0.1", + type: "action", + props: { + app, + companyId: { + propDefinition: [ + app, + "companyId", + ], + description: "The ID of the company to export orgchart for", + }, + filename: { + type: "string", + label: "Target Filename", + description: "The filename that will be used to save in /tmp", + }, + syncDir: { + type: "dir", + accessMode: "write", + sync: true, + }, + }, + async run({ $ }) { + const response = await this.app.exportOrgchartExcel({ + $, + params: { + id: this.companyId, + }, + }); + + const filePath = `/tmp/${this.filename}`; + fs.writeFileSync(filePath, response); + + $.export("$summary", `Successfully exported orgchart for company with ID ${this.companyId}`); + + return { + filename: this.filename, + filePath, + contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + }; + }, +}; diff --git a/components/the_official_board/actions/get-executive-info/get-executive-info.mjs b/components/the_official_board/actions/get-executive-info/get-executive-info.mjs new file mode 100644 index 0000000000000..d5f50c1fe8e01 --- /dev/null +++ b/components/the_official_board/actions/get-executive-info/get-executive-info.mjs @@ -0,0 +1,29 @@ +import app from "../../the_official_board.app.mjs"; + +export default { + key: "the_official_board-get-executive-info", + name: "Get Executive Info", + description: "Get executive biography information. [See the documentation](https://rest.theofficialboard.com/rest/api/doc/#/Executives/get_executive_biography)", + version: "0.0.1", + type: "action", + props: { + app, + executiveId: { + propDefinition: [ + app, + "executiveId", + ], + }, + }, + async run({ $ }) { + const response = await this.app.getExecutiveBiography({ + $, + params: { + bioID: this.executiveId, + }, + }); + + $.export("$summary", `Successfully retrieved executive information for executive with ID ${this.executiveId}`); + return response; + }, +}; diff --git a/components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs b/components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs new file mode 100644 index 0000000000000..7ace49cbced69 --- /dev/null +++ b/components/the_official_board/actions/get-orgchart-info/get-orgchart-info.mjs @@ -0,0 +1,30 @@ +import app from "../../the_official_board.app.mjs"; + +export default { + key: "the_official_board-get-orgchart-info", + name: "Get Orgchart Info", + description: "Get organization chart information for a company. [See the documentation](https://rest.theofficialboard.com/rest/api/doc/#/Companies/get_company_orgchart)", + version: "0.0.1", + type: "action", + props: { + app, + companyId: { + propDefinition: [ + app, + "companyId", + ], + description: "The ID of the company to get orgchart for", + }, + }, + async run({ $ }) { + const response = await this.app.getCompanyOrgchart({ + $, + params: { + id: this.companyId, + }, + }); + + $.export("$summary", `Successfully retrieved orgchart information for company with ID ${this.companyId}`); + return response; + }, +}; diff --git a/components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs b/components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs new file mode 100644 index 0000000000000..d265486cc46a7 --- /dev/null +++ b/components/the_official_board/actions/search-company-org-chart-id/search-company-org-chart-id.mjs @@ -0,0 +1,35 @@ +import app from "../../the_official_board.app.mjs"; + +export default { + key: "the_official_board-search-company-org-chart-id", + name: "Search Company Org Chart ID", + description: "Search for company org chart identifier. [See the documentation](https://rest.theofficialboard.com/rest/api/doc/#/Companies/get_company_search)", + version: "0.0.1", + type: "action", + props: { + app, + companyName: { + type: "string", + label: "Company Name", + description: "The name of the company to search for", + }, + amount: { + type: "integer", + label: "Amount", + description: "Amount of search results", + max: 50, + }, + }, + async run({ $ }) { + const response = await this.app.getCompanySearch({ + $, + params: { + companyName: this.companyName, + amount: this.amount, + }, + }); + + $.export("$summary", `Successfully retrieved ${response.length} companies with name ${this.companyName}`); + return response; + }, +}; diff --git a/components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs b/components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs new file mode 100644 index 0000000000000..b04f75b1e0b97 --- /dev/null +++ b/components/the_official_board/actions/search-executive-by-name/search-executive-by-name.mjs @@ -0,0 +1,28 @@ +import app from "../../the_official_board.app.mjs"; + +export default { + key: "the_official_board-search-executive-by-name", + name: "Search Executive", + description: "Search for executives by name. [See the documentation](https://rest.theofficialboard.com/rest/api/doc/#/Executives/get_executive_search)", + version: "0.0.1", + type: "action", + props: { + app, + name: { + type: "string", + label: "Name", + description: "The name of the executive to search for", + }, + }, + async run({ $ }) { + const response = await this.app.getExecutiveSearch({ + $, + params: { + name: this.name, + }, + }); + + $.export("$summary", `Successfully retrieved ${response.length} executives with name ${this.name}`); + return response; + }, +}; diff --git a/components/the_official_board/package.json b/components/the_official_board/package.json index 7e3d2cc699e6a..0b6b9ba89b46e 100644 --- a/components/the_official_board/package.json +++ b/components/the_official_board/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/the_official_board", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream The Official Board Components", "main": "the_official_board.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } -} \ No newline at end of file +} diff --git a/components/the_official_board/the_official_board.app.mjs b/components/the_official_board/the_official_board.app.mjs index 9456fa00b6a87..cf4afab711864 100644 --- a/components/the_official_board/the_official_board.app.mjs +++ b/components/the_official_board/the_official_board.app.mjs @@ -1,11 +1,79 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "the_official_board", - propDefinitions: {}, + propDefinitions: { + companyId: { + type: "string", + label: "Company ID", + description: "The ID of the company", + }, + executiveId: { + type: "string", + label: "Bio ID", + description: "The ID of the executive to get information for", + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseApiUrl() { + return "https://rest.theofficialboard.com/rest"; + }, + _headers(headers = {}) { + return { + "token": this.$auth.api_token, + "Accept": "application/json", + ...headers, + }; + }, + _makeRequest({ + $ = this, + path, + ...args + } = {}) { + return axios($, { + url: `${this._baseApiUrl()}${path}`, + headers: this._headers(), + ...args, + }); + }, + getExecutiveSearch(opts = {}) { + return this._makeRequest({ + path: "/executive/search", + ...opts, + }); + }, + getCompanySearch(opts = {}) { + return this._makeRequest({ + path: "/company/search", + ...opts, + }); + }, + getCompanyOrgchart(opts = {}) { + return this._makeRequest({ + path: "/company/orgchart", + ...opts, + }); + }, + exportOrgchartExcel(opts = {}) { + return this._makeRequest({ + path: "/export/orgchart-excel", + responseType: "arraybuffer", + ...opts, + }); + }, + exportOrgchartPdf(opts = {}) { + return this._makeRequest({ + path: "/export/orgchart-pdf", + responseType: "arraybuffer", + ...opts, + }); + }, + getExecutiveBiography(opts = {}) { + return this._makeRequest({ + path: "/executive/biography", + ...opts, + }); }, }, }; From b9d88716048d635d27fcccc68be0af7118c47592 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 29 Sep 2025 19:43:25 -0300 Subject: [PATCH 2/2] pnpm update --- pnpm-lock.yaml | 49 +++++++++++-------------------------------------- 1 file changed, 11 insertions(+), 38 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 00c8c360962ff..d389cb64f6a35 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1523,8 +1523,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/beeminder: - specifiers: {} + components/beeminder: {} components/belco: dependencies: @@ -8035,8 +8034,7 @@ importers: specifier: ^1.6.5 version: 1.6.6 - components/lingvanex_translation_api: - specifiers: {} + components/lingvanex_translation_api: {} components/linkedin: dependencies: @@ -14446,7 +14444,11 @@ importers: specifier: ^1.11.10 version: 1.11.13 - components/the_official_board: {} + components/the_official_board: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/thehive: {} @@ -25843,9 +25845,6 @@ packages: generate-function@2.3.1: resolution: {integrity: sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==} - generative-bayesian-network@2.1.70: - resolution: {integrity: sha512-nP0CNiVs/QS5ppMsGiEYN3dgAe3UTT1mpDth0wTh9uEyEO4e7y1Yr5PGDcTJsU0Lm3YM21yNzhuPbUg7etKHbQ==} - generic-pool@3.9.0: resolution: {integrity: sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==} engines: {node: '>= 4'} @@ -26292,10 +26291,6 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true - header-generator@2.1.70: - resolution: {integrity: sha512-s2/jN4hIr/pDRZhXA1D2T72eO4f8Gi1mwYEIFLbU+OR7cjo+Tayrw4RlTN3dXPahrU/MBdjk9gv//MwxLoCpGQ==} - engines: {node: '>=16.0.0'} - heap-js@2.5.0: resolution: {integrity: sha512-kUGoI3p7u6B41z/dp33G6OaL7J4DRqRYwVmeIlwLClx7yaaAy7hoDExnuejTKtuDwfcatGmddHDEOjf6EyIxtQ==} engines: {node: '>=10.0.0'} @@ -30974,22 +30969,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net supports-color@10.0.0: resolution: {integrity: sha512-HRVVSbCCMbj7/kdWF9Q+bbckjBHLtHMEoJWlkmYzzdwhYMkjkOwubLM6t7NbWKjgKamGDrWL1++KrjUO1t9oAQ==} @@ -45401,11 +45396,6 @@ snapshots: dependencies: is-property: 1.0.2 - generative-bayesian-network@2.1.70: - dependencies: - adm-zip: 0.5.16 - tslib: 2.8.1 - generic-pool@3.9.0: {} gensync@1.0.0-beta.2: {} @@ -45854,16 +45844,6 @@ snapshots: gopd@1.2.0: {} - got-scraping@4.1.2: - dependencies: - got: 14.4.6 - header-generator: 2.1.70 - http2-wrapper: 2.2.1 - mimic-response: 4.0.0 - ow: 1.1.1 - quick-lru: 7.1.0 - tslib: 2.8.1 - got@11.8.6: dependencies: '@sindresorhus/is': 4.6.0 @@ -46108,13 +46088,6 @@ snapshots: he@1.2.0: {} - header-generator@2.1.70: - dependencies: - browserslist: 4.24.2 - generative-bayesian-network: 2.1.70 - ow: 0.28.2 - tslib: 2.8.1 - heap-js@2.5.0: {} help-me@3.0.0: