@openfn/language-mssql 4.2.3 → 4.3.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
@@ -666,6 +666,59 @@
666
666
  },
667
667
  "valid": true
668
668
  },
669
+ {
670
+ "name": "fnIf",
671
+ "params": [
672
+ "condition",
673
+ "operation"
674
+ ],
675
+ "docs": {
676
+ "description": "A custom operation that will only execute the function if the condition returns true",
677
+ "tags": [
678
+ {
679
+ "title": "public",
680
+ "description": null,
681
+ "type": null
682
+ },
683
+ {
684
+ "title": "example",
685
+ "description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
686
+ },
687
+ {
688
+ "title": "function",
689
+ "description": null,
690
+ "name": null
691
+ },
692
+ {
693
+ "title": "param",
694
+ "description": "The condition that returns true",
695
+ "type": {
696
+ "type": "NameExpression",
697
+ "name": "Boolean"
698
+ },
699
+ "name": "condition"
700
+ },
701
+ {
702
+ "title": "param",
703
+ "description": "The operation needed to be executed.",
704
+ "type": {
705
+ "type": "NameExpression",
706
+ "name": "Operation"
707
+ },
708
+ "name": "operation"
709
+ },
710
+ {
711
+ "title": "returns",
712
+ "description": null,
713
+ "type": {
714
+ "type": "NameExpression",
715
+ "name": "Operation"
716
+ }
717
+ }
718
+ ]
719
+ },
720
+ "valid": true
721
+ },
669
722
  {
670
723
  "name": "sourceValue",
671
724
  "params": [
@@ -1090,7 +1143,7 @@
1090
1143
  "options"
1091
1144
  ],
1092
1145
  "docs": {
1093
- "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}",
1146
+ "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}",
1094
1147
  "tags": [
1095
1148
  {
1096
1149
  "title": "public",
package/dist/index.cjs CHANGED
@@ -33,6 +33,7 @@ __export(src_exports, {
33
33
  fields: () => import_language_common2.fields,
34
34
  findValue: () => findValue,
35
35
  fn: () => import_language_common2.fn,
36
+ fnIf: () => import_language_common2.fnIf,
36
37
  http: () => import_language_common2.http,
37
38
  insert: () => insert,
38
39
  insertMany: () => insertMany,
@@ -64,6 +65,7 @@ __export(Adaptor_exports, {
64
65
  fields: () => import_language_common2.fields,
65
66
  findValue: () => findValue,
66
67
  fn: () => import_language_common2.fn,
68
+ fnIf: () => import_language_common2.fnIf,
67
69
  http: () => import_language_common2.http,
68
70
  insert: () => insert,
69
71
  insertMany: () => insertMany,
@@ -570,6 +572,7 @@ var src_default = Adaptor_exports;
570
572
  fields,
571
573
  findValue,
572
574
  fn,
575
+ fnIf,
573
576
  http,
574
577
  insert,
575
578
  insertMany,
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ __export(Adaptor_exports, {
20
20
  fields: () => fields,
21
21
  findValue: () => findValue,
22
22
  fn: () => fn,
23
+ fnIf: () => fnIf,
23
24
  http: () => http,
24
25
  insert: () => insert,
25
26
  insertMany: () => insertMany,
@@ -48,6 +49,7 @@ import {
48
49
  field,
49
50
  fields,
50
51
  fn,
52
+ fnIf,
51
53
  http,
52
54
  lastReferenceValue,
53
55
  cursor,
@@ -544,6 +546,7 @@ export {
544
546
  fields,
545
547
  findValue,
546
548
  fn,
549
+ fnIf,
547
550
  http,
548
551
  insert,
549
552
  insertMany,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-mssql",
3
- "version": "4.2.3",
3
+ "version": "4.3.0",
4
4
  "description": "A Microsoft SQL language pack for OpenFn",
5
5
  "exports": {
6
6
  ".": {
@@ -23,7 +23,7 @@
23
23
  "configuration-schema.json"
24
24
  ],
25
25
  "dependencies": {
26
- "@openfn/language-common": "1.13.4",
26
+ "@openfn/language-common": "1.14.0",
27
27
  "tedious": "15.1.0"
28
28
  },
29
29
  "devDependencies": {
@@ -161,4 +161,4 @@ export function insertTable(tableName: string, columns: any[], options: object):
161
161
  * @returns {Operation}
162
162
  */
163
163
  export function modifyTable(tableName: string, columns: any[], options: object): Operation;
164
- export { alterState, combine, dataPath, dataValue, dateFns, each, field, fields, fn, http, lastReferenceValue, cursor, merge, sourceValue } from "@openfn/language-common";
164
+ export { alterState, combine, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, http, lastReferenceValue, cursor, merge, sourceValue } from "@openfn/language-common";