@decodo/sdk-ts 3.1.0 → 4.1.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 +56 -6
- package/build/cjs/index.cjs +5531 -261
- package/build/cjs/index.d.cts +179 -30
- package/build/esm/api/flows.d.ts +52 -0
- package/build/esm/api/flows.js +301 -0
- package/build/esm/api/limits.d.ts +6 -0
- package/build/esm/api/limits.js +36 -0
- package/build/esm/api/results.d.ts +2 -0
- package/build/esm/api/results.js +87 -0
- package/build/esm/api/tools.d.ts +6 -0
- package/build/esm/api/tools.js +185 -0
- package/build/esm/api/web-scraping-api.d.ts +2 -0
- package/build/esm/api/web-scraping-api.js +3 -0
- package/build/esm/errors.d.ts +10 -0
- package/build/esm/errors.js +20 -0
- package/build/esm/generated/data-api.d.ts +4 -0
- package/build/esm/generated/flows.d.ts +3 -0
- package/build/esm/generated/flows.js +4633 -0
- package/build/esm/generated/parameters.js +1 -1
- package/build/esm/generated/request-schemas.d.ts +3 -72
- package/build/esm/generated/request-schemas.js +3 -81
- package/build/esm/generated/targets.d.ts +2 -26
- package/build/esm/generated/targets.js +2 -20
- package/build/esm/index.d.ts +8 -2
- package/build/esm/index.js +5 -1
- package/build/esm/schema/bundled-schema.d.ts +7 -2
- package/build/esm/schema/bundled-schema.js +14 -0
- package/build/esm/schema/remote-schema.d.ts +7 -2
- package/build/esm/schema/remote-schema.js +75 -14
- package/build/esm/schema/types.d.ts +95 -1
- package/package.json +1 -1
|
@@ -11,6 +11,93 @@ export type IrTarget = {
|
|
|
11
11
|
response_format: string;
|
|
12
12
|
parameter_schema: JSONSchema4;
|
|
13
13
|
};
|
|
14
|
+
export type IrOperation = {
|
|
15
|
+
method: string;
|
|
16
|
+
path: string;
|
|
17
|
+
requestSchema?: JSONSchema4;
|
|
18
|
+
};
|
|
19
|
+
export type IrCallFlow = {
|
|
20
|
+
pattern: 'call';
|
|
21
|
+
run: string;
|
|
22
|
+
};
|
|
23
|
+
export type IrJobFlow = {
|
|
24
|
+
pattern: 'job';
|
|
25
|
+
start: string;
|
|
26
|
+
status: string;
|
|
27
|
+
results: string;
|
|
28
|
+
cancel?: string;
|
|
29
|
+
idField: string;
|
|
30
|
+
statusField: string;
|
|
31
|
+
pendingStatuses: string[];
|
|
32
|
+
failedStatuses: string[];
|
|
33
|
+
resultsQuery?: Record<string, string>;
|
|
34
|
+
pagination?: {
|
|
35
|
+
itemsField: string;
|
|
36
|
+
nextUrlField: string;
|
|
37
|
+
};
|
|
38
|
+
pollSeconds?: number;
|
|
39
|
+
};
|
|
40
|
+
export type IrBatchFlow = {
|
|
41
|
+
pattern: 'batch';
|
|
42
|
+
start: string;
|
|
43
|
+
itemsField: string;
|
|
44
|
+
job: string;
|
|
45
|
+
};
|
|
46
|
+
export type IrFlow = IrCallFlow | IrJobFlow | IrBatchFlow;
|
|
47
|
+
export type IrKeyCheck = {
|
|
48
|
+
flow: string;
|
|
49
|
+
params: Record<string, unknown>;
|
|
50
|
+
};
|
|
51
|
+
export type IrResultFailure = {
|
|
52
|
+
path: string;
|
|
53
|
+
equals?: string | number | boolean;
|
|
54
|
+
atLeast?: number;
|
|
55
|
+
message?: string;
|
|
56
|
+
code?: string;
|
|
57
|
+
retryable?: true;
|
|
58
|
+
};
|
|
59
|
+
export type IrResult = {
|
|
60
|
+
failures?: IrResultFailure[];
|
|
61
|
+
from?: string;
|
|
62
|
+
fields?: Record<string, string>;
|
|
63
|
+
omit?: string[];
|
|
64
|
+
required?: string[];
|
|
65
|
+
};
|
|
66
|
+
export type IrSurfaceLimits = {
|
|
67
|
+
maxResultChars?: number;
|
|
68
|
+
maxTextChars?: number;
|
|
69
|
+
maxItems?: number;
|
|
70
|
+
maxListValues?: number;
|
|
71
|
+
waitSeconds?: number;
|
|
72
|
+
};
|
|
73
|
+
export type IrSurfaceTool = {
|
|
74
|
+
name: string;
|
|
75
|
+
title?: string;
|
|
76
|
+
description: string;
|
|
77
|
+
group?: string;
|
|
78
|
+
flow: string;
|
|
79
|
+
step?: 'start' | 'status' | 'results' | 'cancel';
|
|
80
|
+
result?: IrResult;
|
|
81
|
+
limits?: IrSurfaceLimits;
|
|
82
|
+
target?: string;
|
|
83
|
+
fields?: string[];
|
|
84
|
+
required?: string[];
|
|
85
|
+
fixed?: Record<string, unknown>;
|
|
86
|
+
defaults?: Record<string, unknown>;
|
|
87
|
+
choices?: Record<string, Array<string | number | boolean>>;
|
|
88
|
+
maximums?: Record<string, number>;
|
|
89
|
+
minimums?: Record<string, number>;
|
|
90
|
+
descriptions?: Record<string, string>;
|
|
91
|
+
};
|
|
92
|
+
export type IrSurface = {
|
|
93
|
+
tools: IrSurfaceTool[];
|
|
94
|
+
};
|
|
95
|
+
export type IrFlowSections = {
|
|
96
|
+
operations: Record<string, IrOperation>;
|
|
97
|
+
flows: Record<string, IrFlow>;
|
|
98
|
+
surfaces: Record<string, IrSurface>;
|
|
99
|
+
keyCheck?: IrKeyCheck;
|
|
100
|
+
};
|
|
14
101
|
export type RemoteIr = {
|
|
15
102
|
version: string;
|
|
16
103
|
apis: {
|
|
@@ -19,10 +106,11 @@ export type RemoteIr = {
|
|
|
19
106
|
targets: Record<string, IrTarget>;
|
|
20
107
|
};
|
|
21
108
|
};
|
|
22
|
-
}
|
|
109
|
+
} & Partial<IrFlowSections>;
|
|
23
110
|
export type CachedIr = {
|
|
24
111
|
fetchedAt: number;
|
|
25
112
|
resolvedUrl: string;
|
|
113
|
+
latest?: boolean;
|
|
26
114
|
ir: RemoteIr;
|
|
27
115
|
};
|
|
28
116
|
export type GcsObjectList = {
|
|
@@ -42,3 +130,9 @@ export type DecodoSchema = {
|
|
|
42
130
|
getSharedParameters: () => Record<string, unknown>;
|
|
43
131
|
readonly version?: string;
|
|
44
132
|
};
|
|
133
|
+
export type FlowSchema = DecodoSchema & {
|
|
134
|
+
getOperation: (operation: string) => IrOperation | undefined;
|
|
135
|
+
getFlow: (flow: string) => IrFlow | undefined;
|
|
136
|
+
getSurface: (client: string) => IrSurface | undefined;
|
|
137
|
+
getKeyCheck: () => IrKeyCheck | undefined;
|
|
138
|
+
};
|