@hermeticacomms/sdk-node 0.0.0-stage → 0.4.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.
Files changed (73) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +12 -2
  3. package/dist/contracts/analytics.d.ts +405 -0
  4. package/dist/contracts/analytics.js +77 -0
  5. package/dist/contracts/auth.d.ts +363 -0
  6. package/dist/contracts/auth.js +130 -0
  7. package/dist/contracts/billing.d.ts +143 -0
  8. package/dist/contracts/billing.js +32 -0
  9. package/dist/contracts/campaigns.d.ts +915 -0
  10. package/dist/contracts/campaigns.js +276 -0
  11. package/dist/contracts/common.d.ts +57 -0
  12. package/dist/contracts/common.js +35 -0
  13. package/dist/contracts/connectors.d.ts +179 -0
  14. package/dist/contracts/connectors.js +46 -0
  15. package/dist/contracts/consent.d.ts +628 -0
  16. package/dist/contracts/consent.js +194 -0
  17. package/dist/contracts/content-blocks.d.ts +165 -0
  18. package/dist/contracts/content-blocks.js +62 -0
  19. package/dist/contracts/content-library.d.ts +347 -0
  20. package/dist/contracts/content-library.js +52 -0
  21. package/dist/contracts/content.d.ts +955 -0
  22. package/dist/contracts/content.js +194 -0
  23. package/dist/contracts/delivery.d.ts +602 -0
  24. package/dist/contracts/delivery.js +220 -0
  25. package/dist/contracts/events.d.ts +514 -0
  26. package/dist/contracts/events.js +180 -0
  27. package/dist/contracts/experiments.d.ts +378 -0
  28. package/dist/contracts/experiments.js +140 -0
  29. package/dist/contracts/identity.d.ts +761 -0
  30. package/dist/contracts/identity.js +226 -0
  31. package/dist/contracts/index.d.ts +15 -0
  32. package/dist/contracts/index.js +15 -0
  33. package/dist/contracts/integrations.d.ts +445 -0
  34. package/dist/contracts/integrations.js +139 -0
  35. package/dist/contracts/leads.d.ts +733 -0
  36. package/dist/contracts/leads.js +125 -0
  37. package/dist/contracts/metrics.d.ts +465 -0
  38. package/dist/contracts/metrics.js +96 -0
  39. package/dist/contracts/outbound.d.ts +15535 -0
  40. package/dist/contracts/outbound.js +432 -0
  41. package/dist/contracts/pickers.d.ts +12 -0
  42. package/dist/contracts/pickers.js +20 -0
  43. package/dist/contracts/platform-admin.d.ts +244 -0
  44. package/dist/contracts/platform-admin.js +98 -0
  45. package/dist/contracts/postcards.d.ts +79 -0
  46. package/dist/contracts/postcards.js +29 -0
  47. package/dist/contracts/push.d.ts +530 -0
  48. package/dist/contracts/push.js +102 -0
  49. package/dist/contracts/rcs.d.ts +39 -0
  50. package/dist/contracts/rcs.js +19 -0
  51. package/dist/contracts/segments.d.ts +3187 -0
  52. package/dist/contracts/segments.js +421 -0
  53. package/dist/contracts/workflow-nodes.d.ts +2130 -0
  54. package/dist/contracts/workflow-nodes.js +346 -0
  55. package/dist/contracts/workflows.d.ts +46811 -0
  56. package/dist/contracts/workflows.js +350 -0
  57. package/dist/contracts/x10-platform.d.ts +2603 -0
  58. package/dist/contracts/x10-platform.js +129 -0
  59. package/dist/http.d.ts +30 -0
  60. package/dist/http.js +65 -0
  61. package/dist/index.d.ts +11631 -0
  62. package/dist/index.js +63 -0
  63. package/dist/platform.d.ts +163 -0
  64. package/dist/platform.js +40 -0
  65. package/dist/resources.d.ts +1338 -0
  66. package/dist/resources.js +56 -0
  67. package/dist/signature.d.ts +5 -0
  68. package/dist/signature.js +19 -0
  69. package/dist/x10.d.ts +1608 -0
  70. package/dist/x10.js +66 -0
  71. package/dist/z10.d.ts +256 -0
  72. package/dist/z10.js +46 -0
  73. package/package.json +40 -4
