Adding Additional Source to Clickup Using PropDefinition from Original Component

This topic was automatically generated from Slack. You can find the original thread here.

Hello guys. I’m trying to add additional source for clickup. Is there a way for me to use propDefinition from the original clickup component (pipedream/clickup.app.mjs at master · PipedreamHQ/pipedream · GitHub) ?

Yea I recommend looking at some of the other existing sources. You’ll see that they import either import common from "../common/common.mjs";, which also imports the main app file.

it works if you want to add that changes to the main repo. But I was wondering if that’s possible for source uploaded via pd dev

Ah I gotcha. You should also be able to import as an NPM package @pipedream/clickup - npm

resolved the problem by cloning repo, and applying my changes there, so could point pd dev to modified version.

btw, one more thing. Trying to reach methods defined in clickup component from my action, but it says it can’t see them. Documentation says it’s possible, but it doesn’t work for me :frowning:

Can you paste some of the relevant code here?

Posted thread to Discourse: Adding Additional Source to Clickup: Can I Use PropDefinition from Original Component?

sorry for the delay. here’s a simple example

import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    clickup: {
      type: "app",
      app: "clickup",
    }
  },
  async run({steps, $}) {
    console.dir(this.clickup);
    return await axios($, {
      url: `https://api.clickup.com/api/v2/user`,
      headers: {
        "content-type": `application/json`,
        "Authorization": `${this.clickup.$auth.oauth_access_token}`,
      },
    })
  },
})

I expect this.clickup contains all methods we have here pipedream/clickup.app.mjs at master · PipedreamHQ/pipedream · GitHub, but seems like it doesn’t work that way :frowning:

Ah, no, I see how that’s confusing. The app prop only contains auth-related info (see how the oauth_access_token is passed in the Authorization header). You’ll need to either import the npm package or the app file from the repo, since it sounds like you ended up cloning the repo, right?

yes, I did clone it. but thought it’s possible to have access to the full app object via app prop. Anyway, thank you for your help