@atlaskit/react-ufo 2.0.5 → 2.0.6
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 +8 -0
- package/dist/cjs/create-payload/index.js +7 -1
- package/dist/es2019/create-payload/index.js +7 -1
- package/dist/esm/create-payload/index.js +7 -1
- package/dist/types/create-payload/index.d.ts +4 -0
- package/dist/types-ts4.5/create-payload/index.d.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 2.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#157418](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157418)
|
|
8
|
+
[`e6939ccf435a3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e6939ccf435a3) -
|
|
9
|
+
Add payload size as part of UFO payload
|
|
10
|
+
|
|
3
11
|
## 2.0.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -632,6 +632,9 @@ function getSSRDoneTimeValue(config) {
|
|
|
632
632
|
var _config$ssr, _config$ssr2;
|
|
633
633
|
return config !== null && config !== void 0 && (_config$ssr = config.ssr) !== null && _config$ssr !== void 0 && _config$ssr.getSSRDoneTime ? config === null || config === void 0 || (_config$ssr2 = config.ssr) === null || _config$ssr2 === void 0 ? void 0 : _config$ssr2.getSSRDoneTime() : ssr.getSSRDoneTime();
|
|
634
634
|
}
|
|
635
|
+
function getPayloadSize(payload) {
|
|
636
|
+
return Math.round(new TextEncoder().encode(JSON.stringify(payload)).length / 1024);
|
|
637
|
+
}
|
|
635
638
|
function createInteractionMetricsPayload(interaction, interactionId) {
|
|
636
639
|
var _window$location, _config$additionalPay;
|
|
637
640
|
var interactionPayloadStart = performance.now();
|
|
@@ -716,7 +719,7 @@ function createInteractionMetricsPayload(interaction, interactionId) {
|
|
|
716
719
|
};
|
|
717
720
|
};
|
|
718
721
|
var newUFOName = (0, _utils.sanitizeUfoName)(ufoName);
|
|
719
|
-
|
|
722
|
+
var payload = {
|
|
720
723
|
actionSubject: 'experience',
|
|
721
724
|
action: 'measured',
|
|
722
725
|
eventType: 'operational',
|
|
@@ -728,6 +731,7 @@ function createInteractionMetricsPayload(interaction, interactionId) {
|
|
|
728
731
|
'event:hostname': ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || 'unknown',
|
|
729
732
|
'event:product': config.product,
|
|
730
733
|
'event:schema': '1.0.0',
|
|
734
|
+
'event:sizeInKb': 0,
|
|
731
735
|
'event:source': {
|
|
732
736
|
name: 'react-ufo/web',
|
|
733
737
|
version: _constants.REACT_UFO_VERSION,
|
|
@@ -773,6 +777,8 @@ function createInteractionMetricsPayload(interaction, interactionId) {
|
|
|
773
777
|
})
|
|
774
778
|
}
|
|
775
779
|
};
|
|
780
|
+
payload.attributes.properties['event:sizeInKb'] = getPayloadSize(payload.attributes.properties);
|
|
781
|
+
return payload;
|
|
776
782
|
}
|
|
777
783
|
function createPayloads(interactionId, interaction) {
|
|
778
784
|
var ufoNameOverride = getUfoNameOverride(interaction);
|
|
@@ -623,6 +623,9 @@ function getSSRDoneTimeValue(config) {
|
|
|
623
623
|
var _config$ssr, _config$ssr2;
|
|
624
624
|
return config !== null && config !== void 0 && (_config$ssr = config.ssr) !== null && _config$ssr !== void 0 && _config$ssr.getSSRDoneTime ? config === null || config === void 0 ? void 0 : (_config$ssr2 = config.ssr) === null || _config$ssr2 === void 0 ? void 0 : _config$ssr2.getSSRDoneTime() : ssr.getSSRDoneTime();
|
|
625
625
|
}
|
|
626
|
+
function getPayloadSize(payload) {
|
|
627
|
+
return Math.round(new TextEncoder().encode(JSON.stringify(payload)).length / 1024);
|
|
628
|
+
}
|
|
626
629
|
function createInteractionMetricsPayload(interaction, interactionId) {
|
|
627
630
|
var _window$location, _config$additionalPay;
|
|
628
631
|
const interactionPayloadStart = performance.now();
|
|
@@ -710,7 +713,7 @@ function createInteractionMetricsPayload(interaction, interactionId) {
|
|
|
710
713
|
};
|
|
711
714
|
};
|
|
712
715
|
const newUFOName = sanitizeUfoName(ufoName);
|
|
713
|
-
|
|
716
|
+
const payload = {
|
|
714
717
|
actionSubject: 'experience',
|
|
715
718
|
action: 'measured',
|
|
716
719
|
eventType: 'operational',
|
|
@@ -722,6 +725,7 @@ function createInteractionMetricsPayload(interaction, interactionId) {
|
|
|
722
725
|
'event:hostname': ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || 'unknown',
|
|
723
726
|
'event:product': config.product,
|
|
724
727
|
'event:schema': '1.0.0',
|
|
728
|
+
'event:sizeInKb': 0,
|
|
725
729
|
'event:source': {
|
|
726
730
|
name: 'react-ufo/web',
|
|
727
731
|
version: REACT_UFO_VERSION,
|
|
@@ -780,6 +784,8 @@ function createInteractionMetricsPayload(interaction, interactionId) {
|
|
|
780
784
|
}
|
|
781
785
|
}
|
|
782
786
|
};
|
|
787
|
+
payload.attributes.properties['event:sizeInKb'] = getPayloadSize(payload.attributes.properties);
|
|
788
|
+
return payload;
|
|
783
789
|
}
|
|
784
790
|
export function createPayloads(interactionId, interaction) {
|
|
785
791
|
const ufoNameOverride = getUfoNameOverride(interaction);
|
|
@@ -622,6 +622,9 @@ function getSSRDoneTimeValue(config) {
|
|
|
622
622
|
var _config$ssr, _config$ssr2;
|
|
623
623
|
return config !== null && config !== void 0 && (_config$ssr = config.ssr) !== null && _config$ssr !== void 0 && _config$ssr.getSSRDoneTime ? config === null || config === void 0 || (_config$ssr2 = config.ssr) === null || _config$ssr2 === void 0 ? void 0 : _config$ssr2.getSSRDoneTime() : ssr.getSSRDoneTime();
|
|
624
624
|
}
|
|
625
|
+
function getPayloadSize(payload) {
|
|
626
|
+
return Math.round(new TextEncoder().encode(JSON.stringify(payload)).length / 1024);
|
|
627
|
+
}
|
|
625
628
|
function createInteractionMetricsPayload(interaction, interactionId) {
|
|
626
629
|
var _window$location, _config$additionalPay;
|
|
627
630
|
var interactionPayloadStart = performance.now();
|
|
@@ -706,7 +709,7 @@ function createInteractionMetricsPayload(interaction, interactionId) {
|
|
|
706
709
|
};
|
|
707
710
|
};
|
|
708
711
|
var newUFOName = sanitizeUfoName(ufoName);
|
|
709
|
-
|
|
712
|
+
var payload = {
|
|
710
713
|
actionSubject: 'experience',
|
|
711
714
|
action: 'measured',
|
|
712
715
|
eventType: 'operational',
|
|
@@ -718,6 +721,7 @@ function createInteractionMetricsPayload(interaction, interactionId) {
|
|
|
718
721
|
'event:hostname': ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || 'unknown',
|
|
719
722
|
'event:product': config.product,
|
|
720
723
|
'event:schema': '1.0.0',
|
|
724
|
+
'event:sizeInKb': 0,
|
|
721
725
|
'event:source': {
|
|
722
726
|
name: 'react-ufo/web',
|
|
723
727
|
version: REACT_UFO_VERSION,
|
|
@@ -763,6 +767,8 @@ function createInteractionMetricsPayload(interaction, interactionId) {
|
|
|
763
767
|
})
|
|
764
768
|
}
|
|
765
769
|
};
|
|
770
|
+
payload.attributes.properties['event:sizeInKb'] = getPayloadSize(payload.attributes.properties);
|
|
771
|
+
return payload;
|
|
766
772
|
}
|
|
767
773
|
export function createPayloads(interactionId, interaction) {
|
|
768
774
|
var ufoNameOverride = getUfoNameOverride(interaction);
|
|
@@ -727,6 +727,7 @@ export declare function createPayloads(interactionId: string, interaction: Inter
|
|
|
727
727
|
'event:hostname': string;
|
|
728
728
|
'event:product': string;
|
|
729
729
|
'event:schema': string;
|
|
730
|
+
'event:sizeInKb': number;
|
|
730
731
|
'event:source': {
|
|
731
732
|
name: string;
|
|
732
733
|
version: string;
|
|
@@ -1475,6 +1476,7 @@ export declare function createPayloads(interactionId: string, interaction: Inter
|
|
|
1475
1476
|
'event:hostname': string;
|
|
1476
1477
|
'event:product': string;
|
|
1477
1478
|
'event:schema': string;
|
|
1479
|
+
'event:sizeInKb': number;
|
|
1478
1480
|
'event:source': {
|
|
1479
1481
|
name: string;
|
|
1480
1482
|
version: string;
|
|
@@ -2205,6 +2207,7 @@ export declare function createPayloads(interactionId: string, interaction: Inter
|
|
|
2205
2207
|
'event:hostname': string;
|
|
2206
2208
|
'event:product': string;
|
|
2207
2209
|
'event:schema': string;
|
|
2210
|
+
'event:sizeInKb': number;
|
|
2208
2211
|
'event:source': {
|
|
2209
2212
|
name: string;
|
|
2210
2213
|
version: string;
|
|
@@ -2956,6 +2959,7 @@ export declare function createPayloads(interactionId: string, interaction: Inter
|
|
|
2956
2959
|
'event:hostname': string;
|
|
2957
2960
|
'event:product': string;
|
|
2958
2961
|
'event:schema': string;
|
|
2962
|
+
'event:sizeInKb': number;
|
|
2959
2963
|
'event:source': {
|
|
2960
2964
|
name: string;
|
|
2961
2965
|
version: string;
|
|
@@ -727,6 +727,7 @@ export declare function createPayloads(interactionId: string, interaction: Inter
|
|
|
727
727
|
'event:hostname': string;
|
|
728
728
|
'event:product': string;
|
|
729
729
|
'event:schema': string;
|
|
730
|
+
'event:sizeInKb': number;
|
|
730
731
|
'event:source': {
|
|
731
732
|
name: string;
|
|
732
733
|
version: string;
|
|
@@ -1475,6 +1476,7 @@ export declare function createPayloads(interactionId: string, interaction: Inter
|
|
|
1475
1476
|
'event:hostname': string;
|
|
1476
1477
|
'event:product': string;
|
|
1477
1478
|
'event:schema': string;
|
|
1479
|
+
'event:sizeInKb': number;
|
|
1478
1480
|
'event:source': {
|
|
1479
1481
|
name: string;
|
|
1480
1482
|
version: string;
|
|
@@ -2205,6 +2207,7 @@ export declare function createPayloads(interactionId: string, interaction: Inter
|
|
|
2205
2207
|
'event:hostname': string;
|
|
2206
2208
|
'event:product': string;
|
|
2207
2209
|
'event:schema': string;
|
|
2210
|
+
'event:sizeInKb': number;
|
|
2208
2211
|
'event:source': {
|
|
2209
2212
|
name: string;
|
|
2210
2213
|
version: string;
|
|
@@ -2956,6 +2959,7 @@ export declare function createPayloads(interactionId: string, interaction: Inter
|
|
|
2956
2959
|
'event:hostname': string;
|
|
2957
2960
|
'event:product': string;
|
|
2958
2961
|
'event:schema': string;
|
|
2962
|
+
'event:sizeInKb': number;
|
|
2959
2963
|
'event:source': {
|
|
2960
2964
|
name: string;
|
|
2961
2965
|
version: string;
|