@frogbotai/piece-posthog 0.22.0 → 0.24.0
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/README.md +23 -0
- package/dist/actions/createEvent.d.ts +44 -0
- package/dist/actions/createEvent.d.ts.map +1 -0
- package/dist/actions/createEvent.js +37 -0
- package/dist/actions/createEvent.js.map +1 -0
- package/dist/actions/createProject.d.ts +29 -0
- package/dist/actions/createProject.d.ts.map +1 -0
- package/dist/actions/createProject.js +36 -0
- package/dist/actions/createProject.js.map +1 -0
- package/dist/actions/customApiCall.d.ts +47 -0
- package/dist/actions/customApiCall.d.ts.map +1 -0
- package/dist/actions/customApiCall.js +34 -0
- package/dist/actions/customApiCall.js.map +1 -0
- package/dist/client.d.ts +21 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +54 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +5 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +124 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -21
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# `@frogbotai/piece-posthog`
|
|
2
|
+
|
|
3
|
+
Capture product analytics events, create projects, and call the PostHog API.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createPosthog } from '@frogbotai/piece-posthog';
|
|
9
|
+
|
|
10
|
+
export const posthog = createPosthog({
|
|
11
|
+
auth: { personalApiKey: process.env.POSTHOG_PERSONAL_API_KEY! },
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Actions
|
|
16
|
+
|
|
17
|
+
| Upstream action slug | Previous wrapper export | Native action | Notes |
|
|
18
|
+
| -------------------- | ----------------------- | --------------- | --------------------------------------------------------------------------- |
|
|
19
|
+
| `create_event` | `createEvent` | `createEvent` | Uses semantic input names while preserving the capture payload. |
|
|
20
|
+
| `create_project` | `createProject` | `createProject` | Uses semantic input names while preserving PostHog field names on the wire. |
|
|
21
|
+
| `custom_api_call` | `customApiCall` | `customApiCall` | Restricted to authenticated `https://app.posthog.com` requests. |
|
|
22
|
+
|
|
23
|
+
The upstream piece registers no triggers.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { PosthogClient } from '../client.js';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
event: z.ZodString;
|
|
6
|
+
eventType: z.ZodEnum<{
|
|
7
|
+
alias: "alias";
|
|
8
|
+
capture: "capture";
|
|
9
|
+
identify: "identify";
|
|
10
|
+
page: "page";
|
|
11
|
+
screen: "screen";
|
|
12
|
+
}>;
|
|
13
|
+
distinctId: z.ZodString;
|
|
14
|
+
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
15
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
16
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
category: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const createEvent: {
|
|
20
|
+
slug: string;
|
|
21
|
+
description: string;
|
|
22
|
+
input: z.ZodObject<{
|
|
23
|
+
event: z.ZodString;
|
|
24
|
+
eventType: z.ZodEnum<{
|
|
25
|
+
alias: "alias";
|
|
26
|
+
capture: "capture";
|
|
27
|
+
identify: "identify";
|
|
28
|
+
page: "page";
|
|
29
|
+
screen: "screen";
|
|
30
|
+
}>;
|
|
31
|
+
distinctId: z.ZodString;
|
|
32
|
+
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
33
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
34
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
35
|
+
category: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
output: z.ZodObject<{
|
|
38
|
+
status: z.ZodNumber;
|
|
39
|
+
}, z.core.$loose>;
|
|
40
|
+
idempotent: boolean;
|
|
41
|
+
run({ input, client }: PieceRunArgs<z.output<typeof inputSchema>, object, PosthogClient>): Promise<unknown>;
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=createEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createEvent.d.ts","sourceRoot":"","sources":["../../src/actions/createEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;iBAUf,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;2BAMO,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC;CAkB/F,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
event: z.string().min(1).meta({ label: 'Event name' }),
|
|
4
|
+
eventType: z
|
|
5
|
+
.enum(['alias', 'capture', 'identify', 'page', 'screen'])
|
|
6
|
+
.meta({ label: 'Event type' }),
|
|
7
|
+
distinctId: z.string().min(1).meta({ label: 'Distinct ID' }),
|
|
8
|
+
properties: z.record(z.string(), z.unknown()).optional(),
|
|
9
|
+
context: z.record(z.string(), z.unknown()).optional(),
|
|
10
|
+
messageId: z.string().optional(),
|
|
11
|
+
category: z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
export const createEvent = {
|
|
14
|
+
slug: 'createEvent',
|
|
15
|
+
description: 'Capture an event in PostHog.',
|
|
16
|
+
input: inputSchema,
|
|
17
|
+
output: z.object({ status: z.number() }).passthrough(),
|
|
18
|
+
idempotent: false,
|
|
19
|
+
async run({ input, client }) {
|
|
20
|
+
const response = await client.request({
|
|
21
|
+
method: 'POST',
|
|
22
|
+
path: '/capture/',
|
|
23
|
+
body: {
|
|
24
|
+
event: input.event,
|
|
25
|
+
type: input.eventType,
|
|
26
|
+
api_key: client.personalApiKey,
|
|
27
|
+
messageId: input.messageId,
|
|
28
|
+
context: input.context ?? {},
|
|
29
|
+
properties: input.properties ?? {},
|
|
30
|
+
distinct_id: input.distinctId,
|
|
31
|
+
category: input.category,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return response.body;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=createEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createEvent.js","sourceRoot":"","sources":["../../src/actions/createEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;IACtD,SAAS,EAAE,CAAC;SACT,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;SACxD,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;IAC5D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
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { PosthogClient } from '../client.js';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
slackIncomingWebhook: z.ZodOptional<z.ZodString>;
|
|
7
|
+
anonymizeIps: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
isDemo: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const createProject: {
|
|
11
|
+
slug: string;
|
|
12
|
+
description: string;
|
|
13
|
+
input: z.ZodObject<{
|
|
14
|
+
name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
slackIncomingWebhook: z.ZodOptional<z.ZodString>;
|
|
16
|
+
anonymizeIps: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
isDemo: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
output: z.ZodObject<{
|
|
20
|
+
id: z.ZodNumber;
|
|
21
|
+
uuid: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
api_token: z.ZodString;
|
|
24
|
+
}, z.core.$loose>;
|
|
25
|
+
idempotent: boolean;
|
|
26
|
+
run({ input, client }: PieceRunArgs<z.output<typeof inputSchema>, object, PosthogClient>): Promise<unknown>;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=createProject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createProject.d.ts","sourceRoot":"","sources":["../../src/actions/createProject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,QAAA,MAAM,WAAW;;;;;iBAKf,CAAC;AAWH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;2BAMK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC;CAc/F,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
name: z.string().optional(),
|
|
4
|
+
slackIncomingWebhook: z.string().optional(),
|
|
5
|
+
anonymizeIps: z.boolean().optional(),
|
|
6
|
+
isDemo: z.boolean().optional(),
|
|
7
|
+
});
|
|
8
|
+
const output = z
|
|
9
|
+
.object({
|
|
10
|
+
id: z.number().int(),
|
|
11
|
+
uuid: z.string(),
|
|
12
|
+
name: z.string(),
|
|
13
|
+
api_token: z.string(),
|
|
14
|
+
})
|
|
15
|
+
.passthrough();
|
|
16
|
+
export const createProject = {
|
|
17
|
+
slug: 'createProject',
|
|
18
|
+
description: 'Create a PostHog project.',
|
|
19
|
+
input: inputSchema,
|
|
20
|
+
output,
|
|
21
|
+
idempotent: false,
|
|
22
|
+
async run({ input, client }) {
|
|
23
|
+
const response = await client.request({
|
|
24
|
+
method: 'POST',
|
|
25
|
+
path: '/api/projects/',
|
|
26
|
+
body: {
|
|
27
|
+
name: input.name,
|
|
28
|
+
slack_incoming_webhook: input.slackIncomingWebhook,
|
|
29
|
+
anonymize_ips: input.anonymizeIps,
|
|
30
|
+
is_demo: input.isDemo,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
return response.body;
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=createProject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createProject.js","sourceRoot":"","sources":["../../src/actions/createProject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAAW,G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
|
|
3
|
+
import type { PosthogClient } from '../client.js';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
method: z.ZodEnum<{
|
|
6
|
+
GET: "GET";
|
|
7
|
+
POST: "POST";
|
|
8
|
+
PATCH: "PATCH";
|
|
9
|
+
PUT: "PUT";
|
|
10
|
+
DELETE: "DELETE";
|
|
11
|
+
}>;
|
|
12
|
+
path: z.ZodString;
|
|
13
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
|
+
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
15
|
+
body: z.ZodOptional<z.ZodJSONSchema>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const customApiCall: {
|
|
18
|
+
slug: string;
|
|
19
|
+
description: string;
|
|
20
|
+
input: z.ZodObject<{
|
|
21
|
+
method: z.ZodEnum<{
|
|
22
|
+
GET: "GET";
|
|
23
|
+
POST: "POST";
|
|
24
|
+
PATCH: "PATCH";
|
|
25
|
+
PUT: "PUT";
|
|
26
|
+
DELETE: "DELETE";
|
|
27
|
+
}>;
|
|
28
|
+
path: z.ZodString;
|
|
29
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
30
|
+
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
31
|
+
body: z.ZodOptional<z.ZodJSONSchema>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
output: z.ZodObject<{
|
|
34
|
+
status: z.ZodNumber;
|
|
35
|
+
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
36
|
+
body: z.ZodJSONSchema;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
run({ input, client }: PieceRunArgs<z.output<typeof inputSchema>, object, PosthogClient>): Promise<{
|
|
39
|
+
status: number;
|
|
40
|
+
headers: {
|
|
41
|
+
[k: string]: string;
|
|
42
|
+
};
|
|
43
|
+
body: unknown;
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=customApiCall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customApiCall.d.ts","sourceRoot":"","sources":["../../src/actions/customApiCall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAYlD,QAAA,MAAM,WAAW;;;;;;;;;;;;iBAYf,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;2BASK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC;;;;;;;CAG/F,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const scalar = z.union([z.string(), z.number(), z.boolean()]);
|
|
3
|
+
const forbiddenHeaders = new Set([
|
|
4
|
+
'authorization',
|
|
5
|
+
'proxy-authorization',
|
|
6
|
+
'host',
|
|
7
|
+
'cookie',
|
|
8
|
+
'content-length',
|
|
9
|
+
'transfer-encoding',
|
|
10
|
+
]);
|
|
11
|
+
const inputSchema = z.object({
|
|
12
|
+
method: z.enum(['GET', 'POST', 'PATCH', 'PUT', 'DELETE']),
|
|
13
|
+
path: z.string().min(1),
|
|
14
|
+
headers: z
|
|
15
|
+
.record(z.string(), z.string())
|
|
16
|
+
.default({})
|
|
17
|
+
.refine((headers) => Object.keys(headers).every((name) => !forbiddenHeaders.has(name.toLowerCase())), 'Authentication and transport headers cannot be overridden.'),
|
|
18
|
+
query: z.record(z.string(), scalar).optional(),
|
|
19
|
+
body: z.json().optional(),
|
|
20
|
+
});
|
|
21
|
+
export const customApiCall = {
|
|
22
|
+
slug: 'customApiCall',
|
|
23
|
+
description: 'Make an authenticated call to the PostHog API.',
|
|
24
|
+
input: inputSchema,
|
|
25
|
+
output: z.object({
|
|
26
|
+
status: z.number().int(),
|
|
27
|
+
headers: z.record(z.string(), z.string()),
|
|
28
|
+
body: z.json(),
|
|
29
|
+
}),
|
|
30
|
+
async run({ input, client }) {
|
|
31
|
+
return client.request(input);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=customApiCall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customApiCall.js","sourceRoot":"","sources":["../../src/actions/customApiCall.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAC9D,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B,eAAe;IACf,qBAAqB;IACrB,MAAM;IACN,QAAQ;IACR,gBAAgB;IAChB,mBAAmB;CACpB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC;SACP,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;SAC9B,OAAO,CAAC,EAAE,CAAC;SACX,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,EAC5F,4DAA4D,CAC7D;IACH,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,QAAQ,EAAE;IAC9C,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAC1B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;QACxB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QACzC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;KACf,CAAC;IACF,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAqE;QAC5F,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACF,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type PosthogRequest = {
|
|
2
|
+
body?: unknown;
|
|
3
|
+
headers?: Record<string, string>;
|
|
4
|
+
method?: string;
|
|
5
|
+
path: string;
|
|
6
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
7
|
+
};
|
|
8
|
+
export declare function createPosthogClient({ personalApiKey }: {
|
|
9
|
+
personalApiKey: string;
|
|
10
|
+
}): {
|
|
11
|
+
personalApiKey: string;
|
|
12
|
+
request({ body, headers, method, path, query }: PosthogRequest): Promise<{
|
|
13
|
+
status: number;
|
|
14
|
+
headers: {
|
|
15
|
+
[k: string]: string;
|
|
16
|
+
};
|
|
17
|
+
body: unknown;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
export type PosthogClient = ReturnType<typeof createPosthogClient>;
|
|
21
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC/D,CAAC;AAgBF,wBAAgB,mBAAmB,CAAC,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE;;oDAGhB,cAAc;;;;;;;EA8C/E;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function posthogUrl(path) {
|
|
2
|
+
if (/[\\\s\p{Cc}]/u.test(path[0] ?? '') || path.startsWith('//')) {
|
|
3
|
+
throw new Error('Path must target the PostHog API.');
|
|
4
|
+
}
|
|
5
|
+
const url = new URL(path.startsWith('/') ? `https://app.posthog.com${path}` : path);
|
|
6
|
+
if (url.origin !== 'https://app.posthog.com' || url.username || url.password || url.hash) {
|
|
7
|
+
throw new Error('Path must target the PostHog API.');
|
|
8
|
+
}
|
|
9
|
+
return url;
|
|
10
|
+
}
|
|
11
|
+
export function createPosthogClient({ personalApiKey }) {
|
|
12
|
+
return {
|
|
13
|
+
personalApiKey,
|
|
14
|
+
async request({ body, headers, method = 'GET', path, query }) {
|
|
15
|
+
const url = posthogUrl(path);
|
|
16
|
+
for (const [key, value] of Object.entries(query ?? {})) {
|
|
17
|
+
if (value !== undefined)
|
|
18
|
+
url.searchParams.set(key, String(value));
|
|
19
|
+
}
|
|
20
|
+
const response = await fetch(url, {
|
|
21
|
+
method,
|
|
22
|
+
redirect: 'error',
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: `Bearer ${personalApiKey}`,
|
|
25
|
+
...(body === undefined ? {} : { 'Content-Type': 'application/json' }),
|
|
26
|
+
...headers,
|
|
27
|
+
},
|
|
28
|
+
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
|
29
|
+
});
|
|
30
|
+
const text = await response.text();
|
|
31
|
+
let result = null;
|
|
32
|
+
if (text) {
|
|
33
|
+
try {
|
|
34
|
+
result = JSON.parse(text);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
result = text;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (!response.ok) {
|
|
41
|
+
const detail = result && typeof result === 'object' && 'detail' in result
|
|
42
|
+
? result.detail
|
|
43
|
+
: result;
|
|
44
|
+
throw new Error(`PostHog request failed (${response.status}): ${typeof detail === 'string' ? detail : response.statusText}`);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
status: response.status,
|
|
48
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
49
|
+
body: result,
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAQA,SAAS,UAAU,CAAC,IAAY;IAC9B,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC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AAK,CAAC;AAExB,eAAO,MAAM,WAAW;;iBAEtB,CAAC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;CACpF,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,126 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const posthogActions: readonly ["create_event", "create_project"];
|
|
1
|
+
export declare const posthogActions: readonly ["createEvent", "createProject", "customApiCall"];
|
|
3
2
|
export declare const posthogScopes: readonly [];
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
export declare const createPosthog: import("frogbot/pieces").PieceFactory<{
|
|
4
|
+
readonly slug: "posthog";
|
|
5
|
+
readonly label: "PostHog";
|
|
6
|
+
readonly admin: {
|
|
7
|
+
readonly description: "Capture product analytics events and manage PostHog projects";
|
|
8
|
+
readonly group: "Business Intelligence";
|
|
9
|
+
};
|
|
10
|
+
readonly auth: import("zod").ZodObject<{
|
|
11
|
+
personalApiKey: import("zod").ZodString;
|
|
12
|
+
}, import("zod/v4/core").$strip>;
|
|
13
|
+
readonly client: ({ auth }: {
|
|
14
|
+
auth: unknown;
|
|
15
|
+
}) => {
|
|
16
|
+
personalApiKey: string;
|
|
17
|
+
request({ body, headers, method, path, query }: import("./client.js").PosthogRequest): Promise<{
|
|
18
|
+
status: number;
|
|
19
|
+
headers: {
|
|
20
|
+
[k: string]: string;
|
|
21
|
+
};
|
|
22
|
+
body: unknown;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
readonly actions: readonly [{
|
|
26
|
+
slug: string;
|
|
27
|
+
description: string;
|
|
28
|
+
input: import("zod").ZodObject<{
|
|
29
|
+
event: import("zod").ZodString;
|
|
30
|
+
eventType: import("zod").ZodEnum<{
|
|
31
|
+
alias: "alias";
|
|
32
|
+
capture: "capture";
|
|
33
|
+
identify: "identify";
|
|
34
|
+
page: "page";
|
|
35
|
+
screen: "screen";
|
|
36
|
+
}>;
|
|
37
|
+
distinctId: import("zod").ZodString;
|
|
38
|
+
properties: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
39
|
+
context: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
40
|
+
messageId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
41
|
+
category: import("zod").ZodOptional<import("zod").ZodString>;
|
|
42
|
+
}, import("zod/v4/core").$strip>;
|
|
43
|
+
output: import("zod").ZodObject<{
|
|
44
|
+
status: import("zod").ZodNumber;
|
|
45
|
+
}, import("zod/v4/core").$loose>;
|
|
46
|
+
idempotent: boolean;
|
|
47
|
+
run({ input, client }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
48
|
+
event: import("zod").ZodString;
|
|
49
|
+
eventType: import("zod").ZodEnum<{
|
|
50
|
+
alias: "alias";
|
|
51
|
+
capture: "capture";
|
|
52
|
+
identify: "identify";
|
|
53
|
+
page: "page";
|
|
54
|
+
screen: "screen";
|
|
55
|
+
}>;
|
|
56
|
+
distinctId: import("zod").ZodString;
|
|
57
|
+
properties: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
58
|
+
context: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
|
|
59
|
+
messageId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
+
category: import("zod").ZodOptional<import("zod").ZodString>;
|
|
61
|
+
}, import("zod/v4/core").$strip>>, object, import("./client.js").PosthogClient>): Promise<unknown>;
|
|
62
|
+
}, {
|
|
63
|
+
slug: string;
|
|
64
|
+
description: string;
|
|
65
|
+
input: import("zod").ZodObject<{
|
|
66
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
67
|
+
slackIncomingWebhook: import("zod").ZodOptional<import("zod").ZodString>;
|
|
68
|
+
anonymizeIps: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
69
|
+
isDemo: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
70
|
+
}, import("zod/v4/core").$strip>;
|
|
71
|
+
output: import("zod").ZodObject<{
|
|
72
|
+
id: import("zod").ZodNumber;
|
|
73
|
+
uuid: import("zod").ZodString;
|
|
74
|
+
name: import("zod").ZodString;
|
|
75
|
+
api_token: import("zod").ZodString;
|
|
76
|
+
}, import("zod/v4/core").$loose>;
|
|
77
|
+
idempotent: boolean;
|
|
78
|
+
run({ input, client }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
79
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
80
|
+
slackIncomingWebhook: import("zod").ZodOptional<import("zod").ZodString>;
|
|
81
|
+
anonymizeIps: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
82
|
+
isDemo: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
83
|
+
}, import("zod/v4/core").$strip>>, object, import("./client.js").PosthogClient>): Promise<unknown>;
|
|
84
|
+
}, {
|
|
85
|
+
slug: string;
|
|
86
|
+
description: string;
|
|
87
|
+
input: import("zod").ZodObject<{
|
|
88
|
+
method: import("zod").ZodEnum<{
|
|
89
|
+
GET: "GET";
|
|
90
|
+
POST: "POST";
|
|
91
|
+
PATCH: "PATCH";
|
|
92
|
+
PUT: "PUT";
|
|
93
|
+
DELETE: "DELETE";
|
|
94
|
+
}>;
|
|
95
|
+
path: import("zod").ZodString;
|
|
96
|
+
headers: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
97
|
+
query: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean]>>>;
|
|
98
|
+
body: import("zod").ZodOptional<import("zod").ZodJSONSchema>;
|
|
99
|
+
}, import("zod/v4/core").$strip>;
|
|
100
|
+
output: import("zod").ZodObject<{
|
|
101
|
+
status: import("zod").ZodNumber;
|
|
102
|
+
headers: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
|
|
103
|
+
body: import("zod").ZodJSONSchema;
|
|
104
|
+
}, import("zod/v4/core").$strip>;
|
|
105
|
+
run({ input, client }: import("frogbot/pieces").PieceRunArgs<import("zod").infer<import("zod").ZodObject<{
|
|
106
|
+
method: import("zod").ZodEnum<{
|
|
107
|
+
GET: "GET";
|
|
108
|
+
POST: "POST";
|
|
109
|
+
PATCH: "PATCH";
|
|
110
|
+
PUT: "PUT";
|
|
111
|
+
DELETE: "DELETE";
|
|
112
|
+
}>;
|
|
113
|
+
path: import("zod").ZodString;
|
|
114
|
+
headers: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
115
|
+
query: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean]>>>;
|
|
116
|
+
body: import("zod").ZodOptional<import("zod").ZodJSONSchema>;
|
|
117
|
+
}, import("zod/v4/core").$strip>>, object, import("./client.js").PosthogClient>): Promise<{
|
|
118
|
+
status: number;
|
|
119
|
+
headers: {
|
|
120
|
+
[k: string]: string;
|
|
121
|
+
};
|
|
122
|
+
body: unknown;
|
|
123
|
+
}>;
|
|
124
|
+
}];
|
|
125
|
+
}>;
|
|
12
126
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc,4DAA6D,CAAC;AACzF,eAAO,MAAM,aAAa,aAAc,CAAC;AAEzC,eAAO,MAAM,aAAa;;;;;;;;;;gCAQL;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { definePiece } from 'frogbot/pieces';
|
|
2
|
+
import { createEvent } from './actions/createEvent.js';
|
|
3
|
+
import { createProject } from './actions/createProject.js';
|
|
4
|
+
import { customApiCall } from './actions/customApiCall.js';
|
|
5
|
+
import { createPosthogClient } from './client.js';
|
|
6
|
+
import { posthogAuth } from './config.js';
|
|
7
|
+
export const posthogActions = ['createEvent', 'createProject', 'customApiCall'];
|
|
4
8
|
export const posthogScopes = [];
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
createEvent: piece.tool('create_event'),
|
|
17
|
-
/** Create Project: Create a posthog project */
|
|
18
|
-
createProject: piece.tool('create_project'),
|
|
19
|
-
/** Custom API Call: Make a custom API call to a specific endpoint */
|
|
20
|
-
customApiCall: piece.tool('custom_api_call'),
|
|
21
|
-
});
|
|
22
|
-
}
|
|
9
|
+
export const createPosthog = definePiece({
|
|
10
|
+
slug: 'posthog',
|
|
11
|
+
label: 'PostHog',
|
|
12
|
+
admin: {
|
|
13
|
+
description: 'Capture product analytics events and manage PostHog projects',
|
|
14
|
+
group: 'Business Intelligence',
|
|
15
|
+
},
|
|
16
|
+
auth: posthogAuth,
|
|
17
|
+
client: ({ auth }) => createPosthogClient(posthogAuth.parse(auth)),
|
|
18
|
+
actions: [createEvent, createProject, customApiCall],
|
|
19
|
+
});
|
|
23
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,eAAe,EAAE,eAAe,CAAU,CAAC;AACzF,MAAM,CAAC,MAAM,aAAa,GAAG,EAAW,CAAC;AAEzC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;IACvC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE;QACL,WAAW,EAAE,8DAA8D;QAC3E,KAAK,EAAE,uBAAuB;KAC/B;IACD,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAqB,EAAE,EAAE,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrF,OAAO,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC;CACrD,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/piece-posthog",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "PostHog tools for FrogBot.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colby Gilbert",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
],
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"
|
|
22
|
+
"zod": "^4.3.6"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"frogbot": "0.
|
|
25
|
+
"frogbot": "0.24.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "5.6.2",
|
|
29
|
-
"frogbot": "0.
|
|
29
|
+
"frogbot": "0.24.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|