@openfn/language-msgraph 0.1.0 → 0.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 +74 -0
- package/configuration-schema.json +6 -12
- package/dist/index.cjs +3 -0
- package/dist/index.js +4 -1
- package/package.json +2 -2
- package/types/Adaptor.d.ts +1 -1
package/ast.json
CHANGED
|
@@ -545,6 +545,80 @@
|
|
|
545
545
|
]
|
|
546
546
|
},
|
|
547
547
|
"valid": true
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"name": "parseCsv",
|
|
551
|
+
"params": [
|
|
552
|
+
"csvData",
|
|
553
|
+
"parsingOptions",
|
|
554
|
+
"callback"
|
|
555
|
+
],
|
|
556
|
+
"docs": {
|
|
557
|
+
"description": "Takes a CSV file string or stream and parsing options as input, and returns a promise that\nresolves to the parsed CSV data as an array of objects.\nOptions for `parsingOptions` include:\n- `delimiter` {string/Buffer/[string/Buffer]} - Defines the character(s) used to delineate the fields inside a record. Default: `','`\n- `quote` {string/Buffer/[string/Buffer]} - Defines the characters used to surround a field. Default: `'\"'`\n- `escape` {Buffer/string/null/boolean} - Set the escape character as one character/byte only. Default: `\"`\n- `columns` {boolean / array / function} - Generates record in the form of object literals. Default: `true`\n- `bom` {boolean} - Strips the {@link https://en.wikipedia.org/wiki/Byte_order_mark byte order mark (BOM)} from the input string or buffer. Default: `true`\n- `trim` {boolean} - Ignore whitespace characters immediately around the `delimiter`. Default: `true`\n- `ltrim` {boolean} - Ignore whitespace characters from the left side of a CSV field. Default: `true`\n- `rtrim` {boolean} - Ignore whitespace characters from the right side of a CSV field. Default: `true`\n- `chunkSize` {number} - The size of each chunk of CSV data. Default: `Infinity`\n- `skip_empty_lines` {boolean} - Ignore empty lines in the CSV file. Default: `true`",
|
|
558
|
+
"tags": [
|
|
559
|
+
{
|
|
560
|
+
"title": "public",
|
|
561
|
+
"description": null,
|
|
562
|
+
"type": null
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"title": "function",
|
|
566
|
+
"description": null,
|
|
567
|
+
"name": null
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"title": "param",
|
|
571
|
+
"description": "A CSV string or a readable stream",
|
|
572
|
+
"type": {
|
|
573
|
+
"type": "UnionType",
|
|
574
|
+
"elements": [
|
|
575
|
+
{
|
|
576
|
+
"type": "NameExpression",
|
|
577
|
+
"name": "String"
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"type": "NameExpression",
|
|
581
|
+
"name": "Stream"
|
|
582
|
+
}
|
|
583
|
+
]
|
|
584
|
+
},
|
|
585
|
+
"name": "csvData"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"title": "param",
|
|
589
|
+
"description": "Optional. Parsing options for converting CSV to JSON.",
|
|
590
|
+
"type": {
|
|
591
|
+
"type": "OptionalType",
|
|
592
|
+
"expression": {
|
|
593
|
+
"type": "NameExpression",
|
|
594
|
+
"name": "Object"
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
"name": "parsingOptions"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"title": "param",
|
|
601
|
+
"description": "(Optional) callback function. If used it will be called state and an array of rows.",
|
|
602
|
+
"type": {
|
|
603
|
+
"type": "OptionalType",
|
|
604
|
+
"expression": {
|
|
605
|
+
"type": "NameExpression",
|
|
606
|
+
"name": "function"
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
"name": "callback"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"title": "returns",
|
|
613
|
+
"description": "The function returns a Promise that resolves to the result of parsing a CSV `stringOrStream`.",
|
|
614
|
+
"type": {
|
|
615
|
+
"type": "NameExpression",
|
|
616
|
+
"name": "Operation"
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
]
|
|
620
|
+
},
|
|
621
|
+
"valid": true
|
|
548
622
|
}
|
|
549
623
|
]
|
|
550
624
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$comment": "OAuth2",
|
|
3
4
|
"properties": {
|
|
4
5
|
"apiVersion": {
|
|
5
6
|
"title": "API Version",
|
|
@@ -14,25 +15,18 @@
|
|
|
14
15
|
"placeholder": "v1.0",
|
|
15
16
|
"description": "Microsoft Graph api version",
|
|
16
17
|
"minLength": 1,
|
|
17
|
-
"examples": [
|
|
18
|
-
"v1.0",
|
|
19
|
-
"beta"
|
|
20
|
-
]
|
|
18
|
+
"examples": ["v1.0", "beta"]
|
|
21
19
|
},
|
|
22
|
-
"
|
|
20
|
+
"access_token": {
|
|
23
21
|
"title": "Access Token",
|
|
24
22
|
"type": "string",
|
|
25
23
|
"description": "Your Microsoft Graph access token",
|
|
26
24
|
"writeOnly": true,
|
|
27
25
|
"minLength": 1,
|
|
28
|
-
"examples": [
|
|
29
|
-
"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
|
|
30
|
-
]
|
|
26
|
+
"examples": ["eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRl"]
|
|
31
27
|
}
|
|
32
28
|
},
|
|
33
29
|
"type": "object",
|
|
34
30
|
"additionalProperties": true,
|
|
35
|
-
"required": [
|
|
36
|
-
|
|
37
|
-
]
|
|
38
|
-
}
|
|
31
|
+
"required": ["access_token"]
|
|
32
|
+
}
|
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ __export(src_exports, {
|
|
|
32
32
|
get: () => get,
|
|
33
33
|
lastReferenceValue: () => import_language_common3.lastReferenceValue,
|
|
34
34
|
merge: () => import_language_common3.merge,
|
|
35
|
+
parseCsv: () => import_language_common3.parseCsv,
|
|
35
36
|
request: () => request,
|
|
36
37
|
sourceValue: () => import_language_common3.sourceValue
|
|
37
38
|
});
|
|
@@ -52,6 +53,7 @@ __export(Adaptor_exports, {
|
|
|
52
53
|
get: () => get,
|
|
53
54
|
lastReferenceValue: () => import_language_common3.lastReferenceValue,
|
|
54
55
|
merge: () => import_language_common3.merge,
|
|
56
|
+
parseCsv: () => import_language_common3.parseCsv,
|
|
55
57
|
request: () => request,
|
|
56
58
|
sourceValue: () => import_language_common3.sourceValue
|
|
57
59
|
});
|
|
@@ -180,6 +182,7 @@ var src_default = Adaptor_exports;
|
|
|
180
182
|
get,
|
|
181
183
|
lastReferenceValue,
|
|
182
184
|
merge,
|
|
185
|
+
parseCsv,
|
|
183
186
|
request,
|
|
184
187
|
sourceValue
|
|
185
188
|
});
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __export(Adaptor_exports, {
|
|
|
19
19
|
get: () => get,
|
|
20
20
|
lastReferenceValue: () => lastReferenceValue,
|
|
21
21
|
merge: () => merge,
|
|
22
|
+
parseCsv: () => parseCsv,
|
|
22
23
|
request: () => request,
|
|
23
24
|
sourceValue: () => sourceValue
|
|
24
25
|
});
|
|
@@ -102,7 +103,8 @@ import {
|
|
|
102
103
|
fn,
|
|
103
104
|
lastReferenceValue,
|
|
104
105
|
merge,
|
|
105
|
-
sourceValue
|
|
106
|
+
sourceValue,
|
|
107
|
+
parseCsv
|
|
106
108
|
} from "@openfn/language-common";
|
|
107
109
|
function execute(...operations) {
|
|
108
110
|
const initialState = {
|
|
@@ -161,6 +163,7 @@ export {
|
|
|
161
163
|
get,
|
|
162
164
|
lastReferenceValue,
|
|
163
165
|
merge,
|
|
166
|
+
parseCsv,
|
|
164
167
|
request,
|
|
165
168
|
sourceValue
|
|
166
169
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-msgraph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Microsoft Graph Language Pack for OpenFn",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"configuration-schema.json"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@openfn/language-common": "^1.
|
|
22
|
+
"@openfn/language-common": "^1.10.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@openfn/buildtools": "^1.0.2",
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -36,4 +36,4 @@ export function create(resource: string, data: object, callback: Function): Oper
|
|
|
36
36
|
*/
|
|
37
37
|
export function get(path: string, query: object, callback?: Function): Operation;
|
|
38
38
|
export { request } from "./Utils";
|
|
39
|
-
export { dataPath, dataValue, dateFns, each, field, fields, fn, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|
|
39
|
+
export { dataPath, dataValue, dateFns, each, field, fields, fn, lastReferenceValue, merge, sourceValue, parseCsv } from "@openfn/language-common";
|