@nivaro/react 0.1.298 → 0.1.300

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
@@ -1267,6 +1267,88 @@ export declare function dmPeer(room: string, self: string): string | null;
1267
1267
 
1268
1268
  export declare function dmRoom(a: string, b: string): string;
1269
1269
 
1270
+ declare type DocumentApplySelection = {
1271
+ values: Record<string, unknown>;
1272
+ lines_by_alias: Record<string, Array<{
1273
+ values: Record<string, unknown>;
1274
+ }>>;
1275
+ m2m: Record<string, Array<string | number>>;
1276
+ file_id: string | null;
1277
+ summary: string;
1278
+ document_name: string;
1279
+ };
1280
+
1281
+ export declare function DocumentAutofillButton({ collection, onApply, className }: {
1282
+ collection: string;
1283
+ onApply: (selection: DocumentApplySelection, proposal: DocumentProposal) => void | Promise<void>;
1284
+ className?: string;
1285
+ }): JSX.Element | null;
1286
+
1287
+ /**
1288
+ * "Fill from a document" — a person drops a statement of work, a quote, a
1289
+ * spreadsheet on a NEW record and reviews what the model read out of it
1290
+ * before any of it lands in the form. Server contract: POST /ai/extract-record
1291
+ * returns a DocumentProposal (values + confidence + the sentence each came
1292
+ * from); this dialog is the review. Nothing is written until Apply, and Apply
1293
+ * only stages — the record still needs Create.
1294
+ */
1295
+ declare type DocumentProposal = {
1296
+ collection: string;
1297
+ summary: string;
1298
+ fields: Array<{
1299
+ field: string;
1300
+ label: string;
1301
+ value: unknown;
1302
+ display: string | null;
1303
+ confidence: number;
1304
+ source: string | null;
1305
+ }>;
1306
+ children: Array<{
1307
+ alias: string;
1308
+ label: string;
1309
+ collection: string;
1310
+ lines: Array<{
1311
+ values: Record<string, unknown>;
1312
+ display: Record<string, string>;
1313
+ confidence: number;
1314
+ source: string | null;
1315
+ }>;
1316
+ }>;
1317
+ m2m: Array<{
1318
+ alias: string;
1319
+ label: string;
1320
+ items: Array<{
1321
+ id: string | number;
1322
+ label: string;
1323
+ confidence: number;
1324
+ }>;
1325
+ }>;
1326
+ asks: Array<{
1327
+ field: string;
1328
+ label: string;
1329
+ reason: string;
1330
+ }>;
1331
+ warnings: string[];
1332
+ prefill: {
1333
+ values: Record<string, unknown>;
1334
+ lines_by_alias: Record<string, Array<{
1335
+ values: Record<string, unknown>;
1336
+ }>>;
1337
+ m2m: Record<string, Array<string | number>>;
1338
+ file_id: string | null;
1339
+ attach_alias: string | null;
1340
+ };
1341
+ document: {
1342
+ name: string;
1343
+ method: string;
1344
+ pages: number | null;
1345
+ truncated: boolean;
1346
+ chars: number;
1347
+ };
1348
+ model: string;
1349
+ rounds: number;
1350
+ };
1351
+
1270
1352
  /** One dot per partner, worst outcome winning — a red dot must never be
1271
1353
  * hidden behind a green one from the same partner. Superseded rows are
1272
1354
  * never a partner's CURRENT state, so they never contribute a dot at all. */
@@ -2074,7 +2156,7 @@ export declare function idleState(): {
2074
2156
  last_active: string;
2075
2157
  };
2076
2158
 
2077
- export declare function ImportConsole({ realtime, defaultTab, initialJobId, onJobOpen }: ImportConsoleProps): JSX.Element;
2159
+ export declare function ImportConsole({ realtime, defaultTab, initialJobId, onJobOpen, initialRunId, onRunOpen }: ImportConsoleProps): JSX.Element;
2078
2160
 
2079
2161
  export declare interface ImportConsoleProps {
2080
2162
  /**
@@ -2089,6 +2171,10 @@ export declare interface ImportConsoleProps {
2089
2171
  /** Fires when a collection-import job's detail opens or closes, so a host
2090
2172
  * can keep its own URL in step. */
2091
2173
  onJobOpen?: (id: string | null) => void;
2174
+ /** Deep link into a staged run's detail (admin /imports?run=9801). */
2175
+ initialRunId?: number | null;
2176
+ /** Fires when a staged run's detail opens or closes. */
2177
+ onRunOpen?: (id: number | null) => void;
2092
2178
  }
2093
2179
 
2094
2180
  export declare type ImportConsoleTab = 'runs' | 'collection' | 'definitions';
@@ -2281,9 +2367,17 @@ export declare interface ImportRun {
2281
2367
  created_at: string | null;
2282
2368
  updated_at: string | null;
2283
2369
  legacy_id: number | null;
2370
+ /** What executed: 'procedure:<name>', 'service', 'load' or a processor key.
2371
+ * Null on runs from before it was recorded. */
2372
+ ran_via?: string | null;
2373
+ reverted_at?: string | null;
2374
+ /** Detail route only. */
2375
+ report?: ImportRunReport | null;
2284
2376
  definition_label: string | null;
2285
2377
  staging_table: string | null;
2286
2378
  procedure: string | null;
2379
+ /** null / 'proc' = stored procedure, 'service', or a registered processor key. */
2380
+ processor?: string | null;
2287
2381
  loader: 'bulk' | 'insert' | null;
2288
2382
  definition_active: boolean | null;
2289
2383
  file_name: string | null;
@@ -2293,9 +2387,51 @@ export declare interface ImportRun {
2293
2387
  created_by_email: string | null;
2294
2388
  }
2295
2389
 
2390
+ declare interface ImportRunPhase {
2391
+ key: string;
2392
+ label: string;
2393
+ ms: number;
2394
+ count?: number;
2395
+ failed?: number;
2396
+ }
2397
+
2398
+ /** What a run did — counts, timings, values in the file that matched nothing. */
2399
+ declare interface ImportRunReport {
2400
+ counts: {
2401
+ created: number;
2402
+ updated: number;
2403
+ unchanged: number;
2404
+ skipped: number;
2405
+ failed: number;
2406
+ other?: Array<{
2407
+ label: string;
2408
+ count: number;
2409
+ }>;
2410
+ };
2411
+ skipped: Record<string, number>;
2412
+ phases: ImportRunPhase[];
2413
+ unmatched: ImportRunUnmatched[];
2414
+ notes: string[];
2415
+ collections?: Record<string, {
2416
+ created: number;
2417
+ updated: number;
2418
+ }>;
2419
+ items_stored?: number;
2420
+ items_truncated?: boolean;
2421
+ }
2422
+
2296
2423
  /** Shared types for the Import Console (`/api/staged-imports`). */
2297
2424
  export declare type ImportRunStatus = 'queued' | 'running' | 'completed' | 'error' | 'canceled';
2298
2425
 
2426
+ declare interface ImportRunUnmatched {
2427
+ column: string;
2428
+ label: string;
2429
+ values: string[];
2430
+ distinct: number;
2431
+ rows: number;
2432
+ effect: string;
2433
+ }
2434
+
2299
2435
  /** The chip a definitions list shows beside each import. */
2300
2436
  export declare function ImportStalenessChip({ importKey }: {
2301
2437
  importKey: string;
@@ -3970,6 +4106,17 @@ export declare interface PersonProfileData {
3970
4106
  expires_at: string | null;
3971
4107
  }) | null;
3972
4108
  manager: PersonRef | null;
4109
+ /** The directory's manager when they have no account here. */
4110
+ manager_external: {
4111
+ name: string | null;
4112
+ email: string | null;
4113
+ } | null;
4114
+ /** Upward chain from the direct manager: [manager, their manager, …]. */
4115
+ org_chain: Array<PersonRef & {
4116
+ title?: string | null;
4117
+ }>;
4118
+ /** People with the same manager. */
4119
+ peers: PersonRef[];
3973
4120
  direct_reports: PersonRef[];
3974
4121
  covers_for: PersonRef[];
3975
4122
  custom_status: {