@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.
Files changed (48) hide show
  1. package/dist/_official/index.d.mts +1 -1
  2. package/dist/_official/index.mjs +1 -1
  3. package/dist/_runtime/index.d.mts +1 -2
  4. package/dist/_runtime/index.mjs +1 -1
  5. package/dist/actions.d.mts +13 -13
  6. package/dist/actions.mjs +6 -6
  7. package/dist/annotations.d.mts +6 -6
  8. package/dist/annotations.mjs +6 -6
  9. package/dist/capture.d.mts +8 -8
  10. package/dist/capture.mjs +8 -8
  11. package/dist/client.d.mts +1 -2
  12. package/dist/client.mjs +1 -1
  13. package/dist/cohorts.d.mts +9 -9
  14. package/dist/cohorts.mjs +9 -9
  15. package/dist/connection.d.mts +1 -1
  16. package/dist/connection.mjs +1 -1
  17. package/dist/dashboards.d.mts +17 -17
  18. package/dist/dashboards.mjs +17 -17
  19. package/dist/decide.d.mts +3 -3
  20. package/dist/decide.mjs +3 -3
  21. package/dist/events-management.d.mts +11 -11
  22. package/dist/events-management.mjs +11 -11
  23. package/dist/factory-C3ssyfSy.mjs +7 -0
  24. package/dist/feature-flags.d.mts +16 -16
  25. package/dist/feature-flags.mjs +16 -16
  26. package/dist/http-BYcjqxPi.mjs +84 -0
  27. package/dist/insights.d.mts +17 -17
  28. package/dist/insights.mjs +17 -17
  29. package/dist/{integration-Td6D39_E.d.mts → integration-BN7xcpga.d.mts} +15 -5
  30. package/dist/integration-D0HdrI0T.mjs +120 -0
  31. package/dist/organizations.d.mts +12 -12
  32. package/dist/organizations.mjs +12 -12
  33. package/dist/persons.d.mts +16 -16
  34. package/dist/persons.mjs +16 -16
  35. package/dist/projects.d.mts +14 -14
  36. package/dist/projects.mjs +14 -14
  37. package/dist/schemas.d.mts +3 -3
  38. package/dist/session-recordings.d.mts +15 -15
  39. package/dist/session-recordings.mjs +15 -15
  40. package/dist/surveys.d.mts +16 -16
  41. package/dist/surveys.mjs +10 -10
  42. package/dist/triggers.d.mts +5 -3
  43. package/dist/triggers.mjs +52 -3
  44. package/dist/webhook-management.d.mts +10 -10
  45. package/dist/webhook-management.mjs +7 -7
  46. package/package.json +4 -4
  47. package/dist/factory-DYDvHOGb.mjs +0 -8
  48. package/dist/integration-Doy2Dwli.mjs +0 -30
@@ -1,9 +1,19 @@
1
- import * as _keystrokehq_integration_authoring_official0 from "@keystrokehq/integration-authoring/official";
1
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
2
+ import { CredentialSet, Operation } from "@keystrokehq/core";
2
3
  import { z } from "zod";
3
4
  import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
5
  import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
5
- import * as _keystrokehq_core0 from "@keystrokehq/core";
6
6
 
7
+ //#region ../../packages/integration-authoring/dist/official/index.d.mts
8
+ /**
9
+ * Creates a factory for Keystroke-official integration operations.
10
+ *
11
+ * It keeps the same flat `run(input, credentials)` ergonomics as the generic
12
+ * operation factory, while registering official metadata for builder/runtime
13
+ * operation metadata.
14
+ */
15
+ declare function createOfficialOperationFactory(credentialSet: any): (config: any) => Operation<any, any, any[], undefined>;
16
+ //#endregion
7
17
  //#region src/integration.d.ts
