From a907de83befcdfcff721f99391fa2b0e196c7351 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 13 Jan 2025 02:15:09 -0300 Subject: [PATCH 1/7] Launchdarkly OAuth app and package --- .../launch_darkly_oauth.app.mjs | 15 ++++++++++----- components/launch_darkly_oauth/package.json | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 components/launch_darkly_oauth/package.json diff --git a/components/launch_darkly_oauth/launch_darkly_oauth.app.mjs b/components/launch_darkly_oauth/launch_darkly_oauth.app.mjs index b13a42295af5d..3efa1fe86f94f 100644 --- a/components/launch_darkly_oauth/launch_darkly_oauth.app.mjs +++ b/components/launch_darkly_oauth/launch_darkly_oauth.app.mjs @@ -1,11 +1,16 @@ +import launchdarkly from "../launchdarkly/launchdarkly.app.mjs"; + export default { - type: "app", + ...launchdarkly, app: "launch_darkly_oauth", - propDefinitions: {}, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + ...launchdarkly.methods, + getHeaders(headers) { + return { + "Content-Type": "application/json", + ...headers, + "Authorization": `Bearer ${this.$auth.oauth_access_token}`, + }; }, }, }; diff --git a/components/launch_darkly_oauth/package.json b/components/launch_darkly_oauth/package.json new file mode 100644 index 0000000000000..6c12be18db772 --- /dev/null +++ b/components/launch_darkly_oauth/package.json @@ -0,0 +1,18 @@ +{ + "name": "@pipedream/launch_darkly_oauth", + "version": "0.0.1", + "description": "Pipedream LaunchDarkly (OAuth) Components", + "main": "launch_darkly_oauth.app.mjs", + "keywords": [ + "pipedream", + "launch_darkly_oauth" + ], + "homepage": "https://pipedream.com/apps/launch_darkly_oauth", + "author": "Pipedream (https://pipedream.com/)", + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" + } +} From 037838977457d966a1c8882ada2d4a4deb42bdbb Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 13 Jan 2025 02:18:19 -0300 Subject: [PATCH 2/7] Sharing Launchdarkly actions (replacing app in propDefinitions) --- .../evaluate-feature-flag.mjs | 21 ++++++++++ .../toggle-feature-flag.mjs | 21 ++++++++++ .../update-feature-flag.mjs | 21 ++++++++++ .../launch_darkly_oauth/common/utils.mjs | 40 +++++++++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs create mode 100644 components/launch_darkly_oauth/actions/toggle-feature-flag/toggle-feature-flag.mjs create mode 100644 components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs create mode 100644 components/launch_darkly_oauth/common/utils.mjs diff --git a/components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs b/components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs new file mode 100644 index 0000000000000..9557e12f8ceaf --- /dev/null +++ b/components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs @@ -0,0 +1,21 @@ +import { adjustPropDefinitions } from "../../common/utils.mjs"; +import component from "../../../launchdarkly/actions/evaluate-feature-flag/evaluate-feature-flag.mjs"; +import app from "../../launch_darkly_oauth.app.mjs"; + +const { + name, description, type, ...others +} = component; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...component, + key: "launch_darkly_oauth-evaluate-feature-flag", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/components/launch_darkly_oauth/actions/toggle-feature-flag/toggle-feature-flag.mjs b/components/launch_darkly_oauth/actions/toggle-feature-flag/toggle-feature-flag.mjs new file mode 100644 index 0000000000000..4af9bb39fdd60 --- /dev/null +++ b/components/launch_darkly_oauth/actions/toggle-feature-flag/toggle-feature-flag.mjs @@ -0,0 +1,21 @@ +import { adjustPropDefinitions } from "../../common/utils.mjs"; +import component from "../../../launchdarkly/actions/toggle-feature-flag/toggle-feature-flag.mjs"; +import app from "../../launch_darkly_oauth.app.mjs"; + +const { + name, description, type, ...others +} = component; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...component, + key: "launch_darkly_oauth-toggle-feature-flag", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs b/components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs new file mode 100644 index 0000000000000..1764a363d5188 --- /dev/null +++ b/components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs @@ -0,0 +1,21 @@ +import { adjustPropDefinitions } from "../../common/utils.mjs"; +import component from "../../../launchdarkly/actions/update-feature-flag/update-feature-flag.mjs"; +import app from "../../launch_darkly_oauth.app.mjs"; + +const { + name, description, type, ...others +} = component; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...component, + key: "launch_darkly_oauth-update-feature-flag", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/components/launch_darkly_oauth/common/utils.mjs b/components/launch_darkly_oauth/common/utils.mjs new file mode 100644 index 0000000000000..d42df055ddeb0 --- /dev/null +++ b/components/launch_darkly_oauth/common/utils.mjs @@ -0,0 +1,40 @@ +export function adjustPropDefinitions(props, app) { + return Object.fromEntries( + Object.entries(props).map(([ + key, + prop, + ]) => { + if (typeof prop === "string") return [ + key, + prop, + ]; + const { + propDefinition, ...otherValues + } = prop; + if (propDefinition) { + const [ + , ...otherDefs + ] = propDefinition; + return [ + key, + { + propDefinition: [ + app, + ...otherDefs, + ], + ...otherValues, + }, + ]; + } + return [ + key, + otherValues.type === "app" + ? null + : otherValues, + ]; + }) + .filter(([ + , value, + ]) => value), + ); +} From 94be0091a90ff6af5fc296ac7c2748163cc49998 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 13 Jan 2025 02:31:50 -0300 Subject: [PATCH 3/7] Sharing Launchdarkly sources --- .../sources/common/webhook.mjs | 14 +++++++++++ .../new-access-token-event.mjs | 24 +++++++++++++++++++ .../sources/new-flag-event/new-flag-event.mjs | 16 +++++++++++++ .../sources/new-user-event/new-user-event.mjs | 16 +++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 components/launch_darkly_oauth/sources/common/webhook.mjs create mode 100644 components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs create mode 100644 components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs create mode 100644 components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs diff --git a/components/launch_darkly_oauth/sources/common/webhook.mjs b/components/launch_darkly_oauth/sources/common/webhook.mjs new file mode 100644 index 0000000000000..ce05f60d1e836 --- /dev/null +++ b/components/launch_darkly_oauth/sources/common/webhook.mjs @@ -0,0 +1,14 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "../../../launchdarkly/sources/common/webhook.mjs"; + +export default { + ...common, + props: { + app, + db: "$.service.db", + http: { + type: "$.interface.http", + customResponse: true, + }, + }, +}; diff --git a/components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs b/components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs new file mode 100644 index 0000000000000..ffaf22f90309f --- /dev/null +++ b/components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs @@ -0,0 +1,24 @@ +import common from "../common/webhook.mjs"; +import component from "../../../launchdarkly/sources/new-access-token-event/new-access-token-event.mjs"; + +const { + name, description, type, +} = component; + +export default { + ...component, + key: "launch_darkly_oauth-new-access-token-event", + version: "0.0.1", + name, + description, + type, + props: { + ...common.props, + memberId: { + propDefinition: [ + common.props.app, + "memberId", + ], + }, + }, +}; diff --git a/components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs b/components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs new file mode 100644 index 0000000000000..62033323c38a7 --- /dev/null +++ b/components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs @@ -0,0 +1,16 @@ +import common from "../common/webhook.mjs"; +import component from "../../../launchdarkly/sources/new-flag-event/new-flag-event.mjs"; + +const { + name, description, type, +} = component; + +export default { + ...component, + key: "launch_darkly_oauth-new-flag-event", + version: "0.0.1", + name, + description, + type, + props: common.props, +}; diff --git a/components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs b/components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs new file mode 100644 index 0000000000000..b8a8c5cdd5cb3 --- /dev/null +++ b/components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs @@ -0,0 +1,16 @@ +import common from "../common/webhook.mjs"; +import component from "../../../launchdarkly/sources/new-user-event/new-user-event.mjs"; + +const { + name, description, type, +} = component; + +export default { + ...component, + key: "launch_darkly_oauth-new-user-event", + version: "0.0.1", + name, + description, + type, + props: common.props, +}; From 8049e5129ad106093859797db4554085f047cbbc Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Mon, 13 Jan 2025 02:33:56 -0300 Subject: [PATCH 4/7] pnpm-lock --- pnpm-lock.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ba71ead05668a..ad8333db327b3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5695,6 +5695,12 @@ importers: components/lattice: {} + components/launch_darkly_oauth: + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 + components/launchdarkly: dependencies: '@pipedream/platform': From abe93c2bc51c7be6bbc16fc18e7d3be18d3979ef Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Thu, 16 Jan 2025 19:15:28 -0300 Subject: [PATCH 5/7] pnpm --- pnpm-lock.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 581b482ea5671..c5cd6b94e44db 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1554,8 +1554,7 @@ importers: components/calllerapi: {} - components/callminer: - specifiers: {} + components/callminer: {} components/callpage: dependencies: @@ -6033,8 +6032,7 @@ importers: components/logistia_route_planner: {} - components/logo_dev: - specifiers: {} + components/logo_dev: {} components/logoraisr: {} From db3425ec661a82a7611b71937f9ea367850c4a09 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Fri, 4 Apr 2025 12:24:17 -0300 Subject: [PATCH 6/7] pnpm --- pnpm-lock.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a894ef0641a79..67736a8478b25 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16462,8 +16462,8 @@ packages: '@dabh/diagnostics@2.0.3': resolution: {integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==} - '@definitelytyped/header-parser@0.2.18': - resolution: {integrity: sha512-3JWGzhieGOx+zhy+qaPDoiby2TPA1PZGpEJHt0VwR1aK0R9dER5BoBvnT5zSafg9kHQTw4aBRFbt3o41FNkaLw==} + '@definitelytyped/header-parser@0.2.19': + resolution: {integrity: sha512-zu+RxQpUCgorYUQZoyyrRIn9CljL1CeM4qak3NDeMO1r7tjAkodfpAGnVzx/6JR2OUk0tAgwmZxNMSwd9LVgxw==} engines: {node: '>=18.18.0'} '@definitelytyped/typescript-versions@0.1.8': @@ -32205,7 +32205,7 @@ snapshots: enabled: 2.0.0 kuler: 2.0.0 - '@definitelytyped/header-parser@0.2.18': + '@definitelytyped/header-parser@0.2.19': dependencies: '@definitelytyped/typescript-versions': 0.1.8 '@definitelytyped/utils': 0.1.8 @@ -38845,7 +38845,7 @@ snapshots: dts-critic@3.3.11(typescript@5.7.2): dependencies: - '@definitelytyped/header-parser': 0.2.18 + '@definitelytyped/header-parser': 0.2.19 command-exists: 1.2.9 rimraf: 3.0.2 semver: 6.3.1 @@ -38855,7 +38855,7 @@ snapshots: dtslint@4.2.1(typescript@5.7.2): dependencies: - '@definitelytyped/header-parser': 0.2.18 + '@definitelytyped/header-parser': 0.2.19 '@definitelytyped/typescript-versions': 0.1.8 '@definitelytyped/utils': 0.1.8 dts-critic: 3.3.11(typescript@5.7.2) From fef98cc335dfbef43f21ab289b924f1701d93bf5 Mon Sep 17 00:00:00 2001 From: GTFalcao Date: Wed, 9 Apr 2025 16:31:22 -0300 Subject: [PATCH 7/7] pnpm --- pnpm-lock.yaml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e0dd3ec1296f..adbb47d4b767c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4922,8 +4922,7 @@ importers: components/gatekeeper: {} - components/gather: - specifiers: {} + components/gather: {} components/gatherup: dependencies: @@ -8822,8 +8821,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/onehash: - specifiers: {} + components/onehash: {} components/onelogin: {} @@ -10162,8 +10160,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/public_record: - specifiers: {} + components/public_record: {} components/publisherkit: dependencies: @@ -10213,8 +10210,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/pushengage: - specifiers: {} + components/pushengage: {} components/pusher: dependencies: @@ -27894,22 +27890,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + 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 v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + 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 v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + 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 downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731) + 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@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} @@ -34502,6 +34498,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: