svix 2.3.0 → 2.5.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/dist/index.d.mts +1248 -798
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4500 -3712
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/autoconfigSubscription.ts +53 -0
- package/src/api/destination.ts +133 -0
- package/src/api/destinationTransformation.ts +55 -0
- package/src/api_internal/autoconfigSubscription.ts +40 -0
- package/src/api_internal/autoconfigSubscriptionDestination.ts +27 -0
- package/src/api_internal/autoconfigSubscriptionEndpoint.ts +27 -0
- package/src/api_internal/endpoint.ts +3 -3
- package/src/api_internal/{endpointAutoConfig.ts → endpointAutoConfigDeprecated.ts} +1 -1
- package/src/autoconfig.test.ts +162 -3
- package/src/autoconfig.ts +88 -26
- package/src/autoconfigConsumer.ts +90 -16
- package/src/index.ts +10 -0
- package/src/models/autoConfigOut.ts +26 -0
- package/src/models/autoConfigSubscriptionOut.ts +38 -0
- package/src/models/destinationIn.ts +303 -0
- package/src/models/destinationOut.ts +295 -0
- package/src/models/destinationPatch.ts +302 -0
- package/src/models/destinationStatus.ts +18 -0
- package/src/models/destinationStatusIn.ts +16 -0
- package/src/models/destinationTransformIn.ts +19 -0
- package/src/models/destinationTransformationOut.ts +22 -0
- package/src/models/eventBridgeConfigIn.ts +14 -2
- package/src/models/eventBridgeConfigOut.ts +7 -1
- package/src/models/eventBridgeConfigPatch.ts +6 -0
- package/src/models/fifoEndpointConfigIn.ts +25 -0
- package/src/models/index.ts +13 -0
- package/src/models/ingestSourceIn.ts +12 -0
- package/src/models/ingestSourceOut.ts +12 -0
- package/src/models/listResponseDestinationOut.ts +31 -0
- package/src/models/mergeConfig.ts +19 -0
- package/src/models/mergeConfigOut.ts +15 -0
- package/src/models/redshiftConfigIn.ts +14 -2
- package/src/models/redshiftConfigOut.ts +7 -1
- package/src/models/redshiftConfigPatch.ts +6 -0
- package/src/models/rotateSubscriptionIn2.ts +29 -0
- package/src/models/s3ConfigIn.ts +1 -1
- package/src/models/snsConfigIn.ts +14 -2
- package/src/models/snsConfigOut.ts +7 -1
- package/src/models/snsConfigPatch.ts +6 -0
- package/src/models/sqsConfigIn.ts +14 -2
- package/src/models/sqsConfigOut.ts +7 -1
- package/src/models/sqsConfigPatch.ts +6 -0
- package/src/models/status.ts +16 -0
- package/src/models/streamSinkOut.ts +15 -0
- package/src/request.ts +1 -1
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// this file is @generated
|
|
2
|
+
import {
|
|
3
|
+
type AzureBlobStorageConfigIn,
|
|
4
|
+
AzureBlobStorageConfigInSerializer,
|
|
5
|
+
} from "./azureBlobStorageConfigIn";
|
|
6
|
+
import { type BigQueryConfigIn, BigQueryConfigInSerializer } from "./bigQueryConfigIn";
|
|
7
|
+
import {
|
|
8
|
+
type ClickhouseConfigIn,
|
|
9
|
+
ClickhouseConfigInSerializer,
|
|
10
|
+
} from "./clickhouseConfigIn";
|
|
11
|
+
import {
|
|
12
|
+
type DestinationStatusIn,
|
|
13
|
+
DestinationStatusInSerializer,
|
|
14
|
+
} from "./destinationStatusIn";
|
|
15
|
+
import {
|
|
16
|
+
type EventBridgeConfigIn,
|
|
17
|
+
EventBridgeConfigInSerializer,
|
|
18
|
+
} from "./eventBridgeConfigIn";
|
|
19
|
+
import {
|
|
20
|
+
type FifoEndpointConfigIn,
|
|
21
|
+
FifoEndpointConfigInSerializer,
|
|
22
|
+
} from "./fifoEndpointConfigIn";
|
|
23
|
+
import {
|
|
24
|
+
type GoogleCloudPubSubConfigIn,
|
|
25
|
+
GoogleCloudPubSubConfigInSerializer,
|
|
26
|
+
} from "./googleCloudPubSubConfigIn";
|
|
27
|
+
import {
|
|
28
|
+
type GoogleCloudStorageConfigIn,
|
|
29
|
+
GoogleCloudStorageConfigInSerializer,
|
|
30
|
+
} from "./googleCloudStorageConfigIn";
|
|
31
|
+
import {
|
|
32
|
+
type OtelTracingConfigIn,
|
|
33
|
+
OtelTracingConfigInSerializer,
|
|
34
|
+
} from "./otelTracingConfigIn";
|
|
35
|
+
import { type PostgresConfigIn, PostgresConfigInSerializer } from "./postgresConfigIn";
|
|
36
|
+
import { type RabbitMqConfigIn, RabbitMqConfigInSerializer } from "./rabbitMqConfigIn";
|
|
37
|
+
import { type RedshiftConfigIn, RedshiftConfigInSerializer } from "./redshiftConfigIn";
|
|
38
|
+
import { type S3ConfigIn, S3ConfigInSerializer } from "./s3ConfigIn";
|
|
39
|
+
import { type SnowflakeConfigIn, SnowflakeConfigInSerializer } from "./snowflakeConfigIn";
|
|
40
|
+
import { type SnsConfigIn, SnsConfigInSerializer } from "./snsConfigIn";
|
|
41
|
+
import { type SqsConfigIn, SqsConfigInSerializer } from "./sqsConfigIn";
|
|
42
|
+
|
|
43
|
+
interface _DestinationInFields {
|
|
44
|
+
/** An optional unique identifier for the destination. */
|
|
45
|
+
uid?: string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the destination will receive events.
|
|
48
|
+
*
|
|
49
|
+
* If the destination is `enabled`, events sent to the application will be dispatched to the destination in order.
|
|
50
|
+
*
|
|
51
|
+
* If the destination is `disabled`, events will not be dispatched until the destination is reenabled.
|
|
52
|
+
*/
|
|
53
|
+
status?: DestinationStatusIn;
|
|
54
|
+
/** How many events will be batched in a request to the destination. */
|
|
55
|
+
batchSize?: number;
|
|
56
|
+
/**
|
|
57
|
+
* How long to wait before a batch of events is sent, if the `batchSize` is not reached.
|
|
58
|
+
*
|
|
59
|
+
* For example, with a `batchSize` of 100 and `maxWaitSecs` of 10, a request is sent after 10 seconds or 100 events, whichever comes first.
|
|
60
|
+
*
|
|
61
|
+
* Note that an empty batch is never sent to the destination.
|
|
62
|
+
*/
|
|
63
|
+
maxWaitSecs?: number;
|
|
64
|
+
/** A list of event types that filter which events are dispatched to the destination. An empty list (or null) will not filter out any events. */
|
|
65
|
+
eventTypes?: string[];
|
|
66
|
+
/** A list of channels that filter which events are dispatched to the destination. An empty list (or null) will not filter out any events. */
|
|
67
|
+
channels?: string[];
|
|
68
|
+
metadata?: { [key: string]: string };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// biome-ignore lint/suspicious/noEmptyInterface: backwards compat
|
|
72
|
+
interface DestinationInPollingEndpointConfig {}
|
|
73
|
+
|
|
74
|
+
interface DestinationInPollingEndpoint {
|
|
75
|
+
type: "pollingEndpoint";
|
|
76
|
+
config?: DestinationInPollingEndpointConfig;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface DestinationInAzureBlobStorage {
|
|
80
|
+
type: "azureBlobStorage";
|
|
81
|
+
config: AzureBlobStorageConfigIn;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface DestinationInOtelTracing {
|
|
85
|
+
type: "otelTracing";
|
|
86
|
+
config: OtelTracingConfigIn;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface DestinationInFifoEndpoint {
|
|
90
|
+
type: "fifoEndpoint";
|
|
91
|
+
config: FifoEndpointConfigIn;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface DestinationInAmazonS3 {
|
|
95
|
+
type: "amazonS3";
|
|
96
|
+
config: S3ConfigIn;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface DestinationInGoogleCloudStorage {
|
|
100
|
+
type: "googleCloudStorage";
|
|
101
|
+
config: GoogleCloudStorageConfigIn;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface DestinationInGoogleCloudPubSub {
|
|
105
|
+
type: "googleCloudPubSub";
|
|
106
|
+
config: GoogleCloudPubSubConfigIn;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface DestinationInSqs {
|
|
110
|
+
type: "sqs";
|
|
111
|
+
config: SqsConfigIn;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface DestinationInSns {
|
|
115
|
+
type: "sns";
|
|
116
|
+
config: SnsConfigIn;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface DestinationInBigQuery {
|
|
120
|
+
type: "bigQuery";
|
|
121
|
+
config: BigQueryConfigIn;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
interface DestinationInClickhouse {
|
|
125
|
+
type: "clickhouse";
|
|
126
|
+
config: ClickhouseConfigIn;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
interface DestinationInEventBridge {
|
|
130
|
+
type: "eventBridge";
|
|
131
|
+
config: EventBridgeConfigIn;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface DestinationInSnowflake {
|
|
135
|
+
type: "snowflake";
|
|
136
|
+
config: SnowflakeConfigIn;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface DestinationInRabbitMq {
|
|
140
|
+
type: "rabbitMq";
|
|
141
|
+
config: RabbitMqConfigIn;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
interface DestinationInRedshift {
|
|
145
|
+
type: "redshift";
|
|
146
|
+
config: RedshiftConfigIn;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
interface DestinationInPostgres {
|
|
150
|
+
type: "postgres";
|
|
151
|
+
config: PostgresConfigIn;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** The destination's type and type-specific configuration. */
|
|
155
|
+
export type DestinationIn = _DestinationInFields &
|
|
156
|
+
(
|
|
157
|
+
| DestinationInPollingEndpoint
|
|
158
|
+
| DestinationInAzureBlobStorage
|
|
159
|
+
| DestinationInOtelTracing
|
|
160
|
+
| DestinationInFifoEndpoint
|
|
161
|
+
| DestinationInAmazonS3
|
|
162
|
+
| DestinationInGoogleCloudStorage
|
|
163
|
+
| DestinationInGoogleCloudPubSub
|
|
164
|
+
| DestinationInSqs
|
|
165
|
+
| DestinationInSns
|
|
166
|
+
| DestinationInBigQuery
|
|
167
|
+
| DestinationInClickhouse
|
|
168
|
+
| DestinationInEventBridge
|
|
169
|
+
| DestinationInSnowflake
|
|
170
|
+
| DestinationInRabbitMq
|
|
171
|
+
| DestinationInRedshift
|
|
172
|
+
| DestinationInPostgres
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
export const DestinationInSerializer = {
|
|
176
|
+
_fromJsonObject(object: any): DestinationIn {
|
|
177
|
+
const type = object["type"];
|
|
178
|
+
|
|
179
|
+
function getConfig(type: string): any {
|
|
180
|
+
switch (type) {
|
|
181
|
+
case "pollingEndpoint":
|
|
182
|
+
return {};
|
|
183
|
+
case "azureBlobStorage":
|
|
184
|
+
return AzureBlobStorageConfigInSerializer._fromJsonObject(object["config"]);
|
|
185
|
+
case "otelTracing":
|
|
186
|
+
return OtelTracingConfigInSerializer._fromJsonObject(object["config"]);
|
|
187
|
+
case "fifoEndpoint":
|
|
188
|
+
return FifoEndpointConfigInSerializer._fromJsonObject(object["config"]);
|
|
189
|
+
case "amazonS3":
|
|
190
|
+
return S3ConfigInSerializer._fromJsonObject(object["config"]);
|
|
191
|
+
case "googleCloudStorage":
|
|
192
|
+
return GoogleCloudStorageConfigInSerializer._fromJsonObject(object["config"]);
|
|
193
|
+
case "googleCloudPubSub":
|
|
194
|
+
return GoogleCloudPubSubConfigInSerializer._fromJsonObject(object["config"]);
|
|
195
|
+
case "sqs":
|
|
196
|
+
return SqsConfigInSerializer._fromJsonObject(object["config"]);
|
|
197
|
+
case "sns":
|
|
198
|
+
return SnsConfigInSerializer._fromJsonObject(object["config"]);
|
|
199
|
+
case "bigQuery":
|
|
200
|
+
return BigQueryConfigInSerializer._fromJsonObject(object["config"]);
|
|
201
|
+
case "clickhouse":
|
|
202
|
+
return ClickhouseConfigInSerializer._fromJsonObject(object["config"]);
|
|
203
|
+
case "eventBridge":
|
|
204
|
+
return EventBridgeConfigInSerializer._fromJsonObject(object["config"]);
|
|
205
|
+
case "snowflake":
|
|
206
|
+
return SnowflakeConfigInSerializer._fromJsonObject(object["config"]);
|
|
207
|
+
case "rabbitMq":
|
|
208
|
+
return RabbitMqConfigInSerializer._fromJsonObject(object["config"]);
|
|
209
|
+
case "redshift":
|
|
210
|
+
return RedshiftConfigInSerializer._fromJsonObject(object["config"]);
|
|
211
|
+
case "postgres":
|
|
212
|
+
return PostgresConfigInSerializer._fromJsonObject(object["config"]);
|
|
213
|
+
default:
|
|
214
|
+
throw new Error(`Unexpected type: ${type}`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return {
|
|
219
|
+
type,
|
|
220
|
+
config: getConfig(type),
|
|
221
|
+
uid: object["uid"],
|
|
222
|
+
status:
|
|
223
|
+
object["status"] != null
|
|
224
|
+
? DestinationStatusInSerializer._fromJsonObject(object["status"])
|
|
225
|
+
: undefined,
|
|
226
|
+
batchSize: object["batchSize"],
|
|
227
|
+
maxWaitSecs: object["maxWaitSecs"],
|
|
228
|
+
eventTypes: object["eventTypes"],
|
|
229
|
+
channels: object["channels"],
|
|
230
|
+
metadata: object["metadata"],
|
|
231
|
+
};
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
_toJsonObject(self: DestinationIn): any {
|
|
235
|
+
// biome-ignore lint/suspicious/noImplicitAnyLet: the return type needs to be any
|
|
236
|
+
let config;
|
|
237
|
+
switch (self.type) {
|
|
238
|
+
case "pollingEndpoint":
|
|
239
|
+
config = {};
|
|
240
|
+
break;
|
|
241
|
+
case "azureBlobStorage":
|
|
242
|
+
config = AzureBlobStorageConfigInSerializer._toJsonObject(self.config);
|
|
243
|
+
break;
|
|
244
|
+
case "otelTracing":
|
|
245
|
+
config = OtelTracingConfigInSerializer._toJsonObject(self.config);
|
|
246
|
+
break;
|
|
247
|
+
case "fifoEndpoint":
|
|
248
|
+
config = FifoEndpointConfigInSerializer._toJsonObject(self.config);
|
|
249
|
+
break;
|
|
250
|
+
case "amazonS3":
|
|
251
|
+
config = S3ConfigInSerializer._toJsonObject(self.config);
|
|
252
|
+
break;
|
|
253
|
+
case "googleCloudStorage":
|
|
254
|
+
config = GoogleCloudStorageConfigInSerializer._toJsonObject(self.config);
|
|
255
|
+
break;
|
|
256
|
+
case "googleCloudPubSub":
|
|
257
|
+
config = GoogleCloudPubSubConfigInSerializer._toJsonObject(self.config);
|
|
258
|
+
break;
|
|
259
|
+
case "sqs":
|
|
260
|
+
config = SqsConfigInSerializer._toJsonObject(self.config);
|
|
261
|
+
break;
|
|
262
|
+
case "sns":
|
|
263
|
+
config = SnsConfigInSerializer._toJsonObject(self.config);
|
|
264
|
+
break;
|
|
265
|
+
case "bigQuery":
|
|
266
|
+
config = BigQueryConfigInSerializer._toJsonObject(self.config);
|
|
267
|
+
break;
|
|
268
|
+
case "clickhouse":
|
|
269
|
+
config = ClickhouseConfigInSerializer._toJsonObject(self.config);
|
|
270
|
+
break;
|
|
271
|
+
case "eventBridge":
|
|
272
|
+
config = EventBridgeConfigInSerializer._toJsonObject(self.config);
|
|
273
|
+
break;
|
|
274
|
+
case "snowflake":
|
|
275
|
+
config = SnowflakeConfigInSerializer._toJsonObject(self.config);
|
|
276
|
+
break;
|
|
277
|
+
case "rabbitMq":
|
|
278
|
+
config = RabbitMqConfigInSerializer._toJsonObject(self.config);
|
|
279
|
+
break;
|
|
280
|
+
case "redshift":
|
|
281
|
+
config = RedshiftConfigInSerializer._toJsonObject(self.config);
|
|
282
|
+
break;
|
|
283
|
+
case "postgres":
|
|
284
|
+
config = PostgresConfigInSerializer._toJsonObject(self.config);
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return {
|
|
289
|
+
type: self.type,
|
|
290
|
+
config: config,
|
|
291
|
+
uid: self.uid,
|
|
292
|
+
status:
|
|
293
|
+
self.status != null
|
|
294
|
+
? DestinationStatusInSerializer._toJsonObject(self.status)
|
|
295
|
+
: undefined,
|
|
296
|
+
batchSize: self.batchSize,
|
|
297
|
+
maxWaitSecs: self.maxWaitSecs,
|
|
298
|
+
eventTypes: self.eventTypes,
|
|
299
|
+
channels: self.channels,
|
|
300
|
+
metadata: self.metadata,
|
|
301
|
+
};
|
|
302
|
+
},
|
|
303
|
+
};
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
// this file is @generated
|
|
2
|
+
import {
|
|
3
|
+
type AzureBlobStorageConfigOut,
|
|
4
|
+
AzureBlobStorageConfigOutSerializer,
|
|
5
|
+
} from "./azureBlobStorageConfigOut";
|
|
6
|
+
import { type BigQueryConfigOut, BigQueryConfigOutSerializer } from "./bigQueryConfigOut";
|
|
7
|
+
import {
|
|
8
|
+
type ClickhouseConfigOut,
|
|
9
|
+
ClickhouseConfigOutSerializer,
|
|
10
|
+
} from "./clickhouseConfigOut";
|
|
11
|
+
import { type DestinationStatus, DestinationStatusSerializer } from "./destinationStatus";
|
|
12
|
+
import {
|
|
13
|
+
type EventBridgeConfigOut,
|
|
14
|
+
EventBridgeConfigOutSerializer,
|
|
15
|
+
} from "./eventBridgeConfigOut";
|
|
16
|
+
import {
|
|
17
|
+
type GoogleCloudPubSubConfigOut,
|
|
18
|
+
GoogleCloudPubSubConfigOutSerializer,
|
|
19
|
+
} from "./googleCloudPubSubConfigOut";
|
|
20
|
+
import {
|
|
21
|
+
type GoogleCloudStorageConfigOut,
|
|
22
|
+
GoogleCloudStorageConfigOutSerializer,
|
|
23
|
+
} from "./googleCloudStorageConfigOut";
|
|
24
|
+
import {
|
|
25
|
+
type OtelTracingConfigOut,
|
|
26
|
+
OtelTracingConfigOutSerializer,
|
|
27
|
+
} from "./otelTracingConfigOut";
|
|
28
|
+
import { type PostgresConfigOut, PostgresConfigOutSerializer } from "./postgresConfigOut";
|
|
29
|
+
import { type RabbitMqConfigOut, RabbitMqConfigOutSerializer } from "./rabbitMqConfigOut";
|
|
30
|
+
import { type RedshiftConfigOut, RedshiftConfigOutSerializer } from "./redshiftConfigOut";
|
|
31
|
+
import { type S3ConfigOut, S3ConfigOutSerializer } from "./s3ConfigOut";
|
|
32
|
+
import { type SinkHttpConfigOut, SinkHttpConfigOutSerializer } from "./sinkHttpConfigOut";
|
|
33
|
+
import {
|
|
34
|
+
type SnowflakeConfigOut,
|
|
35
|
+
SnowflakeConfigOutSerializer,
|
|
36
|
+
} from "./snowflakeConfigOut";
|
|
37
|
+
import { type SnsConfigOut, SnsConfigOutSerializer } from "./snsConfigOut";
|
|
38
|
+
import { type SqsConfigOut, SqsConfigOutSerializer } from "./sqsConfigOut";
|
|
39
|
+
|
|
40
|
+
interface _DestinationOutFields {
|
|
41
|
+
/** The Destination's ID. */
|
|
42
|
+
id: string;
|
|
43
|
+
/** The Destination's UID. */
|
|
44
|
+
uid?: string | null;
|
|
45
|
+
status: DestinationStatus;
|
|
46
|
+
currentIterator: string;
|
|
47
|
+
failureReason?: string | null;
|
|
48
|
+
createdAt: Date;
|
|
49
|
+
updatedAt: Date;
|
|
50
|
+
batchSize: number;
|
|
51
|
+
maxWaitSecs: number;
|
|
52
|
+
eventTypes?: string[];
|
|
53
|
+
channels?: string[];
|
|
54
|
+
nextRetryAt?: Date | null;
|
|
55
|
+
metadata: { [key: string]: string };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// biome-ignore lint/suspicious/noEmptyInterface: backwards compat
|
|
59
|
+
interface DestinationOutPollingEndpointConfig {}
|
|
60
|
+
|
|
61
|
+
interface DestinationOutPollingEndpoint {
|
|
62
|
+
type: "pollingEndpoint";
|
|
63
|
+
config?: DestinationOutPollingEndpointConfig;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface DestinationOutAzureBlobStorage {
|
|
67
|
+
type: "azureBlobStorage";
|
|
68
|
+
config: AzureBlobStorageConfigOut;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface DestinationOutOtelTracing {
|
|
72
|
+
type: "otelTracing";
|
|
73
|
+
config: OtelTracingConfigOut;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface DestinationOutFifoEndpoint {
|
|
77
|
+
type: "fifoEndpoint";
|
|
78
|
+
config: SinkHttpConfigOut;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface DestinationOutAmazonS3 {
|
|
82
|
+
type: "amazonS3";
|
|
83
|
+
config: S3ConfigOut;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface DestinationOutSnowflake {
|
|
87
|
+
type: "snowflake";
|
|
88
|
+
config: SnowflakeConfigOut;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
interface DestinationOutGoogleCloudStorage {
|
|
92
|
+
type: "googleCloudStorage";
|
|
93
|
+
config: GoogleCloudStorageConfigOut;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
interface DestinationOutGoogleCloudPubSub {
|
|
97
|
+
type: "googleCloudPubSub";
|
|
98
|
+
config: GoogleCloudPubSubConfigOut;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface DestinationOutRedshift {
|
|
102
|
+
type: "redshift";
|
|
103
|
+
config: RedshiftConfigOut;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface DestinationOutBigQuery {
|
|
107
|
+
type: "bigQuery";
|
|
108
|
+
config: BigQueryConfigOut;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface DestinationOutClickhouse {
|
|
112
|
+
type: "clickhouse";
|
|
113
|
+
config: ClickhouseConfigOut;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
interface DestinationOutRabbitMq {
|
|
117
|
+
type: "rabbitMq";
|
|
118
|
+
config: RabbitMqConfigOut;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
interface DestinationOutSqs {
|
|
122
|
+
type: "sqs";
|
|
123
|
+
config: SqsConfigOut;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface DestinationOutEventBridge {
|
|
127
|
+
type: "eventBridge";
|
|
128
|
+
config: EventBridgeConfigOut;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface DestinationOutSns {
|
|
132
|
+
type: "sns";
|
|
133
|
+
config: SnsConfigOut;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface DestinationOutPostgres {
|
|
137
|
+
type: "postgres";
|
|
138
|
+
config: PostgresConfigOut;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export type DestinationOut = _DestinationOutFields &
|
|
142
|
+
(
|
|
143
|
+
| DestinationOutPollingEndpoint
|
|
144
|
+
| DestinationOutAzureBlobStorage
|
|
145
|
+
| DestinationOutOtelTracing
|
|
146
|
+
| DestinationOutFifoEndpoint
|
|
147
|
+
| DestinationOutAmazonS3
|
|
148
|
+
| DestinationOutSnowflake
|
|
149
|
+
| DestinationOutGoogleCloudStorage
|
|
150
|
+
| DestinationOutGoogleCloudPubSub
|
|
151
|
+
| DestinationOutRedshift
|
|
152
|
+
| DestinationOutBigQuery
|
|
153
|
+
| DestinationOutClickhouse
|
|
154
|
+
| DestinationOutRabbitMq
|
|
155
|
+
| DestinationOutSqs
|
|
156
|
+
| DestinationOutEventBridge
|
|
157
|
+
| DestinationOutSns
|
|
158
|
+
| DestinationOutPostgres
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
export const DestinationOutSerializer = {
|
|
162
|
+
_fromJsonObject(object: any): DestinationOut {
|
|
163
|
+
const type = object["type"];
|
|
164
|
+
|
|
165
|
+
function getConfig(type: string): any {
|
|
166
|
+
switch (type) {
|
|
167
|
+
case "pollingEndpoint":
|
|
168
|
+
return {};
|
|
169
|
+
case "azureBlobStorage":
|
|
170
|
+
return AzureBlobStorageConfigOutSerializer._fromJsonObject(object["config"]);
|
|
171
|
+
case "otelTracing":
|
|
172
|
+
return OtelTracingConfigOutSerializer._fromJsonObject(object["config"]);
|
|
173
|
+
case "fifoEndpoint":
|
|
174
|
+
return SinkHttpConfigOutSerializer._fromJsonObject(object["config"]);
|
|
175
|
+
case "amazonS3":
|
|
176
|
+
return S3ConfigOutSerializer._fromJsonObject(object["config"]);
|
|
177
|
+
case "snowflake":
|
|
178
|
+
return SnowflakeConfigOutSerializer._fromJsonObject(object["config"]);
|
|
179
|
+
case "googleCloudStorage":
|
|
180
|
+
return GoogleCloudStorageConfigOutSerializer._fromJsonObject(object["config"]);
|
|
181
|
+
case "googleCloudPubSub":
|
|
182
|
+
return GoogleCloudPubSubConfigOutSerializer._fromJsonObject(object["config"]);
|
|
183
|
+
case "redshift":
|
|
184
|
+
return RedshiftConfigOutSerializer._fromJsonObject(object["config"]);
|
|
185
|
+
case "bigQuery":
|
|
186
|
+
return BigQueryConfigOutSerializer._fromJsonObject(object["config"]);
|
|
187
|
+
case "clickhouse":
|
|
188
|
+
return ClickhouseConfigOutSerializer._fromJsonObject(object["config"]);
|
|
189
|
+
case "rabbitMq":
|
|
190
|
+
return RabbitMqConfigOutSerializer._fromJsonObject(object["config"]);
|
|
191
|
+
case "sqs":
|
|
192
|
+
return SqsConfigOutSerializer._fromJsonObject(object["config"]);
|
|
193
|
+
case "eventBridge":
|
|
194
|
+
return EventBridgeConfigOutSerializer._fromJsonObject(object["config"]);
|
|
195
|
+
case "sns":
|
|
196
|
+
return SnsConfigOutSerializer._fromJsonObject(object["config"]);
|
|
197
|
+
case "postgres":
|
|
198
|
+
return PostgresConfigOutSerializer._fromJsonObject(object["config"]);
|
|
199
|
+
default:
|
|
200
|
+
throw new Error(`Unexpected type: ${type}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return {
|
|
205
|
+
type,
|
|
206
|
+
config: getConfig(type),
|
|
207
|
+
id: object["id"],
|
|
208
|
+
uid: object["uid"],
|
|
209
|
+
status: DestinationStatusSerializer._fromJsonObject(object["status"]),
|
|
210
|
+
currentIterator: object["currentIterator"],
|
|
211
|
+
failureReason: object["failureReason"],
|
|
212
|
+
createdAt: new Date(object["createdAt"]),
|
|
213
|
+
updatedAt: new Date(object["updatedAt"]),
|
|
214
|
+
batchSize: object["batchSize"],
|
|
215
|
+
maxWaitSecs: object["maxWaitSecs"],
|
|
216
|
+
eventTypes: object["eventTypes"],
|
|
217
|
+
channels: object["channels"],
|
|
218
|
+
nextRetryAt: object["nextRetryAt"] ? new Date(object["nextRetryAt"]) : null,
|
|
219
|
+
metadata: object["metadata"],
|
|
220
|
+
};
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
_toJsonObject(self: DestinationOut): any {
|
|
224
|
+
// biome-ignore lint/suspicious/noImplicitAnyLet: the return type needs to be any
|
|
225
|
+
let config;
|
|
226
|
+
switch (self.type) {
|
|
227
|
+
case "pollingEndpoint":
|
|
228
|
+
config = {};
|
|
229
|
+
break;
|
|
230
|
+
case "azureBlobStorage":
|
|
231
|
+
config = AzureBlobStorageConfigOutSerializer._toJsonObject(self.config);
|
|
232
|
+
break;
|
|
233
|
+
case "otelTracing":
|
|
234
|
+
config = OtelTracingConfigOutSerializer._toJsonObject(self.config);
|
|
235
|
+
break;
|
|
236
|
+
case "fifoEndpoint":
|
|
237
|
+
config = SinkHttpConfigOutSerializer._toJsonObject(self.config);
|
|
238
|
+
break;
|
|
239
|
+
case "amazonS3":
|
|
240
|
+
config = S3ConfigOutSerializer._toJsonObject(self.config);
|
|
241
|
+
break;
|
|
242
|
+
case "snowflake":
|
|
243
|
+
config = SnowflakeConfigOutSerializer._toJsonObject(self.config);
|
|
244
|
+
break;
|
|
245
|
+
case "googleCloudStorage":
|
|
246
|
+
config = GoogleCloudStorageConfigOutSerializer._toJsonObject(self.config);
|
|
247
|
+
break;
|
|
248
|
+
case "googleCloudPubSub":
|
|
249
|
+
config = GoogleCloudPubSubConfigOutSerializer._toJsonObject(self.config);
|
|
250
|
+
break;
|
|
251
|
+
case "redshift":
|
|
252
|
+
config = RedshiftConfigOutSerializer._toJsonObject(self.config);
|
|
253
|
+
break;
|
|
254
|
+
case "bigQuery":
|
|
255
|
+
config = BigQueryConfigOutSerializer._toJsonObject(self.config);
|
|
256
|
+
break;
|
|
257
|
+
case "clickhouse":
|
|
258
|
+
config = ClickhouseConfigOutSerializer._toJsonObject(self.config);
|
|
259
|
+
break;
|
|
260
|
+
case "rabbitMq":
|
|
261
|
+
config = RabbitMqConfigOutSerializer._toJsonObject(self.config);
|
|
262
|
+
break;
|
|
263
|
+
case "sqs":
|
|
264
|
+
config = SqsConfigOutSerializer._toJsonObject(self.config);
|
|
265
|
+
break;
|
|
266
|
+
case "eventBridge":
|
|
267
|
+
config = EventBridgeConfigOutSerializer._toJsonObject(self.config);
|
|
268
|
+
break;
|
|
269
|
+
case "sns":
|
|
270
|
+
config = SnsConfigOutSerializer._toJsonObject(self.config);
|
|
271
|
+
break;
|
|
272
|
+
case "postgres":
|
|
273
|
+
config = PostgresConfigOutSerializer._toJsonObject(self.config);
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return {
|
|
278
|
+
type: self.type,
|
|
279
|
+
config: config,
|
|
280
|
+
id: self.id,
|
|
281
|
+
uid: self.uid,
|
|
282
|
+
status: DestinationStatusSerializer._toJsonObject(self.status),
|
|
283
|
+
currentIterator: self.currentIterator,
|
|
284
|
+
failureReason: self.failureReason,
|
|
285
|
+
createdAt: self.createdAt,
|
|
286
|
+
updatedAt: self.updatedAt,
|
|
287
|
+
batchSize: self.batchSize,
|
|
288
|
+
maxWaitSecs: self.maxWaitSecs,
|
|
289
|
+
eventTypes: self.eventTypes,
|
|
290
|
+
channels: self.channels,
|
|
291
|
+
nextRetryAt: self.nextRetryAt,
|
|
292
|
+
metadata: self.metadata,
|
|
293
|
+
};
|
|
294
|
+
},
|
|
295
|
+
};
|