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
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
22 changes: 22 additions & 0 deletions components/launch_darkly_oauth/actions/get-project/get-project.mjs
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
40 changes: 40 additions & 0 deletions components/launch_darkly_oauth/common/utils.mjs
Original file line number Diff line number Diff line change
@@ -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),
);
}
14 changes: 10 additions & 4 deletions components/launch_darkly_oauth/launch_darkly_oauth.app.mjs
Original file line number Diff line number Diff line change
@@ -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}`,
};
},
},
};
3 changes: 2 additions & 1 deletion components/launch_darkly_oauth/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -13,6 +13,7 @@
"access": "public"
},
"dependencies": {
"@pipedream/launchdarkly": "^0.1.1",
"@pipedream/platform": "^3.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
Original file line number Diff line number Diff line change
@@ -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,
},
};
Loading
Loading