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..51cd0da99a2a2 --- /dev/null +++ b/components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/evaluate-feature-flag/evaluate-feature-flag.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + 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/get-feature-flag-status/get-feature-flag-status.mjs b/components/launch_darkly_oauth/actions/get-feature-flag-status/get-feature-flag-status.mjs new file mode 100644 index 0000000000000..3cb16dc0dd7e3 --- /dev/null +++ b/components/launch_darkly_oauth/actions/get-feature-flag-status/get-feature-flag-status.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/get-feature-flag-status/get-feature-flag-status.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-get-feature-flag-status", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/components/launch_darkly_oauth/actions/get-feature-flag/get-feature-flag.mjs b/components/launch_darkly_oauth/actions/get-feature-flag/get-feature-flag.mjs new file mode 100644 index 0000000000000..701c65f9cd77c --- /dev/null +++ b/components/launch_darkly_oauth/actions/get-feature-flag/get-feature-flag.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/get-feature-flag/get-feature-flag.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-get-feature-flag", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/components/launch_darkly_oauth/actions/get-project/get-project.mjs b/components/launch_darkly_oauth/actions/get-project/get-project.mjs new file mode 100644 index 0000000000000..28ce217bb9125 --- /dev/null +++ b/components/launch_darkly_oauth/actions/get-project/get-project.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/get-project/get-project.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-get-project", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/components/launch_darkly_oauth/actions/list-environments/list-environments.mjs b/components/launch_darkly_oauth/actions/list-environments/list-environments.mjs new file mode 100644 index 0000000000000..7954b09023d4a --- /dev/null +++ b/components/launch_darkly_oauth/actions/list-environments/list-environments.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/list-environments/list-environments.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-list-environments", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/components/launch_darkly_oauth/actions/list-feature-flags/list-feature-flags.mjs b/components/launch_darkly_oauth/actions/list-feature-flags/list-feature-flags.mjs new file mode 100644 index 0000000000000..9f8384dc67a8c --- /dev/null +++ b/components/launch_darkly_oauth/actions/list-feature-flags/list-feature-flags.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/list-feature-flags/list-feature-flags.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-list-feature-flags", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/components/launch_darkly_oauth/actions/list-members/list-members.mjs b/components/launch_darkly_oauth/actions/list-members/list-members.mjs new file mode 100644 index 0000000000000..839abefe4384b --- /dev/null +++ b/components/launch_darkly_oauth/actions/list-members/list-members.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/list-members/list-members.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-list-members", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/components/launch_darkly_oauth/actions/list-projects/list-projects.mjs b/components/launch_darkly_oauth/actions/list-projects/list-projects.mjs new file mode 100644 index 0000000000000..5a2cfbe08ba47 --- /dev/null +++ b/components/launch_darkly_oauth/actions/list-projects/list-projects.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/list-projects/list-projects.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-list-projects", + 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..829bebbed95d7 --- /dev/null +++ b/components/launch_darkly_oauth/actions/toggle-feature-flag/toggle-feature-flag.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/toggle-feature-flag/toggle-feature-flag.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + 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..3b53cb0acca00 --- /dev/null +++ b/components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/actions/update-feature-flag/update-feature-flag.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + 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), + ); +} diff --git a/components/launch_darkly_oauth/launch_darkly_oauth.app.mjs b/components/launch_darkly_oauth/launch_darkly_oauth.app.mjs index b13a42295af5d..e8959379ac835 100644 --- a/components/launch_darkly_oauth/launch_darkly_oauth.app.mjs +++ b/components/launch_darkly_oauth/launch_darkly_oauth.app.mjs @@ -1,11 +1,17 @@ +import launchdarkly from "@pipedream/launchdarkly"; + export default { + ...launchdarkly, type: "app", 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 index f60df55b9581d..e67a6f3103588 100644 --- a/components/launch_darkly_oauth/package.json +++ b/components/launch_darkly_oauth/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/launch_darkly_oauth", - "version": "0.6.0", + "version": "0.7.0", "description": "Pipedream launch_darkly_oauth Components", "main": "launch_darkly_oauth.app.mjs", "keywords": [ @@ -13,6 +13,7 @@ "access": "public" }, "dependencies": { + "@pipedream/launchdarkly": "^0.1.1", "@pipedream/platform": "^3.0.0" } } 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..3021e1e6b7076 --- /dev/null +++ b/components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/sources/new-access-token-event/new-access-token-event.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-new-access-token-event", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; 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..34f86039efcaa --- /dev/null +++ b/components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/sources/new-flag-event/new-flag-event.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-new-flag-event", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...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..e37c7d69e90eb --- /dev/null +++ b/components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs @@ -0,0 +1,22 @@ +import app from "../../launch_darkly_oauth.app.mjs"; +import common from "@pipedream/launchdarkly/sources/new-user-event/new-user-event.mjs"; + +import { adjustPropDefinitions } from "../../common/utils.mjs"; + +const { + name, description, type, ...others +} = common; +const props = adjustPropDefinitions(others.props, app); + +export default { + ...others, + key: "launch_darkly_oauth-new-user-event", + version: "0.0.1", + name, + description, + type, + props: { + app, + ...props, + }, +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7888cf3ffdcae..3d3253c3e15a7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7623,6 +7623,9 @@ importers: components/launch_darkly_oauth: dependencies: + '@pipedream/launchdarkly': + specifier: ^0.1.1 + version: 0.1.1 '@pipedream/platform': specifier: ^3.0.0 version: 3.0.3 @@ -20255,6 +20258,9 @@ packages: '@pipedream/helpers@1.3.12': resolution: {integrity: sha512-k305RiFddUBtKY11V9G2aqYD8ICgarHV+A0Isxh0j3il4asnht0q4+t6ykPOb+hl5uo9UV8WY+9eAWlj6VFt6Q==} + '@pipedream/launchdarkly@0.1.1': + resolution: {integrity: sha512-RqW4cJ0CfCnCy/lCutIJNSlX3IXV3jxoyqxDgAeHx8Q8BUEjEl7T0+1vMLyNXhU+V4Kj38KVURnSKqCE59UVvg==} + '@pipedream/linear_app@0.7.5': resolution: {integrity: sha512-Y9JRcEYAFWHftWQ6uMtt2kxCBcLtCBgOXjEDY2XrqmDL36LBfWzcZFpr8GVZ91s/ftTW5gLqCWmNeuXeffqhhA==} @@ -39577,6 +39583,13 @@ snapshots: '@pipedream/types': 0.0.5 lodash-es: 4.17.21 + '@pipedream/launchdarkly@0.1.1': + dependencies: + '@pipedream/platform': 3.0.3 + uuid: 11.1.0 + transitivePeerDependencies: + - debug + '@pipedream/linear_app@0.7.5': dependencies: '@linear/sdk': 55.1.0