@expresscsv/react 0.1.24 → 0.1.26
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 +4 -4
- package/dist/index.d.cts +169 -58
- package/dist/index.d.mts +169 -58
- package/dist/index.d.ts +169 -58
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -9,6 +9,39 @@ declare type BooleanControlType = 'toggle' | 'checkbox' | 'dropdown';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare type ColorModePref = 'light' | 'dark' | 'system';
|
|
11
11
|
|
|
12
|
+
export declare interface ColumnMatch<TTargetField extends string = string> {
|
|
13
|
+
sourceColumnIndex: number;
|
|
14
|
+
targetField: TTargetField;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare type ColumnMatchingFn<TTargetField extends string = string> = (data: ColumnMatchingParams) => Promise<ColumnMatchingResult<TTargetField>>;
|
|
18
|
+
|
|
19
|
+
export declare type ColumnMatchingOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = ManagedColumnMatchingOptions | CustomColumnMatchingOptions<TSchema>;
|
|
20
|
+
|
|
21
|
+
export declare interface ColumnMatchingParams {
|
|
22
|
+
sessionId: string;
|
|
23
|
+
sourceColumns: ColumnMatchingSourceColumn[];
|
|
24
|
+
targetFields: ColumnMatchingTargetField[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare interface ColumnMatchingResult<TTargetField extends string = string> {
|
|
28
|
+
matches: Array<ColumnMatch<TTargetField>>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare interface ColumnMatchingSourceColumn {
|
|
32
|
+
sourceColumnIndex: number;
|
|
33
|
+
name: string;
|
|
34
|
+
sampleValues: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare interface ColumnMatchingTargetField {
|
|
38
|
+
name: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
type: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
aliases: string[];
|
|
43
|
+
}
|
|
44
|
+
|
|
12
45
|
declare const Countries: readonly [{
|
|
13
46
|
readonly name: "Afghanistan";
|
|
14
47
|
readonly alpha2: "AF";
|
|
@@ -1878,11 +1911,21 @@ declare const CurrencyCodes: readonly [{
|
|
|
1878
1911
|
readonly numeric: "932";
|
|
1879
1912
|
}];
|
|
1880
1913
|
|
|
1881
|
-
|
|
1914
|
+
declare type CustomColumnMatchingOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = {
|
|
1882
1915
|
type: 'custom';
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1916
|
+
match: ColumnMatchingFn<SchemaFieldName<TSchema>>;
|
|
1917
|
+
};
|
|
1918
|
+
|
|
1919
|
+
declare type CustomPromptedEditsOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = {
|
|
1920
|
+
type: 'custom';
|
|
1921
|
+
edit: PromptedEditsFn<SchemaFieldName<TSchema>>;
|
|
1922
|
+
};
|
|
1923
|
+
|
|
1924
|
+
export declare type CustomSessionRecoveryOptions = {
|
|
1925
|
+
type: 'custom';
|
|
1926
|
+
get: (key: SessionRecoveryKey) => Promise<RecoveredSession | null>;
|
|
1927
|
+
set: (key: SessionRecoveryKey, value: RecoveredSession) => Promise<void>;
|
|
1928
|
+
remove: (key: SessionRecoveryKey) => Promise<void>;
|
|
1886
1929
|
};
|
|
1887
1930
|
|
|
1888
1931
|
declare interface DatetimeOptions {
|
|
@@ -1893,11 +1936,6 @@ export declare type DeepPartial<T> = {
|
|
|
1893
1936
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
1894
1937
|
};
|
|
1895
1938
|
|
|
1896
|
-
export declare interface DeliveryOptions<T> {
|
|
1897
|
-
/** Callback for processing delivered chunks */
|
|
1898
|
-
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
1939
|
/**
|
|
1902
1940
|
* Font source configuration for custom fonts
|
|
1903
1941
|
*/
|
|
@@ -2750,6 +2788,12 @@ declare interface ExpressCSVLocale {
|
|
|
2750
2788
|
nextDisabledMatchOptions: string;
|
|
2751
2789
|
nextDisabledReviewValidating: string;
|
|
2752
2790
|
nextDisabledReviewInvalid: string;
|
|
2791
|
+
nextDisabledReviewEmpty: string;
|
|
2792
|
+
finishBlockedMissingReviewOrSchema: string;
|
|
2793
|
+
finishBlockedCellsInvalidOrValidating: string;
|
|
2794
|
+
finishBlockedNoRecords: string;
|
|
2795
|
+
/** When Next is blocked but no specific reason was resolved (edge case). */
|
|
2796
|
+
nextBlockedFallback: string;
|
|
2753
2797
|
};
|
|
2754
2798
|
importer: {
|
|
2755
2799
|
title: string;
|
|
@@ -2819,6 +2863,8 @@ declare interface ExpressCSVLocale {
|
|
|
2819
2863
|
showAll: string;
|
|
2820
2864
|
moveUp: string;
|
|
2821
2865
|
moveDown: string;
|
|
2866
|
+
/** When the selected row has zero columns (cannot continue) */
|
|
2867
|
+
rowNotSelectable: string;
|
|
2822
2868
|
};
|
|
2823
2869
|
matchColumns: {
|
|
2824
2870
|
loading: string;
|
|
@@ -2853,6 +2899,8 @@ declare interface ExpressCSVLocale {
|
|
|
2853
2899
|
previewTooltip: string;
|
|
2854
2900
|
/** Available: {rowCount}, {columnName} */
|
|
2855
2901
|
previewShowing: TemplateString<'rowCount' | 'columnName'>;
|
|
2902
|
+
/** Available: {columnNumber} — 1-based index when the sheet header cell is empty */
|
|
2903
|
+
unnamedSourceColumn: TemplateString<'columnNumber'>;
|
|
2856
2904
|
};
|
|
2857
2905
|
matchOptions: {
|
|
2858
2906
|
loading: string;
|
|
@@ -2945,27 +2993,27 @@ declare interface ExpressCSVLocale {
|
|
|
2945
2993
|
filteredColumns: string;
|
|
2946
2994
|
unfilteredColumns: string;
|
|
2947
2995
|
columnsLabel: string;
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2996
|
+
promptedEditsTooltip: string;
|
|
2997
|
+
promptedEditsTitle: string;
|
|
2998
|
+
promptedEditsClose: string;
|
|
2999
|
+
promptedEditsCloseDiscardTooltip: string;
|
|
3000
|
+
promptedEditsCloseTooltip: string;
|
|
3001
|
+
promptedEditsError: string;
|
|
3002
|
+
promptedEditsPlaceholder: string;
|
|
3003
|
+
promptedEditsGenerating: string;
|
|
3004
|
+
promptedEditsApplying: string;
|
|
3005
|
+
promptedEditsDiscard: string;
|
|
3006
|
+
promptedEditsApply: string;
|
|
3007
|
+
promptedEditsUnappliedTitle: string;
|
|
3008
|
+
promptedEditsUnappliedDescription: string;
|
|
3009
|
+
promptedEditsKeepEditing: string;
|
|
3010
|
+
promptedEditsDiscardClose: string;
|
|
3011
|
+
promptedEditsAbortTitle: string;
|
|
3012
|
+
promptedEditsAbortDescription: string;
|
|
3013
|
+
promptedEditsAbortClose: string;
|
|
3014
|
+
promptedEditsSubmit: string;
|
|
2967
3015
|
};
|
|
2968
|
-
|
|
3016
|
+
emptyColumn: {
|
|
2969
3017
|
/** Available: {number} */
|
|
2970
3018
|
defaultName: TemplateString<'number'>;
|
|
2971
3019
|
remove: string;
|
|
@@ -3504,10 +3552,22 @@ export declare type Infer<T extends ExType<unknown, ExBaseDef, unknown>> = T ext
|
|
|
3504
3552
|
|
|
3505
3553
|
declare type IPAddressVersion = 'v4' | 'v6' | 'all';
|
|
3506
3554
|
|
|
3507
|
-
export declare type
|
|
3555
|
+
export declare type LocalSessionRecoveryOptions = {
|
|
3508
3556
|
type: 'local';
|
|
3509
3557
|
};
|
|
3510
3558
|
|
|
3559
|
+
declare type ManagedColumnMatchingOptions = {
|
|
3560
|
+
type: 'managed';
|
|
3561
|
+
exact?: boolean;
|
|
3562
|
+
caseInsensitive?: boolean;
|
|
3563
|
+
normalized?: boolean;
|
|
3564
|
+
inference?: boolean;
|
|
3565
|
+
};
|
|
3566
|
+
|
|
3567
|
+
declare type ManagedPromptedEditsOptions = {
|
|
3568
|
+
type: 'managed';
|
|
3569
|
+
};
|
|
3570
|
+
|
|
3511
3571
|
declare interface MultiselectOptions {
|
|
3512
3572
|
enforceCaseSensitiveMatch?: boolean;
|
|
3513
3573
|
message?: string;
|
|
@@ -3517,7 +3577,9 @@ declare interface MultiselectOptions {
|
|
|
3517
3577
|
* Options for the open() method
|
|
3518
3578
|
* Requires an onData callback for delivery
|
|
3519
3579
|
*/
|
|
3520
|
-
export declare type OpenOptions<T> =
|
|
3580
|
+
export declare type OpenOptions<T> = {
|
|
3581
|
+
/** Callback for processing delivered chunks */
|
|
3582
|
+
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3521
3583
|
/** Number of records per chunk (default: 1000) */
|
|
3522
3584
|
chunkSize?: number;
|
|
3523
3585
|
/** Called when all chunks have been processed */
|
|
@@ -3637,6 +3699,51 @@ declare abstract class PrimitiveExType<Output, Def extends PrimitiveExBaseDef, I
|
|
|
3637
3699
|
protected _replaceOrAddCheck(check: ValidatorCheck, existingIndex: number): void;
|
|
3638
3700
|
}
|
|
3639
3701
|
|
|
3702
|
+
export declare type PromptedEditsChange<TField extends string = string> = {
|
|
3703
|
+
type: 'add';
|
|
3704
|
+
values: Partial<Record<TField, unknown>>;
|
|
3705
|
+
} | {
|
|
3706
|
+
type: 'update';
|
|
3707
|
+
rowId: string;
|
|
3708
|
+
values: Partial<Record<TField, unknown>>;
|
|
3709
|
+
} | {
|
|
3710
|
+
type: 'remove';
|
|
3711
|
+
rowId: string;
|
|
3712
|
+
};
|
|
3713
|
+
|
|
3714
|
+
export declare interface PromptedEditsField<TField extends string = string> {
|
|
3715
|
+
key: TField;
|
|
3716
|
+
name: string;
|
|
3717
|
+
type: string;
|
|
3718
|
+
sampleValues: unknown[];
|
|
3719
|
+
}
|
|
3720
|
+
|
|
3721
|
+
export declare type PromptedEditsFn<TField extends string = string> = (data: PromptedEditsParams<TField>) => Promise<PromptedEditsResult<TField>>;
|
|
3722
|
+
|
|
3723
|
+
export declare type PromptedEditsOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = ManagedPromptedEditsOptions | CustomPromptedEditsOptions<TSchema>;
|
|
3724
|
+
|
|
3725
|
+
export declare interface PromptedEditsParams<TField extends string = string> {
|
|
3726
|
+
sessionId: string;
|
|
3727
|
+
prompt: string;
|
|
3728
|
+
fields: Array<PromptedEditsField<TField>>;
|
|
3729
|
+
rows: Array<PromptedEditsRow<TField>>;
|
|
3730
|
+
totalRows: number;
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
export declare type PromptedEditsResult<TField extends string = string> = {
|
|
3734
|
+
type: 'success';
|
|
3735
|
+
changes: Array<PromptedEditsChange<TField>>;
|
|
3736
|
+
} | {
|
|
3737
|
+
type: 'no-op';
|
|
3738
|
+
message: string;
|
|
3739
|
+
};
|
|
3740
|
+
|
|
3741
|
+
export declare interface PromptedEditsRow<TField extends string = string> {
|
|
3742
|
+
rowId: string;
|
|
3743
|
+
rowIndex: number;
|
|
3744
|
+
values: Partial<Record<TField, unknown>>;
|
|
3745
|
+
}
|
|
3746
|
+
|
|
3640
3747
|
declare type Protocol = 'http' | 'https' | 'ftp' | 'sftp' | 'file' | 'mailto' | 'tel';
|
|
3641
3748
|
|
|
3642
3749
|
/**
|
|
@@ -3657,6 +3764,10 @@ export declare interface RecordsChunk<T> {
|
|
|
3657
3764
|
chunkIdempotencyKey: string;
|
|
3658
3765
|
}
|
|
3659
3766
|
|
|
3767
|
+
export declare type RecoveredSession = PersistedImportSessionData;
|
|
3768
|
+
|
|
3769
|
+
export declare type RecoveredSessionData = PersistedImportSessionPayload;
|
|
3770
|
+
|
|
3660
3771
|
declare type RefineBatchResultItem = {
|
|
3661
3772
|
valid: boolean;
|
|
3662
3773
|
message?: string;
|
|
@@ -3686,6 +3797,29 @@ declare type RefineResultItem = {
|
|
|
3686
3797
|
};
|
|
3687
3798
|
};
|
|
3688
3799
|
|
|
3800
|
+
declare type SchemaFieldName<TSchema extends ExType<unknown, ExBaseDef, unknown>> = Extract<keyof Infer<TSchema>, string>;
|
|
3801
|
+
|
|
3802
|
+
export declare interface SDKOptions<TSchema extends ExType<unknown, ExBaseDef, unknown>> {
|
|
3803
|
+
schema: TSchema;
|
|
3804
|
+
getSessionToken: () => Promise<string>;
|
|
3805
|
+
importIdentifier: string;
|
|
3806
|
+
title?: string;
|
|
3807
|
+
debug?: boolean;
|
|
3808
|
+
preload?: boolean;
|
|
3809
|
+
theme?: ECSVTheme;
|
|
3810
|
+
colorMode?: ColorModePref;
|
|
3811
|
+
customCSS?: string;
|
|
3812
|
+
fonts?: Record<string, ECSVFontSource>;
|
|
3813
|
+
stepDisplay?: 'progressBar' | 'segmented' | 'numbered';
|
|
3814
|
+
previewSchemaBeforeUpload?: boolean;
|
|
3815
|
+
columnMatching?: ColumnMatchingOptions<TSchema>;
|
|
3816
|
+
promptedEdits?: PromptedEditsOptions<TSchema>;
|
|
3817
|
+
templateDownload?: TemplateDownloadOptions<TSchema>;
|
|
3818
|
+
sessionRecovery?: SessionRecoveryOptions;
|
|
3819
|
+
locale?: DeepPartial<ExpressCSVLocaleInput>;
|
|
3820
|
+
disableStatusStep?: boolean;
|
|
3821
|
+
}
|
|
3822
|
+
|
|
3689
3823
|
declare interface SelectOption<TValue extends string | number = string | number> {
|
|
3690
3824
|
label: string;
|
|
3691
3825
|
value: TValue;
|
|
@@ -3698,13 +3832,9 @@ declare interface SelectOptions {
|
|
|
3698
3832
|
message?: string;
|
|
3699
3833
|
}
|
|
3700
3834
|
|
|
3701
|
-
export declare type
|
|
3702
|
-
|
|
3703
|
-
export declare type StorageOptions = LocalStorageOptions | CustomStorageOptions;
|
|
3704
|
-
|
|
3705
|
-
export declare type StoredSession = PersistedImportSessionData;
|
|
3835
|
+
export declare type SessionRecoveryKey = PersistedImportSessionKey;
|
|
3706
3836
|
|
|
3707
|
-
export declare type
|
|
3837
|
+
export declare type SessionRecoveryOptions = LocalSessionRecoveryOptions | CustomSessionRecoveryOptions;
|
|
3708
3838
|
|
|
3709
3839
|
declare type StripBrand<T> = {
|
|
3710
3840
|
[K in keyof T]: T[K] extends TemplateString<string> ? string : T[K] extends object ? StripBrand<T[K]> : T[K];
|
|
@@ -3794,33 +3924,14 @@ declare interface URLOptions {
|
|
|
3794
3924
|
message?: string;
|
|
3795
3925
|
}
|
|
3796
3926
|
|
|
3797
|
-
export declare function useExpressCSV<TSchema extends ExType<unknown, ExBaseDef, unknown>>({ schema, title, importIdentifier, getSessionToken, debug, preload, theme, colorMode, customCSS, fonts, stepDisplay, previewSchemaBeforeUpload,
|
|
3927
|
+
export declare function useExpressCSV<TSchema extends ExType<unknown, ExBaseDef, unknown>>({ schema, title, importIdentifier, getSessionToken, debug, preload, theme, colorMode, customCSS, fonts, stepDisplay, previewSchemaBeforeUpload, columnMatching, promptedEdits, templateDownload, sessionRecovery, locale, disableStatusStep, }: UseExpressCSVOptions<TSchema>): {
|
|
3798
3928
|
open: (options: OpenOptions<Infer<TSchema>>) => void;
|
|
3799
3929
|
importerState: ImporterState;
|
|
3800
3930
|
isInitialising: boolean;
|
|
3801
3931
|
isOpen: boolean;
|
|
3802
3932
|
};
|
|
3803
3933
|
|
|
3804
|
-
export declare
|
|
3805
|
-
schema: TSchema;
|
|
3806
|
-
title?: string;
|
|
3807
|
-
importIdentifier: string;
|
|
3808
|
-
getSessionToken: () => Promise<string>;
|
|
3809
|
-
debug?: boolean;
|
|
3810
|
-
preload?: boolean;
|
|
3811
|
-
theme?: ECSVTheme;
|
|
3812
|
-
colorMode?: ColorModePref;
|
|
3813
|
-
customCSS?: string;
|
|
3814
|
-
fonts?: Record<string, ECSVFontSource>;
|
|
3815
|
-
stepDisplay?: 'progressBar' | 'segmented' | 'numbered';
|
|
3816
|
-
previewSchemaBeforeUpload?: boolean;
|
|
3817
|
-
aiColumnMatching?: boolean;
|
|
3818
|
-
aiTransform?: boolean;
|
|
3819
|
-
templateDownload?: TemplateDownloadOptions<TSchema>;
|
|
3820
|
-
storage?: StorageOptions;
|
|
3821
|
-
locale?: DeepPartial<ExpressCSVLocaleInput>;
|
|
3822
|
-
disableStatusStep?: boolean;
|
|
3823
|
-
}
|
|
3934
|
+
export declare type UseExpressCSVOptions<TSchema extends ExType<unknown, ExBaseDef, unknown>> = SDKOptions<TSchema>;
|
|
3824
3935
|
|
|
3825
3936
|
declare type UUIDVersion = 'v1' | 'v4' | 'v5' | 'all';
|
|
3826
3937
|
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,39 @@ declare type BooleanControlType = 'toggle' | 'checkbox' | 'dropdown';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare type ColorModePref = 'light' | 'dark' | 'system';
|
|
11
11
|
|
|
12
|
+
export declare interface ColumnMatch<TTargetField extends string = string> {
|
|
13
|
+
sourceColumnIndex: number;
|
|
14
|
+
targetField: TTargetField;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare type ColumnMatchingFn<TTargetField extends string = string> = (data: ColumnMatchingParams) => Promise<ColumnMatchingResult<TTargetField>>;
|
|
18
|
+
|
|
19
|
+
export declare type ColumnMatchingOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = ManagedColumnMatchingOptions | CustomColumnMatchingOptions<TSchema>;
|
|
20
|
+
|
|
21
|
+
export declare interface ColumnMatchingParams {
|
|
22
|
+
sessionId: string;
|
|
23
|
+
sourceColumns: ColumnMatchingSourceColumn[];
|
|
24
|
+
targetFields: ColumnMatchingTargetField[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare interface ColumnMatchingResult<TTargetField extends string = string> {
|
|
28
|
+
matches: Array<ColumnMatch<TTargetField>>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare interface ColumnMatchingSourceColumn {
|
|
32
|
+
sourceColumnIndex: number;
|
|
33
|
+
name: string;
|
|
34
|
+
sampleValues: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare interface ColumnMatchingTargetField {
|
|
38
|
+
name: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
type: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
aliases: string[];
|
|
43
|
+
}
|
|
44
|
+
|
|
12
45
|
declare const Countries: readonly [{
|
|
13
46
|
readonly name: "Afghanistan";
|
|
14
47
|
readonly alpha2: "AF";
|
|
@@ -1878,11 +1911,21 @@ declare const CurrencyCodes: readonly [{
|
|
|
1878
1911
|
readonly numeric: "932";
|
|
1879
1912
|
}];
|
|
1880
1913
|
|
|
1881
|
-
|
|
1914
|
+
declare type CustomColumnMatchingOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = {
|
|
1882
1915
|
type: 'custom';
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1916
|
+
match: ColumnMatchingFn<SchemaFieldName<TSchema>>;
|
|
1917
|
+
};
|
|
1918
|
+
|
|
1919
|
+
declare type CustomPromptedEditsOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = {
|
|
1920
|
+
type: 'custom';
|
|
1921
|
+
edit: PromptedEditsFn<SchemaFieldName<TSchema>>;
|
|
1922
|
+
};
|
|
1923
|
+
|
|
1924
|
+
export declare type CustomSessionRecoveryOptions = {
|
|
1925
|
+
type: 'custom';
|
|
1926
|
+
get: (key: SessionRecoveryKey) => Promise<RecoveredSession | null>;
|
|
1927
|
+
set: (key: SessionRecoveryKey, value: RecoveredSession) => Promise<void>;
|
|
1928
|
+
remove: (key: SessionRecoveryKey) => Promise<void>;
|
|
1886
1929
|
};
|
|
1887
1930
|
|
|
1888
1931
|
declare interface DatetimeOptions {
|
|
@@ -1893,11 +1936,6 @@ export declare type DeepPartial<T> = {
|
|
|
1893
1936
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
1894
1937
|
};
|
|
1895
1938
|
|
|
1896
|
-
export declare interface DeliveryOptions<T> {
|
|
1897
|
-
/** Callback for processing delivered chunks */
|
|
1898
|
-
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
1939
|
/**
|
|
1902
1940
|
* Font source configuration for custom fonts
|
|
1903
1941
|
*/
|
|
@@ -2750,6 +2788,12 @@ declare interface ExpressCSVLocale {
|
|
|
2750
2788
|
nextDisabledMatchOptions: string;
|
|
2751
2789
|
nextDisabledReviewValidating: string;
|
|
2752
2790
|
nextDisabledReviewInvalid: string;
|
|
2791
|
+
nextDisabledReviewEmpty: string;
|
|
2792
|
+
finishBlockedMissingReviewOrSchema: string;
|
|
2793
|
+
finishBlockedCellsInvalidOrValidating: string;
|
|
2794
|
+
finishBlockedNoRecords: string;
|
|
2795
|
+
/** When Next is blocked but no specific reason was resolved (edge case). */
|
|
2796
|
+
nextBlockedFallback: string;
|
|
2753
2797
|
};
|
|
2754
2798
|
importer: {
|
|
2755
2799
|
title: string;
|
|
@@ -2819,6 +2863,8 @@ declare interface ExpressCSVLocale {
|
|
|
2819
2863
|
showAll: string;
|
|
2820
2864
|
moveUp: string;
|
|
2821
2865
|
moveDown: string;
|
|
2866
|
+
/** When the selected row has zero columns (cannot continue) */
|
|
2867
|
+
rowNotSelectable: string;
|
|
2822
2868
|
};
|
|
2823
2869
|
matchColumns: {
|
|
2824
2870
|
loading: string;
|
|
@@ -2853,6 +2899,8 @@ declare interface ExpressCSVLocale {
|
|
|
2853
2899
|
previewTooltip: string;
|
|
2854
2900
|
/** Available: {rowCount}, {columnName} */
|
|
2855
2901
|
previewShowing: TemplateString<'rowCount' | 'columnName'>;
|
|
2902
|
+
/** Available: {columnNumber} — 1-based index when the sheet header cell is empty */
|
|
2903
|
+
unnamedSourceColumn: TemplateString<'columnNumber'>;
|
|
2856
2904
|
};
|
|
2857
2905
|
matchOptions: {
|
|
2858
2906
|
loading: string;
|
|
@@ -2945,27 +2993,27 @@ declare interface ExpressCSVLocale {
|
|
|
2945
2993
|
filteredColumns: string;
|
|
2946
2994
|
unfilteredColumns: string;
|
|
2947
2995
|
columnsLabel: string;
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2996
|
+
promptedEditsTooltip: string;
|
|
2997
|
+
promptedEditsTitle: string;
|
|
2998
|
+
promptedEditsClose: string;
|
|
2999
|
+
promptedEditsCloseDiscardTooltip: string;
|
|
3000
|
+
promptedEditsCloseTooltip: string;
|
|
3001
|
+
promptedEditsError: string;
|
|
3002
|
+
promptedEditsPlaceholder: string;
|
|
3003
|
+
promptedEditsGenerating: string;
|
|
3004
|
+
promptedEditsApplying: string;
|
|
3005
|
+
promptedEditsDiscard: string;
|
|
3006
|
+
promptedEditsApply: string;
|
|
3007
|
+
promptedEditsUnappliedTitle: string;
|
|
3008
|
+
promptedEditsUnappliedDescription: string;
|
|
3009
|
+
promptedEditsKeepEditing: string;
|
|
3010
|
+
promptedEditsDiscardClose: string;
|
|
3011
|
+
promptedEditsAbortTitle: string;
|
|
3012
|
+
promptedEditsAbortDescription: string;
|
|
3013
|
+
promptedEditsAbortClose: string;
|
|
3014
|
+
promptedEditsSubmit: string;
|
|
2967
3015
|
};
|
|
2968
|
-
|
|
3016
|
+
emptyColumn: {
|
|
2969
3017
|
/** Available: {number} */
|
|
2970
3018
|
defaultName: TemplateString<'number'>;
|
|
2971
3019
|
remove: string;
|
|
@@ -3504,10 +3552,22 @@ export declare type Infer<T extends ExType<unknown, ExBaseDef, unknown>> = T ext
|
|
|
3504
3552
|
|
|
3505
3553
|
declare type IPAddressVersion = 'v4' | 'v6' | 'all';
|
|
3506
3554
|
|
|
3507
|
-
export declare type
|
|
3555
|
+
export declare type LocalSessionRecoveryOptions = {
|
|
3508
3556
|
type: 'local';
|
|
3509
3557
|
};
|
|
3510
3558
|
|
|
3559
|
+
declare type ManagedColumnMatchingOptions = {
|
|
3560
|
+
type: 'managed';
|
|
3561
|
+
exact?: boolean;
|
|
3562
|
+
caseInsensitive?: boolean;
|
|
3563
|
+
normalized?: boolean;
|
|
3564
|
+
inference?: boolean;
|
|
3565
|
+
};
|
|
3566
|
+
|
|
3567
|
+
declare type ManagedPromptedEditsOptions = {
|
|
3568
|
+
type: 'managed';
|
|
3569
|
+
};
|
|
3570
|
+
|
|
3511
3571
|
declare interface MultiselectOptions {
|
|
3512
3572
|
enforceCaseSensitiveMatch?: boolean;
|
|
3513
3573
|
message?: string;
|
|
@@ -3517,7 +3577,9 @@ declare interface MultiselectOptions {
|
|
|
3517
3577
|
* Options for the open() method
|
|
3518
3578
|
* Requires an onData callback for delivery
|
|
3519
3579
|
*/
|
|
3520
|
-
export declare type OpenOptions<T> =
|
|
3580
|
+
export declare type OpenOptions<T> = {
|
|
3581
|
+
/** Callback for processing delivered chunks */
|
|
3582
|
+
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3521
3583
|
/** Number of records per chunk (default: 1000) */
|
|
3522
3584
|
chunkSize?: number;
|
|
3523
3585
|
/** Called when all chunks have been processed */
|
|
@@ -3637,6 +3699,51 @@ declare abstract class PrimitiveExType<Output, Def extends PrimitiveExBaseDef, I
|
|
|
3637
3699
|
protected _replaceOrAddCheck(check: ValidatorCheck, existingIndex: number): void;
|
|
3638
3700
|
}
|
|
3639
3701
|
|
|
3702
|
+
export declare type PromptedEditsChange<TField extends string = string> = {
|
|
3703
|
+
type: 'add';
|
|
3704
|
+
values: Partial<Record<TField, unknown>>;
|
|
3705
|
+
} | {
|
|
3706
|
+
type: 'update';
|
|
3707
|
+
rowId: string;
|
|
3708
|
+
values: Partial<Record<TField, unknown>>;
|
|
3709
|
+
} | {
|
|
3710
|
+
type: 'remove';
|
|
3711
|
+
rowId: string;
|
|
3712
|
+
};
|
|
3713
|
+
|
|
3714
|
+
export declare interface PromptedEditsField<TField extends string = string> {
|
|
3715
|
+
key: TField;
|
|
3716
|
+
name: string;
|
|
3717
|
+
type: string;
|
|
3718
|
+
sampleValues: unknown[];
|
|
3719
|
+
}
|
|
3720
|
+
|
|
3721
|
+
export declare type PromptedEditsFn<TField extends string = string> = (data: PromptedEditsParams<TField>) => Promise<PromptedEditsResult<TField>>;
|
|
3722
|
+
|
|
3723
|
+
export declare type PromptedEditsOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = ManagedPromptedEditsOptions | CustomPromptedEditsOptions<TSchema>;
|
|
3724
|
+
|
|
3725
|
+
export declare interface PromptedEditsParams<TField extends string = string> {
|
|
3726
|
+
sessionId: string;
|
|
3727
|
+
prompt: string;
|
|
3728
|
+
fields: Array<PromptedEditsField<TField>>;
|
|
3729
|
+
rows: Array<PromptedEditsRow<TField>>;
|
|
3730
|
+
totalRows: number;
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
export declare type PromptedEditsResult<TField extends string = string> = {
|
|
3734
|
+
type: 'success';
|
|
3735
|
+
changes: Array<PromptedEditsChange<TField>>;
|
|
3736
|
+
} | {
|
|
3737
|
+
type: 'no-op';
|
|
3738
|
+
message: string;
|
|
3739
|
+
};
|
|
3740
|
+
|
|
3741
|
+
export declare interface PromptedEditsRow<TField extends string = string> {
|
|
3742
|
+
rowId: string;
|
|
3743
|
+
rowIndex: number;
|
|
3744
|
+
values: Partial<Record<TField, unknown>>;
|
|
3745
|
+
}
|
|
3746
|
+
|
|
3640
3747
|
declare type Protocol = 'http' | 'https' | 'ftp' | 'sftp' | 'file' | 'mailto' | 'tel';
|
|
3641
3748
|
|
|
3642
3749
|
/**
|
|
@@ -3657,6 +3764,10 @@ export declare interface RecordsChunk<T> {
|
|
|
3657
3764
|
chunkIdempotencyKey: string;
|
|
3658
3765
|
}
|
|
3659
3766
|
|
|
3767
|
+
export declare type RecoveredSession = PersistedImportSessionData;
|
|
3768
|
+
|
|
3769
|
+
export declare type RecoveredSessionData = PersistedImportSessionPayload;
|
|
3770
|
+
|
|
3660
3771
|
declare type RefineBatchResultItem = {
|
|
3661
3772
|
valid: boolean;
|
|
3662
3773
|
message?: string;
|
|
@@ -3686,6 +3797,29 @@ declare type RefineResultItem = {
|
|
|
3686
3797
|
};
|
|
3687
3798
|
};
|
|
3688
3799
|
|
|
3800
|
+
declare type SchemaFieldName<TSchema extends ExType<unknown, ExBaseDef, unknown>> = Extract<keyof Infer<TSchema>, string>;
|
|
3801
|
+
|
|
3802
|
+
export declare interface SDKOptions<TSchema extends ExType<unknown, ExBaseDef, unknown>> {
|
|
3803
|
+
schema: TSchema;
|
|
3804
|
+
getSessionToken: () => Promise<string>;
|
|
3805
|
+
importIdentifier: string;
|
|
3806
|
+
title?: string;
|
|
3807
|
+
debug?: boolean;
|
|
3808
|
+
preload?: boolean;
|
|
3809
|
+
theme?: ECSVTheme;
|
|
3810
|
+
colorMode?: ColorModePref;
|
|
3811
|
+
customCSS?: string;
|
|
3812
|
+
fonts?: Record<string, ECSVFontSource>;
|
|
3813
|
+
stepDisplay?: 'progressBar' | 'segmented' | 'numbered';
|
|
3814
|
+
previewSchemaBeforeUpload?: boolean;
|
|
3815
|
+
columnMatching?: ColumnMatchingOptions<TSchema>;
|
|
3816
|
+
promptedEdits?: PromptedEditsOptions<TSchema>;
|
|
3817
|
+
templateDownload?: TemplateDownloadOptions<TSchema>;
|
|
3818
|
+
sessionRecovery?: SessionRecoveryOptions;
|
|
3819
|
+
locale?: DeepPartial<ExpressCSVLocaleInput>;
|
|
3820
|
+
disableStatusStep?: boolean;
|
|
3821
|
+
}
|
|
3822
|
+
|
|
3689
3823
|
declare interface SelectOption<TValue extends string | number = string | number> {
|
|
3690
3824
|
label: string;
|
|
3691
3825
|
value: TValue;
|
|
@@ -3698,13 +3832,9 @@ declare interface SelectOptions {
|
|
|
3698
3832
|
message?: string;
|
|
3699
3833
|
}
|
|
3700
3834
|
|
|
3701
|
-
export declare type
|
|
3702
|
-
|
|
3703
|
-
export declare type StorageOptions = LocalStorageOptions | CustomStorageOptions;
|
|
3704
|
-
|
|
3705
|
-
export declare type StoredSession = PersistedImportSessionData;
|
|
3835
|
+
export declare type SessionRecoveryKey = PersistedImportSessionKey;
|
|
3706
3836
|
|
|
3707
|
-
export declare type
|
|
3837
|
+
export declare type SessionRecoveryOptions = LocalSessionRecoveryOptions | CustomSessionRecoveryOptions;
|
|
3708
3838
|
|
|
3709
3839
|
declare type StripBrand<T> = {
|
|
3710
3840
|
[K in keyof T]: T[K] extends TemplateString<string> ? string : T[K] extends object ? StripBrand<T[K]> : T[K];
|
|
@@ -3794,33 +3924,14 @@ declare interface URLOptions {
|
|
|
3794
3924
|
message?: string;
|
|
3795
3925
|
}
|
|
3796
3926
|
|
|
3797
|
-
export declare function useExpressCSV<TSchema extends ExType<unknown, ExBaseDef, unknown>>({ schema, title, importIdentifier, getSessionToken, debug, preload, theme, colorMode, customCSS, fonts, stepDisplay, previewSchemaBeforeUpload,
|
|
3927
|
+
export declare function useExpressCSV<TSchema extends ExType<unknown, ExBaseDef, unknown>>({ schema, title, importIdentifier, getSessionToken, debug, preload, theme, colorMode, customCSS, fonts, stepDisplay, previewSchemaBeforeUpload, columnMatching, promptedEdits, templateDownload, sessionRecovery, locale, disableStatusStep, }: UseExpressCSVOptions<TSchema>): {
|
|
3798
3928
|
open: (options: OpenOptions<Infer<TSchema>>) => void;
|
|
3799
3929
|
importerState: ImporterState;
|
|
3800
3930
|
isInitialising: boolean;
|
|
3801
3931
|
isOpen: boolean;
|
|
3802
3932
|
};
|
|
3803
3933
|
|
|
3804
|
-
export declare
|
|
3805
|
-
schema: TSchema;
|
|
3806
|
-
title?: string;
|
|
3807
|
-
importIdentifier: string;
|
|
3808
|
-
getSessionToken: () => Promise<string>;
|
|
3809
|
-
debug?: boolean;
|
|
3810
|
-
preload?: boolean;
|
|
3811
|
-
theme?: ECSVTheme;
|
|
3812
|
-
colorMode?: ColorModePref;
|
|
3813
|
-
customCSS?: string;
|
|
3814
|
-
fonts?: Record<string, ECSVFontSource>;
|
|
3815
|
-
stepDisplay?: 'progressBar' | 'segmented' | 'numbered';
|
|
3816
|
-
previewSchemaBeforeUpload?: boolean;
|
|
3817
|
-
aiColumnMatching?: boolean;
|
|
3818
|
-
aiTransform?: boolean;
|
|
3819
|
-
templateDownload?: TemplateDownloadOptions<TSchema>;
|
|
3820
|
-
storage?: StorageOptions;
|
|
3821
|
-
locale?: DeepPartial<ExpressCSVLocaleInput>;
|
|
3822
|
-
disableStatusStep?: boolean;
|
|
3823
|
-
}
|
|
3934
|
+
export declare type UseExpressCSVOptions<TSchema extends ExType<unknown, ExBaseDef, unknown>> = SDKOptions<TSchema>;
|
|
3824
3935
|
|
|
3825
3936
|
declare type UUIDVersion = 'v1' | 'v4' | 'v5' | 'all';
|
|
3826
3937
|
|