@openfn/language-hive 0.2.1 → 0.3.1

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
@@ -80,23 +80,76 @@
80
80
  "description": null,
81
81
  "type": null
82
82
  },
83
+ {
84
+ "title": "function",
85
+ "description": null,
86
+ "name": null
87
+ },
83
88
  {
84
89
  "title": "example",
85
90
  "description": "fn(state => {\n // do some things to state\n return state;\n});"
86
91
  },
92
+ {
93
+ "title": "param",
94
+ "description": "is the function",
95
+ "type": {
96
+ "type": "NameExpression",
97
+ "name": "Function"
98
+ },
99
+ "name": "func"
100
+ },
101
+ {
102
+ "title": "returns",
103
+ "description": null,
104
+ "type": {
105
+ "type": "NameExpression",
106
+ "name": "Operation"
107
+ }
108
+ }
109
+ ]
110
+ },
111
+ "valid": true
112
+ },
113
+ {
114
+ "name": "fnIf",
115
+ "params": [
116
+ "condition",
117
+ "operation"
118
+ ],
119
+ "docs": {
120
+ "description": "A custom operation that will only execute the function if the condition returns true",
121
+ "tags": [
122
+ {
123
+ "title": "public",
124
+ "description": null,
125
+ "type": null
126
+ },
87
127
  {
88
128
  "title": "function",
89
129
  "description": null,
90
130
  "name": null
91
131
  },
132
+ {
133
+ "title": "example",
134
+ "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
135
+ },
92
136
  {
93
137
  "title": "param",
94
- "description": "is the function",
138
+ "description": "The condition that returns true",
95
139
  "type": {
96
140
  "type": "NameExpression",
97
- "name": "Function"
141
+ "name": "Boolean"
98
142
  },
99
- "name": "func"
143
+ "name": "condition"
144
+ },
145
+ {
146
+ "title": "param",
147
+ "description": "The operation needed to be executed.",
148
+ "type": {
149
+ "type": "NameExpression",
150
+ "name": "Operation"
151
+ },
152
+ "name": "operation"
100
153
  },
101
154
  {
102
155
  "title": "returns",
@@ -123,15 +176,15 @@
123
176
  "description": null,
124
177
  "type": null
125
178
  },
126
- {
127
- "title": "example",
128
- "description": "sourceValue('$.key')"
129
- },
130
179
  {
131
180
  "title": "function",
132
181
  "description": null,
133
182
  "name": null
134
183
  },
184
+ {
185
+ "title": "example",
186
+ "description": "sourceValue('$.key')"
187
+ },
135
188
  {
136
189
  "title": "param",
137
190
  "description": "JSONPath referencing a point in `state`.",
@@ -166,15 +219,15 @@
166
219
  "description": null,
167
220
  "type": null
168
221
  },
169
- {
170
- "title": "example",
171
- "description": "dataPath('key')"
172
- },
173
222
  {
174
223
  "title": "function",
175
224
  "description": null,
176
225
  "name": null
177
226
  },
227
+ {
228
+ "title": "example",
229
+ "description": "dataPath('key')"
230
+ },
178
231
  {
179
232
  "title": "param",
180
233
  "description": "JSONPath referencing a point in `data`.",
@@ -209,15 +262,15 @@
209
262
  "description": null,
210
263
  "type": null
211
264
  },
212
- {
213
- "title": "example",
214
- "description": "dataValue('key')"
215
- },
216
265
  {
217
266
  "title": "function",
218
267
  "description": null,
219
268
  "name": null
220
269
  },
270
+ {
271
+ "title": "example",
272
+ "description": "dataValue('key')"
273
+ },
221
274
  {
222
275
  "title": "param",
223
276
  "description": "JSONPath referencing a point in `data`.",
@@ -252,15 +305,15 @@
252
305
  "description": null,
253
306
  "type": null
254
307
  },
255
- {
256
- "title": "example",
257
- "description": "lastReferenceValue('key')"
258
- },
259
308
  {
260
309
  "title": "function",
261
310
  "description": null,
262
311
  "name": null
263
312
  },
313
+ {
314
+ "title": "example",
315
+ "description": "lastReferenceValue('key')"
316
+ },
264
317
  {
265
318
  "title": "param",
266
319
  "description": "JSONPath referencing a point in `references`.",
@@ -296,15 +349,15 @@
296
349
  "description": null,
297
350
  "type": null
298
351
  },
299
- {
300
- "title": "example",
301
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
302
- },
303
352
  {
304
353
  "title": "function",
305
354
  "description": null,
306
355
  "name": null
307
356
  },
357
+ {
358
+ "title": "example",
359
+ "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
360
+ },
308
361
  {
309
362
  "title": "param",
310
363
  "description": "JSONPath referencing a point in `state`.",
@@ -349,15 +402,15 @@
349
402
  "description": null,
350
403
  "type": null
351
404
  },
352
- {
353
- "title": "example",
354
- "description": "field('destination_field_name__c', 'value')"
355
- },
356
405
  {
357
406
  "title": "function",
358
407
  "description": null,
359
408
  "name": null
360
409
  },
410
+ {
411
+ "title": "example",
412
+ "description": "field('destination_field_name__c', 'value')"
413
+ },
361
414
  {
362
415
  "title": "param",
363
416
  "description": "Name of the field",
@@ -401,15 +454,15 @@
401
454
  "description": null,
402
455
  "type": null
403
456
  },
404
- {
405
- "title": "example",
406
- "description": "fields(list_of_fields)"
407
- },
408
457
  {
409
458
  "title": "function",
410
459
  "description": null,
411
460
  "name": null
412
461
  },
462
+ {
463
+ "title": "example",
464
+ "description": "fields(list_of_fields)"
465
+ },
413
466
  {
414
467
  "title": "param",
415
468
  "description": "a list of fields",
@@ -454,6 +507,11 @@
454
507
  "description": null,
455
508
  "name": null
456
509
  },
510
+ {
511
+ "title": "public",
512
+ "description": null,
513
+ "type": null
514
+ },
457
515
  {
458
516
  "title": "param",
459
517
  "description": null,
package/dist/index.cjs CHANGED
@@ -34,6 +34,7 @@ __export(src_exports, {
34
34
  field: () => import_language_common2.field,
35
35
  fields: () => import_language_common2.fields,
36
36
  fn: () => import_language_common2.fn,
37
+ fnIf: () => import_language_common2.fnIf,
37
38
  lastReferenceValue: () => import_language_common2.lastReferenceValue,
38
39
  merge: () => import_language_common2.merge,
39
40
  parseCsv: () => import_language_common2.parseCsv,
@@ -53,6 +54,7 @@ __export(Adaptor_exports, {
53
54
  field: () => import_language_common2.field,
54
55
  fields: () => import_language_common2.fields,
55
56
  fn: () => import_language_common2.fn,
57
+ fnIf: () => import_language_common2.fnIf,
56
58
  lastReferenceValue: () => import_language_common2.lastReferenceValue,
57
59
  merge: () => import_language_common2.merge,
58
60
  parseCsv: () => import_language_common2.parseCsv,
@@ -145,6 +147,7 @@ var src_default = Adaptor_exports;
145
147
  field,
146
148
  fields,
147
149
  fn,
150
+ fnIf,
148
151
  lastReferenceValue,
149
152
  merge,
150
153
  parseCsv,
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ __export(Adaptor_exports, {
15
15
  field: () => field,
16
16
  fields: () => fields,
17
17
  fn: () => fn,
18
+ fnIf: () => fnIf,
18
19
  lastReferenceValue: () => lastReferenceValue,
19
20
  merge: () => merge,
20
21
  parseCsv: () => parseCsv,
@@ -35,6 +36,7 @@ import {
35
36
  field,
36
37
  fields,
37
38
  fn,
39
+ fnIf,
38
40
  parseCsv,
39
41
  lastReferenceValue,
40
42
  merge,
@@ -122,6 +124,7 @@ export {
122
124
  field,
123
125
  fields,
124
126
  fn,
127
+ fnIf,
125
128
  lastReferenceValue,
126
129
  merge,
127
130
  parseCsv,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-hive",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "An Apache HIVE adaptor for OpenFn",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,8 +19,8 @@
19
19
  "configuration-schema.json"
20
20
  ],
21
21
  "dependencies": {
22
- "@openfn/language-common": "^1.12.0",
23
- "hive-driver": "0.2.0"
22
+ "hive-driver": "0.2.0",
23
+ "@openfn/language-common": "2.0.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@openfn/simple-ast": "0.4.1",
@@ -24,4 +24,4 @@ export function execute(...operations: Operations): Operation;
24
24
  * @returns {Operation}
25
25
  */
26
26
  export function query(qs: string, options: object, callback: Function): Operation;
27
- export { dataPath, dataValue, dateFns, each, field, fields, fn, parseCsv, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
27
+ export { dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, parseCsv, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";