@keystrokehq/segment 0.0.9 → 0.0.16-integration-id-canonicalization.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.
Files changed (80) hide show
  1. package/README.md +52 -173
  2. package/dist/{client.mjs → client-DQfeZzLR.mjs} +28 -3
  3. package/dist/credential-sets/index.d.mts +2 -0
  4. package/dist/credential-sets/index.mjs +3 -0
  5. package/dist/index.d.mts +4 -1
  6. package/dist/index.mjs +5 -1
  7. package/dist/operations/index.d.mts +2 -0
  8. package/dist/operations/index.mjs +3 -0
  9. package/dist/schemas/index.mjs +1 -1
  10. package/dist/segment.credential-set-BTTrkHO7.mjs +33 -0
  11. package/dist/{integration-CeShwMIi.d.mts → segment.credential-set-BgROtI_9.d.mts} +28 -37
  12. package/dist/{triggers.d.mts → triggers/index.d.mts} +72 -6
  13. package/dist/{triggers.mjs → triggers/index.mjs} +136 -7
  14. package/dist/workspace-list-spaces.operation-DKWX3vl5.mjs +5200 -0
  15. package/dist/workspace-list-spaces.operation-QbDIgfRG.d.mts +6548 -0
  16. package/package.json +11 -123
  17. package/dist/_official/index.d.mts +0 -2
  18. package/dist/_official/index.mjs +0 -3
  19. package/dist/_runtime/index.d.mts +0 -1
  20. package/dist/_runtime/index.mjs +0 -1
  21. package/dist/audiences.d.mts +0 -282
  22. package/dist/audiences.mjs +0 -205
  23. package/dist/client.d.mts +0 -90
  24. package/dist/computed-traits.d.mts +0 -215
  25. package/dist/computed-traits.mjs +0 -149
  26. package/dist/connection.d.mts +0 -2
  27. package/dist/connection.mjs +0 -3
  28. package/dist/crud-DV9e4Spi.mjs +0 -140
  29. package/dist/deletion-suppression.d.mts +0 -191
  30. package/dist/deletion-suppression.mjs +0 -103
  31. package/dist/delivery-overview.d.mts +0 -79
  32. package/dist/delivery-overview.mjs +0 -54
  33. package/dist/destination-filters.d.mts +0 -190
  34. package/dist/destination-filters.mjs +0 -115
  35. package/dist/destinations.d.mts +0 -473
  36. package/dist/destinations.mjs +0 -257
  37. package/dist/edge-functions.d.mts +0 -168
  38. package/dist/edge-functions.mjs +0 -72
  39. package/dist/errors-4FGnrowW.mjs +0 -27
  40. package/dist/events-catalog.d.mts +0 -111
  41. package/dist/events-catalog.mjs +0 -65
  42. package/dist/events.d.mts +0 -167
  43. package/dist/events.mjs +0 -134
  44. package/dist/factory-DRwj5eiU.mjs +0 -7
  45. package/dist/functions.d.mts +0 -347
  46. package/dist/functions.mjs +0 -180
  47. package/dist/iam-groups.d.mts +0 -284
  48. package/dist/iam-groups.mjs +0 -144
  49. package/dist/iam-users.d.mts +0 -205
  50. package/dist/iam-users.mjs +0 -91
  51. package/dist/integration-B9FOjHPc.mjs +0 -115
  52. package/dist/labels.d.mts +0 -100
  53. package/dist/labels.mjs +0 -58
  54. package/dist/monitoring.d.mts +0 -182
  55. package/dist/monitoring.mjs +0 -88
  56. package/dist/profiles-sync.d.mts +0 -127
  57. package/dist/profiles-sync.mjs +0 -89
  58. package/dist/profiles.d.mts +0 -197
  59. package/dist/profiles.mjs +0 -137
  60. package/dist/reverse-etl.d.mts +0 -448
  61. package/dist/reverse-etl.mjs +0 -228
  62. package/dist/roles.d.mts +0 -48
  63. package/dist/roles.mjs +0 -25
  64. package/dist/sources.d.mts +0 -560
  65. package/dist/sources.mjs +0 -259
  66. package/dist/tracking-plans.d.mts +0 -351
  67. package/dist/tracking-plans.mjs +0 -160
  68. package/dist/tracking.d.mts +0 -499
  69. package/dist/tracking.mjs +0 -255
  70. package/dist/transformations.d.mts +0 -188
  71. package/dist/transformations.mjs +0 -83
  72. package/dist/usage.d.mts +0 -70
  73. package/dist/usage.mjs +0 -55
  74. package/dist/verification.d.mts +0 -17
  75. package/dist/verification.mjs +0 -51
  76. package/dist/warehouses.d.mts +0 -341
  77. package/dist/warehouses.mjs +0 -176
  78. package/dist/workspaces.d.mts +0 -95
  79. package/dist/workspaces.mjs +0 -67
  80. /package/dist/{common-CdGiJbjq.mjs → common-DUU0airJ.mjs} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keystrokehq/segment",
