@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.
- 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/segment.credential-set-BTTrkHO7.mjs +33 -0
- package/dist/{integration-CeShwMIi.d.mts → segment.credential-set-BgROtI_9.d.mts} +28 -37
- package/dist/{triggers.d.mts → triggers/index.d.mts} +72 -6
- package/dist/{triggers.mjs → triggers/index.mjs} +136 -7
- package/dist/workspace-list-spaces.operation-DKWX3vl5.mjs +5200 -0
- package/dist/workspace-list-spaces.operation-QbDIgfRG.d.mts +6548 -0
- package/package.json +11 -123
- 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 -282
- package/dist/audiences.mjs +0 -205
- package/dist/client.d.mts +0 -90
- package/dist/computed-traits.d.mts +0 -215
- package/dist/computed-traits.mjs +0 -149
- package/dist/connection.d.mts +0 -2
- package/dist/connection.mjs +0 -3
- package/dist/crud-DV9e4Spi.mjs +0 -140
- package/dist/deletion-suppression.d.mts +0 -191
- package/dist/deletion-suppression.mjs +0 -103
- package/dist/delivery-overview.d.mts +0 -79
- package/dist/delivery-overview.mjs +0 -54
- package/dist/destination-filters.d.mts +0 -190
- package/dist/destination-filters.mjs +0 -115
- package/dist/destinations.d.mts +0 -473
- package/dist/destinations.mjs +0 -257
- package/dist/edge-functions.d.mts +0 -168
- package/dist/edge-functions.mjs +0 -72
- package/dist/errors-4FGnrowW.mjs +0 -27
- package/dist/events-catalog.d.mts +0 -111
- package/dist/events-catalog.mjs +0 -65
- package/dist/events.d.mts +0 -167
- package/dist/events.mjs +0 -134
- package/dist/factory-DRwj5eiU.mjs +0 -7
- package/dist/functions.d.mts +0 -347
- package/dist/functions.mjs +0 -180
- package/dist/iam-groups.d.mts +0 -284
- package/dist/iam-groups.mjs +0 -144
- package/dist/iam-users.d.mts +0 -205
- package/dist/iam-users.mjs +0 -91
- package/dist/integration-B9FOjHPc.mjs +0 -115
- package/dist/labels.d.mts +0 -100
- package/dist/labels.mjs +0 -58
- package/dist/monitoring.d.mts +0 -182
- package/dist/monitoring.mjs +0 -88
- package/dist/profiles-sync.d.mts +0 -127
- package/dist/profiles-sync.mjs +0 -89
- package/dist/profiles.d.mts +0 -197
- package/dist/profiles.mjs +0 -137
- package/dist/reverse-etl.d.mts +0 -448
- package/dist/reverse-etl.mjs +0 -228
- package/dist/roles.d.mts +0 -48
- package/dist/roles.mjs +0 -25
- package/dist/sources.d.mts +0 -560
- package/dist/sources.mjs +0 -259
- package/dist/tracking-plans.d.mts +0 -351
- package/dist/tracking-plans.mjs +0 -160
- package/dist/tracking.d.mts +0 -499
- package/dist/tracking.mjs +0 -255
- package/dist/transformations.d.mts +0 -188
- package/dist/transformations.mjs +0 -83
- package/dist/usage.d.mts +0 -70
- 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 -341
- package/dist/warehouses.mjs +0 -176
- package/dist/workspaces.d.mts +0 -95
- package/dist/workspaces.mjs +0 -67
- /package/dist/{common-CdGiJbjq.mjs → common-DUU0airJ.mjs} +0 -0
package/dist/reverse-etl.d.mts
DELETED
|
@@ -1,448 +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/reverse-etl.d.ts
|
|
6
|
-
declare const reverseEtlModelSchema: z.ZodObject<{
|
|
7
|
-
id: z.ZodString;
|
|
8
|
-
name: z.ZodOptional<z.ZodString>;
|
|
9
|
-
description: z.ZodOptional<z.ZodString>;
|
|
10
|
-
sourceId: z.ZodOptional<z.ZodString>;
|
|
11
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
-
query: z.ZodOptional<z.ZodString>;
|
|
13
|
-
scheduleStrategy: z.ZodOptional<z.ZodString>;
|
|
14
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
15
|
-
declare const reverseEtlRunSchema: z.ZodObject<{
|
|
16
|
-
id: z.ZodString;
|
|
17
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
18
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
19
|
-
IN_PROGRESS: "IN_PROGRESS";
|
|
20
|
-
SUCCEEDED: "SUCCEEDED";
|
|
21
|
-
FAILED: "FAILED";
|
|
22
|
-
PENDING: "PENDING";
|
|
23
|
-
CANCELED: "CANCELED";
|
|
24
|
-
}>>;
|
|
25
|
-
startedAt: z.ZodOptional<z.ZodString>;
|
|
26
|
-
finishedAt: z.ZodOptional<z.ZodString>;
|
|
27
|
-
error: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
29
|
-
declare const reverseEtlSubscriptionSchema: z.ZodObject<{
|
|
30
|
-
id: z.ZodString;
|
|
31
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
32
|
-
destinationId: z.ZodOptional<z.ZodString>;
|
|
33
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
-
mappings: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
35
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
36
|
-
declare const listReverseEtlModels: _keystrokehq_core0.Operation<z.ZodIntersection<z.ZodObject<{
|
|
37
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
38
|
-
pageToken: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
|
|
40
|
-
items: z.ZodArray<z.ZodObject<{
|
|
41
|
-
id: z.ZodString;
|
|
42
|
-
name: z.ZodOptional<z.ZodString>;
|
|
43
|
-
description: z.ZodOptional<z.ZodString>;
|
|
44
|
-
sourceId: z.ZodOptional<z.ZodString>;
|
|
45
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
-
query: z.ZodOptional<z.ZodString>;
|
|
47
|
-
scheduleStrategy: z.ZodOptional<z.ZodString>;
|
|
48
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
49
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
50
|
-
totalEntries: z.ZodOptional<z.ZodNumber>;
|
|
51
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
52
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
53
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
54
|
-
us: "us";
|
|
55
|
-
eu: "eu";
|
|
56
|
-
}>>;
|
|
57
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
58
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
59
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
60
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
61
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
62
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
63
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
64
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
65
|
-
us: "us";
|
|
66
|
-
eu: "eu";
|
|
67
|
-
}>>;
|
|
68
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
69
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
70
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
71
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
72
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
73
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
74
|
-
declare const getReverseEtlModel: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
75
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
76
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
77
|
-
id: z.ZodString;
|
|
78
|
-
name: z.ZodOptional<z.ZodString>;
|
|
79
|
-
description: z.ZodOptional<z.ZodString>;
|
|
80
|
-
sourceId: z.ZodOptional<z.ZodString>;
|
|
81
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
-
query: z.ZodOptional<z.ZodString>;
|
|
83
|
-
scheduleStrategy: z.ZodOptional<z.ZodString>;
|
|
84
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
85
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
86
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
87
|
-
us: "us";
|
|
88
|
-
eu: "eu";
|
|
89
|
-
}>>;
|
|
90
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
91
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
92
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
93
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
94
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
95
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
96
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
97
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
98
|
-
us: "us";
|
|
99
|
-
eu: "eu";
|
|
100
|
-
}>>;
|
|
101
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
102
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
103
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
104
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
105
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
106
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
107
|
-
declare const createReverseEtlModel: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
108
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
109
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
110
|
-
id: z.ZodString;
|
|
111
|
-
name: z.ZodOptional<z.ZodString>;
|
|
112
|
-
description: z.ZodOptional<z.ZodString>;
|
|
113
|
-
sourceId: z.ZodOptional<z.ZodString>;
|
|
114
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
-
query: z.ZodOptional<z.ZodString>;
|
|
116
|
-
scheduleStrategy: z.ZodOptional<z.ZodString>;
|
|
117
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"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>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
129
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
130
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
131
|
-
us: "us";
|
|
132
|
-
eu: "eu";
|
|
133
|
-
}>>;
|
|
134
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
135
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
136
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
137
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
138
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
139
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
140
|
-
declare const updateReverseEtlModel: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
141
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
142
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
143
|
-
id: z.ZodString;
|
|
144
|
-
name: z.ZodOptional<z.ZodString>;
|
|
145
|
-
description: z.ZodOptional<z.ZodString>;
|
|
146
|
-
sourceId: z.ZodOptional<z.ZodString>;
|
|
147
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
-
query: z.ZodOptional<z.ZodString>;
|
|
149
|
-
scheduleStrategy: z.ZodOptional<z.ZodString>;
|
|
150
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
151
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
152
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
153
|
-
us: "us";
|
|
154
|
-
eu: "eu";
|
|
155
|
-
}>>;
|
|
156
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
157
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
158
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
159
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
160
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
161
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
162
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
163
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
164
|
-
us: "us";
|
|
165
|
-
eu: "eu";
|
|
166
|
-
}>>;
|
|
167
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
168
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
169
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
170
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
171
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
172
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
173
|
-
declare const deleteReverseEtlModel: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
174
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
175
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
176
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
177
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
178
|
-
us: "us";
|
|
179
|
-
eu: "eu";
|
|
180
|
-
}>>;
|
|
181
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
182
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
183
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
184
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
185
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
186
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
187
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
188
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
189
|
-
us: "us";
|
|
190
|
-
eu: "eu";
|
|
191
|
-
}>>;
|
|
192
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
193
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
194
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
195
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
196
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
197
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
198
|
-
declare const runReverseEtlModel: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
199
|
-
id: z.ZodString;
|
|
200
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
-
id: z.ZodString;
|
|
202
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
203
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
204
|
-
IN_PROGRESS: "IN_PROGRESS";
|
|
205
|
-
SUCCEEDED: "SUCCEEDED";
|
|
206
|
-
FAILED: "FAILED";
|
|
207
|
-
PENDING: "PENDING";
|
|
208
|
-
CANCELED: "CANCELED";
|
|
209
|
-
}>>;
|
|
210
|
-
startedAt: z.ZodOptional<z.ZodString>;
|
|
211
|
-
finishedAt: z.ZodOptional<z.ZodString>;
|
|
212
|
-
error: z.ZodOptional<z.ZodString>;
|
|
213
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
214
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
215
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
216
|
-
us: "us";
|
|
217
|
-
eu: "eu";
|
|
218
|
-
}>>;
|
|
219
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
220
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
221
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
222
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
223
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
224
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
225
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
226
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
227
|
-
us: "us";
|
|
228
|
-
eu: "eu";
|
|
229
|
-
}>>;
|
|
230
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
231
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
232
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
233
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
234
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
235
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
236
|
-
declare const listReverseEtlRuns: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
237
|
-
id: z.ZodString;
|
|
238
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
239
|
-
pageToken: z.ZodOptional<z.ZodString>;
|
|
240
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
241
|
-
items: z.ZodArray<z.ZodObject<{
|
|
242
|
-
id: z.ZodString;
|
|
243
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
244
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
245
|
-
IN_PROGRESS: "IN_PROGRESS";
|
|
246
|
-
SUCCEEDED: "SUCCEEDED";
|
|
247
|
-
FAILED: "FAILED";
|
|
248
|
-
PENDING: "PENDING";
|
|
249
|
-
CANCELED: "CANCELED";
|
|
250
|
-
}>>;
|
|
251
|
-
startedAt: z.ZodOptional<z.ZodString>;
|
|
252
|
-
finishedAt: z.ZodOptional<z.ZodString>;
|
|
253
|
-
error: z.ZodOptional<z.ZodString>;
|
|
254
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
255
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
256
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
257
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
258
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
259
|
-
us: "us";
|
|
260
|
-
eu: "eu";
|
|
261
|
-
}>>;
|
|
262
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
263
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
264
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
265
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
266
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
267
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
268
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
269
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
270
|
-
us: "us";
|
|
271
|
-
eu: "eu";
|
|
272
|
-
}>>;
|
|
273
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
274
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
275
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
276
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
277
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
278
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
279
|
-
declare const getReverseEtlRun: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
280
|
-
id: z.ZodString;
|
|
281
|
-
runId: z.ZodString;
|
|
282
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
283
|
-
id: z.ZodString;
|
|
284
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
285
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
286
|
-
IN_PROGRESS: "IN_PROGRESS";
|
|
287
|
-
SUCCEEDED: "SUCCEEDED";
|
|
288
|
-
FAILED: "FAILED";
|
|
289
|
-
PENDING: "PENDING";
|
|
290
|
-
CANCELED: "CANCELED";
|
|
291
|
-
}>>;
|
|
292
|
-
startedAt: z.ZodOptional<z.ZodString>;
|
|
293
|
-
finishedAt: z.ZodOptional<z.ZodString>;
|
|
294
|
-
error: z.ZodOptional<z.ZodString>;
|
|
295
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
296
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
297
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
298
|
-
us: "us";
|
|
299
|
-
eu: "eu";
|
|
300
|
-
}>>;
|
|
301
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
302
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
303
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
304
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
305
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
306
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
307
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
308
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
309
|
-
us: "us";
|
|
310
|
-
eu: "eu";
|
|
311
|
-
}>>;
|
|
312
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
313
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
314
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
315
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
316
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
317
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
318
|
-
declare const listReverseEtlSubscriptions: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
319
|
-
id: z.ZodString;
|
|
320
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
321
|
-
items: z.ZodArray<z.ZodObject<{
|
|
322
|
-
id: z.ZodString;
|
|
323
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
324
|
-
destinationId: z.ZodOptional<z.ZodString>;
|
|
325
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
-
mappings: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
327
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
328
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
329
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
330
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
331
|
-
us: "us";
|
|
332
|
-
eu: "eu";
|
|
333
|
-
}>>;
|
|
334
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
335
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
336
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
337
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
338
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
339
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
340
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
341
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
342
|
-
us: "us";
|
|
343
|
-
eu: "eu";
|
|
344
|
-
}>>;
|
|
345
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
346
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
347
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
348
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
349
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
350
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
351
|
-
declare const createReverseEtlSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
352
|
-
id: z.ZodString;
|
|
353
|
-
destinationId: z.ZodString;
|
|
354
|
-
mappings: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
355
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
356
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
357
|
-
id: z.ZodString;
|
|
358
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
359
|
-
destinationId: z.ZodOptional<z.ZodString>;
|
|
360
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
361
|
-
mappings: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
362
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
363
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
364
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
365
|
-
us: "us";
|
|
366
|
-
eu: "eu";
|
|
367
|
-
}>>;
|
|
368
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
369
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
370
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
371
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
372
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
373
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
374
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
375
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
376
|
-
us: "us";
|
|
377
|
-
eu: "eu";
|
|
378
|
-
}>>;
|
|
379
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
380
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
381
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
382
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
383
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
384
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
385
|
-
declare const updateReverseEtlSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
386
|
-
id: z.ZodString;
|
|
387
|
-
subscriptionId: z.ZodString;
|
|
388
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
389
|
-
mappings: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
390
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
391
|
-
id: z.ZodString;
|
|
392
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
393
|
-
destinationId: z.ZodOptional<z.ZodString>;
|
|
394
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
395
|
-
mappings: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
396
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
397
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
398
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
399
|
-
us: "us";
|
|
400
|
-
eu: "eu";
|
|
401
|
-
}>>;
|
|
402
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
403
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
404
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
405
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
406
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
407
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
408
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
409
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
410
|
-
us: "us";
|
|
411
|
-
eu: "eu";
|
|
412
|
-
}>>;
|
|
413
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
414
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
415
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
416
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
417
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
418
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
419
|
-
declare const deleteReverseEtlSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
420
|
-
id: z.ZodString;
|
|
421
|
-
subscriptionId: z.ZodString;
|
|
422
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
423
|
-
deleted: z.ZodLiteral<true>;
|
|
424
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
425
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
426
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
427
|
-
us: "us";
|
|
428
|
-
eu: "eu";
|
|
429
|
-
}>>;
|
|
430
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
431
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
432
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
433
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
434
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
435
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
436
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
437
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
438
|
-
us: "us";
|
|
439
|
-
eu: "eu";
|
|
440
|
-
}>>;
|
|
441
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
442
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
443
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
444
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
445
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
446
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
447
|
-
//#endregion
|
|
448
|
-
export { createReverseEtlModel, createReverseEtlSubscription, deleteReverseEtlModel, deleteReverseEtlSubscription, getReverseEtlModel, getReverseEtlRun, listReverseEtlModels, listReverseEtlRuns, listReverseEtlSubscriptions, reverseEtlModelSchema, reverseEtlRunSchema, reverseEtlSubscriptionSchema, runReverseEtlModel, updateReverseEtlModel, updateReverseEtlSubscription };
|
package/dist/reverse-etl.mjs
DELETED
|
@@ -1,228 +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 { n as crudList, r as crudMutate, t as crudGet } from "./crud-DV9e4Spi.mjs";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
|
|
7
|
-
//#region src/reverse-etl.ts
|
|
8
|
-
/**
|
|
9
|
-
* segment/reverse-etl.ts — Reverse ETL models + runs + subscriptions. 12
|
|
10
|
-
* actions total (PLAN § 6.18).
|
|
11
|
-
*/
|
|
12
|
-
const reverseEtlModelSchema = segmentLooseObjectSchema({
|
|
13
|
-
id: segmentIdSchema,
|
|
14
|
-
name: z.string().optional(),
|
|
15
|
-
description: z.string().optional(),
|
|
16
|
-
sourceId: z.string().optional(),
|
|
17
|
-
enabled: z.boolean().optional(),
|
|
18
|
-
query: z.string().optional(),
|
|
19
|
-
scheduleStrategy: z.string().optional()
|
|
20
|
-
});
|
|
21
|
-
const reverseEtlRunSchema = segmentLooseObjectSchema({
|
|
22
|
-
id: segmentIdSchema,
|
|
23
|
-
modelId: z.string().optional(),
|
|
24
|
-
status: z.enum([
|
|
25
|
-
"PENDING",
|
|
26
|
-
"IN_PROGRESS",
|
|
27
|
-
"SUCCEEDED",
|
|
28
|
-
"FAILED",
|
|
29
|
-
"CANCELED"
|
|
30
|
-
]).optional(),
|
|
31
|
-
startedAt: z.string().optional(),
|
|
32
|
-
finishedAt: z.string().optional(),
|
|
33
|
-
error: z.string().optional()
|
|
34
|
-
});
|
|
35
|
-
const reverseEtlSubscriptionSchema = segmentLooseObjectSchema({
|
|
36
|
-
id: segmentIdSchema,
|
|
37
|
-
modelId: z.string().optional(),
|
|
38
|
-
destinationId: z.string().optional(),
|
|
39
|
-
enabled: z.boolean().optional(),
|
|
40
|
-
mappings: z.array(z.record(z.string(), z.unknown())).optional()
|
|
41
|
-
});
|
|
42
|
-
const listReverseEtlModels = crudList({
|
|
43
|
-
id: "segment.reverseEtl.listModels",
|
|
44
|
-
name: "List reverse-ETL models",
|
|
45
|
-
description: "List reverse-ETL models.",
|
|
46
|
-
path: "/reverse-etl-models",
|
|
47
|
-
itemsKey: "reverseEtlModels",
|
|
48
|
-
item: reverseEtlModelSchema
|
|
49
|
-
});
|
|
50
|
-
const getReverseEtlModel = crudGet({
|
|
51
|
-
id: "segment.reverseEtl.getModel",
|
|
52
|
-
name: "Get reverse-ETL model",
|
|
53
|
-
description: "Fetch a reverse-ETL model.",
|
|
54
|
-
path: "/reverse-etl-models/{id}",
|
|
55
|
-
output: reverseEtlModelSchema,
|
|
56
|
-
unwrapKey: "reverseEtlModel"
|
|
57
|
-
});
|
|
58
|
-
const createReverseEtlModel = crudMutate({
|
|
59
|
-
id: "segment.reverseEtl.createModel",
|
|
60
|
-
name: "Create reverse-ETL model",
|
|
61
|
-
description: "Create a new reverse-ETL model.",
|
|
62
|
-
method: "POST",
|
|
63
|
-
path: "/reverse-etl-models",
|
|
64
|
-
bodyShape: {
|
|
65
|
-
name: z.string().min(1),
|
|
66
|
-
sourceId: z.string().min(1),
|
|
67
|
-
query: z.string().min(1),
|
|
68
|
-
description: z.string().optional(),
|
|
69
|
-
enabled: z.boolean().optional(),
|
|
70
|
-
scheduleStrategy: z.string().optional()
|
|
71
|
-
},
|
|
72
|
-
output: reverseEtlModelSchema,
|
|
73
|
-
unwrapKey: "reverseEtlModel"
|
|
74
|
-
});
|
|
75
|
-
const updateReverseEtlModel = crudMutate({
|
|
76
|
-
id: "segment.reverseEtl.updateModel",
|
|
77
|
-
name: "Update reverse-ETL model",
|
|
78
|
-
description: "Patch a reverse-ETL model.",
|
|
79
|
-
method: "PATCH",
|
|
80
|
-
path: "/reverse-etl-models/{id}",
|
|
81
|
-
bodyShape: {
|
|
82
|
-
name: z.string().optional(),
|
|
83
|
-
description: z.string().optional(),
|
|
84
|
-
enabled: z.boolean().optional(),
|
|
85
|
-
query: z.string().optional(),
|
|
86
|
-
scheduleStrategy: z.string().optional()
|
|
87
|
-
},
|
|
88
|
-
output: reverseEtlModelSchema,
|
|
89
|
-
unwrapKey: "reverseEtlModel"
|
|
90
|
-
});
|
|
91
|
-
const deleteReverseEtlModel = crudMutate({
|
|
92
|
-
id: "segment.reverseEtl.deleteModel",
|
|
93
|
-
name: "Delete reverse-ETL model",
|
|
94
|
-
description: "Delete a reverse-ETL model.",
|
|
95
|
-
method: "DELETE",
|
|
96
|
-
path: "/reverse-etl-models/{id}",
|
|
97
|
-
output: z.object({}).catchall(z.unknown())
|
|
98
|
-
});
|
|
99
|
-
const runReverseEtlModel = segmentOperation({
|
|
100
|
-
id: "segment.reverseEtl.runModel",
|
|
101
|
-
name: "Trigger a reverse-ETL run",
|
|
102
|
-
description: "Start an ad-hoc reverse-ETL run for a model.",
|
|
103
|
-
input: z.object({ id: segmentIdSchema }),
|
|
104
|
-
output: reverseEtlRunSchema,
|
|
105
|
-
needsApproval: true,
|
|
106
|
-
run: async (input, credentials) => {
|
|
107
|
-
const body = await createSegmentClient(credentials).publicApi.request(`/reverse-etl-models/${encodeURIComponent(input.id)}/runs`, { method: "POST" });
|
|
108
|
-
const rec = body;
|
|
109
|
-
return reverseEtlRunSchema.parse(rec.data?.run ?? body);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
const listReverseEtlRuns = segmentOperation({
|
|
113
|
-
id: "segment.reverseEtl.listRuns",
|
|
114
|
-
name: "List reverse-ETL runs",
|
|
115
|
-
description: "List runs of a reverse-ETL model.",
|
|
116
|
-
input: z.object({
|
|
117
|
-
id: segmentIdSchema,
|
|
118
|
-
pageSize: z.number().int().positive().max(200).optional(),
|
|
119
|
-
pageToken: z.string().optional()
|
|
120
|
-
}),
|
|
121
|
-
output: z.object({
|
|
122
|
-
items: z.array(reverseEtlRunSchema),
|
|
123
|
-
nextPageToken: z.string().optional()
|
|
124
|
-
}),
|
|
125
|
-
run: async (input, credentials) => {
|
|
126
|
-
const result = await createSegmentClient(credentials).publicApi.list(`/reverse-etl-models/${encodeURIComponent(input.id)}/runs`, {
|
|
127
|
-
itemsKey: "runs",
|
|
128
|
-
items: reverseEtlRunSchema
|
|
129
|
-
}, { query: {
|
|
130
|
-
count: input.pageSize,
|
|
131
|
-
cursor: input.pageToken
|
|
132
|
-
} });
|
|
133
|
-
return {
|
|
134
|
-
items: [...result.items],
|
|
135
|
-
...result.nextPageToken !== void 0 ? { nextPageToken: result.nextPageToken } : {}
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
const getReverseEtlRun = segmentOperation({
|
|
140
|
-
id: "segment.reverseEtl.getRun",
|
|
141
|
-
name: "Get reverse-ETL run",
|
|
142
|
-
description: "Fetch a specific reverse-ETL run.",
|
|
143
|
-
input: z.object({
|
|
144
|
-
id: segmentIdSchema,
|
|
145
|
-
runId: segmentIdSchema
|
|
146
|
-
}),
|
|
147
|
-
output: reverseEtlRunSchema,
|
|
148
|
-
run: async (input, credentials) => {
|
|
149
|
-
const body = await createSegmentClient(credentials).publicApi.request(`/reverse-etl-models/${encodeURIComponent(input.id)}/runs/${encodeURIComponent(input.runId)}`);
|
|
150
|
-
const rec = body;
|
|
151
|
-
return reverseEtlRunSchema.parse(rec.data?.run ?? body);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
const listReverseEtlSubscriptions = segmentOperation({
|
|
155
|
-
id: "segment.reverseEtl.listSubscriptions",
|
|
156
|
-
name: "List reverse-ETL subscriptions",
|
|
157
|
-
description: "List destination subscriptions for a reverse-ETL model.",
|
|
158
|
-
input: z.object({ id: segmentIdSchema }),
|
|
159
|
-
output: z.object({ items: z.array(reverseEtlSubscriptionSchema) }),
|
|
160
|
-
run: async (input, credentials) => {
|
|
161
|
-
const rec = await createSegmentClient(credentials).publicApi.request(`/reverse-etl-models/${encodeURIComponent(input.id)}/subscriptions`);
|
|
162
|
-
return { items: (rec.data?.subscriptions ?? rec.subscriptions ?? []).map((entry) => reverseEtlSubscriptionSchema.parse(entry)) };
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
const createReverseEtlSubscription = segmentOperation({
|
|
166
|
-
id: "segment.reverseEtl.createSubscription",
|
|
167
|
-
name: "Create reverse-ETL subscription",
|
|
168
|
-
description: "Subscribe a destination to a reverse-ETL model.",
|
|
169
|
-
input: z.object({
|
|
170
|
-
id: segmentIdSchema,
|
|
171
|
-
destinationId: z.string().min(1),
|
|
172
|
-
mappings: z.array(z.record(z.string(), z.unknown())),
|
|
173
|
-
enabled: z.boolean().optional()
|
|
174
|
-
}),
|
|
175
|
-
output: reverseEtlSubscriptionSchema,
|
|
176
|
-
needsApproval: true,
|
|
177
|
-
run: async (input, credentials) => {
|
|
178
|
-
const client = createSegmentClient(credentials);
|
|
179
|
-
const { id, ...body } = input;
|
|
180
|
-
const response = await client.publicApi.request(`/reverse-etl-models/${encodeURIComponent(id)}/subscriptions`, {
|
|
181
|
-
method: "POST",
|
|
182
|
-
body
|
|
183
|
-
});
|
|
184
|
-
const rec = response;
|
|
185
|
-
return reverseEtlSubscriptionSchema.parse(rec.data?.subscription ?? response);
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
const updateReverseEtlSubscription = segmentOperation({
|
|
189
|
-
id: "segment.reverseEtl.updateSubscription",
|
|
190
|
-
name: "Update reverse-ETL subscription",
|
|
191
|
-
description: "Patch a reverse-ETL subscription.",
|
|
192
|
-
input: z.object({
|
|
193
|
-
id: segmentIdSchema,
|
|
194
|
-
subscriptionId: segmentIdSchema,
|
|
195
|
-
enabled: z.boolean().optional(),
|
|
196
|
-
mappings: z.array(z.record(z.string(), z.unknown())).optional()
|
|
197
|
-
}),
|
|
198
|
-
output: reverseEtlSubscriptionSchema,
|
|
199
|
-
needsApproval: true,
|
|
200
|
-
run: async (input, credentials) => {
|
|
201
|
-
const client = createSegmentClient(credentials);
|
|
202
|
-
const { id, subscriptionId, ...body } = input;
|
|
203
|
-
const response = await client.publicApi.request(`/reverse-etl-models/${encodeURIComponent(id)}/subscriptions/${encodeURIComponent(subscriptionId)}`, {
|
|
204
|
-
method: "PATCH",
|
|
205
|
-
body
|
|
206
|
-
});
|
|
207
|
-
const rec = response;
|
|
208
|
-
return reverseEtlSubscriptionSchema.parse(rec.data?.subscription ?? response);
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
const deleteReverseEtlSubscription = segmentOperation({
|
|
212
|
-
id: "segment.reverseEtl.deleteSubscription",
|
|
213
|
-
name: "Delete reverse-ETL subscription",
|
|
214
|
-
description: "Delete a reverse-ETL subscription.",
|
|
215
|
-
input: z.object({
|
|
216
|
-
id: segmentIdSchema,
|
|
217
|
-
subscriptionId: segmentIdSchema
|
|
218
|
-
}),
|
|
219
|
-
output: z.object({ deleted: z.literal(true) }),
|
|
220
|
-
needsApproval: true,
|
|
221
|
-
run: async (input, credentials) => {
|
|
222
|
-
await createSegmentClient(credentials).publicApi.request(`/reverse-etl-models/${encodeURIComponent(input.id)}/subscriptions/${encodeURIComponent(input.subscriptionId)}`, { method: "DELETE" });
|
|
223
|
-
return { deleted: true };
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
//#endregion
|
|
228
|
-
export { createReverseEtlModel, createReverseEtlSubscription, deleteReverseEtlModel, deleteReverseEtlSubscription, getReverseEtlModel, getReverseEtlRun, listReverseEtlModels, listReverseEtlRuns, listReverseEtlSubscriptions, reverseEtlModelSchema, reverseEtlRunSchema, reverseEtlSubscriptionSchema, runReverseEtlModel, updateReverseEtlModel, updateReverseEtlSubscription };
|