@keystrokehq/posthog 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_official/index.d.mts +1 -1
- package/dist/_official/index.mjs +1 -1
- package/dist/_runtime/index.d.mts +1 -2
- package/dist/_runtime/index.mjs +1 -1
- package/dist/actions.d.mts +13 -13
- package/dist/actions.mjs +6 -6
- package/dist/annotations.d.mts +6 -6
- package/dist/annotations.mjs +6 -6
- package/dist/capture.d.mts +8 -8
- package/dist/capture.mjs +8 -8
- package/dist/client.d.mts +1 -2
- package/dist/client.mjs +1 -1
- package/dist/cohorts.d.mts +9 -9
- package/dist/cohorts.mjs +9 -9
- package/dist/connection.d.mts +1 -1
- package/dist/connection.mjs +1 -1
- package/dist/dashboards.d.mts +17 -17
- package/dist/dashboards.mjs +17 -17
- package/dist/decide.d.mts +3 -3
- package/dist/decide.mjs +3 -3
- package/dist/events-management.d.mts +11 -11
- package/dist/events-management.mjs +11 -11
- package/dist/factory-C3ssyfSy.mjs +7 -0
- package/dist/feature-flags.d.mts +16 -16
- package/dist/feature-flags.mjs +16 -16
- package/dist/http-BYcjqxPi.mjs +84 -0
- package/dist/insights.d.mts +17 -17
- package/dist/insights.mjs +17 -17
- package/dist/{integration-Td6D39_E.d.mts → integration-BN7xcpga.d.mts} +15 -5
- package/dist/integration-D0HdrI0T.mjs +120 -0
- package/dist/organizations.d.mts +12 -12
- package/dist/organizations.mjs +12 -12
- package/dist/persons.d.mts +16 -16
- package/dist/persons.mjs +16 -16
- package/dist/projects.d.mts +14 -14
- package/dist/projects.mjs +14 -14
- package/dist/schemas.d.mts +3 -3
- package/dist/session-recordings.d.mts +15 -15
- package/dist/session-recordings.mjs +15 -15
- package/dist/surveys.d.mts +16 -16
- package/dist/surveys.mjs +10 -10
- package/dist/triggers.d.mts +5 -3
- package/dist/triggers.mjs +52 -3
- package/dist/webhook-management.d.mts +10 -10
- package/dist/webhook-management.mjs +7 -7
- package/package.json +4 -4
- package/dist/factory-DYDvHOGb.mjs +0 -8
- package/dist/integration-Doy2Dwli.mjs +0 -30
package/dist/surveys.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
3
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
4
4
|
|
|
5
5
|
//#region src/surveys.d.ts
|
|
6
6
|
declare const listSurveys: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
@@ -17,12 +17,12 @@ declare const listSurveys: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
17
17
|
name: z.ZodOptional<z.ZodString>;
|
|
18
18
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
19
|
type: z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
email: "email";
|
|
20
21
|
popover: "popover";
|
|
21
22
|
api: "api";
|
|
22
23
|
widget: "widget";
|
|
23
24
|
button: "button";
|
|
24
25
|
full_screen: "full_screen";
|
|
25
|
-
email: "email";
|
|
26
26
|
}>>;
|
|
27
27
|
questions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
28
28
|
conditions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
@@ -35,7 +35,7 @@ declare const listSurveys: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
35
35
|
created_at: z.ZodOptional<z.ZodString>;
|
|
36
36
|
created_by: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
37
37
|
}, z.core.$strip>>;
|
|
38
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
38
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
39
39
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
40
40
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
41
41
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -56,12 +56,12 @@ declare const getSurvey: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
56
56
|
name: z.ZodOptional<z.ZodString>;
|
|
57
57
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
58
|
type: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
email: "email";
|
|
59
60
|
popover: "popover";
|
|
60
61
|
api: "api";
|
|
61
62
|
widget: "widget";
|
|
62
63
|
button: "button";
|
|
63
64
|
full_screen: "full_screen";
|
|
64
|
-
email: "email";
|
|
65
65
|
}>>;
|
|
66
66
|
questions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
67
67
|
conditions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
@@ -73,7 +73,7 @@ declare const getSurvey: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
73
73
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
74
74
|
created_at: z.ZodOptional<z.ZodString>;
|
|
75
75
|
created_by: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
76
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
76
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
77
77
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
78
78
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
79
79
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -90,12 +90,12 @@ declare const createSurvey: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
90
90
|
name: z.ZodString;
|
|
91
91
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
92
|
type: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
email: "email";
|
|
93
94
|
popover: "popover";
|
|
94
95
|
api: "api";
|
|
95
96
|
widget: "widget";
|
|
96
97
|
button: "button";
|
|
97
98
|
full_screen: "full_screen";
|
|
98
|
-
email: "email";
|
|
99
99
|
}>>;
|
|
100
100
|
questions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
101
101
|
conditions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
@@ -111,12 +111,12 @@ declare const createSurvey: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
111
111
|
name: z.ZodOptional<z.ZodString>;
|
|
112
112
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
113
|
type: z.ZodOptional<z.ZodEnum<{
|
|
114
|
+
email: "email";
|
|
114
115
|
popover: "popover";
|
|
115
116
|
api: "api";
|
|
116
117
|
widget: "widget";
|
|
117
118
|
button: "button";
|
|
118
119
|
full_screen: "full_screen";
|
|
119
|
-
email: "email";
|
|
120
120
|
}>>;
|
|
121
121
|
questions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
122
122
|
conditions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
@@ -128,7 +128,7 @@ declare const createSurvey: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
128
128
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
129
129
|
created_at: z.ZodOptional<z.ZodString>;
|
|
130
130
|
created_by: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
131
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
131
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
132
132
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
133
133
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
134
134
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -145,12 +145,12 @@ declare const updateSurvey: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
145
145
|
name: z.ZodOptional<z.ZodString>;
|
|
146
146
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
147
|
type: z.ZodOptional<z.ZodEnum<{
|
|
148
|
+
email: "email";
|
|
148
149
|
popover: "popover";
|
|
149
150
|
api: "api";
|
|
150
151
|
widget: "widget";
|
|
151
152
|
button: "button";
|
|
152
153
|
full_screen: "full_screen";
|
|
153
|
-
email: "email";
|
|
154
154
|
}>>;
|
|
155
155
|
questions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
156
156
|
conditions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
@@ -167,12 +167,12 @@ declare const updateSurvey: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
167
167
|
name: z.ZodOptional<z.ZodString>;
|
|
168
168
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
169
169
|
type: z.ZodOptional<z.ZodEnum<{
|
|
170
|
+
email: "email";
|
|
170
171
|
popover: "popover";
|
|
171
172
|
api: "api";
|
|
172
173
|
widget: "widget";
|
|
173
174
|
button: "button";
|
|
174
175
|
full_screen: "full_screen";
|
|
175
|
-
email: "email";
|
|
176
176
|
}>>;
|
|
177
177
|
questions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
178
178
|
conditions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
@@ -184,7 +184,7 @@ declare const updateSurvey: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
184
184
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
185
185
|
created_at: z.ZodOptional<z.ZodString>;
|
|
186
186
|
created_by: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
187
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
187
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
188
188
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
189
189
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
190
190
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -202,7 +202,7 @@ declare const deleteSurvey: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
202
202
|
projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
203
203
|
}, z.core.$strip>, z.ZodObject<{
|
|
204
204
|
success: z.ZodBoolean;
|
|
205
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
205
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
206
206
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
207
207
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
208
208
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -221,7 +221,7 @@ declare const getSurveyActivity: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
221
221
|
projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
222
222
|
}, z.core.$strip>, z.ZodObject<{
|
|
223
223
|
results: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
224
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
224
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
225
225
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
226
226
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
227
227
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -239,7 +239,7 @@ declare const getSurveysActivityFeed: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
239
239
|
projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
240
240
|
}, z.core.$strip>, z.ZodObject<{
|
|
241
241
|
results: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
242
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
242
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
243
243
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
244
244
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
245
245
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -254,7 +254,7 @@ declare const getSurveysActivityFeed: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
254
254
|
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
255
255
|
declare const getSurveyResponsesCount: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
256
256
|
projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
257
|
-
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
257
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
258
258
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
259
259
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
260
260
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -270,7 +270,7 @@ declare const getSurveyResponsesCount: _keystrokehq_core0.Operation<z.ZodObject<
|
|
|
270
270
|
declare const getSurveyStats: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
271
271
|
id: z.ZodString;
|
|
272
272
|
projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
273
|
-
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
273
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
274
274
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
275
275
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
276
276
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
package/dist/surveys.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createPosthogManagementClient } from "./client.mjs";
|
|
2
2
|
import { paginatedResponseSchema, projectIdInputShape, surveySchema } from "./schemas.mjs";
|
|
3
|
-
import { t as posthogOperation } from "./factory-
|
|
3
|
+
import { t as posthogOperation } from "./factory-C3ssyfSy.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/surveys.ts
|
|
@@ -36,7 +36,7 @@ const writeShape = {
|
|
|
36
36
|
archived: z.boolean().optional()
|
|
37
37
|
};
|
|
38
38
|
const listSurveys = posthogOperation({
|
|
39
|
-
id: "
|
|
39
|
+
id: "posthog.surveys-list",
|
|
40
40
|
name: "PostHog List Surveys",
|
|
41
41
|
description: "List surveys in a project",
|
|
42
42
|
input: z.object({
|
|
@@ -61,7 +61,7 @@ const listSurveys = posthogOperation({
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
const getSurvey = posthogOperation({
|
|
64
|
-
id: "
|
|
64
|
+
id: "posthog.surveys-get",
|
|
65
65
|
name: "PostHog Get Survey",
|
|
66
66
|
description: "Retrieve a survey by id",
|
|
67
67
|
input: z.object(idInput),
|
|
@@ -76,7 +76,7 @@ const getSurvey = posthogOperation({
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
const createSurvey = posthogOperation({
|
|
79
|
-
id: "
|
|
79
|
+
id: "posthog.surveys-create",
|
|
80
80
|
name: "PostHog Create Survey",
|
|
81
81
|
description: "Create a new survey",
|
|
82
82
|
input: z.object({
|
|
@@ -98,7 +98,7 @@ const createSurvey = posthogOperation({
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
const updateSurvey = posthogOperation({
|
|
101
|
-
id: "
|
|
101
|
+
id: "posthog.surveys-update",
|
|
102
102
|
name: "PostHog Update Survey",
|
|
103
103
|
description: "Partial update to a survey",
|
|
104
104
|
input: z.object({
|
|
@@ -119,7 +119,7 @@ const updateSurvey = posthogOperation({
|
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
const deleteSurvey = posthogOperation({
|
|
122
|
-
id: "
|
|
122
|
+
id: "posthog.surveys-delete",
|
|
123
123
|
name: "PostHog Delete Survey",
|
|
124
124
|
description: "Delete (archive) a survey",
|
|
125
125
|
input: z.object(idInput),
|
|
@@ -136,7 +136,7 @@ const deleteSurvey = posthogOperation({
|
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
const getSurveyActivity = posthogOperation({
|
|
139
|
-
id: "
|
|
139
|
+
id: "posthog.surveys-activity",
|
|
140
140
|
name: "PostHog Survey Activity",
|
|
141
141
|
description: "Fetch activity log for a survey",
|
|
142
142
|
input: z.object({
|
|
@@ -155,7 +155,7 @@ const getSurveyActivity = posthogOperation({
|
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
const getSurveysActivityFeed = posthogOperation({
|
|
158
|
-
id: "
|
|
158
|
+
id: "posthog.surveys-activity-feed",
|
|
159
159
|
name: "PostHog Surveys Activity Feed",
|
|
160
160
|
description: "Fetch project-wide survey activity feed",
|
|
161
161
|
input: z.object({
|
|
@@ -174,7 +174,7 @@ const getSurveysActivityFeed = posthogOperation({
|
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
176
|
const getSurveyResponsesCount = posthogOperation({
|
|
177
|
-
id: "
|
|
177
|
+
id: "posthog.surveys-responses-count",
|
|
178
178
|
name: "PostHog Survey Responses Count",
|
|
179
179
|
description: "Fetch the responses count for all surveys",
|
|
180
180
|
input: z.object(projectIdInputShape),
|
|
@@ -189,7 +189,7 @@ const getSurveyResponsesCount = posthogOperation({
|
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
const getSurveyStats = posthogOperation({
|
|
192
|
-
id: "
|
|
192
|
+
id: "posthog.surveys-stats",
|
|
193
193
|
name: "PostHog Survey Stats",
|
|
194
194
|
description: "Fetch aggregate statistics for a survey",
|
|
195
195
|
input: z.object(idInput),
|
package/dist/triggers.d.mts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { n as posthog } from "./integration-
|
|
1
|
+
import { n as posthog } from "./integration-BN7xcpga.mjs";
|
|
2
|
+
import { BoundTrigger, Operation } from "@keystrokehq/core";
|
|
2
3
|
import { z } from "zod";
|
|
3
|
-
import { IntegrationTriggerBindingOptions, createPollingTriggerBindingFactory } from "@keystrokehq/integration-authoring";
|
|
4
|
-
import { BoundTrigger } from "@keystrokehq/core";
|
|
5
4
|
import { PollingTriggerManifest } from "@keystrokehq/core/trigger";
|
|
6
5
|
|
|
6
|
+
//#region ../../packages/integration-authoring/dist/index.d.mts
|
|
7
|
+
declare function createPollingTriggerBindingFactory(config: any): (options: any) => any;
|
|
8
|
+
//#endregion
|
|
7
9
|
//#region src/triggers.d.ts
|
|
8
10
|
type PosthogCredentialSets = readonly [typeof posthog];
|
|
9
11
|
type Schedule = Parameters<typeof createPollingTriggerBindingFactory>[0]['schedule'];
|
package/dist/triggers.mjs
CHANGED
|
@@ -1,15 +1,64 @@
|
|
|
1
|
-
import { t as posthog } from "./integration-
|
|
1
|
+
import { t as posthog } from "./integration-D0HdrI0T.mjs";
|
|
2
2
|
import { createPosthogManagementClient } from "./client.mjs";
|
|
3
|
+
import { Operation } from "@keystrokehq/core";
|
|
3
4
|
import { z } from "zod";
|
|
4
|
-
import {
|
|
5
|
+
import { pollingTrigger } from "@keystrokehq/core/trigger";
|
|
5
6
|
|
|
7
|
+
//#region ../../packages/integration-authoring/dist/index.mjs
|
|
8
|
+
const IntegrationConfigSchema = z.object({
|
|
9
|
+
id: z.string().min(1),
|
|
10
|
+
name: z.string().min(1),
|
|
11
|
+
description: z.string().optional()
|
|
12
|
+
});
|
|
13
|
+
function resolveMetadata(metadata, defaults) {
|
|
14
|
+
return {
|
|
15
|
+
id: metadata?.id ?? defaults.defaultId,
|
|
16
|
+
description: metadata?.description ?? defaults.defaultDescription
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function resolveAuthorPayload(payload, mapPayload) {
|
|
20
|
+
if (!mapPayload) return payload;
|
|
21
|
+
return mapPayload(payload);
|
|
22
|
+
}
|
|
23
|
+
function createIntegrationTriggerBindingFactory(config) {
|
|
24
|
+
const bind = (options) => {
|
|
25
|
+
const resolvedMetadata = resolveMetadata(options, config);
|
|
26
|
+
const baseTrigger = config.createBaseTrigger(resolvedMetadata);
|
|
27
|
+
const userTransform = options?.transform;
|
|
28
|
+
return baseTrigger({ transform: userTransform || config.mapPayload ? (runtimePayload, request) => {
|
|
29
|
+
const authorPayload = resolveAuthorPayload(runtimePayload, config.mapPayload);
|
|
30
|
+
if (authorPayload === null) throw new Error(`Trigger "${resolvedMetadata.id}" mapPayload returned null after the trigger filter passed; tighten the trigger filter schema.`);
|
|
31
|
+
if (!userTransform) return authorPayload;
|
|
32
|
+
return userTransform(authorPayload, request);
|
|
33
|
+
} : void 0 });
|
|
34
|
+
};
|
|
35
|
+
return Object.freeze(bind);
|
|
36
|
+
}
|
|
37
|
+
function createPollingTriggerBindingFactory(config) {
|
|
38
|
+
return createIntegrationTriggerBindingFactory({
|
|
39
|
+
defaultId: config.defaultId,
|
|
40
|
+
defaultDescription: config.defaultDescription,
|
|
41
|
+
mapPayload: config.mapPayload,
|
|
42
|
+
createBaseTrigger: (metadata) => pollingTrigger({
|
|
43
|
+
id: metadata.id,
|
|
44
|
+
description: metadata.description,
|
|
45
|
+
schedule: config.schedule,
|
|
46
|
+
response: config.response,
|
|
47
|
+
poll: config.poll,
|
|
48
|
+
...config.credentialSets ? { credentialSets: config.credentialSets } : {},
|
|
49
|
+
...config.filter ? { filter: config.filter } : {}
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
6
55
|
//#region src/triggers.ts
|
|
7
56
|
function withDefaultSchedule(schedule) {
|
|
8
57
|
if (schedule === void 0) return "1m";
|
|
9
58
|
return schedule;
|
|
10
59
|
}
|
|
11
60
|
function extractCredentials(ctx) {
|
|
12
|
-
return ctx.credentials["
|
|
61
|
+
return ctx.credentials["posthog"];
|
|
13
62
|
}
|
|
14
63
|
function createPosthogPollingBindingFactory(config) {
|
|
15
64
|
return createPollingTriggerBindingFactory({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
3
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
4
4
|
|
|
5
5
|
//#region src/webhook-management.d.ts
|
|
6
6
|
declare const listActionWebhooks: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
@@ -20,9 +20,9 @@ declare const listActionWebhooks: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
20
20
|
event: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
21
|
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
22
|
url_matching: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
23
|
+
exact: "exact";
|
|
23
24
|
contains: "contains";
|
|
24
25
|
regex: "regex";
|
|
25
|
-
exact: "exact";
|
|
26
26
|
}>>>;
|
|
27
27
|
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
28
|
href: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -34,7 +34,7 @@ declare const listActionWebhooks: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
34
34
|
deleted: z.ZodOptional<z.ZodBoolean>;
|
|
35
35
|
is_calculating: z.ZodOptional<z.ZodBoolean>;
|
|
36
36
|
}, z.core.$strip>>;
|
|
37
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
37
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
38
38
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
39
39
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
40
40
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -61,9 +61,9 @@ declare const attachActionWebhook: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
61
61
|
event: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
62
|
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
63
|
url_matching: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
64
|
+
exact: "exact";
|
|
64
65
|
contains: "contains";
|
|
65
66
|
regex: "regex";
|
|
66
|
-
exact: "exact";
|
|
67
67
|
}>>>;
|
|
68
68
|
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
69
|
href: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -74,7 +74,7 @@ declare const attachActionWebhook: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
74
74
|
created_by: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
75
75
|
deleted: z.ZodOptional<z.ZodBoolean>;
|
|
76
76
|
is_calculating: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
77
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
78
78
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
79
79
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
80
80
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -100,9 +100,9 @@ declare const detachActionWebhook: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
100
100
|
event: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
101
|
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
102
|
url_matching: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
103
|
+
exact: "exact";
|
|
103
104
|
contains: "contains";
|
|
104
105
|
regex: "regex";
|
|
105
|
-
exact: "exact";
|
|
106
106
|
}>>>;
|
|
107
107
|
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
108
108
|
href: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -113,7 +113,7 @@ declare const detachActionWebhook: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
113
113
|
created_by: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
114
114
|
deleted: z.ZodOptional<z.ZodBoolean>;
|
|
115
115
|
is_calculating: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
116
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
117
117
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
118
118
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
119
119
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -134,7 +134,7 @@ declare const listPipelineDestinations: _keystrokehq_core0.Operation<z.ZodObject
|
|
|
134
134
|
previous: z.ZodNullable<z.ZodString>;
|
|
135
135
|
count: z.ZodNumber;
|
|
136
136
|
results: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
137
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
138
138
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
139
139
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
140
140
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -153,7 +153,7 @@ declare const createPipelineDestination: _keystrokehq_core0.Operation<z.ZodObjec
|
|
|
153
153
|
order: z.ZodOptional<z.ZodNumber>;
|
|
154
154
|
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
155
155
|
projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
156
|
-
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
156
|
+
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
157
157
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
158
158
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
159
159
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -171,7 +171,7 @@ declare const deletePipelineDestination: _keystrokehq_core0.Operation<z.ZodObjec
|
|
|
171
171
|
projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
172
172
|
}, z.core.$strip>, z.ZodObject<{
|
|
173
173
|
success: z.ZodBoolean;
|
|
174
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
174
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
|
|
175
175
|
POSTHOG_PERSONAL_API_KEY: z.ZodString;
|
|
176
176
|
POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
|
|
177
177
|
POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createPosthogManagementClient } from "./client.mjs";
|
|
2
2
|
import { actionSchema, paginatedResponseSchema, projectIdInputShape } from "./schemas.mjs";
|
|
3
|
-
import { t as posthogOperation } from "./factory-
|
|
3
|
+
import { t as posthogOperation } from "./factory-C3ssyfSy.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/webhook-management.ts
|
|
@@ -20,7 +20,7 @@ const actionIdInput = {
|
|
|
20
20
|
actionId: z.number().int()
|
|
21
21
|
};
|
|
22
22
|
const listActionWebhooks = posthogOperation({
|
|
23
|
-
id: "
|
|
23
|
+
id: "posthog.action-webhooks-list",
|
|
24
24
|
name: "PostHog List Action Webhooks",
|
|
25
25
|
description: "List actions configured to post to a Slack webhook",
|
|
26
26
|
input: z.object({
|
|
@@ -42,7 +42,7 @@ const listActionWebhooks = posthogOperation({
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
const attachActionWebhook = posthogOperation({
|
|
45
|
-
id: "
|
|
45
|
+
id: "posthog.action-webhooks-attach",
|
|
46
46
|
name: "PostHog Attach Action Webhook",
|
|
47
47
|
description: "Enable Slack-webhook posting on an action with a message format",
|
|
48
48
|
input: z.object({
|
|
@@ -65,7 +65,7 @@ const attachActionWebhook = posthogOperation({
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
const detachActionWebhook = posthogOperation({
|
|
68
|
-
id: "
|
|
68
|
+
id: "posthog.action-webhooks-detach",
|
|
69
69
|
name: "PostHog Detach Action Webhook",
|
|
70
70
|
description: "Disable Slack-webhook posting on an action",
|
|
71
71
|
input: z.object(actionIdInput),
|
|
@@ -85,7 +85,7 @@ const detachActionWebhook = posthogOperation({
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
const listPipelineDestinations = posthogOperation({
|
|
88
|
-
id: "
|
|
88
|
+
id: "posthog.pipeline-destinations-list",
|
|
89
89
|
name: "PostHog List Pipeline Destinations",
|
|
90
90
|
description: "List configured pipeline destinations (plugin-configs)",
|
|
91
91
|
input: z.object({
|
|
@@ -104,7 +104,7 @@ const listPipelineDestinations = posthogOperation({
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
const createPipelineDestination = posthogOperation({
|
|
107
|
-
id: "
|
|
107
|
+
id: "posthog.pipeline-destinations-create",
|
|
108
108
|
name: "PostHog Create Pipeline Destination",
|
|
109
109
|
description: "Configure a pipeline destination plugin (e.g. webhook delivery)",
|
|
110
110
|
input: z.object({
|
|
@@ -128,7 +128,7 @@ const createPipelineDestination = posthogOperation({
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
const deletePipelineDestination = posthogOperation({
|
|
131
|
-
id: "
|
|
131
|
+
id: "posthog.pipeline-destinations-delete",
|
|
132
132
|
name: "PostHog Delete Pipeline Destination",
|
|
133
133
|
description: "Remove a pipeline destination configuration",
|
|
134
134
|
input: z.object({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystrokehq/posthog",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -104,7 +104,6 @@
|
|
|
104
104
|
"LICENSE"
|
|
105
105
|
],
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@keystrokehq/integration-authoring": "^0.0.7",
|
|
108
107
|
"zod": "^4.3.6"
|
|
109
108
|
},
|
|
110
109
|
"peerDependencies": {
|
|
@@ -115,9 +114,10 @@
|
|
|
115
114
|
"tsdown": "^0.20.3",
|
|
116
115
|
"typescript": "^5.9.3",
|
|
117
116
|
"vitest": "^4.0.18",
|
|
118
|
-
"@keystrokehq/core": "^0.0.
|
|
117
|
+
"@keystrokehq/core": "^0.0.12",
|
|
119
118
|
"@keystrokehq/test-utils": "0.0.0",
|
|
120
|
-
"@keystrokehq/typescript-config": "0.0.0"
|
|
119
|
+
"@keystrokehq/typescript-config": "0.0.0",
|
|
120
|
+
"@keystrokehq/integration-authoring": "0.0.9"
|
|
121
121
|
},
|
|
122
122
|
"keywords": [
|
|
123
123
|
"posthog",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { t as posthog } from "./integration-Doy2Dwli.mjs";
|
|
2
|
-
import { createOfficialOperationFactory } from "@keystrokehq/integration-authoring/official";
|
|
3
|
-
|
|
4
|
-
//#region src/factory.ts
|
|
5
|
-
const posthogOperation = createOfficialOperationFactory(posthog);
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { posthogOperation as t };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { defineOfficialIntegration } from "@keystrokehq/integration-authoring/official";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/integration.ts
|
|
5
|
-
const posthogAuthSchema = z.object({
|
|
6
|
-
POSTHOG_PERSONAL_API_KEY: z.string().min(1),
|
|
7
|
-
POSTHOG_PROJECT_API_KEY: z.string().min(1).optional(),
|
|
8
|
-
POSTHOG_HOST: z.url().default("https://us.posthog.com"),
|
|
9
|
-
POSTHOG_PROJECT_ID: z.string().min(1).optional(),
|
|
10
|
-
POSTHOG_SCOPES: z.array(z.string()).optional()
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* PostHog integration — product analytics, feature flags, experiments,
|
|
14
|
-
* session replay, surveys, and data-platform management.
|
|
15
|
-
*
|
|
16
|
-
* The personal API key is injected as `Authorization: Bearer` for every
|
|
17
|
-
* management request (see `./client.ts`). The optional project API key
|
|
18
|
-
* is required only for capture/decide operations.
|
|
19
|
-
*/
|
|
20
|
-
const posthogOfficialIntegration = {
|
|
21
|
-
id: "posthog",
|
|
22
|
-
name: "PostHog",
|
|
23
|
-
description: "PostHog product analytics, feature flags, experiments, session replay, surveys, and data-platform management",
|
|
24
|
-
auth: posthogAuthSchema
|
|
25
|
-
};
|
|
26
|
-
const posthogBundle = defineOfficialIntegration(posthogOfficialIntegration);
|
|
27
|
-
const posthog = posthogBundle.credentialSet;
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { posthogBundle as n, posthogOfficialIntegration as r, posthog as t };
|