@expresscsv/sdk 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 +151 -41
- package/dist/index.d.mts +151 -41
- package/dist/index.d.ts +151 -41
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -561,10 +561,10 @@ new CSVImporter(options: SDKOptions)
|
|
|
561
561
|
| `fonts` | `Record<string, ECSVFontSource>` | No | - | Custom font sources |
|
|
562
562
|
| `stepDisplay` | `'progressBar' \| 'segmented' \| 'numbered'` | No | `'progressBar'` | Step indicator style |
|
|
563
563
|
| `previewSchemaBeforeUpload` | `boolean` | No | `true` | Show schema preview before upload |
|
|
564
|
-
| `
|
|
565
|
-
| `
|
|
564
|
+
| `columnMatching` | `{ type: "managed"; exact?: boolean; caseInsensitive?: boolean; normalized?: boolean; inference?: boolean } \| { type: "custom"; match: (...) => Promise<...> }` | No | `undefined` | Configure managed column matching or provide a custom matcher |
|
|
565
|
+
| `promptedEdits` | `{ type: "managed" } \| { type: "custom"; edit: (...) => Promise<...> }` | No | `undefined` | Enable managed prompted edits or provide a custom edit handler |
|
|
566
566
|
| `templateDownload` | `TemplateDownloadOptions<TSchema>` | No | - | Template download configuration with optional schema-typed example rows |
|
|
567
|
-
| `
|
|
567
|
+
| `sessionRecovery` | `SessionRecoveryOptions` | No | - | Enable Recovered Sessions with the built-in local backend or a custom adapter implementing `get`, `set`, and `remove` |
|
|
568
568
|
| `locale` | `DeepPartial<ExpressCSVLocaleInput>` | No | - | Localization overrides |
|
|
569
569
|
| `disableStatusStep` | `boolean` | No | - | Skip the success/error status screen |
|
|
570
570
|
|
|
@@ -578,7 +578,7 @@ importer.open(options: OpenOptions): void
|
|
|
578
578
|
|
|
579
579
|
| Option | Type | Required | Description |
|
|
580
580
|
|---|---|---|---|
|
|
581
|
-
| `onData` | `(chunk: RecordsChunk<T>, next: () => void) => void` | Yes | Callback for each delivered chunk of records. Call `next()`
|
|
581
|
+
| `onData` | `(chunk: RecordsChunk<T>, next: () => void) => void` | Yes | Callback for each delivered chunk of records. Call `next()` after your backend accepts the current chunk. |
|
|
582
582
|
| `chunkSize` | `number` | No | Records per chunk (default: 1000) |
|
|
583
583
|
| `onComplete` | `(context: { sessionId: string }) => void` | No | Called when all chunks have been processed |
|
|
584
584
|
| `onCancel` | `(context: { sessionId: string }) => void` | No | Called when the user cancels the import |
|
package/dist/index.d.cts
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";
|
|
@@ -1266,6 +1299,7 @@ export declare class CSVImporter<TSchema extends ExType<unknown, ExBaseDef, unkn
|
|
|
1266
1299
|
private importerStartupGeneration;
|
|
1267
1300
|
constructor(options: SDKOptions<TSchema>);
|
|
1268
1301
|
private getCustomStorageRpcHandler;
|
|
1302
|
+
private getCustomFeatureRpcHandler;
|
|
1269
1303
|
/**
|
|
1270
1304
|
* Enhanced state management
|
|
1271
1305
|
*/
|
|
@@ -2003,11 +2037,21 @@ declare const CurrencyCodes: readonly [{
|
|
|
2003
2037
|
readonly numeric: "932";
|
|
2004
2038
|
}];
|
|
2005
2039
|
|
|
2006
|
-
export declare type
|
|
2040
|
+
export declare type CustomColumnMatchingOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = {
|
|
2041
|
+
type: 'custom';
|
|
2042
|
+
match: ColumnMatchingFn<SchemaFieldName<TSchema>>;
|
|
2043
|
+
};
|
|
2044
|
+
|
|
2045
|
+
export declare type CustomPromptedEditsOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = {
|
|
2007
2046
|
type: 'custom';
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2047
|
+
edit: PromptedEditsFn<SchemaFieldName<TSchema>>;
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
export declare type CustomSessionRecoveryOptions = {
|
|
2051
|
+
type: 'custom';
|
|
2052
|
+
get: (key: SessionRecoveryKey) => Promise<RecoveredSession | null>;
|
|
2053
|
+
set: (key: SessionRecoveryKey, value: RecoveredSession) => Promise<void>;
|
|
2054
|
+
remove: (key: SessionRecoveryKey) => Promise<void>;
|
|
2011
2055
|
};
|
|
2012
2056
|
|
|
2013
2057
|
declare interface DatetimeOptions {
|
|
@@ -2018,11 +2062,6 @@ export declare type DeepPartial<T> = {
|
|
|
2018
2062
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
2019
2063
|
};
|
|
2020
2064
|
|
|
2021
|
-
export declare interface DeliveryOptions<T> {
|
|
2022
|
-
/** Callback for processing delivered chunks */
|
|
2023
|
-
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
2065
|
/**
|
|
2027
2066
|
* Font source configuration for custom fonts
|
|
2028
2067
|
*/
|
|
@@ -2875,6 +2914,12 @@ declare interface ExpressCSVLocale {
|
|
|
2875
2914
|
nextDisabledMatchOptions: string;
|
|
2876
2915
|
nextDisabledReviewValidating: string;
|
|
2877
2916
|
nextDisabledReviewInvalid: string;
|
|
2917
|
+
nextDisabledReviewEmpty: string;
|
|
2918
|
+
finishBlockedMissingReviewOrSchema: string;
|
|
2919
|
+
finishBlockedCellsInvalidOrValidating: string;
|
|
2920
|
+
finishBlockedNoRecords: string;
|
|
2921
|
+
/** When Next is blocked but no specific reason was resolved (edge case). */
|
|
2922
|
+
nextBlockedFallback: string;
|
|
2878
2923
|
};
|
|
2879
2924
|
importer: {
|
|
2880
2925
|
title: string;
|
|
@@ -2944,6 +2989,8 @@ declare interface ExpressCSVLocale {
|
|
|
2944
2989
|
showAll: string;
|
|
2945
2990
|
moveUp: string;
|
|
2946
2991
|
moveDown: string;
|
|
2992
|
+
/** When the selected row has zero columns (cannot continue) */
|
|
2993
|
+
rowNotSelectable: string;
|
|
2947
2994
|
};
|
|
2948
2995
|
matchColumns: {
|
|
2949
2996
|
loading: string;
|
|
@@ -2978,6 +3025,8 @@ declare interface ExpressCSVLocale {
|
|
|
2978
3025
|
previewTooltip: string;
|
|
2979
3026
|
/** Available: {rowCount}, {columnName} */
|
|
2980
3027
|
previewShowing: TemplateString<'rowCount' | 'columnName'>;
|
|
3028
|
+
/** Available: {columnNumber} — 1-based index when the sheet header cell is empty */
|
|
3029
|
+
unnamedSourceColumn: TemplateString<'columnNumber'>;
|
|
2981
3030
|
};
|
|
2982
3031
|
matchOptions: {
|
|
2983
3032
|
loading: string;
|
|
@@ -3070,27 +3119,27 @@ declare interface ExpressCSVLocale {
|
|
|
3070
3119
|
filteredColumns: string;
|
|
3071
3120
|
unfilteredColumns: string;
|
|
3072
3121
|
columnsLabel: string;
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3122
|
+
promptedEditsTooltip: string;
|
|
3123
|
+
promptedEditsTitle: string;
|
|
3124
|
+
promptedEditsClose: string;
|
|
3125
|
+
promptedEditsCloseDiscardTooltip: string;
|
|
3126
|
+
promptedEditsCloseTooltip: string;
|
|
3127
|
+
promptedEditsError: string;
|
|
3128
|
+
promptedEditsPlaceholder: string;
|
|
3129
|
+
promptedEditsGenerating: string;
|
|
3130
|
+
promptedEditsApplying: string;
|
|
3131
|
+
promptedEditsDiscard: string;
|
|
3132
|
+
promptedEditsApply: string;
|
|
3133
|
+
promptedEditsUnappliedTitle: string;
|
|
3134
|
+
promptedEditsUnappliedDescription: string;
|
|
3135
|
+
promptedEditsKeepEditing: string;
|
|
3136
|
+
promptedEditsDiscardClose: string;
|
|
3137
|
+
promptedEditsAbortTitle: string;
|
|
3138
|
+
promptedEditsAbortDescription: string;
|
|
3139
|
+
promptedEditsAbortClose: string;
|
|
3140
|
+
promptedEditsSubmit: string;
|
|
3092
3141
|
};
|
|
3093
|
-
|
|
3142
|
+
emptyColumn: {
|
|
3094
3143
|
/** Available: {number} */
|
|
3095
3144
|
defaultName: TemplateString<'number'>;
|
|
3096
3145
|
remove: string;
|
|
@@ -3631,10 +3680,22 @@ export declare type InferCSVImporter<TSchema extends ExType<unknown, ExBaseDef,
|
|
|
3631
3680
|
|
|
3632
3681
|
declare type IPAddressVersion = 'v4' | 'v6' | 'all';
|
|
3633
3682
|
|
|
3634
|
-
export declare type
|
|
3683
|
+
export declare type LocalSessionRecoveryOptions = {
|
|
3635
3684
|
type: 'local';
|
|
3636
3685
|
};
|
|
3637
3686
|
|
|
3687
|
+
export declare type ManagedColumnMatchingOptions = {
|
|
3688
|
+
type: 'managed';
|
|
3689
|
+
exact?: boolean;
|
|
3690
|
+
caseInsensitive?: boolean;
|
|
3691
|
+
normalized?: boolean;
|
|
3692
|
+
inference?: boolean;
|
|
3693
|
+
};
|
|
3694
|
+
|
|
3695
|
+
export declare type ManagedPromptedEditsOptions = {
|
|
3696
|
+
type: 'managed';
|
|
3697
|
+
};
|
|
3698
|
+
|
|
3638
3699
|
declare interface MultiselectOptions {
|
|
3639
3700
|
enforceCaseSensitiveMatch?: boolean;
|
|
3640
3701
|
message?: string;
|
|
@@ -3644,7 +3705,9 @@ declare interface MultiselectOptions {
|
|
|
3644
3705
|
* Options for the open() method
|
|
3645
3706
|
* Requires an onData callback for delivery
|
|
3646
3707
|
*/
|
|
3647
|
-
export declare type OpenOptions<T> =
|
|
3708
|
+
export declare type OpenOptions<T> = {
|
|
3709
|
+
/** Callback for processing delivered chunks */
|
|
3710
|
+
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3648
3711
|
/** Number of records per chunk (default: 1000) */
|
|
3649
3712
|
chunkSize?: number;
|
|
3650
3713
|
/** Called when all chunks have been processed */
|
|
@@ -3764,6 +3827,51 @@ declare abstract class PrimitiveExType<Output, Def extends PrimitiveExBaseDef, I
|
|
|
3764
3827
|
protected _replaceOrAddCheck(check: ValidatorCheck, existingIndex: number): void;
|
|
3765
3828
|
}
|
|
3766
3829
|
|
|
3830
|
+
export declare type PromptedEditsChange<TField extends string = string> = {
|
|
3831
|
+
type: 'add';
|
|
3832
|
+
values: Partial<Record<TField, unknown>>;
|
|
3833
|
+
} | {
|
|
3834
|
+
type: 'update';
|
|
3835
|
+
rowId: string;
|
|
3836
|
+
values: Partial<Record<TField, unknown>>;
|
|
3837
|
+
} | {
|
|
3838
|
+
type: 'remove';
|
|
3839
|
+
rowId: string;
|
|
3840
|
+
};
|
|
3841
|
+
|
|
3842
|
+
export declare interface PromptedEditsField<TField extends string = string> {
|
|
3843
|
+
key: TField;
|
|
3844
|
+
name: string;
|
|
3845
|
+
type: string;
|
|
3846
|
+
sampleValues: unknown[];
|
|
3847
|
+
}
|
|
3848
|
+
|
|
3849
|
+
export declare type PromptedEditsFn<TField extends string = string> = (data: PromptedEditsParams<TField>) => Promise<PromptedEditsResult<TField>>;
|
|
3850
|
+
|
|
3851
|
+
export declare type PromptedEditsOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = ManagedPromptedEditsOptions | CustomPromptedEditsOptions<TSchema>;
|
|
3852
|
+
|
|
3853
|
+
export declare interface PromptedEditsParams<TField extends string = string> {
|
|
3854
|
+
sessionId: string;
|
|
3855
|
+
prompt: string;
|
|
3856
|
+
fields: Array<PromptedEditsField<TField>>;
|
|
3857
|
+
rows: Array<PromptedEditsRow<TField>>;
|
|
3858
|
+
totalRows: number;
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
export declare type PromptedEditsResult<TField extends string = string> = {
|
|
3862
|
+
type: 'success';
|
|
3863
|
+
changes: Array<PromptedEditsChange<TField>>;
|
|
3864
|
+
} | {
|
|
3865
|
+
type: 'no-op';
|
|
3866
|
+
message: string;
|
|
3867
|
+
};
|
|
3868
|
+
|
|
3869
|
+
export declare interface PromptedEditsRow<TField extends string = string> {
|
|
3870
|
+
rowId: string;
|
|
3871
|
+
rowIndex: number;
|
|
3872
|
+
values: Partial<Record<TField, unknown>>;
|
|
3873
|
+
}
|
|
3874
|
+
|
|
3767
3875
|
declare type Protocol = 'http' | 'https' | 'ftp' | 'sftp' | 'file' | 'mailto' | 'tel';
|
|
3768
3876
|
|
|
3769
3877
|
/**
|
|
@@ -3784,6 +3892,10 @@ export declare interface RecordsChunk<T> {
|
|
|
3784
3892
|
chunkIdempotencyKey: string;
|
|
3785
3893
|
}
|
|
3786
3894
|
|
|
3895
|
+
export declare type RecoveredSession = PersistedImportSessionData;
|
|
3896
|
+
|
|
3897
|
+
export declare type RecoveredSessionData = PersistedImportSessionPayload;
|
|
3898
|
+
|
|
3787
3899
|
declare type RefineBatchResultItem = {
|
|
3788
3900
|
valid: boolean;
|
|
3789
3901
|
message?: string;
|
|
@@ -3813,6 +3925,8 @@ declare type RefineResultItem = {
|
|
|
3813
3925
|
};
|
|
3814
3926
|
};
|
|
3815
3927
|
|
|
3928
|
+
declare type SchemaFieldName<TSchema extends ExType<unknown, ExBaseDef, unknown>> = Extract<keyof Infer<TSchema>, string>;
|
|
3929
|
+
|
|
3816
3930
|
export declare interface SDKOptions<TSchema extends ExType<unknown, ExBaseDef, unknown>> {
|
|
3817
3931
|
schema: TSchema;
|
|
3818
3932
|
getSessionToken: () => Promise<string>;
|
|
@@ -3826,10 +3940,10 @@ export declare interface SDKOptions<TSchema extends ExType<unknown, ExBaseDef, u
|
|
|
3826
3940
|
fonts?: Record<string, ECSVFontSource>;
|
|
3827
3941
|
stepDisplay?: 'progressBar' | 'segmented' | 'numbered';
|
|
3828
3942
|
previewSchemaBeforeUpload?: boolean;
|
|
3829
|
-
|
|
3830
|
-
|
|
3943
|
+
columnMatching?: ColumnMatchingOptions<TSchema>;
|
|
3944
|
+
promptedEdits?: PromptedEditsOptions<TSchema>;
|
|
3831
3945
|
templateDownload?: TemplateDownloadOptions<TSchema>;
|
|
3832
|
-
|
|
3946
|
+
sessionRecovery?: SessionRecoveryOptions;
|
|
3833
3947
|
locale?: DeepPartial<ExpressCSVLocaleInput>;
|
|
3834
3948
|
disableStatusStep?: boolean;
|
|
3835
3949
|
}
|
|
@@ -3846,15 +3960,11 @@ declare interface SelectOptions {
|
|
|
3846
3960
|
message?: string;
|
|
3847
3961
|
}
|
|
3848
3962
|
|
|
3849
|
-
declare type
|
|
3963
|
+
export declare type SessionRecoveryKey = PersistedImportSessionKey;
|
|
3850
3964
|
|
|
3851
|
-
export declare type
|
|
3965
|
+
export declare type SessionRecoveryOptions = LocalSessionRecoveryOptions | CustomSessionRecoveryOptions;
|
|
3852
3966
|
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
export declare type StoredSession = PersistedImportSessionData;
|
|
3856
|
-
|
|
3857
|
-
export declare type StoredSessionData = PersistedImportSessionPayload;
|
|
3967
|
+
declare type StateChangeListener = (state: ImporterState) => void;
|
|
3858
3968
|
|
|
3859
3969
|
declare type StripBrand<T> = {
|
|
3860
3970
|
[K in keyof T]: T[K] extends TemplateString<string> ? string : T[K] extends object ? StripBrand<T[K]> : T[K];
|
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";
|
|
@@ -1266,6 +1299,7 @@ export declare class CSVImporter<TSchema extends ExType<unknown, ExBaseDef, unkn
|
|
|
1266
1299
|
private importerStartupGeneration;
|
|
1267
1300
|
constructor(options: SDKOptions<TSchema>);
|
|
1268
1301
|
private getCustomStorageRpcHandler;
|
|
1302
|
+
private getCustomFeatureRpcHandler;
|
|
1269
1303
|
/**
|
|
1270
1304
|
* Enhanced state management
|
|
1271
1305
|
*/
|
|
@@ -2003,11 +2037,21 @@ declare const CurrencyCodes: readonly [{
|
|
|
2003
2037
|
readonly numeric: "932";
|
|
2004
2038
|
}];
|
|
2005
2039
|
|
|
2006
|
-
export declare type
|
|
2040
|
+
export declare type CustomColumnMatchingOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = {
|
|
2041
|
+
type: 'custom';
|
|
2042
|
+
match: ColumnMatchingFn<SchemaFieldName<TSchema>>;
|
|
2043
|
+
};
|
|
2044
|
+
|
|
2045
|
+
export declare type CustomPromptedEditsOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = {
|
|
2007
2046
|
type: 'custom';
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2047
|
+
edit: PromptedEditsFn<SchemaFieldName<TSchema>>;
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
export declare type CustomSessionRecoveryOptions = {
|
|
2051
|
+
type: 'custom';
|
|
2052
|
+
get: (key: SessionRecoveryKey) => Promise<RecoveredSession | null>;
|
|
2053
|
+
set: (key: SessionRecoveryKey, value: RecoveredSession) => Promise<void>;
|
|
2054
|
+
remove: (key: SessionRecoveryKey) => Promise<void>;
|
|
2011
2055
|
};
|
|
2012
2056
|
|
|
2013
2057
|
declare interface DatetimeOptions {
|
|
@@ -2018,11 +2062,6 @@ export declare type DeepPartial<T> = {
|
|
|
2018
2062
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
2019
2063
|
};
|
|
2020
2064
|
|
|
2021
|
-
export declare interface DeliveryOptions<T> {
|
|
2022
|
-
/** Callback for processing delivered chunks */
|
|
2023
|
-
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
2065
|
/**
|
|
2027
2066
|
* Font source configuration for custom fonts
|
|
2028
2067
|
*/
|
|
@@ -2875,6 +2914,12 @@ declare interface ExpressCSVLocale {
|
|
|
2875
2914
|
nextDisabledMatchOptions: string;
|
|
2876
2915
|
nextDisabledReviewValidating: string;
|
|
2877
2916
|
nextDisabledReviewInvalid: string;
|
|
2917
|
+
nextDisabledReviewEmpty: string;
|
|
2918
|
+
finishBlockedMissingReviewOrSchema: string;
|
|
2919
|
+
finishBlockedCellsInvalidOrValidating: string;
|
|
2920
|
+
finishBlockedNoRecords: string;
|
|
2921
|
+
/** When Next is blocked but no specific reason was resolved (edge case). */
|
|
2922
|
+
nextBlockedFallback: string;
|
|
2878
2923
|
};
|
|
2879
2924
|
importer: {
|
|
2880
2925
|
title: string;
|
|
@@ -2944,6 +2989,8 @@ declare interface ExpressCSVLocale {
|
|
|
2944
2989
|
showAll: string;
|
|
2945
2990
|
moveUp: string;
|
|
2946
2991
|
moveDown: string;
|
|
2992
|
+
/** When the selected row has zero columns (cannot continue) */
|
|
2993
|
+
rowNotSelectable: string;
|
|
2947
2994
|
};
|
|
2948
2995
|
matchColumns: {
|
|
2949
2996
|
loading: string;
|
|
@@ -2978,6 +3025,8 @@ declare interface ExpressCSVLocale {
|
|
|
2978
3025
|
previewTooltip: string;
|
|
2979
3026
|
/** Available: {rowCount}, {columnName} */
|
|
2980
3027
|
previewShowing: TemplateString<'rowCount' | 'columnName'>;
|
|
3028
|
+
/** Available: {columnNumber} — 1-based index when the sheet header cell is empty */
|
|
3029
|
+
unnamedSourceColumn: TemplateString<'columnNumber'>;
|
|
2981
3030
|
};
|
|
2982
3031
|
matchOptions: {
|
|
2983
3032
|
loading: string;
|
|
@@ -3070,27 +3119,27 @@ declare interface ExpressCSVLocale {
|
|
|
3070
3119
|
filteredColumns: string;
|
|
3071
3120
|
unfilteredColumns: string;
|
|
3072
3121
|
columnsLabel: string;
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3122
|
+
promptedEditsTooltip: string;
|
|
3123
|
+
promptedEditsTitle: string;
|
|
3124
|
+
promptedEditsClose: string;
|
|
3125
|
+
promptedEditsCloseDiscardTooltip: string;
|
|
3126
|
+
promptedEditsCloseTooltip: string;
|
|
3127
|
+
promptedEditsError: string;
|
|
3128
|
+
promptedEditsPlaceholder: string;
|
|
3129
|
+
promptedEditsGenerating: string;
|
|
3130
|
+
promptedEditsApplying: string;
|
|
3131
|
+
promptedEditsDiscard: string;
|
|
3132
|
+
promptedEditsApply: string;
|
|
3133
|
+
promptedEditsUnappliedTitle: string;
|
|
3134
|
+
promptedEditsUnappliedDescription: string;
|
|
3135
|
+
promptedEditsKeepEditing: string;
|
|
3136
|
+
promptedEditsDiscardClose: string;
|
|
3137
|
+
promptedEditsAbortTitle: string;
|
|
3138
|
+
promptedEditsAbortDescription: string;
|
|
3139
|
+
promptedEditsAbortClose: string;
|
|
3140
|
+
promptedEditsSubmit: string;
|
|
3092
3141
|
};
|
|
3093
|
-
|
|
3142
|
+
emptyColumn: {
|
|
3094
3143
|
/** Available: {number} */
|
|
3095
3144
|
defaultName: TemplateString<'number'>;
|
|
3096
3145
|
remove: string;
|
|
@@ -3631,10 +3680,22 @@ export declare type InferCSVImporter<TSchema extends ExType<unknown, ExBaseDef,
|
|
|
3631
3680
|
|
|
3632
3681
|
declare type IPAddressVersion = 'v4' | 'v6' | 'all';
|
|
3633
3682
|
|
|
3634
|
-
export declare type
|
|
3683
|
+
export declare type LocalSessionRecoveryOptions = {
|
|
3635
3684
|
type: 'local';
|
|
3636
3685
|
};
|
|
3637
3686
|
|
|
3687
|
+
export declare type ManagedColumnMatchingOptions = {
|
|
3688
|
+
type: 'managed';
|
|
3689
|
+
exact?: boolean;
|
|
3690
|
+
caseInsensitive?: boolean;
|
|
3691
|
+
normalized?: boolean;
|
|
3692
|
+
inference?: boolean;
|
|
3693
|
+
};
|
|
3694
|
+
|
|
3695
|
+
export declare type ManagedPromptedEditsOptions = {
|
|
3696
|
+
type: 'managed';
|
|
3697
|
+
};
|
|
3698
|
+
|
|
3638
3699
|
declare interface MultiselectOptions {
|
|
3639
3700
|
enforceCaseSensitiveMatch?: boolean;
|
|
3640
3701
|
message?: string;
|
|
@@ -3644,7 +3705,9 @@ declare interface MultiselectOptions {
|
|
|
3644
3705
|
* Options for the open() method
|
|
3645
3706
|
* Requires an onData callback for delivery
|
|
3646
3707
|
*/
|
|
3647
|
-
export declare type OpenOptions<T> =
|
|
3708
|
+
export declare type OpenOptions<T> = {
|
|
3709
|
+
/** Callback for processing delivered chunks */
|
|
3710
|
+
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3648
3711
|
/** Number of records per chunk (default: 1000) */
|
|
3649
3712
|
chunkSize?: number;
|
|
3650
3713
|
/** Called when all chunks have been processed */
|
|
@@ -3764,6 +3827,51 @@ declare abstract class PrimitiveExType<Output, Def extends PrimitiveExBaseDef, I
|
|
|
3764
3827
|
protected _replaceOrAddCheck(check: ValidatorCheck, existingIndex: number): void;
|
|
3765
3828
|
}
|
|
3766
3829
|
|
|
3830
|
+
export declare type PromptedEditsChange<TField extends string = string> = {
|
|
3831
|
+
type: 'add';
|
|
3832
|
+
values: Partial<Record<TField, unknown>>;
|
|
3833
|
+
} | {
|
|
3834
|
+
type: 'update';
|
|
3835
|
+
rowId: string;
|
|
3836
|
+
values: Partial<Record<TField, unknown>>;
|
|
3837
|
+
} | {
|
|
3838
|
+
type: 'remove';
|
|
3839
|
+
rowId: string;
|
|
3840
|
+
};
|
|
3841
|
+
|
|
3842
|
+
export declare interface PromptedEditsField<TField extends string = string> {
|
|
3843
|
+
key: TField;
|
|
3844
|
+
name: string;
|
|
3845
|
+
type: string;
|
|
3846
|
+
sampleValues: unknown[];
|
|
3847
|
+
}
|
|
3848
|
+
|
|
3849
|
+
export declare type PromptedEditsFn<TField extends string = string> = (data: PromptedEditsParams<TField>) => Promise<PromptedEditsResult<TField>>;
|
|
3850
|
+
|
|
3851
|
+
export declare type PromptedEditsOptions<TSchema extends ExType<unknown, ExBaseDef, unknown> = ExRow<ExRowShape>> = ManagedPromptedEditsOptions | CustomPromptedEditsOptions<TSchema>;
|
|
3852
|
+
|
|
3853
|
+
export declare interface PromptedEditsParams<TField extends string = string> {
|
|
3854
|
+
sessionId: string;
|
|
3855
|
+
prompt: string;
|
|
3856
|
+
fields: Array<PromptedEditsField<TField>>;
|
|
3857
|
+
rows: Array<PromptedEditsRow<TField>>;
|
|
3858
|
+
totalRows: number;
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
export declare type PromptedEditsResult<TField extends string = string> = {
|
|
3862
|
+
type: 'success';
|
|
3863
|
+
changes: Array<PromptedEditsChange<TField>>;
|
|
3864
|
+
} | {
|
|
3865
|
+
type: 'no-op';
|
|
3866
|
+
message: string;
|
|
3867
|
+
};
|
|
3868
|
+
|
|
3869
|
+
export declare interface PromptedEditsRow<TField extends string = string> {
|
|
3870
|
+
rowId: string;
|
|
3871
|
+
rowIndex: number;
|
|
3872
|
+
values: Partial<Record<TField, unknown>>;
|
|
3873
|
+
}
|
|
3874
|
+
|
|
3767
3875
|
declare type Protocol = 'http' | 'https' | 'ftp' | 'sftp' | 'file' | 'mailto' | 'tel';
|
|
3768
3876
|
|
|
3769
3877
|
/**
|
|
@@ -3784,6 +3892,10 @@ export declare interface RecordsChunk<T> {
|
|
|
3784
3892
|
chunkIdempotencyKey: string;
|
|
3785
3893
|
}
|
|
3786
3894
|
|
|
3895
|
+
export declare type RecoveredSession = PersistedImportSessionData;
|
|
3896
|
+
|
|
3897
|
+
export declare type RecoveredSessionData = PersistedImportSessionPayload;
|
|
3898
|
+
|
|
3787
3899
|
declare type RefineBatchResultItem = {
|
|
3788
3900
|
valid: boolean;
|
|
3789
3901
|
message?: string;
|
|
@@ -3813,6 +3925,8 @@ declare type RefineResultItem = {
|
|
|
3813
3925
|
};
|
|
3814
3926
|
};
|
|
3815
3927
|
|
|
3928
|
+
declare type SchemaFieldName<TSchema extends ExType<unknown, ExBaseDef, unknown>> = Extract<keyof Infer<TSchema>, string>;
|
|
3929
|
+
|
|
3816
3930
|
export declare interface SDKOptions<TSchema extends ExType<unknown, ExBaseDef, unknown>> {
|
|
3817
3931
|
schema: TSchema;
|
|
3818
3932
|
getSessionToken: () => Promise<string>;
|
|
@@ -3826,10 +3940,10 @@ export declare interface SDKOptions<TSchema extends ExType<unknown, ExBaseDef, u
|
|
|
3826
3940
|
fonts?: Record<string, ECSVFontSource>;
|
|
3827
3941
|
stepDisplay?: 'progressBar' | 'segmented' | 'numbered';
|
|
3828
3942
|
previewSchemaBeforeUpload?: boolean;
|
|
3829
|
-
|
|
3830
|
-
|
|
3943
|
+
columnMatching?: ColumnMatchingOptions<TSchema>;
|
|
3944
|
+
promptedEdits?: PromptedEditsOptions<TSchema>;
|
|
3831
3945
|
templateDownload?: TemplateDownloadOptions<TSchema>;
|
|
3832
|
-
|
|
3946
|
+
sessionRecovery?: SessionRecoveryOptions;
|
|
3833
3947
|
locale?: DeepPartial<ExpressCSVLocaleInput>;
|
|
3834
3948
|
disableStatusStep?: boolean;
|
|
3835
3949
|
}
|
|
@@ -3846,15 +3960,11 @@ declare interface SelectOptions {
|
|
|
3846
3960
|
message?: string;
|
|
3847
3961
|
}
|
|
3848
3962
|
|
|
3849
|
-
declare type
|
|
3963
|
+
export declare type SessionRecoveryKey = PersistedImportSessionKey;
|
|
3850
3964
|
|
|
3851
|
-
export declare type
|
|
3965
|
+
export declare type SessionRecoveryOptions = LocalSessionRecoveryOptions | CustomSessionRecoveryOptions;
|
|
3852
3966
|
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
export declare type StoredSession = PersistedImportSessionData;
|
|
3856
|
-
|
|
3857
|
-
export declare type StoredSessionData = PersistedImportSessionPayload;
|
|
3967
|
+
declare type StateChangeListener = (state: ImporterState) => void;
|
|
3858
3968
|
|
|
3859
3969
|
declare type StripBrand<T> = {
|
|
3860
3970
|
[K in keyof T]: T[K] extends TemplateString<string> ? string : T[K] extends object ? StripBrand<T[K]> : T[K];
|