@useinsider/guido 1.0.3-beta.e0403cf → 1.0.3-beta.e1adf59

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 (139) hide show
  1. package/README.md +3 -141
  2. package/dist/components/Guido.vue.js +10 -12
  3. package/dist/components/Guido.vue2.js +90 -67
  4. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -16
  6. package/dist/components/organisms/header/RightSlot.vue.js +11 -11
  7. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  8. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  9. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  11. package/dist/composables/useApiErrorTracking.js +120 -0
  12. package/dist/composables/useErrorTracking.js +98 -0
  13. package/dist/composables/useHttp.js +89 -52
  14. package/dist/composables/useStripo.js +160 -57
  15. package/dist/composables/useStripoErrorCategory.js +86 -0
  16. package/dist/composables/useStripoSlackNotifier.js +47 -0
  17. package/dist/config/migrator/index.js +6 -7
  18. package/dist/enums/defaults.js +8 -15
  19. package/dist/enums/onboarding.js +1 -2
  20. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  21. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  22. package/dist/extensions/Blocks/Recommendation/block.js +3 -6
  23. package/dist/extensions/Blocks/Recommendation/control.js +40 -69
  24. package/dist/extensions/Blocks/Recommendation/extension.js +7 -42
  25. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +22 -107
  26. package/dist/extensions/Blocks/Recommendation/template.js +200 -0
  27. package/dist/extensions/Blocks/common-control.js +43 -125
  28. package/dist/guido.css +1 -1
  29. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +100 -307
  30. package/dist/package.json.js +1 -1
  31. package/dist/services/slackNotificationService.js +167 -0
  32. package/dist/services/stripoApi.js +49 -19
  33. package/dist/services/stripoErrorDeduplicationService.js +91 -0
  34. package/dist/src/@types/generic.d.ts +0 -15
  35. package/dist/src/components/Guido.vue.d.ts +1 -1
  36. package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
  37. package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
  38. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  39. package/dist/src/composables/useApiErrorTracking.d.ts +26 -0
  40. package/dist/src/composables/useErrorTracking.d.ts +30 -0
  41. package/dist/src/composables/useStripoErrorCategory.d.ts +26 -0
  42. package/dist/src/composables/useStripoSlackNotifier.d.ts +8 -0
  43. package/dist/src/enums/onboarding.d.ts +0 -1
  44. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  45. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -6
  46. package/dist/src/extensions/Blocks/Recommendation/template.d.ts +6 -0
  47. package/dist/src/extensions/Blocks/common-control.d.ts +0 -21
  48. package/dist/src/services/slackNotificationService.d.ts +110 -0
  49. package/dist/src/services/stripoErrorDeduplicationService.d.ts +75 -0
  50. package/dist/src/stores/config.d.ts +0 -7
  51. package/dist/src/utils/dateUtil.d.ts +0 -21
  52. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  53. package/dist/static/styles/customEditorStyle.css.js +0 -5
  54. package/dist/utils/dateUtil.js +3 -24
  55. package/package.json +3 -3
  56. package/dist/composables/useBlocksConfig.js +0 -49
  57. package/dist/config/migrator/recommendationMigrator.js +0 -293
  58. package/dist/enums/date.js +0 -6
  59. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -103
  60. package/dist/extensions/Blocks/Recommendation/constants.js +0 -5
  61. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
  62. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
  63. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
  64. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
  65. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
  66. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
  67. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
  68. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
  69. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
  70. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
  71. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
  72. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
  73. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
  74. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
  75. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
  76. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
  77. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
  78. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
  79. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
  80. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
  81. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
  82. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
  83. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
  84. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
  85. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
  86. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
  87. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
  88. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
  89. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
  90. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
  91. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
  92. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
  93. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
  94. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
  95. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -160
  96. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -152
  97. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -180
  98. package/dist/src/composables/useBlocksConfig.d.ts +0 -11
  99. package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
  100. package/dist/src/enums/date.d.ts +0 -4
  101. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -28
  102. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -51
  103. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
  104. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
  105. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
  106. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
  107. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
  108. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
  109. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
  110. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
  111. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
  112. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
  113. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
  114. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
  115. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
  116. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
  117. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
  118. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
  119. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
  120. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
  121. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
  122. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
  123. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
  124. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
  125. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
  126. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
  127. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
  128. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
  129. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
  130. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
  131. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
  132. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
  133. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
  134. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
  135. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
  136. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
  137. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  138. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
  139. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -44
