@openfn/language-dhis2 4.1.0 → 4.2.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
|
@@ -1380,6 +1380,78 @@
|
|
|
1380
1380
|
]
|
|
1381
1381
|
},
|
|
1382
1382
|
"valid": true
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
"name": "group",
|
|
1386
|
+
"params": [
|
|
1387
|
+
"arrayOfObjects",
|
|
1388
|
+
"keyPath",
|
|
1389
|
+
"callback"
|
|
1390
|
+
],
|
|
1391
|
+
"docs": {
|
|
1392
|
+
"description": "Groups an array of objects by a specified key path.",
|
|
1393
|
+
"tags": [
|
|
1394
|
+
{
|
|
1395
|
+
"title": "public",
|
|
1396
|
+
"description": null,
|
|
1397
|
+
"type": null
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
"title": "example",
|
|
1401
|
+
"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 / ] }"
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
"title": "function",
|
|
1405
|
+
"description": null,
|
|
1406
|
+
"name": null
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"title": "param",
|
|
1410
|
+
"description": "The array of objects to be grouped.",
|
|
1411
|
+
"type": {
|
|
1412
|
+
"type": "TypeApplication",
|
|
1413
|
+
"expression": {
|
|
1414
|
+
"type": "NameExpression",
|
|
1415
|
+
"name": "Array"
|
|
1416
|
+
},
|
|
1417
|
+
"applications": [
|
|
1418
|
+
{
|
|
1419
|
+
"type": "NameExpression",
|
|
1420
|
+
"name": "Object"
|
|
1421
|
+
}
|
|
1422
|
+
]
|
|
1423
|
+
},
|
|
1424
|
+
"name": "arrayOfObjects"
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
"title": "param",
|
|
1428
|
+
"description": "The key path to group by.",
|
|
1429
|
+
"type": {
|
|
1430
|
+
"type": "NameExpression",
|
|
1431
|
+
"name": "string"
|
|
1432
|
+
},
|
|
1433
|
+
"name": "keyPath"
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
"title": "param",
|
|
1437
|
+
"description": "(Optional) Callback function",
|
|
1438
|
+
"type": {
|
|
1439
|
+
"type": "NameExpression",
|
|
1440
|
+
"name": "function"
|
|
1441
|
+
},
|
|
1442
|
+
"name": "callback"
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
"title": "returns",
|
|
1446
|
+
"description": null,
|
|
1447
|
+
"type": {
|
|
1448
|
+
"type": "NameExpression",
|
|
1449
|
+
"name": "Operation"
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
]
|
|
1453
|
+
},
|
|
1454
|
+
"valid": true
|
|
1383
1455
|
}
|
|
1384
1456
|
]
|
|
1385
1457
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(src_exports, {
|
|
|
43
43
|
fn: () => import_language_common3.fn,
|
|
44
44
|
fnIf: () => import_language_common3.fnIf,
|
|
45
45
|
get: () => get,
|
|
46
|
+
group: () => import_language_common3.group,
|
|
46
47
|
http: () => import_language_common3.http,
|
|
47
48
|
lastReferenceValue: () => import_language_common3.lastReferenceValue,
|
|
48
49
|
merge: () => import_language_common3.merge,
|
|
@@ -217,6 +218,7 @@ __export(Adaptor_exports, {
|
|
|
217
218
|
fn: () => import_language_common3.fn,
|
|
218
219
|
fnIf: () => import_language_common3.fnIf,
|
|
219
220
|
get: () => get,
|
|
221
|
+
group: () => import_language_common3.group,
|
|
220
222
|
http: () => import_language_common3.http,
|
|
221
223
|
lastReferenceValue: () => import_language_common3.lastReferenceValue,
|
|
222
224
|
merge: () => import_language_common3.merge,
|
|
@@ -565,6 +567,7 @@ var src_default = Adaptor_exports;
|
|
|
565
567
|
fn,
|
|
566
568
|
fnIf,
|
|
567
569
|
get,
|
|
570
|
+
group,
|
|
568
571
|
http,
|
|
569
572
|
lastReferenceValue,
|
|
570
573
|
merge,
|
package/dist/index.js
CHANGED
|
@@ -167,6 +167,7 @@ __export(Adaptor_exports, {
|
|
|
167
167
|
fn: () => fn,
|
|
168
168
|
fnIf: () => fnIf,
|
|
169
169
|
get: () => get,
|
|
170
|
+
group: () => group,
|
|
170
171
|
http: () => http,
|
|
171
172
|
lastReferenceValue: () => lastReferenceValue,
|
|
172
173
|
merge: () => merge,
|
|
@@ -215,6 +216,7 @@ import {
|
|
|
215
216
|
fn,
|
|
216
217
|
fnIf,
|
|
217
218
|
http,
|
|
219
|
+
group,
|
|
218
220
|
lastReferenceValue,
|
|
219
221
|
merge,
|
|
220
222
|
sourceValue
|
|
@@ -532,6 +534,7 @@ export {
|
|
|
532
534
|
fn,
|
|
533
535
|
fnIf,
|
|
534
536
|
get,
|
|
537
|
+
group,
|
|
535
538
|
http,
|
|
536
539
|
lastReferenceValue,
|
|
537
540
|
merge,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-dhis2",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "DHIS2 Language Pack for OpenFn",
|
|
5
5
|
"homepage": "https://docs.openfn.org",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"configuration-schema.json"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@openfn/language-common": "^1.
|
|
27
|
+
"@openfn/language-common": "^1.15.0",
|
|
28
28
|
"axios": "^0.24.0",
|
|
29
29
|
"lodash": "^4.17.21",
|
|
30
30
|
"qs": "^6.11.0"
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -382,4 +382,4 @@ export function attr(attribute: string, value: string): object;
|
|
|
382
382
|
* @returns {object}
|
|
383
383
|
*/
|
|
384
384
|
export function dv(dataElement: string, value: string): object;
|
|
385
|
-
export { alterState, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|
|
385
|
+
export { alterState, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, http, group, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|