@superdurable/connector-amplitude 0.0.0-stage → 0.2.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.
@@ -0,0 +1,357 @@
1
+ // src/generated/models.ts
2
+ import { z } from "zod";
3
+ import { SecretString } from "@superdurable/connectors-sdk";
4
+ var ConfigSchema = z.object({
5
+ "baseUrl": z.string().optional(),
6
+ "timeoutMs": z.number().int().optional(),
7
+ "maxResponseBytes": z.number().int().optional()
8
+ });
9
+ var CredentialMaterialError = class extends TypeError {
10
+ constructor(message) {
11
+ super(message);
12
+ this.name = "CredentialMaterialError";
13
+ }
14
+ };
15
+ var sdkCredentialDecodingFailureMessages = /* @__PURE__ */ new Set([
16
+ "project credential decoding failed",
17
+ "shared project credential decoding failed",
18
+ "project credential decoding failed: this connector version does not support shared credentials"
19
+ ]);
20
+ function isCredentialMaterialError(error) {
21
+ return error instanceof CredentialMaterialError || error instanceof TypeError && sdkCredentialDecodingFailureMessages.has(error.message);
22
+ }
23
+ function decodeCredentials(value) {
24
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new CredentialMaterialError("credential fields are invalid");
25
+ const fields = value;
26
+ const allowed = /* @__PURE__ */ new Set(["apiKey", "secretKey"]);
27
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new CredentialMaterialError("stored credential does not match the connector credential fields");
28
+ if (fields["apiKey"] != null && !(typeof fields["apiKey"] === "string")) throw new CredentialMaterialError("credential apiKey has an invalid type");
29
+ if (fields["secretKey"] != null && !(typeof fields["secretKey"] === "string")) throw new CredentialMaterialError("credential secretKey has an invalid type");
30
+ const credentials = {};
31
+ if (!fields["apiKey"]) throw new CredentialMaterialError("credential apiKey is required");
32
+ credentials.apiKey = new SecretString(fields["apiKey"] ?? "");
33
+ if (!fields["secretKey"]) throw new CredentialMaterialError("credential secretKey is required");
34
+ credentials.secretKey = new SecretString(fields["secretKey"] ?? "");
35
+ return credentials;
36
+ }
37
+ var QueryChartInputSchema = z.strictObject({
38
+ "chartID": z.string()
39
+ });
40
+ var ChartResultSchema = z.strictObject({
41
+ "chartID": z.string(),
42
+ "dataJSON": z.string()
43
+ });
44
+ var ActiveUserCountsInputSchema = z.strictObject({
45
+ "startDate": z.string(),
46
+ "endDate": z.string(),
47
+ "metric": z.string().optional(),
48
+ "intervalDays": z.number().int().optional()
49
+ });
50
+ var ActiveUserCountsSchema = z.strictObject({
51
+ "startDate": z.string(),
52
+ "endDate": z.string(),
53
+ "metric": z.string(),
54
+ "intervalDays": z.number().int(),
55
+ "dates": z.array(z.string()).nullable(),
56
+ "series": z.array(z.array(z.number()).nullable()).nullable()
57
+ });
58
+ var GetUserActivityInputSchema = z.strictObject({
59
+ "amplitudeID": z.string(),
60
+ "offset": z.number().int().optional(),
61
+ "limit": z.number().int().optional(),
62
+ "direction": z.string().optional()
63
+ });
64
+ var UserActivitySchema = z.strictObject({
65
+ "amplitudeID": z.string(),
66
+ "userID": z.string(),
67
+ "eventCount": z.number().int(),
68
+ "sessionCount": z.number().int(),
69
+ "returnedEvents": z.number().int(),
70
+ "eventTypes": z.array(z.string()).optional()
71
+ });
72
+ var UnsetUserPropertyInputSchema = z.strictObject({
73
+ "userID": z.string(),
74
+ "propertyName": z.string()
75
+ });
76
+ var IdentifiedUserSchema = z.strictObject({
77
+ "userID": z.string(),
78
+ "propertyName": z.string()
79
+ });
80
+ var TrackEventInputSchema = z.strictObject({
81
+ "userID": z.string(),
82
+ "eventType": z.string(),
83
+ "eventProperties": z.record(z.string(), z.string()).optional()
84
+ });
85
+ var TrackedEventSchema = z.strictObject({
86
+ "userID": z.string(),
87
+ "eventType": z.string(),
88
+ "insertID": z.string()
89
+ });
90
+ var IdentifyUserInputSchema = z.strictObject({
91
+ "userID": z.string(),
92
+ "propertyName": z.string(),
93
+ "propertyValue": z.string()
94
+ });
95
+ var SearchUsersInputSchema = z.strictObject({
96
+ "user": z.string()
97
+ });
98
+ var UserSearchPageSchema = z.strictObject({
99
+ "user": z.string(),
100
+ "userIDs": z.array(z.string()).nullable(),
101
+ "matchType": z.string()
102
+ });
103
+
104
+ // src/generated/definitions.ts
105
+ var ConnectorID = "amplitude";
106
+ var ProviderID = "amplitude";
107
+ var QueryChartBranch = {
108
+ Found: "found",
109
+ Missing: "missing",
110
+ ProviderRejected: "providerRejected",
111
+ InvalidResponse: "invalidResponse",
112
+ Defect: "defect"
113
+ };
114
+ var QueryChartBranchFound = QueryChartBranch.Found;
115
+ var QueryChartBranchMissing = QueryChartBranch.Missing;
116
+ var QueryChartBranchProviderRejected = QueryChartBranch.ProviderRejected;
117
+ var QueryChartBranchInvalidResponse = QueryChartBranch.InvalidResponse;
118
+ var QueryChartBranchDefect = QueryChartBranch.Defect;
119
+ var QueryChartDefinition = {
120
+ operation: { connectorId: ConnectorID, operationId: "queryChart" },
121
+ branches: [
122
+ { id: "found", description: "Amplitude returned chart results." },
123
+ { id: "missing", description: "The saved chart does not exist.", optional: true },
124
+ { id: "providerRejected", description: "Amplitude refused the chart query.", optional: true },
125
+ { id: "invalidResponse", description: "Amplitude returned invalid chart JSON.", optional: true },
126
+ { id: "defect", description: "The chart ID or credentials are invalid.", optional: true }
127
+ ],
128
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
129
+ };
130
+ var QueryChartMetadata = { kind: "query", idempotency: "none", authorization: "required" };
131
+ var GetActiveUserCountsBranch = {
132
+ Counted: "counted",
133
+ ProviderRejected: "providerRejected",
134
+ InvalidResponse: "invalidResponse",
135
+ Defect: "defect"
136
+ };
137
+ var GetActiveUserCountsBranchCounted = GetActiveUserCountsBranch.Counted;
138
+ var GetActiveUserCountsBranchProviderRejected = GetActiveUserCountsBranch.ProviderRejected;
139
+ var GetActiveUserCountsBranchInvalidResponse = GetActiveUserCountsBranch.InvalidResponse;
140
+ var GetActiveUserCountsBranchDefect = GetActiveUserCountsBranch.Defect;
141
+ var GetActiveUserCountsDefinition = {
142
+ operation: { connectorId: ConnectorID, operationId: "getActiveUserCounts" },
143
+ branches: [
144
+ { id: "counted", description: "Amplitude returned user count series." },
145
+ { id: "providerRejected", description: "Amplitude refused the metric query.", optional: true },
146
+ { id: "invalidResponse", description: "Amplitude returned invalid metric JSON.", optional: true },
147
+ { id: "defect", description: "Dates, metric, interval, or credentials are invalid.", optional: true }
148
+ ],
149
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
150
+ };
151
+ var GetActiveUserCountsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
152
+ var GetUserActivityBranch = {
153
+ Found: "found",
154
+ Missing: "missing",
155
+ ProviderRejected: "providerRejected",
156
+ InvalidResponse: "invalidResponse",
157
+ Defect: "defect"
158
+ };
159
+ var GetUserActivityBranchFound = GetUserActivityBranch.Found;
160
+ var GetUserActivityBranchMissing = GetUserActivityBranch.Missing;
161
+ var GetUserActivityBranchProviderRejected = GetUserActivityBranch.ProviderRejected;
162
+ var GetUserActivityBranchInvalidResponse = GetUserActivityBranch.InvalidResponse;
163
+ var GetUserActivityBranchDefect = GetUserActivityBranch.Defect;
164
+ var GetUserActivityDefinition = {
165
+ operation: { connectorId: ConnectorID, operationId: "getUserActivity" },
166
+ branches: [
167
+ { id: "found", description: "Amplitude returned the user's activity summary." },
168
+ { id: "missing", description: "Amplitude has no activity for this user.", optional: true },
169
+ { id: "providerRejected", description: "Amplitude refused the activity read.", optional: true },
170
+ { id: "invalidResponse", description: "Amplitude returned invalid activity JSON.", optional: true },
171
+ { id: "defect", description: "The Amplitude ID or credentials are invalid.", optional: true }
172
+ ],
173
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
174
+ };
175
+ var GetUserActivityMetadata = { kind: "query", idempotency: "none", authorization: "required" };
176
+ var UnsetUserPropertyBranch = {
177
+ Unset: "unset",
178
+ ProviderRejected: "providerRejected",
179
+ Defect: "defect"
180
+ };
181
+ var UnsetUserPropertyBranchUnset = UnsetUserPropertyBranch.Unset;
182
+ var UnsetUserPropertyBranchProviderRejected = UnsetUserPropertyBranch.ProviderRejected;
183
+ var UnsetUserPropertyBranchDefect = UnsetUserPropertyBranch.Defect;
184
+ var UnsetUserPropertyDefinition = {
185
+ operation: { connectorId: ConnectorID, operationId: "unsetUserProperty" },
186
+ branches: [
187
+ { id: "unset", description: "Amplitude accepted the property removal." },
188
+ { id: "providerRejected", description: "Amplitude conclusively refused the removal.", optional: true },
189
+ { id: "defect", description: "The user, property, or connection is invalid.", optional: true }
190
+ ],
191
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
192
+ repeatOnUnknown: "safe"
193
+ };
194
+ var UnsetUserPropertyMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
195
+ var TrackEventBranch = {
196
+ Tracked: "tracked",
197
+ ProviderRejected: "providerRejected",
198
+ Defect: "defect"
199
+ };
200
+ var TrackEventBranchTracked = TrackEventBranch.Tracked;
201
+ var TrackEventBranchProviderRejected = TrackEventBranch.ProviderRejected;
202
+ var TrackEventBranchDefect = TrackEventBranch.Defect;
203
+ var TrackEventDefinition = {
204
+ operation: { connectorId: ConnectorID, operationId: "trackEvent" },
205
+ branches: [
206
+ { id: "tracked", description: "Amplitude ingested the event." },
207
+ { id: "providerRejected", description: "Amplitude conclusively rejected the event.", optional: true },
208
+ { id: "defect", description: "The event or connection is invalid.", optional: true }
209
+ ],
210
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
211
+ repeatOnUnknown: "safe"
212
+ };
213
+ var TrackEventMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
214
+ var IdentifyUserBranch = {
215
+ Identified: "identified",
216
+ ProviderRejected: "providerRejected",
217
+ Defect: "defect"
218
+ };
219
+ var IdentifyUserBranchIdentified = IdentifyUserBranch.Identified;
220
+ var IdentifyUserBranchProviderRejected = IdentifyUserBranch.ProviderRejected;
221
+ var IdentifyUserBranchDefect = IdentifyUserBranch.Defect;
222
+ var IdentifyUserDefinition = {
223
+ operation: { connectorId: ConnectorID, operationId: "identifyUser" },
224
+ branches: [
225
+ { id: "identified", description: "Amplitude accepted the property replacement." },
226
+ { id: "providerRejected", description: "Amplitude conclusively rejected the property update.", optional: true },
227
+ { id: "defect", description: "The user, property, or connection is invalid.", optional: true }
228
+ ],
229
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" },
230
+ repeatOnUnknown: "safe"
231
+ };
232
+ var IdentifyUserMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
233
+ var SearchUsersBranch = {
234
+ Searched: "searched",
235
+ ProviderRejected: "providerRejected",
236
+ InvalidResponse: "invalidResponse",
237
+ Defect: "defect"
238
+ };
239
+ var SearchUsersBranchSearched = SearchUsersBranch.Searched;
240
+ var SearchUsersBranchProviderRejected = SearchUsersBranch.ProviderRejected;
241
+ var SearchUsersBranchInvalidResponse = SearchUsersBranch.InvalidResponse;
242
+ var SearchUsersBranchDefect = SearchUsersBranch.Defect;
243
+ var SearchUsersDefinition = {
244
+ operation: { connectorId: ConnectorID, operationId: "searchUsers" },
245
+ branches: [
246
+ { id: "searched", description: "Amplitude returned matching user IDs, possibly empty." },
247
+ { id: "providerRejected", description: "Amplitude conclusively rejected the search.", optional: true },
248
+ { id: "invalidResponse", description: "Amplitude returned malformed or oversized JSON.", optional: true },
249
+ { id: "defect", description: "Local input or credentials are invalid.", optional: true }
250
+ ],
251
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
252
+ };
253
+ var SearchUsersMetadata = { kind: "query", idempotency: "none", authorization: "required" };
254
+
255
+ // src/generated/connection.ts
256
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
257
+ var Connection = class {
258
+ /** Stable provider and connection name. */
259
+ reference;
260
+ /** Bound provider operations. */
261
+ operations;
262
+ /** Validate a reference and bind operations. */
263
+ constructor(reference, operations) {
264
+ this.reference = ConnectionRefSchema.parse(reference);
265
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
266
+ if (!operations) throw new TypeError("connector operations are required");
267
+ this.operations = operations;
268
+ }
269
+ };
270
+ function newConnection(client, reference) {
271
+ if (!client) throw new TypeError("connector client is required");
272
+ return new Connection(reference, client);
273
+ }
274
+ function newConnectionWithOperations(operations, reference) {
275
+ return new Connection(reference, operations);
276
+ }
277
+ function newProjectConnection(project, connectionName, createClient) {
278
+ if (!project) throw new TypeError("loaded project is required");
279
+ const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
280
+ const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
281
+ if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
282
+ return newConnection(createClient(project, connectionName), reference);
283
+ }
284
+
285
+ export {
286
+ ConfigSchema,
287
+ CredentialMaterialError,
288
+ isCredentialMaterialError,
289
+ decodeCredentials,
290
+ QueryChartInputSchema,
291
+ ChartResultSchema,
292
+ ActiveUserCountsInputSchema,
293
+ ActiveUserCountsSchema,
294
+ GetUserActivityInputSchema,
295
+ UserActivitySchema,
296
+ UnsetUserPropertyInputSchema,
297
+ IdentifiedUserSchema,
298
+ TrackEventInputSchema,
299
+ TrackedEventSchema,
300
+ IdentifyUserInputSchema,
301
+ SearchUsersInputSchema,
302
+ UserSearchPageSchema,
303
+ ConnectorID,
304
+ ProviderID,
305
+ QueryChartBranch,
306
+ QueryChartBranchFound,
307
+ QueryChartBranchMissing,
308
+ QueryChartBranchProviderRejected,
309
+ QueryChartBranchInvalidResponse,
310
+ QueryChartBranchDefect,
311
+ QueryChartDefinition,
312
+ QueryChartMetadata,
313
+ GetActiveUserCountsBranch,
314
+ GetActiveUserCountsBranchCounted,
315
+ GetActiveUserCountsBranchProviderRejected,
316
+ GetActiveUserCountsBranchInvalidResponse,
317
+ GetActiveUserCountsBranchDefect,
318
+ GetActiveUserCountsDefinition,
319
+ GetActiveUserCountsMetadata,
320
+ GetUserActivityBranch,
321
+ GetUserActivityBranchFound,
322
+ GetUserActivityBranchMissing,
323
+ GetUserActivityBranchProviderRejected,
324
+ GetUserActivityBranchInvalidResponse,
325
+ GetUserActivityBranchDefect,
326
+ GetUserActivityDefinition,
327
+ GetUserActivityMetadata,
328
+ UnsetUserPropertyBranch,
329
+ UnsetUserPropertyBranchUnset,
330
+ UnsetUserPropertyBranchProviderRejected,
331
+ UnsetUserPropertyBranchDefect,
332
+ UnsetUserPropertyDefinition,
333
+ UnsetUserPropertyMetadata,
334
+ TrackEventBranch,
335
+ TrackEventBranchTracked,
336
+ TrackEventBranchProviderRejected,
337
+ TrackEventBranchDefect,
338
+ TrackEventDefinition,
339
+ TrackEventMetadata,
340
+ IdentifyUserBranch,
341
+ IdentifyUserBranchIdentified,
342
+ IdentifyUserBranchProviderRejected,
343
+ IdentifyUserBranchDefect,
344
+ IdentifyUserDefinition,
345
+ IdentifyUserMetadata,
346
+ SearchUsersBranch,
347
+ SearchUsersBranchSearched,
348
+ SearchUsersBranchProviderRejected,
349
+ SearchUsersBranchInvalidResponse,
350
+ SearchUsersBranchDefect,
351
+ SearchUsersDefinition,
352
+ SearchUsersMetadata,
353
+ Connection,
354
+ newConnection,
355
+ newConnectionWithOperations,
356
+ newProjectConnection
357
+ };
@@ -0,0 +1,268 @@
1
+ import { SecretString, CredentialProvider, Query, Mutation, ConnectionRef } from '@superdurable/connectors-sdk';
2
+ import { z } from 'zod';
3
+
4
+ /** Connector configuration; omitted fields use manifest defaults. */
5
+ interface Config {
6
+ /** Dashboard REST API HTTPS root. Blank uses the displayed US-region default; override with https://analytics.eu.amplitude.com for EU data residency or a verified regional host. Do not include path, query, or credentials. */
7
+ baseUrl?: string;
8
+ /** Maximum duration of one Amplitude API request as a positive Go duration. Blank uses the displayed default; increase only for slow responses. Runtime value in milliseconds. */
9
+ timeoutMs?: number;
10
+ /** Maximum complete Amplitude API response in bytes as a positive integer. Blank uses the displayed default; increase if a project returns many matches. */
11
+ maxResponseBytes?: number;
12
+ }
13
+ /** Runtime schema for manifest configuration. */
14
+ declare const ConfigSchema: z.ZodObject<{
15
+ baseUrl: z.ZodOptional<z.ZodString>;
16
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
17
+ maxResponseBytes: z.ZodOptional<z.ZodNumber>;
18
+ }, z.core.$strip>;
19
+ /** Private connector credentials resolved by the host. */
20
+ interface Credentials {
21
+ /** Secret project API key from Amplitude > Organization settings > API Keys > select project > Generate API Key or existing key. Copy its complete value, not the key name; blank prevents calls. Dex sends it as the Basic-auth username. */
22
+ apiKey: SecretString;
23
+ /** Secret project secret key from Amplitude > Organization settings > API Keys > select project > Generate Secret Key. Copy the complete key at creation; the Key ID is not the secret. Blank prevents calls. Dex sends it as the Basic-auth password. */
24
+ secretKey: SecretString;
25
+ }
26
+ /** Stored credential material that fails the connector credential checks, so no retry can succeed. */
27
+ declare class CredentialMaterialError extends TypeError {
28
+ constructor(message: string);
29
+ }
30
+ /** Report malformed stored credential material, also behind the SDK provider's decoding TypeError. */
31
+ declare function isCredentialMaterialError(error: unknown): boolean;
32
+ /** Decode private credential fields for the connector. */
33
+ declare function decodeCredentials(value: unknown): Credentials;
34
+ /** Host-owned source of private connector credentials. */
35
+ type CredentialSource = CredentialProvider<Credentials>;
36
+ /** QueryChartInput identifies a saved chart by its URL ID. */
37
+ interface QueryChartInput {
38
+ /** ChartID is the segment after /chart/ in an Amplitude chart URL. */
39
+ "chartID": string;
40
+ }
41
+ /** ChartResult contains bounded provider JSON for one saved chart. */
42
+ interface ChartResult {
43
+ /** ChartID is the requested chart. */
44
+ "chartID": string;
45
+ /** DataJSON is the chart's data object encoded as compact JSON; its shape depends on chart type. */
46
+ "dataJSON": string;
47
+ }
48
+ /** ActiveUserCountsInput selects a date range and active or new user metric. */
49
+ interface ActiveUserCountsInput {
50
+ /** StartDate is the first included date in YYYYMMDD format. */
51
+ "startDate": string;
52
+ /** EndDate is the last included date in YYYYMMDD format. */
53
+ "endDate": string;
54
+ /** Metric is active or new; blank uses active. */
55
+ "metric"?: string | undefined;
56
+ /** IntervalDays is 1, 7, or 30; zero uses 1. */
57
+ "intervalDays"?: number | undefined;
58
+ }
59
+ /** ActiveUserCounts contains unsegmented user counts in provider date order. */
60
+ interface ActiveUserCounts {
61
+ /** StartDate is the requested first date. */
62
+ "startDate": string;
63
+ /** EndDate is the requested last date. */
64
+ "endDate": string;
65
+ /** Metric is active or new. */
66
+ "metric": string;
67
+ /** IntervalDays is the provider grouping interval. */
68
+ "intervalDays": number;
69
+ /** Dates are provider date labels in YYYY-MM-DD format. */
70
+ "dates": Array<string> | null;
71
+ /** Series are counts aligned with Dates. */
72
+ "series": Array<Array<number> | null> | null;
73
+ }
74
+ /** GetUserActivityInput selects a bounded page of activity by Amplitude's numeric ID. */
75
+ interface GetUserActivityInput {
76
+ /** AmplitudeID is the numeric ID returned by Amplitude User Lookup. */
77
+ "amplitudeID": string;
78
+ /** Offset is the zero-based offset from the most recent event. */
79
+ "offset"?: number | undefined;
80
+ /** Limit is the requested number of events, 1–1000; zero uses 100. */
81
+ "limit"?: number | undefined;
82
+ /** Direction is latest or earliest; blank uses latest. */
83
+ "direction"?: string | undefined;
84
+ }
85
+ /** UserActivity contains selected counts and event names without arbitrary event properties. */
86
+ interface UserActivity {
87
+ /** AmplitudeID is the requested numeric ID. */
88
+ "amplitudeID": string;
89
+ /** UserID is the associated user ID. */
90
+ "userID": string;
91
+ /** EventCount is the user's lifetime event count. */
92
+ "eventCount": number;
93
+ /** SessionCount is the user's lifetime session count. */
94
+ "sessionCount": number;
95
+ /** ReturnedEvents is the number of events in this response. */
96
+ "returnedEvents": number;
97
+ /** EventTypes are event names in provider order; event property payloads are not copied. */
98
+ "eventTypes"?: Array<string> | undefined;
99
+ }
100
+ /** UnsetUserPropertyInput removes one user property from future events. */
101
+ interface UnsetUserPropertyInput {
102
+ /** UserID is the existing Amplitude user ID. */
103
+ "userID": string;
104
+ /** PropertyName names the user property to remove. */
105
+ "propertyName": string;
106
+ }
107
+ /** IdentifiedUser identifies a user and the property whose value was set. */
108
+ interface IdentifiedUser {
109
+ /** UserID is the input user ID. */
110
+ "userID": string;
111
+ /** PropertyName is the updated property name. */
112
+ "propertyName": string;
113
+ }
114
+ /** TrackEventInput uploads one event for an existing or new Amplitude user. */
115
+ interface TrackEventInput {
116
+ /** UserID is a non-secret project user ID of at least five UTF-8 bytes. */
117
+ "userID": string;
118
+ /** EventType is the nonempty event name visible in Amplitude's event catalog. */
119
+ "eventType": string;
120
+ /** EventProperties are optional string properties; blank map sends no properties. */
121
+ "eventProperties"?: {
122
+ [key: string]: string;
123
+ } | undefined;
124
+ }
125
+ /** TrackedEvent identifies the event accepted by Amplitude. */
126
+ interface TrackedEvent {
127
+ /** UserID is the input user ID. */
128
+ "userID": string;
129
+ /** EventType is the input event name. */
130
+ "eventType": string;
131
+ /** InsertID is the stable Dex-derived ID Amplitude uses to deduplicate retries for seven days. */
132
+ "insertID": string;
133
+ }
134
+ /** IdentifyUserInput absolutely sets one string user property. */
135
+ interface IdentifyUserInput {
136
+ /** UserID is a non-secret Amplitude user ID. */
137
+ "userID": string;
138
+ /** PropertyName is a user property shown in Amplitude User Lookup. */
139
+ "propertyName": string;
140
+ /** PropertyValue replaces the current string value; blank sets the empty string. */
141
+ "propertyValue": string;
142
+ }
143
+ /** SearchUsersInput identifies a user by ID, device ID, Amplitude ID, or user ID prefix. */
144
+ interface SearchUsersInput {
145
+ /** User is the non-secret search term accepted by Amplitude User Search. */
146
+ "user": string;
147
+ }
148
+ /** UserSearchPage contains the matched user IDs and Amplitude's match type. */
149
+ interface UserSearchPage {
150
+ /** User is the search term supplied to Amplitude. */
151
+ "user": string;
152
+ /** UserIDs are the matched user IDs in provider order. */
153
+ "userIDs": Array<string> | null;
154
+ /** MatchType names the matching strategy reported by Amplitude. */
155
+ "matchType": string;
156
+ }
157
+ /** Runtime validator for QueryChartInput. */
158
+ declare const QueryChartInputSchema: z.ZodObject<{
159
+ chartID: z.ZodString;
160
+ }, z.core.$strict>;
161
+ /** Runtime validator for ChartResult. */
162
+ declare const ChartResultSchema: z.ZodObject<{
163
+ chartID: z.ZodString;
164
+ dataJSON: z.ZodString;
165
+ }, z.core.$strict>;
166
+ /** Runtime validator for ActiveUserCountsInput. */
167
+ declare const ActiveUserCountsInputSchema: z.ZodObject<{
168
+ startDate: z.ZodString;
169
+ endDate: z.ZodString;
170
+ metric: z.ZodOptional<z.ZodString>;
171
+ intervalDays: z.ZodOptional<z.ZodNumber>;
172
+ }, z.core.$strict>;
173
+ /** Runtime validator for ActiveUserCounts. */
174
+ declare const ActiveUserCountsSchema: z.ZodObject<{
175
+ startDate: z.ZodString;
176
+ endDate: z.ZodString;
177
+ metric: z.ZodString;
178
+ intervalDays: z.ZodNumber;
179
+ dates: z.ZodNullable<z.ZodArray<z.ZodString>>;
180
+ series: z.ZodNullable<z.ZodArray<z.ZodNullable<z.ZodArray<z.ZodNumber>>>>;
181
+ }, z.core.$strict>;
182
+ /** Runtime validator for GetUserActivityInput. */
183
+ declare const GetUserActivityInputSchema: z.ZodObject<{
184
+ amplitudeID: z.ZodString;
185
+ offset: z.ZodOptional<z.ZodNumber>;
186
+ limit: z.ZodOptional<z.ZodNumber>;
187
+ direction: z.ZodOptional<z.ZodString>;
188
+ }, z.core.$strict>;
189
+ /** Runtime validator for UserActivity. */
190
+ declare const UserActivitySchema: z.ZodObject<{
191
+ amplitudeID: z.ZodString;
192
+ userID: z.ZodString;
193
+ eventCount: z.ZodNumber;
194
+ sessionCount: z.ZodNumber;
195
+ returnedEvents: z.ZodNumber;
196
+ eventTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
197
+ }, z.core.$strict>;
198
+ /** Runtime validator for UnsetUserPropertyInput. */
199
+ declare const UnsetUserPropertyInputSchema: z.ZodObject<{
200
+ userID: z.ZodString;
201
+ propertyName: z.ZodString;
202
+ }, z.core.$strict>;
203
+ /** Runtime validator for IdentifiedUser. */
204
+ declare const IdentifiedUserSchema: z.ZodObject<{
205
+ userID: z.ZodString;
206
+ propertyName: z.ZodString;
207
+ }, z.core.$strict>;
208
+ /** Runtime validator for TrackEventInput. */
209
+ declare const TrackEventInputSchema: z.ZodObject<{
210
+ userID: z.ZodString;
211
+ eventType: z.ZodString;
212
+ eventProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
213
+ }, z.core.$strict>;
214
+ /** Runtime validator for TrackedEvent. */
215
+ declare const TrackedEventSchema: z.ZodObject<{
216
+ userID: z.ZodString;
217
+ eventType: z.ZodString;
218
+ insertID: z.ZodString;
219
+ }, z.core.$strict>;
220
+ /** Runtime validator for IdentifyUserInput. */
221
+ declare const IdentifyUserInputSchema: z.ZodObject<{
222
+ userID: z.ZodString;
223
+ propertyName: z.ZodString;
224
+ propertyValue: z.ZodString;
225
+ }, z.core.$strict>;
226
+ /** Runtime validator for SearchUsersInput. */
227
+ declare const SearchUsersInputSchema: z.ZodObject<{
228
+ user: z.ZodString;
229
+ }, z.core.$strict>;
230
+ /** Runtime validator for UserSearchPage. */
231
+ declare const UserSearchPageSchema: z.ZodObject<{
232
+ user: z.ZodString;
233
+ userIDs: z.ZodNullable<z.ZodArray<z.ZodString>>;
234
+ matchType: z.ZodString;
235
+ }, z.core.$strict>;
236
+
237
+ /** Typed operations supplied by a client or mock. */
238
+ interface Operations {
239
+ /** Invoke queryChart through this connection. */
240
+ queryChart(): Query<QueryChartInput, ChartResult>;
241
+ /** Invoke getActiveUserCounts through this connection. */
242
+ getActiveUserCounts(): Query<ActiveUserCountsInput, ActiveUserCounts>;
243
+ /** Invoke getUserActivity through this connection. */
244
+ getUserActivity(): Query<GetUserActivityInput, UserActivity>;
245
+ /** Invoke unsetUserProperty through this connection. */
246
+ unsetUserProperty(): Mutation<UnsetUserPropertyInput, IdentifiedUser>;
247
+ /** Invoke trackEvent through this connection. */
248
+ trackEvent(): Mutation<TrackEventInput, TrackedEvent>;
249
+ /** Invoke identifyUser through this connection. */
250
+ identifyUser(): Mutation<IdentifyUserInput, IdentifiedUser>;
251
+ /** Invoke searchUsers through this connection. */
252
+ searchUsers(): Query<SearchUsersInput, UserSearchPage>;
253
+ }
254
+ /** Named connector connection kept outside Flow state. */
255
+ declare class Connection<BoundOperations = Operations> {
256
+ /** Stable provider and connection name. */
257
+ readonly reference: ConnectionRef;
258
+ /** Bound provider operations. */
259
+ readonly operations: BoundOperations;
260
+ /** Validate a reference and bind operations. */
261
+ constructor(reference: ConnectionRef, operations: BoundOperations);
262
+ }
263
+ /** Bind a client to a named connection. */
264
+ declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
265
+ /** Bind scripted operations to a named connection. */
266
+ declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
267
+
268
+ export { type ActiveUserCountsInput as A, newConnection as B, Connection as C, newConnectionWithOperations as D, type GetUserActivityInput as G, type IdentifyUserInput as I, type Operations as O, type QueryChartInput as Q, type SearchUsersInput as S, type TrackEventInput as T, type UserActivity as U, type ActiveUserCounts as a, type IdentifiedUser as b, type ChartResult as c, type UserSearchPage as d, type TrackedEvent as e, type UnsetUserPropertyInput as f, type Config as g, type Credentials as h, ActiveUserCountsInputSchema as i, ActiveUserCountsSchema as j, ChartResultSchema as k, ConfigSchema as l, CredentialMaterialError as m, type CredentialSource as n, GetUserActivityInputSchema as o, IdentifiedUserSchema as p, IdentifyUserInputSchema as q, QueryChartInputSchema as r, SearchUsersInputSchema as s, TrackEventInputSchema as t, TrackedEventSchema as u, UnsetUserPropertyInputSchema as v, UserActivitySchema as w, UserSearchPageSchema as x, decodeCredentials as y, isCredentialMaterialError as z };