@keystrokehq/segment 0.0.15 → 0.0.16-integration-id-canonicalization.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 +52 -173
- package/dist/{client.mjs → client-DQfeZzLR.mjs} +28 -3
- package/dist/credential-sets/index.d.mts +2 -0
- package/dist/credential-sets/index.mjs +3 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +5 -1
- package/dist/operations/index.d.mts +2 -0
- package/dist/operations/index.mjs +3 -0
- package/dist/schemas/index.mjs +1 -1
- package/dist/{integration-CliT2xe3.mjs → segment.credential-set-BTTrkHO7.mjs} +16 -9
- package/dist/{integration-DWeMeBqQ.d.mts → segment.credential-set-BgROtI_9.d.mts} +28 -27
- package/dist/{triggers.d.mts → triggers/index.d.mts} +72 -6
- package/dist/{triggers.mjs → triggers/index.mjs} +186 -7
- package/dist/workspace-list-spaces.operation-DKWX3vl5.mjs +5200 -0
- package/dist/workspace-list-spaces.operation-DNIUfIuv.d.mts +6548 -0
- package/package.json +13 -125
- package/dist/_official/index.d.mts +0 -2
- package/dist/_official/index.mjs +0 -3
- package/dist/_runtime/index.d.mts +0 -1
- package/dist/_runtime/index.mjs +0 -1
- package/dist/audiences.d.mts +0 -193
- package/dist/audiences.mjs +0 -205
- package/dist/client.d.mts +0 -90
- package/dist/computed-traits.d.mts +0 -148
- package/dist/computed-traits.mjs +0 -149
- package/dist/connection.d.mts +0 -2
- package/dist/connection.mjs +0 -3
- package/dist/crud-DGM2Ekdr.mjs +0 -140
- package/dist/deletion-suppression.d.mts +0 -135
- package/dist/deletion-suppression.mjs +0 -103
- package/dist/delivery-overview.d.mts +0 -56
- package/dist/delivery-overview.mjs +0 -54
- package/dist/destination-filters.d.mts +0 -134
- package/dist/destination-filters.mjs +0 -115
- package/dist/destinations.d.mts +0 -318
- package/dist/destinations.mjs +0 -257
- package/dist/edge-functions.d.mts +0 -112
- package/dist/edge-functions.mjs +0 -72
- package/dist/errors-4FGnrowW.mjs +0 -27
- package/dist/events-catalog.d.mts +0 -77
- package/dist/events-catalog.mjs +0 -65
- package/dist/events.d.mts +0 -167
- package/dist/events.mjs +0 -134
- package/dist/factory-Dqb49Dfj.mjs +0 -8
- package/dist/functions.d.mts +0 -236
- package/dist/functions.mjs +0 -180
- package/dist/iam-groups.d.mts +0 -184
- package/dist/iam-groups.mjs +0 -144
- package/dist/iam-users.d.mts +0 -138
- package/dist/iam-users.mjs +0 -91
- package/dist/labels.d.mts +0 -66
- package/dist/labels.mjs +0 -58
- package/dist/monitoring.d.mts +0 -126
- package/dist/monitoring.mjs +0 -88
- package/dist/profiles-sync.d.mts +0 -82
- package/dist/profiles-sync.mjs +0 -89
- package/dist/profiles.d.mts +0 -130
- package/dist/profiles.mjs +0 -137
- package/dist/reverse-etl.d.mts +0 -315
- package/dist/reverse-etl.mjs +0 -228
- package/dist/roles.d.mts +0 -36
- package/dist/roles.mjs +0 -25
- package/dist/sources.d.mts +0 -383
- package/dist/sources.mjs +0 -259
- package/dist/tracking-plans.d.mts +0 -229
- package/dist/tracking-plans.mjs +0 -160
- package/dist/tracking.d.mts +0 -410
- package/dist/tracking.mjs +0 -255
- package/dist/transformations.d.mts +0 -132
- package/dist/transformations.mjs +0 -83
- package/dist/usage.d.mts +0 -47
- package/dist/usage.mjs +0 -55
- package/dist/verification.d.mts +0 -17
- package/dist/verification.mjs +0 -51
- package/dist/warehouses.d.mts +0 -219
- package/dist/warehouses.mjs +0 -176
- package/dist/workspaces.d.mts +0 -61
- package/dist/workspaces.mjs +0 -67
- /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.
|
|
3
|
+
"version": "0.0.16-integration-id-canonicalization.1",
|
|
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
|
-
"./
|
|
13
|
-
"types": "./dist/
|
|
14
|
-
"default": "./dist/
|
|
12
|
+
"./credential-sets": {
|
|
13
|
+
"types": "./dist/credential-sets/index.d.mts",
|
|
14
|
+
"default": "./dist/credential-sets/index.mjs"
|
|
15
15
|
},
|
|
16
|
-
"./
|
|
17
|
-
"types": "./dist/
|
|
18
|
-
"default": "./dist/
|
|
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": [
|
|
@@ -144,20 +32,20 @@
|
|
|
144
32
|
"LICENSE"
|
|
145
33
|
],
|
|
146
34
|
"dependencies": {
|
|
147
|
-
"@keystrokehq/integration-authoring": "^0.0.9",
|
|
148
35
|
"zod": "^4.3.6"
|
|
149
36
|
},
|
|
150
37
|
"peerDependencies": {
|
|
151
|
-
"@keystrokehq/core": ">=0.0.
|
|
38
|
+
"@keystrokehq/core": ">=0.0.8 <0.1.0"
|
|
152
39
|
},
|
|
153
40
|
"devDependencies": {
|
|
154
41
|
"@types/node": "^22.19.11",
|
|
155
42
|
"tsdown": "^0.20.3",
|
|
156
43
|
"typescript": "^5.9.3",
|
|
157
44
|
"vitest": "^4.0.18",
|
|
158
|
-
"@keystrokehq/core": "^0.0.
|
|
45
|
+
"@keystrokehq/core": "^0.0.12",
|
|
159
46
|
"@keystrokehq/test-utils": "0.0.0",
|
|
160
|
-
"@keystrokehq/typescript-config": "0.0.0"
|
|
47
|
+
"@keystrokehq/typescript-config": "0.0.0",
|
|
48
|
+
"@keystrokehq/integration-authoring": "0.0.9"
|
|
161
49
|
},
|
|
162
50
|
"keywords": [
|
|
163
51
|
"segment",
|
package/dist/_official/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/_runtime/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/audiences.d.mts
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region src/audiences.d.ts
|
|
5
|
-
declare const audienceSchema: z.ZodObject<{
|
|
6
|
-
id: z.ZodString;
|
|
7
|
-
key: z.ZodOptional<z.ZodString>;
|
|
8
|
-
name: z.ZodOptional<z.ZodString>;
|
|
9
|
-
description: z.ZodOptional<z.ZodString>;
|
|
10
|
-
definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
11
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
13
|
-
declare const listAudiences: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
14
|
-
spaceId: z.ZodString;
|
|
15
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
16
|
-
pageToken: z.ZodOptional<z.ZodString>;
|
|
17
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
-
items: z.ZodArray<z.ZodObject<{
|
|
19
|
-
id: z.ZodString;
|
|
20
|
-
key: z.ZodOptional<z.ZodString>;
|
|
21
|
-
name: z.ZodOptional<z.ZodString>;
|
|
22
|
-
description: z.ZodOptional<z.ZodString>;
|
|
23
|
-
definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
24
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
26
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
27
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
28
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
29
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
30
|
-
us: "us";
|
|
31
|
-
eu: "eu";
|
|
32
|
-
}>>;
|
|
33
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
34
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
35
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
36
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
37
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
38
|
-
}, z.core.$strip>>], undefined>;
|
|
39
|
-
declare const getAudience: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
40
|
-
spaceId: z.ZodString;
|
|
41
|
-
id: z.ZodString;
|
|
42
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
-
id: z.ZodString;
|
|
44
|
-
key: z.ZodOptional<z.ZodString>;
|
|
45
|
-
name: z.ZodOptional<z.ZodString>;
|
|
46
|
-
description: z.ZodOptional<z.ZodString>;
|
|
47
|
-
definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
48
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
50
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
51
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
52
|
-
us: "us";
|
|
53
|
-
eu: "eu";
|
|
54
|
-
}>>;
|
|
55
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
56
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
57
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
58
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
59
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
60
|
-
}, z.core.$strip>>], undefined>;
|
|
61
|
-
declare const createAudience: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
62
|
-
spaceId: z.ZodString;
|
|
63
|
-
name: z.ZodString;
|
|
64
|
-
description: z.ZodOptional<z.ZodString>;
|
|
65
|
-
definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
66
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
-
id: z.ZodString;
|
|
69
|
-
key: z.ZodOptional<z.ZodString>;
|
|
70
|
-
name: z.ZodOptional<z.ZodString>;
|
|
71
|
-
description: z.ZodOptional<z.ZodString>;
|
|
72
|
-
definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
73
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
75
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
76
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
77
|
-
us: "us";
|
|
78
|
-
eu: "eu";
|
|
79
|
-
}>>;
|
|
80
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
81
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
82
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
83
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
84
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
85
|
-
}, z.core.$strip>>], undefined>;
|
|
86
|
-
declare const updateAudience: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
87
|
-
spaceId: z.ZodString;
|
|
88
|
-
id: z.ZodString;
|
|
89
|
-
name: z.ZodOptional<z.ZodString>;
|
|
90
|
-
description: z.ZodOptional<z.ZodString>;
|
|
91
|
-
definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
92
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
94
|
-
id: z.ZodString;
|
|
95
|
-
key: z.ZodOptional<z.ZodString>;
|
|
96
|
-
name: z.ZodOptional<z.ZodString>;
|
|
97
|
-
description: z.ZodOptional<z.ZodString>;
|
|
98
|
-
definition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
99
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
101
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
102
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
103
|
-
us: "us";
|
|
104
|
-
eu: "eu";
|
|
105
|
-
}>>;
|
|
106
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
107
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
108
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
109
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
110
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
111
|
-
}, z.core.$strip>>], undefined>;
|
|
112
|
-
declare const deleteAudience: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
113
|
-
spaceId: z.ZodString;
|
|
114
|
-
id: z.ZodString;
|
|
115
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
116
|
-
deleted: z.ZodLiteral<true>;
|
|
117
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
118
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
119
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
120
|
-
us: "us";
|
|
121
|
-
eu: "eu";
|
|
122
|
-
}>>;
|
|
123
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
124
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
125
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
126
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
127
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
128
|
-
}, z.core.$strip>>], undefined>;
|
|
129
|
-
declare const previewAudience: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
130
|
-
spaceId: z.ZodString;
|
|
131
|
-
definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
132
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
-
count: z.ZodOptional<z.ZodNumber>;
|
|
134
|
-
sample: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
135
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
136
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
137
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
138
|
-
us: "us";
|
|
139
|
-
eu: "eu";
|
|
140
|
-
}>>;
|
|
141
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
142
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
143
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
144
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
145
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
146
|
-
}, z.core.$strip>>], undefined>;
|
|
147
|
-
declare const getAudienceMembership: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
148
|
-
spaceId: z.ZodString;
|
|
149
|
-
id: z.ZodString;
|
|
150
|
-
profileId: z.ZodString;
|
|
151
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
-
profileId: z.ZodOptional<z.ZodString>;
|
|
153
|
-
isMember: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
-
enteredAt: z.ZodOptional<z.ZodString>;
|
|
155
|
-
exitedAt: z.ZodOptional<z.ZodString>;
|
|
156
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
157
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
158
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
159
|
-
us: "us";
|
|
160
|
-
eu: "eu";
|
|
161
|
-
}>>;
|
|
162
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
163
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
164
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
165
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
166
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
167
|
-
}, z.core.$strip>>], undefined>;
|
|
168
|
-
declare const listAudienceMembers: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
169
|
-
spaceId: z.ZodString;
|
|
170
|
-
id: z.ZodString;
|
|
171
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
172
|
-
pageToken: z.ZodOptional<z.ZodString>;
|
|
173
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
174
|
-
items: z.ZodArray<z.ZodObject<{
|
|
175
|
-
profileId: z.ZodString;
|
|
176
|
-
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
177
|
-
enteredAt: z.ZodOptional<z.ZodString>;
|
|
178
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
179
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
180
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
181
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
182
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
183
|
-
us: "us";
|
|
184
|
-
eu: "eu";
|
|
185
|
-
}>>;
|
|
186
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
187
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
188
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
189
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
190
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
191
|
-
}, z.core.$strip>>], undefined>;
|
|
192
|
-
//#endregion
|
|
193
|
-
export { audienceSchema, createAudience, deleteAudience, getAudience, getAudienceMembership, listAudienceMembers, listAudiences, previewAudience, updateAudience };
|
package/dist/audiences.mjs
DELETED
|
@@ -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-Dqb49Dfj.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 };
|
package/dist/client.d.mts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { n as SegmentRegion, t as SegmentCredentials } from "./integration-DWeMeBqQ.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/client.d.ts
|
|
5
|
-
declare const PUBLIC_API_HOSTS: Readonly<Record<SegmentRegion, string>>;
|
|
6
|
-
declare const TRACKING_API_HOSTS: Readonly<Record<SegmentRegion, string>>;
|
|
7
|
-
declare const PROFILE_API_HOST = "https://profiles.segment.com/v1";
|
|
8
|
-
/** Segment-enforced hard limit for a single event body (Track/Identify/…). */
|
|
9
|
-
declare const MAX_EVENT_BYTES: number;
|
|
10
|
-
/** Segment-enforced hard limit for a `/v1/batch` envelope. */
|
|
11
|
-
declare const MAX_BATCH_BYTES: number;
|
|
12
|
-
type FetchLike = (input: string | URL, init?: RequestInit) => Promise<Response>;
|
|
13
|
-
interface CreateSegmentClientOptions {
|
|
14
|
-
/** Override the global `fetch` (for tests, custom timeouts, etc.). */
|
|
15
|
-
readonly fetch?: FetchLike;
|
|
16
|
-
/** Maximum number of retries on 429/5xx. Defaults to 3. */
|
|
17
|
-
readonly maxRetries?: number;
|
|
18
|
-
/** Maximum overall backoff between retries in ms. Defaults to 10_000. */
|
|
19
|
-
readonly maxBackoffMs?: number;
|
|
20
|
-
/** Sleep function (override for tests). */
|
|
21
|
-
readonly sleep?: (ms: number) => Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
type QueryPrimitive = string | number | boolean;
|
|
24
|
-
type QueryValue = QueryPrimitive | readonly QueryPrimitive[] | undefined;
|
|
25
|
-
interface PublicRequestOptions {
|
|
26
|
-
readonly method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
27
|
-
readonly query?: Readonly<Record<string, QueryValue>>;
|
|
28
|
-
readonly body?: unknown;
|
|
29
|
-
readonly timeoutMs?: number;
|
|
30
|
-
}
|
|
31
|
-
interface ListOptions<TOut> {
|
|
32
|
-
readonly itemsKey: string;
|
|
33
|
-
readonly items: z.ZodType<TOut>;
|
|
34
|
-
}
|
|
35
|
-
interface ListResult<T> {
|
|
36
|
-
readonly items: readonly T[];
|
|
37
|
-
readonly nextPageToken?: string;
|
|
38
|
-
readonly totalEntries?: number;
|
|
39
|
-
}
|
|
40
|
-
interface BatchSplitChunk<T> {
|
|
41
|
-
readonly events: readonly T[];
|
|
42
|
-
readonly bytes: number;
|
|
43
|
-
}
|
|
44
|
-
interface BatchSplitResult<T> {
|
|
45
|
-
readonly chunks: readonly BatchSplitChunk<T>[];
|
|
46
|
-
readonly rejected: readonly {
|
|
47
|
-
readonly event: T;
|
|
48
|
-
readonly bytes: number;
|
|
49
|
-
}[];
|
|
50
|
-
}
|
|
51
|
-
declare function splitBatch<T>(events: readonly T[], options?: {
|
|
52
|
-
readonly maxBatchBytes?: number;
|
|
53
|
-
readonly maxEventBytes?: number;
|
|
54
|
-
}): BatchSplitResult<T>;
|
|
55
|
-
interface PublicApiClient {
|
|
56
|
-
readonly baseUrl: string;
|
|
57
|
-
readonly request: <T>(path: string, options?: PublicRequestOptions) => Promise<T>;
|
|
58
|
-
readonly list: <T>(path: string, listOpts: ListOptions<T>, requestOpts?: PublicRequestOptions) => Promise<ListResult<T>>;
|
|
59
|
-
}
|
|
60
|
-
interface TrackingApiClient {
|
|
61
|
-
readonly baseUrl: string;
|
|
62
|
-
/** Send a single tracking event. `method` defaults to the endpoint path
|
|
63
|
-
* (e.g. `identify`, `track`). `sourceId` selects which write key to use. */
|
|
64
|
-
readonly send: (method: TrackingMethod, payload: Record<string, unknown>, options?: {
|
|
65
|
-
readonly sourceId?: string;
|
|
66
|
-
}) => Promise<void>;
|
|
67
|
-
readonly batch: (events: readonly Record<string, unknown>[], options?: {
|
|
68
|
-
readonly sourceId?: string;
|
|
69
|
-
}) => Promise<{
|
|
70
|
-
readonly chunksSent: number;
|
|
71
|
-
readonly rejected: readonly Record<string, unknown>[];
|
|
72
|
-
}>;
|
|
73
|
-
}
|
|
74
|
-
interface ProfileApiClient {
|
|
75
|
-
readonly baseUrl: string;
|
|
76
|
-
readonly request: <T>(path: string, options?: PublicRequestOptions & {
|
|
77
|
-
readonly spaceId?: string;
|
|
78
|
-
}) => Promise<T>;
|
|
79
|
-
}
|
|
80
|
-
type TrackingMethod = 'identify' | 'track' | 'page' | 'screen' | 'group' | 'alias' | 'batch';
|
|
81
|
-
interface SegmentClient {
|
|
82
|
-
readonly credentials: SegmentCredentials;
|
|
83
|
-
readonly region: SegmentRegion;
|
|
84
|
-
readonly publicApi: PublicApiClient;
|
|
85
|
-
readonly tracking: TrackingApiClient;
|
|
86
|
-
readonly profiles: ProfileApiClient;
|
|
87
|
-
}
|
|
88
|
-
declare function createSegmentClient(credentials: SegmentCredentials, options?: CreateSegmentClientOptions): SegmentClient;
|
|
89
|
-
//#endregion
|
|
90
|
-
export { BatchSplitChunk, BatchSplitResult, CreateSegmentClientOptions, FetchLike, ListOptions, ListResult, MAX_BATCH_BYTES, MAX_EVENT_BYTES, PROFILE_API_HOST, PUBLIC_API_HOSTS, ProfileApiClient, PublicApiClient, PublicRequestOptions, SegmentClient, TRACKING_API_HOSTS, TrackingApiClient, TrackingMethod, createSegmentClient, splitBatch };
|