@nivaro/react 0.1.299 → 0.1.301

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/dist/index.d.ts CHANGED
@@ -413,6 +413,8 @@ export declare function BroadcastView({ className }: {
413
413
  className?: string;
414
414
  }): JSX.Element;
415
415
 
416
+ export declare function buildCopyAs(input: CopyAsInput): CopyAsSnippets;
417
+
416
418
  export declare function buildGroups<T extends QueueGroupingRow>(rows: T[], attribute: string): QueueGroup<T>[];
417
419
 
418
420
  export declare function BulkActionButtons({ targets, enabledKeys, tone, disabled, onDone }: {
@@ -1010,10 +1012,44 @@ export declare type ComponentOverrides = {
1010
1012
  fallback?: default_2.ComponentType<FieldComponentProps>;
1011
1013
  };
1012
1014
 
1015
+ /** The browser's conditions as the filter object the SDK and GraphQL take:
1016
+ * a dotted path folds into nested objects, an `or` group into `_or`, and
1017
+ * several conditions AND together. */
1018
+ export declare function conditionsToFilter(conditions: string | undefined): Record<string, unknown> | null;
1019
+
1013
1020
  export declare function ConformanceView({ className }: {
1014
1021
  className?: string;
1015
1022
  }): JSX.Element;
1016
1023
 
1024
+ /**
1025
+ * "Copy as …" (#654): the request behind a list or a record, as a curl
1026
+ * command, an SDK call and a GraphQL document, each ready to paste. The
1027
+ * token is always the `NIVARO_TOKEN` placeholder, never the viewer's own.
1028
+ */
1029
+ export declare function CopyAsButton({ collection, itemId, list, fields, compact, className }: Omit<CopyAsInput, 'origin'> & {
1030
+ /** Icon-only, borderless — for the record header's tool group. */
1031
+ compact?: boolean;
1032
+ className?: string;
1033
+ }): JSX.Element;
1034
+
1035
+ declare interface CopyAsInput {
1036
+ /** The host the API is served from, no trailing slash. */
1037
+ origin: string;
1038
+ collection: string;
1039
+ /** A record id renders the single-record forms. */
1040
+ itemId?: string | null;
1041
+ list?: ListRequest;
1042
+ /** Plain or dotted field keys the GraphQL selection lists (`id` is always
1043
+ * first; a key that starts with `__` is a synthetic column and skipped). */
1044
+ fields?: string[];
1045
+ }
1046
+
1047
+ declare interface CopyAsSnippets {
1048
+ curl: string;
1049
+ sdk: string;
1050
+ graphql: string;
1051
+ }
1052
+
1017
1053
  /**
1018
1054
  * `opts.open` is the gate's state AT CONSTRUCTION. A host that starts a
1019
1055
  * hidden tab must pass `false` here rather than calling `setOpen(false)`
@@ -1267,6 +1303,88 @@ export declare function dmPeer(room: string, self: string): string | null;
1267
1303
 
1268
1304
  export declare function dmRoom(a: string, b: string): string;
1269
1305
 
1306
+ declare type DocumentApplySelection = {
1307
+ values: Record<string, unknown>;
1308
+ lines_by_alias: Record<string, Array<{
1309
+ values: Record<string, unknown>;
1310
+ }>>;
1311
+ m2m: Record<string, Array<string | number>>;
1312
+ file_id: string | null;
1313
+ summary: string;
1314
+ document_name: string;
1315
+ };
1316
+
1317
+ export declare function DocumentAutofillButton({ collection, onApply, className }: {
1318
+ collection: string;
1319
+ onApply: (selection: DocumentApplySelection, proposal: DocumentProposal) => void | Promise<void>;
1320
+ className?: string;
1321
+ }): JSX.Element | null;
1322
+
1323
+ /**
1324
+ * "Fill from a document" — a person drops a statement of work, a quote, a
1325
+ * spreadsheet on a NEW record and reviews what the model read out of it
1326
+ * before any of it lands in the form. Server contract: POST /ai/extract-record
1327
+ * returns a DocumentProposal (values + confidence + the sentence each came
1328
+ * from); this dialog is the review. Nothing is written until Apply, and Apply
1329
+ * only stages — the record still needs Create.
1330
+ */
1331
+ declare type DocumentProposal = {
1332
+ collection: string;
1333
+ summary: string;
1334
+ fields: Array<{
1335
+ field: string;
1336
+ label: string;
1337
+ value: unknown;
1338
+ display: string | null;
1339
+ confidence: number;
1340
+ source: string | null;
1341
+ }>;
1342
+ children: Array<{
1343
+ alias: string;
1344
+ label: string;
1345
+ collection: string;
1346
+ lines: Array<{
1347
+ values: Record<string, unknown>;
1348
+ display: Record<string, string>;
1349
+ confidence: number;
1350
+ source: string | null;
1351
+ }>;
1352
+ }>;
1353
+ m2m: Array<{
1354
+ alias: string;
1355
+ label: string;
1356
+ items: Array<{
1357
+ id: string | number;
1358
+ label: string;
1359
+ confidence: number;
1360
+ }>;
1361
+ }>;
1362
+ asks: Array<{
1363
+ field: string;
1364
+ label: string;
1365
+ reason: string;
1366
+ }>;
1367
+ warnings: string[];
1368
+ prefill: {
1369
+ values: Record<string, unknown>;
1370
+ lines_by_alias: Record<string, Array<{
1371
+ values: Record<string, unknown>;
1372
+ }>>;
1373
+ m2m: Record<string, Array<string | number>>;
1374
+ file_id: string | null;
1375
+ attach_alias: string | null;
1376
+ };
1377
+ document: {
1378
+ name: string;
1379
+ method: string;
1380
+ pages: number | null;
1381
+ truncated: boolean;
1382
+ chars: number;
1383
+ };
1384
+ model: string;
1385
+ rounds: number;
1386
+ };
1387
+
1270
1388
  /** One dot per partner, worst outcome winning — a red dot must never be
1271
1389
  * hidden behind a green one from the same partner. Superseded rows are
1272
1390
  * never a partner's CURRENT state, so they never contribute a dot at all. */
@@ -2074,7 +2192,7 @@ export declare function idleState(): {
2074
2192
  last_active: string;
2075
2193
  };
2076
2194
 
2077
- export declare function ImportConsole({ realtime, defaultTab, initialJobId, onJobOpen }: ImportConsoleProps): JSX.Element;
2195
+ export declare function ImportConsole({ realtime, defaultTab, initialJobId, onJobOpen, initialRunId, onRunOpen }: ImportConsoleProps): JSX.Element;
2078
2196
 
2079
2197
  export declare interface ImportConsoleProps {
2080
2198
  /**
@@ -2089,6 +2207,10 @@ export declare interface ImportConsoleProps {
2089
2207
  /** Fires when a collection-import job's detail opens or closes, so a host
2090
2208
  * can keep its own URL in step. */
2091
2209
  onJobOpen?: (id: string | null) => void;
2210
+ /** Deep link into a staged run's detail (admin /imports?run=9801). */
2211
+ initialRunId?: number | null;
2212
+ /** Fires when a staged run's detail opens or closes. */
2213
+ onRunOpen?: (id: number | null) => void;
2092
2214
  }
2093
2215
 
2094
2216
  export declare type ImportConsoleTab = 'runs' | 'collection' | 'definitions';
@@ -2281,9 +2403,17 @@ export declare interface ImportRun {
2281
2403
  created_at: string | null;
2282
2404
  updated_at: string | null;
2283
2405
  legacy_id: number | null;
2406
+ /** What executed: 'procedure:<name>', 'service', 'load' or a processor key.
2407
+ * Null on runs from before it was recorded. */
2408
+ ran_via?: string | null;
2409
+ reverted_at?: string | null;
2410
+ /** Detail route only. */
2411
+ report?: ImportRunReport | null;
2284
2412
  definition_label: string | null;
2285
2413
  staging_table: string | null;
2286
2414
  procedure: string | null;
2415
+ /** null / 'proc' = stored procedure, 'service', or a registered processor key. */
2416
+ processor?: string | null;
2287
2417
  loader: 'bulk' | 'insert' | null;
2288
2418
  definition_active: boolean | null;
2289
2419
  file_name: string | null;
@@ -2293,9 +2423,51 @@ export declare interface ImportRun {
2293
2423
  created_by_email: string | null;
2294
2424
  }
2295
2425
 
2426
+ declare interface ImportRunPhase {
2427
+ key: string;
2428
+ label: string;
2429
+ ms: number;
2430
+ count?: number;
2431
+ failed?: number;
2432
+ }
2433
+
2434
+ /** What a run did — counts, timings, values in the file that matched nothing. */
2435
+ declare interface ImportRunReport {
2436
+ counts: {
2437
+ created: number;
2438
+ updated: number;
2439
+ unchanged: number;
2440
+ skipped: number;
2441
+ failed: number;
2442
+ other?: Array<{
2443
+ label: string;
2444
+ count: number;
2445
+ }>;
2446
+ };
2447
+ skipped: Record<string, number>;
2448
+ phases: ImportRunPhase[];
2449
+ unmatched: ImportRunUnmatched[];
2450
+ notes: string[];
2451
+ collections?: Record<string, {
2452
+ created: number;
2453
+ updated: number;
2454
+ }>;
2455
+ items_stored?: number;
2456
+ items_truncated?: boolean;
2457
+ }
2458
+
2296
2459
  /** Shared types for the Import Console (`/api/staged-imports`). */
2297
2460
  export declare type ImportRunStatus = 'queued' | 'running' | 'completed' | 'error' | 'canceled';
2298
2461
 
2462
+ declare interface ImportRunUnmatched {
2463
+ column: string;
2464
+ label: string;
2465
+ values: string[];
2466
+ distinct: number;
2467
+ rows: number;
2468
+ effect: string;
2469
+ }
2470
+
2299
2471
  /** The chip a definitions list shows beside each import. */
2300
2472
  export declare function ImportStalenessChip({ importKey }: {
2301
2473
  importKey: string;
@@ -3123,6 +3295,24 @@ export declare interface LeaderSocketHandle {
3123
3295
 
3124
3296
  export declare function listFieldInterfaces(): string[];
3125
3297
 
3298
+ /**
3299
+ * "Copy as …" (#654): the request a list or record view is making, rendered
3300
+ * as a curl command, an SDK call and a GraphQL document. Pure — no client,
3301
+ * no DOM — so the three renderings can be judged against each other.
3302
+ *
3303
+ * The token is never the real one: every rendering names `NIVARO_TOKEN`.
3304
+ */
3305
+ declare interface ListRequest {
3306
+ /** The browser's `conditions` JSON (an array of {path, op, value} and
3307
+ * `{or: [...]}` groups), already serialised. */
3308
+ conditions?: string;
3309
+ search?: string;
3310
+ /** Comma-joined sort, `-` prefix = descending. */
3311
+ sort?: string;
3312
+ limit?: number;
3313
+ page?: number;
3314
+ }
3315
+
3126
3316
  declare interface LockHolder {
3127
3317
  locked_by: string;
3128
3318
  locked_by_name: string | null;