@openfn/language-googlehealthcare 1.0.1 → 1.1.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
@@ -119,23 +119,76 @@
119
119
  "description": null,
120
120
  "type": null
121
121
  },
122
+ {
123
+ "title": "function",
124
+ "description": null,
125
+ "name": null
126
+ },
122
127
  {
123
128
  "title": "example",
124
129
  "description": "fn(state => {\n // do some things to state\n return state;\n});"
125
130
  },
131
+ {
132
+ "title": "param",
133
+ "description": "is the function",
134
+ "type": {
135
+ "type": "NameExpression",
136
+ "name": "Function"
137
+ },
138
+ "name": "func"
139
+ },
140
+ {
141
+ "title": "returns",
142
+ "description": null,
143
+ "type": {
144
+ "type": "NameExpression",
145
+ "name": "Operation"
146
+ }
147
+ }
148
+ ]
149
+ },
150
+ "valid": true
151
+ },
152
+ {
153
+ "name": "fnIf",
154
+ "params": [
155
+ "condition",
156
+ "operation"
157
+ ],
158
+ "docs": {
159
+ "description": "A custom operation that will only execute the function if the condition returns true",
160
+ "tags": [
161
+ {
162
+ "title": "public",
163
+ "description": null,
164
+ "type": null
165
+ },
126
166
  {
127
167
  "title": "function",
128
168
  "description": null,
129
169
  "name": null
130
170
  },
171
+ {
172
+ "title": "example",
173
+ "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
174
+ },
131
175
  {
132
176
  "title": "param",
133
- "description": "is the function",
177
+ "description": "The condition that returns true",
134
178
  "type": {
135
179
  "type": "NameExpression",
136
- "name": "Function"
180
+ "name": "Boolean"
137
181
  },
138
- "name": "func"
182
+ "name": "condition"
183
+ },
184
+ {
185
+ "title": "param",
186
+ "description": "The operation needed to be executed.",
187
+ "type": {
188
+ "type": "NameExpression",
189
+ "name": "Operation"
190
+ },
191
+ "name": "operation"
139
192
  },
140
193
  {
141
194
  "title": "returns",
@@ -162,15 +215,15 @@
162
215
  "description": null,
163
216
  "type": null
164
217
  },
165
- {
166
- "title": "example",
167
- "description": "sourceValue('$.key')"
168
- },
169
218
  {
170
219
  "title": "function",
171
220
  "description": null,
172
221
  "name": null
173
222
  },
223
+ {
224
+ "title": "example",
225
+ "description": "sourceValue('$.key')"
226
+ },
174
227
  {
175
228
  "title": "param",
176
229
  "description": "JSONPath referencing a point in `state`.",
@@ -205,15 +258,15 @@
205
258
  "description": null,
206
259
  "type": null
207
260
  },
208
- {
209
- "title": "example",
210
- "description": "dataPath('key')"
211
- },
212
261
  {
213
262
  "title": "function",
214
263
  "description": null,
215
264
  "name": null
216
265
  },
266
+ {
267
+ "title": "example",
268
+ "description": "dataPath('key')"
269
+ },
217
270
  {
218
271
  "title": "param",
219
272
  "description": "JSONPath referencing a point in `data`.",
@@ -248,15 +301,15 @@
248
301
  "description": null,
249
302
  "type": null
250
303
  },
251
- {
252
- "title": "example",
253
- "description": "dataValue('key')"
254
- },
255
304
  {
256
305
  "title": "function",
257
306
  "description": null,
258
307
  "name": null
259
308
  },
309
+ {
310
+ "title": "example",
311
+ "description": "dataValue('key')"
312
+ },
260
313
  {
261
314
  "title": "param",
262
315
  "description": "JSONPath referencing a point in `data`.",
@@ -291,15 +344,15 @@
291
344
  "description": null,
292
345
  "type": null
293
346
  },
294
- {
295
- "title": "example",
296
- "description": "lastReferenceValue('key')"
297
- },
298
347
  {
299
348
  "title": "function",
300
349
  "description": null,
301
350
  "name": null
302
351
  },
352
+ {
353
+ "title": "example",
354
+ "description": "lastReferenceValue('key')"
355
+ },
303
356
  {
304
357
  "title": "param",
305
358
  "description": "JSONPath referencing a point in `references`.",
@@ -335,15 +388,15 @@
335
388
  "description": null,
336
389
  "type": null
337
390
  },
338
- {
339
- "title": "example",
340
- "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
341
- },
342
391
  {
343
392
  "title": "function",
344
393
  "description": null,
345
394
  "name": null
346
395
  },
396
+ {
397
+ "title": "example",
398
+ "description": "each(\"$.[*]\",\n create(\"SObject\",\n field(\"FirstName\", sourceValue(\"$.firstName\"))\n )\n)"
399
+ },
347
400
  {
348
401
  "title": "param",
349
402
  "description": "JSONPath referencing a point in `state`.",
@@ -388,15 +441,15 @@
388
441
  "description": null,
389
442
  "type": null
390
443
  },
391
- {
392
- "title": "example",
393
- "description": "field('destination_field_name__c', 'value')"
394
- },
395
444
  {
396
445
  "title": "function",
397
446
  "description": null,
398
447
  "name": null
399
448
  },
449
+ {
450
+ "title": "example",
451
+ "description": "field('destination_field_name__c', 'value')"
452
+ },
400
453
  {
401
454
  "title": "param",
402
455
  "description": "Name of the field",
@@ -440,15 +493,15 @@
440
493
  "description": null,
441
494
  "type": null
442
495
  },
443
- {
444
- "title": "example",
445
- "description": "fields(list_of_fields)"
446
- },
447
496
  {
448
497
  "title": "function",
449
498
  "description": null,
450
499
  "name": null
451
500
  },
501
+ {
502
+ "title": "example",
503
+ "description": "fields(list_of_fields)"
504
+ },
452
505
  {
453
506
  "title": "param",
454
507
  "description": "a list of fields",
@@ -493,6 +546,11 @@
493
546
  "description": null,
494
547
  "name": null
495
548
  },
549
+ {
550
+ "title": "public",
551
+ "description": null,
552
+ "type": null
553
+ },
496
554
  {
497
555
  "title": "param",
498
556
  "description": null,
package/dist/index.cjs CHANGED
@@ -29,6 +29,7 @@ __export(src_exports, {
29
29
  field: () => import_language_common2.field,
30
30
  fields: () => import_language_common2.fields,
31
31
  fn: () => import_language_common2.fn,
32
+ fnIf: () => import_language_common2.fnIf,
32
33
  lastReferenceValue: () => import_language_common2.lastReferenceValue,
33
34
  merge: () => import_language_common2.merge,
34
35
  request: () => request,
@@ -48,6 +49,7 @@ __export(Adaptor_exports, {
48
49
  field: () => import_language_common2.field,
49
50
  fields: () => import_language_common2.fields,
50
51
  fn: () => import_language_common2.fn,
52
+ fnIf: () => import_language_common2.fnIf,
51
53
  lastReferenceValue: () => import_language_common2.lastReferenceValue,
52
54
  merge: () => import_language_common2.merge,
53
55
  request: () => request,
@@ -194,6 +196,7 @@ var src_default = Adaptor_exports;
194
196
  field,
195
197
  fields,
196
198
  fn,
199
+ fnIf,
197
200
  lastReferenceValue,
198
201
  merge,
199
202
  request,
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ __export(Adaptor_exports, {
16
16
  field: () => field,
17
17
  fields: () => fields,
18
18
  fn: () => fn,
19
+ fnIf: () => fnIf,
19
20
  lastReferenceValue: () => lastReferenceValue,
20
21
  merge: () => merge,
21
22
  request: () => request,
@@ -102,6 +103,7 @@ import {
102
103
  field,
103
104
  fields,
104
105
  fn,
106
+ fnIf,
105
107
  lastReferenceValue,
106
108
  merge,
107
109
  sourceValue
@@ -179,6 +181,7 @@ export {
179
181
  field,
180
182
  fields,
181
183
  fn,
184
+ fnIf,
182
185
  lastReferenceValue,
183
186
  merge,
184
187
  request,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-googlehealthcare",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "A Google Health Care language package for use with Open Function",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "configuration-schema.json"
20
20
  ],
21
21
  "dependencies": {
22
- "@openfn/language-common": "^1.13.2"
22
+ "@openfn/language-common": "^2.0.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@openfn/simple-ast": "0.4.1",
@@ -73,4 +73,4 @@ export function createFhirResource(fhirStore?: {
73
73
  fhirStoreId: string;
74
74
  }, resource: object, callback: Function): Operation;
75
75
  export { request } from "./Utils";
76
- export { dataPath, dataValue, dateFns, each, field, fields, fn, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
76
+ export { dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";