helpdock 0.1.0 → 0.1.2

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,289 @@
1
+ import * as z from "zod/mini";
2
+ export declare const HelpDockConfigSchema: z.ZodMiniObject<{
3
+ position: z.ZodMiniDefault<z.ZodMiniEnum<{
4
+ bottomRight: "bottomRight";
5
+ bottomLeft: "bottomLeft";
6
+ }>>;
7
+ offset: z.ZodMiniDefault<z.ZodMiniObject<{
8
+ x: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
9
+ y: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
10
+ }, z.core.$strip>>;
11
+ panelWidth: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
12
+ panelHeight: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
13
+ mobileBreakpoint: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
14
+ articles: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
15
+ type: z.ZodMiniLiteral<"function">;
16
+ fetch: z.ZodMiniFunction<z.ZodMiniTuple<[], null>, z.ZodMiniPromise<z.ZodMiniObject<{
17
+ articles: z.ZodMiniArray<z.ZodMiniObject<{
18
+ id: z.ZodMiniString<string>;
19
+ title: z.ZodMiniString<string>;
20
+ description: z.ZodMiniString<string>;
21
+ category: z.ZodMiniOptional<z.ZodMiniString<string>>;
22
+ tags: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniString<string>>>;
23
+ updatedAt: z.ZodMiniOptional<z.iso.ZodMiniISODateTime>;
24
+ content: z.ZodMiniString<string>;
25
+ contentType: z.ZodMiniDefault<z.ZodMiniEnum<{
26
+ markdown: "markdown";
27
+ html: "html";
28
+ }>>;
29
+ }, z.core.$strip>>;
30
+ }, z.core.$strip>>>;
31
+ }, z.core.$strip>], "type">;
32
+ contact: z.ZodMiniOptional<z.ZodMiniObject<{
33
+ title: z.ZodMiniDefault<z.ZodMiniString<string>>;
34
+ subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
35
+ fields: z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
36
+ name: z.ZodMiniString<string>;
37
+ label: z.ZodMiniString<string>;
38
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
39
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
40
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
41
+ type: z.ZodMiniLiteral<"text">;
42
+ }, z.core.$strip>, z.ZodMiniObject<{
43
+ name: z.ZodMiniString<string>;
44
+ label: z.ZodMiniString<string>;
45
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
46
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
47
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
48
+ type: z.ZodMiniLiteral<"email">;
49
+ }, z.core.$strip>, z.ZodMiniObject<{
50
+ name: z.ZodMiniString<string>;
51
+ label: z.ZodMiniString<string>;
52
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
53
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
54
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
55
+ type: z.ZodMiniLiteral<"textarea">;
56
+ rows: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
57
+ }, z.core.$strip>, z.ZodMiniObject<{
58
+ name: z.ZodMiniString<string>;
59
+ label: z.ZodMiniString<string>;
60
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
61
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
62
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
63
+ type: z.ZodMiniLiteral<"select">;
64
+ options: z.ZodMiniArray<z.ZodMiniObject<{
65
+ value: z.ZodMiniString<string>;
66
+ label: z.ZodMiniString<string>;
67
+ }, z.core.$strip>>;
68
+ }, z.core.$strip>], "type">>;
69
+ attachments: z.ZodMiniDefault<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
70
+ mode: z.ZodMiniLiteral<"disabled">;
71
+ }, z.core.$strip>, z.ZodMiniObject<{
72
+ mode: z.ZodMiniLiteral<"inline">;
73
+ maxFiles: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
74
+ maxSizeMB: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
75
+ accept: z.ZodMiniOptional<z.ZodMiniString<string>>;
76
+ }, z.core.$strip>, z.ZodMiniObject<{
77
+ mode: z.ZodMiniLiteral<"presigned">;
78
+ maxFiles: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
79
+ maxSizeMB: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
80
+ accept: z.ZodMiniOptional<z.ZodMiniString<string>>;
81
+ getUploadUrl: z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
82
+ filename: z.ZodMiniString<string>;
83
+ contentType: z.ZodMiniString<string>;
84
+ size: z.ZodMiniNumber<number>;
85
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniObject<{
86
+ uploadUrl: z.ZodMiniString<string>;
87
+ fileUrl: z.ZodMiniString<string>;
88
+ }, z.core.$strip>>>;
89
+ }, z.core.$strip>], "mode">>;
90
+ submit: z.ZodMiniObject<{
91
+ type: z.ZodMiniLiteral<"function">;
92
+ beforeSubmit: z.ZodMiniOptional<z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
93
+ fields: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
94
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
95
+ proceed: z.ZodMiniLiteral<true>;
96
+ extraFields: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
97
+ }, z.core.$strip>, z.ZodMiniObject<{
98
+ proceed: z.ZodMiniLiteral<false>;
99
+ error: z.ZodMiniString<string>;
100
+ }, z.core.$strip>], "proceed">>>>;
101
+ handler: z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
102
+ fields: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
103
+ attachments: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniCustom<File, File>>, z.ZodMiniArray<z.ZodMiniObject<{
104
+ filename: z.ZodMiniString<string>;
105
+ url: z.ZodMiniString<string>;
106
+ contentType: z.ZodMiniString<string>;
107
+ size: z.ZodMiniNumber<number>;
108
+ }, z.core.$strip>>]>>;
109
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniObject<{
110
+ success: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
111
+ message: z.ZodMiniString<string>;
112
+ }, z.core.$strip>>>;
113
+ }, z.core.$strip>;
114
+ submitButtonText: z.ZodMiniDefault<z.ZodMiniString<string>>;
115
+ }, z.core.$strip>>;
116
+ icons: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniObject<{
117
+ widget: z.ZodMiniOptional<z.ZodMiniString<string>>;
118
+ close: z.ZodMiniOptional<z.ZodMiniString<string>>;
119
+ }, z.core.$strip>>, z.ZodMiniTransform<{
120
+ widget: string | import("lit-html").TemplateResult<1>;
121
+ close: string | import("lit-html").TemplateResult<1>;
122
+ }, {
123
+ widget?: string | undefined;
124
+ close?: string | undefined;
125
+ } | undefined>>>;
126
+ labels: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniObject<{
127
+ articlesTab: z.ZodMiniOptional<z.ZodMiniString<string>>;
128
+ contactTab: z.ZodMiniOptional<z.ZodMiniString<string>>;
129
+ searchPlaceholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
130
+ noResults: z.ZodMiniOptional<z.ZodMiniString<string>>;
131
+ loading: z.ZodMiniOptional<z.ZodMiniString<string>>;
132
+ backToArticles: z.ZodMiniOptional<z.ZodMiniString<string>>;
133
+ emptyStateTitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
134
+ emptyStateSearchMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
135
+ emptyStateNoArticlesMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
136
+ getInTouch: z.ZodMiniOptional<z.ZodMiniString<string>>;
137
+ }, z.core.$strip>>, z.ZodMiniTransform<{
138
+ articlesTab: string;
139
+ contactTab: string;
140
+ searchPlaceholder: string;
141
+ noResults: string;
142
+ loading: string;
143
+ backToArticles: string;
144
+ emptyStateTitle: string;
145
+ emptyStateSearchMessage: string;
146
+ emptyStateNoArticlesMessage: string;
147
+ getInTouch: string;
148
+ }, {
149
+ articlesTab?: string | undefined;
150
+ contactTab?: string | undefined;
151
+ searchPlaceholder?: string | undefined;
152
+ noResults?: string | undefined;
153
+ loading?: string | undefined;
154
+ backToArticles?: string | undefined;
155
+ emptyStateTitle?: string | undefined;
156
+ emptyStateSearchMessage?: string | undefined;
157
+ emptyStateNoArticlesMessage?: string | undefined;
158
+ getInTouch?: string | undefined;
159
+ } | undefined>>>;
160
+ defaultTab: z.ZodMiniDefault<z.ZodMiniEnum<{
161
+ articles: "articles";
162
+ contact: "contact";
163
+ }>>;
164
+ closeOnEscape: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
165
+ closeOnClickOutside: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
166
+ analytics: z.ZodMiniOptional<z.ZodMiniObject<{
167
+ enabled: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
168
+ onEvent: z.ZodMiniOptional<z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
169
+ type: z.ZodMiniLiteral<"widget:open">;
170
+ trigger: z.ZodMiniEnum<{
171
+ button_click: "button_click";
172
+ programmatic: "programmatic";
173
+ auto: "auto";
174
+ }>;
175
+ }, z.core.$strip>, z.ZodMiniObject<{
176
+ type: z.ZodMiniLiteral<"widget:close">;
177
+ trigger: z.ZodMiniEnum<{
178
+ button_click: "button_click";
179
+ programmatic: "programmatic";
180
+ escape: "escape";
181
+ click_outside: "click_outside";
182
+ }>;
183
+ }, z.core.$strip>, z.ZodMiniObject<{
184
+ type: z.ZodMiniLiteral<"tab:change">;
185
+ from: z.ZodMiniEnum<{
186
+ articles: "articles";
187
+ contact: "contact";
188
+ }>;
189
+ to: z.ZodMiniEnum<{
190
+ articles: "articles";
191
+ contact: "contact";
192
+ }>;
193
+ }, z.core.$strip>, z.ZodMiniObject<{
194
+ type: z.ZodMiniLiteral<"articles:view">;
195
+ articleCount: z.ZodMiniNumber<number>;
196
+ hasSearchQuery: z.ZodMiniBoolean<boolean>;
197
+ }, z.core.$strip>, z.ZodMiniObject<{
198
+ type: z.ZodMiniLiteral<"article:click">;
199
+ articleId: z.ZodMiniString<string>;
200
+ articleTitle: z.ZodMiniString<string>;
201
+ articleCategory: z.ZodMiniOptional<z.ZodMiniString<string>>;
202
+ fromSearch: z.ZodMiniBoolean<boolean>;
203
+ searchQuery: z.ZodMiniOptional<z.ZodMiniString<string>>;
204
+ }, z.core.$strip>, z.ZodMiniObject<{
205
+ type: z.ZodMiniLiteral<"article:view">;
206
+ articleId: z.ZodMiniString<string>;
207
+ articleTitle: z.ZodMiniString<string>;
208
+ articleCategory: z.ZodMiniOptional<z.ZodMiniString<string>>;
209
+ }, z.core.$strip>, z.ZodMiniObject<{
210
+ type: z.ZodMiniLiteral<"article:close">;
211
+ articleId: z.ZodMiniString<string>;
212
+ articleTitle: z.ZodMiniString<string>;
213
+ timeSpent: z.ZodMiniNumber<number>;
214
+ }, z.core.$strip>, z.ZodMiniObject<{
215
+ type: z.ZodMiniLiteral<"article:link:click">;
216
+ articleId: z.ZodMiniString<string>;
217
+ articleTitle: z.ZodMiniString<string>;
218
+ linkUrl: z.ZodMiniString<string>;
219
+ linkText: z.ZodMiniString<string>;
220
+ external: z.ZodMiniBoolean<boolean>;
221
+ }, z.core.$strip>, z.ZodMiniObject<{
222
+ type: z.ZodMiniLiteral<"search:query">;
223
+ query: z.ZodMiniString<string>;
224
+ resultCount: z.ZodMiniNumber<number>;
225
+ timeToResults: z.ZodMiniNumber<number>;
226
+ }, z.core.$strip>, z.ZodMiniObject<{
227
+ type: z.ZodMiniLiteral<"search:result:click">;
228
+ query: z.ZodMiniString<string>;
229
+ articleId: z.ZodMiniString<string>;
230
+ articleTitle: z.ZodMiniString<string>;
231
+ resultPosition: z.ZodMiniNumber<number>;
232
+ }, z.core.$strip>, z.ZodMiniObject<{
233
+ type: z.ZodMiniLiteral<"search:clear">;
234
+ previousQuery: z.ZodMiniString<string>;
235
+ }, z.core.$strip>, z.ZodMiniObject<{
236
+ type: z.ZodMiniLiteral<"contact:view">;
237
+ }, z.core.$strip>, z.ZodMiniObject<{
238
+ type: z.ZodMiniLiteral<"contact:field:focus">;
239
+ fieldName: z.ZodMiniString<string>;
240
+ }, z.core.$strip>, z.ZodMiniObject<{
241
+ type: z.ZodMiniLiteral<"contact:submit">;
242
+ hasName: z.ZodMiniBoolean<boolean>;
243
+ hasEmail: z.ZodMiniBoolean<boolean>;
244
+ hasMessage: z.ZodMiniBoolean<boolean>;
245
+ messageLength: z.ZodMiniNumber<number>;
246
+ attachmentCount: z.ZodMiniNumber<number>;
247
+ totalAttachmentSize: z.ZodMiniNumber<number>;
248
+ }, z.core.$strip>, z.ZodMiniObject<{
249
+ type: z.ZodMiniLiteral<"contact:success">;
250
+ responseTime: z.ZodMiniNumber<number>;
251
+ }, z.core.$strip>, z.ZodMiniObject<{
252
+ type: z.ZodMiniLiteral<"contact:error">;
253
+ errorType: z.ZodMiniString<string>;
254
+ errorMessage: z.ZodMiniString<string>;
255
+ }, z.core.$strip>, z.ZodMiniObject<{
256
+ type: z.ZodMiniLiteral<"contact:attachment:add">;
257
+ fileName: z.ZodMiniString<string>;
258
+ fileSize: z.ZodMiniNumber<number>;
259
+ fileType: z.ZodMiniString<string>;
260
+ attachmentCount: z.ZodMiniNumber<number>;
261
+ }, z.core.$strip>, z.ZodMiniObject<{
262
+ type: z.ZodMiniLiteral<"contact:attachment:remove">;
263
+ fileName: z.ZodMiniString<string>;
264
+ attachmentCount: z.ZodMiniNumber<number>;
265
+ }, z.core.$strip>, z.ZodMiniObject<{
266
+ type: z.ZodMiniLiteral<"contact:attachment:upload:start">;
267
+ fileName: z.ZodMiniString<string>;
268
+ fileSize: z.ZodMiniNumber<number>;
269
+ }, z.core.$strip>, z.ZodMiniObject<{
270
+ type: z.ZodMiniLiteral<"contact:attachment:upload:success">;
271
+ fileName: z.ZodMiniString<string>;
272
+ uploadTime: z.ZodMiniNumber<number>;
273
+ }, z.core.$strip>, z.ZodMiniObject<{
274
+ type: z.ZodMiniLiteral<"contact:attachment:upload:error">;
275
+ fileName: z.ZodMiniString<string>;
276
+ errorMessage: z.ZodMiniString<string>;
277
+ }, z.core.$strip>, z.ZodMiniObject<{
278
+ type: z.ZodMiniLiteral<"filter:category">;
279
+ category: z.ZodMiniString<string>;
280
+ resultCount: z.ZodMiniNumber<number>;
281
+ }, z.core.$strip>, z.ZodMiniObject<{
282
+ type: z.ZodMiniLiteral<"filter:tag">;
283
+ tag: z.ZodMiniString<string>;
284
+ resultCount: z.ZodMiniNumber<number>;
285
+ }, z.core.$strip>], "type">], null>, z.ZodMiniVoid>>;
286
+ getSessionId: z.ZodMiniOptional<z.ZodMiniFunction<z.ZodMiniTuple<[], null>, z.ZodMiniString<string>>>;
287
+ }, z.core.$strip>>;
288
+ }, z.core.$strip>;
289
+ export type HelpDockConfig = z.infer<typeof HelpDockConfigSchema>;
@@ -0,0 +1,268 @@
1
+ import * as z from "zod/mini";
2
+ export declare const TextFieldSchema: z.ZodMiniObject<{
3
+ name: z.ZodMiniString<string>;
4
+ label: z.ZodMiniString<string>;
5
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
6
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
7
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
8
+ type: z.ZodMiniLiteral<"text">;
9
+ }, z.core.$strip>;
10
+ export declare const EmailFieldSchema: z.ZodMiniObject<{
11
+ name: z.ZodMiniString<string>;
12
+ label: z.ZodMiniString<string>;
13
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
14
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
15
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
16
+ type: z.ZodMiniLiteral<"email">;
17
+ }, z.core.$strip>;
18
+ export declare const TextareaFieldSchema: z.ZodMiniObject<{
19
+ name: z.ZodMiniString<string>;
20
+ label: z.ZodMiniString<string>;
21
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
22
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
23
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
24
+ type: z.ZodMiniLiteral<"textarea">;
25
+ rows: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
26
+ }, z.core.$strip>;
27
+ export declare const SelectFieldSchema: z.ZodMiniObject<{
28
+ name: z.ZodMiniString<string>;
29
+ label: z.ZodMiniString<string>;
30
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
31
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
32
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
33
+ type: z.ZodMiniLiteral<"select">;
34
+ options: z.ZodMiniArray<z.ZodMiniObject<{
35
+ value: z.ZodMiniString<string>;
36
+ label: z.ZodMiniString<string>;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>;
39
+ export declare const FormFieldSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
40
+ name: z.ZodMiniString<string>;
41
+ label: z.ZodMiniString<string>;
42
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
43
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
44
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
45
+ type: z.ZodMiniLiteral<"text">;
46
+ }, z.core.$strip>, z.ZodMiniObject<{
47
+ name: z.ZodMiniString<string>;
48
+ label: z.ZodMiniString<string>;
49
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
50
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
51
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
52
+ type: z.ZodMiniLiteral<"email">;
53
+ }, z.core.$strip>, z.ZodMiniObject<{
54
+ name: z.ZodMiniString<string>;
55
+ label: z.ZodMiniString<string>;
56
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
57
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
58
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
59
+ type: z.ZodMiniLiteral<"textarea">;
60
+ rows: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
61
+ }, z.core.$strip>, z.ZodMiniObject<{
62
+ name: z.ZodMiniString<string>;
63
+ label: z.ZodMiniString<string>;
64
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
65
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
66
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
67
+ type: z.ZodMiniLiteral<"select">;
68
+ options: z.ZodMiniArray<z.ZodMiniObject<{
69
+ value: z.ZodMiniString<string>;
70
+ label: z.ZodMiniString<string>;
71
+ }, z.core.$strip>>;
72
+ }, z.core.$strip>], "type">;
73
+ export type FormField = z.infer<typeof FormFieldSchema>;
74
+ export declare const AttachmentDisabledSchema: z.ZodMiniObject<{
75
+ mode: z.ZodMiniLiteral<"disabled">;
76
+ }, z.core.$strip>;
77
+ export declare const AttachmentInlineSchema: z.ZodMiniObject<{
78
+ mode: z.ZodMiniLiteral<"inline">;
79
+ maxFiles: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
80
+ maxSizeMB: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
81
+ accept: z.ZodMiniOptional<z.ZodMiniString<string>>;
82
+ }, z.core.$strip>;
83
+ export declare const AttachmentPresignedSchema: z.ZodMiniObject<{
84
+ mode: z.ZodMiniLiteral<"presigned">;
85
+ maxFiles: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
86
+ maxSizeMB: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
87
+ accept: z.ZodMiniOptional<z.ZodMiniString<string>>;
88
+ getUploadUrl: z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
89
+ filename: z.ZodMiniString<string>;
90
+ contentType: z.ZodMiniString<string>;
91
+ size: z.ZodMiniNumber<number>;
92
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniObject<{
93
+ uploadUrl: z.ZodMiniString<string>;
94
+ fileUrl: z.ZodMiniString<string>;
95
+ }, z.core.$strip>>>;
96
+ }, z.core.$strip>;
97
+ export declare const AttachmentConfigSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
98
+ mode: z.ZodMiniLiteral<"disabled">;
99
+ }, z.core.$strip>, z.ZodMiniObject<{
100
+ mode: z.ZodMiniLiteral<"inline">;
101
+ maxFiles: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
102
+ maxSizeMB: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
103
+ accept: z.ZodMiniOptional<z.ZodMiniString<string>>;
104
+ }, z.core.$strip>, z.ZodMiniObject<{
105
+ mode: z.ZodMiniLiteral<"presigned">;
106
+ maxFiles: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
107
+ maxSizeMB: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
108
+ accept: z.ZodMiniOptional<z.ZodMiniString<string>>;
109
+ getUploadUrl: z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
110
+ filename: z.ZodMiniString<string>;
111
+ contentType: z.ZodMiniString<string>;
112
+ size: z.ZodMiniNumber<number>;
113
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniObject<{
114
+ uploadUrl: z.ZodMiniString<string>;
115
+ fileUrl: z.ZodMiniString<string>;
116
+ }, z.core.$strip>>>;
117
+ }, z.core.$strip>], "mode">;
118
+ export type AttachmentConfig = z.infer<typeof AttachmentConfigSchema>;
119
+ export declare const UploadedFileSchema: z.ZodMiniObject<{
120
+ filename: z.ZodMiniString<string>;
121
+ url: z.ZodMiniString<string>;
122
+ contentType: z.ZodMiniString<string>;
123
+ size: z.ZodMiniNumber<number>;
124
+ }, z.core.$strip>;
125
+ export type UploadedFile = z.infer<typeof UploadedFileSchema>;
126
+ declare const BeforeSubmitResultSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
127
+ proceed: z.ZodMiniLiteral<true>;
128
+ extraFields: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
129
+ }, z.core.$strip>, z.ZodMiniObject<{
130
+ proceed: z.ZodMiniLiteral<false>;
131
+ error: z.ZodMiniString<string>;
132
+ }, z.core.$strip>], "proceed">;
133
+ export type BeforeSubmitResult = z.infer<typeof BeforeSubmitResultSchema>;
134
+ export declare const SubmitFunctionSchema: z.ZodMiniObject<{
135
+ type: z.ZodMiniLiteral<"function">;
136
+ beforeSubmit: z.ZodMiniOptional<z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
137
+ fields: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
138
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
139
+ proceed: z.ZodMiniLiteral<true>;
140
+ extraFields: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
141
+ }, z.core.$strip>, z.ZodMiniObject<{
142
+ proceed: z.ZodMiniLiteral<false>;
143
+ error: z.ZodMiniString<string>;
144
+ }, z.core.$strip>], "proceed">>>>;
145
+ handler: z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
146
+ fields: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
147
+ attachments: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniCustom<File, File>>, z.ZodMiniArray<z.ZodMiniObject<{
148
+ filename: z.ZodMiniString<string>;
149
+ url: z.ZodMiniString<string>;
150
+ contentType: z.ZodMiniString<string>;
151
+ size: z.ZodMiniNumber<number>;
152
+ }, z.core.$strip>>]>>;
153
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniObject<{
154
+ success: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
155
+ message: z.ZodMiniString<string>;
156
+ }, z.core.$strip>>>;
157
+ }, z.core.$strip>;
158
+ export declare const SubmitConfigSchema: z.ZodMiniObject<{
159
+ type: z.ZodMiniLiteral<"function">;
160
+ beforeSubmit: z.ZodMiniOptional<z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
161
+ fields: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
162
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
163
+ proceed: z.ZodMiniLiteral<true>;
164
+ extraFields: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
165
+ }, z.core.$strip>, z.ZodMiniObject<{
166
+ proceed: z.ZodMiniLiteral<false>;
167
+ error: z.ZodMiniString<string>;
168
+ }, z.core.$strip>], "proceed">>>>;
169
+ handler: z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
170
+ fields: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
171
+ attachments: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniCustom<File, File>>, z.ZodMiniArray<z.ZodMiniObject<{
172
+ filename: z.ZodMiniString<string>;
173
+ url: z.ZodMiniString<string>;
174
+ contentType: z.ZodMiniString<string>;
175
+ size: z.ZodMiniNumber<number>;
176
+ }, z.core.$strip>>]>>;
177
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniObject<{
178
+ success: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
179
+ message: z.ZodMiniString<string>;
180
+ }, z.core.$strip>>>;
181
+ }, z.core.$strip>;
182
+ export type SubmitConfig = z.infer<typeof SubmitConfigSchema>;
183
+ export declare const ContactConfigSchema: z.ZodMiniObject<{
184
+ title: z.ZodMiniDefault<z.ZodMiniString<string>>;
185
+ subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
186
+ fields: z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
187
+ name: z.ZodMiniString<string>;
188
+ label: z.ZodMiniString<string>;
189
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
190
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
191
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
192
+ type: z.ZodMiniLiteral<"text">;
193
+ }, z.core.$strip>, z.ZodMiniObject<{
194
+ name: z.ZodMiniString<string>;
195
+ label: z.ZodMiniString<string>;
196
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
197
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
198
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
199
+ type: z.ZodMiniLiteral<"email">;
200
+ }, z.core.$strip>, z.ZodMiniObject<{
201
+ name: z.ZodMiniString<string>;
202
+ label: z.ZodMiniString<string>;
203
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
204
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
205
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
206
+ type: z.ZodMiniLiteral<"textarea">;
207
+ rows: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
208
+ }, z.core.$strip>, z.ZodMiniObject<{
209
+ name: z.ZodMiniString<string>;
210
+ label: z.ZodMiniString<string>;
211
+ required: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
212
+ placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
213
+ defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
214
+ type: z.ZodMiniLiteral<"select">;
215
+ options: z.ZodMiniArray<z.ZodMiniObject<{
216
+ value: z.ZodMiniString<string>;
217
+ label: z.ZodMiniString<string>;
218
+ }, z.core.$strip>>;
219
+ }, z.core.$strip>], "type">>;
220
+ attachments: z.ZodMiniDefault<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
221
+ mode: z.ZodMiniLiteral<"disabled">;
222
+ }, z.core.$strip>, z.ZodMiniObject<{
223
+ mode: z.ZodMiniLiteral<"inline">;
224
+ maxFiles: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
225
+ maxSizeMB: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
226
+ accept: z.ZodMiniOptional<z.ZodMiniString<string>>;
227
+ }, z.core.$strip>, z.ZodMiniObject<{
228
+ mode: z.ZodMiniLiteral<"presigned">;
229
+ maxFiles: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
230
+ maxSizeMB: z.ZodMiniDefault<z.ZodMiniNumber<number>>;
231
+ accept: z.ZodMiniOptional<z.ZodMiniString<string>>;
232
+ getUploadUrl: z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
233
+ filename: z.ZodMiniString<string>;
234
+ contentType: z.ZodMiniString<string>;
235
+ size: z.ZodMiniNumber<number>;
236
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniObject<{
237
+ uploadUrl: z.ZodMiniString<string>;
238
+ fileUrl: z.ZodMiniString<string>;
239
+ }, z.core.$strip>>>;
240
+ }, z.core.$strip>], "mode">>;
241
+ submit: z.ZodMiniObject<{
242
+ type: z.ZodMiniLiteral<"function">;
243
+ beforeSubmit: z.ZodMiniOptional<z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
244
+ fields: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
245
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
246
+ proceed: z.ZodMiniLiteral<true>;
247
+ extraFields: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
248
+ }, z.core.$strip>, z.ZodMiniObject<{
249
+ proceed: z.ZodMiniLiteral<false>;
250
+ error: z.ZodMiniString<string>;
251
+ }, z.core.$strip>], "proceed">>>>;
252
+ handler: z.ZodMiniFunction<z.ZodMiniTuple<[z.ZodMiniObject<{
253
+ fields: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
254
+ attachments: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniArray<z.ZodMiniCustom<File, File>>, z.ZodMiniArray<z.ZodMiniObject<{
255
+ filename: z.ZodMiniString<string>;
256
+ url: z.ZodMiniString<string>;
257
+ contentType: z.ZodMiniString<string>;
258
+ size: z.ZodMiniNumber<number>;
259
+ }, z.core.$strip>>]>>;
260
+ }, z.core.$strip>], null>, z.ZodMiniPromise<z.ZodMiniObject<{
261
+ success: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
262
+ message: z.ZodMiniString<string>;
263
+ }, z.core.$strip>>>;
264
+ }, z.core.$strip>;
265
+ submitButtonText: z.ZodMiniDefault<z.ZodMiniString<string>>;
266
+ }, z.core.$strip>;
267
+ export type ContactConfig = z.infer<typeof ContactConfigSchema>;
268
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { AnalyticsConfig, RawAnalyticsEvent } from "../schema/analytics";
2
+ /**
3
+ * Analytics Service
4
+ * Handles tracking and dispatching analytics events
5
+ */
6
+ export declare class AnalyticsService {
7
+ private config;
8
+ private sessionId;
9
+ private isInitialized;
10
+ constructor();
11
+ /**
12
+ * Initialize the analytics service with configuration
13
+ */
14
+ init(config: AnalyticsConfig | undefined): void;
15
+ /**
16
+ * Track an analytics event
17
+ */
18
+ track(eventData: RawAnalyticsEvent): void;
19
+ private generateDefaultSessionId;
20
+ }
21
+ export declare const analyticsService: AnalyticsService;
@@ -0,0 +1,68 @@
1
+ import type { AttachmentConfig, UploadedFile } from "../schema/contact";
2
+ export interface FileValidationResult {
3
+ valid: boolean;
4
+ error?: string;
5
+ }
6
+ export interface UploadProgress {
7
+ filename: string;
8
+ progress: number;
9
+ status: "uploading" | "success" | "error";
10
+ error?: string;
11
+ }
12
+ export interface UploadResult {
13
+ success: boolean;
14
+ file?: UploadedFile;
15
+ error?: string;
16
+ }
17
+ export type ProgressCallback = (progress: UploadProgress) => void;
18
+ /**
19
+ * Validates files against attachment configuration
20
+ */
21
+ export declare function validateFiles(files: File[], config: AttachmentConfig, currentFileCount: number): FileValidationResult;
22
+ /**
23
+ * Uploads a file to a presigned URL with progress tracking
24
+ */
25
+ export declare function uploadFilePresigned(file: File, getUploadUrl: (meta: {
26
+ filename: string;
27
+ contentType: string;
28
+ size: number;
29
+ }) => Promise<{
30
+ uploadUrl: string;
31
+ fileUrl: string;
32
+ }>, onProgress?: ProgressCallback): Promise<UploadResult>;
33
+ /**
34
+ * Uploads multiple files with presigned URLs
35
+ */
36
+ export declare function uploadFilesPresigned(files: File[], getUploadUrl: (meta: {
37
+ filename: string;
38
+ contentType: string;
39
+ size: number;
40
+ }) => Promise<{
41
+ uploadUrl: string;
42
+ fileUrl: string;
43
+ }>, onProgress?: ProgressCallback): Promise<UploadResult[]>;
44
+ /**
45
+ * Converts a file to base64 string (without data URL prefix)
46
+ */
47
+ export declare function fileToBase64(file: File): Promise<string>;
48
+ /**
49
+ * Converts multiple files to base64
50
+ */
51
+ export declare function filesToBase64(files: File[]): Promise<Array<{
52
+ filename: string;
53
+ contentType: string;
54
+ size: number;
55
+ data: string;
56
+ }>>;
57
+ /**
58
+ * Formats file size in human-readable format
59
+ */
60
+ export declare function formatFileSize(bytes: number): string;
61
+ /**
62
+ * Gets file extension from filename
63
+ */
64
+ export declare function getFileExtension(filename: string): string;
65
+ /**
66
+ * Checks if file matches accept pattern
67
+ */
68
+ export declare function matchesAcceptPattern(file: File, accept?: string): boolean;
@@ -0,0 +1,10 @@
1
+ import type { Article } from "../schema/article";
2
+ /**
3
+ * Search articles by query string
4
+ * Searches in title, description, and content
5
+ */
6
+ export declare function searchArticles(articles: Article[], query: string): Article[];
7
+ /**
8
+ * Get related articles based on category
9
+ */
10
+ export declare function getRelatedArticles(articles: Article[], currentArticle: Article, limit?: number): Article[];