@lowdefy/connection-google-sheets 4.0.0-alpha.5 → 4.0.0-alpha.8

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.
Files changed (36) hide show
  1. package/dist/connections/GoogleSheet/GoogleSheet.js +2 -3
  2. package/dist/connections/GoogleSheet/GoogleSheetAppendMany/GoogleSheetAppendMany.js +9 -4
  3. package/dist/connections/GoogleSheet/GoogleSheetAppendMany/schema.js +56 -0
  4. package/dist/connections/GoogleSheet/GoogleSheetAppendOne/GoogleSheetAppendOne.js +9 -4
  5. package/dist/connections/GoogleSheet/GoogleSheetAppendOne/schema.js +49 -0
  6. package/dist/connections/GoogleSheet/GoogleSheetDeleteOne/GoogleSheetDeleteOne.js +9 -4
  7. package/dist/connections/GoogleSheet/GoogleSheetDeleteOne/schema.js +56 -0
  8. package/dist/connections/GoogleSheet/GoogleSheetGetMany/GoogleSheetGetMany.js +9 -4
  9. package/dist/connections/GoogleSheet/GoogleSheetGetMany/schema.js +57 -0
  10. package/dist/connections/GoogleSheet/GoogleSheetGetOne/GoogleSheetGetOne.js +9 -4
  11. package/dist/connections/GoogleSheet/GoogleSheetGetOne/schema.js +50 -0
  12. package/dist/connections/GoogleSheet/GoogleSheetUpdateMany/GoogleSheetUpdateMany.js +9 -4
  13. package/dist/connections/GoogleSheet/GoogleSheetUpdateMany/schema.js +72 -0
  14. package/dist/connections/GoogleSheet/GoogleSheetUpdateOne/GoogleSheetUpdateOne.js +9 -4
  15. package/dist/connections/GoogleSheet/GoogleSheetUpdateOne/schema.js +79 -0
  16. package/dist/connections/GoogleSheet/mingoAggregation.js +17 -11
  17. package/dist/connections/GoogleSheet/mingoFilter.js +2 -3
  18. package/dist/connections/GoogleSheet/schema.js +110 -0
  19. package/dist/connections/GoogleSheet/transformTypes.js +2 -4
  20. package/dist/{connections/GoogleSheet/GoogleSheetGetOne/index.js → connections.js} +1 -10
  21. package/dist/{connections/GoogleSheet/GoogleSheetUpdateOne/index.js → types.js} +6 -10
  22. package/package.json +14 -13
  23. package/dist/connections/GoogleSheet/GoogleSheetAppendMany/GoogleSheetAppendManySchema.json +0 -40
  24. package/dist/connections/GoogleSheet/GoogleSheetAppendMany/index.js +0 -24
  25. package/dist/connections/GoogleSheet/GoogleSheetAppendOne/GoogleSheetAppendOneSchema.json +0 -33
  26. package/dist/connections/GoogleSheet/GoogleSheetAppendOne/index.js +0 -24
  27. package/dist/connections/GoogleSheet/GoogleSheetDeleteOne/GoogleSheetDeleteOneSchema.json +0 -40
  28. package/dist/connections/GoogleSheet/GoogleSheetDeleteOne/index.js +0 -24
  29. package/dist/connections/GoogleSheet/GoogleSheetGetMany/GoogleSheetGetManySchema.json +0 -43
  30. package/dist/connections/GoogleSheet/GoogleSheetGetMany/index.js +0 -24
  31. package/dist/connections/GoogleSheet/GoogleSheetGetOne/GoogleSheetGetOneSchema.json +0 -36
  32. package/dist/connections/GoogleSheet/GoogleSheetSchema.json +0 -88
  33. package/dist/connections/GoogleSheet/GoogleSheetUpdateMany/GoogleSheetUpdateManySchema.json +0 -55
  34. package/dist/connections/GoogleSheet/GoogleSheetUpdateMany/index.js +0 -24
  35. package/dist/connections/GoogleSheet/GoogleSheetUpdateOne/GoogleSheetUpdateOneSchema.json +0 -62
  36. package/dist/index.js +0 -7
@@ -19,10 +19,9 @@ import GoogleSheetGetMany from './GoogleSheetGetMany/GoogleSheetGetMany.js';
19
19
  import GoogleSheetGetOne from './GoogleSheetGetOne/GoogleSheetGetOne.js';
20
20
  import GoogleSheetUpdateOne from './GoogleSheetUpdateOne/GoogleSheetUpdateOne.js';
