@keystrokehq/segment 0.0.1
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 +232 -0
- package/dist/_official/index.d.mts +2 -0
- package/dist/_official/index.mjs +3 -0
- package/dist/_runtime/index.d.mts +1 -0
- package/dist/_runtime/index.mjs +1 -0
- package/dist/audiences.d.mts +282 -0
- package/dist/audiences.mjs +205 -0
- package/dist/client.d.mts +90 -0
- package/dist/client.mjs +337 -0
- package/dist/common-CdGiJbjq.mjs +56 -0
- package/dist/computed-traits.d.mts +215 -0
- package/dist/computed-traits.mjs +149 -0
- package/dist/connection.d.mts +2 -0
- package/dist/connection.mjs +3 -0
- package/dist/crud-SWa_79Hg.mjs +140 -0
- package/dist/deletion-suppression.d.mts +191 -0
- package/dist/deletion-suppression.mjs +103 -0
- package/dist/delivery-overview.d.mts +79 -0
- package/dist/delivery-overview.mjs +54 -0
- package/dist/destination-filters.d.mts +190 -0
- package/dist/destination-filters.mjs +115 -0
- package/dist/destinations.d.mts +473 -0
- package/dist/destinations.mjs +257 -0
- package/dist/edge-functions.d.mts +168 -0
- package/dist/edge-functions.mjs +72 -0
- package/dist/errors-4FGnrowW.mjs +27 -0
- package/dist/events-catalog.d.mts +111 -0
- package/dist/events-catalog.mjs +65 -0
- package/dist/events.d.mts +167 -0
- package/dist/events.mjs +134 -0
- package/dist/factory-CvfKfzMq.mjs +8 -0
- package/dist/functions.d.mts +347 -0
- package/dist/functions.mjs +180 -0
- package/dist/iam-groups.d.mts +284 -0
- package/dist/iam-groups.mjs +144 -0
- package/dist/iam-users.d.mts +205 -0
- package/dist/iam-users.mjs +91 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +1 -0
- package/dist/integration-B5zYasBZ.mjs +25 -0
- package/dist/integration-D2yRaKFR.d.mts +67 -0
- package/dist/labels.d.mts +100 -0
- package/dist/labels.mjs +58 -0
- package/dist/monitoring.d.mts +182 -0
- package/dist/monitoring.mjs +88 -0
- package/dist/profiles-sync.d.mts +127 -0
- package/dist/profiles-sync.mjs +89 -0
- package/dist/profiles.d.mts +197 -0
- package/dist/profiles.mjs +137 -0
- package/dist/reverse-etl.d.mts +448 -0
- package/dist/reverse-etl.mjs +228 -0
- package/dist/roles.d.mts +48 -0
- package/dist/roles.mjs +25 -0
- package/dist/schemas/index.d.mts +57 -0
- package/dist/schemas/index.mjs +3 -0
- package/dist/sources.d.mts +560 -0
- package/dist/sources.mjs +259 -0
- package/dist/tracking-plans.d.mts +351 -0
- package/dist/tracking-plans.mjs +160 -0
- package/dist/tracking.d.mts +499 -0
- package/dist/tracking.mjs +255 -0
- package/dist/transformations.d.mts +188 -0
- package/dist/transformations.mjs +83 -0
- package/dist/triggers.d.mts +54 -0
- package/dist/triggers.mjs +341 -0
- package/dist/usage.d.mts +70 -0
- package/dist/usage.mjs +55 -0
- package/dist/verification.d.mts +17 -0
- package/dist/verification.mjs +51 -0
- package/dist/warehouses.d.mts +341 -0
- package/dist/warehouses.mjs +176 -0
- package/dist/workspaces.d.mts +95 -0
- package/dist/workspaces.mjs +67 -0
- package/package.json +188 -0
package/README.md
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# @keystrokehq/segment
|
|
2
|
+
|
|
3
|
+
First-class Keystroke integration for
|
|
4
|
+
[Twilio Segment](https://segment.com/) — the customer data platform.
|
|
5
|
+
|
|
6
|
+
The package covers **160 operations across 24 domains** and **14 direct-binding
|
|
7
|
+
triggers**, spanning Segment's three authentication boundaries:
|
|
8
|
+
|
|
9
|
+
- **Tracking API** (`api.segment.io` / `events.eu1.segmentapis.com`) —
|
|
10
|
+
`identify`, `track`, `page`, `screen`, `group`, `alias`, `batch`, and a
|
|
11
|
+
backdated historical `import`.
|
|
12
|
+
- **Public API** (`api.segmentapis.com` / `eu1.api.segmentapis.com`) — full
|
|
13
|
+
CRUD for sources, destinations, tracking plans, functions, warehouses,
|
|
14
|
+
Engage audiences & computed traits, monitoring, destination filters,
|
|
15
|
+
transformations, labels, IAM, reverse ETL, profiles sync, GDPR deletion &
|
|
16
|
+
suppression, delivery overview, and usage.
|
|
17
|
+
- **Profile API** (`profiles.segment.com`) — read-only access to traits,
|
|
18
|
+
events, external ids, links, metadata, and audience membership.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
The package is a workspace member; add a dependency from whichever workspace
|
|
23
|
+
needs it:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@keystrokehq/segment": "workspace:*"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Credentials
|
|
34
|
+
|
|
35
|
+
Segment does not publish an end-user OAuth flow for any of its three
|
|
36
|
+
authentication surfaces. You configure tokens once in Segment and paste
|
|
37
|
+
them into the Keystroke connection (`kind: 'manual'`):
|
|
38
|
+
|
|
39
|
+
| Field | Required | What it unlocks |
|
|
40
|
+
|--------------------------------|-------------------------------|-----------------|
|
|
41
|
+
| `SEGMENT_PUBLIC_API_TOKEN` | yes | Public API — every management action |
|
|
42
|
+
| `SEGMENT_REGION` | defaulted to `'us'` | `'us'` \| `'eu'` — selects hosts for Public + Tracking APIs |
|
|
43
|
+
| `SEGMENT_DEFAULT_WRITE_KEY` | when calling `tracking.*` without a `sourceId` | Fallback write key |
|
|
44
|
+
| `SEGMENT_WRITE_KEYS_JSON` | when calling `tracking.*` with `sourceId` | JSON map `{ [sourceId]: writeKey }` |
|
|
45
|
+
| `SEGMENT_PROFILE_API_TOKEN` | when calling `profiles.*` | Profile API access token |
|
|
46
|
+
| `SEGMENT_PROFILE_SPACE_ID` | when calling `profiles.*` without per-call `spaceId` | Default Engage space |
|
|
47
|
+
| `SEGMENT_WEBHOOK_SHARED_SECRET`| when using webhook triggers | Shared secret configured on the Segment-side Webhook destination |
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { segment } from '@keystrokehq/segment/connection';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Quickstart
|
|
54
|
+
|
|
55
|
+
### Track an event
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { track } from '@keystrokehq/segment/tracking';
|
|
59
|
+
|
|
60
|
+
await track.run(
|
|
61
|
+
{ userId: 'u_123', event: 'Signup Completed', properties: { plan: 'pro' } },
|
|
62
|
+
{ credentials: { segment: connectionCreds } }
|
|
63
|
+
);
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### List destinations
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import { listDestinations } from '@keystrokehq/segment/destinations';
|
|
70
|
+
|
|
71
|
+
const { items, nextPageToken } = await listDestinations.run(
|
|
72
|
+
{ pageSize: 50 },
|
|
73
|
+
{ credentials: { segment: connectionCreds } }
|
|
74
|
+
);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Create an audience in an Engage space
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { createAudience } from '@keystrokehq/segment/audiences';
|
|
81
|
+
|
|
82
|
+
await createAudience.run(
|
|
83
|
+
{
|
|
84
|
+
spaceId: 'spa_abc',
|
|
85
|
+
name: 'VIP Users',
|
|
86
|
+
description: 'Users with >$1000 LTV',
|
|
87
|
+
definition: { type: 'USERS', query: 'lifetime_value > 1000' },
|
|
88
|
+
},
|
|
89
|
+
{ credentials: { segment: connectionCreds } }
|
|
90
|
+
);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### React to audience membership changes (webhook trigger)
|
|
94
|
+
|
|
95
|
+
Set up a Webhook destination in Segment pointing at your Keystroke ingress
|
|
96
|
+
for this integration, with a shared secret matching
|
|
97
|
+
`SEGMENT_WEBHOOK_SHARED_SECRET`:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { webhooks } from '@keystrokehq/segment/triggers';
|
|
101
|
+
|
|
102
|
+
export const onVipEntered = webhooks.audienceEntered({
|
|
103
|
+
name: 'VIP entered',
|
|
104
|
+
filter: (event) => event.audienceKey === 'vip_users',
|
|
105
|
+
transform: (event) => ({ userId: event.userId, enteredAt: event.timestamp }),
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Poll a reverse-ETL run to completion
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import { polling } from '@keystrokehq/segment/triggers';
|
|
113
|
+
|
|
114
|
+
export const onModelRun = polling.reverseEtlRunSucceeded(
|
|
115
|
+
{ modelId: 'rem_user_segments' },
|
|
116
|
+
{ schedule: '5m', transform: (run) => ({ runId: run.runId, status: run.status }) }
|
|
117
|
+
);
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Read a profile's traits (Profile API)
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
import { getProfileTraits } from '@keystrokehq/segment/profiles';
|
|
124
|
+
|
|
125
|
+
await getProfileTraits.run(
|
|
126
|
+
{ profileId: 'u_123', spaceId: 'spa_abc' },
|
|
127
|
+
{ credentials: { segment: connectionCreds } }
|
|
128
|
+
);
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Public surface
|
|
132
|
+
|
|
133
|
+
### End-user authoring subpaths
|
|
134
|
+
|
|
135
|
+
Operation modules (import the individual operations you need):
|
|
136
|
+
|
|
137
|
+
- `@keystrokehq/segment/tracking`
|
|
138
|
+
- `@keystrokehq/segment/sources`
|
|
139
|
+
- `@keystrokehq/segment/destinations`
|
|
140
|
+
- `@keystrokehq/segment/tracking-plans`
|
|
141
|
+
- `@keystrokehq/segment/functions`
|
|
142
|
+
- `@keystrokehq/segment/warehouses`
|
|
143
|
+
- `@keystrokehq/segment/audiences`
|
|
144
|
+
- `@keystrokehq/segment/computed-traits`
|
|
145
|
+
- `@keystrokehq/segment/monitoring`
|
|
146
|
+
- `@keystrokehq/segment/destination-filters`
|
|
147
|
+
- `@keystrokehq/segment/transformations`
|
|
148
|
+
- `@keystrokehq/segment/labels`
|
|
149
|
+
- `@keystrokehq/segment/iam-groups`
|
|
150
|
+
- `@keystrokehq/segment/iam-users`
|
|
151
|
+
- `@keystrokehq/segment/roles`
|
|
152
|
+
- `@keystrokehq/segment/events-catalog`
|
|
153
|
+
- `@keystrokehq/segment/edge-functions`
|
|
154
|
+
- `@keystrokehq/segment/reverse-etl`
|
|
155
|
+
- `@keystrokehq/segment/profiles-sync`
|
|
156
|
+
- `@keystrokehq/segment/deletion-suppression`
|
|
157
|
+
- `@keystrokehq/segment/delivery-overview`
|
|
158
|
+
- `@keystrokehq/segment/usage`
|
|
159
|
+
- `@keystrokehq/segment/workspaces`
|
|
160
|
+
- `@keystrokehq/segment/profiles`
|
|
161
|
+
|
|
162
|
+
Triggers (all direct-binding — no preset APIs):
|
|
163
|
+
|
|
164
|
+
- `@keystrokehq/segment/triggers` exports `webhooks` and `polling`
|
|
165
|
+
namespaces plus each polling helper by name.
|
|
166
|
+
|
|
167
|
+
### Support surfaces
|
|
168
|
+
|
|
169
|
+
- `@keystrokehq/segment/connection` — `segment`, `SegmentCredentials`
|
|
170
|
+
- `@keystrokehq/segment/client` — `createSegmentClient`, three
|
|
171
|
+
sub-clients, `splitBatch`, host constants
|
|
172
|
+
- `@keystrokehq/segment/schemas` — reusable Zod primitives
|
|
173
|
+
- `@keystrokehq/segment/events` — curated trigger-event schemas
|
|
174
|
+
- `@keystrokehq/segment/verification` —
|
|
175
|
+
`verifySegmentWebhookRequest`, `buildSegmentWebhookSignature`
|
|
176
|
+
|
|
177
|
+
### Internal surfaces — not for authoring
|
|
178
|
+
|
|
179
|
+
- `@keystrokehq/segment/_official` — bundle wiring for
|
|
180
|
+
`@keystrokehq/official-integration-catalog`
|
|
181
|
+
- `@keystrokehq/segment/_runtime` — runtime registry hooks
|
|
182
|
+
|
|
183
|
+
## Caveats
|
|
184
|
+
|
|
185
|
+
- **Regional dispatch.** `SEGMENT_REGION = 'eu'` routes Tracking calls to
|
|
186
|
+
`events.eu1.segmentapis.com` **and** Public API calls to
|
|
187
|
+
`eu1.api.segmentapis.com`. This was a PLAN delta — the earlier spec said
|
|
188
|
+
the Public API was region-agnostic. See `IMPLEMENTATION_NOTES.md` Q1.
|
|
189
|
+
- **Write-key fan-out.** Tracking operations accept an optional `sourceId`.
|
|
190
|
+
When present, the client looks it up in `SEGMENT_WRITE_KEYS_JSON`;
|
|
191
|
+
otherwise it falls back to `SEGMENT_DEFAULT_WRITE_KEY`. If neither
|
|
192
|
+
resolves, the call fails with `SegmentApiError { kind: 'missing_credential' }`.
|
|
193
|
+
- **Batch limits.** Segment enforces 500 KB per batch and 32 KB per event.
|
|
194
|
+
`tracking.batch` automatically splits oversized batches and reports any
|
|
195
|
+
individual events that exceed 32 KB in the `rejected` output.
|
|
196
|
+
- **Alias deprecation.** Many downstream destinations ignore Segment alias
|
|
197
|
+
calls; `segment.tracking.alias` is primarily useful for warehouse
|
|
198
|
+
identity resolution.
|
|
199
|
+
- **`segment.tracking.import` is sugar.** Segment does not publish a
|
|
200
|
+
`/v1/import` endpoint in its current HTTP API docs. The action sends a
|
|
201
|
+
`POST /v1/track` with the caller's `timestamp` and a fresh `sentAt`, which
|
|
202
|
+
is the documented pattern for historical imports. Only destinations that
|
|
203
|
+
accept backdated events (warehouses, Mixpanel, Amplitude) will backfill.
|
|
204
|
+
- **Audience webhook provisioning is manual.** You must configure the
|
|
205
|
+
Webhook destination inside Segment's UI, point it at your Keystroke
|
|
206
|
+
ingress URL, and set `SEGMENT_WEBHOOK_SHARED_SECRET` on **both** sides.
|
|
207
|
+
The package verifies the `X-Signature` header (HMAC-SHA1 hex) via
|
|
208
|
+
`src/verification.ts`.
|
|
209
|
+
- **Polling trigger cost.** The polling triggers issue one Public API
|
|
210
|
+
request per tick per binding. Space out schedules on high-volume
|
|
211
|
+
workspaces and collapse to the minimum number of bindings per surface
|
|
212
|
+
you can.
|
|
213
|
+
- **No official SDK.** `@segment/public-api-sdk-typescript` exists but
|
|
214
|
+
depends on `request@^2` and `bluebird@^3` — not ESM-friendly or usable
|
|
215
|
+
in Cloudflare Workers / V8 isolates. The client is hand-rolled
|
|
216
|
+
`fetch`-based.
|
|
217
|
+
|
|
218
|
+
## Documentation & references
|
|
219
|
+
|
|
220
|
+
- Tracking API: https://segment.com/docs/connections/sources/catalog/libraries/server/http-api/
|
|
221
|
+
- Public API: https://docs.segmentapis.com/
|
|
222
|
+
- Profile API: https://segment.com/docs/unify/profile-api/
|
|
223
|
+
- Engage audiences & computed traits: https://segment.com/docs/engage/
|
|
224
|
+
- Functions: https://segment.com/docs/connections/functions/
|
|
225
|
+
- Reverse ETL: https://segment.com/docs/connections/reverse-etl/
|
|
226
|
+
- Monitoring & Alerts: https://segment.com/docs/monitor/
|
|
227
|
+
- Regional endpoints: https://segment.com/docs/guides/regional-segment/
|
|
228
|
+
- Deletion & suppression: https://segment.com/docs/privacy/user-deletion-and-suppression/
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
3
|
+
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
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 };
|