@openfn/language-msgraph 0.5.5 → 0.6.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
@@ -502,6 +502,59 @@
502
502
  },
503
503
  "valid": true
504
504
  },
505
+ {
506
+ "name": "fnIf",
507
+ "params": [
508
+ "condition",
509
+ "operation"
510
+ ],
511
+ "docs": {
512
+ "description": "A custom operation that will only execute the function if the condition returns true",
513
+ "tags": [
514
+ {
515
+ "title": "public",
516
+ "description": null,
517
+ "type": null
518
+ },
519
+ {
520
+ "title": "example",
521
+ "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
522
+ },
523
+ {
524
+ "title": "function",
525
+ "description": null,
526
+ "name": null
527
+ },
528
+ {
529
+ "title": "param",
530
+ "description": "The condition that returns true",
531
+ "type": {
532
+ "type": "NameExpression",
533
+ "name": "Boolean"
534
+ },
535
+ "name": "condition"
536
+ },
537
+ {
538
+ "title": "param",
539
+ "description": "The operation needed to be executed.",
540
+ "type": {
541
+ "type": "NameExpression",
542
+ "name": "Operation"
543
+ },
544
+ "name": "operation"
545
+ },
546
+ {
547
+ "title": "returns",
548
+ "description": null,
549
+ "type": {
550
+ "type": "NameExpression",
551
+ "name": "Operation"
552
+ }
553
+ }
554
+ ]
555
+ },
556
+ "valid": true
557
+ },
505
558
  {
506
559
  "name": "sourceValue",
507
560
  "params": [
@@ -957,7 +1010,7 @@
957
1010
  "options"
958
1011
  ],
959
1012
  "docs": {
960
- "description": "Sets a cursor property on state.\nSupports natural language dates like `now`, `today`, `yesterday`, `n hours ago`, `n days ago`, and `start`,\nwhich will be converted relative to the environment (ie, the Lightning or CLI locale). Custom timezones \nare not yet supported.\nYou can provide a formatter to customise the final cursor value, which is useful for normalising\ndifferent inputs. The custom formatter runs after natural language date conversion.\nSee the usage guide at {@link https://docs.openfn.org/documentation/jobs/job-writing-guide#using-cursors}",
1013
+ "description": "Sets a cursor property on state.\nSupports natural language dates like `now`, `today`, `yesterday`, `n hours ago`, `n days ago`, and `start`,\nwhich will be converted relative to the environment (ie, the Lightning or CLI locale). Custom timezones\nare not yet supported.\nYou can provide a formatter to customise the final cursor value, which is useful for normalising\ndifferent inputs. The custom formatter runs after natural language date conversion.\nSee the usage guide at {@link https://docs.openfn.org/documentation/jobs/job-writing-guide#using-cursors}",
961
1014
  "tags": [
962
1015
  {
963
1016
  "title": "public",
package/dist/index.cjs CHANGED
@@ -36,6 +36,7 @@ __export(src_exports, {
36
36
  field: () => import_language_common3.field,
37
37
  fields: () => import_language_common3.fields,
38
38
  fn: () => import_language_common3.fn,
39
+ fnIf: () => import_language_common3.fnIf,
39
40
  get: () => get,
40
41
  getDrive: () => getDrive,
41
42
  getFile: () => getFile,
@@ -63,6 +64,7 @@ __export(Adaptor_exports, {
63
64
  field: () => import_language_common3.field,
64
65
  fields: () => import_language_common3.fields,
65
66
  fn: () => import_language_common3.fn,
67
+ fnIf: () => import_language_common3.fnIf,
66
68
  get: () => get,
67
69
  getDrive: () => getDrive,
68
70
  getFile: () => getFile,
@@ -424,6 +426,7 @@ var src_default = Adaptor_exports;
424
426
  field,
425
427
  fields,
426
428
  fn,
429
+ fnIf,
427
430
  get,
428
431
  getDrive,
429
432
  getFile,
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ __export(Adaptor_exports, {
17
17
  field: () => field,
18
18
  fields: () => fields,
19
19
  fn: () => fn,
20
+ fnIf: () => fnIf,
20
21
  get: () => get,
21
22
  getDrive: () => getDrive,
22
23
  getFile: () => getFile,
@@ -180,6 +181,7 @@ import {
180
181
  field,
181
182
  fields,
182
183
  fn,
184
+ fnIf,
183
185
  lastReferenceValue,
184
186
  merge,
185
187
  sourceValue,
@@ -391,6 +393,7 @@ export {
391
393
  field,
392
394
  fields,
393
395
  fn,
396
+ fnIf,
394
397
  get,
395
398
  getDrive,
396
399
  getFile,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-msgraph",
3
- "version": "0.5.5",
3
+ "version": "0.6.0",
4
4
  "description": "Microsoft Graph Language Pack for OpenFn",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "undici": "^5.28.4",
23
23
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz",
24
- "@openfn/language-common": "1.13.5"
24
+ "@openfn/language-common": "1.14.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@openfn/simple-ast": "0.4.1",
@@ -121,4 +121,4 @@ export function uploadFile(resource: {
121
121
  onConflict?: string;
122
122
  }, data: any, callback: Function): Operation;
123
123
  export { request, sheetToBuffer } from "./Utils";
124
- export { cursor, dataPath, dataValue, dateFns, each, field, fields, fn, lastReferenceValue, merge, sourceValue, parseCsv } from "@openfn/language-common";
124
+ export { cursor, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, lastReferenceValue, merge, sourceValue, parseCsv } from "@openfn/language-common";