@useinsider/guido 1.3.1-beta.cf510dd → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +664 -295
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +89 -63
  4. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
  5. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +5 -5
  6. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
  7. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  8. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -18
  9. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  10. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +19 -22
  11. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
  12. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
  13. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  14. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
  15. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
  16. package/dist/composables/useBlocksConfig.js +20 -23
  17. package/dist/composables/useConfig.js +5 -51
  18. package/dist/composables/useHtmlCompiler.js +19 -20
  19. package/dist/composables/useHtmlValidator.js +41 -41
  20. package/dist/composables/usePartner.js +9 -19
  21. package/dist/composables/useStripo.js +11 -11
  22. package/dist/composables/useTranslations.js +2 -3
  23. package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
  24. package/dist/enums/defaults.js +67 -3
  25. package/dist/enums/unsubscribe.js +20 -23
  26. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +11 -12
  27. package/dist/guido.css +1 -1
  28. package/dist/library.js +2 -12
  29. package/dist/node_modules/lodash-es/_apply.js +16 -0
  30. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
  31. package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
  32. package/dist/node_modules/lodash-es/_assignValue.js +10 -0
  33. package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
  34. package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
  35. package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
  36. package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
  37. package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
  38. package/dist/node_modules/lodash-es/_baseRest.js +9 -0
  39. package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
  40. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  41. package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
  42. package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  43. package/dist/node_modules/lodash-es/_copyArray.js +9 -0
  44. package/dist/node_modules/lodash-es/_copyObject.js +14 -0
  45. package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
  46. package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
  47. package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
  48. package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
  49. package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
  50. package/dist/node_modules/lodash-es/_overRest.js +15 -0
  51. package/dist/node_modules/lodash-es/_safeGet.js +7 -0
  52. package/dist/node_modules/lodash-es/_setToString.js +6 -0
  53. package/dist/node_modules/lodash-es/_shortOut.js +16 -0
  54. package/dist/node_modules/lodash-es/constant.js +8 -0
  55. package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
  56. package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
  57. package/dist/node_modules/lodash-es/keysIn.js +9 -0
  58. package/dist/node_modules/lodash-es/merge.js +8 -0
  59. package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
  60. package/dist/node_modules/valibot/dist/index.js +103 -476
  61. package/dist/services/templateLibraryApi.js +18 -18
  62. package/dist/src/@types/generic.d.ts +45 -4
  63. package/dist/src/components/Guido.vue.d.ts +12 -13
  64. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  65. package/dist/src/composables/useConfig.d.ts +2 -184
  66. package/dist/src/composables/usePartner.d.ts +0 -8
  67. package/dist/src/enums/defaults.d.ts +6 -4
  68. package/dist/src/enums/unsubscribe.d.ts +1 -5
  69. package/dist/src/library.d.ts +1 -3
  70. package/dist/src/stores/config.d.ts +102 -1547
  71. package/dist/stores/config.js +9 -141
  72. package/package.json +1 -1
  73. package/dist/@types/config/defaults.js +0 -44
  74. package/dist/@types/config/schemas.js +0 -229
  75. package/dist/@types/config/validator.js +0 -56
  76. package/dist/src/@types/config/defaults.d.ts +0 -68
  77. package/dist/src/@types/config/index.d.ts +0 -14
  78. package/dist/src/@types/config/schemas.d.ts +0 -505
  79. package/dist/src/@types/config/types.d.ts +0 -142
  80. package/dist/src/@types/config/validator.d.ts +0 -119
@@ -1,119 +0,0 @@
1
- /**
2
- * Guido Configuration Validator
3
- *
4
- * Utilities for validating and parsing Guido configuration.
5
- * Provides both throwing and non-throwing validation methods.
6
- * @module @types/config/validator
7
- */
8
- import type { GuidoConfig, GuidoConfigInput } from './types';
9
- /**
10
- * Result of config validation
11
- */
12
- export interface ValidationResult {
13
- /** Whether validation was successful */
14
- success: boolean;
15
- /** Validated and transformed config (only if success) */
16
- data?: GuidoConfig;
17
- /** Validation error messages (only if failed) */
18
- errors?: string[];
19
- }
20
- /**
21
- * Formatted validation error with path and message
22
- */
23
- export interface ValidationError {
24
- /** Dot-notation path to the invalid field */
25
- path: string;
26
- /** Error message */
27
- message: string;
28
- }
29
- /**
30
- * Validates configuration input and returns a result object.
31
- *
32
- * Use this for non-throwing validation where you want to handle errors yourself.
33
- * @example
34
- * ```typescript
35
- * const result = validateConfig({
36
- * identity: { templateId: 'tpl-1', userId: 'usr-1' },
37
- * partner: { name: 'acme-corp' },
38
- * });
39
- *
40
- * if (result.success) {
41
- * console.log(result.data); // Full GuidoConfig with defaults
42
- * } else {
43
- * console.error(result.errors); // ['[identity.templateId] templateId is required']
44
- * }
45
- * ```
46
- * @param input - Raw configuration input
47
- * @returns Validation result with success status and data or errors
48
- */
49
- export declare function validateConfig(input: GuidoConfigInput): ValidationResult;
50
- /**
51
- * Validates configuration and throws on error.
52
- *
53
- * Use this during component initialization where invalid config should halt execution.
54
- * @example
55
- * ```typescript
56
- * try {
57
- * const config = parseConfig({
58
- * identity: { templateId: 'tpl-1', userId: 'usr-1' },
59
- * partner: { name: 'acme-corp' },
60
- * });
61
- * // config is fully typed GuidoConfig
62
- * } catch (error) {
63
- * console.error('Invalid configuration:', error.message);
64
- * }
65
- * ```
66
- * @param input - Raw configuration input
67
- * @returns Validated GuidoConfig with all defaults applied
68
- */
69
- export declare function parseConfig(input: GuidoConfigInput): GuidoConfig;
70
- /**
71
- * Validates configuration with console warnings (non-throwing).
72
- *
73
- * Use this when you want to attempt recovery from invalid config.
74
- * Returns null on failure instead of throwing.
75
- * @example
76
- * ```typescript
77
- * const config = parseConfigSafe(userInput);
78
- * if (!config) {
79
- * // Use fallback configuration
80
- * return defaultConfig;
81
- * }
82
- * ```
83
- * @param input - Raw configuration input
84
- * @returns Validated GuidoConfig or null if validation fails
85
- */
86
- export declare function parseConfigSafe(input: GuidoConfigInput): GuidoConfig | null;
87
- /**
88
- * Get structured validation errors for detailed error handling.
89
- * @example
90
- * ```typescript
91
- * const errors = getValidationErrors(input);
92
- * errors.forEach(({ path, message }) => {
93
- * formErrors[path] = message;
94
- * });
95
- * ```
96
- * @param input - Raw configuration input
97
- * @returns Array of validation errors with paths, or empty array if valid
98
- */
99
- export declare function getValidationErrors(input: GuidoConfigInput): ValidationError[];
100
- /**
101
- * Check if a configuration input is valid without parsing.
102
- * @example
103
- * ```typescript
104
- * if (isValidConfig(userInput)) {
105
- * saveConfig(userInput);
106
- * }
107
- * ```
108
- * @param input - Raw configuration input
109
- * @returns True if valid, false otherwise
110
- */
111
- export declare function isValidConfig(input: unknown): input is GuidoConfigInput;
112
- /**
113
- * Validate just the identity section
114
- */
115
- export declare function validateIdentity(input: unknown): ValidationResult;
116
- /**
117
- * Validate just the partner section
118
- */
119
- export declare function validatePartner(input: unknown): ValidationResult;