@atlaskit/media-picker 70.1.0 → 70.1.2

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,20 @@
1
1
  # @atlaskit/media-picker
2
2
 
3
+ ## 70.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`33c6d6aaeef68`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/33c6d6aaeef68) -
8
+ Use payload.error.description as fallback for errorDetail when rawError does not provide a message
9
+ in upload failure handling
10
+
11
+ ## 70.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`dee27fdf979fb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dee27fdf979fb) -
16
+ Added statusCode at the top level of analytics failure events, for SignalFX compatibility.
17
+
3
18
  ## 70.1.0
4
19
 
5
20
  ### Minor Changes
@@ -106,7 +106,7 @@ var LocalUploadComponentReact = exports.LocalUploadComponentReact = /*#__PURE__*
106
106
  });
107
107
  (0, _defineProperty2.default)(_this, "fireUploadFailed", /*#__PURE__*/function () {
108
108
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(payload) {
109
- var fileId, _payload$error, errorName, rawError, traceContext, _end2, _end2$duration, uploadDurationMsec, errorDetail, _rawError$innerError, _rawError$innerError2;
109
+ var fileId, _payload$error, errorName, rawError, traceContext, _end2, _end2$duration, uploadDurationMsec, errorDetail, _rawError$innerError, _rawError$innerError2, requestMetadata;
110
110
  return _regenerator.default.wrap(function _callee$(_context) {
111
111
  while (1) switch (_context.prev = _context.next) {
112
112
  case 0:
@@ -114,8 +114,9 @@ var LocalUploadComponentReact = exports.LocalUploadComponentReact = /*#__PURE__*
114
114
  _end2 = (0, _perfMarks.end)("MediaPicker.fireUpload.".concat(fileId)), _end2$duration = _end2.duration, uploadDurationMsec = _end2$duration === void 0 ? -1 : _end2$duration;
115
115
  errorDetail = 'unknown';
116
116
  if ((0, _platformFeatureFlags.fg)('add_media_picker_error_detail')) {
117
- errorDetail = rawError && (0, _mediaClient.isCommonMediaClientError)(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : 'unknown';
117
+ errorDetail = rawError && (0, _mediaClient.isCommonMediaClientError)(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : payload.error.description;
118
118
  }
119
+ requestMetadata = !!rawError ? (0, _analytics.getRequestMetadata)(rawError) : undefined;
119
120
  _this.createAndFireAnalyticsEvent({
120
121
  eventType: 'operational',
121
122
  action: 'failed',
@@ -127,7 +128,8 @@ var LocalUploadComponentReact = exports.LocalUploadComponentReact = /*#__PURE__*
127
128
  status: 'fail',
128
129
  failReason: errorName,
129
130
  error: !!rawError ? (0, _mediaClient.getMediaClientErrorReason)(rawError) : 'unknown',
130
- request: !!rawError ? (0, _analytics.getRequestMetadata)(rawError) : undefined,
131
+ statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
132
+ request: requestMetadata,
131
133
  fileAttributes: {
132
134
  fileId: fileId
133
135
  },
@@ -140,13 +142,14 @@ var LocalUploadComponentReact = exports.LocalUploadComponentReact = /*#__PURE__*
140
142
  failReason: errorName,
141
143
  error: !!rawError ? (0, _mediaClient.getMediaClientErrorReason)(rawError) : 'unknown',
142
144
  errorDetail: errorDetail,
143
- request: !!rawError ? (0, _analytics.getRequestMetadata)(rawError) : undefined,
145
+ statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
146
+ request: requestMetadata,
144
147
  fileAttributes: {
145
148
  fileId: fileId
146
149
  },
147
150
  uploadDurationMsec: uploadDurationMsec
148
151
  });
149
- case 6:
152
+ case 7:
150
153
  case "end":
151
154
  return _context.stop();
152
155
  }
@@ -9,7 +9,7 @@ var _mediaClient = require("@atlaskit/media-client");
9
9
  // Component name will be prefixed with "media-picker-" in logs. Check ufoExperiences in utils files
10
10
 
11
11
  var packageName = "@atlaskit/media-picker";
12
- var packageVersion = "70.0.9";
12
+ var packageVersion = "0.0.0-development";
13
13
  function getPackageAttributes(componentName) {
14
14
  return {
15
15
  packageName: packageName,
@@ -12,7 +12,7 @@ var _mediaClient = require("@atlaskit/media-client");
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
14
  var packageName = "@atlaskit/media-picker";
15
- var packageVersion = "70.0.9";
15
+ var packageVersion = "0.0.0-development";
16
16
  var ufoExperience;
17
17
  var initExperience = function initExperience(id, componentName) {
18
18
  if (!ufoExperience) {
@@ -106,8 +106,9 @@ export class LocalUploadComponentReact extends Component {
106
106
  let errorDetail = 'unknown';
107
107
  if (fg('add_media_picker_error_detail')) {
108
108
  var _rawError$innerError, _rawError$innerError2;
109
- errorDetail = rawError && isCommonMediaClientError(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : 'unknown';
109
+ errorDetail = rawError && isCommonMediaClientError(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : payload.error.description;
110
110
  }
111
+ const requestMetadata = !!rawError ? getRequestMetadata(rawError) : undefined;
111
112
  this.createAndFireAnalyticsEvent({
112
113
  eventType: 'operational',
113
114
  action: 'failed',
@@ -119,7 +120,8 @@ export class LocalUploadComponentReact extends Component {
119
120
  status: 'fail',
120
121
  failReason: errorName,
121
122
  error: !!rawError ? getMediaClientErrorReason(rawError) : 'unknown',
122
- request: !!rawError ? getRequestMetadata(rawError) : undefined,
123
+ statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
124
+ request: requestMetadata,
123
125
  fileAttributes: {
124
126
  fileId
125
127
  },
@@ -132,7 +134,8 @@ export class LocalUploadComponentReact extends Component {
132
134
  failReason: errorName,
133
135
  error: !!rawError ? getMediaClientErrorReason(rawError) : 'unknown',
134
136
  errorDetail,
135
- request: !!rawError ? getRequestMetadata(rawError) : undefined,
137
+ statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
138
+ request: requestMetadata,
136
139
  fileAttributes: {
137
140
  fileId
138
141
  },
@@ -3,7 +3,7 @@ import { isRequestError } from '@atlaskit/media-client';
3
3
  // Component name will be prefixed with "media-picker-" in logs. Check ufoExperiences in utils files
4
4
 
5
5
  const packageName = "@atlaskit/media-picker";
6
- const packageVersion = "70.0.9";
6
+ const packageVersion = "0.0.0-development";
7
7
  export function getPackageAttributes(componentName) {
8
8
  return {
9
9
  packageName,
@@ -2,7 +2,7 @@ import { ConcurrentExperience, ExperiencePerformanceTypes, ExperienceTypes } fro
2
2
  import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
3
3
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
4
4
  const packageName = "@atlaskit/media-picker";
5
- const packageVersion = "70.0.9";
5
+ const packageVersion = "0.0.0-development";
6
6
  let ufoExperience;
7
7
  const initExperience = (id, componentName) => {
8
8
  if (!ufoExperience) {
@@ -99,7 +99,7 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
99
99
  });
100
100
  _defineProperty(_this, "fireUploadFailed", /*#__PURE__*/function () {
101
101
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(payload) {
102
- var fileId, _payload$error, errorName, rawError, traceContext, _end2, _end2$duration, uploadDurationMsec, errorDetail, _rawError$innerError, _rawError$innerError2;
102
+ var fileId, _payload$error, errorName, rawError, traceContext, _end2, _end2$duration, uploadDurationMsec, errorDetail, _rawError$innerError, _rawError$innerError2, requestMetadata;
103
103
  return _regeneratorRuntime.wrap(function _callee$(_context) {
104
104
  while (1) switch (_context.prev = _context.next) {
105
105
  case 0:
@@ -107,8 +107,9 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
107
107
  _end2 = end("MediaPicker.fireUpload.".concat(fileId)), _end2$duration = _end2.duration, uploadDurationMsec = _end2$duration === void 0 ? -1 : _end2$duration;
108
108
  errorDetail = 'unknown';
109
109
  if (fg('add_media_picker_error_detail')) {
110
- errorDetail = rawError && isCommonMediaClientError(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : 'unknown';
110
+ errorDetail = rawError && isCommonMediaClientError(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : payload.error.description;
111
111
  }
112
+ requestMetadata = !!rawError ? getRequestMetadata(rawError) : undefined;
112
113
  _this.createAndFireAnalyticsEvent({
113
114
  eventType: 'operational',
114
115
  action: 'failed',
@@ -120,7 +121,8 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
120
121
  status: 'fail',
121
122
  failReason: errorName,
122
123
  error: !!rawError ? getMediaClientErrorReason(rawError) : 'unknown',
123
- request: !!rawError ? getRequestMetadata(rawError) : undefined,
124
+ statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
125
+ request: requestMetadata,
124
126
  fileAttributes: {
125
127
  fileId: fileId
126
128
  },
@@ -133,13 +135,14 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
133
135
  failReason: errorName,
134
136
  error: !!rawError ? getMediaClientErrorReason(rawError) : 'unknown',
135
137
  errorDetail: errorDetail,
136
- request: !!rawError ? getRequestMetadata(rawError) : undefined,
138
+ statusCode: requestMetadata === null || requestMetadata === void 0 ? void 0 : requestMetadata.statusCode,
139
+ request: requestMetadata,
137
140
  fileAttributes: {
138
141
  fileId: fileId
139
142
  },
140
143
  uploadDurationMsec: uploadDurationMsec
141
144
  });
142
- case 6:
145
+ case 7:
143
146
  case "end":
144
147
  return _context.stop();
145
148
  }
@@ -3,7 +3,7 @@ import { isRequestError } from '@atlaskit/media-client';
3
3
  // Component name will be prefixed with "media-picker-" in logs. Check ufoExperiences in utils files
4
4
 
5
5
  var packageName = "@atlaskit/media-picker";
6
- var packageVersion = "70.0.9";
6
+ var packageVersion = "0.0.0-development";
7
7
  export function getPackageAttributes(componentName) {
8
8
  return {
9
9
  packageName: packageName,
@@ -5,7 +5,7 @@ import { ConcurrentExperience, ExperiencePerformanceTypes, ExperienceTypes } fro
5
5
  import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
6
6
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
7
7
  var packageName = "@atlaskit/media-picker";
8
- var packageVersion = "70.0.9";
8
+ var packageVersion = "0.0.0-development";
9
9
  var ufoExperience;
10
10
  var initExperience = function initExperience(id, componentName) {
11
11
  if (!ufoExperience) {
@@ -125,6 +125,7 @@ export type MediaUploadFailurePayload = OperationalEventPayload<OperationalAttri
125
125
  sourceType: MediaUploadSource;
126
126
  serviceName: string;
127
127
  uploadDurationMsec: number;
128
+ statusCode?: number;
128
129
  request?: RequestMetadata;
129
130
  }, 'failed', 'mediaUpload', MediaUploadType>;
130
131
  export type UnhandledErrorPayload = OperationalEventPayload<OperationalAttributes & FailureAttributes & {
@@ -1,5 +1,5 @@
1
- import { type RequestMetadata } from '@atlaskit/media-client';
1
+ import { type RequestErrorMetadata } from '@atlaskit/media-client';
2
2
  import { type PackageAttributes } from '@atlaskit/media-common';
3
3
  export type ComponentName = 'browser' | 'clipboard' | 'dropzone';
4
4
  export declare function getPackageAttributes(componentName: ComponentName): PackageAttributes;
5
- export declare function getRequestMetadata(error?: Error): RequestMetadata | undefined;
5
+ export declare function getRequestMetadata(error?: Error): RequestErrorMetadata | undefined;
@@ -6,6 +6,7 @@ export type UFOFailedEventPayload = {
6
6
  error?: string;
7
7
  errorDetail?: string | undefined;
8
8
  uploadDurationMsec: number;
9
+ statusCode?: number;
9
10
  request?: RequestMetadata;
10
11
  } & WithFileAttributes;
11
12
  export declare const startMediaUploadUfoExperience: (id: string, componentName: ComponentName) => void;
@@ -125,6 +125,7 @@ export type MediaUploadFailurePayload = OperationalEventPayload<OperationalAttri
125
125
  sourceType: MediaUploadSource;
126
126
  serviceName: string;
127
127
  uploadDurationMsec: number;
128
+ statusCode?: number;
128
129
  request?: RequestMetadata;
129
130
  }, 'failed', 'mediaUpload', MediaUploadType>;
130
131
  export type UnhandledErrorPayload = OperationalEventPayload<OperationalAttributes & FailureAttributes & {
@@ -1,5 +1,5 @@
1
- import { type RequestMetadata } from '@atlaskit/media-client';
1
+ import { type RequestErrorMetadata } from '@atlaskit/media-client';
2
2
  import { type PackageAttributes } from '@atlaskit/media-common';
3
3
  export type ComponentName = 'browser' | 'clipboard' | 'dropzone';
4
4
  export declare function getPackageAttributes(componentName: ComponentName): PackageAttributes;
5
- export declare function getRequestMetadata(error?: Error): RequestMetadata | undefined;
5
+ export declare function getRequestMetadata(error?: Error): RequestErrorMetadata | undefined;
@@ -6,6 +6,7 @@ export type UFOFailedEventPayload = {
6
6
  error?: string;
7
7
  errorDetail?: string | undefined;
8
8
  uploadDurationMsec: number;
9
+ statusCode?: number;
9
10
  request?: RequestMetadata;
10
11
  } & WithFileAttributes;
11
12
  export declare const startMediaUploadUfoExperience: (id: string, componentName: ComponentName) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-picker",
3
- "version": "70.1.0",
3
+ "version": "70.1.2",
4
4
  "description": "Library for handling file uploads",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/media-ui": "^28.7.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
40
  "@atlaskit/theme": "^21.0.0",
41
- "@atlaskit/tokens": "^8.2.0",
41
+ "@atlaskit/tokens": "^8.4.0",
42
42
  "@atlaskit/ufo": "^0.4.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "eventemitter2": "^4.1.0",