@openfn/language-http 5.1.1 → 6.0.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/ast.json CHANGED
@@ -1,5 +1,78 @@
1
1
  {
2
2
  "operations": [
3
+ {
4
+ "name": "request",
5
+ "params": [
6
+ "method",
7
+ "path",
8
+ "params",
9
+ "callback"
10
+ ],
11
+ "docs": {
12
+ "description": "Make a HTTP request",
13
+ "tags": [
14
+ {
15
+ "title": "public",
16
+ "description": null,
17
+ "type": null
18
+ },
19
+ {
20
+ "title": "example",
21
+ "description": "request(\n 'GET',\n '/myEndpoint',\n {\n query: {foo: 'bar', a: 1},\n headers: {'content-type': 'application/json'},\n }\n)"
22
+ },
23
+ {
24
+ "title": "function",
25
+ "description": null,
26
+ "name": null
27
+ },
28
+ {
29
+ "title": "param",
30
+ "description": "The HTTP method to use",
31
+ "type": {
32
+ "type": "NameExpression",
33
+ "name": "string"
34
+ },
35
+ "name": "method"
36
+ },
37
+ {
38
+ "title": "param",
39
+ "description": "Path to resource",
40
+ "type": {
41
+ "type": "NameExpression",
42
+ "name": "string"
43
+ },
44
+ "name": "path"
45
+ },
46
+ {
47
+ "title": "param",
48
+ "description": "Query, Headers and Authentication parameters",
49
+ "type": {
50
+ "type": "NameExpression",
51
+ "name": "RequestOptions"
52
+ },
53
+ "name": "params"
54
+ },
55
+ {
56
+ "title": "param",
57
+ "description": "(Optional) Callback function",
58
+ "type": {
59
+ "type": "NameExpression",
60
+ "name": "function"
61
+ },
62
+ "name": "callback"
63
+ },
64
+ {
65
+ "title": "returns",
66
+ "description": null,
67
+ "type": {
68
+ "type": "NameExpression",
69
+ "name": "Operation"
70
+ }
71
+ }
72
+ ]
73
+ },
74
+ "valid": true
75
+ },
3
76
  {
4
77
  "name": "get",
5
78
  "params": [
@@ -17,7 +90,7 @@
17
90
  },
18
91
  {
19
92
  "title": "example",
20
- "description": "get('/myEndpoint', {\n query: {foo: 'bar', a: 1},\n headers: {'content-type': 'application/json'},\n authentication: {username: 'user', password: 'pass'}\n })"
93
+ "description": "get('/myEndpoint', {\n query: {foo: 'bar', a: 1},\n headers: {'content-type': 'application/json'},\n})"
21
94
  },
22
95
  {
23
96
  "title": "function",
@@ -38,7 +111,7 @@
38
111
  "description": "Query, Headers and Authentication parameters",
39
112
  "type": {
40
113
  "type": "NameExpression",
41
- "name": "object"
114
+ "name": "RequestOptions"
42
115
  },
43
116
  "name": "params"
44
117
  },
@@ -80,7 +153,7 @@
80
153
  },
81
154
  {
82
155
  "title": "example",
83
- "description": "post('/myEndpoint', {\n body: {'foo': 'bar'},\n headers: {'content-type': 'application/json'},\n authentication: {username: 'user', password: 'pass'}\n })"
156
+ "description": "post('/myEndpoint', {\n body: {'foo': 'bar'},\n headers: {'content-type': 'application/json'},\n })"
84
157
  },
85
158
  {
86
159
  "title": "function",
@@ -101,7 +174,7 @@
101
174
  "description": "Body, Query, Headers and Authentication parameters",
102
175
  "type": {
103
176
  "type": "NameExpression",
104
- "name": "object"
177
+ "name": "RequestOptions"
105
178
  },
106
179
  "name": "params"
107
180
  },
@@ -143,7 +216,7 @@
143
216
  },
144
217
  {
145
218
  "title": "example",
146
- "description": "put('/myEndpoint', {\n body: {'foo': 'bar'},\n headers: {'content-type': 'application/json'},\n authentication: {username: 'user', password: 'pass'}\n })"
219
+ "description": "put('/myEndpoint', {\n body: {'foo': 'bar'},\n headers: {'content-type': 'application/json'},\n })"
147
220
  },
148
221
  {
149
222
  "title": "function",
@@ -164,7 +237,7 @@
164
237
  "description": "Body, Query, Headers and Auth parameters",
165
238
  "type": {
166
239
  "type": "NameExpression",
167
- "name": "object"
240
+ "name": "RequestOptions"
168
241
  },
169
242
  "name": "params"
170
243
  },
@@ -206,7 +279,7 @@
206
279
  },
207
280
  {
208
281
  "title": "example",
209
- "description": "patch('/myEndpoint', {\n body: {'foo': 'bar'},\n headers: {'content-type': 'application/json'},\n authentication: {username: 'user', password: 'pass'}\n })"
282
+ "description": "patch('/myEndpoint', {\n body: {'foo': 'bar'},\n headers: {'content-type': 'application/json'},\n })"
210
283
  },
211
284
  {
212
285
  "title": "function",
@@ -227,7 +300,7 @@
227
300
  "description": "Body, Query, Headers and Auth parameters",
228
301
  "type": {
229
302
  "type": "NameExpression",
230
- "name": "object"
303
+ "name": "RequestOptions"
231
304
  },
232
305
  "name": "params"
233
306
  },
@@ -290,7 +363,7 @@
290
363
  "description": "Body, Query, Headers and Auth parameters",
291
364
  "type": {
292
365
  "type": "NameExpression",
293
- "name": "object"
366
+ "name": "RequestOptions"
294
367
  },
295
368
  "name": "params"
296
369
  },
@@ -1090,6 +1163,59 @@
1090
1163
  },
1091
1164
  "valid": true
1092
1165
  },
1166
+ {
1167
+ "name": "chunk",
1168
+ "params": [
1169
+ "array",
1170
+ "chunkSize"
1171
+ ],
1172
+ "docs": {
1173
+ "description": "Chunks an array into an array of arrays, each with no more than a certain size.",
1174
+ "tags": [
1175
+ {
1176
+ "title": "public",
1177
+ "description": null,
1178
+ "type": null
1179
+ },
1180
+ {
1181
+ "title": "example",
1182
+ "description": "chunk([1,2,3,4,5], 2)"
1183
+ },
1184
+ {
1185
+ "title": "function",
1186
+ "description": null,
1187
+ "name": null
1188
+ },
1189
+ {
1190
+ "title": "param",
1191
+ "description": "Array to be chunked",
1192
+ "type": {
1193
+ "type": "NameExpression",
1194
+ "name": "Object"
1195
+ },
1196
+ "name": "array"
1197
+ },
1198
+ {
1199
+ "title": "param",
1200
+ "description": "The maxiumum size of each chunks",
1201
+ "type": {
1202
+ "type": "NameExpression",
1203
+ "name": "Integer"
1204
+ },
1205
+ "name": "chunkSize"
1206
+ },
1207
+ {
1208
+ "title": "returns",
1209
+ "description": null,
1210
+ "type": {
1211
+ "type": "NameExpression",
1212
+ "name": "Object"
1213
+ }
1214
+ }
1215
+ ]
1216
+ },
1217
+ "valid": true
1218
+ },
1093
1219
  {
1094
1220
  "name": "parseCsv",
1095
1221
  "params": [