@@ -0,0 +1,167 @@
1
+ var d = Object.defineProperty;
2
+ var h = (t, e, r) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var i = (t, e, r) => h(t, typeof e != "symbol" ? e + "" : e, r);
4
+ class u {
5
+ constructor(e, r) {
6
+ i(this, "webhookUrl");
7
+ i(this, "channel");
8
+ i(this, "defaultUsername");
9
+ i(this, "enabled");
10
+ this.webhookUrl = e || void 0 || "", this.channel = (r == null ? void 0 : r.channel) || "#errors", this.defaultUsername = (r == null ? void 0 : r.username) || "Guido Error Bot", this.enabled = (r == null ? void 0 : r.enabled) !== !1, this.webhookUrl || (console.warn("[SlackNotificationService] Webhook URL not configured, Slack notifications disabled"), this.enabled = !1);
11
+ }
12
+ /**
13
+ * Send an error notification to Slack
14
+ */
15
+ async sendErrorNotification(e) {
16
+ if (!this.enabled || !this.webhookUrl)
17
+ return !1;
18
+ try {
19
+ const r = this.buildErrorPayload(e), a = await fetch(this.webhookUrl, {
20
+ method: "POST",
21
+ headers: {
22
+ "Content-Type": "application/json"
23
+ },
24
+ body: JSON.stringify(r)
25
+ });
26
+ return a.ok ? !0 : (console.error("[SlackNotificationService] Failed to send Slack notification:", a.statusText), !1);
27
+ } catch (r) {
28
+ return console.error("[SlackNotificationService] Error sending Slack notification:", r), !1;
29
+ }
30
+ }
31
+ /**
32
+ * Send a critical error that requires immediate attention
33
+ */
34
+ async sendCriticalError(e, r, a) {
35
+ return this.sendErrorNotification({
36
+ title: e,
37
+ message: r,
38
+ errorType: "critical",
39
+ severity: "critical",
40
+ context: a,
41
+ timestamp: Date.now()
42
+ });
43
+ }
44
+ /**
45
+ * Send a CORS error notification
46
+ */
47
+ async sendCorsErrorNotification(e, r) {
48
+ return this.sendCriticalError(
49
+ "CORS Error in Stripo Email Editor",
50
+ "Failed to load Stripo resources due to CORS restrictions",
51
+ {
52
+ resourceUrl: e,
53
+ ...r,
54
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
55
+ }
56
+ );
57
+ }
58
+ /**
59
+ * Send a plugin load error notification
60
+ */
61
+ async sendPluginLoadErrorNotification(e, r) {
62
+ return this.sendCriticalError(
63
+ "Stripo Plugin Failed to Load",
64
+ `Email editor initialization failed: ${e}`,
65
+ {
66
+ ...r,
67
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
68
+ }
69
+ );
70
+ }
71
+ /**
72
+ * Build Slack message payload from error notification
73
+ */
74
+ buildErrorPayload(e) {
75
+ const a = {
76
+ critical: "#E74C3C",
77
+ // Red
78
+ high: "#E67E22",
79
+ // Orange
80
+ medium: "#F39C12",
81
+ // Yellow
82
+ low: "#3498DB"
83
+ // Blue
84
+ }[e.severity] || "#95A5A6", l = [
85
+ {
86
+ title: "Error Type",
87
+ value: e.errorType,
88
+ short: !0
89
+ },
90
+ {
91
+ title: "Severity",
92
+ value: e.severity.toUpperCase(),
93
+ short: !0
94
+ },
95
+ {
96
+ title: "Timestamp",
97
+ value: e.timestamp ? new Date(e.timestamp).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
98
+ short: !0
99
+ }
100
+ ];
101
+ e.context && Object.entries(e.context).forEach(([n, c]) => {
102
+ l.length < 20 && l.push({
103
+ title: this.formatFieldTitle(n),
104
+ value: this.formatFieldValue(c),
105
+ short: !0
106
+ });
107
+ });
108
+ const s = {
109
+ color: a,
110
+ title: e.title,
111
+ text: e.message,
112
+ fields: l,
113
+ footer: "Guido Error Tracking",
114
+ ts: Math.floor((e.timestamp || Date.now()) / 1e3)
115
+ };
116
+ return e.stackTrace && (s.text = `${e.message}
117
+ \`\`\`${e.stackTrace}\`\`\``), {
118
+ channel: this.channel,
119
+ username: this.defaultUsername,
120
+ // eslint-disable-next-line camelcase
121
+ icon_emoji: ":warning:",
122
+ attachments: [s]
123
+ };
124
+ }
125
+ /**
126
+ * Format field title for Slack (e.g., emailId -> Email ID)
127
+ */
128
+ formatFieldTitle(e) {
129
+ return e.replace(/([A-Z])/g, " $1").replace(/^./, (r) => r.toUpperCase()).trim();
130
+ }
131
+ /**
132
+ * Format field value for Slack display
133
+ */
134
+ formatFieldValue(e) {
135
+ return e == null ? "(empty)" : typeof e == "object" ? JSON.stringify(e).slice(0, 500) : String(e).slice(0, 500);
136
+ }
137
+ /**
138
+ * Check if notifications are enabled
139
+ */
140
+ isEnabled() {
141
+ return this.enabled;
142
+ }
143
+ /**
144
+ * Update webhook URL
145
+ */
146
+ setWebhookUrl(e) {
147
+ this.webhookUrl = e, this.enabled = !!e;
148
+ }
149
+ /**
150
+ * Update channel
151
+ */
152
+ setChannel(e) {
153
+ this.channel = e;
154
+ }
155
+ /**
156
+ * Enable/disable notifications
157
+ */
158
+ setEnabled(e) {
159
+ this.enabled = e && !!this.webhookUrl;
160
+ }
161
+ }
162
+ let o = null;
163
+ const S = () => (o || (o = new u()), o);
164
+ export {
165
+ u as SlackNotificationService,
166
+ S as getSlackNotificationService
167
+ };
@@ -1,25 +1,45 @@
1
- import { useHttp as a } from "../composables/useHttp.js";
2
- import { useToaster as s } from "../composables/useToaster.js";
3
- const m = () => {
4
- const { get: r } = a(), { handleError: o } = s();
1
+ import { useApiErrorTracking as i } from "../composables/useApiErrorTracking.js";
2
+ import { useHttp as c } from "../composables/useHttp.js";
3
+ import { useToaster as p } from "../composables/useToaster.js";
4
+ const h = () => {
5
+ const { get: s } = c(), { handleError: n } = p(), { withParsingErrorTracking: a } = i();
5
6
  return {
6
7
  getToken: async () => {
7
8
  try {
8
- const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await r(`/stripo/get-user-token?test=${t}`);
9
- return e.body.token;
9
+ const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await s(`/stripo/get-user-token?test=${t}`);
10
+ return a(
11
+ () => {
12
+ var o;
13
+ if (!((o = e == null ? void 0 : e.body) != null && o.token))
14
+ throw new Error("Invalid token response: missing token in response body");
15
+ return e.body.token;
16
+ },
17
+ "/stripo/get-user-token",
18
+ e,
19
+ { endpoint: "/stripo/get-user-token", operation: "getToken" }
20
+ );
10
21
  } catch (t) {
11
- return o(t, "Failed to fetch token"), "";
22
+ return n(t, "Failed to fetch token"), "";
12
23
  }
13
24
  },
14
25
  getCustomFonts: async () => {
15
26
  try {
16
- const { data: t = [] } = await r("/stripo/get-partner-custom-fonts");
17
- return t.map((e) => ({
18
- ...e,
19
- active: !0
20
- }));
27
+ const { data: t = [] } = await s("/stripo/get-partner-custom-fonts");
28
+ return a(
29
+ () => {
30
+ if (!Array.isArray(t))
31
+ throw new Error("Invalid fonts response: expected array");
32
+ return t.map((r) => ({
33
+ ...r,
34
+ active: !0
35
+ }));
36
+ },
37
+ "/stripo/get-partner-custom-fonts",
38
+ t,
39
+ { endpoint: "/stripo/get-partner-custom-fonts", operation: "getCustomFonts" }
40
+ );
21
41
  } catch (t) {
22
- return o(t, "Failed to fetch custom fonts"), [];
42
+ return n(t, "Failed to fetch custom fonts"), [];
23
43
  }
24
44
  },
25
45
  getDefaultTemplate: async () => {
@@ -29,21 +49,31 @@ const m = () => {
29
49
  forceRecreate: !0
30
50
  };
31
51
  try {
32
- const { data: e } = await r("/stripo/default-template/0");
52
+ const { data: e } = await s("/stripo/default-template");
33
53
  try {
34
54
  return {
35
- ...JSON.parse(e),
55
+ ...a(
56
+ () => {
57
+ const o = JSON.parse(e);
58
+ if (!o.html)
59
+ throw new Error("Invalid template response: missing html field");
60
+ return o;
61
+ },
62
+ "/stripo/default-template",
63
+ e,
64
+ { endpoint: "/stripo/default-template", operation: "getDefaultTemplate" }
65
+ ),
36
66
  forceRecreate: !0
37
67
  };
38
- } catch {
39
- return t;
68
+ } catch (r) {
69
+ return r instanceof Error && !r.message.includes("Invalid template") && n(r, "Failed to parse template as JSON"), t;
40
70
  }
41
71
  } catch (e) {
42
- return o(e, "Failed to fetch default template"), t;
72
+ return n(e, "Failed to fetch default template"), t;
43
73
  }
44
74
  }
45
75
  };
46
76
  };
47
77
  export {
48
- m as useStripoApi
78
+ h as useStripoApi
49
79
  };
@@ -0,0 +1,91 @@
1
+ var c = Object.defineProperty;
2
+ var a = (e, r, t) => r in e ? c(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var n = (e, r, t) => a(e, typeof r != "symbol" ? r + "" : r, t);
4
+ class s {
5
+ constructor() {
6
+ n(this, "reportedErrors", /* @__PURE__ */ new Set());
7
+ }
8
+ /**
9
+ * Track an error locally to prevent duplicate Slack alerts
10
+ * Only sends Slack alert once per unique error within the same session
11
+ */
12
+ trackError(r) {
13
+ const t = this.getDeduplicationKey(r);
14
+ return this.reportedErrors.has(t) ? !1 : (this.reportedErrors.add(t), !0);
15
+ }
16
+ /**
17
+ * Track plugin load error locally (CORS, script failure, timeout)
18
+ */
19
+ trackPluginLoadError(r, t) {
20
+ return this.trackError({
21
+ errorType: "plugin_load_error",
22
+ errorMessage: r,
23
+ errorCategory: "critical",
24
+ context: {
25
+ ...t,
26
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
27
+ environment: "production"
28
+ },
29
+ reportedAt: (/* @__PURE__ */ new Date()).toISOString()
30
+ });
31
+ }
32
+ /**
33
+ * Track CORS error locally
34
+ */
35
+ trackCorsError(r, t) {
36
+ return this.trackError({
37
+ errorType: "cors_error",
38
+ errorMessage: r,
39
+ errorCategory: "handled",
40
+ context: {
41
+ ...t,
42
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
43
+ environment: "production"
44
+ },
45
+ reportedAt: (/* @__PURE__ */ new Date()).toISOString()
46
+ });
47
+ }
48
+ /**
49
+ * Track authentication error locally (token refresh failure)
50
+ * Tracks it, but Slack notifier decides whether to alert based on token expiration
51
+ */
52
+ trackAuthenticationError(r, t) {
53
+ return this.trackError({
54
+ errorType: "authentication_error",
55
+ errorMessage: r,
56
+ errorCategory: "critical",
57
+ context: {
58
+ ...t,
59
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
60
+ environment: "production"
61
+ },
62
+ reportedAt: (/* @__PURE__ */ new Date()).toISOString()
63
+ });
64
+ }
65
+ /**
66
+ * Generate unique deduplication key for error
67
+ * Format: "errorType:emailId:userId" to allow same error on different emails
68
+ */
69
+ getDeduplicationKey(r) {
70
+ const t = r.context.emailId || "unknown", i = r.context.userId || "unknown";
71
+ return `${r.errorType}:${t}:${i}`;
72
+ }
73
+ /**
74
+ * Clear tracked errors (for testing or session reset)
75
+ */
76
+ clearTrackedErrors() {
77
+ this.reportedErrors.clear();
78
+ }
79
+ /**
80
+ * Get count of errors tracked in this session
81
+ */
82
+ getTrackedErrorCount() {
83
+ return this.reportedErrors.size;
84
+ }
85
+ }
86
+ let o = null;
87
+ const u = () => (o || (o = new s()), o);
88
+ export {
89
+ s as StripoErrorDeduplicationService,
90
+ u as getStripoErrorDeduplicationService
91
+ };
@@ -6,31 +6,21 @@ type Features = {
6
6
  dynamicContent?: boolean;
7
7
  saveAsTemplate?: boolean;
8
8
  versionHistory?: boolean;
9
- testMessage?: boolean;
10
9
  };
11
10
  type Partner = {
12
11
  partnerName: string;
13
12
  productType: number;
14
13
  messageType: number;
15
14
  };
16
- export type GuidoBlockType = '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';
17
- export type GuidoCustomBlockType = 'dynamic-content' | 'checkbox-block' | 'radio-button-block' | 'recommendation-block' | 'unsubscribe-block' | 'coupon-block' | 'items-block';
18
- type BlocksConfig = {
19
- excludeDefaults?: GuidoBlockType[];
20
- includeCustoms?: GuidoCustomBlockType[];
21
- };
22
15
  export type GuidoConfig = {
23
16
  translationsPath: string;
24
17
  htmlCompilerRules?: CompilerRule[];
25
18
  ignoreDefaultHtmlCompilerRules?: boolean;
26
19
  useHeader?: boolean;
27
20
  emailHeader: EmailHeader;
28
- migrationDate: number;
29
21
  partner?: Partner;
30
22
  extensions?: Extensions;
31
23
  features?: Features;
32
- blocks?: BlocksConfig;
33
- backButtonLabel?: string;
34
24
  };
35
25
  export type TemplateConfig = {
36
26
  preselectedDynamicContentList?: DynamicContent[];
@@ -69,9 +59,4 @@ export type TextValueObject = {
69
59
  text: string;
70
60
  value: string;
71
61
  };
72
- export interface L10n {
73
- locale?: string;
74
- timezone?: string;
75
- time?: number;
76
- }
77
62
  export {};
@@ -11,6 +11,7 @@ type __VLS_Props = {
11
11
  css?: string;
12
12
  guidoConfig: GuidoConfig;
13
13
  templateConfig?: TemplateConfig;
14
+ traceId?: string;
14
15
  };
15
16
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
16
17
  dynamicContent: {
@@ -26,7 +27,6 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
26
27
  "save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
27
28
  "on-change": (hasChanges: boolean) => void;
28
29
  ready: () => void;
29
- "onboarding:finished": () => void;
30
30
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
31
31
  export default _default;
32
32
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,4 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
2
- "onboarding-finished": () => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
2
  export default _default;
@@ -1,4 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
2
- "onboarding-finished": () => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
4
2
  export default _default;
@@ -32,8 +32,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
32
32
  closeOnOutsideClick: boolean;
33
33
  footerStatus: boolean;
34
34
  }>>>, {
35
- size: "small" | "medium" | "large";
36
35
  description: string;
36
+ size: "small" | "medium" | "large";
37
37
  closeOnOutsideClick: boolean;
38
38
  footerButtonOptions: FooterButtonGroup;
39
39
  closeButtonStatus: boolean;
@@ -0,0 +1,26 @@
1
+ import type { HttpError, HttpResponse } from '@@/Composables/useHttp';
2
+ /**
3
+ * API error context with request/response details
4
+ */
5
+ export interface ApiErrorContext {
6
+ endpoint: string;
7
+ method?: string;
8
+ statusCode?: number;
9
+ statusText?: string;
10
+ errorType?: 'http_error' | 'network_error' | 'parsing_error' | 'timeout';
11
+ attemptNumber?: number;
12
+ retryable?: boolean;
13
+ [key: string]: unknown;
14
+ }
15
+ /**
16
+ * Tracks API failures including HTTP errors, network issues, and data parsing failures
17
+ * Integrates with the main error tracking system (Sentry + FullStory)
18
+ */
19
+ export declare const useApiErrorTracking: () => {
20
+ captureHttpError: (error: HttpError, endpoint: string, options?: Omit<ApiErrorContext, "endpoint">) => ApiErrorContext;
21
+ captureNetworkError: (error: Error, endpoint: string, options?: Omit<ApiErrorContext, "endpoint">) => ApiErrorContext;
22
+ captureParsingError: (error: unknown, endpoint: string, responseData?: unknown, options?: Omit<ApiErrorContext, "endpoint">) => ApiErrorContext;
23
+ captureTimeoutError: (endpoint: string, timeoutMs: number, options?: Omit<ApiErrorContext, "endpoint">) => ApiErrorContext;
24
+ withApiErrorTracking: <T>(apiCall: () => Promise<HttpResponse<T>>, endpoint: string, method?: string, options?: Omit<ApiErrorContext, "endpoint">) => Promise<HttpResponse<T>>;
25
+ withParsingErrorTracking: <T>(parser: () => T, endpoint: string, rawResponse?: unknown, options?: Omit<ApiErrorContext, "endpoint">) => T;
26
+ };
@@ -0,0 +1,30 @@
1
+ import type { Ref } from 'vue';
2
+ /**
3
+ * Error context for error tracking and correlation
4
+ */
5
+ export interface ErrorContext {
6
+ component?: string;
7
+ operation?: string;
8
+ templateId?: string;
9
+ userId?: string;
10
+ [key: string]: unknown;
11
+ }
12
+ /**
13
+ * Error tracking service for capturing and reporting errors
14
+ * Integrates with Sentry and FullStory for comprehensive error tracking
15
+ */
16
+ export declare const useErrorTracking: () => {
17
+ traceId: string;
18
+ errorCount: Readonly<Ref<number>>;
19
+ lastError: Readonly<Ref<Error | null>>;
20
+ captureError: (error: Error, context?: ErrorContext) => ErrorContext;
21
+ captureStripoError: (error: unknown, operation: string, additionalContext?: Record<string, unknown>, shouldLogToSentry?: boolean) => ErrorContext;
22
+ captureTimeoutError: (operation: string, timeoutMs: number, additionalContext?: Record<string, unknown>) => ErrorContext;
23
+ createTimeoutPromise: <T>(ms: number, operation: string, additionalContext?: Record<string, unknown>) => Promise<T>;
24
+ withTimeout: <T>(promise: Promise<T>, ms: number, operation: string, additionalContext?: Record<string, unknown>) => Promise<T>;
25
+ getErrorSummary: () => {
26
+ errorCount: number;
27
+ lastError: Error | null;
28
+ };
29
+ resetErrorTracking: () => void;
30
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Error categorization system for Stripo integration
3
+ * Determines whether errors should be logged to Sentry/FullStory, Slack, or both
4
+ *
5
+ * Note: Error type names use snake_case (e.g., plugin_load_error) to match
6
+ * error type strings used throughout the codebase. This is intentional and
7
+ * required for the categorization system to work correctly.
8
+ */
9
+ export type ErrorSeverity = 'critical' | 'warning' | 'info';
10
+ export type ErrorCaptureLevel = 'sentry_and_slack' | 'slack_only' | 'sentry_only';
11
+ export interface ErrorCategory {
12
+ type: string;
13
+ severity: ErrorSeverity;
14
+ captureLevel: ErrorCaptureLevel;
15
+ description: string;
16
+ }
17
+ /**
18
+ * Categorize an error based on its type
19
+ * Returns the error category with capture level and severity
20
+ */
21
+ export declare const useStripoErrorCategory: () => {
22
+ getErrorCategory: (errorType: string) => ErrorCategory;
23
+ shouldCaptureSentry: (errorType: string) => boolean;
24
+ shouldNotifySlack: (errorType: string) => boolean;
25
+ addErrorCategory: (category: ErrorCategory) => void;
26
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Slack notifications for Stripo errors
3
+ * Uses error categorization to determine which errors should trigger Slack alerts
4
+ * Prevents duplicate alerts within the same session
5
+ */
6
+ export declare const useStripoSlackNotifier: () => {
7
+ notifySlack: (errorMessage: string, errorType: string, additionalContext?: Record<string, unknown>) => Promise<boolean>;
8
+ };
@@ -1,2 +1 @@
1
1
  export declare const SERVICE_HOVER_SELECTORS: string[];
2
- export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/email-drag-drop-editor";
@@ -1,7 +1,6 @@
1
1
  import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
2
2
  export declare const BLOCK_ID = "recommendation-block";
3
3
  export declare class RecommendationBlock extends Block {
4
- constructor();
5
4
  getId(): string;
6
5
  getIcon(): string;
7
6
  getBlockCompositionType(): BlockCompositionType;
@@ -21,12 +21,6 @@ export declare class RecommendationBlockControl extends CommonControl {
21
21
  _onFilterChange(value: boolean): void;
22
22
  _onFilterSelectClick(): void;
23
23
  _onDataChange(item: string, value: string | number | string[]): void;
24
- /**
25
- * Get the current card composition from block data attribute or use default
26
- */
27
- _getCardComposition(): string[];
28
- _regenerateProductRows(): void;
29
- _debouncedRegenerateProductRows: import("@vueuse/shared").PromisifyFn<() => void>;
30
24
  _onCurrencyConfigChange(item: string, value: string | number): void;
31
25
  _onCurrencyChange(value: string): void;
32
26
  _setProductIdsVisibility(): void;
@@ -0,0 +1,6 @@
1
+ declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
2
+ /**
3
+ * @returns The template for the default checkbox block
4
+ */
5
+ export declare function getDefaultTemplate(): string;
6
+ export default migrationTemplate;
@@ -62,26 +62,5 @@ export declare abstract class CommonControl extends Control {
62
62
  */
63
63
  _GuIconButton({ name, icon, className }: IconButtonProps): string;
64
64
  _GuTwoColumns(children: string[]): string;
65
- /**
66
- * Creates an orderable (sortable) list control
67
- * @param name - The control name for value binding
68
- * @param items - Array of item keys/values
69
- * @param itemLabels - Optional array of objects with key and label properties for display
70
- * @returns HTML string for the orderable control
71
- */
72
- _GuOrderable(name: string, items: {
73
- key: string;
74
- label: string;
75
- content: string;
76
- }[]): string;
77
- _GuNestedControl(id: string, content: string): string;
78
- _GuExpandable(label: string, content: string): string;
79
- _GuColorPicker(name: string): string;
80
- _GuFontFamily(name: string, placeholder?: string): string;
81
- _GuRadioButtons(name: string, buttons: {
82
- text: string;
83
- value: string;
84
- }[]): string;
85
- _GuCheckbox(name: string, caption: string): string;
86
65
  }
87
66
  export {};