3
- "version": "0.0.9",
3
+ "version": "0.0.16-integration-id-canonicalization.0",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -9,133 +9,21 @@
9
9
  "types": "./dist/index.d.mts",
10
10
  "default": "./dist/index.mjs"
11
11
  },
12
- "./connection": {
13
- "types": "./dist/connection.d.mts",
14
- "default": "./dist/connection.mjs"
12
+ "./credential-sets": {
13
+ "types": "./dist/credential-sets/index.d.mts",
14
+ "default": "./dist/credential-sets/index.mjs"
15
15
  },
16
- "./client": {
17
- "types": "./dist/client.d.mts",
18
- "default": "./dist/client.mjs"
16
+ "./operations": {
17
+ "types": "./dist/operations/index.d.mts",
18
+ "default": "./dist/operations/index.mjs"
19
19
  },
20
20
  "./schemas": {
21
21
  "types": "./dist/schemas/index.d.mts",
22
22
  "default": "./dist/schemas/index.mjs"
23
23
  },
24
- "./_official": {
25
- "types": "./dist/_official/index.d.mts",
26
- "default": "./dist/_official/index.mjs"
27
- },
28
- "./events": {
29
- "types": "./dist/events.d.mts",
30
- "default": "./dist/events.mjs"
31
- },
32
24
  "./triggers": {
33
- "types": "./dist/triggers.d.mts",
34
- "default": "./dist/triggers.mjs"
35
- },
36
- "./verification": {
37
- "types": "./dist/verification.d.mts",
38
- "default": "./dist/verification.mjs"
39
- },
40
- "./tracking": {
41
- "types": "./dist/tracking.d.mts",
42
- "default": "./dist/tracking.mjs"
43
- },
44
- "./profiles": {
45
- "types": "./dist/profiles.d.mts",
46
- "default": "./dist/profiles.mjs"
47
- },
48
- "./workspaces": {
49
- "types": "./dist/workspaces.d.mts",
50
- "default": "./dist/workspaces.mjs"
51
- },
52
- "./sources": {
53
- "types": "./dist/sources.d.mts",
54
- "default": "./dist/sources.mjs"
55
- },
56
- "./destinations": {
57
- "types": "./dist/destinations.d.mts",
58
- "default": "./dist/destinations.mjs"
59
- },
60
- "./tracking-plans": {
61
- "types": "./dist/tracking-plans.d.mts",
62
- "default": "./dist/tracking-plans.mjs"
63
- },
64
- "./functions": {
65
- "types": "./dist/functions.d.mts",
66
- "default": "./dist/functions.mjs"
67
- },
68
- "./warehouses": {
69
- "types": "./dist/warehouses.d.mts",
70
- "default": "./dist/warehouses.mjs"
71
- },
72
- "./audiences": {
73
- "types": "./dist/audiences.d.mts",
74
- "default": "./dist/audiences.mjs"
75
- },
76
- "./computed-traits": {
77
- "types": "./dist/computed-traits.d.mts",
78
- "default": "./dist/computed-traits.mjs"
79
- },
80
- "./monitoring": {
81
- "types": "./dist/monitoring.d.mts",
82
- "default": "./dist/monitoring.mjs"
83
- },
84
- "./destination-filters": {
85
- "types": "./dist/destination-filters.d.mts",
86
- "default": "./dist/destination-filters.mjs"
87
- },
88
- "./transformations": {
89
- "types": "./dist/transformations.d.mts",
90
- "default": "./dist/transformations.mjs"
91
- },
92
- "./labels": {
93
- "types": "./dist/labels.d.mts",
94
- "default": "./dist/labels.mjs"
95
- },
96
- "./iam-groups": {
97
- "types": "./dist/iam-groups.d.mts",
98
- "default": "./dist/iam-groups.mjs"
99
- },
100
- "./iam-users": {
101
- "types": "./dist/iam-users.d.mts",
102
- "default": "./dist/iam-users.mjs"
103
- },
104
- "./roles": {
105
- "types": "./dist/roles.d.mts",
106
- "default": "./dist/roles.mjs"
107
- },
108
- "./events-catalog": {
109
- "types": "./dist/events-catalog.d.mts",
110
- "default": "./dist/events-catalog.mjs"
111
- },
112
- "./edge-functions": {
113
- "types": "./dist/edge-functions.d.mts",
114
- "default": "./dist/edge-functions.mjs"
115
- },
116
- "./reverse-etl": {
117
- "types": "./dist/reverse-etl.d.mts",
118
- "default": "./dist/reverse-etl.mjs"
119
- },
120
- "./profiles-sync": {
121
- "types": "./dist/profiles-sync.d.mts",
122
- "default": "./dist/profiles-sync.mjs"
123
- },
124
- "./deletion-suppression": {
125
- "types": "./dist/deletion-suppression.d.mts",
126
- "default": "./dist/deletion-suppression.mjs"
127
- },
128
- "./delivery-overview": {
129
- "types": "./dist/delivery-overview.d.mts",
130
- "default": "./dist/delivery-overview.mjs"
131
- },
132
- "./usage": {
133
- "types": "./dist/usage.d.mts",
134
- "default": "./dist/usage.mjs"
135
- },
136
- "./_runtime": {
137
- "types": "./dist/_runtime/index.d.mts",
138
- "default": "./dist/_runtime/index.mjs"
25
+ "types": "./dist/triggers/index.d.mts",
26
+ "default": "./dist/triggers/index.mjs"
139
27
  }
140
28
  },
141
29
  "files": [
@@ -155,9 +43,9 @@
155
43
  "typescript": "^5.9.3",
156
44
  "vitest": "^4.0.18",
157
45
  "@keystrokehq/core": "^0.0.12",
158
- "@keystrokehq/test-utils": "0.0.0",
159
46
  "@keystrokehq/typescript-config": "0.0.0",
160
- "@keystrokehq/integration-authoring": "0.0.9"
47
+ "@keystrokehq/integration-authoring": "0.0.9",
48
+ "@keystrokehq/test-utils": "0.0.0"
161
49
  },
162
50
  "keywords": [
163
51
  "segment",
@@ -1,2 +0,0 @@
1
- import { a as segmentOfficialIntegration, i as segmentBundle } from "../integration-CeShwMIi.mjs";
2
- export { segmentBundle, segmentOfficialIntegration };
@@ -1,3 +0,0 @@
1
- import { n as segmentBundle, r as segmentOfficialIntegration } from "../integration-B9FOjHPc.mjs";
2
-
3
- export { segmentBundle, segmentOfficialIntegration };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1,282 +0,0 @@
1
- import * as _keystrokehq_core0 from "@keystrokehq/core";
2
- import { z } from "zod";
3
- import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
-
5
- //#region src/audiences.d.ts
6
- declare const audienceSchema: z.ZodObject<{
7
- id: z.ZodString;
8
- key: z.ZodOptional<z.ZodString>;
9
- name: z.ZodOptional<z.ZodString>;
10
- description: z.ZodOptional<z.ZodString>;
11
- definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
12
- enabled: z.ZodOptional<z.ZodBoolean>;
13
- }, z.core.$catchall<z.ZodUnknown>>;
14
- declare const listAudiences: _keystrokehq_core0.Operation<z.ZodObject<{
15
- spaceId: z.ZodString;
16
- pageSize: z.ZodOptional<z.ZodNumber>;
17
- pageToken: z.ZodOptional<z.ZodString>;
18
- }, z.core.$strip>, z.ZodObject<{
19
- items: z.ZodArray<z.ZodObject<{
20
- id: z.ZodString;
21
- key: z.ZodOptional<z.ZodString>;
22
- name: z.ZodOptional<z.ZodString>;
23
- description: z.ZodOptional<z.ZodString>;
24
- definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
25
- enabled: z.ZodOptional<z.ZodBoolean>;
26
- }, z.core.$catchall<z.ZodUnknown>>>;
27
- nextPageToken: z.ZodOptional<z.ZodString>;
28
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
29
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
30
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
31
- us: "us";
32
- eu: "eu";
33
- }>>;
34
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
35
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
36
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
37
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
38
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
39
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
40
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
41
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
42
- us: "us";
43
- eu: "eu";
44
- }>>;
45
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
46
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
47
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
48
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
49
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
50
- }, z.core.$strip>>[] | undefined>], undefined>;
51
- declare const getAudience: _keystrokehq_core0.Operation<z.ZodObject<{
52
- spaceId: z.ZodString;
53
- id: z.ZodString;
54
- }, z.core.$strip>, z.ZodObject<{
55
- id: z.ZodString;
56
- key: z.ZodOptional<z.ZodString>;
57
- name: z.ZodOptional<z.ZodString>;
58
- description: z.ZodOptional<z.ZodString>;
59
- definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
60
- enabled: z.ZodOptional<z.ZodBoolean>;
61
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
62
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
63
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
64
- us: "us";
65
- eu: "eu";
66
- }>>;
67
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
68
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
69
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
70
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
71
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
72
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
73
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
74
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
75
- us: "us";
76
- eu: "eu";
77
- }>>;
78
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
79
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
80
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
81
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
82
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
83
- }, z.core.$strip>>[] | undefined>], undefined>;
84
- declare const createAudience: _keystrokehq_core0.Operation<z.ZodObject<{
85
- spaceId: z.ZodString;
86
- name: z.ZodString;
87
- description: z.ZodOptional<z.ZodString>;
88
- definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
89
- enabled: z.ZodOptional<z.ZodBoolean>;
90
- }, z.core.$strip>, z.ZodObject<{
91
- id: z.ZodString;
92
- key: z.ZodOptional<z.ZodString>;
93
- name: z.ZodOptional<z.ZodString>;
94
- description: z.ZodOptional<z.ZodString>;
95
- definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
96
- enabled: z.ZodOptional<z.ZodBoolean>;
97
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
98
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
99
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
100
- us: "us";
101
- eu: "eu";
102
- }>>;
103
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
104
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
105
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
106
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
107
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
108
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
109
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
110
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
111
- us: "us";
112
- eu: "eu";
113
- }>>;
114
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
115
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
116
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
117
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
118
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
119
- }, z.core.$strip>>[] | undefined>], undefined>;
120
- declare const updateAudience: _keystrokehq_core0.Operation<z.ZodObject<{
121
- spaceId: z.ZodString;
122
- id: z.ZodString;
123
- name: z.ZodOptional<z.ZodString>;
124
- description: z.ZodOptional<z.ZodString>;
125
- definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
126
- enabled: z.ZodOptional<z.ZodBoolean>;
127
- }, z.core.$strip>, z.ZodObject<{
128
- id: z.ZodString;
129
- key: z.ZodOptional<z.ZodString>;
130
- name: z.ZodOptional<z.ZodString>;
131
- description: z.ZodOptional<z.ZodString>;
132
- definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
133
- enabled: z.ZodOptional<z.ZodBoolean>;
134
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
135
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
136
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
137
- us: "us";
138
- eu: "eu";
139
- }>>;
140
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
141
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
142
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
143
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
144
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
145
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
146
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
147
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
148
- us: "us";
149
- eu: "eu";
150
- }>>;
151
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
152
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
153
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
154
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
155
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
156
- }, z.core.$strip>>[] | undefined>], undefined>;
157
- declare const deleteAudience: _keystrokehq_core0.Operation<z.ZodObject<{
158
- spaceId: z.ZodString;
159
- id: z.ZodString;
160
- }, z.core.$strip>, z.ZodObject<{
161
- deleted: z.ZodLiteral<true>;
162
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
163
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
164
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
165
- us: "us";
166
- eu: "eu";
167
- }>>;
168
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
169
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
170
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
171
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
172
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
173
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
174
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
175
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
176
- us: "us";
177
- eu: "eu";
178
- }>>;
179
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
180
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
181
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
182
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
183
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
184
- }, z.core.$strip>>[] | undefined>], undefined>;
185
- declare const previewAudience: _keystrokehq_core0.Operation<z.ZodObject<{
186
- spaceId: z.ZodString;
187
- definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
188
- }, z.core.$strip>, z.ZodObject<{
189
- count: z.ZodOptional<z.ZodNumber>;
190
- sample: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
191
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
192
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
193
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
194
- us: "us";
195
- eu: "eu";
196
- }>>;
197
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
198
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
199
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
200
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
201
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
202
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
203
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
204
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
205
- us: "us";
206
- eu: "eu";
207
- }>>;
208
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
209
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
210
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
211
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
212
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
213
- }, z.core.$strip>>[] | undefined>], undefined>;
214
- declare const getAudienceMembership: _keystrokehq_core0.Operation<z.ZodObject<{
215
- spaceId: z.ZodString;
216
- id: z.ZodString;
217
- profileId: z.ZodString;
218
- }, z.core.$strip>, z.ZodObject<{
219
- profileId: z.ZodOptional<z.ZodString>;
220
- isMember: z.ZodOptional<z.ZodBoolean>;
221
- enteredAt: z.ZodOptional<z.ZodString>;
222
- exitedAt: z.ZodOptional<z.ZodString>;
223
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
224
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
225
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
226
- us: "us";
227
- eu: "eu";
228
- }>>;
229
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
230
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
231
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
232
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
233
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
234
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
235
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
236
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
237
- us: "us";
238
- eu: "eu";
239
- }>>;
240
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
241
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
242
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
243
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
244
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
245
- }, z.core.$strip>>[] | undefined>], undefined>;
246
- declare const listAudienceMembers: _keystrokehq_core0.Operation<z.ZodObject<{
247
- spaceId: z.ZodString;
248
- id: z.ZodString;
249
- pageSize: z.ZodOptional<z.ZodNumber>;
250
- pageToken: z.ZodOptional<z.ZodString>;
251
- }, z.core.$strip>, z.ZodObject<{
252
- items: z.ZodArray<z.ZodObject<{
253
- profileId: z.ZodString;
254
- traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
255
- enteredAt: z.ZodOptional<z.ZodString>;
256
- }, z.core.$catchall<z.ZodUnknown>>>;
257
- nextPageToken: z.ZodOptional<z.ZodString>;
258
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
259
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
260
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
261
- us: "us";
262
- eu: "eu";
263
- }>>;
264
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
265
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
266
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
267
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
268
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
269
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
270
- SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
271
- SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
272
- us: "us";
273
- eu: "eu";
274
- }>>;
275
- SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
276
- SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
277
- SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
278
- SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
279
- SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
280
- }, z.core.$strip>>[] | undefined>], undefined>;
281
- //#endregion
282
- export { audienceSchema, createAudience, deleteAudience, getAudience, getAudienceMembership, listAudienceMembers, listAudiences, previewAudience, updateAudience };
@@ -1,205 +0,0 @@
1
- import { createSegmentClient } from "./client.mjs";
2
- import { a as segmentLooseObjectSchema, n as segmentIdSchema } from "./common-CdGiJbjq.mjs";
3
- import { t as segmentOperation } from "./factory-DRwj5eiU.mjs";
4
- import { z } from "zod";
5
-
6
- //#region src/audiences.ts
7
- /**
8
- * segment/audiences.ts — Engage audiences (space-scoped). 8 actions total
9
- * (PLAN.md § 6.7).
10
- */
11
- const audienceSchema = segmentLooseObjectSchema({
12
- id: segmentIdSchema,
13
- key: z.string().optional(),
14
- name: z.string().optional(),
15
- description: z.string().optional(),
16
- definition: z.record(z.string(), z.unknown()).optional(),
17
- enabled: z.boolean().optional()
18
- });
19
- const membershipSchema = segmentLooseObjectSchema({
20
- profileId: z.string().optional(),
21
- isMember: z.boolean().optional(),
22
- enteredAt: z.string().optional(),
23
- exitedAt: z.string().optional()
24
- });
25
- const memberSchema = segmentLooseObjectSchema({
26
- profileId: z.string(),
27
- traits: z.record(z.string(), z.unknown()).optional(),
28
- enteredAt: z.string().optional()
29
- });
30
- const previewResultSchema = segmentLooseObjectSchema({
31
- count: z.number().optional(),
32
- sample: z.array(z.record(z.string(), z.unknown())).optional()
33
- });
34
- const listAudiences = segmentOperation({
35
- id: "segment.audiences.list",
36
- name: "List audiences",
37
- description: "List audiences defined in an Engage space.",
38
- input: z.object({
39
- spaceId: segmentIdSchema,
40
- pageSize: z.number().int().positive().max(200).optional(),
41
- pageToken: z.string().optional()
42
- }),
43
- output: z.object({
44
- items: z.array(audienceSchema),
45
- nextPageToken: z.string().optional()
46
- }),
47
- run: async (input, credentials) => {
48
- const result = await createSegmentClient(credentials).publicApi.list(`/spaces/${encodeURIComponent(input.spaceId)}/audiences`, {
49
- itemsKey: "audiences",
50
- items: audienceSchema
51
- }, { query: {
52
- count: input.pageSize,
53
- cursor: input.pageToken
54
- } });
55
- return {
56
- items: [...result.items],
57
- ...result.nextPageToken !== void 0 ? { nextPageToken: result.nextPageToken } : {}
58
- };
59
- }
60
- });
61
- const getAudience = segmentOperation({
62
- id: "segment.audiences.get",
63
- name: "Get audience",
64
- description: "Fetch an audience in an Engage space.",
65
- input: z.object({
66
- spaceId: segmentIdSchema,
67
- id: segmentIdSchema
68
- }),
69
- output: audienceSchema,
70
- run: async (input, credentials) => {
71
- const body = await createSegmentClient(credentials).publicApi.request(`/spaces/${encodeURIComponent(input.spaceId)}/audiences/${encodeURIComponent(input.id)}`);
72
- const rec = body;
73
- return audienceSchema.parse(rec.data?.audience ?? body);
74
- }
75
- });
76
- const createAudience = segmentOperation({
77
- id: "segment.audiences.create",
78
- name: "Create audience",
79
- description: "Create a new audience.",
80
- input: z.object({
81
- spaceId: segmentIdSchema,
82
- name: z.string().min(1),
83
- description: z.string().optional(),
84
- definition: z.record(z.string(), z.unknown()),
85
- enabled: z.boolean().optional()
86
- }),
87
- output: audienceSchema,
88
- needsApproval: true,
89
- run: async (input, credentials) => {
90
- const client = createSegmentClient(credentials);
91
- const { spaceId, ...body } = input;
92
- const response = await client.publicApi.request(`/spaces/${encodeURIComponent(spaceId)}/audiences`, {
93
- method: "POST",
94
- body
95
- });
96
- const rec = response;
97
- return audienceSchema.parse(rec.data?.audience ?? response);
98
- }
99
- });
100
- const updateAudience = segmentOperation({
101
- id: "segment.audiences.update",
102
- name: "Update audience",
103
- description: "Patch an audience definition.",
104
- input: z.object({
105
- spaceId: segmentIdSchema,
106
- id: segmentIdSchema,
107
- name: z.string().optional(),
108
- description: z.string().optional(),
109
- definition: z.record(z.string(), z.unknown()).optional(),
110
- enabled: z.boolean().optional()
111
- }),
112
- output: audienceSchema,
113
- needsApproval: true,
114
- run: async (input, credentials) => {
115
- const client = createSegmentClient(credentials);
116
- const { spaceId, id, ...body } = input;
117
- const response = await client.publicApi.request(`/spaces/${encodeURIComponent(spaceId)}/audiences/${encodeURIComponent(id)}`, {
118
- method: "PATCH",
119
- body
120
- });
121
- const rec = response;
122
- return audienceSchema.parse(rec.data?.audience ?? response);
123
- }
124
- });
125
- const deleteAudience = segmentOperation({
126
- id: "segment.audiences.delete",
127
- name: "Delete audience",
128
- description: "Delete an audience.",
129
- input: z.object({
130
- spaceId: segmentIdSchema,
131
- id: segmentIdSchema
132
- }),
133
- output: z.object({ deleted: z.literal(true) }),
134
- needsApproval: true,
135
- run: async (input, credentials) => {
136
- await createSegmentClient(credentials).publicApi.request(`/spaces/${encodeURIComponent(input.spaceId)}/audiences/${encodeURIComponent(input.id)}`, { method: "DELETE" });
137
- return { deleted: true };
138
- }
139
- });
140
- const previewAudience = segmentOperation({
141
- id: "segment.audiences.preview",
142
- name: "Preview audience",
143
- description: "Run a preview compute over an audience definition without saving.",
144
- input: z.object({
145
- spaceId: segmentIdSchema,
146
- definition: z.record(z.string(), z.unknown())
147
- }),
148
- output: previewResultSchema,
149
- needsApproval: true,
150
- run: async (input, credentials) => {
151
- const body = await createSegmentClient(credentials).publicApi.request(`/spaces/${encodeURIComponent(input.spaceId)}/audiences/previews`, {
152
- method: "POST",
153
- body: { definition: input.definition }
154
- });
155
- const rec = body;
156
- return previewResultSchema.parse(rec.data?.preview ?? body);
157
- }
158
- });
159
- const getAudienceMembership = segmentOperation({
160
- id: "segment.audiences.getMembership",
161
- name: "Get audience membership",
162
- description: "Check whether a specific profile is a member of an audience.",
163
- input: z.object({
164
- spaceId: segmentIdSchema,
165
- id: segmentIdSchema,
166
- profileId: segmentIdSchema
167
- }),
168
- output: membershipSchema,
169
- run: async (input, credentials) => {
170
- const body = await createSegmentClient(credentials).publicApi.request(`/spaces/${encodeURIComponent(input.spaceId)}/audiences/${encodeURIComponent(input.id)}/membership/${encodeURIComponent(input.profileId)}`);
171
- const rec = body;
172
- return membershipSchema.parse(rec.data ?? body);
173
- }
174
- });
175
- const listAudienceMembers = segmentOperation({
176
- id: "segment.audiences.listMembers",
177
- name: "List audience members",
178
- description: "List the profiles currently in an audience.",
179
- input: z.object({
180
- spaceId: segmentIdSchema,
181
- id: segmentIdSchema,
182
- pageSize: z.number().int().positive().max(200).optional(),
183
- pageToken: z.string().optional()
184
- }),
185
- output: z.object({
186
- items: z.array(memberSchema),
187
- nextPageToken: z.string().optional()
188
- }),
189
- run: async (input, credentials) => {
190
- const result = await createSegmentClient(credentials).publicApi.list(`/spaces/${encodeURIComponent(input.spaceId)}/audiences/${encodeURIComponent(input.id)}/members`, {
191
- itemsKey: "members",
192
- items: memberSchema
193
- }, { query: {
194
- count: input.pageSize,
195
- cursor: input.pageToken
196
- } });
197
- return {
198
- items: [...result.items],
199
- ...result.nextPageToken !== void 0 ? { nextPageToken: result.nextPageToken } : {}
200
- };
201
- }
202
- });
203
-
204
- //#endregion
205
- export { audienceSchema, createAudience, deleteAudience, getAudience, getAudienceMembership, listAudienceMembers, listAudiences, previewAudience, updateAudience };