Skip to content

Commit 4a815c0

Browse files
author
naman-contentstack
committed
chore: moved constants to constants file
1 parent c98fafe commit 4a815c0

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

packages/contentstack-asset-management/src/constants/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
export const BATCH_SIZE = 50;
2+
export const CHUNK_FILE_SIZE_MB = 1;
3+
14
/**
25
* Main process name for Asset Management 2.0 export (single progress bar).
36
* Use this when adding/starting the process and for all ticks.

packages/contentstack-asset-management/src/export/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { AssetManagementAPIConfig } from '../types/asset-management-api';
66
import type { ExportContext } from '../types/export-types';
77
import { AssetManagementAdapter } from '../utils/asset-management-api-adapter';
88
import { AM_MAIN_PROCESS_NAME } from '../constants/index';
9-
import { BATCH_SIZE, CHUNK_FILE_SIZE_MB } from '../utils/export-helpers';
9+
import { BATCH_SIZE, CHUNK_FILE_SIZE_MB } from '../constants/index';
1010

1111
export type { ExportContext };
1212

packages/contentstack-asset-management/src/utils/export-helpers.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { createWriteStream } from 'node:fs';
22

3-
export const BATCH_SIZE = 50;
4-
export const CHUNK_FILE_SIZE_MB = 1;
5-
63
export function getArrayFromResponse(data: unknown, arrayKey: string): unknown[] {
74
if (Array.isArray(data)) return data;
85
if (data != null && typeof data === 'object' && arrayKey in data) {

packages/contentstack-asset-management/src/utils/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export { AssetManagementAdapter } from './asset-management-api-adapter';
2+
export { BATCH_SIZE, CHUNK_FILE_SIZE_MB } from '../constants';
23
export {
3-
BATCH_SIZE,
4-
CHUNK_FILE_SIZE_MB,
54
getArrayFromResponse,
65
getAssetItems,
76
getReadableStreamFromDownloadResponse,

0 commit comments

Comments
 (0)