@expresscsv/sdk 1.5.0 → 1.6.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 +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ ExpressCSV delivers imported data through `onData`. Your app receives validated
|
|
|
68
68
|
|
|
69
69
|
```typescript
|
|
70
70
|
importer.open({
|
|
71
|
-
chunkSize: { unit: "
|
|
71
|
+
chunkSize: { unit: "rows", value: 1000 },
|
|
72
72
|
onData: async (chunk, next) => {
|
|
73
73
|
const response = await fetch("/your-api/import-users/chunks", {
|
|
74
74
|
method: "POST",
|
|
@@ -586,7 +586,7 @@ importer.open(options: OpenOptions): void
|
|
|
586
586
|
| Option | Type | Required | Description |
|
|
587
587
|
|---|---|---|---|
|
|
588
588
|
| `onData` | `(chunk: RecordsChunk<T>, next: () => void) => void` | Yes | Callback for each delivered chunk of records. Call `next()` after your backend accepts the current chunk. |
|
|
589
|
-
| `chunkSize` | `ChunkSize` | No | Delivery packet size. Defaults to `{ unit: "
|
|
589
|
+
| `chunkSize` | `ChunkSize` | No | Delivery packet size. Defaults to `{ unit: "rows", value: 1000 }`. `kb` uses decimal kilobytes (`1 KB = 1000 bytes`). Use `{ unit: "kb", value: 500 }` for KB or `{ unit: "rows", value: 1000 }` for row counts. Zero or negative values send all records in one chunk. |
|
|
590
590
|
| `onComplete` | `(context: { sessionId: string }) => void` | No | Called when all chunks have been processed |
|
|
591
591
|
| `onCancel` | `(context: { sessionId: string }) => void` | No | Called when the user cancels the import |
|
|
592
592
|
| `onError` | `(error: Error, context: { sessionId: string }) => void` | No | Called when an error occurs |
|
package/dist/index.d.cts
CHANGED
|
@@ -3725,7 +3725,7 @@ declare interface MultiselectOptions {
|
|
|
3725
3725
|
export declare type OpenOptions<T> = {
|
|
3726
3726
|
/** Callback for processing delivered chunks */
|
|
3727
3727
|
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3728
|
-
/** Chunk size by KB quota or row count. Defaults to
|
|
3728
|
+
/** Chunk size by KB quota or row count. Defaults to 1000 rows. Values <= 0 send one chunk. */
|
|
3729
3729
|
chunkSize?: ChunkSize;
|
|
3730
3730
|
/** Called when all chunks have been processed */
|
|
3731
3731
|
onComplete?: (context: ImportDeliveryContext) => void;
|
package/dist/index.d.mts
CHANGED
|
@@ -3725,7 +3725,7 @@ declare interface MultiselectOptions {
|
|
|
3725
3725
|
export declare type OpenOptions<T> = {
|
|
3726
3726
|
/** Callback for processing delivered chunks */
|
|
3727
3727
|
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3728
|
-
/** Chunk size by KB quota or row count. Defaults to
|
|
3728
|
+
/** Chunk size by KB quota or row count. Defaults to 1000 rows. Values <= 0 send one chunk. */
|
|
3729
3729
|
chunkSize?: ChunkSize;
|
|
3730
3730
|
/** Called when all chunks have been processed */
|
|
3731
3731
|
onComplete?: (context: ImportDeliveryContext) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -3725,7 +3725,7 @@ declare interface MultiselectOptions {
|
|
|
3725
3725
|
export declare type OpenOptions<T> = {
|
|
3726
3726
|
/** Callback for processing delivered chunks */
|
|
3727
3727
|
onData: (chunk: RecordsChunk<T>, next: () => void) => void | Promise<void>;
|
|
3728
|
-
/** Chunk size by KB quota or row count. Defaults to
|
|
3728
|
+
/** Chunk size by KB quota or row count. Defaults to 1000 rows. Values <= 0 send one chunk. */
|
|
3729
3729
|
chunkSize?: ChunkSize;
|
|
3730
3730
|
/** Called when all chunks have been processed */
|
|
3731
3731
|
onComplete?: (context: ImportDeliveryContext) => void;
|