@spotify-confidence/csr-common 0.18.6 → 0.18.8
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 +14 -0
- package/dist/index.d.cts +21 -2
- package/dist/index.d.ts +21 -2
- package/package.json +1 -1
- package/src/events.ts +22 -0
- package/src/index.ts +2 -0
- package/src/uploader/create-uploader.test.ts +24 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.18.8](https://github.com/spotify/confidence-sdk-js/compare/csr-common-v0.18.7...csr-common-v0.18.8) (2026-08-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ✨ New Features
|
|
7
|
+
|
|
8
|
+
* expose clipboard input provenance types ([#446](https://github.com/spotify/confidence-sdk-js/issues/446)) ([c955079](https://github.com/spotify/confidence-sdk-js/commit/c9550793998c8f2e043d926b9e5ec1690304da91))
|
|
9
|
+
|
|
10
|
+
## [0.18.7](https://github.com/spotify/confidence-sdk-js/compare/csr-common-v0.18.6...csr-common-v0.18.7) (2026-08-18)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ✨ New Features
|
|
14
|
+
|
|
15
|
+
* **csr-recorder:** capture click modifier keys ([#435](https://github.com/spotify/confidence-sdk-js/issues/435)) ([a1e7a96](https://github.com/spotify/confidence-sdk-js/commit/a1e7a96996cd2f361f3b44cc924d6b4d5ff0b003))
|
|
16
|
+
|
|
3
17
|
## [0.18.6](https://github.com/spotify/confidence-sdk-js/compare/csr-common-v0.18.5...csr-common-v0.18.6) (2026-08-18)
|
|
4
18
|
|
|
5
19
|
|
package/dist/index.d.cts
CHANGED
|
@@ -70,7 +70,12 @@ type MouseInteractionData = {
|
|
|
70
70
|
id: number;
|
|
71
71
|
x?: number;
|
|
72
72
|
y?: number;
|
|
73
|
-
pointerType?: number;
|
|
73
|
+
pointerType?: number; /** Mouse button and modifier keys present on click events. */
|
|
74
|
+
button?: number;
|
|
75
|
+
altKey?: boolean;
|
|
76
|
+
ctrlKey?: boolean;
|
|
77
|
+
metaKey?: boolean;
|
|
78
|
+
shiftKey?: boolean;
|
|
74
79
|
};
|
|
75
80
|
type SelectionRange = {
|
|
76
81
|
start: number;
|
|
@@ -138,6 +143,11 @@ type ClickCustomData = {
|
|
|
138
143
|
targetId: number;
|
|
139
144
|
element?: ElementDescriptor;
|
|
140
145
|
pathname?: string;
|
|
146
|
+
button?: number;
|
|
147
|
+
altKey?: boolean;
|
|
148
|
+
ctrlKey?: boolean;
|
|
149
|
+
metaKey?: boolean;
|
|
150
|
+
shiftKey?: boolean;
|
|
141
151
|
};
|
|
142
152
|
};
|
|
143
153
|
type InputCustomData = {
|
|
@@ -149,6 +159,15 @@ type InputCustomData = {
|
|
|
149
159
|
pathname?: string;
|
|
150
160
|
fieldType?: string;
|
|
151
161
|
hasValue?: boolean;
|
|
162
|
+
source?: "paste";
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
type ClipboardAction = "copy" | "cut" | "paste";
|
|
166
|
+
type ClipboardPluginData = {
|
|
167
|
+
plugin: "csr/clipboard@1";
|
|
168
|
+
payload: {
|
|
169
|
+
action: ClipboardAction;
|
|
170
|
+
targetId: number;
|
|
152
171
|
};
|
|
153
172
|
};
|
|
154
173
|
type DeadClickCustomData = {
|
|
@@ -334,4 +353,4 @@ declare function validateKey(key: string): string | null;
|
|
|
334
353
|
declare function validateTagValue(value: string | undefined): string | null;
|
|
335
354
|
declare function validateMeasureValue(value: number | undefined): string | null;
|
|
336
355
|
//#endregion
|
|
337
|
-
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 GraphQLRequestMetadata, type IdleGapCustomData, type IncrementalSnapshotData, IncrementalSource, type InputCustomData, MAX_DISTINCT_KEYS, MAX_KEY_LENGTH, MAX_TAG_VALUE_LENGTH, MAX_VALUES_PER_KEY, type MeasurePluginData, type MouseInteractionData, MouseInteractions, type NetworkRequestInitiator, type NetworkRequestPluginData, type OpaqueIncrementalData, type RageClickCustomData, type RecordingEvent, RecordingEventType, type RouteChangeCustomData, type RouteChangePayload, type RouteChangePluginData, type RouteChangeTrigger, type ScrollBackCustomData, type SelectionData, type SelectionRange, SerializedNodeType, type TabRefocusCustomData, type TabUnfocusCustomData, type TabVisibilityPluginData, type TagPluginData, type UserAgentContext, stripUrl, validateKey, validateMeasureValue, validateTagValue };
|
|
356
|
+
export { type AwayGapCustomData, type ClickCustomData, type ClientContext, type ClipboardAction, type ClipboardPluginData, type ConsoleLogLevel, type ConsoleLogPluginData, type CustomEventData, type DeadClickCustomData, type DialogOpenedCustomData, type ElementDescriptor, type ErrorMessageCustomData, type FlagEvaluationPluginData, type FormFieldReEditCustomData, type Frame, type GraphQLRequestMetadata, type IdleGapCustomData, type IncrementalSnapshotData, IncrementalSource, type InputCustomData, MAX_DISTINCT_KEYS, MAX_KEY_LENGTH, MAX_TAG_VALUE_LENGTH, MAX_VALUES_PER_KEY, type MeasurePluginData, type MouseInteractionData, MouseInteractions, type NetworkRequestInitiator, type NetworkRequestPluginData, type OpaqueIncrementalData, type RageClickCustomData, type RecordingEvent, RecordingEventType, type RouteChangeCustomData, type RouteChangePayload, type RouteChangePluginData, type RouteChangeTrigger, type ScrollBackCustomData, type SelectionData, type SelectionRange, SerializedNodeType, type TabRefocusCustomData, type TabUnfocusCustomData, type TabVisibilityPluginData, type TagPluginData, type UserAgentContext, stripUrl, validateKey, validateMeasureValue, validateTagValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -70,7 +70,12 @@ type MouseInteractionData = {
|
|
|
70
70
|
id: number;
|
|
71
71
|
x?: number;
|
|
72
72
|
y?: number;
|
|
73
|
-
pointerType?: number;
|
|
73
|
+
pointerType?: number; /** Mouse button and modifier keys present on click events. */
|
|
74
|
+
button?: number;
|
|
75
|
+
altKey?: boolean;
|
|
76
|
+
ctrlKey?: boolean;
|
|
77
|
+
metaKey?: boolean;
|
|
78
|
+
shiftKey?: boolean;
|
|
74
79
|
};
|
|
75
80
|
type SelectionRange = {
|
|
76
81
|
start: number;
|
|
@@ -138,6 +143,11 @@ type ClickCustomData = {
|
|
|
138
143
|
targetId: number;
|
|
139
144
|
element?: ElementDescriptor;
|
|
140
145
|
pathname?: string;
|
|
146
|
+
button?: number;
|
|
147
|
+
altKey?: boolean;
|
|
148
|
+
ctrlKey?: boolean;
|
|
149
|
+
metaKey?: boolean;
|
|
150
|
+
shiftKey?: boolean;
|
|
141
151
|
};
|
|
142
152
|
};
|
|
143
153
|
type InputCustomData = {
|
|
@@ -149,6 +159,15 @@ type InputCustomData = {
|
|
|
149
159
|
pathname?: string;
|
|
150
160
|
fieldType?: string;
|
|
151
161
|
hasValue?: boolean;
|
|
162
|
+
source?: "paste";
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
type ClipboardAction = "copy" | "cut" | "paste";
|
|
166
|
+
type ClipboardPluginData = {
|
|
167
|
+
plugin: "csr/clipboard@1";
|
|
168
|
+
payload: {
|
|
169
|
+
action: ClipboardAction;
|
|
170
|
+
targetId: number;
|
|
152
171
|
};
|
|
153
172
|
};
|
|
154
173
|
type DeadClickCustomData = {
|
|
@@ -334,4 +353,4 @@ declare function validateKey(key: string): string | null;
|
|
|
334
353
|
declare function validateTagValue(value: string | undefined): string | null;
|
|
335
354
|
declare function validateMeasureValue(value: number | undefined): string | null;
|
|
336
355
|
//#endregion
|
|
337
|
-
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 GraphQLRequestMetadata, type IdleGapCustomData, type IncrementalSnapshotData, IncrementalSource, type InputCustomData, MAX_DISTINCT_KEYS, MAX_KEY_LENGTH, MAX_TAG_VALUE_LENGTH, MAX_VALUES_PER_KEY, type MeasurePluginData, type MouseInteractionData, MouseInteractions, type NetworkRequestInitiator, type NetworkRequestPluginData, type OpaqueIncrementalData, type RageClickCustomData, type RecordingEvent, RecordingEventType, type RouteChangeCustomData, type RouteChangePayload, type RouteChangePluginData, type RouteChangeTrigger, type ScrollBackCustomData, type SelectionData, type SelectionRange, SerializedNodeType, type TabRefocusCustomData, type TabUnfocusCustomData, type TabVisibilityPluginData, type TagPluginData, type UserAgentContext, stripUrl, validateKey, validateMeasureValue, validateTagValue };
|
|
356
|
+
export { type AwayGapCustomData, type ClickCustomData, type ClientContext, type ClipboardAction, type ClipboardPluginData, type ConsoleLogLevel, type ConsoleLogPluginData, type CustomEventData, type DeadClickCustomData, type DialogOpenedCustomData, type ElementDescriptor, type ErrorMessageCustomData, type FlagEvaluationPluginData, type FormFieldReEditCustomData, type Frame, type GraphQLRequestMetadata, type IdleGapCustomData, type IncrementalSnapshotData, IncrementalSource, type InputCustomData, MAX_DISTINCT_KEYS, MAX_KEY_LENGTH, MAX_TAG_VALUE_LENGTH, MAX_VALUES_PER_KEY, type MeasurePluginData, type MouseInteractionData, MouseInteractions, type NetworkRequestInitiator, type NetworkRequestPluginData, type OpaqueIncrementalData, type RageClickCustomData, type RecordingEvent, RecordingEventType, type RouteChangeCustomData, type RouteChangePayload, type RouteChangePluginData, type RouteChangeTrigger, type ScrollBackCustomData, type SelectionData, type SelectionRange, SerializedNodeType, type TabRefocusCustomData, type TabUnfocusCustomData, type TabVisibilityPluginData, type TagPluginData, type UserAgentContext, stripUrl, validateKey, validateMeasureValue, validateTagValue };
|
package/package.json
CHANGED
package/src/events.ts
CHANGED
|
@@ -72,6 +72,12 @@ export type MouseInteractionData = {
|
|
|
72
72
|
x?: number;
|
|
73
73
|
y?: number;
|
|
74
74
|
pointerType?: number;
|
|
75
|
+
/** Mouse button and modifier keys present on click events. */
|
|
76
|
+
button?: number;
|
|
77
|
+
altKey?: boolean;
|
|
78
|
+
ctrlKey?: boolean;
|
|
79
|
+
metaKey?: boolean;
|
|
80
|
+
shiftKey?: boolean;
|
|
75
81
|
};
|
|
76
82
|
|
|
77
83
|
export type SelectionRange = {
|
|
@@ -148,6 +154,11 @@ export type ClickCustomData = {
|
|
|
148
154
|
targetId: number;
|
|
149
155
|
element?: ElementDescriptor;
|
|
150
156
|
pathname?: string;
|
|
157
|
+
button?: number;
|
|
158
|
+
altKey?: boolean;
|
|
159
|
+
ctrlKey?: boolean;
|
|
160
|
+
metaKey?: boolean;
|
|
161
|
+
shiftKey?: boolean;
|
|
151
162
|
};
|
|
152
163
|
};
|
|
153
164
|
|
|
@@ -160,6 +171,17 @@ export type InputCustomData = {
|
|
|
160
171
|
pathname?: string;
|
|
161
172
|
fieldType?: string;
|
|
162
173
|
hasValue?: boolean;
|
|
174
|
+
source?: 'paste';
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export type ClipboardAction = 'copy' | 'cut' | 'paste';
|
|
179
|
+
|
|
180
|
+
export type ClipboardPluginData = {
|
|
181
|
+
plugin: 'csr/clipboard@1';
|
|
182
|
+
payload: {
|
|
183
|
+
action: ClipboardAction;
|
|
184
|
+
targetId: number;
|
|
163
185
|
};
|
|
164
186
|
};
|
|
165
187
|
|
package/src/index.ts
CHANGED
|
@@ -61,10 +61,6 @@ function installWorkerStubs(opts?: { workerThrows?: boolean; sharedWorkerThrows?
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function tick() {
|
|
65
|
-
return new Promise(r => setTimeout(r, 0));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
64
|
describe('createUploader', () => {
|
|
69
65
|
const blobUrls: string[] = [];
|
|
70
66
|
|
|
@@ -112,8 +108,14 @@ describe('createUploader', () => {
|
|
|
112
108
|
|
|
113
109
|
const createUploader = await loadCreateUploader();
|
|
114
110
|
const logs: string[] = [];
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
await expect(
|
|
112
|
+
createUploader({
|
|
113
|
+
...DEFAULTS,
|
|
114
|
+
workerMode: 'dedicated',
|
|
115
|
+
debugLogger: m => logs.push(m),
|
|
116
|
+
_welcomeTimeoutMs: 0,
|
|
117
|
+
}),
|
|
118
|
+
).rejects.toThrow(/welcome timeout/);
|
|
117
119
|
|
|
118
120
|
expect(blobUrls).toHaveLength(0);
|
|
119
121
|
expect(logs.some(l => l.includes('via data'))).toBe(true);
|
|
@@ -136,8 +138,14 @@ describe('createUploader', () => {
|
|
|
136
138
|
|
|
137
139
|
const createUploader = await loadCreateUploader();
|
|
138
140
|
const logs: string[] = [];
|
|
139
|
-
|
|
140
|
-
|
|
141
|
+
await expect(
|
|
142
|
+
createUploader({
|
|
143
|
+
...DEFAULTS,
|
|
144
|
+
workerMode: 'dedicated',
|
|
145
|
+
debugLogger: m => logs.push(m),
|
|
146
|
+
_welcomeTimeoutMs: 0,
|
|
147
|
+
}),
|
|
148
|
+
).rejects.toThrow(/welcome timeout/);
|
|
141
149
|
|
|
142
150
|
expect(blobUrls).toHaveLength(1);
|
|
143
151
|
expect(constructedUrl).toBe(blobUrls[0]);
|
|
@@ -163,8 +171,14 @@ describe('createUploader', () => {
|
|
|
163
171
|
|
|
164
172
|
const createUploader = await loadCreateUploader();
|
|
165
173
|
const logs: string[] = [];
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
await expect(
|
|
175
|
+
createUploader({
|
|
176
|
+
...DEFAULTS,
|
|
177
|
+
workerMode: 'shared',
|
|
178
|
+
debugLogger: m => logs.push(m),
|
|
179
|
+
_welcomeTimeoutMs: 0,
|
|
180
|
+
}),
|
|
181
|
+
).rejects.toThrow(/welcome timeout/);
|
|
168
182
|
|
|
169
183
|
expect(blobUrls).toHaveLength(1);
|
|
170
184
|
expect(constructedUrl).toBe(blobUrls[0]);
|