@iterable/api 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -0
  3. package/dist/client/base.d.ts +33 -0
  4. package/dist/client/base.d.ts.map +1 -0
  5. package/dist/client/base.js +155 -0
  6. package/dist/client/base.js.map +1 -0
  7. package/dist/client/campaigns.d.ts +71 -0
  8. package/dist/client/campaigns.d.ts.map +1 -0
  9. package/dist/client/campaigns.js +125 -0
  10. package/dist/client/campaigns.js.map +1 -0
  11. package/dist/client/catalogs.d.ts +60 -0
  12. package/dist/client/catalogs.d.ts.map +1 -0
  13. package/dist/client/catalogs.js +138 -0
  14. package/dist/client/catalogs.js.map +1 -0
  15. package/dist/client/events.d.ts +38 -0
  16. package/dist/client/events.d.ts.map +1 -0
  17. package/dist/client/events.js +38 -0
  18. package/dist/client/events.js.map +1 -0
  19. package/dist/client/experiments.d.ts +24 -0
  20. package/dist/client/experiments.d.ts.map +1 -0
  21. package/dist/client/experiments.js +29 -0
  22. package/dist/client/experiments.js.map +1 -0
  23. package/dist/client/export.d.ts +27 -0
  24. package/dist/client/export.d.ts.map +1 -0
  25. package/dist/client/export.js +31 -0
  26. package/dist/client/export.js.map +1 -0
  27. package/dist/client/index.d.ts +315 -0
  28. package/dist/client/index.d.ts.map +1 -0
  29. package/dist/client/index.js +25 -0
  30. package/dist/client/index.js.map +1 -0
  31. package/dist/client/journeys.d.ts +26 -0
  32. package/dist/client/journeys.d.ts.map +1 -0
  33. package/dist/client/journeys.js +32 -0
  34. package/dist/client/journeys.js.map +1 -0
  35. package/dist/client/lists.d.ts +39 -0
  36. package/dist/client/lists.d.ts.map +1 -0
  37. package/dist/client/lists.js +80 -0
  38. package/dist/client/lists.js.map +1 -0
  39. package/dist/client/messaging.d.ts +39 -0
  40. package/dist/client/messaging.d.ts.map +1 -0
  41. package/dist/client/messaging.js +110 -0
  42. package/dist/client/messaging.js.map +1 -0
  43. package/dist/client/snippets.d.ts +37 -0
  44. package/dist/client/snippets.d.ts.map +1 -0
  45. package/dist/client/snippets.js +29 -0
  46. package/dist/client/snippets.js.map +1 -0
  47. package/dist/client/subscriptions.d.ts +26 -0
  48. package/dist/client/subscriptions.d.ts.map +1 -0
  49. package/dist/client/subscriptions.js +31 -0
  50. package/dist/client/subscriptions.js.map +1 -0
  51. package/dist/client/templates.d.ts +52 -0
  52. package/dist/client/templates.d.ts.map +1 -0
  53. package/dist/client/templates.js +132 -0
  54. package/dist/client/templates.js.map +1 -0
  55. package/dist/client/users.d.ts +76 -0
  56. package/dist/client/users.d.ts.map +1 -0
  57. package/dist/client/users.js +115 -0
  58. package/dist/client/users.js.map +1 -0
  59. package/dist/client/webhooks.d.ts +25 -0
  60. package/dist/client/webhooks.d.ts.map +1 -0
  61. package/dist/client/webhooks.js +17 -0
  62. package/dist/client/webhooks.js.map +1 -0
  63. package/dist/config.d.ts +26 -0
  64. package/dist/config.d.ts.map +1 -0
  65. package/dist/config.js +51 -0
  66. package/dist/config.js.map +1 -0
  67. package/dist/errors.d.ts +45 -0
  68. package/dist/errors.d.ts.map +1 -0
  69. package/dist/errors.js +144 -0
  70. package/dist/errors.js.map +1 -0
  71. package/dist/index.d.ts +21 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +25 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/logger.d.ts +3 -0
  76. package/dist/logger.d.ts.map +1 -0
  77. package/dist/logger.js +32 -0
  78. package/dist/logger.js.map +1 -0
  79. package/dist/types/campaigns.d.ts +307 -0
  80. package/dist/types/campaigns.d.ts.map +1 -0
  81. package/dist/types/campaigns.js +226 -0
  82. package/dist/types/campaigns.js.map +1 -0
  83. package/dist/types/catalogs.d.ts +138 -0
  84. package/dist/types/catalogs.d.ts.map +1 -0
  85. package/dist/types/catalogs.js +139 -0
  86. package/dist/types/catalogs.js.map +1 -0
  87. package/dist/types/common.d.ts +145 -0
  88. package/dist/types/common.d.ts.map +1 -0
  89. package/dist/types/common.js +110 -0
  90. package/dist/types/common.js.map +1 -0
  91. package/dist/types/events.d.ts +124 -0
  92. package/dist/types/events.d.ts.map +1 -0
  93. package/dist/types/events.js +118 -0
  94. package/dist/types/events.js.map +1 -0
  95. package/dist/types/experiments.d.ts +14 -0
  96. package/dist/types/experiments.d.ts.map +1 -0
  97. package/dist/types/experiments.js +24 -0
  98. package/dist/types/experiments.js.map +1 -0
  99. package/dist/types/export.d.ts +121 -0
  100. package/dist/types/export.d.ts.map +1 -0
  101. package/dist/types/export.js +105 -0
  102. package/dist/types/export.js.map +1 -0
  103. package/dist/types/journeys.d.ts +72 -0
  104. package/dist/types/journeys.d.ts.map +1 -0
  105. package/dist/types/journeys.js +65 -0
  106. package/dist/types/journeys.js.map +1 -0
  107. package/dist/types/lists.d.ts +149 -0
  108. package/dist/types/lists.d.ts.map +1 -0
  109. package/dist/types/lists.js +140 -0
  110. package/dist/types/lists.js.map +1 -0
  111. package/dist/types/messaging.d.ts +246 -0
  112. package/dist/types/messaging.d.ts.map +1 -0
  113. package/dist/types/messaging.js +323 -0
  114. package/dist/types/messaging.js.map +1 -0
  115. package/dist/types/snippets.d.ts +89 -0
  116. package/dist/types/snippets.d.ts.map +1 -0
  117. package/dist/types/snippets.js +85 -0
  118. package/dist/types/snippets.js.map +1 -0
  119. package/dist/types/subscriptions.d.ts +63 -0
  120. package/dist/types/subscriptions.d.ts.map +1 -0
  121. package/dist/types/subscriptions.js +40 -0
  122. package/dist/types/subscriptions.js.map +1 -0
  123. package/dist/types/templates.d.ts +315 -0
  124. package/dist/types/templates.d.ts.map +1 -0
  125. package/dist/types/templates.js +357 -0
  126. package/dist/types/templates.js.map +1 -0
  127. package/dist/types/users.d.ts +144 -0
  128. package/dist/types/users.d.ts.map +1 -0
  129. package/dist/types/users.js +189 -0
  130. package/dist/types/users.js.map +1 -0
  131. package/dist/types/webhooks.d.ts +52 -0
  132. package/dist/types/webhooks.d.ts.map +1 -0
  133. package/dist/types/webhooks.js +32 -0
  134. package/dist/types/webhooks.js.map +1 -0
  135. package/package.json +73 -0
