mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
refactor: remove node-fetch dependency and use native fetch API (#12097)
This commit is contained in:
@@ -18,8 +18,9 @@
|
||||
*/
|
||||
|
||||
import { parseArgs } from 'node:util';
|
||||
import fetch from 'node-fetch';
|
||||
import * as fs from 'fs';
|
||||
import { Readable } from 'node:stream';
|
||||
import type { ReadableStream } from 'node:stream/web';
|
||||
import { logger } from './logger';
|
||||
import { AlfrescoApi, AlfrescoApiConfig } from '@alfresco/js-api';
|
||||
import { argv, exit } from 'node:process';
|
||||
@@ -682,14 +683,18 @@ async function getFileFromRemote(url: string, name: string): Promise<void> {
|
||||
.then(
|
||||
(response) =>
|
||||
new Promise<void>((resolve, reject) => {
|
||||
if (!response.body) {
|
||||
reject(new Error('Response body is empty'));
|
||||
return;
|
||||
}
|
||||
const outputFile = fs.createWriteStream(`${name}.zip`);
|
||||
response.body.pipe(outputFile);
|
||||
Readable.fromWeb(response.body as ReadableStream<Uint8Array>).pipe(outputFile);
|
||||
outputFile.on('finish', () => {
|
||||
logger.info(`The file is finished downloading.`);
|
||||
resolve();
|
||||
});
|
||||
outputFile.on('error', (error) => {
|
||||
logger.error(`Not possible to download the project form remote`);
|
||||
logger.error(`Not possible to download the project from remote: ${error.message}`);
|
||||
reject(error);
|
||||
});
|
||||
})
|
||||
|
||||
+3
-3
@@ -35,11 +35,11 @@ export class SearchChipListComponent {
|
||||
facetFiltersService = inject(SearchFacetFiltersService);
|
||||
|
||||
/**
|
||||
* Search filter to supply the data for the chips.
|
||||
* Not required from 4.5.0 and later versions @deprecated
|
||||
* @deprecated Search filter to supply the data for the chips.
|
||||
* Not required from 4.5.0 and later versions
|
||||
*/
|
||||
@Input()
|
||||
searchFilter: SearchFilterComponent;
|
||||
searchFilter: SearchFilterComponent | undefined;
|
||||
|
||||
/** Flag used to enable the display of a clear-all-filters button. */
|
||||
@Input()
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
export interface RequestLocalization {
|
||||
/**
|
||||
* A valid timezone id supported by @see java.time.ZoneId
|
||||
* A valid timezone id supported by {@link java.time.ZoneId}
|
||||
*/
|
||||
timezone?: string;
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user