@strapi/data-transfer 5.10.3 → 5.10.4
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/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -2
- package/dist/index.mjs.map +1 -1
- package/dist/strapi/providers/local-source/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -2824,7 +2824,11 @@ function _class_private_field_loose_key$4(name) {
|
|
|
2824
2824
|
const createLocalStrapiSourceProvider = (options)=>{
|
|
2825
2825
|
return new LocalStrapiSourceProvider(options);
|
|
2826
2826
|
};
|
|
2827
|
-
var _diagnostics$4 = /*#__PURE__*/ _class_private_field_loose_key$4("_diagnostics"), _reportInfo$4 = /*#__PURE__*/ _class_private_field_loose_key$4("_reportInfo")
|
|
2827
|
+
var _diagnostics$4 = /*#__PURE__*/ _class_private_field_loose_key$4("_diagnostics"), _reportInfo$4 = /*#__PURE__*/ _class_private_field_loose_key$4("_reportInfo"), /**
|
|
2828
|
+
* Reports an error to the diagnostic reporter.
|
|
2829
|
+
*/ _reportError = /*#__PURE__*/ _class_private_field_loose_key$4("_reportError"), /**
|
|
2830
|
+
* Handles errors that occur in read streams.
|
|
2831
|
+
*/ _handleStreamError = /*#__PURE__*/ _class_private_field_loose_key$4("_handleStreamError");
|
|
2828
2832
|
class LocalStrapiSourceProvider {
|
|
2829
2833
|
async bootstrap(diagnostics) {
|
|
2830
2834
|
_class_private_field_loose_base$4(this, _diagnostics$4)[_diagnostics$4] = diagnostics;
|
|
@@ -2886,12 +2890,22 @@ class LocalStrapiSourceProvider {
|
|
|
2886
2890
|
createAssetsReadStream() {
|
|
2887
2891
|
assertValidStrapi(this.strapi, 'Not able to stream assets');
|
|
2888
2892
|
_class_private_field_loose_base$4(this, _reportInfo$4)[_reportInfo$4]('creating assets read stream');
|
|
2889
|
-
|
|
2893
|
+
const stream = createAssetsStream(this.strapi);
|
|
2894
|
+
stream.on('error', (err)=>{
|
|
2895
|
+
_class_private_field_loose_base$4(this, _handleStreamError)[_handleStreamError]('assets', err);
|
|
2896
|
+
});
|
|
2897
|
+
return stream;
|
|
2890
2898
|
}
|
|
2891
2899
|
constructor(options){
|
|
2892
2900
|
Object.defineProperty(this, _reportInfo$4, {
|
|
2893
2901
|
value: reportInfo$4
|
|
2894
2902
|
});
|
|
2903
|
+
Object.defineProperty(this, _reportError, {
|
|
2904
|
+
value: reportError
|
|
2905
|
+
});
|
|
2906
|
+
Object.defineProperty(this, _handleStreamError, {
|
|
2907
|
+
value: handleStreamError
|
|
2908
|
+
});
|
|
2895
2909
|
Object.defineProperty(this, _diagnostics$4, {
|
|
2896
2910
|
writable: true,
|
|
2897
2911
|
value: void 0
|
|
@@ -2911,6 +2925,29 @@ function reportInfo$4(message) {
|
|
|
2911
2925
|
kind: 'info'
|
|
2912
2926
|
});
|
|
2913
2927
|
}
|
|
2928
|
+
function reportError(message, error) {
|
|
2929
|
+
_class_private_field_loose_base$4(this, _diagnostics$4)[_diagnostics$4]?.report({
|
|
2930
|
+
details: {
|
|
2931
|
+
createdAt: new Date(),
|
|
2932
|
+
message,
|
|
2933
|
+
error,
|
|
2934
|
+
severity: 'fatal',
|
|
2935
|
+
name: error.name
|
|
2936
|
+
},
|
|
2937
|
+
kind: 'error'
|
|
2938
|
+
});
|
|
2939
|
+
}
|
|
2940
|
+
function handleStreamError(streamType, err) {
|
|
2941
|
+
const { message, stack } = err;
|
|
2942
|
+
const errorMessage = `Error in ${streamType} read stream: ${message}`;
|
|
2943
|
+
const formattedError = {
|
|
2944
|
+
message: errorMessage,
|
|
2945
|
+
stack,
|
|
2946
|
+
timestamp: new Date().toISOString()
|
|
2947
|
+
};
|
|
2948
|
+
this.strapi?.log.error(formattedError);
|
|
2949
|
+
_class_private_field_loose_base$4(this, _reportError)[_reportError](formattedError.message, err);
|
|
2950
|
+
}
|
|
2914
2951
|
|
|
2915
2952
|
const createDispatcher = (ws, retryMessageOptions = {
|
|
2916
2953
|
retryMessageMaxRetries: 5,
|