@openfn/language-khanacademy 0.4.1 → 0.5.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 +53 -0
- package/dist/index.cjs +3 -0
- package/dist/index.js +3 -0
- package/package.json +2 -3
- package/types/Adaptor.d.ts +1 -1
package/ast.json
CHANGED
|
@@ -45,6 +45,59 @@
|
|
|
45
45
|
},
|
|
46
46
|
"valid": true
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
"name": "fnIf",
|
|
50
|
+
"params": [
|
|
51
|
+
"condition",
|
|
52
|
+
"operation"
|
|
53
|
+
],
|
|
54
|
+
"docs": {
|
|
55
|
+
"description": "A custom operation that will only execute the function if the condition returns true",
|
|
56
|
+
"tags": [
|
|
57
|
+
{
|
|
58
|
+
"title": "public",
|
|
59
|
+
"description": null,
|
|
60
|
+
"type": null
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"title": "example",
|
|
64
|
+
"description": "fnIf((state) => state?.data?.name, get(\"https://example.com\"));"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"title": "function",
|
|
68
|
+
"description": null,
|
|
69
|
+
"name": null
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"title": "param",
|
|
73
|
+
"description": "The condition that returns true",
|
|
74
|
+
"type": {
|
|
75
|
+
"type": "NameExpression",
|
|
76
|
+
"name": "Boolean"
|
|
77
|
+
},
|
|
78
|
+
"name": "condition"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"title": "param",
|
|
82
|
+
"description": "The operation needed to be executed.",
|
|
83
|
+
"type": {
|
|
84
|
+
"type": "NameExpression",
|
|
85
|
+
"name": "Operation"
|
|
86
|
+
},
|
|
87
|
+
"name": "operation"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"title": "returns",
|
|
91
|
+
"description": null,
|
|
92
|
+
"type": {
|
|
93
|
+
"type": "NameExpression",
|
|
94
|
+
"name": "Operation"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"valid": true
|
|
100
|
+
},
|
|
48
101
|
{
|
|
49
102
|
"name": "sourceValue",
|
|
50
103
|
"params": [
|
package/dist/index.cjs
CHANGED
|
@@ -34,6 +34,7 @@ __export(src_exports, {
|
|
|
34
34
|
field: () => import_language_common2.field,
|
|
35
35
|
fields: () => import_language_common2.fields,
|
|
36
36
|
fn: () => import_language_common2.fn,
|
|
37
|
+
fnIf: () => import_language_common2.fnIf,
|
|
37
38
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
38
39
|
merge: () => import_language_common2.merge,
|
|
39
40
|
sourceValue: () => import_language_common2.sourceValue
|
|
@@ -51,6 +52,7 @@ __export(Adaptor_exports, {
|
|
|
51
52
|
field: () => import_language_common2.field,
|
|
52
53
|
fields: () => import_language_common2.fields,
|
|
53
54
|
fn: () => import_language_common2.fn,
|
|
55
|
+
fnIf: () => import_language_common2.fnIf,
|
|
54
56
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
55
57
|
merge: () => import_language_common2.merge,
|
|
56
58
|
sourceValue: () => import_language_common2.sourceValue
|
|
@@ -225,6 +227,7 @@ var src_default = Adaptor_exports;
|
|
|
225
227
|
field,
|
|
226
228
|
fields,
|
|
227
229
|
fn,
|
|
230
|
+
fnIf,
|
|
228
231
|
lastReferenceValue,
|
|
229
232
|
merge,
|
|
230
233
|
sourceValue
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ __export(Adaptor_exports, {
|
|
|
15
15
|
field: () => field,
|
|
16
16
|
fields: () => fields,
|
|
17
17
|
fn: () => fn,
|
|
18
|
+
fnIf: () => fnIf,
|
|
18
19
|
lastReferenceValue: () => lastReferenceValue,
|
|
19
20
|
merge: () => merge,
|
|
20
21
|
sourceValue: () => sourceValue
|
|
@@ -28,6 +29,7 @@ import request from "request";
|
|
|
28
29
|
import qs from "qs";
|
|
29
30
|
import {
|
|
30
31
|
fn,
|
|
32
|
+
fnIf,
|
|
31
33
|
field,
|
|
32
34
|
sourceValue,
|
|
33
35
|
fields,
|
|
@@ -202,6 +204,7 @@ export {
|
|
|
202
204
|
field,
|
|
203
205
|
fields,
|
|
204
206
|
fn,
|
|
207
|
+
fnIf,
|
|
205
208
|
lastReferenceValue,
|
|
206
209
|
merge,
|
|
207
210
|
sourceValue
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-khanacademy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "A Khan Academy Language Pack for OpenFn",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"author": "Open Function Group",
|
|
@@ -12,12 +12,11 @@
|
|
|
12
12
|
"configuration-schema.json"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@openfn/language-common": "^1.
|
|
15
|
+
"@openfn/language-common": "^1.14.0",
|
|
16
16
|
"qs": "^6.11.0",
|
|
17
17
|
"request": "^2.88.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@openfn/buildtools": "^1.0.2",
|
|
21
20
|
"@openfn/simple-ast": "0.4.1",
|
|
22
21
|
"assertion-error": "^2.0.0",
|
|
23
22
|
"chai": "^4.3.7",
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ export function execute(...operations: Operations): Operation;
|
|
|
22
22
|
* @returns {Operation}
|
|
23
23
|
*/
|
|
24
24
|
export function fetch(params: object): Operation;
|
|
25
|
-
export { fn, field, sourceValue, fields, alterState, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|
|
25
|
+
export { fn, fnIf, field, sourceValue, fields, alterState, merge, dataPath, dataValue, lastReferenceValue } from "@openfn/language-common";
|