@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.
@@ -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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decodo/sdk-ts",
3
- "version": "3.1.0",
3
+ "version": "4.1.0",
4
4
  "description": "Official TypeScript SDK for the Decodo APIs",
5
5
  "license": "MIT",
6
6
  "repository": {