@@ -0,0 +1,180 @@
1
+ import { z } from 'zod';
2
+ import { AppSlug, Id, PageQuery, Timestamp, pageResult } from './common.js';
3
+ export const STANDARD_EVENTS = [
4
+ 'page_view', 'page_exit', 'form_view', 'form_submit', 'product_view', 'search',
5
+ 'add_to_cart', 'remove_from_cart', 'checkout_started', 'purchase', 'identify',
6
+ ];
7
+ export const EventSource = z.enum(['browser', 'server', 'integration', 'system']);
8
+ /** The only `$` names a client may send: reported by the mobile/web SDKs (push opens, geofences). Everything else with `$` is reserved for the system. */
9
+ export const CLIENT_RESERVED_EVENTS = ['$opened_push', '$geofence_enter', '$geofence_exit', '$geofence_dwell'];
10
+ const EventName = z.string().min(1).max(128).refine((n) => !n.startsWith('$') || CLIENT_RESERVED_EVENTS.includes(n), 'names must not start with $');
11
+ export const EventContext = z.object({
12
+ page: z.object({ url: z.string().max(2048).optional(), referrer: z.string().max(2048).optional(), title: z.string().max(512).optional() }).optional(),
13
+ userAgent: z.string().max(512).optional(),
14
+ ip: z.string().max(64).optional(),
15
+ utm: z.record(z.string().max(64), z.string().max(256)).optional(),
16
+ });
17
+ export const EventProfile = z.object({ email: z.string().optional(), phone: z.string().optional(), externalId: z.string().max(256).optional() });
18
+ const EventLocation = z.object({
19
+ city: z.string().max(128).optional(), region: z.string().max(128).optional(), country: z.string().max(64).optional(), zip: z.string().max(32).optional(),
20
+ address1: z.string().max(256).optional(), latitude: z.number().min(-90).max(90).optional(), longitude: z.number().min(-180).max(180).optional(), timezone: z.string().max(64).optional(),
21
+ });
22
+ /** The event's person: identifiers plus profile data written inline (names, location, custom properties). */
23
+ export const EventProfileData = EventProfile.extend({
24
+ firstName: z.string().max(128).optional(), lastName: z.string().max(128).optional(), locale: z.string().max(32).optional(),
25
+ location: EventLocation.optional(),
26
+ /** Custom profile properties, stored as profile attributes. */
27
+ attributes: z.record(z.string().max(128), z.unknown()).optional(),
28
+ });
29
+ export const IngestEvent = z.object({
30
+ name: EventName,
31
+ /** Optional product dimension: journey event triggers and segment event conditions can require it. */
32
+ app: AppSlug.optional(),
33
+ occurredAt: Timestamp.optional(),
34
+ properties: z.record(z.string().max(128), z.unknown()).optional(),
35
+ /** Minor currency units (cents). */
36
+ value: z.number().int().nonnegative().optional(),
37
+ /** Decimal value in major units (9.99), the alternative to `value`; stored in the currency's minor units. */
38
+ amount: z.number().nonnegative().max(1e12).optional(),
39
+ currency: z.string().length(3).optional(),
40
+ dedupeKey: z.string().min(1).max(256).optional(),
41
+ profile: EventProfileData.optional(),
42
+ /** Match the person on this key instead: email, phone, externalId, or a custom field declared unique. */
43
+ correlationKey: z.string().min(1).max(64).optional(),
44
+ correlationValue: z.union([z.string().min(1).max(256), z.number()]).optional(),
45
+ anonymousId: z.string().min(1).max(128).optional(),
46
+ context: EventContext.optional(),
47
+ });
48
+ export const IngestEventChecked = IngestEvent
49
+ .refine((e) => e.value === undefined || e.amount === undefined, { message: 'Send value (cents) or amount (decimal), not both', path: ['amount'] })
50
+ .refine((e) => (e.correlationKey === undefined) === (e.correlationValue === undefined), { message: 'correlationKey and correlationValue go together', path: ['correlationKey'] });
51
+ /** Batch bodies keep items opaque so one bad event is rejected individually, not the whole request. */
52
+ export const BatchConsent = z.object({ analytics: z.boolean().optional(), marketing: z.boolean().optional() });
53
+ export const IngestBatchBody = z.object({ events: z.array(z.unknown()).min(1).max(1000), consent: BatchConsent.optional() });
54
+ export const IngestResult = z.object({
55
+ accepted: z.number().int(),
56
+ duplicates: z.number().int(),
57
+ rejected: z.array(z.object({ index: z.number().int(), reason: z.string() })),
58
+ });
59
+ export const IdentifyBody = z.object({
60
+ anonymousId: z.string().min(1).max(128),
61
+ identifiers: EventProfile,
62
+ traits: z.record(z.string().max(128), z.unknown()).optional(),
63
+ consent: BatchConsent.optional(),
64
+ /** Signed identify: hex HMAC-SHA256 of the identity (externalId, else email, else phone) with the site's identity secret, made on your server. */
65
+ signature: z.string().regex(/^[0-9a-f]{64}$/).optional(),
66
+ });
67
+ export const IdentifyResult = z.object({ profileId: Id, created: z.boolean() });
68
+ export const EventRecord = z.object({
69
+ id: Id,
70
+ name: z.string(),
71
+ profileId: Id.nullable(),
72
+ anonymousId: z.string().nullable(),
73
+ occurredAt: Timestamp,
74
+ source: EventSource,
75
+ properties: z.record(z.string(), z.unknown()),
76
+ value: z.number().int().nullable(),
77
+ currency: z.string().nullable(),
78
+ /** With `include=metric`: the event's definition. */
79
+ metric: z.object({ name: z.string(), category: z.string(), goal: z.boolean() }).nullable().optional(),
80
+ /** With `include=profile`: who did it. */
81
+ profile: z.object({ id: Id, email: z.string().nullable(), firstName: z.string().nullable(), lastName: z.string().nullable() }).nullable().optional(),
82
+ });
83
+ export const ProfileEventsQuery = PageQuery.extend({ name: z.string().optional(), goal: z.enum(['true', 'false']).transform((v) => v === 'true').optional() });
84
+ export const EventPage = pageResult(EventRecord);
85
+ export const EventDefinitionRecord = z.object({
86
+ id: Id,
87
+ name: z.string(),
88
+ category: z.enum(['standard', 'custom']),
89
+ schema: z.record(z.string(), z.string()).nullable(),
90
+ enforce: z.boolean(),
91
+ /** Marks conversion-style events (purchases, form conversions) for the goal view. */
92
+ goal: z.boolean(),
93
+ firstSeenAt: Timestamp,
94
+ lastSeenAt: Timestamp,
95
+ });
96
+ export const EventDefinitionList = z.object({ items: z.array(EventDefinitionRecord) });
97
+ export const EventPropertyType = z.enum(['string', 'number', 'boolean', 'object', 'array']);
98
+ export const EventDefinitionName = z.object({ name: z.string().min(1).max(128) });
99
+ export const EventPropertyParams = EventDefinitionName.extend({ prop: z.string().min(1).max(128) });
100
+ export const CreateEventDefinition = z.object({ name: z.string().trim().min(1).max(128), schema: z.record(z.string().max(128), EventPropertyType).optional() });
101
+ export const SetEventProperty = z.object({ type: EventPropertyType });
102
+ export const UpdateEventDefinition = z.object({
103
+ schema: z.record(z.string().max(128), z.enum(['string', 'number', 'boolean', 'object', 'array'])).nullable().optional(),
104
+ enforce: z.boolean().optional(),
105
+ goal: z.boolean().optional(),
106
+ });
107
+ /** Segment/RudderStack-compatible single-call payload (`/ingest/v1/segment`). */
108
+ export const SegmentCall = z.object({
109
+ type: z.enum(['track', 'identify', 'page', 'screen']),
110
+ event: z.string().max(128).optional(),
111
+ name: z.string().max(128).optional(),
112
+ userId: z.string().max(256).nullish(),
113
+ anonymousId: z.string().max(128).nullish(),
114
+ messageId: z.string().max(256).optional(),
115
+ timestamp: z.string().optional(),
116
+ properties: z.record(z.string().max(128), z.unknown()).optional(),
117
+ traits: z.record(z.string().max(128), z.unknown()).optional(),
118
+ context: z.object({ traits: z.record(z.string(), z.unknown()).optional(), userAgent: z.string().optional(), ip: z.string().optional(), page: z.record(z.string(), z.unknown()).optional() }).loose().optional(),
119
+ consent: BatchConsent.optional(),
120
+ });
121
+ export const CreateSiteConfig = z.object({
122
+ siteKeyId: z.string().min(1),
123
+ consentMode: z.enum(['open', 'require_consent']).default('open'),
124
+ botFilter: z.boolean().default(true),
125
+ domains: z.array(z.string()).default([]),
126
+ trustBrowserRevenue: z.boolean().default(false),
127
+ retentionDays: z.number().int().positive().optional(),
128
+ });
129
+ export const SdkConsentMode = z.enum(['require-consent', 'opt-out', 'none']);
130
+ const CountryCode = z.string().regex(/^[A-Z]{2}$/, 'Two-letter country codes, for example FR');
131
+ /**
132
+ * Per-site browser SDK settings, served to the snippet by GET /ingest/v1/config (`remoteConfig: true`). Options passed in code still
133
+ * win. Defaults are the SDK's own defaults; consent mode, region rules and identify rules are also enforced at ingest.
134
+ */
135
+ export const SiteSdkSettings = z.object({
136
+ consentMode: SdkConsentMode.default('require-consent'),
137
+ /** First matching rule wins for a visitor from one of these countries (CDN country header); others use `consentMode`. */
138
+ regions: z.array(z.object({ countries: z.array(CountryCode).min(1).max(60), consentMode: SdkConsentMode })).max(20).default([]),
139
+ /** require-consent only: keep up to 50 pre-decision events in memory and send them once analytics is granted. */
140
+ bufferUntilConsent: z.boolean().default(false),
141
+ autoPageViews: z.boolean().default(true),
142
+ /** Automatic page views only on these paths: `/shop` (the page and below) or `/blog/*` (prefix). Empty = every page. */
143
+ pageViewRoutes: z.array(z.string().regex(/^\/[^\s?#]*$/, 'A path starting with /').max(200)).max(50).default([]),
144
+ stripQuery: z.boolean().default(false),
145
+ /** Query parameters kept in page URLs and referrers; every other one is dropped. Empty = keep all (unless stripQuery). */
146
+ allowParams: z.array(z.string().regex(/^[\w.[\]-]{1,64}$/)).max(50).default([]),
147
+ /** Which identifiers a browser identify may carry. A disallowed one is dropped by the SDK and refused by the server. */
148
+ identify: z.object({ email: z.boolean().default(true), phone: z.boolean().default(true), externalId: z.boolean().default(true) }).default({ email: true, phone: true, externalId: true }),
149
+ /** Signed identify: browser identify needs a `signature` from your server (POST /v1/sites/:id/identity-secret), and browser events carry no profile. */
150
+ requireSignedIdentify: z.boolean().default(false),
151
+ batchSize: z.number().int().min(1).max(50).default(20),
152
+ flushMs: z.number().int().min(250).max(60_000).default(2000),
153
+ maxQueue: z.number().int().min(10).max(1000).default(200),
154
+ autocapture: z.boolean().default(false),
155
+ trackVideo: z.boolean().default(false),
156
+ });
157
+ /** GET/PUT /v1/sites/:id/settings: the SDK settings plus the server-side ingest switches of the site. */
158
+ /** `retentionDays`: this site's events are deleted after this many days, null = the workspace's events retention (a site can only be stricter). */
159
+ const SiteRetentionDays = z.number().int().min(30).max(3650).nullable();
160
+ export const SiteSettingsDto = SiteSdkSettings.extend({ botFilter: z.boolean(), trustBrowserRevenue: z.boolean(), identitySecretSet: z.boolean(), retentionDays: SiteRetentionDays });
161
+ export const SiteSettingsBody = SiteSdkSettings.extend({ botFilter: z.boolean().default(true), trustBrowserRevenue: z.boolean().default(false), /** Left out: unchanged. */ retentionDays: SiteRetentionDays.optional() });
162
+ /** GET /ingest/v1/config: what the snippet applies; `consentMode` is already resolved for the visitor's region. */
163
+ export const SdkRemoteConfig = SiteSdkSettings.omit({ regions: true });
164
+ /** The identity secret, shown once; signing identities with it is done on the site's server, never in the browser. */
165
+ export const SiteIdentitySecret = z.object({ secret: z.string(), createdAt: z.string() });
166
+ /** POST /ingest/v1/test: each event checked as the batch endpoint would, nothing stored. */
167
+ export const IngestTestResult = z.object({
168
+ consent: z.object({ ok: z.boolean(), reason: z.string().optional(), consentMode: SdkConsentMode }),
169
+ items: z.array(z.object({ index: z.number().int(), name: z.string().nullable(), ok: z.boolean(), issues: z.array(z.string()) })),
170
+ });
171
+ /** Workspace-wide ingest settings: the server ingest switch and the custom field used as each person's primary key. */
172
+ export const EventSettingsDto = z.object({
173
+ serverIngestEnabled: z.boolean(),
174
+ /** A custom field declared unique; an event whose profile carries it in `attributes` is matched on it. */
175
+ primaryKeyAttribute: z.string().nullable(),
176
+ });
177
+ export const UpdateEventSettingsBody = z.object({
178
+ serverIngestEnabled: z.boolean().optional(),
179
+ primaryKeyAttribute: z.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/).nullable().optional(),
180
+ });
@@ -0,0 +1,378 @@
1
+ import { z } from 'zod';
2
+ export declare const ExperimentKind: z.ZodEnum<{
3
+ holdout: "holdout";
4
+ message_variant: "message_variant";
5
+ path_split: "path_split";
6
+ send_time: "send_time";
7
+ }>;
8
+ export declare const ExperimentMethod: z.ZodEnum<{
9
+ bayesian_beta: "bayesian_beta";
10
+ frequentist_ztest: "frequentist_ztest";
11
+ }>;
12
+ /** Opens are accepted but flagged unreliable (Apple MPP, prefetch). */
13
+ export declare const PrimaryMetric: z.ZodEnum<{
14
+ clicks: "clicks";
15
+ conversions: "conversions";
16
+ opens: "opens";
17
+ replies: "replies";
18
+ revenue: "revenue";
19
+ }>;
20
+ export type PrimaryMetric = z.infer<typeof PrimaryMetric>;
21
+ export declare const GuardrailMetric: z.ZodEnum<{
22
+ bounce: "bounce";
23
+ complaint: "complaint";
24
+ unsubscribe: "unsubscribe";
25
+ }>;
26
+ export type GuardrailMetric = z.infer<typeof GuardrailMetric>;
27
+ export declare const VariantWeight: z.ZodObject<{
28
+ key: z.ZodString;
29
+ weight: z.ZodNumber;
30
+ }, z.core.$strip>;
31
+ export type VariantWeight = z.infer<typeof VariantWeight>;
32
+ export declare const ExperimentMetricSpec: z.ZodObject<{
33
+ primary: z.ZodDefault<z.ZodEnum<{
34
+ clicks: "clicks";
35
+ conversions: "conversions";
36
+ opens: "opens";
37
+ replies: "replies";
38
+ revenue: "revenue";
39
+ }>>;
40
+ guardrails: z.ZodDefault<z.ZodArray<z.ZodObject<{
41
+ metric: z.ZodEnum<{
42
+ bounce: "bounce";
43
+ complaint: "complaint";
44
+ unsubscribe: "unsubscribe";
45
+ }>;
46
+ threshold: z.ZodNumber;
47
+ }, z.core.$strip>>>;
48
+ }, z.core.$strip>;
49
+ export type ExperimentMetricSpec = z.infer<typeof ExperimentMetricSpec>;
50
+ export declare const AutoSelect: z.ZodObject<{
51
+ enabled: z.ZodDefault<z.ZodBoolean>;
52
+ afterHours: z.ZodDefault<z.ZodNumber>;
53
+ pBest: z.ZodDefault<z.ZodNumber>;
54
+ stopAt: z.ZodOptional<z.ZodISODateTime>;
55
+ shift: z.ZodOptional<z.ZodBoolean>;
56
+ stopOnGuardrail: z.ZodOptional<z.ZodBoolean>;
57
+ }, z.core.$strip>;
58
+ export type AutoSelect = z.infer<typeof AutoSelect>;
59
+ export declare const CreateExperimentBody: z.ZodObject<{
60
+ name: z.ZodString;
61
+ kind: z.ZodDefault<z.ZodEnum<{
62
+ holdout: "holdout";
63
+ message_variant: "message_variant";
64
+ path_split: "path_split";
65
+ send_time: "send_time";
66
+ }>>;
67
+ scopeType: z.ZodEnum<{
68
+ campaign: "campaign";
69
+ form: "form";
70
+ workflow: "workflow";
71
+ workspace: "workspace";
72
+ }>;
73
+ scopeId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
74
+ key: z.ZodDefault<z.ZodString>;
75
+ variants: z.ZodArray<z.ZodObject<{
76
+ key: z.ZodString;
77
+ weight: z.ZodNumber;
78
+ }, z.core.$strip>>;
79
+ control: z.ZodOptional<z.ZodString>;
80
+ metric: z.ZodDefault<z.ZodObject<{
81
+ primary: z.ZodDefault<z.ZodEnum<{
82
+ clicks: "clicks";
83
+ conversions: "conversions";
84
+ opens: "opens";
85
+ replies: "replies";
86
+ revenue: "revenue";
87
+ }>>;
88
+ guardrails: z.ZodDefault<z.ZodArray<z.ZodObject<{
89
+ metric: z.ZodEnum<{
90
+ bounce: "bounce";
91
+ complaint: "complaint";
92
+ unsubscribe: "unsubscribe";
93
+ }>;
94
+ threshold: z.ZodNumber;
95
+ }, z.core.$strip>>>;
96
+ }, z.core.$strip>>;
97
+ method: z.ZodDefault<z.ZodEnum<{
98
+ bayesian_beta: "bayesian_beta";
99
+ frequentist_ztest: "frequentist_ztest";
100
+ }>>;
101
+ autoSelect: z.ZodOptional<z.ZodNullable<z.ZodObject<{
102
+ enabled: z.ZodDefault<z.ZodBoolean>;
103
+ afterHours: z.ZodDefault<z.ZodNumber>;
104
+ pBest: z.ZodDefault<z.ZodNumber>;
105
+ stopAt: z.ZodOptional<z.ZodISODateTime>;
106
+ shift: z.ZodOptional<z.ZodBoolean>;
107
+ stopOnGuardrail: z.ZodOptional<z.ZodBoolean>;
108
+ }, z.core.$strip>>>;
109
+ minRecipients: z.ZodDefault<z.ZodNumber>;
110
+ minConversions: z.ZodDefault<z.ZodNumber>;
111
+ }, z.core.$strip>;
112
+ export type CreateExperimentBody = z.input<typeof CreateExperimentBody>;
113
+ export declare const GuardrailResult: z.ZodObject<{
114
+ metric: z.ZodEnum<{
115
+ bounce: "bounce";
116
+ complaint: "complaint";
117
+ unsubscribe: "unsubscribe";
118
+ }>;
119
+ rate: z.ZodNumber;
120
+ pWorse: z.ZodNullable<z.ZodNumber>;
121
+ failed: z.ZodBoolean;
122
+ }, z.core.$strip>;
123
+ export declare const ReportArm: z.ZodObject<{
124
+ key: z.ZodString;
125
+ n: z.ZodNumber;
126
+ conversions: z.ZodNumber;
127
+ rate: z.ZodNumber;
128
+ ci: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
129
+ pBest: z.ZodNumber;
130
+ expectedLoss: z.ZodNumber;
131
+ pValue: z.ZodNullable<z.ZodNumber>;
132
+ guardrails: z.ZodArray<z.ZodObject<{
133
+ metric: z.ZodEnum<{
134
+ bounce: "bounce";
135
+ complaint: "complaint";
136
+ unsubscribe: "unsubscribe";
137
+ }>;
138
+ rate: z.ZodNumber;
139
+ pWorse: z.ZodNullable<z.ZodNumber>;
140
+ failed: z.ZodBoolean;
141
+ }, z.core.$strip>>;
142
+ orders: z.ZodOptional<z.ZodNumber>;
143
+ revenueMinor: z.ZodOptional<z.ZodNumber>;
144
+ }, z.core.$strip>;
145
+ export declare const ExperimentReport: z.ZodObject<{
146
+ arms: z.ZodArray<z.ZodObject<{
147
+ key: z.ZodString;
148
+ n: z.ZodNumber;
149
+ conversions: z.ZodNumber;
150
+ rate: z.ZodNumber;
151
+ ci: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
152
+ pBest: z.ZodNumber;
153
+ expectedLoss: z.ZodNumber;
154
+ pValue: z.ZodNullable<z.ZodNumber>;
155
+ guardrails: z.ZodArray<z.ZodObject<{
156
+ metric: z.ZodEnum<{
157
+ bounce: "bounce";
158
+ complaint: "complaint";
159
+ unsubscribe: "unsubscribe";
160
+ }>;
161
+ rate: z.ZodNumber;
162
+ pWorse: z.ZodNullable<z.ZodNumber>;
163
+ failed: z.ZodBoolean;
164
+ }, z.core.$strip>>;
165
+ orders: z.ZodOptional<z.ZodNumber>;
166
+ revenueMinor: z.ZodOptional<z.ZodNumber>;
167
+ }, z.core.$strip>>;
168
+ recommendation: z.ZodObject<{
169
+ kind: z.ZodEnum<{
170
+ keep_running: "keep_running";
171
+ no_winner: "no_winner";
172
+ winner: "winner";
173
+ }>;
174
+ key: z.ZodNullable<z.ZodString>;
175
+ }, z.core.$strip>;
176
+ reason: z.ZodString;
177
+ method: z.ZodEnum<{
178
+ bayesian_beta: "bayesian_beta";
179
+ frequentist_ztest: "frequentist_ztest";
180
+ }>;
181
+ metric: z.ZodEnum<{
182
+ clicks: "clicks";
183
+ conversions: "conversions";
184
+ opens: "opens";
185
+ replies: "replies";
186
+ revenue: "revenue";
187
+ }>;
188
+ significant: z.ZodBoolean;
189
+ sampleSufficient: z.ZodBoolean;
190
+ caveat: z.ZodNullable<z.ZodString>;
191
+ }, z.core.$strip>;
192
+ export type ExperimentReport = z.infer<typeof ExperimentReport>;
193
+ export declare const ExperimentDto: z.ZodObject<{
194
+ id: z.ZodUUID;
195
+ }, z.core.$loose>;
196
+ export declare const ExperimentPage: z.ZodObject<{
197
+ items: z.ZodArray<z.ZodObject<{
198
+ id: z.ZodUUID;
199
+ }, z.core.$loose>>;
200
+ nextCursor: z.ZodNullable<z.ZodUUID>;
201
+ }, z.core.$strip>;
202
+ export declare const ExperimentListQuery: z.ZodObject<{
203
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
204
+ cursor: z.ZodOptional<z.ZodUUID>;
205
+ status: z.ZodOptional<z.ZodEnum<{
206
+ concluded: "concluded";
207
+ draft: "draft";
208
+ running: "running";
209
+ }>>;
210
+ scopeId: z.ZodOptional<z.ZodUUID>;
211
+ }, z.core.$strip>;
212
+ export declare const ConcludeBody: z.ZodObject<{
213
+ winnerKey: z.ZodString;
214
+ }, z.core.$strip>;
215
+ export declare const HoldoutScope: z.ZodEnum<{
216
+ campaign: "campaign";
217
+ workflow: "workflow";
218
+ workspace: "workspace";
219
+ }>;
220
+ export declare const HoldoutBody: z.ZodObject<{
221
+ name: z.ZodString;
222
+ percent: z.ZodNumber;
223
+ scopeType: z.ZodDefault<z.ZodEnum<{
224
+ campaign: "campaign";
225
+ workflow: "workflow";
226
+ workspace: "workspace";
227
+ }>>;
228
+ scopeId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
229
+ }, z.core.$strip>;
230
+ export declare const HoldoutDto: z.ZodObject<{
231
+ id: z.ZodUUID;
232
+ }, z.core.$loose>;
233
+ /** Incrementality: who of the held-back vs treated people did `event` after being assigned; the sample floors gate any recommendation. */
234
+ export declare const HoldoutReportQuery: z.ZodObject<{
235
+ event: z.ZodDefault<z.ZodString>;
236
+ minPeople: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
237
+ minConversions: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
238
+ }, z.core.$strip>;
239
+ export declare const HoldoutPage: z.ZodObject<{
240
+ items: z.ZodArray<z.ZodObject<{
241
+ id: z.ZodUUID;
242
+ }, z.core.$loose>>;
243
+ nextCursor: z.ZodNullable<z.ZodUUID>;
244
+ }, z.core.$strip>;
245
+ /** Frequency caps (T6.3). `windowHours` instead of ms so the API stays human-sized. */
246
+ export declare const FrequencyCapInput: z.ZodObject<{
247
+ channel: z.ZodEnum<{
248
+ email: "email";
249
+ postcard: "postcard";
250
+ push: "push";
251
+ sms: "sms";
252
+ whatsapp: "whatsapp";
253
+ }>;
254
+ purpose: z.ZodEnum<{
255
+ marketing: "marketing";
256
+ operational: "operational";
257
+ prospecting: "prospecting";
258
+ transactional: "transactional";
259
+ }>;
260
+ max: z.ZodNumber;
261
+ windowHours: z.ZodNumber;
262
+ }, z.core.$strip>;
263
+ export type FrequencyCapInput = z.infer<typeof FrequencyCapInput>;
264
+ export declare const SmartSending: z.ZodObject<{
265
+ hours: z.ZodNumber;
266
+ action: z.ZodDefault<z.ZodEnum<{
267
+ defer: "defer";
268
+ skip: "skip";
269
+ }>>;
270
+ }, z.core.$strip>;
271
+ export type SmartSending = z.infer<typeof SmartSending>;
272
+ export declare const FrequencySettingsBody: z.ZodObject<{
273
+ scopeType: z.ZodDefault<z.ZodEnum<{
274
+ campaign: "campaign";
275
+ workflow: "workflow";
276
+ workspace: "workspace";
277
+ }>>;
278
+ scopeId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
279
+ caps: z.ZodDefault<z.ZodArray<z.ZodObject<{
280
+ channel: z.ZodEnum<{
281
+ email: "email";
282
+ postcard: "postcard";
283
+ push: "push";
284
+ sms: "sms";
285
+ whatsapp: "whatsapp";
286
+ }>;
287
+ purpose: z.ZodEnum<{
288
+ marketing: "marketing";
289
+ operational: "operational";
290
+ prospecting: "prospecting";
291
+ transactional: "transactional";
292
+ }>;
293
+ max: z.ZodNumber;
294
+ windowHours: z.ZodNumber;
295
+ }, z.core.$strip>>>;
296
+ smartSending: z.ZodOptional<z.ZodNullable<z.ZodObject<{
297
+ hours: z.ZodNumber;
298
+ action: z.ZodDefault<z.ZodEnum<{
299
+ defer: "defer";
300
+ skip: "skip";
301
+ }>>;
302
+ }, z.core.$strip>>>;
303
+ crossPurpose: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
304
+ max: z.ZodNumber;
305
+ windowHours: z.ZodNumber;
306
+ }, z.core.$strip>, z.ZodLiteral<"off">]>>>;
307
+ }, z.core.$strip>;
308
+ export declare const FrequencySettingsDto: z.ZodObject<{
309
+ id: z.ZodUUID;
310
+ }, z.core.$loose>;
311
+ export declare const FrequencySettingsList: z.ZodObject<{
312
+ items: z.ZodArray<z.ZodObject<{
313
+ id: z.ZodUUID;
314
+ }, z.core.$loose>>;
315
+ }, z.core.$strip>;
316
+ /** `hour` is local to `timezone`: the profile's own zone, else the workspace's. */
317
+ export declare const SendTimeRecommendation: z.ZodObject<{
318
+ profileId: z.ZodUUID;
319
+ hour: z.ZodNumber;
320
+ source: z.ZodEnum<{
321
+ default: "default";
322
+ profile: "profile";
323
+ workspace: "workspace";
324
+ }>;
325
+ timezone: z.ZodOptional<z.ZodString>;
326
+ at: z.ZodISODateTime;
327
+ }, z.core.$strip>;
328
+ /** `new_subscribers`: people in the audience now who were not sent the original; `non_purchasers`: recipients with no attributed order. */
329
+ export declare const ResendBody: z.ZodObject<{
330
+ to: z.ZodEnum<{
331
+ new_subscribers: "new_subscribers";
332
+ non_clickers: "non_clickers";
333
+ non_openers: "non_openers";
334
+ non_purchasers: "non_purchasers";
335
+ }>;
336
+ subject: z.ZodString;
337
+ at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
338
+ }, z.core.$strip>;
339
+ export declare const AbTestConfig: z.ZodObject<{
340
+ testPercent: z.ZodDefault<z.ZodNumber>;
341
+ metric: z.ZodDefault<z.ZodEnum<{
342
+ clicks: "clicks";
343
+ conversions: "conversions";
344
+ opens: "opens";
345
+ replies: "replies";
346
+ revenue: "revenue";
347
+ }>>;
348
+ waitHours: z.ZodDefault<z.ZodNumber>;
349
+ auto: z.ZodDefault<z.ZodBoolean>;
350
+ method: z.ZodDefault<z.ZodEnum<{
351
+ bayesian_beta: "bayesian_beta";
352
+ frequentist_ztest: "frequentist_ztest";
353
+ }>>;
354
+ confidence: z.ZodOptional<z.ZodNumber>;
355
+ guardrail: z.ZodOptional<z.ZodNumber>;
356
+ }, z.core.$strip>;
357
+ export type AbTestConfig = z.infer<typeof AbTestConfig>;
358
+ export declare const RolloutBody: z.ZodObject<{
359
+ winnerKey: z.ZodOptional<z.ZodString>;
360
+ }, z.core.$strip>;
361
+ /** Multivariate: every combination of the listed values becomes one variant (at most 8). An empty dimension keeps the base value. */
362
+ export declare const MultivariateGridBody: z.ZodObject<{
363
+ templateVersionIds: z.ZodDefault<z.ZodArray<z.ZodUUID>>;
364
+ subjects: z.ZodDefault<z.ZodArray<z.ZodString>>;
365
+ fromNames: z.ZodDefault<z.ZodArray<z.ZodString>>;
366
+ previewTexts: z.ZodDefault<z.ZodArray<z.ZodString>>;
367
+ baseTemplateVersionId: z.ZodUUID;
368
+ }, z.core.$strip>;
369
+ export declare const MultivariateGridResult: z.ZodObject<{
370
+ combinations: z.ZodNumber;
371
+ variants: z.ZodArray<z.ZodObject<{
372
+ key: z.ZodString;
373
+ templateVersionId: z.ZodString;
374
+ subject: z.ZodNullable<z.ZodString>;
375
+ fromName: z.ZodNullable<z.ZodString>;
376
+ previewText: z.ZodNullable<z.ZodString>;
377
+ }, z.core.$strip>>;
378
+ }, z.core.$strip>;