@lowdefy/connection-google-sheets 0.0.0-experimental-20250915134255 → 0.0.0-experimental-20251010122007
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/dist/connections/GoogleSheet/GoogleSheetAppendMany/documentation.md +93 -0
- package/dist/connections/GoogleSheet/GoogleSheetAppendOne/documentation.md +79 -0
- package/dist/connections/GoogleSheet/GoogleSheetDeleteOne/documentation.md +85 -0
- package/dist/connections/GoogleSheet/GoogleSheetGetMany/documentation.md +145 -0
- package/dist/connections/GoogleSheet/GoogleSheetGetOne/documentation.md +80 -0
- package/dist/connections/GoogleSheet/GoogleSheetUpdateMany/documentation.md +105 -0
- package/dist/connections/GoogleSheet/GoogleSheetUpdateOne/documentation.md +113 -0
- package/dist/connections/GoogleSheet/documentation.md +176 -0
- package/package.json +3 -3
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
GoogleSheetAppendMany
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
The `GoogleSheetAppendMany` request inserts an array of documents as rows in a Google Sheet.
|
|
8
|
+
|
|
9
|
+
### Properties
|
|
10
|
+
|
|
11
|
+
- `rows: object[]`: __Required__ - 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.
|
|
12
|
+
- `options: object`: Optional settings. Supported settings are:
|
|
13
|
+
- `raw: boolean`: Store raw values instead of converting as if typed into the sheets UI.
|
|
14
|
+
|
|
15
|
+
</DESCRIPTION>
|
|
16
|
+
|
|
17
|
+
<CONNECTION>
|
|
18
|
+
GoogleSheet
|
|
19
|
+
</CONNECTION>
|
|
20
|
+
|
|
21
|
+
<SCHEMA>
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
export default {
|
|
25
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
26
|
+
title: 'Lowdefy Request Schema - GoogleSheetAppendMany',
|
|
27
|
+
type: 'object',
|
|
28
|
+
required: ['rows'],
|
|
29
|
+
properties: {
|
|
30
|
+
rows: {
|
|
31
|
+
type: 'array',
|
|
32
|
+
description:
|
|
33
|
+
'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.',
|
|
34
|
+
errorMessage: {
|
|
35
|
+
type: 'GoogleSheetAppendMany request property "rows" should be an array.',
|
|
36
|
+
},
|
|
37
|
+
items: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
description:
|
|
40
|
+
'The row to insert into the sheet. An object where keys are the column names and values are the values to insert.',
|
|
41
|
+
errorMessage: {
|
|
42
|
+
type: 'GoogleSheetAppendMany request property "rows" should be an array of objects.',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
options: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
properties: {
|
|
49
|
+
raw: {
|
|
50
|
+
type: 'boolean',
|
|
51
|
+
description: 'Store raw values instead of converting as if typed into the sheets UI.',
|
|
52
|
+
errorMessage: {
|
|
53
|
+
type: 'GoogleSheetAppendMany request property "options.raw" should be a boolean.',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
errorMessage: {
|
|
60
|
+
type: 'GoogleSheetAppendMany request properties should be an object.',
|
|
61
|
+
required: {
|
|
62
|
+
rows: 'GoogleSheetAppendMany request should have required property "rows".',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
</SCHEMA>
|
|
69
|
+
|
|
70
|
+
<EXAMPLES>
|
|
71
|
+
|
|
72
|
+
### Insert a list of rows
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
requests:
|
|
76
|
+
- id: append_rows
|
|
77
|
+
type: GoogleSheetAppendMany
|
|
78
|
+
connectionId: google_sheets
|
|
79
|
+
properties:
|
|
80
|
+
rows:
|
|
81
|
+
- name: D.Va
|
|
82
|
+
role: Tank
|
|
83
|
+
- name: Tracer
|
|
84
|
+
role: Damage
|
|
85
|
+
- name: Genji
|
|
86
|
+
role: Damage
|
|
87
|
+
- name: Reinhart
|
|
88
|
+
role: Tank
|
|
89
|
+
- name: Mercy
|
|
90
|
+
role: Support
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
</EXAMPLES>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
GoogleSheetAppendOne
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
The `GoogleSheetAppendOne` request inserts a documents as a row in a Google Sheet.
|
|
8
|
+
|
|
9
|
+
### Properties
|
|
10
|
+
|
|
11
|
+
- `row: object`: __Required__ - The row to insert into the sheet. An object where keys are the column names and values are the values to insert.
|
|
12
|
+
- `options: object`: Optional settings. Supported settings are:
|
|
13
|
+
- `raw: boolean`: Store raw values instead of converting as if typed into the sheets UI.
|
|
14
|
+
|
|
15
|
+
</DESCRIPTION>
|
|
16
|
+
|
|
17
|
+
<CONNECTION>
|
|
18
|
+
GoogleSheet
|
|
19
|
+
</CONNECTION>
|
|
20
|
+
|
|
21
|
+
<SCHEMA>
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
export default {
|
|
25
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
26
|
+
title: 'Lowdefy Request Schema - GoogleSheetAppendOne',
|
|
27
|
+
type: 'object',
|
|
28
|
+
required: ['row'],
|
|
29
|
+
properties: {
|
|
30
|
+
row: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
description:
|
|
33
|
+
'The row to insert into the sheet. An object where keys are the column names and values are the values to insert.',
|
|
34
|
+
errorMessage: {
|
|
35
|
+
type: 'GoogleSheetAppendOne request property "row" should be an object.',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
options: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
raw: {
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
description: 'Store raw values instead of converting as if typed into the sheets UI.',
|
|
44
|
+
errorMessage: {
|
|
45
|
+
type: 'GoogleSheetAppendOne request property "options.raw" should be a boolean.',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
errorMessage: {
|
|
52
|
+
type: 'GoogleSheetAppendOne request properties should be an object.',
|
|
53
|
+
required: {
|
|
54
|
+
row: 'GoogleSheetAppendOne request should have required property "row".',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
</SCHEMA>
|
|
61
|
+
|
|
62
|
+
<EXAMPLES>
|
|
63
|
+
|
|
64
|
+
### Insert a single row
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
requests:
|
|
68
|
+
- id: insert_dva
|
|
69
|
+
type: GoogleSheetAppendOne
|
|
70
|
+
connectionId: google_sheets
|
|
71
|
+
properties:
|
|
72
|
+
row:
|
|
73
|
+
name: D.Va
|
|
74
|
+
role: Tank
|
|
75
|
+
real_name: Hana Song
|
|
76
|
+
age: 19
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
</EXAMPLES>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
GoogleSheetDeleteOne
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
The `GoogleSheetDeleteOne` request deletes a row from a Google Sheet. It deletes the first row matched by the filter, written as a MongoDB query expression.
|
|
8
|
+
|
|
9
|
+
### Properties
|
|
10
|
+
|
|
11
|
+
- `filter: object`: __Required__ - A MongoDB query expression to filter the data. The first row matched by the filter will be deleted.
|
|
12
|
+
- `options: object`: Optional settings. Supported settings are:
|
|
13
|
+
- `limit: number`: The maximum number of rows to fetch.
|
|
14
|
+
- `skip: number`: The number of rows to skip from the top of the sheet.
|
|
15
|
+
|
|
16
|
+
</DESCRIPTION>
|
|
17
|
+
|
|
18
|
+
<CONNECTION>
|
|
19
|
+
GoogleSheet
|
|
20
|
+
</CONNECTION>
|
|
21
|
+
|
|
22
|
+
<SCHEMA>
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
export default {
|
|
26
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
27
|
+
title: 'Lowdefy Request Schema - GoogleSheetDeleteOne',
|
|
28
|
+
type: 'object',
|
|
29
|
+
required: ['filter'],
|
|
30
|
+
properties: {
|
|
31
|
+
filter: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
description:
|
|
34
|
+
'A MongoDB query expression to filter the data. The first row matched by the filter will be deleted.',
|
|
35
|
+
errorMessage: {
|
|
36
|
+
type: 'GoogleSheetDeleteOne request property "filter" should be an object.',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
options: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
limit: {
|
|
43
|
+
type: 'number',
|
|
44
|
+
description: 'The maximum number of rows to fetch.',
|
|
45
|
+
errorMessage: {
|
|
46
|
+
type: 'GoogleSheetDeleteOne request property "options.limit" should be a number.',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
skip: {
|
|
50
|
+
type: 'number',
|
|
51
|
+
description: 'The number of rows to skip from the top of the sheet.',
|
|
52
|
+
errorMessage: {
|
|
53
|
+
type: 'GoogleSheetDeleteOne request property "options.skip" should be a number.',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
errorMessage: {
|
|
60
|
+
type: 'GoogleSheetDeleteOne request properties should be an object.',
|
|
61
|
+
required: {
|
|
62
|
+
filter: 'GoogleSheetDeleteOne request should have required property "filter".',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
</SCHEMA>
|
|
69
|
+
|
|
70
|
+
<EXAMPLES>
|
|
71
|
+
|
|
72
|
+
### Delete the row where name is "Hanzo"
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
requests:
|
|
76
|
+
- id: delete_hanzo
|
|
77
|
+
type: GoogleSheetDeleteOne
|
|
78
|
+
connectionId: google_sheets
|
|
79
|
+
properties:
|
|
80
|
+
filter:
|
|
81
|
+
name:
|
|
82
|
+
$eq: Hanzo
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
</EXAMPLES>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
GoogleSheetGetMany
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
The `GoogleSheetGetMany` request fetches a number of rows from the spreadsheet. The `limit` and `skip` options can be used to control which documents are read from the spreadsheet. The filter or pipeline options can then be used to filter or transform the fetched data.
|
|
8
|
+
|
|
9
|
+
### Properties
|
|
10
|
+
|
|
11
|
+
- `filter: object`: A MongoDB query expression to filter the data.
|
|
12
|
+
- `pipeline: object[]`: A MongoDB aggregation pipeline to transform the data.
|
|
13
|
+
- `options: object`: Optional settings. Supported settings are:
|
|
14
|
+
- `limit: number`: The maximum number of rows to fetch.
|
|
15
|
+
- `skip: number`: The number of rows to skip from the top of the sheet.
|
|
16
|
+
|
|
17
|
+
</DESCRIPTION>
|
|
18
|
+
|
|
19
|
+
<CONNECTION>
|
|
20
|
+
GoogleSheet
|
|
21
|
+
</CONNECTION>
|
|
22
|
+
|
|
23
|
+
<SCHEMA>
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
export default {
|
|
27
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
28
|
+
title: 'Lowdefy Request Schema - GoogleSheetGetMany',
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: {
|
|
31
|
+
filter: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
description: 'A MongoDB query expression to filter the data.',
|
|
34
|
+
errorMessage: {
|
|
35
|
+
type: 'GoogleSheetGetMany request property "filter" should be an object.',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
pipeline: {
|
|
39
|
+
type: 'array',
|
|
40
|
+
description: 'A MongoDB aggregation pipeline to transform the data.',
|
|
41
|
+
errorMessage: {
|
|
42
|
+
type: 'GoogleSheetGetMany request property "pipeline" should be an array.',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
options: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: {
|
|
48
|
+
limit: {
|
|
49
|
+
type: 'number',
|
|
50
|
+
description: 'The maximum number of rows to fetch.',
|
|
51
|
+
errorMessage: {
|
|
52
|
+
type: 'GoogleSheetGetMany request property "options.limit" should be a number.',
|
|
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: 'GoogleSheetGetMany request property "options.skip" should be a number.',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
errorMessage: {
|
|
66
|
+
type: 'GoogleSheetGetMany request properties should be an object.',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
</SCHEMA>
|
|
72
|
+
|
|
73
|
+
<EXAMPLES>
|
|
74
|
+
|
|
75
|
+
### Get the first 10 rows
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
requests:
|
|
79
|
+
- id: get_10_rows
|
|
80
|
+
type: GoogleSheetGetMany
|
|
81
|
+
connectionId: google_sheets
|
|
82
|
+
properties:
|
|
83
|
+
options:
|
|
84
|
+
limit: 10
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Pagination using limit and skip
|
|
88
|
+
|
|
89
|
+
```yaml
|
|
90
|
+
requests:
|
|
91
|
+
- id: get_10_rows
|
|
92
|
+
type: GoogleSheetGetMany
|
|
93
|
+
connectionId: google_sheets
|
|
94
|
+
payload:
|
|
95
|
+
page_size:
|
|
96
|
+
_state: page_size
|
|
97
|
+
page_number:
|
|
98
|
+
_state: page_number
|
|
99
|
+
properties:
|
|
100
|
+
options:
|
|
101
|
+
skip:
|
|
102
|
+
_product:
|
|
103
|
+
- _payload: page_size
|
|
104
|
+
- _subtract:
|
|
105
|
+
- _payload: page_number
|
|
106
|
+
- 1
|
|
107
|
+
limit:
|
|
108
|
+
_payload: page_size
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Get all records where age is greater than 25
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
requests:
|
|
115
|
+
- id: get_10_rows
|
|
116
|
+
type: GoogleSheetGetMany
|
|
117
|
+
connectionId: google_sheets
|
|
118
|
+
properties:
|
|
119
|
+
filter:
|
|
120
|
+
age:
|
|
121
|
+
$gt: 25
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Use an aggregation pipeline to aggregate data
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
requests:
|
|
128
|
+
- id: get_10_rows
|
|
129
|
+
type: GoogleSheetGetMany
|
|
130
|
+
connectionId: google_sheets
|
|
131
|
+
properties:
|
|
132
|
+
pipeline:
|
|
133
|
+
- $group:
|
|
134
|
+
_id: $region
|
|
135
|
+
score:
|
|
136
|
+
$avg: $score
|
|
137
|
+
- $project:
|
|
138
|
+
_id: 0
|
|
139
|
+
region: $_id
|
|
140
|
+
score: 1
|
|
141
|
+
- $sort:
|
|
142
|
+
score: 1
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
</EXAMPLES>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
GoogleSheetGetOne
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
The `GoogleSheetGetOne` request fetches a single rows from the spreadsheet. The `limit` and `skip` options can be used to control which documents are read from the spreadsheet. The filter option can then be used to filter or select which row is returned.
|
|
8
|
+
|
|
9
|
+
### Properties
|
|
10
|
+
|
|
11
|
+
- `filter: object`: A MongoDB query expression to filter the data.
|
|
12
|
+
- `options: object`: Optional settings. Supported settings are:
|
|
13
|
+
- `limit: number`: The maximum number of rows to fetch.
|
|
14
|
+
- `skip: number`: The number of rows to skip from the top of the sheet.
|
|
15
|
+
|
|
16
|
+
</DESCRIPTION>
|
|
17
|
+
|
|
18
|
+
<CONNECTION>
|
|
19
|
+
GoogleSheet
|
|
20
|
+
</CONNECTION>
|
|
21
|
+
|
|
22
|
+
<SCHEMA>
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
export default {
|
|
26
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
27
|
+
title: 'Lowdefy Request Schema - GoogleSheetGetOne',
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
filter: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
description: 'A MongoDB query expression to filter the data.',
|
|
33
|
+
errorMessage: {
|
|
34
|
+
type: 'GoogleSheetGetOne request property "filter" should be an object.',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
options: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
limit: {
|
|
41
|
+
type: 'number',
|
|
42
|
+
description: 'The maximum number of rows to fetch.',
|
|
43
|
+
errorMessage: {
|
|
44
|
+
type: 'GoogleSheetGetOne request property "options.limit" should be a number.',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
skip: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: 'The number of rows to skip from the top of the sheet.',
|
|
50
|
+
errorMessage: {
|
|
51
|
+
type: 'GoogleSheetGetOne request property "options.skip" should be a number.',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
errorMessage: {
|
|
58
|
+
type: 'GoogleSheetGetOne request properties should be an object.',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
</SCHEMA>
|
|
64
|
+
|
|
65
|
+
<EXAMPLES>
|
|
66
|
+
|
|
67
|
+
### Get row where name is "Zarya"
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
requests:
|
|
71
|
+
- id: get_10_rows
|
|
72
|
+
type: GoogleSheetGetOne
|
|
73
|
+
connectionId: google_sheets
|
|
74
|
+
properties:
|
|
75
|
+
filter:
|
|
76
|
+
name:
|
|
77
|
+
$eq: Zarya
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
</EXAMPLES>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
GoogleSheetUpdateMany
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
The `GoogleSheetUpdateMany` request updates all the rows matched by the filter.
|
|
8
|
+
|
|
9
|
+
### Properties
|
|
10
|
+
|
|
11
|
+
- `filter: object`: A MongoDB query expression to filter the data. . All rows matched by the filter will be updated.
|
|
12
|
+
- `update: object`: The update to apply to the row. An object where keys are the column names and values are the updated values.
|
|
13
|
+
- `options: object`: Optional settings. Supported settings are:
|
|
14
|
+
- `limit: number`: The maximum number of rows to fetch.
|
|
15
|
+
- `raw: boolean`: Store raw values instead of converting as if typed into the sheets UI.
|
|
16
|
+
- `skip: number`: The number of rows to skip from the top of the sheet.
|
|
17
|
+
|
|
18
|
+
</DESCRIPTION>
|
|
19
|
+
|
|
20
|
+
<CONNECTION>
|
|
21
|
+
GoogleSheet
|
|
22
|
+
</CONNECTION>
|
|
23
|
+
|
|
24
|
+
<SCHEMA>
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
export default {
|
|
28
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
29
|
+
title: 'Lowdefy Request Schema - GoogleSheetUpdateMany',
|
|
30
|
+
type: 'object',
|
|
31
|
+
required: ['update', 'filter'],
|
|
32
|
+
properties: {
|
|
33
|
+
filter: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
description:
|
|
36
|
+
'A MongoDB query expression to filter the data. All rows matched by the filter will be updated.',
|
|
37
|
+
errorMessage: {
|
|
38
|
+
type: 'GoogleSheetUpdateMany request property "filter" should be an object.',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
update: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
description:
|
|
44
|
+
'The update to apply to the row. An object where keys are the column names and values are the updated values.',
|
|
45
|
+
errorMessage: {
|
|
46
|
+
type: 'GoogleSheetUpdateMany request property "update" should be an object.',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
options: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {
|
|
52
|
+
limit: {
|
|
53
|
+
type: 'number',
|
|
54
|
+
description: 'The maximum number of rows to fetch.',
|
|
55
|
+
errorMessage: {
|
|
56
|
+
type: 'GoogleSheetUpdateMany request property "options.limit" should be a number.',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
raw: {
|
|
60
|
+
type: 'boolean',
|
|
61
|
+
description: 'Store raw values instead of converting as if typed into the sheets UI.',
|
|
62
|
+
errorMessage: {
|
|
63
|
+
type: 'GoogleSheetUpdateMany request property "options.raw" should be a boolean.',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
skip: {
|
|
67
|
+
type: 'number',
|
|
68
|
+
description: 'The number of rows to skip from the top of the sheet.',
|
|
69
|
+
errorMessage: {
|
|
70
|
+
type: 'GoogleSheetUpdateMany request property "options.skip" should be a number.',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
errorMessage: {
|
|
77
|
+
type: 'GoogleSheetUpdateMany request properties should be an object.',
|
|
78
|
+
required: {
|
|
79
|
+
filter: 'GoogleSheetUpdateMany request should have required property "filter".',
|
|
80
|
+
update: 'GoogleSheetUpdateMany request should have required property "update".',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
</SCHEMA>
|
|
87
|
+
|
|
88
|
+
<EXAMPLES>
|
|
89
|
+
|
|
90
|
+
### Update all rows where age is less than 18
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
requests:
|
|
94
|
+
- id: get_10_rows
|
|
95
|
+
type: GoogleSheetUpdateMany
|
|
96
|
+
connectionId: google_sheets
|
|
97
|
+
properties:
|
|
98
|
+
filter:
|
|
99
|
+
age:
|
|
100
|
+
$lt: 18
|
|
101
|
+
update:
|
|
102
|
+
minor: true
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
</EXAMPLES>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
GoogleSheetUpdateOne
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
The `GoogleSheetUpdateOne` request updates the first row matched by the filter.
|
|
8
|
+
|
|
9
|
+
### Properties
|
|
10
|
+
|
|
11
|
+
- `filter: object`: A MongoDB query expression to filter the data. . The first row matched by the filter will be updated.
|
|
12
|
+
- `update: object`: The update to apply to the row. An object where keys are the column names and values are the updated values.
|
|
13
|
+
- `options: object`: Optional settings. Supported settings are:
|
|
14
|
+
- `limit: number`: The maximum number of rows to fetch.
|
|
15
|
+
- `raw: boolean`: Store raw values instead of converting as if typed into the sheets UI.
|
|
16
|
+
- `skip: number`: The number of rows to skip from the top of the sheet.
|
|
17
|
+
- `upsert: boolean`: Insert the row if no rows are matched by the filter.
|
|
18
|
+
|
|
19
|
+
</DESCRIPTION>
|
|
20
|
+
|
|
21
|
+
<CONNECTION>
|
|
22
|
+
GoogleSheet
|
|
23
|
+
</CONNECTION>
|
|
24
|
+
|
|
25
|
+
<SCHEMA>
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
export default {
|
|
29
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
30
|
+
title: 'Lowdefy Request Schema - GoogleSheetUpdateOne',
|
|
31
|
+
type: 'object',
|
|
32
|
+
required: ['update', 'filter'],
|
|
33
|
+
properties: {
|
|
34
|
+
filter: {
|
|
35
|
+
type: 'object',
|
|
36
|
+
description:
|
|
37
|
+
'A MongoDB query expression to filter the data. The first row matched by the filter will be updated.',
|
|
38
|
+
errorMessage: {
|
|
39
|
+
type: 'GoogleSheetUpdateOne request property "filter" should be an object.',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
update: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
description:
|
|
45
|
+
'The update to apply to the row. An object where keys are the column names and values are the updated values.',
|
|
46
|
+
errorMessage: {
|
|
47
|
+
type: 'GoogleSheetUpdateOne request property "update" should be an object.',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
options: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: {
|
|
53
|
+
limit: {
|
|
54
|
+
type: 'number',
|
|
55
|
+
description: 'The maximum number of rows to fetch.',
|
|
56
|
+
errorMessage: {
|
|
57
|
+
type: 'GoogleSheetUpdateOne request property "options.limit" should be a number.',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
raw: {
|
|
61
|
+
type: 'boolean',
|
|
62
|
+
description: 'Store raw values instead of converting as if typed into the sheets UI.',
|
|
63
|
+
errorMessage: {
|
|
64
|
+
type: 'GoogleSheetUpdateOne request property "options.raw" should be a boolean.',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
skip: {
|
|
68
|
+
type: 'number',
|
|
69
|
+
description: 'The number of rows to skip from the top of the sheet.',
|
|
70
|
+
errorMessage: {
|
|
71
|
+
type: 'GoogleSheetUpdateOne request property "options.skip" should be a number.',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
upsert: {
|
|
75
|
+
type: 'boolean',
|
|
76
|
+
description: 'Insert the row if no rows are matched by the filter.',
|
|
77
|
+
errorMessage: {
|
|
78
|
+
type: 'GoogleSheetUpdateOne request property "options.upsert" should be a boolean.',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
errorMessage: {
|
|
85
|
+
type: 'GoogleSheetUpdateOne request properties should be an object.',
|
|
86
|
+
required: {
|
|
87
|
+
filter: 'GoogleSheetUpdateOne request should have required property "filter".',
|
|
88
|
+
update: 'GoogleSheetUpdateOne request should have required property "update".',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
</SCHEMA>
|
|
95
|
+
|
|
96
|
+
<EXAMPLES>
|
|
97
|
+
|
|
98
|
+
### Update the row for "Doomfist"
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
requests:
|
|
102
|
+
- id: get_10_rows
|
|
103
|
+
type: GoogleSheetUpdateOne
|
|
104
|
+
connectionId: google_sheets
|
|
105
|
+
properties:
|
|
106
|
+
filter:
|
|
107
|
+
name:
|
|
108
|
+
$eq: Doomfist
|
|
109
|
+
update:
|
|
110
|
+
overpowered: true
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
</EXAMPLES>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
GoogleSheet
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
The `GoogleSheet` connection offers the flexibility to connect to Google Sheets using either an API key or a service account. While an API key is suitable for read-only access to public sheets, most applications will benefit more from using a service account, which offers broader capabilities. For detailed instructions on creating a service account, you can refer to the [Google Sheets API Quickstart Guide](https://developers.google.com/sheets/api/quickstart/js) and the [Google Workspace Guide on Creating a Project](https://developers.google.com/workspace/guides/create-project).
|
|
8
|
+
|
|
9
|
+
This connection refers to the entire document as the `spreadsheet`, and the individual sheets in the document as `sheets`. The spreadsheet is identified by it's `spreadsheetId`, and sheets can either be identified by their `sheetId` or their `index` (position in the document starting from 0).
|
|
10
|
+
|
|
11
|
+
When a sheet is accessed in a browser the url either looks like:
|
|
12
|
+
`https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit#gid={sheetId}`
|
|
13
|
+
|
|
14
|
+
The `GoogleSheet` connection works with sheets as a row based data store. Each row is a data record, and a header row needs to be present to define the column names. This header needs to be created in the Google Sheets web interface. Types can be specified for any of the columns in the sheet. If a type is not specified, the value will be read as a string. The `json` type will stringify a object as JSON before saving it, and parse it again when reading.
|
|
15
|
+
|
|
16
|
+
### Properties
|
|
17
|
+
|
|
18
|
+
- `apiKey: string`: API key for your google project.
|
|
19
|
+
- `client_email: string`: The email address of your service account.
|
|
20
|
+
- `private_key: string`: The private key for your service account. Base64 encode the string if you have issues with the newline characters in the string.
|
|
21
|
+
- `sheetId: string`: The ID of the worksheet. Can be found in the URL as the "gid" parameter. One of `sheetId` or `sheetIndex` is required.
|
|
22
|
+
- `sheetIndex: number`: The position of the worksheet as they appear in the Google sheets UI. Starts from 0. One of `sheetId` or `sheetIndex` is required.
|
|
23
|
+
- `spreadsheetId: string`: __Required__ - The document ID from the URL of the spreadsheet.
|
|
24
|
+
- `columnTypes: object`: An object that defines the data types for each column. Each key should be the column name, and the value should be one of: `string`, `number`, `boolean`, `date`, or `json`.
|
|
25
|
+
- `read: boolean`: Default: `true` - Allow read operations like find on the sheet.
|
|
26
|
+
- `write: boolean`: Default: `false` - Allow write operations like update on the sheet.
|
|
27
|
+
|
|
28
|
+
</DESCRIPTION>
|
|
29
|
+
|
|
30
|
+
<REQUESTS>
|
|
31
|
+
|
|
32
|
+
- GoogleSheetAppendMany
|
|
33
|
+
- GoogleSheetAppendOne
|
|
34
|
+
- GoogleSheetDeleteOne
|
|
35
|
+
- GoogleSheetGetMany
|
|
36
|
+
- GoogleSheetGetOne
|
|
37
|
+
- GoogleSheetUpdateMany
|
|
38
|
+
- GoogleSheetUpdateOne
|
|
39
|
+
|
|
40
|
+
</REQUESTS>
|
|
41
|
+
|
|
42
|
+
<SCHEMA>
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
export default {
|
|
46
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
47
|
+
title: 'Lowdefy Connection Schema - GoogleSheet',
|
|
48
|
+
type: 'object',
|
|
49
|
+
required: ['spreadsheetId'],
|
|
50
|
+
properties: {
|
|
51
|
+
apiKey: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'API key for your google project.',
|
|
54
|
+
errorMessage: {
|
|
55
|
+
type: 'GoogleSheet connection property "apiKey" should be a string.',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
client_email: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'The email of your service account.',
|
|
61
|
+
errorMessage: {
|
|
62
|
+
type: 'GoogleSheet connection property "client_email" should be a string.',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
private_key: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: 'The private key for your service account.',
|
|
68
|
+
errorMessage: {
|
|
69
|
+
type: 'GoogleSheet connection property "private_key" should be a string.',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
sheetId: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
description:
|
|
75
|
+
'The ID of the worksheet. Can be found in the URL as the "gid" parameter. One of "sheetId" or "sheetIndex" is required.',
|
|
76
|
+
errorMessage: {
|
|
77
|
+
type: 'GoogleSheet connection property "sheetId" should be a string.',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
sheetIndex: {
|
|
81
|
+
type: 'number',
|
|
82
|
+
description:
|
|
83
|
+
'The position of the worksheet as they appear in the Google sheets UI. Starts from 0. One of "sheetId" or "sheetIndex" is required.',
|
|
84
|
+
errorMessage: {
|
|
85
|
+
type: 'GoogleSheet connection property "sheetIndex" should be a number.',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
spreadsheetId: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
description: 'document ID from the URL of the spreadsheet.',
|
|
91
|
+
errorMessage: {
|
|
92
|
+
type: 'GoogleSheet connection property "spreadsheetId" should be a string.',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
columnTypes: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
description: 'Define types for columns in the spreadsheet.',
|
|
98
|
+
patternProperties: {
|
|
99
|
+
'^.*$': {
|
|
100
|
+
type: 'string',
|
|
101
|
+
enum: ['string', 'number', 'boolean', 'date', 'json'],
|
|
102
|
+
errorMessage: {
|
|
103
|
+
enum: 'GoogleSheet connection property "{{ instancePath }}" should be one of "string", "number", "boolean", "date", or "json".',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
errorMessage: {
|
|
108
|
+
type: 'GoogleSheet connection property "columnTypes" should be an object.',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
read: {
|
|
112
|
+
type: 'boolean',
|
|
113
|
+
default: true,
|
|
114
|
+
description: 'Allow reads from the spreadsheet.',
|
|
115
|
+
errorMessage: {
|
|
116
|
+
type: 'GoogleSheet connection property "read" should be a boolean.',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
write: {
|
|
120
|
+
type: 'boolean',
|
|
121
|
+
default: false,
|
|
122
|
+
description: 'Allow writes to the spreadsheet.',
|
|
123
|
+
errorMessage: {
|
|
124
|
+
type: 'GoogleSheet connection property "write" should be a boolean.',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
errorMessage: {
|
|
129
|
+
type: 'GoogleSheet connection properties should be an object.',
|
|
130
|
+
required: {
|
|
131
|
+
spreadsheetId: 'GoogleSheet connection should have required property "spreadsheetId".',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
</SCHEMA>
|
|
138
|
+
|
|
139
|
+
<EXAMPLES>
|
|
140
|
+
|
|
141
|
+
### Read only access to first sheet in a public spreadsheet
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
connections:
|
|
145
|
+
- id: public_sheet
|
|
146
|
+
type: GoogleSheet
|
|
147
|
+
properties:
|
|
148
|
+
apiKey:
|
|
149
|
+
_secret: GOOGLE_SHEETS_API_KEY
|
|
150
|
+
sheetIndex: 0
|
|
151
|
+
spreadsheetId: ubQsWYNGRUq0gFB1sAp2r9oYE19lZ8yGA1T6y0yBoLPW
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Access with a service account, with defined types
|
|
155
|
+
|
|
156
|
+
```yaml
|
|
157
|
+
connections:
|
|
158
|
+
- id: my_sheet
|
|
159
|
+
type: GoogleSheet
|
|
160
|
+
properties:
|
|
161
|
+
client_email:
|
|
162
|
+
_secret: GOOGLE_SHEETS_CLIENT_EMAIL
|
|
163
|
+
private_key:
|
|
164
|
+
_base64.decode:
|
|
165
|
+
_secret: GOOGLE_SHEETS_PRIVATE_KEY
|
|
166
|
+
sheetId: '1199545345'
|
|
167
|
+
spreadsheetId: ubQsWYNGRUq0gFB1sAp2r9oYE19lZ8yGA1T6y0yBoLPW
|
|
168
|
+
columnTypes:
|
|
169
|
+
name: string
|
|
170
|
+
age: number
|
|
171
|
+
birthday: date
|
|
172
|
+
subscribed: boolean
|
|
173
|
+
address: json
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
</EXAMPLES>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/connection-google-sheets",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20251010122007",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"dist/*"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
38
|
+
"@lowdefy/helpers": "0.0.0-experimental-20251010122007",
|
|
39
39
|
"google-spreadsheet": "3.3.0",
|
|
40
40
|
"mingo": "6.4.9",
|
|
41
41
|
"moment": "2.29.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@jest/globals": "28.1.3",
|
|
45
|
-
"@lowdefy/ajv": "0.0.0-experimental-
|
|
45
|
+
"@lowdefy/ajv": "0.0.0-experimental-20251010122007",
|
|
46
46
|
"@swc/cli": "0.1.63",
|
|
47
47
|
"@swc/core": "1.3.99",
|
|
48
48
|
"@swc/jest": "0.2.29",
|