@openfn/language-kobotoolbox 2.3.0 → 2.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 +72 -0
- package/dist/index.cjs +3 -0
- package/dist/index.js +3 -0
- package/package.json +2 -2
- package/types/Adaptor.d.ts +1 -1
package/ast.json
CHANGED
|
@@ -526,6 +526,78 @@
|
|
|
526
526
|
},
|
|
527
527
|
"valid": true
|
|
528
528
|
},
|
|
529
|
+
{
|
|
530
|
+
"name": "group",
|
|
531
|
+
"params": [
|
|
532
|
+
"arrayOfObjects",
|
|
533
|
+
"keyPath",
|
|
534
|
+
"callback"
|
|
535
|
+
],
|
|
536
|
+
"docs": {
|
|
537
|
+
"description": "Groups an array of objects by a specified key path.",
|
|
538
|
+
"tags": [
|
|
539
|
+
{
|
|
540
|
+
"title": "public",
|
|
541
|
+
"description": null,
|
|
542
|
+
"type": null
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"title": "example",
|
|
546
|
+
"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 / ] }"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"title": "function",
|
|
550
|
+
"description": null,
|
|
551
|
+
"name": null
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"title": "param",
|
|
555
|
+
"description": "The array of objects to be grouped.",
|
|
556
|
+
"type": {
|
|
557
|
+
"type": "TypeApplication",
|
|
558
|
+
"expression": {
|
|
559
|
+
"type": "NameExpression",
|
|
560
|
+
"name": "Array"
|
|
561
|
+
},
|
|
562
|
+
"applications": [
|
|
563
|
+
{
|
|
564
|
+
"type": "NameExpression",
|
|
565
|
+
"name": "Object"
|
|
566
|
+
}
|
|
567
|
+
]
|
|
568
|
+
},
|
|
569
|
+
"name": "arrayOfObjects"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"title": "param",
|
|
573
|
+
"description": "The key path to group by.",
|
|
574
|
+
"type": {
|
|
575
|
+
"type": "NameExpression",
|
|
576
|
+
"name": "string"
|
|
577
|
+
},
|
|
578
|
+
"name": "keyPath"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"title": "param",
|
|
582
|
+
"description": "(Optional) Callback function",
|
|
583
|
+
"type": {
|
|
584
|
+
"type": "NameExpression",
|
|
585
|
+
"name": "function"
|
|
586
|
+
},
|
|
587
|
+
"name": "callback"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"title": "returns",
|
|
591
|
+
"description": null,
|
|
592
|
+
"type": {
|
|
593
|
+
"type": "NameExpression",
|
|
594
|
+
"name": "Operation"
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
]
|
|
598
|
+
},
|
|
599
|
+
"valid": true
|
|
600
|
+
},
|
|
529
601
|
{
|
|
530
602
|
"name": "cursor",
|
|
531
603
|
"params": [
|
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ __export(src_exports, {
|
|
|
33
33
|
getDeploymentInfo: () => getDeploymentInfo,
|
|
34
34
|
getForms: () => getForms,
|
|
35
35
|
getSubmissions: () => getSubmissions,
|
|
36
|
+
group: () => import_language_common2.group,
|
|
36
37
|
http: () => import_language_common2.http,
|
|
37
38
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
38
39
|
merge: () => import_language_common2.merge,
|
|
@@ -56,6 +57,7 @@ __export(Adaptor_exports, {
|
|
|
56
57
|
getDeploymentInfo: () => getDeploymentInfo,
|
|
57
58
|
getForms: () => getForms,
|
|
58
59
|
getSubmissions: () => getSubmissions,
|
|
60
|
+
group: () => import_language_common2.group,
|
|
59
61
|
http: () => import_language_common2.http,
|
|
60
62
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
61
63
|
merge: () => import_language_common2.merge,
|
|
@@ -155,6 +157,7 @@ var src_default = Adaptor_exports;
|
|
|
155
157
|
getDeploymentInfo,
|
|
156
158
|
getForms,
|
|
157
159
|
getSubmissions,
|
|
160
|
+
group,
|
|
158
161
|
http,
|
|
159
162
|
lastReferenceValue,
|
|
160
163
|
merge,
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __export(Adaptor_exports, {
|
|
|
20
20
|
getDeploymentInfo: () => getDeploymentInfo,
|
|
21
21
|
getForms: () => getForms,
|
|
22
22
|
getSubmissions: () => getSubmissions,
|
|
23
|
+
group: () => group,
|
|
23
24
|
http: () => http2,
|
|
24
25
|
lastReferenceValue: () => lastReferenceValue,
|
|
25
26
|
merge: () => merge,
|
|
@@ -42,6 +43,7 @@ import {
|
|
|
42
43
|
fn,
|
|
43
44
|
fnIf,
|
|
44
45
|
http as http2,
|
|
46
|
+
group,
|
|
45
47
|
lastReferenceValue,
|
|
46
48
|
merge,
|
|
47
49
|
sourceValue
|
|
@@ -138,6 +140,7 @@ export {
|
|
|
138
140
|
getDeploymentInfo,
|
|
139
141
|
getForms,
|
|
140
142
|
getSubmissions,
|
|
143
|
+
group,
|
|
141
144
|
http2 as http,
|
|
142
145
|
lastReferenceValue,
|
|
143
146
|
merge,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-kobotoolbox",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "A Kobo Toolbox Language Pack for OpenFn",
|
|
5
5
|
"homepage": "https://docs.openfn.org",
|
|
6
6
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"configuration-schema.json"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@openfn/language-common": "^1.
|
|
20
|
+
"@openfn/language-common": "^1.15.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"assertion-error": "^1.0.1",
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -51,4 +51,4 @@ export function getSubmissions(params: object, callback: Function): Operation;
|
|
|
51
51
|
* @returns {Operation}
|
|
52
52
|
*/
|
|
53
53
|
export function getDeploymentInfo(params: object, callback: Function): Operation;
|
|
54
|
-
export { alterState, cursor, dataPath, dataValue, each, field, fields, fn, fnIf, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|
|
54
|
+
export { alterState, cursor, dataPath, dataValue, each, field, fields, fn, fnIf, http, group, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|