@ivandt/importer 1.0.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/README.md +30 -0
- package/dist/assets/importer.css +1 -0
- package/dist/importer.cjs.js +514 -0
- package/dist/importer.d.ts +1 -0
- package/dist/importer.es.js +91645 -0
- package/dist/index-C1bluYVj.js +118 -0
- package/dist/index-CI2WmQs5.cjs +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +8 -0
- package/dist/src/importer.d.ts +0 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/lib/IvtImporter.svelte.d.ts +1 -0
- package/dist/src/lib/actions/applyToColumn.d.ts +6 -0
- package/dist/src/lib/actions/autoIncrementIdsAction.d.ts +3 -0
- package/dist/src/lib/actions/backwardFillAction.d.ts +3 -0
- package/dist/src/lib/actions/clampRangeAction.d.ts +3 -0
- package/dist/src/lib/actions/clearCellRangeAction.d.ts +3 -0
- package/dist/src/lib/actions/clearCulmn.d.ts +3 -0
- package/dist/src/lib/actions/combineColumnsAction.d.ts +4 -0
- package/dist/src/lib/actions/defaultValueAction.d.ts +3 -0
- package/dist/src/lib/actions/dispatcher.d.ts +5 -0
- package/dist/src/lib/actions/fillWithTimestampAction.d.ts +3 -0
- package/dist/src/lib/actions/findAndReplace.d.ts +3 -0
- package/dist/src/lib/actions/formatDatesAction.d.ts +9 -0
- package/dist/src/lib/actions/formatPhoneNumbersAction.d.ts +0 -0
- package/dist/src/lib/actions/forwardFillAction.d.ts +3 -0
- package/dist/src/lib/actions/fuzzyFixAction/fastestfuzzyFixAction.d.ts +7 -0
- package/dist/src/lib/actions/fuzzyFixAction/fuzzyFixAction.d.ts +3 -0
- package/dist/src/lib/actions/fuzzyFixAction/fuzzyFixAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/generateUUIDsAction.d.ts +3 -0
- package/dist/src/lib/actions/lookupCountryNamesAction.d.ts +18 -0
- package/dist/src/lib/actions/mapToEnumAction.d.ts +4 -0
- package/dist/src/lib/actions/normalizeUrlsAction.d.ts +30 -0
- package/dist/src/lib/actions/normalizeZScoreAction.d.ts +24 -0
- package/dist/src/lib/actions/padStringAction.d.ts +3 -0
- package/dist/src/lib/actions/parseNumberAction.d.ts +3 -0
- package/dist/src/lib/actions/regexReplaceAction.d.ts +3 -0
- package/dist/src/lib/actions/removeDuplicatesAction.d.ts +3 -0
- package/dist/src/lib/actions/roundNumbersAction.d.ts +3 -0
- package/dist/src/lib/actions/scaleNumbersAction.d.ts +3 -0
- package/dist/src/lib/actions/specs/autoIncrementIdsAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/backwardFillAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/clampRangeAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/clearCellRangeAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/combineColumnsAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/fillWithTimestampAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/findAndReplace.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/formatDatesAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/forwardFillAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/generateUUIDsAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/lookupCountryNamesAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/normalizeUrlsAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/normalizeZScoreAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/padStringAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/parseNumberAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/regexReplaceAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/removeDuplicatesAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/roundNumbersAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/scaleNumbersAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/stripHtmlTagsAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/titleCaseTextAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/toLowerCaseAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/toUpperCaseAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/trimWhitespaceAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/specs/truncateTextAction.spec.d.ts +1 -0
- package/dist/src/lib/actions/stripHtmlTagsAction.d.ts +3 -0
- package/dist/src/lib/actions/titleCaseTextAction.d.ts +3 -0
- package/dist/src/lib/actions/toLowerCaseAction.d.ts +3 -0
- package/dist/src/lib/actions/toUpperCaseAction.d.ts +3 -0
- package/dist/src/lib/actions/trimWhitespace.d.ts +3 -0
- package/dist/src/lib/actions/truncateTextAction.d.ts +3 -0
- package/dist/src/lib/api/suggestMapHeaders.d.ts +5 -0
- package/dist/src/lib/api/validateApiKey.d.ts +2 -0
- package/dist/src/lib/components/IvtAnimatedDots.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtAutocomplete.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtCellMenu.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtCellTooltip.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtChooseHeader.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtColDescTooltip.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtCombineDialog.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtConfirmDialog.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtContextMenu/IvtContextMenu.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtContextMenu/contentMenu.util.d.ts +3 -0
- package/dist/src/lib/components/IvtContextMenu/contextMenu.store.d.ts +10 -0
- package/dist/src/lib/components/IvtDialog.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtDiffTable/DiffTableLogic.d.ts +12 -0
- package/dist/src/lib/components/IvtDiffTable/DiffTableLogic.spec.d.ts +1 -0
- package/dist/src/lib/components/IvtDiffTable/IngDiffTable.spec.d.ts +1 -0
- package/dist/src/lib/components/IvtDiffTable/IvtDiffTable.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtExportExcel.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtFindAndReplaceDialog.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtFullPageTextLoading.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtHot.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtInfoTooltip.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtMapHeaders.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtMappingWarningDialog.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtMention/Caret.d.ts +45 -0
- package/dist/src/lib/components/IvtMention/IvtMention.spec.d.ts +1 -0
- package/dist/src/lib/components/IvtMention/IvtMention.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtMention/renderTemplate.d.ts +2 -0
- package/dist/src/lib/components/IvtMention/renderTemplate.spec.d.ts +1 -0
- package/dist/src/lib/components/IvtMention/replaceLabelsWithValues.d.ts +2 -0
- package/dist/src/lib/components/IvtPaginator.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtSmartFixButton.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtStepper/IvtStepper.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtStepper/constants.d.ts +14 -0
- package/dist/src/lib/components/IvtSubmitDialog.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtTable.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtTableBadges.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtTableWrapper.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtToast.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtToasts.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtTooltip.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtUploadIcons.svelte.d.ts +1 -0
- package/dist/src/lib/components/IvtUploader.svelte.d.ts +1 -0
- package/dist/src/lib/constants.d.ts +17 -0
- package/dist/src/lib/icons/IconCSV.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconCheck.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconClearColumn.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconClose.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconCombined.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconError.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconExcel.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconFindAndReplace.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconIntelligence.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconPDF.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconRemoveColumn.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconReplaceEmptyCells.svelte.d.ts +1 -0
- package/dist/src/lib/icons/IconTick.svelte.d.ts +1 -0
- package/dist/src/lib/icons/InfoIcon.svelte.d.ts +1 -0
- package/dist/src/lib/renderers/date-picker.renderer.d.ts +1 -0
- package/dist/src/lib/services/eventHandler.service.d.ts +26 -0
- package/dist/src/lib/store/activeBadge.store.d.ts +3 -0
- package/dist/src/lib/store/constants.d.ts +2 -0
- package/dist/src/lib/store/dataSource.store.d.ts +28 -0
- package/dist/src/lib/store/dataSource.store.spec.d.ts +1 -0
- package/dist/src/lib/store/dialog.store.d.ts +16 -0
- package/dist/src/lib/store/excel-parser.store.d.ts +4 -0
- package/dist/src/lib/store/file.store.d.ts +7 -0
- package/dist/src/lib/store/fileHeaders.store.d.ts +2 -0
- package/dist/src/lib/store/fuzzy.store.d.ts +3 -0
- package/dist/src/lib/store/index.d.ts +13 -0
- package/dist/src/lib/store/initialiseStores.d.ts +3 -0
- package/dist/src/lib/store/mapping.store.d.ts +5 -0
- package/dist/src/lib/store/schema.store.d.ts +3 -0
- package/dist/src/lib/store/stepper.store.d.ts +9 -0
- package/dist/src/lib/store/tableRows.store.d.ts +3 -0
- package/dist/src/lib/store/toast.store.d.ts +4 -0
- package/dist/src/lib/store/validations.store.d.ts +38 -0
- package/dist/src/lib/store/validations.store.spec.d.ts +1 -0
- package/dist/src/lib/types/dto.types.d.ts +10 -0
- package/dist/src/lib/types/events.d.ts +9 -0
- package/dist/src/lib/types/external.types.d.ts +66 -0
- package/dist/src/lib/types/index.d.ts +7 -0
- package/dist/src/lib/types/internal.types.d.ts +143 -0
- package/dist/src/lib/types/parser.types.d.ts +53 -0
- package/dist/src/lib/types/schema.types.d.ts +118 -0
- package/dist/src/lib/types/table.types.d.ts +4 -0
- package/dist/src/lib/types/transformActions.types.d.ts +266 -0
- package/dist/src/lib/types/validators.types.d.ts +113 -0
- package/dist/src/lib/utils/augmentCellChangesWithTableRows.d.ts +21 -0
- package/dist/src/lib/utils/augmentCellChangesWithTableRows.spec.d.ts +1 -0
- package/dist/src/lib/utils/augmentChangesForCrossFieldValidation.d.ts +2 -0
- package/dist/src/lib/utils/augmentChangesForCrossFieldValidation.spec.d.ts +1 -0
- package/dist/src/lib/utils/createField.d.ts +2 -0
- package/dist/src/lib/utils/createFileReaderStore.d.ts +3 -0
- package/dist/src/lib/utils/debounce.d.ts +5 -0
- package/dist/src/lib/utils/downloadTemplate.d.ts +2 -0
- package/dist/src/lib/utils/formatFileSize.d.ts +1 -0
- package/dist/src/lib/utils/getAllPossibleOptions.d.ts +2 -0
- package/dist/src/lib/utils/getCellChangesRowsRange.d.ts +2 -0
- package/dist/src/lib/utils/getCellChangesRowsRange.spec.d.ts +1 -0
- package/dist/src/lib/utils/getEventCords.d.ts +2 -0
- package/dist/src/lib/utils/getFileExtension.d.ts +2 -0
- package/dist/src/lib/utils/hasCalculatedField.d.ts +3 -0
- package/dist/src/lib/utils/hasFullColumnValidators.d.ts +3 -0
- package/dist/src/lib/utils/hot/convertHotDataToIngTableRows.d.ts +2 -0
- package/dist/src/lib/utils/hot/convertTableRowsToHotCellChanges.d.ts +2 -0
- package/dist/src/lib/utils/hot/convertTableRowsToHotData.d.ts +2 -0
- package/dist/src/lib/utils/hot/searchColumn.d.ts +3 -0
- package/dist/src/lib/utils/hot/searchColumn.spec.d.ts +1 -0
- package/dist/src/lib/utils/hot/valueDropdownCellType.d.ts +17 -0
- package/dist/src/lib/utils/isAllMapped.d.ts +3 -0
- package/dist/src/lib/utils/isEqualValue.d.ts +2 -0
- package/dist/src/lib/utils/isEqualValue.spec.d.ts +1 -0
- package/dist/src/lib/utils/isNoOpChanges.d.ts +2 -0
- package/dist/src/lib/utils/isOfType.d.ts +8 -0
- package/dist/src/lib/utils/isSelectOptions.d.ts +1 -0
- package/dist/src/lib/utils/mappers/mapHeaders.d.ts +17 -0
- package/dist/src/lib/utils/mappers/mapHeaders.spec.d.ts +1 -0
- package/dist/src/lib/utils/mappers/mapIngToHotColumns.d.ts +3 -0
- package/dist/src/lib/utils/mustache.d.ts +2 -0
- package/dist/src/lib/utils/mustache.spec.d.ts +1 -0
- package/dist/src/lib/utils/normaliseSchema.d.ts +9 -0
- package/dist/src/lib/utils/normaliseSchema.spec.d.ts +1 -0
- package/dist/src/lib/utils/normalizeFieldOrder/normalizeFieldOrder.d.ts +7 -0
- package/dist/src/lib/utils/normalizeFieldOrder/normalizeFieldOrder.spec.d.ts +1 -0
- package/dist/src/lib/utils/parseNumberOrReturnNull.d.ts +2 -0
- package/dist/src/lib/utils/parseNumberOrReturnNull.spec.d.ts +1 -0
- package/dist/src/lib/utils/sanitiseFieldMappingsAndExtractFieldsForWorker.d.ts +4 -0
- package/dist/src/lib/utils/stripRowDependentClauses.d.ts +5 -0
- package/dist/src/lib/utils/stripRowDependentClauses.spec.d.ts +1 -0
- package/dist/src/lib/utils/throttle.d.ts +5 -0
- package/dist/src/lib/utils/toCleanCamelCase.d.ts +1 -0
- package/dist/src/lib/utils/transformers/transoformTableRows.d.ts +1 -0
- package/dist/src/lib/utils/validators/createValidator.d.ts +2 -0
- package/dist/src/lib/utils/validators/makeResult.d.ts +2 -0
- package/dist/src/lib/utils/validators/resolveEnumerate.d.ts +2 -0
- package/dist/src/lib/utils/validators/rulepilot.d.ts +0 -0
- package/dist/src/lib/utils/validators/sortValidators.d.ts +2 -0
- package/dist/src/lib/utils/validators/spec/boolean.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/comparator.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/creditCard.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/date.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/email.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/enum.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/max.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/maxLength.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/min.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/minLength.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/multiple.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/numeric.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/phone.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/range.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/regex.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/required.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/sortValidators.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/spec.utils.d.ts +4 -0
- package/dist/src/lib/utils/validators/spec/unique.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/spec/url.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/validateBoolean.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateCell.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateCell.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/validateCreditCard.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateDate.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateDate.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/validateEmail.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateEnumerate.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateInvalidIf.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/validateMax.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateMaxLength.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateMin.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateMinLength.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateNumeric.d.ts +2 -0
- package/dist/src/lib/utils/validators/validatePhone.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateRange.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateRegex.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateRequired.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateRows.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateRows.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/validateRules.d.ts +14 -0
- package/dist/src/lib/utils/validators/validateRules.spec.d.ts +1 -0
- package/dist/src/lib/utils/validators/validateUUID.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateUnique.d.ts +2 -0
- package/dist/src/lib/utils/validators/validateUrl.d.ts +2 -0
- package/dist/src/lib/workers/action.worker.d.ts +1 -0
- package/dist/src/lib/workers/excel-parser/createExcelFile.d.ts +6 -0
- package/dist/src/lib/workers/excel-parser/excel-parser.worker.d.ts +1 -0
- package/dist/src/lib/workers/excel-parser/isSameCalendarDate.d.ts +1 -0
- package/dist/src/lib/workers/excel-parser/loadBuffer.d.ts +2 -0
- package/dist/src/lib/workers/excel-parser/normaliseCell.d.ts +13 -0
- package/dist/src/lib/workers/excel-parser/normaliseCell.spec.d.ts +1 -0
- package/dist/src/lib/workers/excel-parser/normaliseRows.d.ts +2 -0
- package/dist/src/lib/workers/excel-parser/normaliseRows.spec.d.ts +1 -0
- package/dist/src/lib/workers/excel-parser/parseComplete.d.ts +8 -0
- package/dist/src/lib/workers/excel-parser/parseComplete.spec.d.ts +1 -0
- package/dist/src/lib/workers/excel-parser/parsePreview.d.ts +9 -0
- package/dist/src/lib/workers/excel-parser/parsePreview.spec.d.ts +1 -0
- package/dist/src/lib/workers/excel-parser/useExcelParseWorker.d.ts +6 -0
- package/dist/src/lib/workers/excel-to-table-rows/excel-to-table-rows.worker.d.ts +3 -0
- package/dist/src/lib/workers/excel-to-table-rows/sortWorkbookMappings.d.ts +2 -0
- package/dist/src/lib/workers/excel-to-table-rows/sortWorkbookMappings.spec.d.ts +1 -0
- package/dist/src/lib/workers/excel-to-table-rows/useExcelToTableRowsWorker.d.ts +5 -0
- package/dist/src/lib/workers/hooks/actionDispatcher.d.ts +2 -0
- package/dist/src/lib/workers/hooks/useActionWorker.d.ts +4 -0
- package/dist/src/lib/workers/transform-table-rows/transformTable.worker.d.ts +1 -0
- package/dist/src/lib/workers/transform-table-rows/transformTableRows.d.ts +2 -0
- package/dist/src/lib/workers/transform-table-rows/transformTableRows.spec.d.ts +1 -0
- package/dist/src/lib/workers/transform-table-rows/useTransformTableRows.d.ts +6 -0
- package/dist/src/lib/workers/validator/useValidatorWorker.d.ts +6 -0
- package/dist/src/lib/workers/validator/validator.worker.d.ts +1 -0
- package/dist/src/lib/workers/workerPool.d.ts +11 -0
- package/dist/src/mock/mock-field-mappings.d.ts +15 -0
- package/dist/src/routes/e2e/mock-mappings/mock-fields-ai-mapping.d.ts +2 -0
- package/dist/src/routes/e2e/mock-mappings/mock-fields-all-match.d.ts +2 -0
- package/dist/src/routes/shared.d.ts +1 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +101 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { WorkBook } from 'xlsx';
|
|
2
|
+
import { DataSources, IAutoCompleteFieldSchemaInternal, ICheckBoxFieldSchemaInternal, ICombineFiledSchemaInternal, IDateFieldSchemaInternal, IDropDownFieldSchemaInternal, IFieldSchemaInternal, IMenuFieldSchemaInternal, INumericFieldSchemaInternal, IPasswordFieldSchemaInternal, ISelectFieldSchemaInternal, ITextFieldSchemaInternal, ITimeFieldSchemaInternal } from './schema.types';
|
|
3
|
+
import { ITableRowInternal, ITableRowsInternal } from './table.types';
|
|
4
|
+
import { ICellError } from './validators.types';
|
|
5
|
+
import { ICellTransformAction, IColumnTransformAction, ITransformActionPayload, ITransformActionRunOn } from './transformActions.types';
|
|
6
|
+
import { IParsedSheetData } from './parser.types';
|
|
7
|
+
export type IFuseIndex<_> = any;
|
|
8
|
+
export interface FieldSchemaMap {
|
|
9
|
+
autocomplete: IAutoCompleteFieldSchemaInternal;
|
|
10
|
+
dropdown: IDropDownFieldSchemaInternal;
|
|
11
|
+
checkbox: ICheckBoxFieldSchemaInternal;
|
|
12
|
+
date: IDateFieldSchemaInternal;
|
|
13
|
+
select: ISelectFieldSchemaInternal;
|
|
14
|
+
numeric: INumericFieldSchemaInternal;
|
|
15
|
+
password: IPasswordFieldSchemaInternal;
|
|
16
|
+
text: ITextFieldSchemaInternal;
|
|
17
|
+
time: ITimeFieldSchemaInternal;
|
|
18
|
+
combine: ICombineFiledSchemaInternal;
|
|
19
|
+
}
|
|
20
|
+
export interface IFileHeader {
|
|
21
|
+
label: string;
|
|
22
|
+
key: string;
|
|
23
|
+
order: number;
|
|
24
|
+
}
|
|
25
|
+
export interface IFieldMapping {
|
|
26
|
+
field: IFieldSchemaInternal;
|
|
27
|
+
file: IFileHeader | null;
|
|
28
|
+
perfectMatch: boolean;
|
|
29
|
+
guessMatch: boolean;
|
|
30
|
+
aiMatch: boolean;
|
|
31
|
+
manualMatch: boolean;
|
|
32
|
+
hiddenInMappingStage: boolean;
|
|
33
|
+
hiddenInReviewState: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface IFieldMappingSanitised {
|
|
36
|
+
field: IFieldSchemaSanitised;
|
|
37
|
+
file: IFileHeader | null;
|
|
38
|
+
perfectMatch: boolean;
|
|
39
|
+
guessMatch: boolean;
|
|
40
|
+
aiMatch: boolean;
|
|
41
|
+
}
|
|
42
|
+
export type IHotCellEditChange = [
|
|
43
|
+
number,
|
|
44
|
+
string,
|
|
45
|
+
IvtCellValue,
|
|
46
|
+
IvtCellValue
|
|
47
|
+
];
|
|
48
|
+
export type IHotCellUpdateChange = [
|
|
49
|
+
number,
|
|
50
|
+
string,
|
|
51
|
+
IvtCellValue
|
|
52
|
+
];
|
|
53
|
+
export type ISimpleOption = {
|
|
54
|
+
label: string;
|
|
55
|
+
value: string;
|
|
56
|
+
};
|
|
57
|
+
export type IFieldSchemaSanitised = Pick<IFieldSchemaInternal, 'validators' | 'key' | 'order' | 'label' | 'type' | 'transformers'> & Partial<Pick<IMenuFieldSchemaInternal, 'options' | 'acceptNewValueIfNoOptions'>>;
|
|
58
|
+
export type IFieldMappings = IFieldMapping[];
|
|
59
|
+
export type IFileStore = {
|
|
60
|
+
fileHeaders: IFileHeader[];
|
|
61
|
+
workBook: WorkBook | null;
|
|
62
|
+
};
|
|
63
|
+
export interface ICellErrorWithMeta {
|
|
64
|
+
row: number;
|
|
65
|
+
fieldKey: IFieldSchemaInternal['key'];
|
|
66
|
+
col: number;
|
|
67
|
+
error: ICellError;
|
|
68
|
+
}
|
|
69
|
+
export interface IValidatorWorkerResponse {
|
|
70
|
+
errors: ICellErrorWithMeta[];
|
|
71
|
+
status: 'in-progress' | 'done' | 'failed';
|
|
72
|
+
error?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface IActionWorkerResponse {
|
|
75
|
+
data: ITableRowsInternal;
|
|
76
|
+
status: 'done' | 'failed';
|
|
77
|
+
}
|
|
78
|
+
export interface ITransformerWorkerResponse {
|
|
79
|
+
data: ITableRowsInternal;
|
|
80
|
+
chunkStart: number;
|
|
81
|
+
status: 'done' | 'failed';
|
|
82
|
+
}
|
|
83
|
+
export type FuzzyIndexes = Map<string, string>;
|
|
84
|
+
export interface IValidatorWorkerMessage {
|
|
85
|
+
rowRange: ITableRowRange;
|
|
86
|
+
tableRows: ITableRowInternal[];
|
|
87
|
+
dataSource: DataSources;
|
|
88
|
+
tableRowsStartIndex: number;
|
|
89
|
+
fieldSchemas: IFieldSchemaSanitised[];
|
|
90
|
+
}
|
|
91
|
+
export interface ITableRowRange {
|
|
92
|
+
startRowIndex: number;
|
|
93
|
+
rowsLength: number;
|
|
94
|
+
}
|
|
95
|
+
export interface IValidateCellChangesData {
|
|
96
|
+
changes: IHotCellEditChange[];
|
|
97
|
+
tableRows: ITableRowsInternal;
|
|
98
|
+
dataSource?: DataSources;
|
|
99
|
+
fieldSchemas: IFieldSchemaSanitised[];
|
|
100
|
+
}
|
|
101
|
+
export interface IActionWorkerMessage {
|
|
102
|
+
hotData: IvtCellValue[][];
|
|
103
|
+
hiddenRows: number[];
|
|
104
|
+
cellErrors: ICellErrorWithMeta[];
|
|
105
|
+
action: IColumnTransformAction | ICellTransformAction;
|
|
106
|
+
payload: ITransformActionPayload;
|
|
107
|
+
dataSources: DataSources;
|
|
108
|
+
}
|
|
109
|
+
export interface IMappingWorkerResponse {
|
|
110
|
+
tableRows: ITableRowsInternal;
|
|
111
|
+
status: 'done' | 'failed';
|
|
112
|
+
error?: string;
|
|
113
|
+
}
|
|
114
|
+
export interface IMappingWorkerMessage {
|
|
115
|
+
fieldMappings: IFieldMappingSanitised[];
|
|
116
|
+
sheetData: IParsedSheetData['rows'];
|
|
117
|
+
}
|
|
118
|
+
export interface ITransformerTableWorkerMessage {
|
|
119
|
+
tableRows: ITableRowsInternal;
|
|
120
|
+
hiddenRows: number[];
|
|
121
|
+
chunkStart: number;
|
|
122
|
+
dataSources: DataSources;
|
|
123
|
+
cellErrors: ICellErrorWithMeta[];
|
|
124
|
+
runOns: ITransformActionRunOn[];
|
|
125
|
+
fieldSchemas: IFieldSchemaSanitised[];
|
|
126
|
+
}
|
|
127
|
+
export type IToastMessage = {
|
|
128
|
+
id?: string;
|
|
129
|
+
title?: string;
|
|
130
|
+
message?: string;
|
|
131
|
+
type: 'info' | 'error' | 'warning' | 'success';
|
|
132
|
+
dismissible?: boolean;
|
|
133
|
+
timeout?: number;
|
|
134
|
+
};
|
|
135
|
+
export type IFileExtension = 'xls' | 'xlsx' | 'csv' | 'pdf' | 'json' | 'txt' | 'xml' | 'unknown';
|
|
136
|
+
export type IvtCellValue = string | number | Date | null | undefined | boolean;
|
|
137
|
+
export type ISearchColumnResult = {
|
|
138
|
+
row: number;
|
|
139
|
+
column: number;
|
|
140
|
+
cellValue: string;
|
|
141
|
+
};
|
|
142
|
+
export type IActiveBadge = 'valid' | 'warning' | 'invalid' | 'all' | 'duplicate';
|
|
143
|
+
export type IRowRange = 'all' | 'errors' | 'warnings' | 'valids' | 'duplicates';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request to the worker.
|
|
3
|
+
* - “preview” asks for the first 20 rows of every sheet.
|
|
4
|
+
* - “complete” asks for one sheet, given a sheetName and headerRowIndex.
|
|
5
|
+
*/
|
|
6
|
+
export type IExcelWorkerRequest = {
|
|
7
|
+
requestId: string;
|
|
8
|
+
type: 'preview';
|
|
9
|
+
file: File;
|
|
10
|
+
} | {
|
|
11
|
+
requestId: string;
|
|
12
|
+
type: 'complete';
|
|
13
|
+
sheetName: string;
|
|
14
|
+
headerRowIndex: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The shape of each sheet’s result, in both “preview” and “complete” modes.
|
|
18
|
+
* - `rows` is always defined.
|
|
19
|
+
* - `fileHeaders` is only populated when event = "complete", otherwise undefined.
|
|
20
|
+
*/
|
|
21
|
+
export interface IParsedSheetData {
|
|
22
|
+
sheetName: string;
|
|
23
|
+
rows: any[][];
|
|
24
|
+
fileHeaders?: Array<{
|
|
25
|
+
label: any;
|
|
26
|
+
key: string;
|
|
27
|
+
order: number;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Worker’s response.
|
|
32
|
+
* - `event` is either "preview" or "complete" (or "error").
|
|
33
|
+
* - `sheets` is always an array of ISheetResult.
|
|
34
|
+
*/
|
|
35
|
+
export interface IExcelWorkerResponse {
|
|
36
|
+
requestId: string;
|
|
37
|
+
event: 'preview' | 'complete' | 'error';
|
|
38
|
+
sheets: IParsedSheetData[];
|
|
39
|
+
error?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface IExcelDataStore {
|
|
42
|
+
previewSheets: IParsedSheetData[];
|
|
43
|
+
selected: {
|
|
44
|
+
sheetName: string | null;
|
|
45
|
+
headerIndex: number | null;
|
|
46
|
+
sheetData: IParsedSheetData | null;
|
|
47
|
+
};
|
|
48
|
+
error?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ISelectedSheetAndHeader {
|
|
51
|
+
sheetName: string;
|
|
52
|
+
headerIndex: number;
|
|
53
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { IFieldValidatorInternal } from './validators.types';
|
|
2
|
+
import { ITableRowsInternal } from './table.types';
|
|
3
|
+
import { IFileExtension, IvtCellValue } from './internal.types';
|
|
4
|
+
import { ICombineColumnsTransformActionPayload, IFieldTransformerMapInternal } from './transformActions.types';
|
|
5
|
+
import { IEventHandlersInternal } from './events';
|
|
6
|
+
export type IFieldSchemaType = 'autocomplete' | 'dropdown' | 'checkbox' | 'date' | 'numeric' | 'password' | 'select' | 'text' | 'combine' | 'time';
|
|
7
|
+
export interface IBaseFieldSchemaInternal {
|
|
8
|
+
validators?: IFieldValidatorInternal[];
|
|
9
|
+
transformers?: IFieldTransformerMapInternal[];
|
|
10
|
+
type: IFieldSchemaType;
|
|
11
|
+
label: string;
|
|
12
|
+
key: string;
|
|
13
|
+
order: number;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
textEllipsis?: boolean;
|
|
16
|
+
description?: string;
|
|
17
|
+
columnWidth?: number;
|
|
18
|
+
alternativeMatches?: string[];
|
|
19
|
+
defaultValue?: IvtCellValue;
|
|
20
|
+
onChange?: (rowNumber: number, oldValue: string, newValue: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface ICheckBoxFieldSchemaInternal extends Omit<IBaseFieldSchemaInternal, 'defaultValue'> {
|
|
23
|
+
type: 'checkbox';
|
|
24
|
+
defaultValue?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface IDateFieldSchemaInternal extends Omit<IBaseFieldSchemaInternal, 'defaultValue'> {
|
|
27
|
+
type: 'date';
|
|
28
|
+
defaultValue?: Date | string;
|
|
29
|
+
parsePatterns?: string[];
|
|
30
|
+
strictParsing?: boolean;
|
|
31
|
+
yearRange?: [Date, Date];
|
|
32
|
+
formatPattern: string;
|
|
33
|
+
}
|
|
34
|
+
export interface INumericFieldSchemaInternal extends Omit<IBaseFieldSchemaInternal, 'defaultValue'> {
|
|
35
|
+
type: 'numeric';
|
|
36
|
+
defaultValue?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface IPasswordFieldSchemaInternal extends IBaseFieldSchemaInternal {
|
|
39
|
+
type: 'password';
|
|
40
|
+
}
|
|
41
|
+
export interface IAutoCompleteFieldSchemaInternal extends IBaseFieldSchemaInternal {
|
|
42
|
+
type: 'autocomplete';
|
|
43
|
+
options: IDataSourceResolver;
|
|
44
|
+
acceptNewValueIfNoOptions?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export type IDropdownFieldOption = {
|
|
47
|
+
label: string;
|
|
48
|
+
value: string;
|
|
49
|
+
};
|
|
50
|
+
export interface ISelectFieldSchemaInternal extends IBaseFieldSchemaInternal {
|
|
51
|
+
type: 'select';
|
|
52
|
+
options: IDataSourceResolver;
|
|
53
|
+
acceptNewValueIfNoOptions?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface IDropDownFieldSchemaInternal extends IBaseFieldSchemaInternal {
|
|
56
|
+
type: 'dropdown';
|
|
57
|
+
options: IDataSourceResolver;
|
|
58
|
+
acceptNewValueIfNoOptions?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface ITextFieldSchemaInternal extends IBaseFieldSchemaInternal {
|
|
61
|
+
type: 'text';
|
|
62
|
+
}
|
|
63
|
+
export interface ICombineFiledSchemaInternal extends Omit<IBaseFieldSchemaInternal, 'alternativeMatches'> {
|
|
64
|
+
type: 'combine';
|
|
65
|
+
combine: Omit<ICombineColumnsTransformActionPayload, 'fieldSchemas' | 'columnNumber'>;
|
|
66
|
+
}
|
|
67
|
+
export interface ITimeFieldSchemaInternal extends IBaseFieldSchemaInternal {
|
|
68
|
+
type: 'time';
|
|
69
|
+
}
|
|
70
|
+
export type DataSources = Record<string, any>;
|
|
71
|
+
/**
|
|
72
|
+
* Defines how to resolve dynamic options from dataSources
|
|
73
|
+
*/
|
|
74
|
+
export interface IDataSourceResolver {
|
|
75
|
+
query: string;
|
|
76
|
+
}
|
|
77
|
+
export type IMenuFieldSchemaInternal = IAutoCompleteFieldSchemaInternal | IDropDownFieldSchemaInternal | ISelectFieldSchemaInternal;
|
|
78
|
+
export type IFieldSchemaInternal = IMenuFieldSchemaInternal | ICheckBoxFieldSchemaInternal | IDateFieldSchemaInternal | INumericFieldSchemaInternal | IPasswordFieldSchemaInternal | ITextFieldSchemaInternal | ICombineFiledSchemaInternal | ITimeFieldSchemaInternal;
|
|
79
|
+
export type IngSchemaInternal = {
|
|
80
|
+
id: string;
|
|
81
|
+
title: string;
|
|
82
|
+
dataSources: DataSources;
|
|
83
|
+
fields: IFieldSchemaInternal[];
|
|
84
|
+
apiKey: string;
|
|
85
|
+
initialData?: ITableRowsInternal[];
|
|
86
|
+
initialFile?: File;
|
|
87
|
+
environment?: 'local' | 'dev' | 'staging' | 'prod';
|
|
88
|
+
browserExcelParsing?: boolean;
|
|
89
|
+
eventHandlers?: IEventHandlersInternal;
|
|
90
|
+
stepsConfig: {
|
|
91
|
+
uploadFileStep: {
|
|
92
|
+
supportedExtensions: IFileExtension[];
|
|
93
|
+
dataEntryMethod: 'manual' | 'upload' | 'manual_and_upload';
|
|
94
|
+
maxColumns: number;
|
|
95
|
+
maxRows: number;
|
|
96
|
+
maxFileSize: number;
|
|
97
|
+
};
|
|
98
|
+
mapHeadersStep: {
|
|
99
|
+
passThroughExcessColumns: boolean;
|
|
100
|
+
autoMapHeaders: boolean;
|
|
101
|
+
unMatchedHeadersBehaviour: 'block' | 'allow' | 'warn';
|
|
102
|
+
};
|
|
103
|
+
reviewStep: {
|
|
104
|
+
invalidDataBehaviour: 'block_submit' | 'remove_invalid_rows' | 'include_invalid_rows';
|
|
105
|
+
includeValidationMetadata: boolean;
|
|
106
|
+
includeOriginalData: boolean;
|
|
107
|
+
storeInServer: boolean;
|
|
108
|
+
allowCustomColumn: boolean;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
advanced: {
|
|
112
|
+
maxInMemoryValidationRows: number;
|
|
113
|
+
maxPerWorkerValidationRows: number;
|
|
114
|
+
maxInMemoryTransformationRows: number;
|
|
115
|
+
maxPerWorkerTransformationRows: number;
|
|
116
|
+
};
|
|
117
|
+
locale?: 'en' | 'bn' | 'cs' | 'da' | 'de' | 'el' | 'es' | 'fi' | 'fr' | 'hi' | 'hr' | 'hu' | 'id' | 'is' | 'it' | 'ja' | 'ko' | 'lt' | 'lv' | 'ms' | 'nl' | 'no' | 'pl' | 'pt' | 'ro' | 'ru' | 'sw' | 'sv' | 'th' | 'tr' | 'uk' | 'vi' | 'zh_CN' | 'zh_TW';
|
|
118
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IvtCellValue } from './internal.types';
|
|
2
|
+
export type DefaultTableRowType = Record<string, IvtCellValue>;
|
|
3
|
+
export type ITableRowInternal<TableRow = DefaultTableRowType> = Record<keyof TableRow, IvtCellValue>;
|
|
4
|
+
export type ITableRowsInternal<TableRow = DefaultTableRowType> = ITableRowInternal<TableRow>[];
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { IFieldSchemaSanitised, IvtCellValue } from './internal.types';
|
|
2
|
+
import { UUIDVersion } from 'validator';
|
|
3
|
+
import { IDataSourceResolver } from './schema.types';
|
|
4
|
+
import { LocaleSpecifier, MomentBuiltinFormat } from 'moment/moment';
|
|
5
|
+
export declare enum IInvalidCellTransformerAction {
|
|
6
|
+
GenerateUUID = "generateUUID",
|
|
7
|
+
FuzzyFix = "fuzzyFix"
|
|
8
|
+
}
|
|
9
|
+
export declare enum ICellTransformAction {
|
|
10
|
+
TrimWhitespace = "trimWhitespace",
|
|
11
|
+
MapToEnum = "mapToEnum",
|
|
12
|
+
DefaultValue = "defaultValue",
|
|
13
|
+
ToUpperCase = "toUpperCase",
|
|
14
|
+
ToLowerCase = "toLowerCase",
|
|
15
|
+
TitleCaseText = "titleCaseText",
|
|
16
|
+
PadString = "padString",
|
|
17
|
+
TruncateText = "truncateText",
|
|
18
|
+
StripHtmlTags = "stripHtmlTags",
|
|
19
|
+
RegexReplace = "regexReplace",
|
|
20
|
+
AutoIncrementIds = "autoIncrementIds",
|
|
21
|
+
FillWithTimestamp = "fillWithTimestamp",
|
|
22
|
+
ParseNumbers = "parseNumbers",
|
|
23
|
+
RoundNumbers = "roundNumbers",
|
|
24
|
+
ScaleNumbers = "scaleNumbers",
|
|
25
|
+
NormalizeZScore = "normalizeZScore",
|
|
26
|
+
FormatDates = "formatDates",
|
|
27
|
+
NormalizeUrls = "normalizeUrls",
|
|
28
|
+
MapCountryNames = "mapCountryNames",
|
|
29
|
+
CombineColumns = "combineColumns"
|
|
30
|
+
}
|
|
31
|
+
export declare enum IColumnTransformAction {
|
|
32
|
+
ForwardFill = "forwardFill",
|
|
33
|
+
BackwardFill = "backwardFill",
|
|
34
|
+
ClampRange = "clampRange",
|
|
35
|
+
ClearCellRange = "clearCellRange",
|
|
36
|
+
FindAndReplace = "findAndReplace",
|
|
37
|
+
ClearColumn = "clearColumn",
|
|
38
|
+
RemoveColumn = "removeColumn",
|
|
39
|
+
ReplaceEmptyCells = "replaceEmptyCells"
|
|
40
|
+
}
|
|
41
|
+
export type ITransformActionRunOn = 'load' | 'cells-change' | 'load-invalid-cells';
|
|
42
|
+
export interface ITransformActionPayloadBase {
|
|
43
|
+
runOns?: ITransformActionRunOn[];
|
|
44
|
+
columnNumber: number;
|
|
45
|
+
fieldSchemas: IFieldSchemaSanitised[];
|
|
46
|
+
}
|
|
47
|
+
export interface IParseNumberActionPayload extends ITransformActionPayloadBase {
|
|
48
|
+
dropNonNumbers?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export type IClearColumnTransformActionPayload = ITransformActionPayloadBase;
|
|
51
|
+
export type IRemoveColumnTransformActionPayload = ITransformActionPayloadBase;
|
|
52
|
+
export type ITrimWhitespaceTransformActionPayload = ITransformActionPayloadBase;
|
|
53
|
+
export type IToUpperCaseTransformActionPayload = ITransformActionPayloadBase;
|
|
54
|
+
export type IToLowerCaseTransformActionPayload = ITransformActionPayloadBase;
|
|
55
|
+
export interface ITitleCaseTextTransformActionPayload extends ITransformActionPayloadBase {
|
|
56
|
+
allWords?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export type IStripHtmlTagsTransformActionPayload = ITransformActionPayloadBase;
|
|
59
|
+
export type IRemoveDuplicatesTransformActionPayload = ITransformActionPayloadBase;
|
|
60
|
+
export type IForwardFillTransformActionPayload = ITransformActionPayloadBase;
|
|
61
|
+
export type IBackwardFillTransformActionPayload = ITransformActionPayloadBase;
|
|
62
|
+
export interface IReplaceEmptyCellsTransformActionPayload extends ITransformActionPayloadBase {
|
|
63
|
+
/** Value to insert into empty cells */
|
|
64
|
+
value: IvtCellValue;
|
|
65
|
+
}
|
|
66
|
+
export interface IFindAndReplaceTransformActionPayload extends ITransformActionPayloadBase {
|
|
67
|
+
/** Substring or regex to find; null = clear entire column */
|
|
68
|
+
query: string | null;
|
|
69
|
+
/** Replacement text */
|
|
70
|
+
replaceWith: string;
|
|
71
|
+
/** Case‑insensitive search */
|
|
72
|
+
insensitive?: boolean;
|
|
73
|
+
/** Whether to match with the entire cell's content, or partial */
|
|
74
|
+
matchFullString?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface IPadStringTransformActionPayload extends ITransformActionPayloadBase {
|
|
77
|
+
length: number;
|
|
78
|
+
char?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface IMapToEnumTransformActionPayloadInternal extends ITransformActionPayloadBase {
|
|
81
|
+
resolver: IDataSourceResolver;
|
|
82
|
+
}
|
|
83
|
+
export interface IDefaultValueTransformActionPayload extends ITransformActionPayloadBase {
|
|
84
|
+
defaultValue: IvtCellValue;
|
|
85
|
+
}
|
|
86
|
+
export interface ITruncateTextTransformActionPayload extends ITransformActionPayloadBase {
|
|
87
|
+
maxLength: number;
|
|
88
|
+
/** Text to append when truncated, default '…' */
|
|
89
|
+
suffix?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface IRegexReplaceTransformActionPayload extends ITransformActionPayloadBase {
|
|
92
|
+
pattern: string;
|
|
93
|
+
flags?: string;
|
|
94
|
+
replaceWith: string;
|
|
95
|
+
}
|
|
96
|
+
export interface IClearCellRangeTransformActionPayload extends ITransformActionPayloadBase {
|
|
97
|
+
startRow: number;
|
|
98
|
+
endRow: number;
|
|
99
|
+
}
|
|
100
|
+
export interface IRemoveRowsTransformActionPayload extends ITransformActionPayloadBase {
|
|
101
|
+
/** Array of filter conditions to drop matching rows */
|
|
102
|
+
filters: Array<{
|
|
103
|
+
column: string;
|
|
104
|
+
operator: '=' | '!=' | '>' | '<=' | 'regex';
|
|
105
|
+
value: IvtCellValue;
|
|
106
|
+
}>;
|
|
107
|
+
}
|
|
108
|
+
export interface IAutoIncrementIdsTransformActionPayload extends ITransformActionPayloadBase {
|
|
109
|
+
start?: number;
|
|
110
|
+
step?: number;
|
|
111
|
+
}
|
|
112
|
+
export interface IGenerateUUIDsTransformActionPayload extends ITransformActionPayloadBase {
|
|
113
|
+
version: UUIDVersion;
|
|
114
|
+
/** Required for v3/v5 */
|
|
115
|
+
namespace?: string;
|
|
116
|
+
/** Required for v3/v5 */
|
|
117
|
+
name?: string;
|
|
118
|
+
}
|
|
119
|
+
export interface IFillWithTimestampTransformActionPayload extends ITransformActionPayloadBase {
|
|
120
|
+
timestamp?: Date;
|
|
121
|
+
}
|
|
122
|
+
export interface IRoundNumbersTransformActionPayload extends ITransformActionPayloadBase {
|
|
123
|
+
decimals: number;
|
|
124
|
+
}
|
|
125
|
+
export interface IFuzzyMatchTransformActionPayload extends ITransformActionPayloadBase {
|
|
126
|
+
isCaseSensitive?: boolean;
|
|
127
|
+
threshold?: number;
|
|
128
|
+
}
|
|
129
|
+
export interface IClampRangeTransformActionPayload extends ITransformActionPayloadBase {
|
|
130
|
+
min?: number;
|
|
131
|
+
max?: number;
|
|
132
|
+
}
|
|
133
|
+
export interface IScaleNumbersTransformActionPayload extends ITransformActionPayloadBase {
|
|
134
|
+
factor: number;
|
|
135
|
+
}
|
|
136
|
+
export type INormalizeZScoreTransformActionPayload = ITransformActionPayloadBase;
|
|
137
|
+
export interface IParseDatesTransformActionPayload extends ITransformActionPayloadBase {
|
|
138
|
+
formats: string[];
|
|
139
|
+
}
|
|
140
|
+
export interface IFormatDatesTransformActionPayload extends ITransformActionPayloadBase {
|
|
141
|
+
strictParsing?: boolean;
|
|
142
|
+
parsePatterns?: (string | MomentBuiltinFormat)[];
|
|
143
|
+
/** momentJs format string */
|
|
144
|
+
formatPattern: string;
|
|
145
|
+
/** optional locale from 'momentJs/locale' */
|
|
146
|
+
locale?: LocaleSpecifier;
|
|
147
|
+
}
|
|
148
|
+
export interface IExtractDatePartsTransformActionPayload extends ITransformActionPayloadBase {
|
|
149
|
+
parts: Array<'year' | 'month' | 'day' | 'weekday'>;
|
|
150
|
+
}
|
|
151
|
+
export interface IComputeDateDifferencesTransformActionPayload extends ITransformActionPayloadBase {
|
|
152
|
+
startColumn: string;
|
|
153
|
+
endColumn: string;
|
|
154
|
+
unit: 'days' | 'hours' | 'minutes';
|
|
155
|
+
outputColumn: string;
|
|
156
|
+
}
|
|
157
|
+
export interface IFormatPhoneNumbersTransformActionPayload extends ITransformActionPayloadBase {
|
|
158
|
+
region?: string;
|
|
159
|
+
format?: 'E.164' | 'INTERNATIONAL' | 'NATIONAL';
|
|
160
|
+
}
|
|
161
|
+
export interface IValidateEmailsTransformActionPayload extends ITransformActionPayloadBase {
|
|
162
|
+
/** If true, adds a `_validEmail` boolean column */
|
|
163
|
+
tagInvalid?: boolean;
|
|
164
|
+
}
|
|
165
|
+
export interface IMaskPIITransformActionPayload extends ITransformActionPayloadBase {
|
|
166
|
+
visibleCount: number;
|
|
167
|
+
maskChar?: string;
|
|
168
|
+
}
|
|
169
|
+
export interface INormalizeUrlsTransformActionPayload extends ITransformActionPayloadBase {
|
|
170
|
+
enforceHttps?: boolean;
|
|
171
|
+
removeQueryParams?: boolean;
|
|
172
|
+
}
|
|
173
|
+
export interface IValidateUrlsTransformActionPayload extends ITransformActionPayloadBase {
|
|
174
|
+
/** If true, adds a `_validUrl` boolean column */
|
|
175
|
+
tagInvalid?: boolean;
|
|
176
|
+
}
|
|
177
|
+
export interface IEnforceRequiredFieldsTransformActionPayload extends ITransformActionPayloadBase {
|
|
178
|
+
defaultValue?: IvtCellValue;
|
|
179
|
+
}
|
|
180
|
+
export interface IEnforceUniqueTransformActionPayload extends ITransformActionPayloadBase {
|
|
181
|
+
strategy: 'suffix' | 'drop';
|
|
182
|
+
suffixSeparator?: string;
|
|
183
|
+
}
|
|
184
|
+
export interface IEnforceNumericBoundsTransformActionPayload extends ITransformActionPayloadBase {
|
|
185
|
+
min?: number;
|
|
186
|
+
max?: number;
|
|
187
|
+
strategy?: 'clamp' | 'flag';
|
|
188
|
+
}
|
|
189
|
+
export interface ISortRowsTransformActionPayload extends ITransformActionPayloadBase {
|
|
190
|
+
keys: Array<{
|
|
191
|
+
column: string;
|
|
192
|
+
direction: 'asc' | 'desc';
|
|
193
|
+
}>;
|
|
194
|
+
}
|
|
195
|
+
export interface IFilterRowsTransformActionPayload extends ITransformActionPayloadBase {
|
|
196
|
+
filters: Array<{
|
|
197
|
+
column: string;
|
|
198
|
+
operator: '=' | '!=' | '>' | '<=' | 'regex';
|
|
199
|
+
value: IvtCellValue;
|
|
200
|
+
}>;
|
|
201
|
+
}
|
|
202
|
+
export interface IGroupAndAggregateTransformActionPayload extends ITransformActionPayloadBase {
|
|
203
|
+
groupBy: string[];
|
|
204
|
+
aggregations: Record<string, 'sum' | 'avg' | 'count' | 'min' | 'max'>;
|
|
205
|
+
}
|
|
206
|
+
export interface ICombineColumnsTransformActionPayload extends ITransformActionPayloadBase {
|
|
207
|
+
template: string;
|
|
208
|
+
}
|
|
209
|
+
export interface IPivotTableTransformActionPayload extends ITransformActionPayloadBase {
|
|
210
|
+
index: string[];
|
|
211
|
+
columns: string;
|
|
212
|
+
values: string;
|
|
213
|
+
aggregator?: 'sum' | 'count' | 'avg';
|
|
214
|
+
}
|
|
215
|
+
export interface ILookupCountryNamesTransformActionPayload extends ITransformActionPayloadBase {
|
|
216
|
+
direction: 'codeToName' | 'nameToCode';
|
|
217
|
+
}
|
|
218
|
+
export interface IConvertCurrencyTransformActionPayload extends ITransformActionPayloadBase {
|
|
219
|
+
rate: number;
|
|
220
|
+
currencyFrom?: string;
|
|
221
|
+
currencyTo?: string;
|
|
222
|
+
}
|
|
223
|
+
export interface IInferMissingDataTransformActionPayload extends ITransformActionPayloadBase {
|
|
224
|
+
promptTemplate: string;
|
|
225
|
+
maxTokens?: number;
|
|
226
|
+
}
|
|
227
|
+
export interface ISuggestCorrectionsTransformActionPayload extends ITransformActionPayloadBase {
|
|
228
|
+
maxSuggestions?: number;
|
|
229
|
+
}
|
|
230
|
+
export type ITransformActionPayload = IClearColumnTransformActionPayload | IParseNumberActionPayload | IReplaceEmptyCellsTransformActionPayload | IFindAndReplaceTransformActionPayload | IRemoveColumnTransformActionPayload | ITrimWhitespaceTransformActionPayload | IToUpperCaseTransformActionPayload | IToLowerCaseTransformActionPayload | ITitleCaseTextTransformActionPayload | IPadStringTransformActionPayload | ITruncateTextTransformActionPayload | IStripHtmlTagsTransformActionPayload | IRegexReplaceTransformActionPayload | IClearCellRangeTransformActionPayload | IRemoveDuplicatesTransformActionPayload | IRemoveRowsTransformActionPayload | IForwardFillTransformActionPayload | IBackwardFillTransformActionPayload | IAutoIncrementIdsTransformActionPayload | IGenerateUUIDsTransformActionPayload | IFillWithTimestampTransformActionPayload | IRoundNumbersTransformActionPayload | IClampRangeTransformActionPayload | IScaleNumbersTransformActionPayload | INormalizeZScoreTransformActionPayload | IParseDatesTransformActionPayload | IFormatDatesTransformActionPayload | IExtractDatePartsTransformActionPayload | IComputeDateDifferencesTransformActionPayload | IFormatPhoneNumbersTransformActionPayload | IValidateEmailsTransformActionPayload | IMaskPIITransformActionPayload | INormalizeUrlsTransformActionPayload | IValidateUrlsTransformActionPayload | IEnforceRequiredFieldsTransformActionPayload | IEnforceUniqueTransformActionPayload | IEnforceNumericBoundsTransformActionPayload | ISortRowsTransformActionPayload | IFilterRowsTransformActionPayload | IGroupAndAggregateTransformActionPayload | IPivotTableTransformActionPayload | ILookupCountryNamesTransformActionPayload | IConvertCurrencyTransformActionPayload | IInferMissingDataTransformActionPayload | ISuggestCorrectionsTransformActionPayload | IFuzzyMatchTransformActionPayload;
|
|
231
|
+
export type CellActionPayloadMap = {
|
|
232
|
+
[ICellTransformAction.TrimWhitespace]: ITrimWhitespaceTransformActionPayload;
|
|
233
|
+
[ICellTransformAction.ToUpperCase]: IToUpperCaseTransformActionPayload;
|
|
234
|
+
[ICellTransformAction.ToLowerCase]: IToLowerCaseTransformActionPayload;
|
|
235
|
+
[ICellTransformAction.TitleCaseText]: ITitleCaseTextTransformActionPayload;
|
|
236
|
+
[ICellTransformAction.PadString]: IPadStringTransformActionPayload;
|
|
237
|
+
[ICellTransformAction.MapToEnum]: IMapToEnumTransformActionPayloadInternal;
|
|
238
|
+
[ICellTransformAction.DefaultValue]: IDefaultValueTransformActionPayload;
|
|
239
|
+
[ICellTransformAction.TruncateText]: ITruncateTextTransformActionPayload;
|
|
240
|
+
[ICellTransformAction.StripHtmlTags]: IStripHtmlTagsTransformActionPayload;
|
|
241
|
+
[ICellTransformAction.RegexReplace]: IRegexReplaceTransformActionPayload;
|
|
242
|
+
[ICellTransformAction.AutoIncrementIds]: IAutoIncrementIdsTransformActionPayload;
|
|
243
|
+
[ICellTransformAction.FillWithTimestamp]: IFillWithTimestampTransformActionPayload;
|
|
244
|
+
[ICellTransformAction.RoundNumbers]: IRoundNumbersTransformActionPayload;
|
|
245
|
+
[ICellTransformAction.ScaleNumbers]: IScaleNumbersTransformActionPayload;
|
|
246
|
+
[ICellTransformAction.NormalizeZScore]: INormalizeZScoreTransformActionPayload;
|
|
247
|
+
[ICellTransformAction.FormatDates]: IFormatDatesTransformActionPayload;
|
|
248
|
+
[ICellTransformAction.NormalizeUrls]: INormalizeUrlsTransformActionPayload;
|
|
249
|
+
[ICellTransformAction.ParseNumbers]: IParseNumberActionPayload;
|
|
250
|
+
[ICellTransformAction.CombineColumns]: ICombineColumnsTransformActionPayload;
|
|
251
|
+
[IInvalidCellTransformerAction.GenerateUUID]: IGenerateUUIDsTransformActionPayload;
|
|
252
|
+
[IInvalidCellTransformerAction.FuzzyFix]: IFuzzyMatchTransformActionPayload;
|
|
253
|
+
};
|
|
254
|
+
export type ColumnActionPayloadMap = {
|
|
255
|
+
[IColumnTransformAction.ClearCellRange]: IClearCellRangeTransformActionPayload;
|
|
256
|
+
[IColumnTransformAction.ForwardFill]: IForwardFillTransformActionPayload;
|
|
257
|
+
[IColumnTransformAction.BackwardFill]: IBackwardFillTransformActionPayload;
|
|
258
|
+
[IColumnTransformAction.ClampRange]: IClampRangeTransformActionPayload;
|
|
259
|
+
};
|
|
260
|
+
export type IFieldTransformerMapInternal = {
|
|
261
|
+
[A in keyof CellActionPayloadMap]: {
|
|
262
|
+
action: A;
|
|
263
|
+
payload: Omit<CellActionPayloadMap[A], 'columnNumber' | 'fieldSchemas'>;
|
|
264
|
+
};
|
|
265
|
+
}[keyof CellActionPayloadMap];
|
|
266
|
+
export declare const crossColumnsTransformers: Set<ICellTransformAction | IColumnTransformAction>;
|