@spotify-confidence/csr-common 0.18.7 → 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 +7 -0
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/package.json +1 -1
- package/src/events.ts +11 -0
- package/src/index.ts +2 -0
- package/src/uploader/create-uploader.test.ts +24 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
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
|
+
|
|
3
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)
|
|
4
11
|
|
|
5
12
|
|
package/dist/index.d.cts
CHANGED
|
@@ -159,6 +159,15 @@ type InputCustomData = {
|
|
|
159
159
|
pathname?: string;
|
|
160
160
|
fieldType?: string;
|
|
161
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;
|
|
162
171
|
};
|
|
163
172
|
};
|
|
164
173
|
type DeadClickCustomData = {
|
|
@@ -344,4 +353,4 @@ declare function validateKey(key: string): string | null;
|
|
|
344
353
|
declare function validateTagValue(value: string | undefined): string | null;
|
|
345
354
|
declare function validateMeasureValue(value: number | undefined): string | null;
|
|
346
355
|
//#endregion
|
|
347
|
-
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
|
@@ -159,6 +159,15 @@ type InputCustomData = {
|
|
|
159
159
|
pathname?: string;
|
|
160
160
|
fieldType?: string;
|
|
161
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;
|
|
162
171
|
};
|
|
163
172
|
};
|
|
164
173
|
type DeadClickCustomData = {
|
|
@@ -344,4 +353,4 @@ declare function validateKey(key: string): string | null;
|
|
|
344
353
|
declare function validateTagValue(value: string | undefined): string | null;
|
|
345
354
|
declare function validateMeasureValue(value: number | undefined): string | null;
|
|
346
355
|
//#endregion
|
|
347
|
-
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
|
@@ -171,6 +171,17 @@ export type InputCustomData = {
|
|
|
171
171
|
pathname?: string;
|
|
172
172
|
fieldType?: string;
|
|
173
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;
|
|
174
185
|
};
|
|
175
186
|
};
|
|
176
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]);
|