@atlaskit/media-client 36.1.0 → 36.1.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 +7 -0
- package/dist/cjs/client/file-fetcher/index.js +10 -10
- package/dist/es2019/client/file-fetcher/index.js +2 -2
- package/dist/esm/client/file-fetcher/index.js +10 -10
- package/dist/types/client/file-fetcher/index.d.ts +2 -2
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 36.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`71ee114498663`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/71ee114498663) -
|
|
8
|
+
Parameterized anonymize media file names on upload
|
|
9
|
+
|
|
3
10
|
## 36.1.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -545,7 +545,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
545
545
|
}, {
|
|
546
546
|
key: "uploadExternal",
|
|
547
547
|
value: function () {
|
|
548
|
-
var _uploadExternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee0(url, collection, traceContext) {
|
|
548
|
+
var _uploadExternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee0(url, collection, traceContext, anonymizeFilename) {
|
|
549
549
|
var _this3 = this;
|
|
550
550
|
var uploadableFileUpfrontIds, id, occurrenceKey, subject, deferredBlob, preview, name, fileState;
|
|
551
551
|
return _regenerator.default.wrap(function _callee0$(_context0) {
|
|
@@ -582,11 +582,11 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
582
582
|
}
|
|
583
583
|
}, _callee8);
|
|
584
584
|
}));
|
|
585
|
-
return function (
|
|
585
|
+
return function (_x18, _x19) {
|
|
586
586
|
return _ref0.apply(this, arguments);
|
|
587
587
|
};
|
|
588
588
|
}());
|
|
589
|
-
name = (0, _platformFeatureFlags.fg)('platform_media_upload_external_anonymize_filename') ? crypto.randomUUID() : url.split('/').pop() || ''; // we create a initial fileState with the minimum info that we have at this point
|
|
589
|
+
name = anonymizeFilename && (0, _platformFeatureFlags.fg)('platform_media_upload_external_anonymize_filename') ? crypto.randomUUID() : url.split('/').pop() || ''; // we create a initial fileState with the minimum info that we have at this point
|
|
590
590
|
fileState = {
|
|
591
591
|
status: 'processing',
|
|
592
592
|
name: name,
|
|
@@ -662,7 +662,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
662
662
|
}
|
|
663
663
|
}, _callee9, null, [[10, 16]]);
|
|
664
664
|
}));
|
|
665
|
-
return function (
|
|
665
|
+
return function (_x20, _x21) {
|
|
666
666
|
return _ref1.apply(this, arguments);
|
|
667
667
|
};
|
|
668
668
|
}()));
|
|
@@ -672,7 +672,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
672
672
|
}
|
|
673
673
|
}, _callee0, this);
|
|
674
674
|
}));
|
|
675
|
-
function uploadExternal(_x14, _x15, _x16) {
|
|
675
|
+
function uploadExternal(_x14, _x15, _x16, _x17) {
|
|
676
676
|
return _uploadExternal.apply(this, arguments);
|
|
677
677
|
}
|
|
678
678
|
return uploadExternal;
|
|
@@ -774,7 +774,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
774
774
|
}
|
|
775
775
|
}, _callee1, this);
|
|
776
776
|
}));
|
|
777
|
-
function downloadBinary(
|
|
777
|
+
function downloadBinary(_x22) {
|
|
778
778
|
return _downloadBinary.apply(this, arguments);
|
|
779
779
|
}
|
|
780
780
|
return downloadBinary;
|
|
@@ -817,7 +817,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
817
817
|
}
|
|
818
818
|
}, _callee10, this);
|
|
819
819
|
}));
|
|
820
|
-
function registerCopyIntent(
|
|
820
|
+
function registerCopyIntent(_x23, _x24) {
|
|
821
821
|
return _registerCopyIntent.apply(this, arguments);
|
|
822
822
|
}
|
|
823
823
|
return registerCopyIntent;
|
|
@@ -867,7 +867,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
867
867
|
}
|
|
868
868
|
}, _callee11);
|
|
869
869
|
}));
|
|
870
|
-
function copyFileWithToken(
|
|
870
|
+
function copyFileWithToken(_x25, _x26, _x27) {
|
|
871
871
|
return _copyFileWithToken.apply(this, arguments);
|
|
872
872
|
}
|
|
873
873
|
return copyFileWithToken;
|
|
@@ -896,7 +896,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
896
896
|
}
|
|
897
897
|
}, _callee12, this);
|
|
898
898
|
}));
|
|
899
|
-
function copyFileWithIntent(
|
|
899
|
+
function copyFileWithIntent(_x28, _x29, _x30) {
|
|
900
900
|
return _copyFileWithIntent.apply(this, arguments);
|
|
901
901
|
}
|
|
902
902
|
return copyFileWithIntent;
|
|
@@ -1047,7 +1047,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
}, _callee13, this, [[6, 40]]);
|
|
1049
1049
|
}));
|
|
1050
|
-
function copyFile(
|
|
1050
|
+
function copyFile(_x31, _x32) {
|
|
1051
1051
|
return _copyFile.apply(this, arguments);
|
|
1052
1052
|
}
|
|
1053
1053
|
return copyFile;
|
|
@@ -341,7 +341,7 @@ export class FileFetcherImpl {
|
|
|
341
341
|
deferredUploadId
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
-
async uploadExternal(url, collection, traceContext) {
|
|
344
|
+
async uploadExternal(url, collection, traceContext, anonymizeFilename) {
|
|
345
345
|
const uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection, traceContext);
|
|
346
346
|
const {
|
|
347
347
|
id,
|
|
@@ -359,7 +359,7 @@ export class FileFetcherImpl {
|
|
|
359
359
|
origin: 'remote'
|
|
360
360
|
});
|
|
361
361
|
});
|
|
362
|
-
const name = fg('platform_media_upload_external_anonymize_filename') ? crypto.randomUUID() : url.split('/').pop() || '';
|
|
362
|
+
const name = anonymizeFilename && fg('platform_media_upload_external_anonymize_filename') ? crypto.randomUUID() : url.split('/').pop() || '';
|
|
363
363
|
// we create a initial fileState with the minimum info that we have at this point
|
|
364
364
|
const fileState = {
|
|
365
365
|
status: 'processing',
|
|
@@ -528,7 +528,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
528
528
|
}, {
|
|
529
529
|
key: "uploadExternal",
|
|
530
530
|
value: function () {
|
|
531
|
-
var _uploadExternal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee0(url, collection, traceContext) {
|
|
531
|
+
var _uploadExternal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee0(url, collection, traceContext, anonymizeFilename) {
|
|
532
532
|
var _this3 = this;
|
|
533
533
|
var uploadableFileUpfrontIds, id, occurrenceKey, subject, deferredBlob, preview, name, fileState;
|
|
534
534
|
return _regeneratorRuntime.wrap(function _callee0$(_context0) {
|
|
@@ -565,11 +565,11 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
565
565
|
}
|
|
566
566
|
}, _callee8);
|
|
567
567
|
}));
|
|
568
|
-
return function (
|
|
568
|
+
return function (_x18, _x19) {
|
|
569
569
|
return _ref0.apply(this, arguments);
|
|
570
570
|
};
|
|
571
571
|
}());
|
|
572
|
-
name = fg('platform_media_upload_external_anonymize_filename') ? crypto.randomUUID() : url.split('/').pop() || ''; // we create a initial fileState with the minimum info that we have at this point
|
|
572
|
+
name = anonymizeFilename && fg('platform_media_upload_external_anonymize_filename') ? crypto.randomUUID() : url.split('/').pop() || ''; // we create a initial fileState with the minimum info that we have at this point
|
|
573
573
|
fileState = {
|
|
574
574
|
status: 'processing',
|
|
575
575
|
name: name,
|
|
@@ -645,7 +645,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
645
645
|
}
|
|
646
646
|
}, _callee9, null, [[10, 16]]);
|
|
647
647
|
}));
|
|
648
|
-
return function (
|
|
648
|
+
return function (_x20, _x21) {
|
|
649
649
|
return _ref1.apply(this, arguments);
|
|
650
650
|
};
|
|
651
651
|
}()));
|
|
@@ -655,7 +655,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
655
655
|
}
|
|
656
656
|
}, _callee0, this);
|
|
657
657
|
}));
|
|
658
|
-
function uploadExternal(_x14, _x15, _x16) {
|
|
658
|
+
function uploadExternal(_x14, _x15, _x16, _x17) {
|
|
659
659
|
return _uploadExternal.apply(this, arguments);
|
|
660
660
|
}
|
|
661
661
|
return uploadExternal;
|
|
@@ -757,7 +757,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
757
757
|
}
|
|
758
758
|
}, _callee1, this);
|
|
759
759
|
}));
|
|
760
|
-
function downloadBinary(
|
|
760
|
+
function downloadBinary(_x22) {
|
|
761
761
|
return _downloadBinary.apply(this, arguments);
|
|
762
762
|
}
|
|
763
763
|
return downloadBinary;
|
|
@@ -800,7 +800,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
800
800
|
}
|
|
801
801
|
}, _callee10, this);
|
|
802
802
|
}));
|
|
803
|
-
function registerCopyIntent(
|
|
803
|
+
function registerCopyIntent(_x23, _x24) {
|
|
804
804
|
return _registerCopyIntent.apply(this, arguments);
|
|
805
805
|
}
|
|
806
806
|
return registerCopyIntent;
|
|
@@ -850,7 +850,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
850
850
|
}
|
|
851
851
|
}, _callee11);
|
|
852
852
|
}));
|
|
853
|
-
function copyFileWithToken(
|
|
853
|
+
function copyFileWithToken(_x25, _x26, _x27) {
|
|
854
854
|
return _copyFileWithToken.apply(this, arguments);
|
|
855
855
|
}
|
|
856
856
|
return copyFileWithToken;
|
|
@@ -879,7 +879,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
879
879
|
}
|
|
880
880
|
}, _callee12, this);
|
|
881
881
|
}));
|
|
882
|
-
function copyFileWithIntent(
|
|
882
|
+
function copyFileWithIntent(_x28, _x29, _x30) {
|
|
883
883
|
return _copyFileWithIntent.apply(this, arguments);
|
|
884
884
|
}
|
|
885
885
|
return copyFileWithIntent;
|
|
@@ -1030,7 +1030,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
}, _callee13, this, [[6, 40]]);
|
|
1032
1032
|
}));
|
|
1033
|
-
function copyFile(
|
|
1033
|
+
function copyFile(_x31, _x32) {
|
|
1034
1034
|
return _copyFile.apply(this, arguments);
|
|
1035
1035
|
}
|
|
1036
1036
|
return copyFile;
|
|
@@ -36,7 +36,7 @@ export interface FileFetcher {
|
|
|
36
36
|
getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
|
|
37
37
|
touchFiles(descriptors: TouchFileDescriptor[], collection?: string, traceContext?: MediaTraceContext): Promise<TouchedFiles>;
|
|
38
38
|
upload(file: UploadableFile, controller?: UploadController, uploadableFileUpfrontIds?: UploadableFileUpfrontIds, traceContext?: MediaTraceContext): MediaSubscribable;
|
|
39
|
-
uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext): Promise<ExternalUploadPayload>;
|
|
39
|
+
uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext, anonymizeFilename?: boolean): Promise<ExternalUploadPayload>;
|
|
40
40
|
downloadBinary(id: string, name?: string, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
41
41
|
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
42
42
|
copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions, traceContext?: MediaTraceContext): Promise<MediaFile>;
|
|
@@ -67,7 +67,7 @@ export declare class FileFetcherImpl implements FileFetcher {
|
|
|
67
67
|
private createDownloadFileStream;
|
|
68
68
|
touchFiles(descriptors: TouchFileDescriptor[], collection?: string, traceContext?: MediaTraceContext): Promise<TouchedFiles>;
|
|
69
69
|
private generateUploadableFileUpfrontIds;
|
|
70
|
-
uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext): Promise<ExternalUploadPayload>;
|
|
70
|
+
uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext, anonymizeFilename?: boolean): Promise<ExternalUploadPayload>;
|
|
71
71
|
private getUploadingFileStateBase;
|
|
72
72
|
upload(file: UploadableFile, controller?: UploadController, uploadableFileUpfrontIds?: UploadableFileUpfrontIds, traceContext?: MediaTraceContext): MediaSubscribable;
|
|
73
73
|
downloadBinary(id: string, name?: string, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
@@ -36,7 +36,7 @@ export interface FileFetcher {
|
|
|
36
36
|
getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
|
|
37
37
|
touchFiles(descriptors: TouchFileDescriptor[], collection?: string, traceContext?: MediaTraceContext): Promise<TouchedFiles>;
|
|
38
38
|
upload(file: UploadableFile, controller?: UploadController, uploadableFileUpfrontIds?: UploadableFileUpfrontIds, traceContext?: MediaTraceContext): MediaSubscribable;
|
|
39
|
-
uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext): Promise<ExternalUploadPayload>;
|
|
39
|
+
uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext, anonymizeFilename?: boolean): Promise<ExternalUploadPayload>;
|
|
40
40
|
downloadBinary(id: string, name?: string, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
41
41
|
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
42
42
|
copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions, traceContext?: MediaTraceContext): Promise<MediaFile>;
|
|
@@ -67,7 +67,7 @@ export declare class FileFetcherImpl implements FileFetcher {
|
|
|
67
67
|
private createDownloadFileStream;
|
|
68
68
|
touchFiles(descriptors: TouchFileDescriptor[], collection?: string, traceContext?: MediaTraceContext): Promise<TouchedFiles>;
|
|
69
69
|
private generateUploadableFileUpfrontIds;
|
|
70
|
-
uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext): Promise<ExternalUploadPayload>;
|
|
70
|
+
uploadExternal(url: string, collection?: string, traceContext?: MediaTraceContext, anonymizeFilename?: boolean): Promise<ExternalUploadPayload>;
|
|
71
71
|
private getUploadingFileStateBase;
|
|
72
72
|
upload(file: UploadableFile, controller?: UploadController, uploadableFileUpfrontIds?: UploadableFileUpfrontIds, traceContext?: MediaTraceContext): MediaSubscribable;
|
|
73
73
|
downloadBinary(id: string, name?: string, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|