@openfn/language-http 6.3.0 → 6.4.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
@@ -972,6 +972,78 @@
972
972
  },
973
973
  "valid": true
974
974
  },
975
+ {
976
+ "name": "group",
977
+ "params": [
978
+ "arrayOfObjects",
979
+ "keyPath",
980
+ "callback"
981
+ ],
982
+ "docs": {
983
+ "description": "Groups an array of objects by a specified key path.",
984
+ "tags": [
985
+ {
986
+ "title": "public",
987
+ "description": null,
988
+ "type": null
989
+ },
990
+ {
991
+ "title": "example",
992
+ "description": "const users = [\n { name: 'Alice', age: 25, city: 'New York' },\n { name: 'Bob', age: 30, city: 'San Francisco' },\n { name: 'Charlie', age: 25, city: 'New York' },\n { name: 'David', age: 30, city: 'San Francisco' }\n];\ngroup(users, 'city');\n// state is { data: { 'New York': [/Alice, Charlie/], 'San Francisco': [ /Bob, David / ] }"
993
+ },
994
+ {
995
+ "title": "function",
996
+ "description": null,
997
+ "name": null
998
+ },
999
+ {
1000
+ "title": "param",
1001
+ "description": "The array of objects to be grouped.",
1002
+ "type": {
1003
+ "type": "TypeApplication",
1004
+ "expression": {
1005
+ "type": "NameExpression",
1006
+ "name": "Array"
1007
+ },
1008
+ "applications": [
1009
+ {
1010
+ "type": "NameExpression",
1011
+ "name": "Object"
1012
+ }
1013
+ ]
1014
+ },
1015
+ "name": "arrayOfObjects"
1016
+ },
1017
+ {
1018
+ "title": "param",
1019
+ "description": "The key path to group by.",
1020
+ "type": {
1021
+ "type": "NameExpression",
1022
+ "name": "string"
1023
+ },
1024
+ "name": "keyPath"
1025
+ },
1026
+ {
1027
+ "title": "param",
1028
+ "description": "(Optional) Callback function",
1029
+ "type": {
1030
+ "type": "NameExpression",
1031
+ "name": "function"
1032
+ },
1033
+ "name": "callback"
1034
+ },
1035
+ {
1036
+ "title": "returns",
1037
+ "description": null,
1038
+ "type": {
1039
+ "type": "NameExpression",
1040
+ "name": "Operation"
1041
+ }
1042
+ }
1043
+ ]
1044
+ },
1045
+ "valid": true
1046
+ },
975
1047
  {
976
1048
  "name": "arrayToString",
977
1049
  "params": [
package/dist/index.cjs CHANGED
@@ -42,6 +42,7 @@ __export(src_exports, {
42
42
  fn: () => import_language_common3.fn,
43
43
  fnIf: () => import_language_common3.fnIf,
44
44
  get: () => get,
45
+ group: () => import_language_common3.group,
45
46
  humanProper: () => import_language_common3.humanProper,
46
47
  lastReferenceValue: () => import_language_common3.lastReferenceValue,
47
48
  merge: () => import_language_common3.merge,
@@ -77,6 +78,7 @@ __export(Adaptor_exports, {
77
78
  fn: () => import_language_common3.fn,
78
79
  fnIf: () => import_language_common3.fnIf,
79
80
  get: () => get,
81
+ group: () => import_language_common3.group,
80
82
  humanProper: () => import_language_common3.humanProper,
81
83
  lastReferenceValue: () => import_language_common3.lastReferenceValue,
82
84
  merge: () => import_language_common3.merge,
@@ -235,6 +237,7 @@ var src_default = Adaptor_exports;
235
237
  fn,
236
238
  fnIf,
237
239
  get,
240
+ group,
238
241
  humanProper,
239
242
  lastReferenceValue,
240
243
  merge,
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ __export(Adaptor_exports, {
23
23
  fn: () => fn,
24
24
  fnIf: () => fnIf,
25
25
  get: () => get,
26
+ group: () => group,
26
27
  humanProper: () => humanProper,
27
28
  lastReferenceValue: () => lastReferenceValue,
28
29
  merge: () => merge,
@@ -148,6 +149,7 @@ import {
148
149
  fn,
149
150
  fnIf,
150
151
  chunk,
152
+ group,
151
153
  humanProper,
152
154
  lastReferenceValue,
153
155
  merge,
@@ -208,6 +210,7 @@ export {
208
210
  fn,
209
211
  fnIf,
210
212
  get,
213
+ group,
211
214
  humanProper,
212
215
  lastReferenceValue,
213
216
  merge,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-http",
3
- "version": "6.3.0",
3
+ "version": "6.4.0",
4
4
  "description": "An HTTP request language package for use with Open Function",
5
5
  "homepage": "https://docs.openfn.org",
6
6
  "repository": {
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "cheerio": "1.0.0-rc.12",
29
29
  "cheerio-tableparser": "^1.0.1",
30
- "@openfn/language-common": "1.14.0"
30
+ "@openfn/language-common": "1.15.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@openfn/simple-ast": "0.4.1",
@@ -179,4 +179,4 @@ export type RequestOptions = {
179
179
  */
180
180
  tls: object;
181
181
  };
182
- export { alterState, arrayToString, combine, cursor, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, chunk, humanProper, lastReferenceValue, merge, scrubEmojis, sourceValue, splitKeys, toArray, parseCsv } from "@openfn/language-common";
182
+ export { alterState, arrayToString, combine, cursor, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, chunk, group, humanProper, lastReferenceValue, merge, scrubEmojis, sourceValue, splitKeys, toArray, parseCsv } from "@openfn/language-common";