@spotify-confidence/csr-common 0.18.0 → 0.18.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.18.1](https://github.com/spotify/confidence-sdk-js/compare/csr-common-v0.18.0...csr-common-v0.18.1) (2026-07-01)
4
+
5
+
6
+ ### ✨ New Features
7
+
8
+ * **csr-common:** add analyzer custom event types ([#391](https://github.com/spotify/confidence-sdk-js/issues/391)) ([09f135b](https://github.com/spotify/confidence-sdk-js/commit/09f135b38743b7726bc7e690d864a148fd49b2bb))
9
+
3
10
  ## [0.18.0](https://github.com/spotify/confidence-sdk-js/compare/csr-common-v0.17.3...csr-common-v0.18.0) (2026-06-30)
4
11
 
5
12
 
package/dist/index.d.cts CHANGED
@@ -207,11 +207,39 @@ type FlagEvaluationPluginData = {
207
207
  variant: string;
208
208
  };
209
209
  };
210
+ type ErrorMessageCustomData = {
211
+ tag: "csr:errorMessage";
212
+ payload: {
213
+ text: string;
214
+ };
215
+ };
216
+ type DialogOpenedCustomData = {
217
+ tag: "csr:dialogOpened";
218
+ payload: {
219
+ content: string[];
220
+ };
221
+ };
222
+ type IdleGapCustomData = {
223
+ tag: "csr:idleGap";
224
+ payload: {
225
+ visibleGapS: number;
226
+ totalGapS: number;
227
+ hiddenS: number;
228
+ trailing: boolean;
229
+ };
230
+ };
231
+ type AwayGapCustomData = {
232
+ tag: "csr:awayGap";
233
+ payload: {
234
+ totalGapS: number;
235
+ hiddenS: number;
236
+ };
237
+ };
210
238
  /**
211
239
  * Closed union of every Custom event we emit. Add a new variant here when
212
240
  * introducing a new tag — emitting an unregistered tag is a TS error.
213
241
  */
214
- type CustomEventData = ClickCustomData | InputCustomData | RageClickCustomData | FormFieldReEditCustomData | ScrollBackCustomData | DeadClickCustomData | TabUnfocusCustomData | TabRefocusCustomData | RouteChangeCustomData;
242
+ type CustomEventData = ClickCustomData | InputCustomData | RageClickCustomData | FormFieldReEditCustomData | ScrollBackCustomData | DeadClickCustomData | TabUnfocusCustomData | TabRefocusCustomData | RouteChangeCustomData | ErrorMessageCustomData | DialogOpenedCustomData | IdleGapCustomData | AwayGapCustomData;
215
243
  /**
216
244
  * A single recorded event.
217
245
  *
@@ -245,4 +273,4 @@ declare function validateKey(key: string): string | null;
245
273
  declare function validateTagValue(value: string | undefined): string | null;
246
274
  declare function validateMeasureValue(value: number | undefined): string | null;
247
275
  //#endregion
248
- export { type ClickCustomData, type ClientContext, type ConsoleLogLevel, type ConsoleLogPluginData, type CustomEventData, type DeadClickCustomData, type ElementDescriptor, type FlagEvaluationPluginData, type FormFieldReEditCustomData, type Frame, IncrementalSource, type InputCustomData, MAX_DISTINCT_KEYS, MAX_KEY_LENGTH, MAX_TAG_VALUE_LENGTH, MAX_VALUES_PER_KEY, type MeasurePluginData, MouseInteractions, type NetworkRequestInitiator, type NetworkRequestPluginData, type RageClickCustomData, type RecordingEvent, RecordingEventType, type RouteChangeCustomData, type RouteChangePayload, type RouteChangePluginData, type RouteChangeTrigger, type ScrollBackCustomData, SerializedNodeType, type TabRefocusCustomData, type TabUnfocusCustomData, type TabVisibilityPluginData, type TagPluginData, type UserAgentContext, stripUrl, validateKey, validateMeasureValue, validateTagValue };
276
+ export { type AwayGapCustomData, type ClickCustomData, type ClientContext, type ConsoleLogLevel, type ConsoleLogPluginData, type CustomEventData, type DeadClickCustomData, type DialogOpenedCustomData, type ElementDescriptor, type ErrorMessageCustomData, type FlagEvaluationPluginData, type FormFieldReEditCustomData, type Frame, type IdleGapCustomData, IncrementalSource, type InputCustomData, MAX_DISTINCT_KEYS, MAX_KEY_LENGTH, MAX_TAG_VALUE_LENGTH, MAX_VALUES_PER_KEY, type MeasurePluginData, MouseInteractions, type NetworkRequestInitiator, type NetworkRequestPluginData, type RageClickCustomData, type RecordingEvent, RecordingEventType, type RouteChangeCustomData, type RouteChangePayload, type RouteChangePluginData, type RouteChangeTrigger, type ScrollBackCustomData, SerializedNodeType, type TabRefocusCustomData, type TabUnfocusCustomData, type TabVisibilityPluginData, type TagPluginData, type UserAgentContext, stripUrl, validateKey, validateMeasureValue, validateTagValue };
package/dist/index.d.ts CHANGED
@@ -207,11 +207,39 @@ type FlagEvaluationPluginData = {
207
207
  variant: string;
208
208
  };
209
209
  };
210
+ type ErrorMessageCustomData = {
211
+ tag: "csr:errorMessage";
212
+ payload: {
213
+ text: string;
214
+ };
215
+ };
216
+ type DialogOpenedCustomData = {
217
+ tag: "csr:dialogOpened";
218
+ payload: {
219
+ content: string[];
220
+ };
221
+ };
222
+ type IdleGapCustomData = {
223
+ tag: "csr:idleGap";
224
+ payload: {
225
+ visibleGapS: number;
226
+ totalGapS: number;
227
+ hiddenS: number;
228
+ trailing: boolean;
229
+ };
230
+ };
231
+ type AwayGapCustomData = {
232
+ tag: "csr:awayGap";
233
+ payload: {
234
+ totalGapS: number;
235
+ hiddenS: number;
236
+ };
237
+ };
210
238
  /**
211
239
  * Closed union of every Custom event we emit. Add a new variant here when
212
240
  * introducing a new tag — emitting an unregistered tag is a TS error.
213
241
  */
214
- type CustomEventData = ClickCustomData | InputCustomData | RageClickCustomData | FormFieldReEditCustomData | ScrollBackCustomData | DeadClickCustomData | TabUnfocusCustomData | TabRefocusCustomData | RouteChangeCustomData;
242
+ type CustomEventData = ClickCustomData | InputCustomData | RageClickCustomData | FormFieldReEditCustomData | ScrollBackCustomData | DeadClickCustomData | TabUnfocusCustomData | TabRefocusCustomData | RouteChangeCustomData | ErrorMessageCustomData | DialogOpenedCustomData | IdleGapCustomData | AwayGapCustomData;
215
243
  /**
216
244
  * A single recorded event.
217
245
  *
@@ -245,4 +273,4 @@ declare function validateKey(key: string): string | null;
245
273
  declare function validateTagValue(value: string | undefined): string | null;
246
274
  declare function validateMeasureValue(value: number | undefined): string | null;
247
275
  //#endregion
248
- export { type ClickCustomData, type ClientContext, type ConsoleLogLevel, type ConsoleLogPluginData, type CustomEventData, type DeadClickCustomData, type ElementDescriptor, type FlagEvaluationPluginData, type FormFieldReEditCustomData, type Frame, IncrementalSource, type InputCustomData, MAX_DISTINCT_KEYS, MAX_KEY_LENGTH, MAX_TAG_VALUE_LENGTH, MAX_VALUES_PER_KEY, type MeasurePluginData, MouseInteractions, type NetworkRequestInitiator, type NetworkRequestPluginData, type RageClickCustomData, type RecordingEvent, RecordingEventType, type RouteChangeCustomData, type RouteChangePayload, type RouteChangePluginData, type RouteChangeTrigger, type ScrollBackCustomData, SerializedNodeType, type TabRefocusCustomData, type TabUnfocusCustomData, type TabVisibilityPluginData, type TagPluginData, type UserAgentContext, stripUrl, validateKey, validateMeasureValue, validateTagValue };
276
+ export { type AwayGapCustomData, type ClickCustomData, type ClientContext, type ConsoleLogLevel, type ConsoleLogPluginData, type CustomEventData, type DeadClickCustomData, type DialogOpenedCustomData, type ElementDescriptor, type ErrorMessageCustomData, type FlagEvaluationPluginData, type FormFieldReEditCustomData, type Frame, type IdleGapCustomData, IncrementalSource, type InputCustomData, MAX_DISTINCT_KEYS, MAX_KEY_LENGTH, MAX_TAG_VALUE_LENGTH, MAX_VALUES_PER_KEY, type MeasurePluginData, MouseInteractions, type NetworkRequestInitiator, type NetworkRequestPluginData, type RageClickCustomData, type RecordingEvent, RecordingEventType, type RouteChangeCustomData, type RouteChangePayload, type RouteChangePluginData, type RouteChangeTrigger, type ScrollBackCustomData, SerializedNodeType, type TabRefocusCustomData, type TabUnfocusCustomData, type TabVisibilityPluginData, type TagPluginData, type UserAgentContext, stripUrl, validateKey, validateMeasureValue, validateTagValue };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotify-confidence/csr-common",
3
3
  "license": "Apache-2.0",
4
- "version": "0.18.0",
4
+ "version": "0.18.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/spotify/confidence-sdk-js.git",
package/src/events.ts CHANGED
@@ -227,6 +227,38 @@ export type FlagEvaluationPluginData = {
227
227
  };
228
228
  };
229
229
 
230
+ export type ErrorMessageCustomData = {
231
+ tag: 'csr:errorMessage';
232
+ payload: {
233
+ text: string;
234
+ };
235
+ };
236
+
237
+ export type DialogOpenedCustomData = {
238
+ tag: 'csr:dialogOpened';
239
+ payload: {
240
+ content: string[];
241
+ };
242
+ };
243
+
244
+ export type IdleGapCustomData = {
245
+ tag: 'csr:idleGap';
246
+ payload: {
247
+ visibleGapS: number;
248
+ totalGapS: number;
249
+ hiddenS: number;
250
+ trailing: boolean;
251
+ };
252
+ };
253
+
254
+ export type AwayGapCustomData = {
255
+ tag: 'csr:awayGap';
256
+ payload: {
257
+ totalGapS: number;
258
+ hiddenS: number;
259
+ };
260
+ };
261
+
230
262
  /**
231
263
  * Closed union of every Custom event we emit. Add a new variant here when
232
264
  * introducing a new tag — emitting an unregistered tag is a TS error.
@@ -240,7 +272,11 @@ export type CustomEventData =
240
272
  | DeadClickCustomData
241
273
  | TabUnfocusCustomData
242
274
  | TabRefocusCustomData
243
- | RouteChangeCustomData;
275
+ | RouteChangeCustomData
276
+ | ErrorMessageCustomData
277
+ | DialogOpenedCustomData
278
+ | IdleGapCustomData
279
+ | AwayGapCustomData;
244
280
 
245
281
  /**
246
282
  * A single recorded event.
package/src/index.ts CHANGED
@@ -23,6 +23,10 @@ export {
23
23
  type RouteChangePayload,
24
24
  type RouteChangeCustomData,
25
25
  type RouteChangePluginData,
26
+ type ErrorMessageCustomData,
27
+ type DialogOpenedCustomData,
28
+ type IdleGapCustomData,
29
+ type AwayGapCustomData,
26
30
  type TagPluginData,
27
31
  type MeasurePluginData,
28
32
  type FlagEvaluationPluginData,