8
18
  /**
9
19
  * PostHog integration — product analytics, feature flags, experiments,
@@ -25,14 +35,14 @@ declare const posthogOfficialIntegration: {
25
35
  POSTHOG_SCOPES: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
36
  }, z.core.$strip>;
27
37
  };
28
- declare const posthogBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"posthog", z.ZodObject<{
38
+ declare const posthogBundle: undefined<"posthog", z.ZodObject<{
29
39
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
30
40
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
31
41
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
32
42
  POSTHOG_PROJECT_ID: z.ZodOptional<z.ZodString>;
33
43
  POSTHOG_SCOPES: z.ZodOptional<z.ZodArray<z.ZodString>>;
34
44
  }, z.core.$strip>>;
35
- declare const posthog: _keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
45
+ declare const posthog: _keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
36
46
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
37
47
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
38
48
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -50,4 +60,4 @@ declare const posthog: _keystrokehq_core0.CredentialSet<"keystroke:posthog", z.Z
50
60
  */
51
61
  type PosthogCredentials = InferCredentialSetAuth<typeof posthog>;
52
62
  //#endregion
53
- export { posthogOfficialIntegration as i, posthog as n, posthogBundle as r, PosthogCredentials as t };
63
+ export { createOfficialOperationFactory as a, posthogOfficialIntegration as i, posthog as n, posthogBundle as r, PosthogCredentials as t };
@@ -0,0 +1,120 @@
1
+ import { CredentialSet, Operation } from "@keystrokehq/core";
2
+ import { z } from "zod";
3
+
4
+ //#region ../../packages/integration-authoring/dist/official/runtime.mjs
5
+ const REGISTRY_KEY = "__ks_official_integration_metadata_registry";
6
+ function getRegistry() {
7
+ const globalStore = globalThis;
8
+ if (!globalStore[REGISTRY_KEY]) globalStore[REGISTRY_KEY] = /* @__PURE__ */ new WeakMap();
9
+ return globalStore[REGISTRY_KEY];
10
+ }
11
+ function registerOfficialOperation(operation, metadata) {
12
+ getRegistry().set(operation, Object.freeze({ ...metadata }));
13
+ }
14
+
15
+ //#endregion
16
+ //#region ../../packages/integration-authoring/dist/official/index.mjs
17
+ const OFFICIAL_CREDENTIAL_SET_ID_PREFIX = "keystroke:";
18
+ function stripOfficialCredentialSetIdPrefix(id) {
19
+ return id.startsWith(OFFICIAL_CREDENTIAL_SET_ID_PREFIX) ? id.slice(10) : id;
20
+ }
21
+ /**
22
+ * Creates a factory for Keystroke-official integration operations.
23
+ *
24
+ * It keeps the same flat `run(input, credentials)` ergonomics as the generic
25
+ * operation factory, while registering official metadata for builder/runtime
26
+ * operation metadata.
27
+ */
28
+ function createOfficialOperationFactory(credentialSet) {
29
+ const integrationId = stripOfficialCredentialSetIdPrefix(credentialSet.id);
30
+ return (config) => {
31
+ const wrappedRun = async (input, ctx) => {
32
+ const creds = ctx.credentials[credentialSet.id];
33
+ return config.run(input, creds);
34
+ };
35
+ const operation = new Operation({
36
+ id: config.id,
37
+ name: config.name,
38
+ description: config.description,
39
+ input: config.input,
40
+ output: config.output,
41
+ credentialSets: [credentialSet],
42
+ ...config.tags !== void 0 ? { tags: config.tags } : {},
43
+ ...config.needsApproval !== void 0 ? { needsApproval: config.needsApproval } : {},
44
+ ...config.requiredOAuthScopes !== void 0 ? { requiredOAuthScopes: config.requiredOAuthScopes } : {},
45
+ ...config.retries !== void 0 ? { retries: config.retries } : {},
46
+ ...config.timeout !== void 0 ? { timeout: config.timeout } : {},
47
+ ...config.maxDurationMs !== void 0 ? { maxDurationMs: config.maxDurationMs } : {},
48
+ run: wrappedRun
49
+ });
50
+ registerOfficialOperation(operation, { integrationId });
51
+ return operation;
52
+ };
53
+ }
54
+ /**
55
+ * Creates an official integration bundle from a single config object.
56
+ *
57
+ * - Creates the public `CredentialSet` internally.
58
+ * - Accepts optional `internal` fields for Keystroke-owned platform credentials.
59
+ */
60
+ function defineOfficialIntegration(config) {
61
+ const internalCredentialSets = config.internal ?? {};
62
+ const allInternalCredentialSets = [
63
+ ...internalCredentialSets.providerApp ? [internalCredentialSets.providerApp] : [],
64
+ ...internalCredentialSets.providerAppVariants ?? [],
65
+ ...internalCredentialSets.webhookVerification ? [internalCredentialSets.webhookVerification] : [],
66
+ ...internalCredentialSets.other ?? []
67
+ ];
68
+ const credentialSet = new CredentialSet({
69
+ id: config.id,
70
+ name: config.name,
71
+ description: config.description,
72
+ auth: config.auth,
73
+ ...config.connections ? { connections: config.connections } : {},
74
+ ...config.proxy ? { proxy: config.proxy } : {},
75
+ ...config.needsRawSecret === true ? { needsRawSecret: true } : {}
76
+ });
77
+ return Object.freeze({
78
+ integration: {
79
+ id: config.id,
80
+ name: config.name,
81
+ ...config.description !== void 0 ? { description: config.description } : {},
82
+ auth: config.auth,
83
+ ...config.proxy ? { proxy: config.proxy } : {},
84
+ ...config.needsRawSecret === true ? { needsRawSecret: true } : {},
85
+ ...config.connections ? { connections: config.connections } : {}
86
+ },
87
+ credentialSet,
88
+ internalCredentialSets,
89
+ allInternalCredentialSets
90
+ });
91
+ }
92
+
93
+ //#endregion
94
+ //#region src/integration.ts
95
+ const posthogAuthSchema = z.object({
96
+ POSTHOG_PERSONAL_API_KEY: z.string().min(1),
97
+ POSTHOG_PROJECT_API_KEY: z.string().min(1).optional(),
98
+ POSTHOG_HOST: z.url().default("https://us.posthog.com"),
99
+ POSTHOG_PROJECT_ID: z.string().min(1).optional(),
100
+ POSTHOG_SCOPES: z.array(z.string()).optional()
101
+ });
102
+ /**
103
+ * PostHog integration — product analytics, feature flags, experiments,
104
+ * session replay, surveys, and data-platform management.
105
+ *
106
+ * The personal API key is injected as `Authorization: Bearer` for every
107
+ * management request (see `./client.ts`). The optional project API key
108
+ * is required only for capture/decide operations.
109
+ */
110
+ const posthogOfficialIntegration = {
111
+ id: "posthog",
112
+ name: "PostHog",
113
+ description: "PostHog product analytics, feature flags, experiments, session replay, surveys, and data-platform management",
114
+ auth: posthogAuthSchema
115
+ };
116
+ const posthogBundle = defineOfficialIntegration(posthogOfficialIntegration);
117
+ const posthog = posthogBundle.credentialSet;
118
+
119
+ //#endregion
120
+ export { createOfficialOperationFactory as i, posthogBundle as n, posthogOfficialIntegration as r, posthog as t };
@@ -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/organizations.d.ts
6
6
  declare const listOrganizations: _keystrokehq_core0.Operation<z.ZodObject<{
@@ -20,7 +20,7 @@ declare const listOrganizations: _keystrokehq_core0.Operation<z.ZodObject<{
20
20
  plugins_access_level: z.ZodOptional<z.ZodNumber>;
21
21
  teams: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
22
22
  }, z.core.$strip>>;
23
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
23
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
24
24
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
25
25
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
26
26
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -44,7 +44,7 @@ declare const getOrganization: _keystrokehq_core0.Operation<z.ZodObject<{
44
44
  membership_level: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
45
45
  plugins_access_level: z.ZodOptional<z.ZodNumber>;
46
46
  teams: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
47
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
47
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
48
48
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
49
49
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
50
50
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -69,7 +69,7 @@ declare const createOrganization: _keystrokehq_core0.Operation<z.ZodObject<{
69
69
  membership_level: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
70
70
  plugins_access_level: z.ZodOptional<z.ZodNumber>;
71
71
  teams: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
72
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
72
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
73
73
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
74
74
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
75
75
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -95,7 +95,7 @@ declare const updateOrganization: _keystrokehq_core0.Operation<z.ZodObject<{
95
95
  membership_level: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
96
96
  plugins_access_level: z.ZodOptional<z.ZodNumber>;
97
97
  teams: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
98
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
98
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
99
99
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
100
100
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
101
101
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -112,7 +112,7 @@ declare const deleteOrganization: _keystrokehq_core0.Operation<z.ZodObject<{
112
112
  organizationId: z.ZodString;
113
113
  }, z.core.$strip>, z.ZodObject<{
114
114
  success: z.ZodBoolean;
115
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
115
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
116
116
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
117
117
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
118
118
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -141,7 +141,7 @@ declare const listOrganizationMembers: _keystrokehq_core0.Operation<z.ZodObject<
141
141
  joined_at: z.ZodOptional<z.ZodString>;
142
142
  updated_at: z.ZodOptional<z.ZodString>;
143
143
  }, z.core.$strip>>;
144
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
144
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
145
145
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
146
146
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
147
147
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -165,7 +165,7 @@ declare const updateOrganizationMember: _keystrokehq_core0.Operation<z.ZodObject
165
165
  parent_level: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
166
166
  joined_at: z.ZodOptional<z.ZodString>;
167
167
  updated_at: z.ZodOptional<z.ZodString>;
168
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
168
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
169
169
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
170
170
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
171
171
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -183,7 +183,7 @@ declare const removeOrganizationMember: _keystrokehq_core0.Operation<z.ZodObject
183
183
  organizationId: z.ZodString;
184
184
  }, z.core.$strip>, z.ZodObject<{
185
185
  success: z.ZodBoolean;
186
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
186
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
187
187
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
188
188
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
189
189
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -204,7 +204,7 @@ declare const listOrganizationInvites: _keystrokehq_core0.Operation<z.ZodObject<
204
204
  previous: z.ZodNullable<z.ZodString>;
205
205
  count: z.ZodNumber;
206
206
  results: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
207
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
207
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
208
208
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
209
209
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
210
210
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -222,7 +222,7 @@ declare const createOrganizationInvite: _keystrokehq_core0.Operation<z.ZodObject
222
222
  level: z.ZodOptional<z.ZodNumber>;
223
223
  first_name: z.ZodOptional<z.ZodString>;
224
224
  organizationId: z.ZodString;
225
- }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
225
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodUnknown>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
226
226
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
227
227
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
228
228
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -240,7 +240,7 @@ declare const deleteOrganizationInvite: _keystrokehq_core0.Operation<z.ZodObject
240
240
  organizationId: z.ZodString;
241
241
  }, z.core.$strip>, z.ZodObject<{
242
242
  success: z.ZodBoolean;
243
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
243
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
244
244
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
245
245
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
246
246
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -1,6 +1,6 @@
1
1
  import { createPosthogManagementClient } from "./client.mjs";
2
2
  import { organizationSchema, paginatedResponseSchema, projectMemberSchema } from "./schemas.mjs";
3
- import { t as posthogOperation } from "./factory-DYDvHOGb.mjs";
3
+ import { t as posthogOperation } from "./factory-C3ssyfSy.mjs";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region src/organizations.ts
@@ -13,7 +13,7 @@ import { z } from "zod";
13
13
  */
14
14
  const orgInput = { organizationId: z.string().min(1) };
15
15
  const listOrganizations = posthogOperation({
16
- id: "posthog_organizations_list",
16
+ id: "posthog.organizations-list",
17
17
  name: "PostHog List Organizations",
18
18
  description: "List organizations the personal API key can access",
19
19
  input: z.object({
@@ -33,7 +33,7 @@ const listOrganizations = posthogOperation({
33
33
  }
34
34
  });
35
35
  const getOrganization = posthogOperation({
36
- id: "posthog_organizations_get",
36
+ id: "posthog.organizations-get",
37
37
  name: "PostHog Get Organization",
38
38
  description: "Retrieve an organization by id",
39
39
  input: z.object(orgInput),
@@ -46,7 +46,7 @@ const getOrganization = posthogOperation({
46
46
  }
47
47
  });
48
48
  const createOrganization = posthogOperation({
49
- id: "posthog_organizations_create",
49
+ id: "posthog.organizations-create",
50
50
  name: "PostHog Create Organization",
51
51
  description: "Create a new organization",
52
52
  input: z.object({
@@ -64,7 +64,7 @@ const createOrganization = posthogOperation({
64
64
  }
65
65
  });
66
66
  const updateOrganization = posthogOperation({
67
- id: "posthog_organizations_update",
67
+ id: "posthog.organizations-update",
68
68
  name: "PostHog Update Organization",
69
69
  description: "Partial update to an organization",
70
70
  input: z.object({
@@ -85,7 +85,7 @@ const updateOrganization = posthogOperation({
85
85
  }
86
86
  });
87
87
  const deleteOrganization = posthogOperation({
88
- id: "posthog_organizations_delete",
88
+ id: "posthog.organizations-delete",
89
89
  name: "PostHog Delete Organization",
90
90
  description: "Delete an organization",
91
91
  input: z.object(orgInput),
@@ -100,7 +100,7 @@ const deleteOrganization = posthogOperation({
100
100
  }
101
101
  });
102
102
  const listOrganizationMembers = posthogOperation({
103
- id: "posthog_organization_members_list",
103
+ id: "posthog.organization-members-list",
104
104
  name: "PostHog List Organization Members",
105
105
  description: "List members of an organization",
106
106
  input: z.object({
@@ -121,7 +121,7 @@ const listOrganizationMembers = posthogOperation({
121
121
  }
122
122
  });
123
123
  const updateOrganizationMember = posthogOperation({
124
- id: "posthog_organization_members_update",
124
+ id: "posthog.organization-members-update",
125
125
  name: "PostHog Update Organization Member",
126
126
  description: "Update an organization member's role",
127
127
  input: z.object({
@@ -140,7 +140,7 @@ const updateOrganizationMember = posthogOperation({
140
140
  }
141
141
  });
142
142
  const removeOrganizationMember = posthogOperation({
143
- id: "posthog_organization_members_remove",
143
+ id: "posthog.organization-members-remove",
144
144
  name: "PostHog Remove Organization Member",
145
145
  description: "Remove a user from an organization",
146
146
  input: z.object({
@@ -158,7 +158,7 @@ const removeOrganizationMember = posthogOperation({
158
158
  }
159
159
  });
160
160
  const listOrganizationInvites = posthogOperation({
161
- id: "posthog_organization_invites_list",
161
+ id: "posthog.organization-invites-list",
162
162
  name: "PostHog List Organization Invites",
163
163
  description: "List outstanding invites for an organization",
164
164
  input: z.object({
@@ -175,7 +175,7 @@ const listOrganizationInvites = posthogOperation({
175
175
  }
176
176
  });
177
177
  const createOrganizationInvite = posthogOperation({
178
- id: "posthog_organization_invites_create",
178
+ id: "posthog.organization-invites-create",
179
179
  name: "PostHog Create Organization Invite",
180
180
  description: "Invite a user to an organization",
181
181
  input: z.object({
@@ -197,7 +197,7 @@ const createOrganizationInvite = posthogOperation({
197
197
  }
198
198
  });
199
199
  const deleteOrganizationInvite = posthogOperation({
200
- id: "posthog_organization_invites_delete",
200
+ id: "posthog.organization-invites-delete",
201
201
  name: "PostHog Delete Organization Invite",
202
202
  description: "Revoke an organization invite",
203
203
  input: z.object({
@@ -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/persons.d.ts
6
6
  declare const listPersons: _keystrokehq_core0.Operation<z.ZodObject<{
@@ -24,7 +24,7 @@ declare const listPersons: _keystrokehq_core0.Operation<z.ZodObject<{
24
24
  created_at: z.ZodOptional<z.ZodString>;
25
25
  is_identified: z.ZodOptional<z.ZodBoolean>;
26
26
  }, z.core.$strip>>;
27
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
27
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
28
28
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
29
29
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
30
30
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -48,7 +48,7 @@ declare const getPerson: _keystrokehq_core0.Operation<z.ZodObject<{
48
48
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
49
  created_at: z.ZodOptional<z.ZodString>;
50
50
  is_identified: z.ZodOptional<z.ZodBoolean>;
51
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
51
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
52
52
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
53
53
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
54
54
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -74,7 +74,7 @@ declare const updatePerson: _keystrokehq_core0.Operation<z.ZodObject<{
74
74
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
75
  created_at: z.ZodOptional<z.ZodString>;
76
76
  is_identified: z.ZodOptional<z.ZodBoolean>;
77
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
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>;
@@ -93,7 +93,7 @@ declare const deletePerson: _keystrokehq_core0.Operation<z.ZodObject<{
93
93
  projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
94
94
  }, z.core.$strip>, z.ZodObject<{
95
95
  success: z.ZodBoolean;
96
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
96
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
97
97
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
98
98
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
99
99
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -118,7 +118,7 @@ declare const mergePersons: _keystrokehq_core0.Operation<z.ZodObject<{
118
118
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
119
119
  created_at: z.ZodOptional<z.ZodString>;
120
120
  is_identified: z.ZodOptional<z.ZodBoolean>;
121
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
121
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
122
122
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
123
123
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
124
124
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -137,7 +137,7 @@ declare const splitPerson: _keystrokehq_core0.Operation<z.ZodObject<{
137
137
  projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
138
138
  }, z.core.$strip>, z.ZodObject<{
139
139
  success: z.ZodBoolean;
140
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
140
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
141
141
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
142
142
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
143
143
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -163,7 +163,7 @@ declare const updatePersonProperty: _keystrokehq_core0.Operation<z.ZodObject<{
163
163
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
164
164
  created_at: z.ZodOptional<z.ZodString>;
165
165
  is_identified: z.ZodOptional<z.ZodBoolean>;
166
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
166
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
167
167
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
168
168
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
169
169
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -182,7 +182,7 @@ declare const deletePersonProperty: _keystrokehq_core0.Operation<z.ZodObject<{
182
182
  projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
183
183
  }, z.core.$strip>, z.ZodObject<{
184
184
  success: z.ZodBoolean;
185
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
185
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
186
186
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
187
187
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
188
188
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -201,7 +201,7 @@ declare const getPersonActivity: _keystrokehq_core0.Operation<z.ZodObject<{
201
201
  projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
202
202
  }, z.core.$strip>, z.ZodObject<{
203
203
  results: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
204
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
204
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
205
205
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
206
206
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
207
207
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -219,7 +219,7 @@ declare const getPersonsActivityFeed: _keystrokehq_core0.Operation<z.ZodObject<{
219
219
  projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
220
220
  }, z.core.$strip>, z.ZodObject<{
221
221
  results: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
222
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
222
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
223
223
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
224
224
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
225
225
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -236,7 +236,7 @@ declare const getPersonsValues: _keystrokehq_core0.Operation<z.ZodObject<{
236
236
  key: z.ZodString;
237
237
  value: z.ZodOptional<z.ZodString>;
238
238
  projectId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
239
- }, z.core.$strip>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
239
+ }, z.core.$strip>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
240
240
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
241
241
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
242
242
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -267,7 +267,7 @@ declare const getPersonsFunnel: _keystrokehq_core0.Operation<z.ZodObject<{
267
267
  created_at: z.ZodOptional<z.ZodString>;
268
268
  is_identified: z.ZodOptional<z.ZodBoolean>;
269
269
  }, z.core.$strip>>;
270
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
270
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
271
271
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
272
272
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
273
273
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -298,7 +298,7 @@ declare const getPersonsTrends: _keystrokehq_core0.Operation<z.ZodObject<{
298
298
  created_at: z.ZodOptional<z.ZodString>;
299
299
  is_identified: z.ZodOptional<z.ZodBoolean>;
300
300
  }, z.core.$strip>>;
301
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
301
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
302
302
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
303
303
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
304
304
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -328,7 +328,7 @@ declare const getPersonsLifecycle: _keystrokehq_core0.Operation<z.ZodObject<{
328
328
  created_at: z.ZodOptional<z.ZodString>;
329
329
  is_identified: z.ZodOptional<z.ZodBoolean>;
330
330
  }, z.core.$strip>>;
331
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
331
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
332
332
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
333
333
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
334
334
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
@@ -352,7 +352,7 @@ declare const resetPersonName: _keystrokehq_core0.Operation<z.ZodObject<{
352
352
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
353
353
  created_at: z.ZodOptional<z.ZodString>;
354
354
  is_identified: z.ZodOptional<z.ZodBoolean>;
355
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:posthog", z.ZodObject<{
355
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"posthog", z.ZodObject<{
356
356
  POSTHOG_PERSONAL_API_KEY: z.ZodString;
357
357
  POSTHOG_PROJECT_API_KEY: z.ZodOptional<z.ZodString>;
358
358
  POSTHOG_HOST: z.ZodDefault<z.ZodURL>;
package/dist/persons.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createPosthogManagementClient } from "./client.mjs";
2
2
  import { paginatedResponseSchema, personSchema, projectIdInputShape, propertiesBagSchema } from "./schemas.mjs";
3
- import { t as posthogOperation } from "./factory-DYDvHOGb.mjs";
3
+ import { t as posthogOperation } from "./factory-C3ssyfSy.mjs";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region src/persons.ts
@@ -18,7 +18,7 @@ const idInput = {
18
18
  };
19
19
  const listSchema = paginatedResponseSchema(personSchema);
20
20
  const listPersons = posthogOperation({
21
- id: "posthog_persons_list",
21
+ id: "posthog.persons-list",
22
22
  name: "PostHog List Persons",
23
23
  description: "List persons with optional search, email, or distinct-id filters",
24
24
  input: z.object({
@@ -49,7 +49,7 @@ const listPersons = posthogOperation({
49
49
  }
50
50
  });
51
51
  const getPerson = posthogOperation({
52
- id: "posthog_persons_get",
52
+ id: "posthog.persons-get",
53
53
  name: "PostHog Get Person",
54
54
  description: "Retrieve a single person by id",
55
55
  input: z.object(idInput),
@@ -64,7 +64,7 @@ const getPerson = posthogOperation({
64
64
  }
65
65
  });
66
66
  const updatePerson = posthogOperation({
67
- id: "posthog_persons_update",
67
+ id: "posthog.persons-update",
68
68
  name: "PostHog Update Person",
69
69
  description: "Update a person (partial update)",
70
70
  input: z.object({
@@ -86,7 +86,7 @@ const updatePerson = posthogOperation({
86
86
  }
87
87
  });
88
88
  const deletePerson = posthogOperation({
89
- id: "posthog_persons_delete",
89
+ id: "posthog.persons-delete",
90
90
  name: "PostHog Delete Person",
91
91
  description: "Delete a person and optionally their associated events",
92
92
  input: z.object({
@@ -107,7 +107,7 @@ const deletePerson = posthogOperation({
107
107
  }
108
108
  });
109
109
  const mergePersons = posthogOperation({
110
- id: "posthog_persons_merge",
110
+ id: "posthog.persons-merge",
111
111
  name: "PostHog Merge Persons",
112
112
  description: "Merge two persons together (destination receives events from source)",
113
113
  input: z.object({
@@ -127,7 +127,7 @@ const mergePersons = posthogOperation({
127
127
  }
128
128
  });
129
129
  const splitPerson = posthogOperation({
130
- id: "posthog_persons_split",
130
+ id: "posthog.persons-split",
131
131
  name: "PostHog Split Person",
132
132
  description: "Split a person by separating their distinct_ids",
133
133
  input: z.object({
@@ -148,7 +148,7 @@ const splitPerson = posthogOperation({
148
148
  }
149
149
  });
150
150
  const updatePersonProperty = posthogOperation({
151
- id: "posthog_persons_update_property",
151
+ id: "posthog.persons-update-property",
152
152
  name: "PostHog Update Person Property",
153
153
  description: "Set a single property on a person",
154
154
  input: z.object({
@@ -172,7 +172,7 @@ const updatePersonProperty = posthogOperation({
172
172
  }
173
173
  });
174
174
  const deletePersonProperty = posthogOperation({
175
- id: "posthog_persons_delete_property",
175
+ id: "posthog.persons-delete-property",
176
176
  name: "PostHog Delete Person Property",
177
177
  description: "Remove a single property from a person",
178
178
  input: z.object({
@@ -193,7 +193,7 @@ const deletePersonProperty = posthogOperation({
193
193
  }
194
194
  });
195
195
  const getPersonActivity = posthogOperation({
196
- id: "posthog_persons_activity",
196
+ id: "posthog.persons-activity",
197
197
  name: "PostHog Person Activity",
198
198
  description: "Fetch recent activity for a person",
199
199
  input: z.object({
@@ -212,7 +212,7 @@ const getPersonActivity = posthogOperation({
212
212
  }
213
213
  });
214
214
  const getPersonsActivityFeed = posthogOperation({
215
- id: "posthog_persons_activity_feed",
215
+ id: "posthog.persons-activity-feed",
216
216
  name: "PostHog Persons Activity Feed",
217
217
  description: "Fetch the project-wide persons activity feed",
218
218
  input: z.object({
@@ -231,7 +231,7 @@ const getPersonsActivityFeed = posthogOperation({
231
231
  }
232
232
  });
233
233
  const getPersonsValues = posthogOperation({
234
- id: "posthog_persons_values",
234
+ id: "posthog.persons-values",
235
235
  name: "PostHog Person Property Values",
236
236
  description: "Fetch distinct values for a person property",
237
237
  input: z.object({
@@ -254,7 +254,7 @@ const getPersonsValues = posthogOperation({
254
254
  }
255
255
  });
256
256
  const getPersonsFunnel = posthogOperation({
257
- id: "posthog_persons_funnel",
257
+ id: "posthog.persons-funnel",
258
258
  name: "PostHog Persons Funnel",
259
259
  description: "Fetch persons dropping through a funnel",
260
260
  input: z.object({
@@ -279,7 +279,7 @@ const getPersonsFunnel = posthogOperation({
279
279
  }
280
280
  });
281
281
  const getPersonsTrends = posthogOperation({
282
- id: "posthog_persons_trends",
282
+ id: "posthog.persons-trends",
283
283
  name: "PostHog Persons Trends",
284
284
  description: "Fetch persons matching a trend query",
285
285
  input: z.object({
@@ -304,7 +304,7 @@ const getPersonsTrends = posthogOperation({
304
304
  }
305
305
  });
306
306
  const getPersonsLifecycle = posthogOperation({
307
- id: "posthog_persons_lifecycle",
307
+ id: "posthog.persons-lifecycle",
308
308
  name: "PostHog Persons Lifecycle",
309
309
  description: "Fetch persons matching a lifecycle query",
310
310
  input: z.object({
@@ -325,7 +325,7 @@ const getPersonsLifecycle = posthogOperation({
325
325
  }
326
326
  });
327
327
  const resetPersonName = posthogOperation({
328
- id: "posthog_persons_reset_name",
328
+ id: "posthog.persons-reset-name",
329
329
  name: "PostHog Reset Person Name",
330
330
  description: "Reset a person displayed-name override",
331
331
  input: z.object(idInput),