@lowdefy/connection-google-sheets 4.0.0-alpha.9 → 4.0.0-rc.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.
|
@@ -25,8 +25,7 @@ function cleanRows(input) {
|
|
|
25
25
|
return cleanRow(input);
|
|
26
26
|
}
|
|
27
27
|
if (type.isArray(input)) {
|
|
28
|
-
return input.map((row)=>cleanRow(row)
|
|
29
|
-
);
|
|
28
|
+
return input.map((row)=>cleanRow(row));
|
|
30
29
|
}
|
|
31
30
|
throw new Error(`cleanRows received invalid input type ${type.typeOf(input)}.`);
|
|
32
31
|
}
|
|
@@ -15,15 +15,13 @@
|
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import moment from 'moment';
|
|
17
17
|
const readTransformers = {
|
|
18
|
-
string: (value)=>value
|
|
19
|
-
,
|
|
18
|
+
string: (value)=>value,
|
|
20
19
|
number: (value)=>{
|
|
21
20
|
const number = Number(value);
|
|
22
21
|
if (isNaN(number)) return null;
|
|
23
22
|
return number;
|
|
24
23
|
},
|
|
25
|
-
boolean: (value)=>value === 'TRUE'
|
|
26
|
-
,
|
|
24
|
+
boolean: (value)=>value === 'TRUE',
|
|
27
25
|
date: (value)=>{
|
|
28
26
|
const date = moment.utc(value);
|
|
29
27
|
if (!date.isValid()) return null;
|
|
@@ -38,17 +36,14 @@ const readTransformers = {
|
|
|
38
36
|
}
|
|
39
37
|
};
|
|
40
38
|
const writeTransformers = {
|
|
41
|
-
string: (value)=>value
|
|
42
|
-
,
|
|
43
|
-
number: (value)=>type.isNumber(value) ? value.toString() : value
|
|
44
|
-
,
|
|
39
|
+
string: (value)=>value,
|
|
40
|
+
number: (value)=>type.isNumber(value) ? value.toString() : value,
|
|
45
41
|
boolean: (value)=>{
|
|
46
42
|
if (value === true) return 'TRUE';
|
|
47
43
|
if (value === false) return 'FALSE';
|
|
48
44
|
return value;
|
|
49
45
|
},
|
|
50
|
-
date: (value)=>type.isDate(value) ? value.toISOString() : value
|
|
51
|
-
,
|
|
46
|
+
date: (value)=>type.isDate(value) ? value.toISOString() : value,
|
|
52
47
|
json: (value)=>{
|
|
53
48
|
try {
|
|
54
49
|
return JSON.stringify(value);
|
|
@@ -64,8 +59,7 @@ const transformObject = ({ transformers , types })=>(object)=>{
|
|
|
64
59
|
}
|
|
65
60
|
});
|
|
66
61
|
return object;
|
|
67
|
-
}
|
|
68
|
-
;
|
|
62
|
+
};
|
|
69
63
|
function transformRead({ input , types ={} }) {
|
|
70
64
|
if (type.isObject(input)) {
|
|
71
65
|
return transformObject({
|
|
@@ -77,8 +71,7 @@ function transformRead({ input , types ={} }) {
|
|
|
77
71
|
return input.map((obj)=>transformObject({
|
|
78
72
|
transformers: readTransformers,
|
|
79
73
|
types
|
|
80
|
-
})(obj)
|
|
81
|
-
);
|
|
74
|
+
})(obj));
|
|
82
75
|
}
|
|
83
76
|
throw new Error(`transformRead received invalid input type ${type.typeOf(input)}.`);
|
|
84
77
|
}
|
|
@@ -93,8 +86,7 @@ function transformWrite({ input , types ={} }) {
|
|
|
93
86
|
return input.map((obj)=>transformObject({
|
|
94
87
|
transformers: writeTransformers,
|
|
95
88
|
types
|
|
96
|
-
})(obj)
|
|
97
|
-
);
|
|
89
|
+
})(obj));
|
|
98
90
|
}
|
|
99
91
|
throw new Error(`transformWrite received invalid input type ${type.typeOf(input)}.`);
|
|
100
92
|
}
|
package/dist/types.js
CHANGED
|
@@ -15,6 +15,5 @@
|
|
|
15
15
|
*/ import * as connections from './connections.js';
|
|
16
16
|
export default {
|
|
17
17
|
connections: Object.keys(connections),
|
|
18
|
-
requests: Object.keys(connections).map((connection)=>Object.keys(connections[connection].requests)
|
|
19
|
-
).flat()
|
|
18
|
+
requests: Object.keys(connections).map((connection)=>Object.keys(connections[connection].requests)).flat()
|
|
20
19
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/connection-google-sheets",
|
|
3
|
-
"version": "4.0.0-
|
|
4
|
-
"
|
|
3
|
+
"version": "4.0.0-rc.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
7
7
|
"keywords": [
|
|
@@ -35,27 +35,26 @@
|
|
|
35
35
|
"dist/*"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
-
"build": "
|
|
38
|
+
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files",
|
|
39
39
|
"clean": "rm -rf dist",
|
|
40
|
-
"
|
|
41
|
-
"swc": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files",
|
|
40
|
+
"prepublishOnly": "pnpm build",
|
|
42
41
|
"test": "jest --coverage"
|
|
43
42
|
},
|
|
44
43
|
"dependencies": {
|
|
45
|
-
"@lowdefy/helpers": "4.0.0-
|
|
46
|
-
"google-spreadsheet": "3.
|
|
47
|
-
"mingo": "6.0.
|
|
48
|
-
"moment": "2.29.
|
|
44
|
+
"@lowdefy/helpers": "4.0.0-rc.0",
|
|
45
|
+
"google-spreadsheet": "3.3.0",
|
|
46
|
+
"mingo": "6.0.6",
|
|
47
|
+
"moment": "2.29.4"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
|
-
"@lowdefy/ajv": "4.0.0-
|
|
52
|
-
"@swc/cli": "0.1.
|
|
53
|
-
"@swc/core": "1.2.
|
|
54
|
-
"@swc/jest": "0.2.
|
|
55
|
-
"jest": "
|
|
50
|
+
"@lowdefy/ajv": "4.0.0-rc.0",
|
|
51
|
+
"@swc/cli": "0.1.57",
|
|
52
|
+
"@swc/core": "1.2.194",
|
|
53
|
+
"@swc/jest": "0.2.21",
|
|
54
|
+
"jest": "28.1.0"
|
|
56
55
|
},
|
|
57
56
|
"publishConfig": {
|
|
58
57
|
"access": "public"
|
|
59
58
|
},
|
|
60
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "f6872d7ff6da421710096536fce7b2016ef8f35c"
|
|
61
60
|
}
|