@expresscsv/sdk 0.1.25 → 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 +145 -41
- package/dist/index.d.mts +145 -41
- package/dist/index.d.ts +145 -41
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
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";
|
|
@@ -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
|
*/
|
|
@@ -2950,6 +2989,8 @@ declare interface ExpressCSVLocale {
|
|
|
2950
2989
|
showAll: string;
|
|
2951
2990
|
moveUp: string;
|
|
2952
2991
|
moveDown: string;
|
|
2992
|
+
/** When the selected row has zero columns (cannot continue) */
|
|
2993
|
+
rowNotSelectable: string;
|
|
2953
2994
|
};
|
|
2954
2995
|
matchColumns: {
|
|
2955
2996
|
loading: string;
|
|
@@ -2984,6 +3025,8 @@ declare interface ExpressCSVLocale {
|
|
|
2984
3025
|
previewTooltip: string;
|
|
2985
3026
|
/** Available: {rowCount}, {columnName} */
|
|
2986
3027
|
previewShowing: TemplateString<'rowCount' | 'columnName'>;
|
|
3028
|
+
/** Available: {columnNumber} — 1-based index when the sheet header cell is empty */
|
|
3029
|
+
unnamedSourceColumn: TemplateString<'columnNumber'>;
|
|
2987
3030
|
};
|
|
2988
3031
|
matchOptions: {
|
|
2989
3032
|
loading: string;
|
|
@@ -3076,27 +3119,27 @@ declare interface ExpressCSVLocale {
|
|
|
3076
3119
|
filteredColumns: string;
|
|
3077
3120
|
unfilteredColumns: string;
|
|
3078
3121
|
columnsLabel: string;
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
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;
|
|
3098
3141
|
};
|
|
3099
|
-
|
|
3142
|
+
emptyColumn: {
|
|
3100
3143
|
/** Available: {number} */
|
|
3101
3144
|
defaultName: TemplateString<'number'>;
|
|
3102
3145
|
remove: string;
|
|
@@ -3637,10 +3680,22 @@ export declare type InferCSVImporter<TSchema extends ExType<unknown, ExBaseDef,
|
|
|
3637
3680
|
|
|
3638
3681
|
declare type IPAddressVersion = 'v4' | 'v6' | 'all';
|
|
3639
3682
|
|
|
3640
|
-
export declare type
|
|
3683
|
+
export declare type LocalSessionRecoveryOptions = {
|
|
3641
3684
|
type: 'local';
|
|
3642
3685
|
};
|
|
3643
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
|
+
|
|
3644
3699
|
declare interface MultiselectOptions {
|
|
3645
3700
|
enforceCaseSensitiveMatch?: boolean;
|
|
3646
3701
|
message?: string;
|
|
@@ -3650,7 +3705,9 @@ declare interface MultiselectOptions {
|
|
|
3650
3705
|
* Options for the open() method
|
|
3651
3706
|
* Requires an onData callback for delivery
|
|
3652
3707
|
*/
|
|
3653
|
-
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>;
|
|
3654
3711
|
/** Number of records per chunk (default: 1000) */
|
|
3655
3712
|
chunkSize?: number;
|
|
3656
3713
|
/** Called when all chunks have been processed */
|
|
@@ -3770,6 +3827,51 @@ declare abstract class PrimitiveExType<Output, Def extends PrimitiveExBaseDef, I
|
|
|
3770
3827
|
protected _replaceOrAddCheck(check: ValidatorCheck, existingIndex: number): void;
|
|
3771
3828
|
}
|
|
3772
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
|
+
|
|
3773
3875
|
declare type Protocol = 'http' | 'https' | 'ftp' | 'sftp' | 'file' | 'mailto' | 'tel';
|
|
3774
3876
|
|
|
3775
3877
|
/**
|
|
@@ -3790,6 +3892,10 @@ export declare interface RecordsChunk<T> {
|
|
|
3790
3892
|
chunkIdempotencyKey: string;
|
|
3791
3893
|
}
|
|
3792
3894
|
|
|
3895
|
+
export declare type RecoveredSession = PersistedImportSessionData;
|
|
3896
|
+
|
|
3897
|
+
export declare type RecoveredSessionData = PersistedImportSessionPayload;
|
|
3898
|
+
|
|
3793
3899
|
declare type RefineBatchResultItem = {
|
|
3794
3900
|
valid: boolean;
|
|
3795
3901
|
message?: string;
|
|
@@ -3819,6 +3925,8 @@ declare type RefineResultItem = {
|
|
|
3819
3925
|
};
|
|
3820
3926
|
};
|
|
3821
3927
|
|
|
3928
|
+
declare type SchemaFieldName<TSchema extends ExType<unknown, ExBaseDef, unknown>> = Extract<keyof Infer<TSchema>, string>;
|
|
3929
|
+
|
|
3822
3930
|
export declare interface SDKOptions<TSchema extends ExType<unknown, ExBaseDef, unknown>> {
|
|
3823
3931
|
schema: TSchema;
|
|
3824
3932
|
getSessionToken: () => Promise<string>;
|
|
@@ -3832,10 +3940,10 @@ export declare interface SDKOptions<TSchema extends ExType<unknown, ExBaseDef, u
|
|
|
3832
3940
|
fonts?: Record<string, ECSVFontSource>;
|
|
3833
3941
|
stepDisplay?: 'progressBar' | 'segmented' | 'numbered';
|
|
3834
3942
|
previewSchemaBeforeUpload?: boolean;
|
|
3835
|
-
|
|
3836
|
-
|
|
3943
|
+
columnMatching?: ColumnMatchingOptions<TSchema>;
|
|
3944
|
+
promptedEdits?: PromptedEditsOptions<TSchema>;
|
|
3837
3945
|
templateDownload?: TemplateDownloadOptions<TSchema>;
|
|
3838
|
-
|
|
3946
|
+
sessionRecovery?: SessionRecoveryOptions;
|
|
3839
3947
|
locale?: DeepPartial<ExpressCSVLocaleInput>;
|
|
3840
3948
|
disableStatusStep?: boolean;
|
|
3841
3949
|
}
|
|
@@ -3852,15 +3960,11 @@ declare interface SelectOptions {
|
|
|
3852
3960
|
message?: string;
|
|
3853
3961
|
}
|
|
3854
3962
|
|
|
3855
|
-
declare type
|
|
3963
|
+
export declare type SessionRecoveryKey = PersistedImportSessionKey;
|
|
3856
3964
|
|
|
3857
|
-
export declare type
|
|
3965
|
+
export declare type SessionRecoveryOptions = LocalSessionRecoveryOptions | CustomSessionRecoveryOptions;
|
|
3858
3966
|
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
export declare type StoredSession = PersistedImportSessionData;
|
|
3862
|
-
|
|
3863
|
-
export declare type StoredSessionData = PersistedImportSessionPayload;
|
|
3967
|
+
declare type StateChangeListener = (state: ImporterState) => void;
|
|
3864
3968
|
|
|
3865
3969
|
declare type StripBrand<T> = {
|
|
3866
3970
|
[K in keyof T]: T[K] extends TemplateString<string> ? string : T[K] extends object ? StripBrand<T[K]> : T[K];
|