@atlaskit/media-client 28.4.0 → 28.5.0
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 +9 -0
- package/dist/cjs/client/media-store/MediaStore.js +85 -24
- package/dist/es2019/client/media-store/MediaStore.js +41 -0
- package/dist/esm/client/media-store/MediaStore.js +85 -24
- package/dist/types/client/media-store/MediaStore.d.ts +3 -1
- package/dist/types/client/media-store/types.d.ts +7 -0
- package/dist/types-ts4.5/client/media-store/MediaStore.d.ts +3 -1
- package/dist/types-ts4.5/client/media-store/types.d.ts +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 28.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#170974](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/170974)
|
|
8
|
+
[`215eb993c1ea3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/215eb993c1ea3) -
|
|
9
|
+
Added `registerCopyIntents` and `copyFile` endpoints to meida client to enable cross client copy
|
|
10
|
+
and paste
|
|
11
|
+
|
|
3
12
|
## 28.4.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -593,10 +593,71 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
593
593
|
});
|
|
594
594
|
return this.request('/file/copy/withToken', options).then((0, _helpers.createMapResponseToJson)(metadata));
|
|
595
595
|
}
|
|
596
|
+
}, {
|
|
597
|
+
key: "copyFile",
|
|
598
|
+
value: function copyFile(id, params, traceContext) {
|
|
599
|
+
var metadata = {
|
|
600
|
+
method: 'POST',
|
|
601
|
+
endpoint: '/v2/file/copy'
|
|
602
|
+
};
|
|
603
|
+
var options = _objectSpread(_objectSpread({}, metadata), {}, {
|
|
604
|
+
authContext: {
|
|
605
|
+
collectionName: params.collection
|
|
606
|
+
},
|
|
607
|
+
params: params,
|
|
608
|
+
headers: jsonHeaders,
|
|
609
|
+
body: JSON.stringify({
|
|
610
|
+
id: id
|
|
611
|
+
}),
|
|
612
|
+
traceContext: traceContext
|
|
613
|
+
});
|
|
614
|
+
return this.request('/v2/file/copy', options).then((0, _helpers.createMapResponseToJson)(metadata));
|
|
615
|
+
}
|
|
616
|
+
}, {
|
|
617
|
+
key: "registerCopyIntents",
|
|
618
|
+
value: function () {
|
|
619
|
+
var _registerCopyIntents = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(ids, collectionName, traceContext) {
|
|
620
|
+
var files, metadata, options;
|
|
621
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
622
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
623
|
+
case 0:
|
|
624
|
+
files = ids.map(function (id) {
|
|
625
|
+
return {
|
|
626
|
+
id: id,
|
|
627
|
+
collection: collectionName
|
|
628
|
+
};
|
|
629
|
+
});
|
|
630
|
+
metadata = {
|
|
631
|
+
method: 'POST',
|
|
632
|
+
endpoint: '/file/copy/intents'
|
|
633
|
+
};
|
|
634
|
+
options = _objectSpread(_objectSpread({}, metadata), {}, {
|
|
635
|
+
authContext: {
|
|
636
|
+
collectionName: collectionName
|
|
637
|
+
},
|
|
638
|
+
headers: jsonHeaders,
|
|
639
|
+
body: JSON.stringify({
|
|
640
|
+
files: files
|
|
641
|
+
}),
|
|
642
|
+
traceContext: traceContext
|
|
643
|
+
});
|
|
644
|
+
_context12.next = 5;
|
|
645
|
+
return this.request('/file/copy/intents', options);
|
|
646
|
+
case 5:
|
|
647
|
+
case "end":
|
|
648
|
+
return _context12.stop();
|
|
649
|
+
}
|
|
650
|
+
}, _callee12, this);
|
|
651
|
+
}));
|
|
652
|
+
function registerCopyIntents(_x38, _x39, _x40) {
|
|
653
|
+
return _registerCopyIntents.apply(this, arguments);
|
|
654
|
+
}
|
|
655
|
+
return registerCopyIntents;
|
|
656
|
+
}()
|
|
596
657
|
}, {
|
|
597
658
|
key: "request",
|
|
598
659
|
value: function () {
|
|
599
|
-
var _request2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
660
|
+
var _request2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(path) {
|
|
600
661
|
var options,
|
|
601
662
|
controller,
|
|
602
663
|
useMediaCdn,
|
|
@@ -615,22 +676,22 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
615
676
|
extendedParams,
|
|
616
677
|
url,
|
|
617
678
|
response,
|
|
618
|
-
|
|
619
|
-
return _regenerator.default.wrap(function
|
|
620
|
-
while (1) switch (
|
|
679
|
+
_args13 = arguments;
|
|
680
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
681
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
621
682
|
case 0:
|
|
622
|
-
options =
|
|
683
|
+
options = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : {
|
|
623
684
|
method: 'GET',
|
|
624
685
|
endpoint: undefined,
|
|
625
686
|
authContext: {}
|
|
626
687
|
};
|
|
627
|
-
controller =
|
|
628
|
-
useMediaCdn =
|
|
688
|
+
controller = _args13.length > 2 ? _args13[2] : undefined;
|
|
689
|
+
useMediaCdn = _args13.length > 3 ? _args13[3] : undefined;
|
|
629
690
|
method = options.method, endpoint = options.endpoint, authContext = options.authContext, params = options.params, headers = options.headers, body = options.body, clientOptions = options.clientOptions, traceContext = options.traceContext, addMediaClientParam = options.addMediaClientParam;
|
|
630
|
-
|
|
691
|
+
_context13.next = 6;
|
|
631
692
|
return this.resolveAuth(authContext);
|
|
632
693
|
case 6:
|
|
633
|
-
auth =
|
|
694
|
+
auth = _context13.sent;
|
|
634
695
|
clientId = (0, _mediaCore.isClientBasedAuth)(auth) ? auth.clientId : undefined;
|
|
635
696
|
extendedTraceContext = (0, _helpers.extendTraceContext)(traceContext);
|
|
636
697
|
extendedParams = addMediaClientParam ? _objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -640,7 +701,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
640
701
|
if (useMediaCdn) {
|
|
641
702
|
url = (0, _mediaCdn.mapToMediaCdnUrl)(url, auth.token);
|
|
642
703
|
}
|
|
643
|
-
|
|
704
|
+
_context13.next = 14;
|
|
644
705
|
return (0, _request3.request)(url, {
|
|
645
706
|
method: method,
|
|
646
707
|
endpoint: endpoint,
|
|
@@ -652,17 +713,17 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
652
713
|
traceContext: extendedTraceContext
|
|
653
714
|
}, controller);
|
|
654
715
|
case 14:
|
|
655
|
-
response =
|
|
716
|
+
response = _context13.sent;
|
|
656
717
|
setKeyValueInSessionStorage(MEDIA_API_REGION, response.headers.get('x-media-region'));
|
|
657
718
|
setKeyValueInSessionStorage(MEDIA_API_ENVIRONMENT, response.headers.get('x-media-env'));
|
|
658
|
-
return
|
|
719
|
+
return _context13.abrupt("return", response);
|
|
659
720
|
case 18:
|
|
660
721
|
case "end":
|
|
661
|
-
return
|
|
722
|
+
return _context13.stop();
|
|
662
723
|
}
|
|
663
|
-
},
|
|
724
|
+
}, _callee13, this);
|
|
664
725
|
}));
|
|
665
|
-
function request(
|
|
726
|
+
function request(_x41) {
|
|
666
727
|
return _request2.apply(this, arguments);
|
|
667
728
|
}
|
|
668
729
|
return request;
|
|
@@ -670,16 +731,16 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
670
731
|
}, {
|
|
671
732
|
key: "testUrl",
|
|
672
733
|
value: function () {
|
|
673
|
-
var _testUrl = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
734
|
+
var _testUrl = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(url) {
|
|
674
735
|
var options,
|
|
675
736
|
traceContext,
|
|
676
|
-
|
|
677
|
-
return _regenerator.default.wrap(function
|
|
678
|
-
while (1) switch (
|
|
737
|
+
_args14 = arguments;
|
|
738
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
739
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
679
740
|
case 0:
|
|
680
|
-
options =
|
|
741
|
+
options = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : {};
|
|
681
742
|
traceContext = options.traceContext;
|
|
682
|
-
|
|
743
|
+
_context14.next = 4;
|
|
683
744
|
return (0, _request3.request)(url, {
|
|
684
745
|
method: 'HEAD',
|
|
685
746
|
traceContext: (0, _helpers.extendTraceContext)(traceContext),
|
|
@@ -691,11 +752,11 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
691
752
|
});
|
|
692
753
|
case 4:
|
|
693
754
|
case "end":
|
|
694
|
-
return
|
|
755
|
+
return _context14.stop();
|
|
695
756
|
}
|
|
696
|
-
},
|
|
757
|
+
}, _callee14);
|
|
697
758
|
}));
|
|
698
|
-
function testUrl(
|
|
759
|
+
function testUrl(_x42) {
|
|
699
760
|
return _testUrl.apply(this, arguments);
|
|
700
761
|
}
|
|
701
762
|
return testUrl;
|
|
@@ -350,6 +350,47 @@ export class MediaStore {
|
|
|
350
350
|
};
|
|
351
351
|
return this.request('/file/copy/withToken', options).then(createMapResponseToJson(metadata));
|
|
352
352
|
}
|
|
353
|
+
copyFile(id, params, traceContext) {
|
|
354
|
+
const metadata = {
|
|
355
|
+
method: 'POST',
|
|
356
|
+
endpoint: '/v2/file/copy'
|
|
357
|
+
};
|
|
358
|
+
const options = {
|
|
359
|
+
...metadata,
|
|
360
|
+
authContext: {
|
|
361
|
+
collectionName: params.collection
|
|
362
|
+
},
|
|
363
|
+
params,
|
|
364
|
+
headers: jsonHeaders,
|
|
365
|
+
body: JSON.stringify({
|
|
366
|
+
id
|
|
367
|
+
}),
|
|
368
|
+
traceContext
|
|
369
|
+
};
|
|
370
|
+
return this.request('/v2/file/copy', options).then(createMapResponseToJson(metadata));
|
|
371
|
+
}
|
|
372
|
+
async registerCopyIntents(ids, collectionName, traceContext) {
|
|
373
|
+
const files = ids.map(id => ({
|
|
374
|
+
id,
|
|
375
|
+
collection: collectionName
|
|
376
|
+
}));
|
|
377
|
+
const metadata = {
|
|
378
|
+
method: 'POST',
|
|
379
|
+
endpoint: '/file/copy/intents'
|
|
380
|
+
};
|
|
381
|
+
const options = {
|
|
382
|
+
...metadata,
|
|
383
|
+
authContext: {
|
|
384
|
+
collectionName
|
|
385
|
+
},
|
|
386
|
+
headers: jsonHeaders,
|
|
387
|
+
body: JSON.stringify({
|
|
388
|
+
files
|
|
389
|
+
}),
|
|
390
|
+
traceContext
|
|
391
|
+
};
|
|
392
|
+
await this.request('/file/copy/intents', options);
|
|
393
|
+
}
|
|
353
394
|
async request(path, options = {
|
|
354
395
|
method: 'GET',
|
|
355
396
|
endpoint: undefined,
|
|
@@ -587,10 +587,71 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
587
587
|
});
|
|
588
588
|
return this.request('/file/copy/withToken', options).then(createMapResponseToJson(metadata));
|
|
589
589
|
}
|
|
590
|
+
}, {
|
|
591
|
+
key: "copyFile",
|
|
592
|
+
value: function copyFile(id, params, traceContext) {
|
|
593
|
+
var metadata = {
|
|
594
|
+
method: 'POST',
|
|
595
|
+
endpoint: '/v2/file/copy'
|
|
596
|
+
};
|
|
597
|
+
var options = _objectSpread(_objectSpread({}, metadata), {}, {
|
|
598
|
+
authContext: {
|
|
599
|
+
collectionName: params.collection
|
|
600
|
+
},
|
|
601
|
+
params: params,
|
|
602
|
+
headers: jsonHeaders,
|
|
603
|
+
body: JSON.stringify({
|
|
604
|
+
id: id
|
|
605
|
+
}),
|
|
606
|
+
traceContext: traceContext
|
|
607
|
+
});
|
|
608
|
+
return this.request('/v2/file/copy', options).then(createMapResponseToJson(metadata));
|
|
609
|
+
}
|
|
610
|
+
}, {
|
|
611
|
+
key: "registerCopyIntents",
|
|
612
|
+
value: function () {
|
|
613
|
+
var _registerCopyIntents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(ids, collectionName, traceContext) {
|
|
614
|
+
var files, metadata, options;
|
|
615
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
616
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
617
|
+
case 0:
|
|
618
|
+
files = ids.map(function (id) {
|
|
619
|
+
return {
|
|
620
|
+
id: id,
|
|
621
|
+
collection: collectionName
|
|
622
|
+
};
|
|
623
|
+
});
|
|
624
|
+
metadata = {
|
|
625
|
+
method: 'POST',
|
|
626
|
+
endpoint: '/file/copy/intents'
|
|
627
|
+
};
|
|
628
|
+
options = _objectSpread(_objectSpread({}, metadata), {}, {
|
|
629
|
+
authContext: {
|
|
630
|
+
collectionName: collectionName
|
|
631
|
+
},
|
|
632
|
+
headers: jsonHeaders,
|
|
633
|
+
body: JSON.stringify({
|
|
634
|
+
files: files
|
|
635
|
+
}),
|
|
636
|
+
traceContext: traceContext
|
|
637
|
+
});
|
|
638
|
+
_context12.next = 5;
|
|
639
|
+
return this.request('/file/copy/intents', options);
|
|
640
|
+
case 5:
|
|
641
|
+
case "end":
|
|
642
|
+
return _context12.stop();
|
|
643
|
+
}
|
|
644
|
+
}, _callee12, this);
|
|
645
|
+
}));
|
|
646
|
+
function registerCopyIntents(_x38, _x39, _x40) {
|
|
647
|
+
return _registerCopyIntents.apply(this, arguments);
|
|
648
|
+
}
|
|
649
|
+
return registerCopyIntents;
|
|
650
|
+
}()
|
|
590
651
|
}, {
|
|
591
652
|
key: "request",
|
|
592
653
|
value: function () {
|
|
593
|
-
var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
654
|
+
var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(path) {
|
|
594
655
|
var options,
|
|
595
656
|
controller,
|
|
596
657
|
useMediaCdn,
|
|
@@ -609,22 +670,22 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
609
670
|
extendedParams,
|
|
610
671
|
url,
|
|
611
672
|
response,
|
|
612
|
-
|
|
613
|
-
return _regeneratorRuntime.wrap(function
|
|
614
|
-
while (1) switch (
|
|
673
|
+
_args13 = arguments;
|
|
674
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
675
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
615
676
|
case 0:
|
|
616
|
-
options =
|
|
677
|
+
options = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : {
|
|
617
678
|
method: 'GET',
|
|
618
679
|
endpoint: undefined,
|
|
619
680
|
authContext: {}
|
|
620
681
|
};
|
|
621
|
-
controller =
|
|
622
|
-
useMediaCdn =
|
|
682
|
+
controller = _args13.length > 2 ? _args13[2] : undefined;
|
|
683
|
+
useMediaCdn = _args13.length > 3 ? _args13[3] : undefined;
|
|
623
684
|
method = options.method, endpoint = options.endpoint, authContext = options.authContext, params = options.params, headers = options.headers, body = options.body, clientOptions = options.clientOptions, traceContext = options.traceContext, addMediaClientParam = options.addMediaClientParam;
|
|
624
|
-
|
|
685
|
+
_context13.next = 6;
|
|
625
686
|
return this.resolveAuth(authContext);
|
|
626
687
|
case 6:
|
|
627
|
-
auth =
|
|
688
|
+
auth = _context13.sent;
|
|
628
689
|
clientId = isClientBasedAuth(auth) ? auth.clientId : undefined;
|
|
629
690
|
extendedTraceContext = extendTraceContext(traceContext);
|
|
630
691
|
extendedParams = addMediaClientParam ? _objectSpread(_objectSpread({}, params), {}, {
|
|
@@ -634,7 +695,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
634
695
|
if (useMediaCdn) {
|
|
635
696
|
url = mapToMediaCdnUrl(url, auth.token);
|
|
636
697
|
}
|
|
637
|
-
|
|
698
|
+
_context13.next = 14;
|
|
638
699
|
return _request(url, {
|
|
639
700
|
method: method,
|
|
640
701
|
endpoint: endpoint,
|
|
@@ -646,17 +707,17 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
646
707
|
traceContext: extendedTraceContext
|
|
647
708
|
}, controller);
|
|
648
709
|
case 14:
|
|
649
|
-
response =
|
|
710
|
+
response = _context13.sent;
|
|
650
711
|
setKeyValueInSessionStorage(MEDIA_API_REGION, response.headers.get('x-media-region'));
|
|
651
712
|
setKeyValueInSessionStorage(MEDIA_API_ENVIRONMENT, response.headers.get('x-media-env'));
|
|
652
|
-
return
|
|
713
|
+
return _context13.abrupt("return", response);
|
|
653
714
|
case 18:
|
|
654
715
|
case "end":
|
|
655
|
-
return
|
|
716
|
+
return _context13.stop();
|
|
656
717
|
}
|
|
657
|
-
},
|
|
718
|
+
}, _callee13, this);
|
|
658
719
|
}));
|
|
659
|
-
function request(
|
|
720
|
+
function request(_x41) {
|
|
660
721
|
return _request2.apply(this, arguments);
|
|
661
722
|
}
|
|
662
723
|
return request;
|
|
@@ -664,16 +725,16 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
664
725
|
}, {
|
|
665
726
|
key: "testUrl",
|
|
666
727
|
value: function () {
|
|
667
|
-
var _testUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
728
|
+
var _testUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(url) {
|
|
668
729
|
var options,
|
|
669
730
|
traceContext,
|
|
670
|
-
|
|
671
|
-
return _regeneratorRuntime.wrap(function
|
|
672
|
-
while (1) switch (
|
|
731
|
+
_args14 = arguments;
|
|
732
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
733
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
673
734
|
case 0:
|
|
674
|
-
options =
|
|
735
|
+
options = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : {};
|
|
675
736
|
traceContext = options.traceContext;
|
|
676
|
-
|
|
737
|
+
_context14.next = 4;
|
|
677
738
|
return _request(url, {
|
|
678
739
|
method: 'HEAD',
|
|
679
740
|
traceContext: extendTraceContext(traceContext),
|
|
@@ -685,11 +746,11 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
685
746
|
});
|
|
686
747
|
case 4:
|
|
687
748
|
case "end":
|
|
688
|
-
return
|
|
749
|
+
return _context14.stop();
|
|
689
750
|
}
|
|
690
|
-
},
|
|
751
|
+
}, _callee14);
|
|
691
752
|
}));
|
|
692
|
-
function testUrl(
|
|
753
|
+
function testUrl(_x42) {
|
|
693
754
|
return _testUrl.apply(this, arguments);
|
|
694
755
|
}
|
|
695
756
|
return testUrl;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AuthContext, type MediaApiConfig, type Auth } from '@atlaskit/media-core';
|
|
2
2
|
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
3
3
|
import { type MediaFileArtifacts } from '@atlaskit/media-state';
|
|
4
|
-
import type { ItemsPayload, ImageMetadata, MediaStoreResponse, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, RejectedTouchFile, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, TouchedFiles, MediaApi } from './types';
|
|
4
|
+
import type { ItemsPayload, ImageMetadata, MediaStoreResponse, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, RejectedTouchFile, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, TouchedFiles, MediaApi, CopyFileParams } from './types';
|
|
5
5
|
import { type MediaFile, type MediaUpload } from '../../models/media';
|
|
6
6
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core';
|
|
7
7
|
export declare class MediaStore implements MediaApi {
|
|
@@ -28,6 +28,8 @@ export declare class MediaStore implements MediaApi {
|
|
|
28
28
|
}>;
|
|
29
29
|
appendChunksToUpload(uploadId: string, body: AppendChunksToUploadRequestBody, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
30
30
|
copyFileWithToken(body: MediaStoreCopyFileWithTokenBody, params: MediaStoreCopyFileWithTokenParams, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaFile>>;
|
|
31
|
+
copyFile(id: string, params: CopyFileParams, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaFile>>;
|
|
32
|
+
registerCopyIntents(ids: string[], collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
31
33
|
request(path: string, options?: MediaStoreRequestOptions, controller?: AbortController, useMediaCdn?: boolean): Promise<Response>;
|
|
32
34
|
testUrl(url: string, options?: {
|
|
33
35
|
traceContext?: MediaTraceContext;
|
|
@@ -113,6 +113,11 @@ export interface SourceFile {
|
|
|
113
113
|
export type MediaStoreCopyFileWithTokenBody = {
|
|
114
114
|
sourceFile: SourceFile;
|
|
115
115
|
};
|
|
116
|
+
export type CopyFileParams = {
|
|
117
|
+
sourceCollection?: string;
|
|
118
|
+
collection?: string;
|
|
119
|
+
replaceFileId?: string;
|
|
120
|
+
};
|
|
116
121
|
export type MediaStoreCopyFileWithTokenParams = {
|
|
117
122
|
readonly collection?: string;
|
|
118
123
|
readonly replaceFileId?: string;
|
|
@@ -166,6 +171,8 @@ export interface MediaApi {
|
|
|
166
171
|
}>;
|
|
167
172
|
appendChunksToUpload: (uploadId: string, body: AppendChunksToUploadRequestBody, collectionName?: string, traceContext?: MediaTraceContext) => Promise<void>;
|
|
168
173
|
copyFileWithToken: (body: MediaStoreCopyFileWithTokenBody, params: MediaStoreCopyFileWithTokenParams, traceContext?: MediaTraceContext) => Promise<MediaStoreResponse<MediaFile>>;
|
|
174
|
+
copyFile: (id: string, params: CopyFileParams) => Promise<MediaStoreResponse<MediaFile>>;
|
|
175
|
+
registerCopyIntents: (ids: string[], collectionName: string) => Promise<void>;
|
|
169
176
|
request: (path: string, options: MediaStoreRequestOptions, controller?: AbortController) => Promise<Response>;
|
|
170
177
|
testUrl: (url: string, options?: {
|
|
171
178
|
traceContext?: MediaTraceContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AuthContext, type MediaApiConfig, type Auth } from '@atlaskit/media-core';
|
|
2
2
|
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
3
3
|
import { type MediaFileArtifacts } from '@atlaskit/media-state';
|
|
4
|
-
import type { ItemsPayload, ImageMetadata, MediaStoreResponse, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, RejectedTouchFile, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, TouchedFiles, MediaApi } from './types';
|
|
4
|
+
import type { ItemsPayload, ImageMetadata, MediaStoreResponse, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, RejectedTouchFile, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, TouchedFiles, MediaApi, CopyFileParams } from './types';
|
|
5
5
|
import { type MediaFile, type MediaUpload } from '../../models/media';
|
|
6
6
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core';
|
|
7
7
|
export declare class MediaStore implements MediaApi {
|
|
@@ -28,6 +28,8 @@ export declare class MediaStore implements MediaApi {
|
|
|
28
28
|
}>;
|
|
29
29
|
appendChunksToUpload(uploadId: string, body: AppendChunksToUploadRequestBody, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
30
30
|
copyFileWithToken(body: MediaStoreCopyFileWithTokenBody, params: MediaStoreCopyFileWithTokenParams, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaFile>>;
|
|
31
|
+
copyFile(id: string, params: CopyFileParams, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaFile>>;
|
|
32
|
+
registerCopyIntents(ids: string[], collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
31
33
|
request(path: string, options?: MediaStoreRequestOptions, controller?: AbortController, useMediaCdn?: boolean): Promise<Response>;
|
|
32
34
|
testUrl(url: string, options?: {
|
|
33
35
|
traceContext?: MediaTraceContext;
|
|
@@ -113,6 +113,11 @@ export interface SourceFile {
|
|
|
113
113
|
export type MediaStoreCopyFileWithTokenBody = {
|
|
114
114
|
sourceFile: SourceFile;
|
|
115
115
|
};
|
|
116
|
+
export type CopyFileParams = {
|
|
117
|
+
sourceCollection?: string;
|
|
118
|
+
collection?: string;
|
|
119
|
+
replaceFileId?: string;
|
|
120
|
+
};
|
|
116
121
|
export type MediaStoreCopyFileWithTokenParams = {
|
|
117
122
|
readonly collection?: string;
|
|
118
123
|
readonly replaceFileId?: string;
|
|
@@ -166,6 +171,8 @@ export interface MediaApi {
|
|
|
166
171
|
}>;
|
|
167
172
|
appendChunksToUpload: (uploadId: string, body: AppendChunksToUploadRequestBody, collectionName?: string, traceContext?: MediaTraceContext) => Promise<void>;
|
|
168
173
|
copyFileWithToken: (body: MediaStoreCopyFileWithTokenBody, params: MediaStoreCopyFileWithTokenParams, traceContext?: MediaTraceContext) => Promise<MediaStoreResponse<MediaFile>>;
|
|
174
|
+
copyFile: (id: string, params: CopyFileParams) => Promise<MediaStoreResponse<MediaFile>>;
|
|
175
|
+
registerCopyIntents: (ids: string[], collectionName: string) => Promise<void>;
|
|
169
176
|
request: (path: string, options: MediaStoreRequestOptions, controller?: AbortController) => Promise<Response>;
|
|
170
177
|
testUrl: (url: string, options?: {
|
|
171
178
|
traceContext?: MediaTraceContext;
|