@useinsider/guido 1.4.3 → 1.4.4-beta.b4adc85

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 (80) hide show
  1. package/README.md +295 -664
  2. package/dist/@types/config/defaults.js +44 -0
  3. package/dist/@types/config/schemas.js +229 -0
  4. package/dist/@types/config/validator.js +56 -0
  5. package/dist/components/Guido.vue.js +1 -1
  6. package/dist/components/Guido.vue2.js +63 -89
  7. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
  8. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +5 -5
  9. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
  10. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +18 -15
  12. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  13. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +22 -19
  14. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
  15. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
  16. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  17. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
  18. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
  19. package/dist/composables/useBlocksConfig.js +23 -20
  20. package/dist/composables/useConfig.js +51 -5
  21. package/dist/composables/useHtmlCompiler.js +20 -19
  22. package/dist/composables/useHtmlValidator.js +41 -41
  23. package/dist/composables/usePartner.js +19 -9
  24. package/dist/composables/useStripo.js +11 -11
  25. package/dist/composables/useTranslations.js +3 -2
  26. package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
  27. package/dist/enums/defaults.js +3 -67
  28. package/dist/enums/unsubscribe.js +23 -20
  29. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +12 -11
  30. package/dist/guido.css +1 -1
  31. package/dist/library.js +12 -2
  32. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
  33. package/dist/node_modules/valibot/dist/index.js +476 -103
  34. package/dist/services/templateLibraryApi.js +18 -18
  35. package/dist/src/@types/config/defaults.d.ts +68 -0
  36. package/dist/src/@types/config/index.d.ts +14 -0
  37. package/dist/src/@types/config/schemas.d.ts +505 -0
  38. package/dist/src/@types/config/types.d.ts +142 -0
  39. package/dist/src/@types/config/validator.d.ts +119 -0
  40. package/dist/src/@types/generic.d.ts +4 -45
  41. package/dist/src/components/Guido.vue.d.ts +13 -12
  42. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  43. package/dist/src/composables/useConfig.d.ts +184 -2
  44. package/dist/src/composables/usePartner.d.ts +8 -0
  45. package/dist/src/enums/defaults.d.ts +4 -6
  46. package/dist/src/enums/unsubscribe.d.ts +5 -1
  47. package/dist/src/library.d.ts +3 -1
  48. package/dist/src/stores/config.d.ts +1547 -102
  49. package/dist/stores/config.js +141 -9
  50. package/package.json +1 -1
  51. package/dist/node_modules/lodash-es/_apply.js +0 -16
  52. package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
  53. package/dist/node_modules/lodash-es/_assignValue.js +0 -10
  54. package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
  55. package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
  56. package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
  57. package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
  58. package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  59. package/dist/node_modules/lodash-es/_baseRest.js +0 -9
  60. package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
  61. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  62. package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
  63. package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  64. package/dist/node_modules/lodash-es/_copyArray.js +0 -9
  65. package/dist/node_modules/lodash-es/_copyObject.js +0 -14
  66. package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
  67. package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
  68. package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
  69. package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
  70. package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
  71. package/dist/node_modules/lodash-es/_overRest.js +0 -15
  72. package/dist/node_modules/lodash-es/_safeGet.js +0 -7
  73. package/dist/node_modules/lodash-es/_setToString.js +0 -6
  74. package/dist/node_modules/lodash-es/_shortOut.js +0 -16
  75. package/dist/node_modules/lodash-es/constant.js +0 -8
  76. package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  77. package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
  78. package/dist/node_modules/lodash-es/keysIn.js +0 -9
  79. package/dist/node_modules/lodash-es/merge.js +0 -8
  80. package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
@@ -1,13 +1,13 @@
1
- import { useConfig as u } from "../composables/useConfig.js";
2
- import { useHttp as d } from "../composables/useHttp.js";
3
- import { useToaster as T } from "../composables/useToaster.js";
4
- import { useTranslations as f } from "../composables/useTranslations.js";
5
- import { EditorType as w } from "../enums/defaults.js";
6
- import { useSaveAsTemplateStore as b } from "../stores/save-as-template.js";
1
+ import { useConfig as T } from "../composables/useConfig.js";
2
+ import { useHttp as f } from "../composables/useHttp.js";
3
+ import { useToaster as w } from "../composables/useToaster.js";
4
+ import { useTranslations as b } from "../composables/useTranslations.js";
5
+ import { EditorType as h } from "../enums/defaults.js";
6
+ import { useSaveAsTemplateStore as C } from "../stores/save-as-template.js";
7
7
  import { base64EncodeWithSpecialChars as a } from "../utils/base64.js";
