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
2 changes: 1 addition & 1 deletion components/posthog/actions/capture-event/capture-event.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "posthog-capture-event",
name: "Capture Event",
description: "Captures a given event within the PostHog system. [See the documentation](https://posthog.com/docs/api/post-only-endpoints#single-event)",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
posthog,
Expand Down
2 changes: 1 addition & 1 deletion components/posthog/actions/create-query/create-query.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "posthog-create-query",
name: "Create Query",
description: "Create a HogQLQuery and return the results. [See the documentation](https://posthog.com/docs/api/queries#creating-a-query)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
posthog,
Expand Down
2 changes: 1 addition & 1 deletion components/posthog/actions/get-cohorts/get-cohorts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "posthog-get-cohorts",
name: "Get Cohorts",
description: "Retrieve a list of cohorts. [See the documentation](https://posthog.com/docs/api/cohorts#get-api-projects-project_id-cohorts)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
posthog,
Expand Down
2 changes: 1 addition & 1 deletion components/posthog/actions/get-persons/get-persons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "posthog-get-persons",
name: "Get Persons",
description: "Retrieve a list of persons. [See the documentation](https://posthog.com/docs/api/persons#get-api-projects-project_id-persons)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
posthog,
Expand Down
2 changes: 1 addition & 1 deletion components/posthog/actions/get-surveys/get-surveys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "posthog-get-surveys",
name: "Get Surveys",
description: "Retrieve a list of surveys. [See the documentation](https://posthog.com/docs/api/surveys#get-api-projects-project_id-surveys)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
posthog,
Expand Down
4 changes: 2 additions & 2 deletions components/posthog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/posthog",
"version": "0.2.0",
"version": "0.2.1",
"description": "Pipedream PostHog Components",
"main": "posthog.app.mjs",
"keywords": [
Expand All @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
"@pipedream/platform": "^3.1.0"
}
}
14 changes: 11 additions & 3 deletions components/posthog/posthog.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,24 @@ export default {
},
},
methods: {
_baseUrl() {
return "https://app.posthog.com";
_baseUrl(publicUrl = false) {
const url = this.$auth.instance_url;
if (publicUrl) {
return `https://${url.substring(0, 2)}.i.${url.slice(3)}`;
}
return `https://${this.$auth.instance_url}`;
},
_makeRequest(opts = {}) {
const {
$ = this,
path,
publicUrl,
...otherOpts
} = opts;

return axios($, {
...otherOpts,
url: `${this._baseUrl()}${path}`,
url: `${this._baseUrl(publicUrl)}${path}`,
headers: {
Authorization: `Bearer ${this.$auth.api_key}`,
},
Expand Down Expand Up @@ -138,13 +144,15 @@ export default {
return this._makeRequest({
method: "POST",
path: `/api/projects/${projectId}/query`,
publicUrl: true,
...opts,
});
},
captureEvent(opts = {}) {
return this._makeRequest({
method: "POST",
path: "/capture",
publicUrl: true,
...opts,
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "posthog-new-action-performed",
name: "New Action Performed",
description: "Emit new event when an action is performed in a project. [See the documentation](https://posthog.com/docs/api/query#post-api-projects-project_id-query)",
version: "0.0.2",
version: "0.0.3",
type: "source",
dedupe: "unique",
props: {
Expand Down
18 changes: 8 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading