@spaceinvoices/js-sdk 9.0.0 → 9.0.2
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.
|
@@ -335,11 +335,13 @@ export type backfillExpenseRecognitionResponse = (backfillExpenseRecognitionResp
|
|
|
335
335
|
export declare const getBackfillExpenseRecognitionUrl: () => string;
|
|
336
336
|
export declare const backfillExpenseRecognition: (expenseRecognitionBackfill: ExpenseRecognitionBackfill, options?: RequestInit) => Promise<backfillExpenseRecognitionResponse>;
|
|
337
337
|
/**
|
|
338
|
-
*
|
|
338
|
+
* Automatic expense recognition supports PDFs up to 8 pages. Split a larger PDF into smaller documents before trying again.
|
|
339
|
+
|
|
340
|
+
Accepts one supplier invoice (PDF, JPEG, PNG, or WebP), creates an invoice-only draft expense with `creation_source=ocr`, and enqueues an async recognition job. For sandbox entities, no provider is called and no usage is charged: the submitted file is not stored and is replaced by a clearly marked deterministic demo invoice; the response exposes `simulation_mode=sandbox_demo`.
|
|
339
341
|
|
|
340
342
|
Returns **202 Accepted** with the job, expense, and file identifiers. Recognition is asynchronous in live mode; poll `GET /expenses/recognitions/{id}` for status. Terminal success is `ready_for_review` or `needs_attention`; terminal failure is `failed`, with safe `error_code` and `error_message` fields.
|
|
341
343
|
|
|
342
|
-
Parsed document and line amounts are checked against the standard expense calculation before applying extraction. A disagreement keeps the draft unchanged and stores the extraction with `needs_attention` for review.
|
|
344
|
+
Parsed document and line amounts are checked against the standard expense calculation before applying extraction. A disagreement keeps the draft unchanged and stores the extraction with `needs_attention` for review. Critical identity, required-field, confidence, document-type, and questionable financial warnings also require review and prevent unsafe automatic application.
|
|
343
345
|
|
|
344
346
|
Payment suggestions from OCR are advisory only and never mark the expense paid or create payments. Failed provider attempts record zero customer usage. Automatic provider attempts and a permitted customer retry share the same job; billable customer usage is recorded once only after a successful terminal result.
|
|
345
347
|
|
|
@@ -358,6 +360,10 @@ export type createExpenseRecognitionResponse401 = {
|
|
|
358
360
|
data: Error;
|
|
359
361
|
status: 401;
|
|
360
362
|
};
|
|
363
|
+
export type createExpenseRecognitionResponse402 = {
|
|
364
|
+
data: Error;
|
|
365
|
+
status: 402;
|
|
366
|
+
};
|
|
361
367
|
export type createExpenseRecognitionResponse403 = {
|
|
362
368
|
data: Error;
|
|
363
369
|
status: 403;
|
|
@@ -366,6 +372,10 @@ export type createExpenseRecognitionResponse404 = {
|
|
|
366
372
|
data: Error;
|
|
367
373
|
status: 404;
|
|
368
374
|
};
|
|
375
|
+
export type createExpenseRecognitionResponse409 = {
|
|
376
|
+
data: Error;
|
|
377
|
+
status: 409;
|
|
378
|
+
};
|
|
369
379
|
export type createExpenseRecognitionResponse422 = {
|
|
370
380
|
data: ValidationError;
|
|
371
381
|
status: 422;
|
|
@@ -374,10 +384,14 @@ export type createExpenseRecognitionResponse500 = {
|
|
|
374
384
|
data: Error;
|
|
375
385
|
status: 500;
|
|
376
386
|
};
|
|
387
|
+
export type createExpenseRecognitionResponse503 = {
|
|
388
|
+
data: Error;
|
|
389
|
+
status: 503;
|
|
390
|
+
};
|
|
377
391
|
export type createExpenseRecognitionResponseSuccess = (createExpenseRecognitionResponse202) & {
|
|
378
392
|
headers: Headers;
|
|
379
393
|
};
|
|
380
|
-
export type createExpenseRecognitionResponseError = (createExpenseRecognitionResponse400 | createExpenseRecognitionResponse401 | createExpenseRecognitionResponse403 | createExpenseRecognitionResponse404 | createExpenseRecognitionResponse422 | createExpenseRecognitionResponse500) & {
|
|
394
|
+
export type createExpenseRecognitionResponseError = (createExpenseRecognitionResponse400 | createExpenseRecognitionResponse401 | createExpenseRecognitionResponse402 | createExpenseRecognitionResponse403 | createExpenseRecognitionResponse404 | createExpenseRecognitionResponse409 | createExpenseRecognitionResponse422 | createExpenseRecognitionResponse500 | createExpenseRecognitionResponse503) & {
|
|
381
395
|
headers: Headers;
|
|
382
396
|
};
|
|
383
397
|
export type createExpenseRecognitionResponse = (createExpenseRecognitionResponseSuccess | createExpenseRecognitionResponseError);
|
|
@@ -432,6 +446,10 @@ export type retryExpenseRecognitionResponse401 = {
|
|
|
432
446
|
data: Error;
|
|
433
447
|
status: 401;
|
|
434
448
|
};
|
|
449
|
+
export type retryExpenseRecognitionResponse402 = {
|
|
450
|
+
data: Error;
|
|
451
|
+
status: 402;
|
|
452
|
+
};
|
|
435
453
|
export type retryExpenseRecognitionResponse403 = {
|
|
436
454
|
data: Error;
|
|
437
455
|
status: 403;
|
|
@@ -440,6 +458,10 @@ export type retryExpenseRecognitionResponse404 = {
|
|
|
440
458
|
data: Error;
|
|
441
459
|
status: 404;
|
|
442
460
|
};
|
|
461
|
+
export type retryExpenseRecognitionResponse409 = {
|
|
462
|
+
data: Error;
|
|
463
|
+
status: 409;
|
|
464
|
+
};
|
|
443
465
|
export type retryExpenseRecognitionResponse422 = {
|
|
444
466
|
data: ValidationError;
|
|
445
467
|
status: 422;
|
|
@@ -448,10 +470,14 @@ export type retryExpenseRecognitionResponse500 = {
|
|
|
448
470
|
data: Error;
|
|
449
471
|
status: 500;
|
|
450
472
|
};
|
|
473
|
+
export type retryExpenseRecognitionResponse503 = {
|
|
474
|
+
data: Error;
|
|
475
|
+
status: 503;
|
|
476
|
+
};
|
|
451
477
|
export type retryExpenseRecognitionResponseSuccess = (retryExpenseRecognitionResponse202) & {
|
|
452
478
|
headers: Headers;
|
|
453
479
|
};
|
|
454
|
-
export type retryExpenseRecognitionResponseError = (retryExpenseRecognitionResponse400 | retryExpenseRecognitionResponse401 | retryExpenseRecognitionResponse403 | retryExpenseRecognitionResponse404 | retryExpenseRecognitionResponse422 | retryExpenseRecognitionResponse500) & {
|
|
480
|
+
export type retryExpenseRecognitionResponseError = (retryExpenseRecognitionResponse400 | retryExpenseRecognitionResponse401 | retryExpenseRecognitionResponse402 | retryExpenseRecognitionResponse403 | retryExpenseRecognitionResponse404 | retryExpenseRecognitionResponse409 | retryExpenseRecognitionResponse422 | retryExpenseRecognitionResponse500 | retryExpenseRecognitionResponse503) & {
|
|
455
481
|
headers: Headers;
|
|
456
482
|
};
|
|
457
483
|
export type retryExpenseRecognitionResponse = (retryExpenseRecognitionResponseSuccess | retryExpenseRecognitionResponseError);
|
|
@@ -335,11 +335,13 @@ export type backfillExpenseRecognitionResponse = (backfillExpenseRecognitionResp
|
|
|
335
335
|
export declare const getBackfillExpenseRecognitionUrl: () => string;
|
|
336
336
|
export declare const backfillExpenseRecognition: (expenseRecognitionBackfill: ExpenseRecognitionBackfill, options?: RequestInit) => Promise<backfillExpenseRecognitionResponse>;
|
|
337
337
|
/**
|
|
338
|
-
*
|
|
338
|
+
* Automatic expense recognition supports PDFs up to 8 pages. Split a larger PDF into smaller documents before trying again.
|
|
339
|
+
|
|
340
|
+
Accepts one supplier invoice (PDF, JPEG, PNG, or WebP), creates an invoice-only draft expense with `creation_source=ocr`, and enqueues an async recognition job. For sandbox entities, no provider is called and no usage is charged: the submitted file is not stored and is replaced by a clearly marked deterministic demo invoice; the response exposes `simulation_mode=sandbox_demo`.
|
|
339
341
|
|
|
340
342
|
Returns **202 Accepted** with the job, expense, and file identifiers. Recognition is asynchronous in live mode; poll `GET /expenses/recognitions/{id}` for status. Terminal success is `ready_for_review` or `needs_attention`; terminal failure is `failed`, with safe `error_code` and `error_message` fields.
|
|
341
343
|
|
|
342
|
-
Parsed document and line amounts are checked against the standard expense calculation before applying extraction. A disagreement keeps the draft unchanged and stores the extraction with `needs_attention` for review.
|
|
344
|
+
Parsed document and line amounts are checked against the standard expense calculation before applying extraction. A disagreement keeps the draft unchanged and stores the extraction with `needs_attention` for review. Critical identity, required-field, confidence, document-type, and questionable financial warnings also require review and prevent unsafe automatic application.
|
|
343
345
|
|
|
344
346
|
Payment suggestions from OCR are advisory only and never mark the expense paid or create payments. Failed provider attempts record zero customer usage. Automatic provider attempts and a permitted customer retry share the same job; billable customer usage is recorded once only after a successful terminal result.
|
|
345
347
|
|
|
@@ -358,6 +360,10 @@ export type createExpenseRecognitionResponse401 = {
|
|
|
358
360
|
data: Error;
|
|
359
361
|
status: 401;
|
|
360
362
|
};
|
|
363
|
+
export type createExpenseRecognitionResponse402 = {
|
|
364
|
+
data: Error;
|
|
365
|
+
status: 402;
|
|
366
|
+
};
|
|
361
367
|
export type createExpenseRecognitionResponse403 = {
|
|
362
368
|
data: Error;
|
|
363
369
|
status: 403;
|
|
@@ -366,6 +372,10 @@ export type createExpenseRecognitionResponse404 = {
|
|
|
366
372
|
data: Error;
|
|
367
373
|
status: 404;
|
|
368
374
|
};
|
|
375
|
+
export type createExpenseRecognitionResponse409 = {
|
|
376
|
+
data: Error;
|
|
377
|
+
status: 409;
|
|
378
|
+
};
|
|
369
379
|
export type createExpenseRecognitionResponse422 = {
|
|
370
380
|
data: ValidationError;
|
|
371
381
|
status: 422;
|
|
@@ -374,10 +384,14 @@ export type createExpenseRecognitionResponse500 = {
|
|
|
374
384
|
data: Error;
|
|
375
385
|
status: 500;
|
|
376
386
|
};
|
|
387
|
+
export type createExpenseRecognitionResponse503 = {
|
|
388
|
+
data: Error;
|
|
389
|
+
status: 503;
|
|
390
|
+
};
|
|
377
391
|
export type createExpenseRecognitionResponseSuccess = (createExpenseRecognitionResponse202) & {
|
|
378
392
|
headers: Headers;
|
|
379
393
|
};
|
|
380
|
-
export type createExpenseRecognitionResponseError = (createExpenseRecognitionResponse400 | createExpenseRecognitionResponse401 | createExpenseRecognitionResponse403 | createExpenseRecognitionResponse404 | createExpenseRecognitionResponse422 | createExpenseRecognitionResponse500) & {
|
|
394
|
+
export type createExpenseRecognitionResponseError = (createExpenseRecognitionResponse400 | createExpenseRecognitionResponse401 | createExpenseRecognitionResponse402 | createExpenseRecognitionResponse403 | createExpenseRecognitionResponse404 | createExpenseRecognitionResponse409 | createExpenseRecognitionResponse422 | createExpenseRecognitionResponse500 | createExpenseRecognitionResponse503) & {
|
|
381
395
|
headers: Headers;
|
|
382
396
|
};
|
|
383
397
|
export type createExpenseRecognitionResponse = (createExpenseRecognitionResponseSuccess | createExpenseRecognitionResponseError);
|
|
@@ -432,6 +446,10 @@ export type retryExpenseRecognitionResponse401 = {
|
|
|
432
446
|
data: Error;
|
|
433
447
|
status: 401;
|
|
434
448
|
};
|
|
449
|
+
export type retryExpenseRecognitionResponse402 = {
|
|
450
|
+
data: Error;
|
|
451
|
+
status: 402;
|
|
452
|
+
};
|
|
435
453
|
export type retryExpenseRecognitionResponse403 = {
|
|
436
454
|
data: Error;
|
|
437
455
|
status: 403;
|
|
@@ -440,6 +458,10 @@ export type retryExpenseRecognitionResponse404 = {
|
|
|
440
458
|
data: Error;
|
|
441
459
|
status: 404;
|
|
442
460
|
};
|
|
461
|
+
export type retryExpenseRecognitionResponse409 = {
|
|
462
|
+
data: Error;
|
|
463
|
+
status: 409;
|
|
464
|
+
};
|
|
443
465
|
export type retryExpenseRecognitionResponse422 = {
|
|
444
466
|
data: ValidationError;
|
|
445
467
|
status: 422;
|
|
@@ -448,10 +470,14 @@ export type retryExpenseRecognitionResponse500 = {
|
|
|
448
470
|
data: Error;
|
|
449
471
|
status: 500;
|
|
450
472
|
};
|
|
473
|
+
export type retryExpenseRecognitionResponse503 = {
|
|
474
|
+
data: Error;
|
|
475
|
+
status: 503;
|
|
476
|
+
};
|
|
451
477
|
export type retryExpenseRecognitionResponseSuccess = (retryExpenseRecognitionResponse202) & {
|
|
452
478
|
headers: Headers;
|
|
453
479
|
};
|
|
454
|
-
export type retryExpenseRecognitionResponseError = (retryExpenseRecognitionResponse400 | retryExpenseRecognitionResponse401 | retryExpenseRecognitionResponse403 | retryExpenseRecognitionResponse404 | retryExpenseRecognitionResponse422 | retryExpenseRecognitionResponse500) & {
|
|
480
|
+
export type retryExpenseRecognitionResponseError = (retryExpenseRecognitionResponse400 | retryExpenseRecognitionResponse401 | retryExpenseRecognitionResponse402 | retryExpenseRecognitionResponse403 | retryExpenseRecognitionResponse404 | retryExpenseRecognitionResponse409 | retryExpenseRecognitionResponse422 | retryExpenseRecognitionResponse500 | retryExpenseRecognitionResponse503) & {
|
|
455
481
|
headers: Headers;
|
|
456
482
|
};
|
|
457
483
|
export type retryExpenseRecognitionResponse = (retryExpenseRecognitionResponseSuccess | retryExpenseRecognitionResponseError);
|
|
@@ -951,11 +951,13 @@ export declare const BackfillExpenseRecognitionResponse: zod.ZodObject<{
|
|
|
951
951
|
next_cursor: zod.ZodNullable<zod.ZodString>;
|
|
952
952
|
}, zod.z.core.$strip>;
|
|
953
953
|
/**
|
|
954
|
-
*
|
|
954
|
+
* Automatic expense recognition supports PDFs up to 8 pages. Split a larger PDF into smaller documents before trying again.
|
|
955
|
+
|
|
956
|
+
Accepts one supplier invoice (PDF, JPEG, PNG, or WebP), creates an invoice-only draft expense with `creation_source=ocr`, and enqueues an async recognition job. For sandbox entities, no provider is called and no usage is charged: the submitted file is not stored and is replaced by a clearly marked deterministic demo invoice; the response exposes `simulation_mode=sandbox_demo`.
|
|
955
957
|
|
|
956
958
|
Returns **202 Accepted** with the job, expense, and file identifiers. Recognition is asynchronous in live mode; poll `GET /expenses/recognitions/{id}` for status. Terminal success is `ready_for_review` or `needs_attention`; terminal failure is `failed`, with safe `error_code` and `error_message` fields.
|
|
957
959
|
|
|
958
|
-
Parsed document and line amounts are checked against the standard expense calculation before applying extraction. A disagreement keeps the draft unchanged and stores the extraction with `needs_attention` for review.
|
|
960
|
+
Parsed document and line amounts are checked against the standard expense calculation before applying extraction. A disagreement keeps the draft unchanged and stores the extraction with `needs_attention` for review. Critical identity, required-field, confidence, document-type, and questionable financial warnings also require review and prevent unsafe automatic application.
|
|
959
961
|
|
|
960
962
|
Payment suggestions from OCR are advisory only and never mark the expense paid or create payments. Failed provider attempts record zero customer usage. Automatic provider attempts and a permitted customer retry share the same job; billable customer usage is recorded once only after a successful terminal result.
|
|
961
963
|
|
|
@@ -951,11 +951,13 @@ export declare const BackfillExpenseRecognitionResponse: zod.ZodObject<{
|
|
|
951
951
|
next_cursor: zod.ZodNullable<zod.ZodString>;
|
|
952
952
|
}, zod.z.core.$strip>;
|
|
953
953
|
/**
|
|
954
|
-
*
|
|
954
|
+
* Automatic expense recognition supports PDFs up to 8 pages. Split a larger PDF into smaller documents before trying again.
|
|
955
|
+
|
|
956
|
+
Accepts one supplier invoice (PDF, JPEG, PNG, or WebP), creates an invoice-only draft expense with `creation_source=ocr`, and enqueues an async recognition job. For sandbox entities, no provider is called and no usage is charged: the submitted file is not stored and is replaced by a clearly marked deterministic demo invoice; the response exposes `simulation_mode=sandbox_demo`.
|
|
955
957
|
|
|
956
958
|
Returns **202 Accepted** with the job, expense, and file identifiers. Recognition is asynchronous in live mode; poll `GET /expenses/recognitions/{id}` for status. Terminal success is `ready_for_review` or `needs_attention`; terminal failure is `failed`, with safe `error_code` and `error_message` fields.
|
|
957
959
|
|
|
958
|
-
Parsed document and line amounts are checked against the standard expense calculation before applying extraction. A disagreement keeps the draft unchanged and stores the extraction with `needs_attention` for review.
|
|
960
|
+
Parsed document and line amounts are checked against the standard expense calculation before applying extraction. A disagreement keeps the draft unchanged and stores the extraction with `needs_attention` for review. Critical identity, required-field, confidence, document-type, and questionable financial warnings also require review and prevent unsafe automatic application.
|
|
959
961
|
|
|
960
962
|
Payment suggestions from OCR are advisory only and never mark the expense paid or create payments. Failed provider attempts record zero customer usage. Automatic provider attempts and a permitted customer retry share the same job; billable customer usage is recorded once only after a successful terminal result.
|
|
961
963
|
|
package/package.json
CHANGED