21
21
  import GoogleSheetUpdateMany from './GoogleSheetUpdateMany/GoogleSheetUpdateMany.js';
22
+ import schema from './schema.js';
22
23
  export default {
23
- import: {
24
- schema: 'connections/GoogleSheet/GoogleSheetSchema.json'
25
- },
24
+ schema,
26
25
  requests: {
27
26
  GoogleSheetAppendMany,
28
27
  GoogleSheetAppendOne,
@@ -14,9 +14,9 @@
14
14
  limitations under the License.
15
15
  */ import getSheet from '../getSheet.js';
16
16
  import { transformWrite } from '../transformTypes.js';
17
- async function googleSheetAppendMany({ request , connection }) {
18
- const { rows , options ={
19
- } } = request;
17
+ import schema from './schema.js';
18
+ async function GoogleSheetAppendMany({ request , connection }) {
19
+ const { rows , options ={} } = request;
20
20
  const { raw } = options;
21
21
  const sheet = await getSheet({
22
22
  connection
@@ -31,4 +31,9 @@ async function googleSheetAppendMany({ request , connection }) {
31
31
  insertedCount: rows.length
32
32
  };
33
33
  }
34
- export default googleSheetAppendMany;
34
+ GoogleSheetAppendMany.schema = schema;
35
+ GoogleSheetAppendMany.meta = {
36
+ checkRead: false,
37
+ checkWrite: true
38
+ };
39
+ export default GoogleSheetAppendMany;
@@ -0,0 +1,56 @@
1
+ /*
2
+ Copyright 2020-2021 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ title: 'Lowdefy Request Schema - GoogleSheetAppendMany',
18
+ type: 'object',
19
+ required: [
20
+ 'rows'
21
+ ],
22
+ properties: {
23
+ rows: {
24
+ type: 'array',
25
+ description: 'The rows to insert into the sheet. An an array of objects where keys are the column names and values are the values to insert.',
26
+ errorMessage: {
27
+ type: 'GoogleSheetAppendMany request property "rows" should be an array.'
28
+ },
29
+ items: {
30
+ type: 'object',
31
+ description: 'The row to insert into the sheet. An object where keys are the column names and values are the values to insert.',
32
+ errorMessage: {
33
+ type: 'GoogleSheetAppendMany request property "rows" should be an array of objects.'
34
+ }
35
+ }
36
+ },
37
+ options: {
38
+ type: 'object',
39
+ properties: {
40
+ raw: {
41
+ type: 'boolean',
42
+ description: 'Store raw values instead of converting as if typed into the sheets UI.',
43
+ errorMessage: {
44
+ type: 'GoogleSheetAppendMany request property "options.raw" should be a boolean.'
45
+ }
46
+ }
47
+ }
48
+ }
49
+ },
50
+ errorMessage: {
51
+ type: 'GoogleSheetAppendMany request properties should be an object.',
52
+ required: {
53
+ rows: 'GoogleSheetAppendMany request should have required property "rows".'
54
+ }
55
+ }
56
+ };
@@ -15,9 +15,9 @@
15
15
  */ import getSheet from '../getSheet.js';
16
16
  import cleanRows from '../cleanRows.js';
17
17
  import { transformWrite } from '../transformTypes.js';
18
- async function googleSheetAppendOne({ request , connection }) {
19
- const { row , options ={
20
- } } = request;
18
+ import schema from './schema.js';
19
+ async function GoogleSheetAppendOne({ request , connection }) {
20
+ const { row , options ={} } = request;
21
21
  const { raw } = options;
22
22
  const sheet = await getSheet({
23
23
  connection
@@ -33,4 +33,9 @@ async function googleSheetAppendOne({ request , connection }) {
33
33
  row: cleanRows(insertedRow)
34
34
  };
35
35
  }
36
- export default googleSheetAppendOne;
36
+ GoogleSheetAppendOne.schema = schema;
37
+ GoogleSheetAppendOne.meta = {
38
+ checkRead: false,
39
+ checkWrite: true
40
+ };
41
+ export default GoogleSheetAppendOne;
@@ -0,0 +1,49 @@
1
+ /*
2
+ Copyright 2020-2021 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ title: 'Lowdefy Request Schema - GoogleSheetAppendOne',
18
+ type: 'object',
19
+ required: [
20
+ 'row'
21
+ ],
22
+ properties: {
23
+ row: {
24
+ type: 'object',
25
+ description: 'The row to insert into the sheet. An object where keys are the column names and values are the values to insert.',
26
+ errorMessage: {
27
+ type: 'GoogleSheetAppendOne request property "row" should be an object.'
28
+ }
29
+ },
30
+ options: {
31
+ type: 'object',
32
+ properties: {
33
+ raw: {
34
+ type: 'boolean',
35
+ description: 'Store raw values instead of converting as if typed into the sheets UI.',
36
+ errorMessage: {
37
+ type: 'GoogleSheetAppendOne request property "options.raw" should be a boolean.'
38
+ }
39
+ }
40
+ }
41
+ }
42
+ },
43
+ errorMessage: {
44
+ type: 'GoogleSheetAppendOne request properties should be an object.',
45
+ required: {
46
+ row: 'GoogleSheetAppendOne request should have required property "row".'
47
+ }
48
+ }
49
+ };
@@ -16,9 +16,9 @@
16
16
  import getSheet from '../getSheet.js';
17
17
  import { transformRead } from '../transformTypes.js';
18
18
  import mingoFilter from '../mingoFilter.js';
19
- async function googleSheetDeleteOne({ request , connection }) {
20
- const { filter , options ={
21
- } } = request;
19
+ import schema from './schema.js';
20
+ async function GoogleSheetDeleteOne({ request , connection }) {
21
+ const { filter , options ={} } = request;
22
22
  const { limit , skip } = options;
23
23
  const sheet = await getSheet({
24
24
  connection
@@ -47,4 +47,9 @@ async function googleSheetDeleteOne({ request , connection }) {
47
47
  row: cleanRows(row)
48
48
  };
49
49
  }
50
- export default googleSheetDeleteOne;
50
+ GoogleSheetDeleteOne.schema = schema;
51
+ GoogleSheetDeleteOne.meta = {
52
+ checkRead: false,
53
+ checkWrite: true
54
+ };
55
+ export default GoogleSheetDeleteOne;
@@ -0,0 +1,56 @@
1
+ /*
2
+ Copyright 2020-2021 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ title: 'Lowdefy Request Schema - GoogleSheetDeleteOne',
18
+ type: 'object',
19
+ required: [
20
+ 'filter'
21
+ ],
22
+ properties: {
23
+ filter: {
24
+ type: 'object',
25
+ description: 'A MongoDB query expression to filter the data. The first row matched by the filter will be deleted.',
26
+ errorMessage: {
27
+ type: 'GoogleSheetDeleteOne request property "filter" should be an object.'
28
+ }
29
+ },
30
+ options: {
31
+ type: 'object',
32
+ properties: {
33
+ limit: {
34
+ type: 'number',
35
+ description: 'The maximum number of rows to fetch.',
36
+ errorMessage: {
37
+ type: 'GoogleSheetDeleteOne request property "options.limit" should be a number.'
38
+ }
39
+ },
40
+ skip: {
41
+ type: 'number',
42
+ description: 'The number of rows to skip from the top of the sheet.',
43
+ errorMessage: {
44
+ type: 'GoogleSheetDeleteOne request property "options.skip" should be a number.'
45
+ }
46
+ }
47
+ }
48
+ }
49
+ },
50
+ errorMessage: {
51
+ type: 'GoogleSheetDeleteOne request properties should be an object.',
52
+ required: {
53
+ filter: 'GoogleSheetDeleteOne request should have required property "filter".'
54
+ }
55
+ }
56
+ };
@@ -17,9 +17,9 @@ import getSheet from '../getSheet.js';
17
17
  import { transformRead } from '../transformTypes.js';
18
18
  import mingoAggregation from '../mingoAggregation.js';
19
19
  import mingoFilter from '../mingoFilter.js';
20
- async function googleSheetGetMany({ request , connection }) {
21
- const { filter , pipeline , options ={
22
- } } = request;
20
+ import schema from './schema.js';
21
+ async function GoogleSheetGetMany({ request , connection }) {
22
+ const { filter , pipeline , options ={} } = request;
23
23
  const { limit , skip } = options;
24
24
  const sheet = await getSheet({
25
25
  connection
@@ -47,4 +47,9 @@ async function googleSheetGetMany({ request , connection }) {
47
47
  }
48
48
  return rows;
49
49
  }
50
- export default googleSheetGetMany;
50
+ GoogleSheetGetMany.schema = schema;
51
+ GoogleSheetGetMany.meta = {
52
+ checkRead: true,
53
+ checkWrite: false
54
+ };
55
+ export default GoogleSheetGetMany;
@@ -0,0 +1,57 @@
1
+ /*
2
+ Copyright 2020-2021 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ title: 'Lowdefy Request Schema - GoogleSheetGetMany',
18
+ type: 'object',
19
+ properties: {
20
+ filter: {
21
+ type: 'object',
22
+ description: 'A MongoDB query expression to filter the data.',
23
+ errorMessage: {
24
+ type: 'GoogleSheetGetMany request property "filter" should be an object.'
25
+ }
26
+ },
27
+ pipeline: {
28
+ type: 'array',
29
+ description: 'A MongoDB aggregation pipeline to transform the data.',
30
+ errorMessage: {
31
+ type: 'GoogleSheetGetMany request property "pipeline" should be an array.'
32
+ }
33
+ },
34
+ options: {
35
+ type: 'object',
36
+ properties: {
37
+ limit: {
38
+ type: 'number',
39
+ description: 'The maximum number of rows to fetch.',
40
+ errorMessage: {
41
+ type: 'GoogleSheetGetMany request property "options.limit" should be a number.'
42
+ }
43
+ },
44
+ skip: {
45
+ type: 'number',
46
+ description: 'The number of rows to skip from the top of the sheet.',
47
+ errorMessage: {
48
+ type: 'GoogleSheetGetMany request property "options.skip" should be a number.'
49
+ }
50
+ }
51
+ }
52
+ }
53
+ },
54
+ errorMessage: {
55
+ type: 'GoogleSheetGetMany request properties should be an object.'
56
+ }
57
+ };
@@ -16,9 +16,9 @@
16
16
  import getSheet from '../getSheet.js';
17
17
  import { transformRead } from '../transformTypes.js';
18
18
  import mingoFilter from '../mingoFilter.js';
19
- async function googleSheetGetOne({ request , connection }) {
20
- const { filter , options ={
21
- } } = request;
19
+ import schema from './schema.js';
20
+ async function GoogleSheetGetOne({ request , connection }) {
21
+ const { filter , options ={} } = request;
22
22
  const { limit , skip } = options;
23
23
  const sheet = await getSheet({
24
24
  connection
@@ -40,4 +40,9 @@ async function googleSheetGetOne({ request , connection }) {
40
40
  }
41
41
  return rows[0] || null;
42
42
  }
43
- export default googleSheetGetOne;
43
+ GoogleSheetGetOne.schema = schema;
44
+ GoogleSheetGetOne.meta = {
45
+ checkRead: true,
46
+ checkWrite: false
47
+ };
48
+ export default GoogleSheetGetOne;
@@ -0,0 +1,50 @@
1
+ /*
2
+ Copyright 2020-2021 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ title: 'Lowdefy Request Schema - GoogleSheetGetOne',
18
+ type: 'object',
19
+ properties: {
20
+ filter: {
21
+ type: 'object',
22
+ description: 'A MongoDB query expression to filter the data.',
23
+ errorMessage: {
24
+ type: 'GoogleSheetGetOne request property "filter" should be an object.'
25
+ }
26
+ },
27
+ options: {
28
+ type: 'object',
29
+ properties: {
30
+ limit: {
31
+ type: 'number',
32
+ description: 'The maximum number of rows to fetch.',
33
+ errorMessage: {
34
+ type: 'GoogleSheetGetOne request property "options.limit" should be a number.'
35
+ }
36
+ },
37
+ skip: {
38
+ type: 'number',
39
+ description: 'The number of rows to skip from the top of the sheet.',
40
+ errorMessage: {
41
+ type: 'GoogleSheetGetOne request property "options.skip" should be a number.'
42
+ }
43
+ }
44
+ }
45
+ }
46
+ },
47
+ errorMessage: {
48
+ type: 'GoogleSheetGetOne request properties should be an object.'
49
+ }
50
+ };
@@ -15,9 +15,9 @@
15
15
  */ import getSheet from '../getSheet.js';
16
16
  import { transformRead, transformWrite } from '../transformTypes.js';
17
17
  import mingoFilter from '../mingoFilter.js';
18
- async function googleSheetUpdateMany({ request , connection }) {
19
- const { filter , update , options ={
20
- } } = request;
18
+ import schema from './schema.js';
19
+ async function GoogleSheetUpdateMany({ request , connection }) {
20
+ const { filter , update , options ={} } = request;
21
21
  const { limit , skip , raw } = options;
22
22
  const sheet = await getSheet({
23
23
  connection
@@ -54,4 +54,9 @@ async function googleSheetUpdateMany({ request , connection }) {
54
54
  modifiedCount: rows.length
55
55
  };
56
56
  }
57
- export default googleSheetUpdateMany;
57
+ GoogleSheetUpdateMany.schema = schema;
58
+ GoogleSheetUpdateMany.meta = {
59
+ checkRead: false,
60
+ checkWrite: true
61
+ };
62
+ export default GoogleSheetUpdateMany;
@@ -0,0 +1,72 @@
1
+ /*
2
+ Copyright 2020-2021 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ title: 'Lowdefy Request Schema - GoogleSheetUpdateMany',
18
+ type: 'object',
19
+ required: [
20
+ 'update',
21
+ 'filter'
22
+ ],
23
+ properties: {
24
+ filter: {
25
+ type: 'object',
26
+ description: 'A MongoDB query expression to filter the data. All rows matched by the filter will be updated.',
27
+ errorMessage: {
28
+ type: 'GoogleSheetUpdateMany request property "filter" should be an object.'
29
+ }
30
+ },
31
+ update: {
32
+ type: 'object',
33
+ description: 'The update to apply to the row. An object where keys are the column names and values are the updated values.',
34
+ errorMessage: {
35
+ type: 'GoogleSheetUpdateMany request property "update" should be an object.'
36
+ }
37
+ },
38
+ options: {
39
+ type: 'object',
40
+ properties: {
41
+ limit: {
42
+ type: 'number',
43
+ description: 'The maximum number of rows to fetch.',
44
+ errorMessage: {
45
+ type: 'GoogleSheetUpdateMany request property "options.limit" should be a number.'
46
+ }
47
+ },
48
+ raw: {
49
+ type: 'boolean',
50
+ description: 'Store raw values instead of converting as if typed into the sheets UI.',
51
+ errorMessage: {
52
+ type: 'GoogleSheetUpdateMany request property "options.raw" should be a boolean.'
53
+ }
54
+ },
55
+ skip: {
56
+ type: 'number',
57
+ description: 'The number of rows to skip from the top of the sheet.',
58
+ errorMessage: {
59
+ type: 'GoogleSheetUpdateMany request property "options.skip" should be a number.'
60
+ }
61
+ }
62
+ }
63
+ }
64
+ },
65
+ errorMessage: {
66
+ type: 'GoogleSheetUpdateMany request properties should be an object.',
67
+ required: {
68
+ filter: 'GoogleSheetUpdateMany request should have required property "filter".',
69
+ update: 'GoogleSheetUpdateMany request should have required property "update".'
70
+ }
71
+ }
72
+ };
@@ -16,9 +16,9 @@
16
16
  import getSheet from '../getSheet.js';
17
17
  import { transformRead, transformWrite } from '../transformTypes.js';
18
18
  import mingoFilter from '../mingoFilter.js';
19
- async function googleSheetUpdateOne({ request , connection }) {
20
- const { filter , update , options ={
21
- } } = request;
19
+ import schema from './schema.js';
20
+ async function GoogleSheetUpdateOne({ request , connection }) {
21
+ const { filter , update , options ={} } = request;
22
22
  const { limit , skip , upsert , raw } = options;
23
23
  const sheet = await getSheet({
24
24
  connection
@@ -66,4 +66,9 @@ async function googleSheetUpdateOne({ request , connection }) {
66
66
  row: cleanRows(row)
67
67
  };
68
68
  }
69
- export default googleSheetUpdateOne;
69
+ GoogleSheetUpdateOne.schema = schema;
70
+ GoogleSheetUpdateOne.meta = {
71
+ checkRead: false,
72
+ checkWrite: true
73
+ };
74
+ export default GoogleSheetUpdateOne;
@@ -0,0 +1,79 @@
1
+ /*
2
+ Copyright 2020-2021 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ $schema: 'http://json-schema.org/draft-07/schema#',
17
+ title: 'Lowdefy Request Schema - GoogleSheetUpdateOne',
18
+ type: 'object',
19
+ required: [
20
+ 'update',
21
+ 'filter'
22
+ ],
23
+ properties: {
24
+ filter: {
25
+ type: 'object',
26
+ description: 'A MongoDB query expression to filter the data. The first row matched by the filter will be updated.',
27
+ errorMessage: {
28
+ type: 'GoogleSheetUpdateOne request property "filter" should be an object.'
29
+ }
30
+ },
31
+ update: {
32
+ type: 'object',
33
+ description: 'The update to apply to the row. An object where keys are the column names and values are the updated values.',
34
+ errorMessage: {
35
+ type: 'GoogleSheetUpdateOne request property "update" should be an object.'
36
+ }
37
+ },
38
+ options: {
39
+ type: 'object',
40
+ properties: {
41
+ limit: {
42
+ type: 'number',
43
+ description: 'The maximum number of rows to fetch.',
44
+ errorMessage: {
45
+ type: 'GoogleSheetUpdateOne request property "options.limit" should be a number.'
46
+ }
47
+ },
48
+ raw: {
49
+ type: 'boolean',
50
+ description: 'Store raw values instead of converting as if typed into the sheets UI.',
51
+ errorMessage: {
52
+ type: 'GoogleSheetUpdateOne request property "options.raw" should be a boolean.'
53
+ }
54
+ },
55
+ skip: {
56
+ type: 'number',
57
+ description: 'The number of rows to skip from the top of the sheet.',
58
+ errorMessage: {
59
+ type: 'GoogleSheetUpdateOne request property "options.skip" should be a number.'
60
+ }
61
+ },
62
+ upsert: {
63
+ type: 'boolean',
64
+ description: 'Insert the row if no rows are matched by the filter.',
65
+ errorMessage: {
66
+ type: 'GoogleSheetUpdateOne request property "options.upsert" should be a boolean.'
67
+ }
68
+ }
69
+ }
70
+ }
71
+ },
72
+ errorMessage: {
73
+ type: 'GoogleSheetUpdateOne request properties should be an object.',
74
+ required: {
75
+ filter: 'GoogleSheetUpdateOne request should have required property "filter".',
76
+ update: 'GoogleSheetUpdateOne request should have required property "update".'
77
+ }
78
+ }
79
+ };
@@ -14,17 +14,23 @@
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
16
  import mingo from 'mingo';
17
- import { useOperators, OperatorType } from 'mingo/core';
18
- import * as accumulatorOperators from 'mingo/operators/accumulator';
19
- import * as expressionOperators from 'mingo/operators/expression';
20
- import * as pipelineOperators from 'mingo/operators/pipeline';
21
- import * as queryOperators from 'mingo/operators/query';
22
- import * as projectionOperators from 'mingo/operators/projection';
23
- useOperators(OperatorType.ACCUMULATOR, accumulatorOperators);
24
- useOperators(OperatorType.EXPRESSION, expressionOperators);
25
- useOperators(OperatorType.PIPELINE, pipelineOperators);
26
- useOperators(OperatorType.PROJECTION, queryOperators);
27
- useOperators(OperatorType.QUERY, projectionOperators);
17
+ // TODO: fix build to work with:
18
+ // import 'mingo/init/system';
19
+ import { useOperators, OperatorType } from 'mingo/core.js';
20
+ import * as accumulatorOperators from 'mingo/operators/accumulator/index.js';
21
+ import * as expressionOperators from 'mingo/operators/expression/index.js';
22
+ import * as pipelineOperators from 'mingo/operators/pipeline/index.js';
23
+ import * as queryOperators from 'mingo/operators/query/index.js';
24
+ import * as projectionOperators from 'mingo/operators/projection/index.js';
25
+ // "import * as" is returning different object structures when the connection is being
26
+ // imported in the build or when running the tests.
27
+ // So we check for the a default object with all the named exports, otherwise the
28
+ // returned object has all the named exports.
29
+ useOperators(OperatorType.ACCUMULATOR, accumulatorOperators.default || accumulatorOperators);
30
+ useOperators(OperatorType.EXPRESSION, expressionOperators.default || expressionOperators);
31
+ useOperators(OperatorType.PIPELINE, pipelineOperators.default || pipelineOperators);
32
+ useOperators(OperatorType.QUERY, queryOperators.default || queryOperators);
33
+ useOperators(OperatorType.PROJECTION, projectionOperators.default || projectionOperators);
28
34
  function mingoAggregation({ input =[] , pipeline =[] }) {
29
35
  if (!type.isArray(input)) {
30
36
  throw new Error('Mingo aggregation error. Argument "input" should be an array.');
@@ -13,9 +13,8 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
- import mingoAggregation from './mingoAggregation';
17
- function mingoFilter({ input =[] , filter ={
18
- } }) {
16
+ import mingoAggregation from './mingoAggregation.js';
17
+ function mingoFilter({ input =[] , filter ={} }) {
19
18
  if (!type.isObject(filter)) {
20
19
  throw new Error('Mingo filter error. Argument "filter" should be an object.');
21
20
  }