@@ -0,0 +1,124 @@
1
+ import { z } from "zod";
2
+ /** Single event (track) */
3
+ export declare const TrackEventParamsSchema: z.ZodObject<{
4
+ email: z.ZodOptional<z.ZodEmail>;
5
+ userId: z.ZodOptional<z.ZodString>;
6
+ eventName: z.ZodString;
7
+ id: z.ZodOptional<z.ZodString>;
8
+ dataFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
9
+ campaignId: z.ZodOptional<z.ZodNumber>;
10
+ templateId: z.ZodOptional<z.ZodNumber>;
11
+ createdAt: z.ZodOptional<z.ZodNumber>;
12
+ createNewFields: z.ZodOptional<z.ZodBoolean>;
13
+ }, z.core.$strip>;
14
+ export type TrackEventParams = z.infer<typeof TrackEventParamsSchema>;
15
+ /** Bulk events */
16
+ export declare const TrackBulkEventsParamsSchema: z.ZodObject<{
17
+ events: z.ZodArray<z.ZodObject<{
18
+ createdAt: z.ZodOptional<z.ZodNumber>;
19
+ id: z.ZodOptional<z.ZodString>;
20
+ templateId: z.ZodOptional<z.ZodNumber>;
21
+ campaignId: z.ZodOptional<z.ZodNumber>;
22
+ dataFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
23
+ email: z.ZodOptional<z.ZodEmail>;
24
+ userId: z.ZodOptional<z.ZodString>;
25
+ eventName: z.ZodString;
26
+ }, z.core.$strip>>;
27
+ }, z.core.$strip>;
28
+ export type TrackBulkEventsParams = z.infer<typeof TrackBulkEventsParamsSchema>;
29
+ /** Loose reader schema for GET /events/... (allows extra fields) */
30
+ export declare const EventRecordSchema: z.ZodObject<{
31
+ _id: z.ZodOptional<z.ZodString>;
32
+ eventType: z.ZodOptional<z.ZodString>;
33
+ eventName: z.ZodOptional<z.ZodString>;
34
+ email: z.ZodOptional<z.ZodEmail>;
35
+ userId: z.ZodOptional<z.ZodString>;
36
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
37
+ dataFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
38
+ campaignId: z.ZodOptional<z.ZodNumber>;
39
+ templateId: z.ZodOptional<z.ZodNumber>;
40
+ messageId: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$loose>;
42
+ export type EventRecord = z.infer<typeof EventRecordSchema>;
43
+ export declare const BulkEventSchema: z.ZodObject<{
44
+ eventName: z.ZodString;
45
+ email: z.ZodOptional<z.ZodEmail>;
46
+ userId: z.ZodOptional<z.ZodString>;
47
+ dataFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
48
+ campaignId: z.ZodOptional<z.ZodNumber>;
49
+ templateId: z.ZodOptional<z.ZodNumber>;
50
+ id: z.ZodOptional<z.ZodString>;
51
+ createdAt: z.ZodOptional<z.ZodNumber>;
52
+ createNewFields: z.ZodOptional<z.ZodBoolean>;
53
+ }, z.core.$strip>;
54
+ export declare const FailedEventUpdatesSchema: z.ZodObject<{
55
+ invalidEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
56
+ invalidUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
+ failedEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
+ failedUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
+ }, z.core.$strip>;
60
+ export declare const BulkTrackResponseSchema: z.ZodObject<{
61
+ successCount: z.ZodNumber;
62
+ failCount: z.ZodNumber;
63
+ createdFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ filteredOutFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
+ disallowedEventNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
+ failedUpdates: z.ZodOptional<z.ZodObject<{
67
+ invalidEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ invalidUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
69
+ failedEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
+ failedUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
+ }, z.core.$strip>>;
72
+ invalidEmails: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
+ invalidUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
+ }, z.core.$strip>;
75
+ /**
76
+ * Schema for getting events by email
77
+ */
78
+ export declare const GetUserEventsByEmailParamsSchema: z.ZodObject<{
79
+ email: z.ZodEmail;
80
+ limit: z.ZodOptional<z.ZodNumber>;
81
+ }, z.core.$strip>;
82
+ export declare const GetUserEventsByEmailResponseSchema: z.ZodObject<{
83
+ events: z.ZodArray<z.ZodObject<{
84
+ _id: z.ZodOptional<z.ZodString>;
85
+ eventType: z.ZodOptional<z.ZodString>;
86
+ eventName: z.ZodOptional<z.ZodString>;
87
+ email: z.ZodOptional<z.ZodEmail>;
88
+ userId: z.ZodOptional<z.ZodString>;
89
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
90
+ dataFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
91
+ campaignId: z.ZodOptional<z.ZodNumber>;
92
+ templateId: z.ZodOptional<z.ZodNumber>;
93
+ messageId: z.ZodOptional<z.ZodString>;
94
+ }, z.core.$loose>>;
95
+ }, z.core.$strip>;
96
+ /**
97
+ * Schema for getting events by userId
98
+ */
99
+ export declare const GetUserEventsByUserIdParamsSchema: z.ZodObject<{
100
+ userId: z.ZodString;
101
+ limit: z.ZodOptional<z.ZodNumber>;
102
+ }, z.core.$strip>;
103
+ export declare const GetUserEventsByUserIdResponseSchema: z.ZodObject<{
104
+ events: z.ZodArray<z.ZodObject<{
105
+ _id: z.ZodOptional<z.ZodString>;
106
+ eventType: z.ZodOptional<z.ZodString>;
107
+ eventName: z.ZodOptional<z.ZodString>;
108
+ email: z.ZodOptional<z.ZodEmail>;
109
+ userId: z.ZodOptional<z.ZodString>;
110
+ createdAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
111
+ dataFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
112
+ campaignId: z.ZodOptional<z.ZodNumber>;
113
+ templateId: z.ZodOptional<z.ZodNumber>;
114
+ messageId: z.ZodOptional<z.ZodString>;
115
+ }, z.core.$loose>>;
116
+ }, z.core.$strip>;
117
+ export type BulkEvent = z.infer<typeof BulkEventSchema>;
118
+ export type FailedEventUpdates = z.infer<typeof FailedEventUpdatesSchema>;
119
+ export type BulkTrackResponse = z.infer<typeof BulkTrackResponseSchema>;
120
+ export type GetUserEventsByEmailParams = z.infer<typeof GetUserEventsByEmailParamsSchema>;
121
+ export type GetUserEventsByEmailResponse = z.infer<typeof GetUserEventsByEmailResponseSchema>;
122
+ export type GetUserEventsByUserIdParams = z.infer<typeof GetUserEventsByUserIdParamsSchema>;
123
+ export type GetUserEventsByUserIdResponse = z.infer<typeof GetUserEventsByUserIdResponseSchema>;
124
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,2BAA2B;AAC3B,eAAO,MAAM,sBAAsB;;;;;;;;;;iBAGlC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,kBAAkB;AAClB,eAAO,MAAM,2BAA2B;;;;;;;;;;;iBAStC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,oEAAoE;AACpE,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAad,CAAC;AAEjB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAG5D,eAAO,MAAM,eAAe;;;;;;;;;;iBAiCzB,CAAC;AAGJ,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;iBAUlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gCAAgC;;;iBAQ3C,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;iBAE7C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;iBAQ5C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;iBAE9C,CAAC;AAGH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { z } from "zod";
2
+ import { FlexibleTimestampSchema, UnixTimestampSchema } from "./common.js";
3
+ /**
4
+ * Event tracking schemas and types
5
+ */
6
+ /** Base event schema without validation */
7
+ const BaseTrackEventSchema = z.object({
8
+ email: z.email().optional(),
9
+ userId: z.string().min(1).optional(),
10
+ eventName: z.string().min(1),
11
+ id: z.string().min(1).max(512).optional(),
12
+ dataFields: z.record(z.string(), z.any()).optional(),
13
+ campaignId: z.number().int().positive().optional(),
14
+ templateId: z.number().int().positive().optional(),
15
+ createdAt: UnixTimestampSchema.optional(), // API expects Unix timestamp
16
+ createNewFields: z.boolean().optional(),
17
+ });
18
+ /** Single event (track) */
19
+ export const TrackEventParamsSchema = BaseTrackEventSchema.refine((v) => !!(v.email || v.userId), { message: "Provide either email or userId." });
20
+ /** Bulk events */
21
+ export const TrackBulkEventsParamsSchema = z.object({
22
+ events: z
23
+ .array(BaseTrackEventSchema.omit({ createNewFields: true }) // safer: not used by bulk
24
+ .refine((v) => !!(v.email || v.userId), {
25
+ message: "Provide either email or userId.",
26
+ }))
27
+ .min(1),
28
+ });
29
+ /** Loose reader schema for GET /events/... (allows extra fields) */
30
+ export const EventRecordSchema = z
31
+ .object({
32
+ _id: z.string().optional(),
33
+ eventType: z.string().optional(), // system events
34
+ eventName: z.string().optional(), // custom events
35
+ email: z.email().optional(),
36
+ userId: z.string().min(1).optional(),
37
+ createdAt: FlexibleTimestampSchema.optional(), // API returns various formats
38
+ dataFields: z.record(z.string(), z.any()).optional(),
39
+ campaignId: z.number().int().optional(),
40
+ templateId: z.number().int().optional(),
41
+ messageId: z.string().optional(),
42
+ })
43
+ .passthrough();
44
+ // Bulk event tracking schema
45
+ export const BulkEventSchema = z
46
+ .object({
47
+ eventName: z.string().describe("Name of event"),
48
+ email: z.email().optional().describe("User email address"),
49
+ userId: z.string().optional().describe("User ID (alternative to email)"),
50
+ dataFields: z
51
+ .record(z.string(), z.any())
52
+ .optional()
53
+ .describe("Event data fields"),
54
+ campaignId: z.number().optional().describe("Campaign tied to conversion"),
55
+ templateId: z.number().optional().describe("Template id"),
56
+ id: z
57
+ .string()
58
+ .optional()
59
+ .describe("Optional event id. If an event exists with that id, the event will be updated"),
60
+ createdAt: z
61
+ .number()
62
+ .optional()
63
+ .describe("Time event happened. Set to the time event was received if unspecified. Expects a unix timestamp"),
64
+ createNewFields: z
65
+ .boolean()
66
+ .optional()
67
+ .describe("Whether new fields should be ingested and added to the schema. Defaults to project's setting"),
68
+ })
69
+ .refine((data) => data.email || data.userId, "Either email or userId must be provided");
70
+ // Response schemas based on API specification
71
+ export const FailedEventUpdatesSchema = z.object({
72
+ invalidEmails: z.array(z.string()).optional(),
73
+ invalidUserIds: z.array(z.string()).optional(),
74
+ failedEmails: z.array(z.string()).optional(),
75
+ failedUserIds: z.array(z.string()).optional(),
76
+ });
77
+ export const BulkTrackResponseSchema = z.object({
78
+ successCount: z.number(),
79
+ failCount: z.number(),
80
+ createdFields: z.array(z.string()).optional(),
81
+ filteredOutFields: z.array(z.string()).optional(),
82
+ disallowedEventNames: z.array(z.string()).optional(),
83
+ failedUpdates: FailedEventUpdatesSchema.optional(),
84
+ // Deprecated fields but still present
85
+ invalidEmails: z.array(z.string()).optional(),
86
+ invalidUserIds: z.array(z.string()).optional(),
87
+ });
88
+ /**
89
+ * Schema for getting events by email
90
+ */
91
+ export const GetUserEventsByEmailParamsSchema = z.object({
92
+ email: z.email().describe("User email address"),
93
+ limit: z
94
+ .number()
95
+ .min(1)
96
+ .max(1000)
97
+ .optional()
98
+ .describe("Maximum number of events to return"),
99
+ });
100
+ export const GetUserEventsByEmailResponseSchema = z.object({
101
+ events: z.array(EventRecordSchema),
102
+ });
103
+ /**
104
+ * Schema for getting events by userId
105
+ */
106
+ export const GetUserEventsByUserIdParamsSchema = z.object({
107
+ userId: z.string().min(1).describe("User ID to get events for"),
108
+ limit: z
109
+ .number()
110
+ .min(1)
111
+ .max(1000)
112
+ .optional()
113
+ .describe("Maximum number of events to return (default: 20)"),
114
+ });
115
+ export const GetUserEventsByUserIdResponseSchema = z.object({
116
+ events: z.array(EventRecordSchema),
117
+ });
118
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE3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AAC,oCAAoC,CAAC;CAClD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC;CACnC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC/D,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,IAAI,CAAC;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,kDAAkD,CAAC;CAChE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1D,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC;CACnC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Experiment metrics schemas and types
4
+ */
5
+ export declare const ExperimentMetricsResponseSchema: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>;
6
+ export declare const GetExperimentMetricsParamsSchema: z.ZodObject<{
7
+ experimentId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
8
+ campaignId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
9
+ startDateTime: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodString]>, z.ZodTransform<string, string | Date>>>;
10
+ endDateTime: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodString]>, z.ZodTransform<string, string | Date>>>;
11
+ }, z.core.$strip>;
12
+ export type ExperimentMetricsResponse = z.infer<typeof ExperimentMetricsResponseSchema>;
13
+ export type GetExperimentMetricsParams = z.infer<typeof GetExperimentMetricsParamsSchema>;
14
+ //# sourceMappingURL=experiments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experiments.d.ts","sourceRoot":"","sources":["../../src/types/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AAGH,eAAO,MAAM,+BAA+B,gDAEC,CAAC;AAE9C,eAAO,MAAM,gCAAgC;;;;;iBAmBW,CAAC;AAGzD,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ import { IterableDateTimeSchema } from "./common.js";
3
+ /**
4
+ * Experiment metrics schemas and types
5
+ */
6
+ // The API returns CSV data which we parse into objects
7
+ export const ExperimentMetricsResponseSchema = z
8
+ .array(z.record(z.string(), z.any()))
9
+ .describe("Parsed experiment metrics data");
10
+ export const GetExperimentMetricsParamsSchema = z
11
+ .object({
12
+ experimentId: z
13
+ .array(z.number())
14
+ .optional()
15
+ .describe("Experiment IDs to export (can specify multiple)"),
16
+ campaignId: z
17
+ .array(z.number())
18
+ .optional()
19
+ .describe("Campaign IDs whose experiments to export (can specify multiple)"),
20
+ startDateTime: IterableDateTimeSchema.optional().describe("Export starting from (ISO 8601 format)"),
21
+ endDateTime: IterableDateTimeSchema.optional().describe("Export ending at (ISO 8601 format)"),
22
+ })
23
+ .describe("Parameters for getting experiment metrics");
24
+ //# sourceMappingURL=experiments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experiments.js","sourceRoot":"","sources":["../../src/types/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD;;GAEG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC;KAC7C,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;KACpC,QAAQ,CAAC,gCAAgC,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,YAAY,EAAE,CAAC;SACZ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,iDAAiD,CAAC;IAC9D,UAAU,EAAE,CAAC;SACV,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,iEAAiE,CAClE;IACH,aAAa,EAAE,sBAAsB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACvD,wCAAwC,CACzC;IACD,WAAW,EAAE,sBAAsB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACrD,oCAAoC,CACrC;CACF,CAAC;KACD,QAAQ,CAAC,2CAA2C,CAAC,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Export operation schemas and types
4
+ */
5
+ export declare const GetExportJobsParamsSchema: z.ZodObject<{
6
+ jobState: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export declare const GetExportFilesParamsSchema: z.ZodObject<{
9
+ jobId: z.ZodNumber;
10
+ startAfter: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ export declare const StartExportJobParamsSchema: z.ZodObject<{
13
+ dataTypeName: z.ZodEnum<{
14
+ emailSend: "emailSend";
15
+ emailOpen: "emailOpen";
16
+ emailClick: "emailClick";
17
+ hostedUnsubscribeClick: "hostedUnsubscribeClick";
18
+ emailComplaint: "emailComplaint";
19
+ emailBounce: "emailBounce";
20
+ emailSendSkip: "emailSendSkip";
21
+ pushSend: "pushSend";
22
+ pushOpen: "pushOpen";
23
+ pushUninstall: "pushUninstall";
24
+ pushBounce: "pushBounce";
25
+ pushSendSkip: "pushSendSkip";
26
+ inAppSend: "inAppSend";
27
+ inAppOpen: "inAppOpen";
28
+ inAppClick: "inAppClick";
29
+ inAppClose: "inAppClose";
30
+ inAppDelete: "inAppDelete";
31
+ inAppDelivery: "inAppDelivery";
32
+ inAppSendSkip: "inAppSendSkip";
33
+ inAppRecall: "inAppRecall";
34
+ inboxSession: "inboxSession";
35
+ inboxMessageImpression: "inboxMessageImpression";
36
+ smsSend: "smsSend";
37
+ smsBounce: "smsBounce";
38
+ smsClick: "smsClick";
39
+ smsReceived: "smsReceived";
40
+ smsSendSkip: "smsSendSkip";
41
+ webPushSend: "webPushSend";
42
+ webPushClick: "webPushClick";
43
+ webPushSendSkip: "webPushSendSkip";
44
+ emailSubscribe: "emailSubscribe";
45
+ emailUnSubscribe: "emailUnSubscribe";
46
+ purchase: "purchase";
47
+ customEvent: "customEvent";
48
+ user: "user";
49
+ smsUsageInfo: "smsUsageInfo";
50
+ embeddedSend: "embeddedSend";
51
+ embeddedSendSkip: "embeddedSendSkip";
52
+ embeddedClick: "embeddedClick";
53
+ embeddedReceived: "embeddedReceived";
54
+ embeddedImpression: "embeddedImpression";
55
+ embeddedSession: "embeddedSession";
56
+ anonSession: "anonSession";
57
+ journeyExit: "journeyExit";
58
+ whatsAppBounce: "whatsAppBounce";
59
+ whatsAppClick: "whatsAppClick";
60
+ whatsAppReceived: "whatsAppReceived";
61
+ whatsAppSeen: "whatsAppSeen";
62
+ whatsAppSend: "whatsAppSend";
63
+ whatsAppSendSkip: "whatsAppSendSkip";
64
+ whatsAppUsageInfo: "whatsAppUsageInfo";
65
+ }>;
66
+ outputFormat: z.ZodEnum<{
67
+ "text/csv": "text/csv";
68
+ "application/x-json-stream": "application/x-json-stream";
69
+ }>;
70
+ startDateTime: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodString]>, z.ZodTransform<string, string | Date>>>;
71
+ endDateTime: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodDate, z.ZodString]>, z.ZodTransform<string, string | Date>>>;
72
+ campaignId: z.ZodOptional<z.ZodNumber>;
73
+ delimiter: z.ZodOptional<z.ZodString>;
74
+ omitFields: z.ZodOptional<z.ZodString>;
75
+ onlyFields: z.ZodOptional<z.ZodString>;
76
+ }, z.core.$strip>;
77
+ export declare const CancelExportJobParamsSchema: z.ZodObject<{
78
+ jobId: z.ZodNumber;
79
+ }, z.core.$strip>;
80
+ export type GetExportJobsParams = z.infer<typeof GetExportJobsParamsSchema>;
81
+ export type GetExportFilesParams = z.infer<typeof GetExportFilesParamsSchema>;
82
+ export type StartExportJobParams = z.infer<typeof StartExportJobParamsSchema>;
83
+ export type CancelExportJobParams = z.infer<typeof CancelExportJobParamsSchema>;
84
+ export interface ExportJob {
85
+ id: number;
86
+ dataTypeName: string;
87
+ jobState: "enqueued" | "queued" | "running" | "completed" | "failed" | "cancelled" | "cancelling";
88
+ scheduledStartTime?: string;
89
+ endTime?: string;
90
+ bytesExported?: number;
91
+ }
92
+ export declare const StartExportJobResponseSchema: z.ZodObject<{
93
+ jobId: z.ZodNumber;
94
+ message: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>;
96
+ export type StartExportJobResponse = z.infer<typeof StartExportJobResponseSchema>;
97
+ export interface GetExportJobsResponse {
98
+ jobs: ExportJob[];
99
+ }
100
+ /**
101
+ * Individual export file with download URL
102
+ * Each file is up to 10MB in size
103
+ */
104
+ export interface ExportFileAndUrl {
105
+ file: string;
106
+ url: string;
107
+ }
108
+ /**
109
+ * Response from getExportFiles containing job status and file download URLs
110
+ * Files are added to the list as the export job runs
111
+ */
112
+ export interface GetExportFilesResponse {
113
+ exportTruncated: boolean;
114
+ files: ExportFileAndUrl[];
115
+ jobId: number;
116
+ jobState: "Enqueued" | "Running" | "Completed" | "Failed";
117
+ }
118
+ export interface CancelExportJobResponse {
119
+ [key: string]: unknown;
120
+ }
121
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/types/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AAEH,eAAO,MAAM,yBAAyB;;iBAOpC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;iBAUrC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgFrC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;iBAMtC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EACJ,UAAU,GACV,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,GACR,WAAW,GACX,YAAY,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;CAC3D;AAED,MAAM,WAAW,uBAAuB;IAGtC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
@@ -0,0 +1,105 @@
1
+ import { z } from "zod";
2
+ import { IterableDateTimeSchema } from "./common.js";
3
+ /**
4
+ * Export operation schemas and types
5
+ */
6
+ export const GetExportJobsParamsSchema = z.object({
7
+ jobState: z
8
+ .string()
9
+ .optional()
10
+ .describe("Filter results to only include jobs in the specified state (enqueued, queued, running, completed, failed, cancelled, cancelling)"),
11
+ });
12
+ export const GetExportFilesParamsSchema = z.object({
13
+ jobId: z
14
+ .number()
15
+ .describe("The ID of the export job (returned from startExportJob)"),
16
+ startAfter: z
17
+ .string()
18
+ .optional()
19
+ .describe("Skip file names up to and including this value. Use for paginating over the files in the export (e.g., 'file-1679086247925.csv')"),
20
+ });
21
+ export const StartExportJobParamsSchema = z.object({
22
+ dataTypeName: z
23
+ .enum([
24
+ "emailSend",
25
+ "emailOpen",
26
+ "emailClick",
27
+ "hostedUnsubscribeClick",
28
+ "emailComplaint",
29
+ "emailBounce",
30
+ "emailSendSkip",
31
+ "pushSend",
32
+ "pushOpen",
33
+ "pushUninstall",
34
+ "pushBounce",
35
+ "pushSendSkip",
36
+ "inAppSend",
37
+ "inAppOpen",
38
+ "inAppClick",
39
+ "inAppClose",
40
+ "inAppDelete",
41
+ "inAppDelivery",
42
+ "inAppSendSkip",
43
+ "inAppRecall",
44
+ "inboxSession",
45
+ "inboxMessageImpression",
46
+ "smsSend",
47
+ "smsBounce",
48
+ "smsClick",
49
+ "smsReceived",
50
+ "smsSendSkip",
51
+ "webPushSend",
52
+ "webPushClick",
53
+ "webPushSendSkip",
54
+ "emailSubscribe",
55
+ "emailUnSubscribe",
56
+ "purchase",
57
+ "customEvent",
58
+ "user",
59
+ "smsUsageInfo",
60
+ "embeddedSend",
61
+ "embeddedSendSkip",
62
+ "embeddedClick",
63
+ "embeddedReceived",
64
+ "embeddedImpression",
65
+ "embeddedSession",
66
+ "anonSession",
67
+ "journeyExit",
68
+ "whatsAppBounce",
69
+ "whatsAppClick",
70
+ "whatsAppReceived",
71
+ "whatsAppSeen",
72
+ "whatsAppSend",
73
+ "whatsAppSendSkip",
74
+ "whatsAppUsageInfo",
75
+ ])
76
+ .describe("Data type name to export (e.g., 'user' for user data, 'emailSend' for email send events)"),
77
+ outputFormat: z
78
+ .enum(["text/csv", "application/x-json-stream"])
79
+ .describe("Output format"),
80
+ startDateTime: IterableDateTimeSchema.optional().describe("Export events occurring or users updated after date and time inclusive"),
81
+ endDateTime: IterableDateTimeSchema.optional().describe("Export events occurring or users updated before date and time exclusive"),
82
+ campaignId: z
83
+ .number()
84
+ .optional()
85
+ .describe("Only export data from this campaign"),
86
+ delimiter: z.string().optional().describe("CSV file delimiter"),
87
+ omitFields: z
88
+ .string()
89
+ .optional()
90
+ .describe("Fields to omit from the export (comma separated)"),
91
+ onlyFields: z
92
+ .string()
93
+ .optional()
94
+ .describe("Only include these fields in the export (comma separated)"),
95
+ });
96
+ export const CancelExportJobParamsSchema = z.object({
97
+ jobId: z
98
+ .number()
99
+ .describe("The ID of the export job to cancel (returned from startExportJob)"),
100
+ });
101
+ export const StartExportJobResponseSchema = z.object({
102
+ jobId: z.number(),
103
+ message: z.string().optional(),
104
+ });
105
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","sourceRoot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cAAc;QACd,cAAc;QACd,kBAAkB;QAClB,mBAAmB;KACpB,CAAC;SACD,QAAQ,CACP,0FAA0F,CAC3F;IACH,YAAY,EAAE,CAAC;SACZ,IAAI,CAAC,CAAC,UAAU,EAAE,2BAA2B,CAAC,CAAC;SAC/C,QAAQ,CAAC,eAAe,CAAC;IAC5B,aAAa,EAAE,sBAAsB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACvD,wEAAwE,CACzE;IACD,WAAW,EAAE,sBAAsB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACrD,yEAAyE,CAC1E;IACD,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,qCAAqC,CAAC;IAClD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAC/D,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,kDAAkD,CAAC;IAC/D,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,2DAA2D,CAAC;CACzE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,CACP,mEAAmE,CACpE;CACJ,CAAC,CAAC;AAsBH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { z } from "zod";
2
+ import { SortParam } from "./common.js";
3
+ /**
4
+ * Journey (workflow) management schemas and types
5
+ */
6
+ export declare const JourneySchema: z.ZodObject<{
7
+ id: z.ZodNumber;
8
+ name: z.ZodString;
9
+ description: z.ZodOptional<z.ZodString>;
10
+ enabled: z.ZodBoolean;
11
+ isArchived: z.ZodBoolean;
12
+ journeyType: z.ZodString;
13
+ lifetimeLimit: z.ZodOptional<z.ZodNumber>;
14
+ simultaneousLimit: z.ZodOptional<z.ZodNumber>;
15
+ startTileId: z.ZodOptional<z.ZodNumber>;
16
+ triggerEventNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
17
+ createdAt: z.ZodNumber;
18
+ updatedAt: z.ZodNumber;
19
+ creatorUserId: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ export declare const GetJourneysResponseSchema: z.ZodObject<{
22
+ journeys: z.ZodArray<z.ZodObject<{
23
+ id: z.ZodNumber;
24
+ name: z.ZodString;
25
+ description: z.ZodOptional<z.ZodString>;
26
+ enabled: z.ZodBoolean;
27
+ isArchived: z.ZodBoolean;
28
+ journeyType: z.ZodString;
29
+ lifetimeLimit: z.ZodOptional<z.ZodNumber>;
30
+ simultaneousLimit: z.ZodOptional<z.ZodNumber>;
31
+ startTileId: z.ZodOptional<z.ZodNumber>;
32
+ triggerEventNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
+ createdAt: z.ZodNumber;
34
+ updatedAt: z.ZodNumber;
35
+ creatorUserId: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>>;
37
+ totalJourneysCount: z.ZodNumber;
38
+ nextPageUrl: z.ZodOptional<z.ZodString>;
39
+ previousPageUrl: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ export type Journey = z.infer<typeof JourneySchema>;
42
+ export type GetJourneysResponse = z.infer<typeof GetJourneysResponseSchema>;
43
+ declare const JOURNEY_SORT_FIELDS: readonly ["id", "name", "createdAt", "updatedAt"];
44
+ export declare const GetJourneysParamsSchema: z.ZodObject<{
45
+ page: z.ZodOptional<z.ZodNumber>;
46
+ pageSize: z.ZodOptional<z.ZodNumber>;
47
+ sort: z.ZodOptional<z.ZodObject<{
48
+ field: z.ZodEnum<{
49
+ createdAt: "createdAt";
50
+ updatedAt: "updatedAt";
51
+ id: "id";
52
+ name: "name";
53
+ }>;
54
+ direction: z.ZodOptional<z.ZodEnum<{
55
+ asc: "asc";
56
+ desc: "desc";
57
+ }>>;
58
+ }, z.core.$strip>>;
59
+ state: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
+ }, z.core.$strip>;
61
+ export type JourneySortParam = SortParam<(typeof JOURNEY_SORT_FIELDS)[number]>;
62
+ export declare const TriggerJourneyParamsSchema: z.ZodObject<{
63
+ workflowId: z.ZodNumber;
64
+ email: z.ZodOptional<z.ZodEmail>;
65
+ userId: z.ZodOptional<z.ZodString>;
66
+ listId: z.ZodOptional<z.ZodNumber>;
67
+ dataFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
68
+ }, z.core.$strip>;
69
+ export type GetJourneysParams = z.infer<typeof GetJourneysParamsSchema>;
70
+ export type TriggerJourneyParams = z.infer<typeof TriggerJourneyParamsSchema>;
71
+ export {};
72
+ //# sourceMappingURL=journeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journeys.d.ts","sourceRoot":"","sources":["../../src/types/journeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,SAAS,EAEV,MAAM,aAAa,CAAC;AAErB;;GAEG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;iBAcxB,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;iBAKpC,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAG5E,QAAA,MAAM,mBAAmB,mDAAoD,CAAC;AAG9E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;iBAyBjC,CAAC;AAEJ,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE/E,eAAO,MAAM,0BAA0B;;;;;;iBAYrC,CAAC;AAGH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}