Skip to content

Commit 1fa2073

Browse files
committed
Update PostHog component versions and enhance URL handling
- Bump version of @pipedream/posthog to 0.2.1 and update @pipedream/platform dependency to ^3.1.0. - Increment action versions for capture-event, create-query, get-cohorts, get-persons, get-surveys, and new-action-performed to reflect recent changes. - Modify _baseUrl method to support public URL generation based on authentication instance.
1 parent b4a7915 commit 1fa2073

File tree

8 files changed

+19
-11
lines changed

8 files changed

+19
-11
lines changed

components/posthog/actions/capture-event/capture-event.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "posthog-capture-event",
55
name: "Capture Event",
66
description: "Captures a given event within the PostHog system. [See the documentation](https://posthog.com/docs/api/post-only-endpoints#single-event)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
type: "action",
99
props: {
1010
posthog,

components/posthog/actions/create-query/create-query.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "posthog-create-query",
55
name: "Create Query",
66
description: "Create a HogQLQuery and return the results. [See the documentation](https://posthog.com/docs/api/queries#creating-a-query)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
posthog,

components/posthog/actions/get-cohorts/get-cohorts.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "posthog-get-cohorts",
55
name: "Get Cohorts",
66
description: "Retrieve a list of cohorts. [See the documentation](https://posthog.com/docs/api/cohorts#get-api-projects-project_id-cohorts)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
posthog,

components/posthog/actions/get-persons/get-persons.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "posthog-get-persons",
55
name: "Get Persons",
66
description: "Retrieve a list of persons. [See the documentation](https://posthog.com/docs/api/persons#get-api-projects-project_id-persons)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
posthog,

components/posthog/actions/get-surveys/get-surveys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "posthog-get-surveys",
55
name: "Get Surveys",
66
description: "Retrieve a list of surveys. [See the documentation](https://posthog.com/docs/api/surveys#get-api-projects-project_id-surveys)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
posthog,

components/posthog/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/posthog",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Pipedream PostHog Components",
55
"main": "posthog.app.mjs",
66
"keywords": [
@@ -13,6 +13,6 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^3.0.3"
16+
"@pipedream/platform": "^3.1.0"
1717
}
1818
}

components/posthog/posthog.app.mjs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,24 @@ export default {
6969
},
7070
},
7171
methods: {
72-
_baseUrl() {
73-
return "https://app.posthog.com";
72+
_baseUrl(publicUrl = false) {
73+
const url = this.$auth.instance_url;
74+
if (publicUrl) {
75+
return `https://${url.substring(0, 2)}.i.${url.slice(3)}`;
76+
}
77+
return `https://${this.$auth.instance_url}`;
7478
},
7579
_makeRequest(opts = {}) {
7680
const {
7781
$ = this,
7882
path,
83+
publicUrl,
7984
...otherOpts
8085
} = opts;
86+
8187
return axios($, {
8288
...otherOpts,
83-
url: `${this._baseUrl()}${path}`,
89+
url: `${this._baseUrl(publicUrl)}${path}`,
8490
headers: {
8591
Authorization: `Bearer ${this.$auth.api_key}`,
8692
},
@@ -138,13 +144,15 @@ export default {
138144
return this._makeRequest({
139145
method: "POST",
140146
path: `/api/projects/${projectId}/query`,
147+
publicUrl: true,
141148
...opts,
142149
});
143150
},
144151
captureEvent(opts = {}) {
145152
return this._makeRequest({
146153
method: "POST",
147154
path: "/capture",
155+
publicUrl: true,
148156
...opts,
149157
});
150158
},

components/posthog/sources/new-action-performed/new-action-performed.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "posthog-new-action-performed",
66
name: "New Action Performed",
77
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)",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
type: "source",
1010
dedupe: "unique",
1111
props: {

0 commit comments

Comments
 (0)