8
- import { useTemplatePreparation as h } from "../utils/templatePreparation.js";
9
- const I = () => {
10
- const { get: m, post: n } = d(), { handleError: o, showToaster: i } = T(), { config: l } = u(), p = f();
8
+ import { useTemplatePreparation as v } from "../utils/templatePreparation.js";
9
+ const L = () => {
10
+ const { get: m, post: n } = f(), { handleError: o, showToaster: i } = w(), { config: l } = T(), p = b();
11
11
  return {
12
12
  getCategories: async () => {
13
13
  try {
@@ -35,14 +35,14 @@ const I = () => {
35
35
  }
36
36
  },
37
37
  createTemplate: async () => {
38
- var e, t;
38
+ var e, t, g, y;
39
39
  try {
40
- const { prepareTemplateDetails: c } = h(), r = b(), s = await c(), g = {
40
+ const { prepareTemplateDetails: c } = v(), r = C(), s = await c(), u = {
41
41
  name: r.getTemplateName,
42
42
  categories: r.getSelectedCategoryIds,
43
- productId: ((e = l.partner) == null ? void 0 : e.productType) || 0,
44
- editorType: w,
45
- messageType: ((t = l.partner) == null ? void 0 : t.messageType) || 0,
43
+ productId: ((t = (e = l.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
44
+ editorType: h,
45
+ messageType: ((y = (g = l.value) == null ? void 0 : g.partner) == null ? void 0 : y.messageType) || 0,
46
46
  content: a(s.compiledHtml),
47
47
  css: a(s.css),
48
48
  unsubscriptionPreferencePageStatus: !1,
@@ -55,11 +55,11 @@ const I = () => {
55
55
  html: s.rawHtml,
56
56
  css: s.css
57
57
  })
58
- }, { data: { type: y } } = await n(
58
+ }, { data: { type: d } } = await n(
59
59
  "/newsletter/template-library/create-template",
60
- g
60
+ u
61
61
  );
62
- if (y === "alert") {
62
+ if (d === "alert") {
63
63
  i({
64
64
  message: p(
65
65
  "newsletter.template-library-save-alert",
@@ -83,5 +83,5 @@ const I = () => {
83
83
  };
84
84
  };
85
85
  export {
86
- I as useTemplateLibraryApi
86
+ L as useTemplateLibraryApi
87
87
  };
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Guido Configuration Defaults
3
+ *
4
+ * Default values for optional configuration sections.
5
+ * These are applied during validation when values are not provided.
6
+ * @module @types/config/defaults
7
+ */
8
+ import type { TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, EmailHeader } from './types';
9
+ /**
10
+ * Default email header values
11
+ */
12
+ export declare const DEFAULT_EMAIL_HEADER: EmailHeader;
13
+ /**
14
+ * Default template configuration
15
+ */
16
+ export declare const DEFAULT_TEMPLATE: TemplateConfig;
17
+ /**
18
+ * Default editor configuration
19
+ */
20
+ export declare const DEFAULT_EDITOR: EditorConfig;
21
+ /**
22
+ * Default UI configuration
23
+ */
24
+ export declare const DEFAULT_UI: UIConfig;
25
+ /**
26
+ * Default features configuration (all enabled)
27
+ */
28
+ export declare const DEFAULT_FEATURES: FeaturesConfig;
29
+ /**
30
+ * Default blocks configuration
31
+ */
32
+ export declare const DEFAULT_BLOCKS: BlocksConfig;
33
+ /**
34
+ * Default compiler configuration
35
+ */
36
+ export declare const DEFAULT_COMPILER: CompilerConfig;
37
+ /**
38
+ * Default product type (Email)
39
+ */
40
+ export declare const DEFAULT_PRODUCT_TYPE: 60;
41
+ /**
42
+ * Default message type (Promotional)
43
+ */
44
+ export declare const DEFAULT_MESSAGE_TYPE: 1;
45
+ /**
46
+ * Default username
47
+ */
48
+ export declare const DEFAULT_USERNAME = "Guido User";
49
+ /**
50
+ * Re-export message type constants
51
+ */
52
+ export { MessageType } from './schemas';
53
+ /**
54
+ * Re-export product type constants
55
+ */
56
+ export { ProductType } from './schemas';
57
+ /**
58
+ * Stripo editor type identifier
59
+ */
60
+ export declare const EDITOR_TYPE = 2;
61
+ /**
62
+ * Test partner names for development/QA
63
+ */
64
+ export declare const TEST_PARTNERS: readonly ["alfredtesting", "electio", "eurekatest", "gachapontestpart", "gluautomation1", "gluautomation2", "gluautomation3", "gluautomation4", "inone", "inshoppingcart", "krakentest", "leeroy", "newsletteruat", "ozaspava", "piratesquad", "qaautomation1", "qaautomation2", "qaautomation3", "qaautomation4", "roiautomation", "seleniumautomation", "seleniumautomation1", "seleniumautomation2", "seleniumautomation3", "shopbagg", "shopifytest", "singlepageqa", "testqa", "vikingsankara", "stripoeditorlivetest"];
65
+ /**
66
+ * Check if a partner is a test partner
67
+ */
68
+ export declare function isTestPartner(partnerName: string): boolean;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Guido Configuration Module
3
+ *
4
+ * This module provides a complete configuration system for Guido with:
5
+ * - Valibot schemas for runtime validation
6
+ * - TypeScript types inferred from schemas
7
+ * - Default values for optional configuration
8
+ * - Validation utilities
9
+ */
10
+ export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, CompilerRuleSchema, CompilerRuleTypeSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, } from './schemas';
11
+ export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
12
+ export { DEFAULT_EMAIL_HEADER, DEFAULT_TEMPLATE, DEFAULT_EDITOR, DEFAULT_UI, DEFAULT_FEATURES, DEFAULT_BLOCKS, DEFAULT_COMPILER, DEFAULT_PRODUCT_TYPE, DEFAULT_MESSAGE_TYPE, DEFAULT_USERNAME, EDITOR_TYPE, TEST_PARTNERS, isTestPartner, } from './defaults';
13
+ export { validateConfig, parseConfig, parseConfigSafe, getValidationErrors, isValidConfig, validateIdentity, validatePartner, } from './validator';
14
+ export type { ValidationResult, ValidationError, } from './validator';
@@ -0,0 +1,505 @@
1
+ /**
2
+ * Guido Configuration Schemas
3
+ *
4
+ * Valibot schemas for validating and transforming Guido configuration.
5
+ * All types are inferred from these schemas to ensure single source of truth.
6
+ * @module @types/config/schemas
7
+ */
8
+ import * as v from 'valibot';
9
+ /**
10
+ * Message type constants for email templates
11
+ */
12
+ export declare const MessageType: {
13
+ /** Promotional/marketing emails */
14
+ readonly PROMOTIONAL: 1;
15
+ /** Transactional/system emails */
16
+ readonly TRANSACTIONAL: 2;
17
+ };
18
+ /**
19
+ * Product type constants for different Insider products
20
+ */
21
+ export declare const ProductType: {
22
+ /** Standard email campaigns */
23
+ readonly EMAIL: 60;
24
+ /** Architect journey builder */
25
+ readonly ARCHITECT: 49;
26
+ /** Unsubscribe page builder */
27
+ readonly UNSUBSCRIBE_PAGES: 97;
28
+ };
29
+ /**
30
+ * Identity configuration - identifies the template and user
31
+ */
32
+ export declare const IdentitySchema: v.ObjectSchema<{
33
+ /** Unique identifier for the template being edited */
34
+ readonly templateId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "templateId is required">]>;
35
+ /** Unique identifier for the user editing the template */
36
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
37
+ /** Optional variation ID for A/B testing */
38
+ readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
39
+ }, undefined>;
40
+ /**
41
+ * Partner configuration - organization and product context
42
+ */
43
+ export declare const PartnerSchema: v.ObjectSchema<{
44
+ /** Partner/organization name (required) */
45
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "partner.name is required">]>;
46
+ /** Product type identifier */
47
+ readonly productType: v.OptionalSchema<v.PicklistSchema<[60, 49, 97], undefined>, 60>;
48
+ /** Message type (promotional or transactional) */
49
+ readonly messageType: v.OptionalSchema<v.PicklistSchema<[1, 2], undefined>, 1>;
50
+ /** Display name for the current user */
51
+ readonly username: v.OptionalSchema<v.StringSchema<undefined>, "Guido User">;
52
+ }, undefined>;
53
+ /**
54
+ * Dynamic content item schema
55
+ */
56
+ export declare const DynamicContentSchema: v.ObjectSchema<{
57
+ /** Display text for the dynamic content */
58
+ readonly text: v.StringSchema<undefined>;
59
+ /** Template variable value (e.g., {{username}}) */
60
+ readonly value: v.StringSchema<undefined>;
61
+ /** Fallback value if variable is empty */
62
+ readonly fallback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
63
+ /** Optional formatting options */
64
+ readonly format: v.OptionalSchema<v.ObjectSchema<{
65
+ readonly key: v.StringSchema<undefined>;
66
+ readonly value: v.StringSchema<undefined>;
67
+ }, undefined>, undefined>;
68
+ }, undefined>;
69
+ /**
70
+ * Template configuration - initial content and preselected values
71
+ */
72
+ export declare const TemplateSchema: v.ObjectSchema<{
73
+ /** Initial HTML content */
74
+ readonly html: v.OptionalSchema<v.StringSchema<undefined>, "">;
75
+ /** Initial CSS content */
76
+ readonly css: v.OptionalSchema<v.StringSchema<undefined>, "">;
77
+ /** Preselected dynamic content items */
78
+ readonly preselectedDynamicContent: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
79
+ /** Display text for the dynamic content */
80
+ readonly text: v.StringSchema<undefined>;
81
+ /** Template variable value (e.g., {{username}}) */
82
+ readonly value: v.StringSchema<undefined>;
83
+ /** Fallback value if variable is empty */
84
+ readonly fallback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
85
+ /** Optional formatting options */
86
+ readonly format: v.OptionalSchema<v.ObjectSchema<{
87
+ readonly key: v.StringSchema<undefined>;
88
+ readonly value: v.StringSchema<undefined>;
89
+ }, undefined>, undefined>;
90
+ }, undefined>, undefined>, readonly []>;
91
+ /** Selected unsubscribe page IDs */
92
+ readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
93
+ }, undefined>;
94
+ /**
95
+ * Email header configuration (sender name and subject)
96
+ */
97
+ export declare const EmailHeaderSchema: v.ObjectSchema<{
98
+ /** Sender display name */
99
+ readonly senderName: v.OptionalSchema<v.StringSchema<undefined>, "">;
100
+ /** Email subject line */
101
+ readonly subject: v.OptionalSchema<v.StringSchema<undefined>, "">;
102
+ }, undefined>;
103
+ /**
104
+ * Editor configuration - core editor settings
105
+ */
106
+ export declare const EditorSchema: v.ObjectSchema<{
107
+ /** Locale for the editor UI */
108
+ readonly locale: v.OptionalSchema<v.StringSchema<undefined>, "en">;
109
+ /** Path to translations object */
110
+ readonly translationsPath: v.OptionalSchema<v.StringSchema<undefined>, "window.trans.en">;
111
+ /** Migration date for template compatibility */
112
+ readonly migrationDate: v.OptionalSchema<v.NumberSchema<undefined>, 1759696858>;
113
+ /** Email header settings */
114
+ readonly emailHeader: v.OptionalSchema<v.ObjectSchema<{
115
+ /** Sender display name */
116
+ readonly senderName: v.OptionalSchema<v.StringSchema<undefined>, "">;
117
+ /** Email subject line */
118
+ readonly subject: v.OptionalSchema<v.StringSchema<undefined>, "">;
119
+ }, undefined>, {
120
+ readonly senderName: "";
121
+ readonly subject: "";
122
+ }>;
123
+ }, undefined>;
124
+ /**
125
+ * UI configuration - visual elements and layout
126
+ */
127
+ export declare const UISchema: v.ObjectSchema<{
128
+ /** Whether to show the header bar */
129
+ readonly showHeader: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
130
+ /** Custom label for back button (if shown) */
131
+ readonly backButtonLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
132
+ }, undefined>;
133
+ /**
134
+ * Features configuration - enable/disable editor features
135
+ */
136
+ export declare const FeaturesSchema: v.ObjectSchema<{
137
+ /** Enable dynamic content insertion */
138
+ readonly dynamicContent: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
139
+ /** Enable save as template functionality */
140
+ readonly saveAsTemplate: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
141
+ /** Enable version history */
142
+ readonly versionHistory: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
143
+ /** Enable test message sending */
144
+ readonly testMessage: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
145
+ /** Enable display conditions */
146
+ readonly displayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
147
+ /** Enable unsubscribe block */
148
+ readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
149
+ }, undefined>;
150
+ /**
151
+ * Default block types available in Stripo
152
+ */
153
+ export declare const DefaultBlockTypeSchema: v.PicklistSchema<["amp-accordion", "amp-carousel", "amp-form-controls", "banner-block", "button-block", "html-block", "image-block", "menu-block", "social-block", "spacer-block", "text-block", "timer-block", "video-block"], undefined>;
154
+ /**
155
+ * Custom block types added by Guido
156
+ */
157
+ export declare const CustomBlockTypeSchema: v.PicklistSchema<["dynamic-content", "checkbox-block", "radio-button-block", "recommendation-block", "unsubscribe-block", "coupon-block", "items-block"], undefined>;
158
+ /**
159
+ * Blocks configuration - include/exclude specific blocks
160
+ */
161
+ export declare const BlocksSchema: v.ObjectSchema<{
162
+ /** Default blocks to exclude from the editor */
163
+ readonly excludeDefaults: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["amp-accordion", "amp-carousel", "amp-form-controls", "banner-block", "button-block", "html-block", "image-block", "menu-block", "social-block", "spacer-block", "text-block", "timer-block", "video-block"], undefined>, undefined>, readonly []>;
164
+ /** Custom blocks to include in the editor */
165
+ readonly includeCustoms: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["dynamic-content", "checkbox-block", "radio-button-block", "recommendation-block", "unsubscribe-block", "coupon-block", "items-block"], undefined>, undefined>, readonly []>;
166
+ }, undefined>;
167
+ /**
168
+ * Compiler rule types
169
+ */
170
+ export declare const CompilerRuleTypeSchema: v.PicklistSchema<["replace", "regex", "remove", "custom"], undefined>;
171
+ /**
172
+ * Replace rule - simple string replacement
173
+ */
174
+ export declare const ReplaceRuleSchema: v.ObjectSchema<{
175
+ readonly type: v.LiteralSchema<"replace", undefined>;
176
+ /** String to search for */
177
+ readonly search: v.StringSchema<undefined>;
178
+ /** Replacement string */
179
+ readonly replacement: v.StringSchema<undefined>;
180
+ /** Replace all occurrences (default: false) */
181
+ readonly replaceAll: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
182
+ /** Unique identifier for the rule */
183
+ readonly id: v.StringSchema<undefined>;
184
+ /** Human-readable description */
185
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
186
+ /** Priority for rule ordering (lower = earlier) */
187
+ readonly priority: v.NumberSchema<undefined>;
188
+ }, undefined>;
189
+ /**
190
+ * Regex rule - regular expression replacement
191
+ */
192
+ export declare const RegexRuleSchema: v.ObjectSchema<{
193
+ readonly type: v.LiteralSchema<"regex", undefined>;
194
+ /** Regex pattern string */
195
+ readonly pattern: v.StringSchema<undefined>;
196
+ /** Replacement string (supports $1, $2, etc.) */
197
+ readonly replacement: v.StringSchema<undefined>;
198
+ /** Regex flags (e.g., 'gi') */
199
+ readonly flags: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
200
+ /** Unique identifier for the rule */
201
+ readonly id: v.StringSchema<undefined>;
202
+ /** Human-readable description */
203
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
204
+ /** Priority for rule ordering (lower = earlier) */
205
+ readonly priority: v.NumberSchema<undefined>;
206
+ }, undefined>;
207
+ /**
208
+ * Remove rule - remove matching content
209
+ */
210
+ export declare const RemoveRuleSchema: v.ObjectSchema<{
211
+ readonly type: v.LiteralSchema<"remove", undefined>;
212
+ /** Strings or patterns to remove */
213
+ readonly targets: v.ArraySchema<v.StringSchema<undefined>, undefined>;
214
+ /** Unique identifier for the rule */
215
+ readonly id: v.StringSchema<undefined>;
216
+ /** Human-readable description */
217
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
218
+ /** Priority for rule ordering (lower = earlier) */
219
+ readonly priority: v.NumberSchema<undefined>;
220
+ }, undefined>;
221
+ /**
222
+ * Custom rule - custom processing function
223
+ * Note: Functions cannot be validated at runtime, this is for type safety
224
+ */
225
+ export declare const CustomRuleSchema: v.ObjectSchema<{
226
+ readonly type: v.LiteralSchema<"custom", undefined>;
227
+ /** Custom processor function */
228
+ readonly processor: v.CustomSchema<(html: string) => string, v.ErrorMessage<v.CustomIssue> | undefined>;
229
+ /** Unique identifier for the rule */
230
+ readonly id: v.StringSchema<undefined>;
231
+ /** Human-readable description */
232
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
233
+ /** Priority for rule ordering (lower = earlier) */
234
+ readonly priority: v.NumberSchema<undefined>;
235
+ }, undefined>;
236
+ /**
237
+ * Union of all compiler rule types
238
+ */
239
+ export declare const CompilerRuleSchema: v.VariantSchema<"type", [v.ObjectSchema<{
240
+ readonly type: v.LiteralSchema<"replace", undefined>;
241
+ /** String to search for */
242
+ readonly search: v.StringSchema<undefined>;
243
+ /** Replacement string */
244
+ readonly replacement: v.StringSchema<undefined>;
245
+ /** Replace all occurrences (default: false) */
246
+ readonly replaceAll: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
247
+ /** Unique identifier for the rule */
248
+ readonly id: v.StringSchema<undefined>;
249
+ /** Human-readable description */
250
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
251
+ /** Priority for rule ordering (lower = earlier) */
252
+ readonly priority: v.NumberSchema<undefined>;
253
+ }, undefined>, v.ObjectSchema<{
254
+ readonly type: v.LiteralSchema<"regex", undefined>;
255
+ /** Regex pattern string */
256
+ readonly pattern: v.StringSchema<undefined>;
257
+ /** Replacement string (supports $1, $2, etc.) */
258
+ readonly replacement: v.StringSchema<undefined>;
259
+ /** Regex flags (e.g., 'gi') */
260
+ readonly flags: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
261
+ /** Unique identifier for the rule */
262
+ readonly id: v.StringSchema<undefined>;
263
+ /** Human-readable description */
264
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
265
+ /** Priority for rule ordering (lower = earlier) */
266
+ readonly priority: v.NumberSchema<undefined>;
267
+ }, undefined>, v.ObjectSchema<{
268
+ readonly type: v.LiteralSchema<"remove", undefined>;
269
+ /** Strings or patterns to remove */
270
+ readonly targets: v.ArraySchema<v.StringSchema<undefined>, undefined>;
271
+ /** Unique identifier for the rule */
272
+ readonly id: v.StringSchema<undefined>;
273
+ /** Human-readable description */
274
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
275
+ /** Priority for rule ordering (lower = earlier) */
276
+ readonly priority: v.NumberSchema<undefined>;
277
+ }, undefined>, v.ObjectSchema<{
278
+ readonly type: v.LiteralSchema<"custom", undefined>;
279
+ /** Custom processor function */
280
+ readonly processor: v.CustomSchema<(html: string) => string, v.ErrorMessage<v.CustomIssue> | undefined>;
281
+ /** Unique identifier for the rule */
282
+ readonly id: v.StringSchema<undefined>;
283
+ /** Human-readable description */
284
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
285
+ /** Priority for rule ordering (lower = earlier) */
286
+ readonly priority: v.NumberSchema<undefined>;
287
+ }, undefined>], undefined>;
288
+ /**
289
+ * Compiler configuration - HTML compilation settings
290
+ */
291
+ export declare const CompilerSchema: v.ObjectSchema<{
292
+ /** Custom compiler rules to apply */
293
+ readonly customRules: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
294
+ readonly type: v.LiteralSchema<"replace", undefined>;
295
+ /** String to search for */
296
+ readonly search: v.StringSchema<undefined>;
297
+ /** Replacement string */
298
+ readonly replacement: v.StringSchema<undefined>;
299
+ /** Replace all occurrences (default: false) */
300
+ readonly replaceAll: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
301
+ /** Unique identifier for the rule */
302
+ readonly id: v.StringSchema<undefined>;
303
+ /** Human-readable description */
304
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
305
+ /** Priority for rule ordering (lower = earlier) */
306
+ readonly priority: v.NumberSchema<undefined>;
307
+ }, undefined>, v.ObjectSchema<{
308
+ readonly type: v.LiteralSchema<"regex", undefined>;
309
+ /** Regex pattern string */
310
+ readonly pattern: v.StringSchema<undefined>;
311
+ /** Replacement string (supports $1, $2, etc.) */
312
+ readonly replacement: v.StringSchema<undefined>;
313
+ /** Regex flags (e.g., 'gi') */
314
+ readonly flags: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
315
+ /** Unique identifier for the rule */
316
+ readonly id: v.StringSchema<undefined>;
317
+ /** Human-readable description */
318
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
319
+ /** Priority for rule ordering (lower = earlier) */
320
+ readonly priority: v.NumberSchema<undefined>;
321
+ }, undefined>, v.ObjectSchema<{
322
+ readonly type: v.LiteralSchema<"remove", undefined>;
323
+ /** Strings or patterns to remove */
324
+ readonly targets: v.ArraySchema<v.StringSchema<undefined>, undefined>;
325
+ /** Unique identifier for the rule */
326
+ readonly id: v.StringSchema<undefined>;
327
+ /** Human-readable description */
328
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
329
+ /** Priority for rule ordering (lower = earlier) */
330
+ readonly priority: v.NumberSchema<undefined>;
331
+ }, undefined>, v.ObjectSchema<{
332
+ readonly type: v.LiteralSchema<"custom", undefined>;
333
+ /** Custom processor function */
334
+ readonly processor: v.CustomSchema<(html: string) => string, v.ErrorMessage<v.CustomIssue> | undefined>;
335
+ /** Unique identifier for the rule */
336
+ readonly id: v.StringSchema<undefined>;
337
+ /** Human-readable description */
338
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
339
+ /** Priority for rule ordering (lower = earlier) */
340
+ readonly priority: v.NumberSchema<undefined>;
341
+ }, undefined>], undefined>, undefined>, readonly []>;
342
+ /** Skip default compiler rules */
343
+ readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
344
+ }, undefined>;
345
+ /**
346
+ * Complete Guido configuration schema
347
+ *
348
+ * Organized by domain:
349
+ * - identity: Who is editing what
350
+ * - partner: Organization context
351
+ * - template: Initial content
352
+ * - editor: Core editor settings
353
+ * - ui: Visual elements
354
+ * - features: Feature toggles
355
+ * - blocks: Block configuration
356
+ * - compiler: HTML compilation
357
+ */
358
+ export declare const GuidoConfigSchema: v.ObjectSchema<{
359
+ /** Identity configuration (required) */
360
+ readonly identity: v.ObjectSchema<{
361
+ /** Unique identifier for the template being edited */
362
+ readonly templateId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "templateId is required">]>;
363
+ /** Unique identifier for the user editing the template */
364
+ readonly userId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "userId is required">]>;
365
+ /** Optional variation ID for A/B testing */
366
+ readonly variationId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
367
+ }, undefined>;
368
+ /** Partner configuration (required) */
369
+ readonly partner: v.ObjectSchema<{
370
+ /** Partner/organization name (required) */
371
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "partner.name is required">]>;
372
+ /** Product type identifier */
373
+ readonly productType: v.OptionalSchema<v.PicklistSchema<[60, 49, 97], undefined>, 60>;
374
+ /** Message type (promotional or transactional) */
375
+ readonly messageType: v.OptionalSchema<v.PicklistSchema<[1, 2], undefined>, 1>;
376
+ /** Display name for the current user */
377
+ readonly username: v.OptionalSchema<v.StringSchema<undefined>, "Guido User">;
378
+ }, undefined>;
379
+ /** Template content and presets */
380
+ readonly template: v.OptionalSchema<v.ObjectSchema<{
381
+ /** Initial HTML content */
382
+ readonly html: v.OptionalSchema<v.StringSchema<undefined>, "">;
383
+ /** Initial CSS content */
384
+ readonly css: v.OptionalSchema<v.StringSchema<undefined>, "">;
385
+ /** Preselected dynamic content items */
386
+ readonly preselectedDynamicContent: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
387
+ /** Display text for the dynamic content */
388
+ readonly text: v.StringSchema<undefined>;
389
+ /** Template variable value (e.g., {{username}}) */
390
+ readonly value: v.StringSchema<undefined>;
391
+ /** Fallback value if variable is empty */
392
+ readonly fallback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
393
+ /** Optional formatting options */
394
+ readonly format: v.OptionalSchema<v.ObjectSchema<{
395
+ readonly key: v.StringSchema<undefined>;
396
+ readonly value: v.StringSchema<undefined>;
397
+ }, undefined>, undefined>;
398
+ }, undefined>, undefined>, readonly []>;
399
+ /** Selected unsubscribe page IDs */
400
+ readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
401
+ }, undefined>, {}>;
402
+ /** Editor settings */
403
+ readonly editor: v.OptionalSchema<v.ObjectSchema<{
404
+ /** Locale for the editor UI */
405
+ readonly locale: v.OptionalSchema<v.StringSchema<undefined>, "en">;
406
+ /** Path to translations object */
407
+ readonly translationsPath: v.OptionalSchema<v.StringSchema<undefined>, "window.trans.en">;
408
+ /** Migration date for template compatibility */
409
+ readonly migrationDate: v.OptionalSchema<v.NumberSchema<undefined>, 1759696858>;
410
+ /** Email header settings */
411
+ readonly emailHeader: v.OptionalSchema<v.ObjectSchema<{
412
+ /** Sender display name */
413
+ readonly senderName: v.OptionalSchema<v.StringSchema<undefined>, "">;
414
+ /** Email subject line */
415
+ readonly subject: v.OptionalSchema<v.StringSchema<undefined>, "">;
416
+ }, undefined>, {
417
+ readonly senderName: "";
418
+ readonly subject: "";
419
+ }>;
420
+ }, undefined>, {}>;
421
+ /** UI configuration */
422
+ readonly ui: v.OptionalSchema<v.ObjectSchema<{
423
+ /** Whether to show the header bar */
424
+ readonly showHeader: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
425
+ /** Custom label for back button (if shown) */
426
+ readonly backButtonLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
427
+ }, undefined>, {}>;
428
+ /** Feature toggles */
429
+ readonly features: v.OptionalSchema<v.ObjectSchema<{
430
+ /** Enable dynamic content insertion */
431
+ readonly dynamicContent: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
432
+ /** Enable save as template functionality */
433
+ readonly saveAsTemplate: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
434
+ /** Enable version history */
435
+ readonly versionHistory: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
436
+ /** Enable test message sending */
437
+ readonly testMessage: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
438
+ /** Enable display conditions */
439
+ readonly displayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
440
+ /** Enable unsubscribe block */
441
+ readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
442
+ }, undefined>, {}>;
443
+ /** Block configuration */
444
+ readonly blocks: v.OptionalSchema<v.ObjectSchema<{
445
+ /** Default blocks to exclude from the editor */
446
+ readonly excludeDefaults: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["amp-accordion", "amp-carousel", "amp-form-controls", "banner-block", "button-block", "html-block", "image-block", "menu-block", "social-block", "spacer-block", "text-block", "timer-block", "video-block"], undefined>, undefined>, readonly []>;
447
+ /** Custom blocks to include in the editor */
448
+ readonly includeCustoms: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["dynamic-content", "checkbox-block", "radio-button-block", "recommendation-block", "unsubscribe-block", "coupon-block", "items-block"], undefined>, undefined>, readonly []>;
449
+ }, undefined>, {}>;
450
+ /** Compiler configuration */
451
+ readonly compiler: v.OptionalSchema<v.ObjectSchema<{
452
+ /** Custom compiler rules to apply */
453
+ readonly customRules: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
454
+ readonly type: v.LiteralSchema<"replace", undefined>;
455
+ /** String to search for */
456
+ readonly search: v.StringSchema<undefined>;
457
+ /** Replacement string */
458
+ readonly replacement: v.StringSchema<undefined>;
459
+ /** Replace all occurrences (default: false) */
460
+ readonly replaceAll: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
461
+ /** Unique identifier for the rule */
462
+ readonly id: v.StringSchema<undefined>;
463
+ /** Human-readable description */
464
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
465
+ /** Priority for rule ordering (lower = earlier) */
466
+ readonly priority: v.NumberSchema<undefined>;
467
+ }, undefined>, v.ObjectSchema<{
468
+ readonly type: v.LiteralSchema<"regex", undefined>;
469
+ /** Regex pattern string */
470
+ readonly pattern: v.StringSchema<undefined>;
471
+ /** Replacement string (supports $1, $2, etc.) */
472
+ readonly replacement: v.StringSchema<undefined>;
473
+ /** Regex flags (e.g., 'gi') */
474
+ readonly flags: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
475
+ /** Unique identifier for the rule */
476
+ readonly id: v.StringSchema<undefined>;
477
+ /** Human-readable description */
478
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
479
+ /** Priority for rule ordering (lower = earlier) */
480
+ readonly priority: v.NumberSchema<undefined>;
481
+ }, undefined>, v.ObjectSchema<{
482
+ readonly type: v.LiteralSchema<"remove", undefined>;
483
+ /** Strings or patterns to remove */
484
+ readonly targets: v.ArraySchema<v.StringSchema<undefined>, undefined>;
485
+ /** Unique identifier for the rule */
486
+ readonly id: v.StringSchema<undefined>;
487
+ /** Human-readable description */
488
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
489
+ /** Priority for rule ordering (lower = earlier) */
490
+ readonly priority: v.NumberSchema<undefined>;
491
+ }, undefined>, v.ObjectSchema<{
492
+ readonly type: v.LiteralSchema<"custom", undefined>;
493
+ /** Custom processor function */
494
+ readonly processor: v.CustomSchema<(html: string) => string, v.ErrorMessage<v.CustomIssue> | undefined>;
495
+ /** Unique identifier for the rule */
496
+ readonly id: v.StringSchema<undefined>;
497
+ /** Human-readable description */
498
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
499
+ /** Priority for rule ordering (lower = earlier) */
500
+ readonly priority: v.NumberSchema<undefined>;
501
+ }, undefined>], undefined>, undefined>, readonly []>;
502
+ /** Skip default compiler rules */
503
+ readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
504
+ }, undefined>, {}>;
505
+ }, undefined>;