@docmana/sdk 0.4.0 → 0.9.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/dist/types.d.ts CHANGED
@@ -25,11 +25,19 @@ export interface TokenCache {
25
25
  export interface PathFileInput {
26
26
  path: string;
27
27
  }
28
- export type FileInput = string | PathFileInput | Uint8Array | NodeJS.ReadableStream;
29
- export interface RunFlowInput {
30
- file?: FileInput;
31
- files?: FileInput[];
32
- fileName?: string;
28
+ export interface NamedFileInput {
29
+ data: Uint8Array | NodeJS.ReadableStream;
30
+ filename: string;
31
+ contentType?: string;
32
+ }
33
+ export type FileInput = string | PathFileInput | NamedFileInput;
34
+ export interface RunFlowParams {
35
+ files: FileInput[];
36
+ useDraftVersion?: boolean;
37
+ language?: string;
38
+ context?: Record<string, unknown>;
39
+ }
40
+ export interface RunFlowOptions {
33
41
  signal?: AbortSignal;
34
42
  timeoutMs?: number;
35
43
  pollIntervalMs?: number;
@@ -47,20 +55,81 @@ export interface RunFlowInput {
47
55
  elapsedMs: number;
48
56
  retryAfterMs: number;
49
57
  }) => void;
50
- useDraftVersion?: boolean;
51
- language?: string;
52
- context?: Record<string, unknown>;
53
58
  }
54
- export interface RunFlowWithCallbackInput {
55
- file?: FileInput;
56
- files?: FileInput[];
57
- fileName?: string;
59
+ export interface RunFlowAsyncOptions {
58
60
  signal?: AbortSignal;
59
- useDraftVersion?: boolean;
60
- language?: string;
61
- context?: Record<string, unknown>;
62
- /** URL Consumer will POST the completion result to (wire: `callback_url`). */
63
- callbackUrl: string;
61
+ }
62
+ export interface RunFlowAsyncParams extends RunFlowParams {
63
+ /** URL Consumer will POST the completion result to (wire: `callbackUrl`). */
64
+ callbackUrl?: string;
65
+ }
66
+ export interface FlowListItem {
67
+ id: string;
68
+ name: string;
69
+ state: string;
70
+ }
71
+ export interface AccessibleOrganization {
72
+ id: string;
73
+ name: string;
74
+ }
75
+ export interface OrganizationDocument {
76
+ path: string;
77
+ name: string;
78
+ size: number;
79
+ lastModified: string;
80
+ contentType?: string;
81
+ }
82
+ export interface OrganizationDocumentsPayload {
83
+ configured: boolean;
84
+ documents: OrganizationDocument[];
85
+ }
86
+ export interface DownloadedOrganizationDocument {
87
+ bytes: Uint8Array;
88
+ filename: string;
89
+ contentType?: string;
90
+ }
91
+ export interface FlowDocumentRequirement {
92
+ docId: string;
93
+ label: string;
94
+ required: boolean;
95
+ }
96
+ export interface FlowMetadata {
97
+ flowId: string;
98
+ name?: string;
99
+ contextSchema: Record<string, unknown>;
100
+ languages: string[];
101
+ minScore?: number;
102
+ documents: FlowDocumentRequirement[];
103
+ }
104
+ export interface FlowDefinitionField {
105
+ fieldKey: string;
106
+ path: string;
107
+ type?: string;
108
+ }
109
+ export interface FlowDefinitionNodeMetadata {
110
+ title?: string;
111
+ uniqueName?: string;
112
+ assessmentType?: string;
113
+ scoreAssessment: boolean;
114
+ scoreAcceptanceThreshold?: number;
115
+ description?: string;
116
+ enabled?: boolean;
117
+ }
118
+ export interface FlowDefinitionNode {
119
+ nodeId: string;
120
+ type: string;
121
+ label: string;
122
+ uniqueName?: string;
123
+ parentId?: string;
124
+ fields: FlowDefinitionField[];
125
+ metadata?: FlowDefinitionNodeMetadata;
126
+ }
127
+ export interface FlowDefinition {
128
+ flowId: string;
129
+ name?: string;
130
+ languages: string[];
131
+ minScore?: number;
132
+ nodes: FlowDefinitionNode[];
64
133
  }
65
134
  export type { DocmanaExecutionResult } from "./models/docmana-execution-result.model.js";
66
135
  export type { DocmanaDocumentMapping } from "./models/docmana-document-mapping.model.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docmana/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.9.0",
4
4
  "description": "Official Docmana SDK — run document-analysis flows with a single call.",
5
5
  "license": "MIT",
6
6
  "type": "module",