@openfn/language-googlesheets 2.2.2 → 2.3.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 +93 -2
- package/dist/index.cjs +100 -13
- package/dist/index.js +103 -15
- package/package.json +2 -3
- package/types/Adaptor.d.ts +44 -1
package/ast.json
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
{
|
|
4
4
|
"name": "appendValues",
|
|
5
5
|
"params": [
|
|
6
|
-
"params"
|
|
6
|
+
"params",
|
|
7
|
+
"callback"
|
|
7
8
|
],
|
|
8
9
|
"docs": {
|
|
9
10
|
"description": "Add an array of rows to the spreadsheet.\nhttps://developers.google.com/sheets/api/samples/writing#append_values",
|
|
@@ -31,6 +32,42 @@
|
|
|
31
32
|
},
|
|
32
33
|
"name": "params"
|
|
33
34
|
},
|
|
35
|
+
{
|
|
36
|
+
"title": "param",
|
|
37
|
+
"description": "The spreadsheet ID.",
|
|
38
|
+
"type": {
|
|
39
|
+
"type": "OptionalType",
|
|
40
|
+
"expression": {
|
|
41
|
+
"type": "NameExpression",
|
|
42
|
+
"name": "string"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"name": "params.spreadsheetId"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"title": "param",
|
|
49
|
+
"description": "The range of values to update.",
|
|
50
|
+
"type": {
|
|
51
|
+
"type": "OptionalType",
|
|
52
|
+
"expression": {
|
|
53
|
+
"type": "NameExpression",
|
|
54
|
+
"name": "string"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"name": "params.range"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"title": "param",
|
|
61
|
+
"description": "A 2d array of values to update.",
|
|
62
|
+
"type": {
|
|
63
|
+
"type": "OptionalType",
|
|
64
|
+
"expression": {
|
|
65
|
+
"type": "NameExpression",
|
|
66
|
+
"name": "array"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"name": "params.values"
|
|
70
|
+
},
|
|
34
71
|
{
|
|
35
72
|
"title": "returns",
|
|
36
73
|
"description": null,
|
|
@@ -41,7 +78,61 @@
|
|
|
41
78
|
}
|
|
42
79
|
]
|
|
43
80
|
},
|
|
44
|
-
"valid":
|
|
81
|
+
"valid": false
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "getValues",
|
|
85
|
+
"params": [
|
|
86
|
+
"spreadsheetId",
|
|
87
|
+
"range",
|
|
88
|
+
"callback"
|
|
89
|
+
],
|
|
90
|
+
"docs": {
|
|
91
|
+
"description": "Gets cell values from a Spreadsheet.",
|
|
92
|
+
"tags": [
|
|
93
|
+
{
|
|
94
|
+
"title": "public",
|
|
95
|
+
"description": null,
|
|
96
|
+
"type": null
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"title": "example",
|
|
100
|
+
"description": "getValues('1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos','Sheet1!A1:E1')"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"title": "function",
|
|
104
|
+
"description": null,
|
|
105
|
+
"name": null
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"title": "param",
|
|
109
|
+
"description": "The spreadsheet ID.",
|
|
110
|
+
"type": {
|
|
111
|
+
"type": "NameExpression",
|
|
112
|
+
"name": "string"
|
|
113
|
+
},
|
|
114
|
+
"name": "spreadsheetId"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"title": "param",
|
|
118
|
+
"description": "The sheet range.",
|
|
119
|
+
"type": {
|
|
120
|
+
"type": "NameExpression",
|
|
121
|
+
"name": "string"
|
|
122
|
+
},
|
|
123
|
+
"name": "range"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"title": "returns",
|
|
127
|
+
"description": "spreadsheet information",
|
|
128
|
+
"type": {
|
|
129
|
+
"type": "NameExpression",
|
|
130
|
+
"name": "Operation"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"valid": false
|
|
45
136
|
}
|
|
46
137
|
],
|
|
47
138
|
"exports": [],
|
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,7 @@ var src_exports = {};
|
|
|
21
21
|
__export(src_exports, {
|
|
22
22
|
alterState: () => import_language_common2.alterState,
|
|
23
23
|
appendValues: () => appendValues,
|
|
24
|
+
batchUpdateValues: () => batchUpdateValues,
|
|
24
25
|
combine: () => import_language_common2.combine,
|
|
25
26
|
dataPath: () => import_language_common2.dataPath,
|
|
26
27
|
dataValue: () => import_language_common2.dataValue,
|
|
@@ -30,6 +31,7 @@ __export(src_exports, {
|
|
|
30
31
|
field: () => import_language_common2.field,
|
|
31
32
|
fields: () => import_language_common2.fields,
|
|
32
33
|
fn: () => import_language_common2.fn,
|
|
34
|
+
getValues: () => getValues,
|
|
33
35
|
http: () => import_language_common2.http,
|
|
34
36
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
35
37
|
merge: () => import_language_common2.merge,
|
|
@@ -42,6 +44,7 @@ var Adaptor_exports = {};
|
|
|
42
44
|
__export(Adaptor_exports, {
|
|
43
45
|
alterState: () => import_language_common2.alterState,
|
|
44
46
|
appendValues: () => appendValues,
|
|
47
|
+
batchUpdateValues: () => batchUpdateValues,
|
|
45
48
|
combine: () => import_language_common2.combine,
|
|
46
49
|
dataPath: () => import_language_common2.dataPath,
|
|
47
50
|
dataValue: () => import_language_common2.dataValue,
|
|
@@ -50,6 +53,7 @@ __export(Adaptor_exports, {
|
|
|
50
53
|
field: () => import_language_common2.field,
|
|
51
54
|
fields: () => import_language_common2.fields,
|
|
52
55
|
fn: () => import_language_common2.fn,
|
|
56
|
+
getValues: () => getValues,
|
|
53
57
|
http: () => import_language_common2.http,
|
|
54
58
|
lastReferenceValue: () => import_language_common2.lastReferenceValue,
|
|
55
59
|
merge: () => import_language_common2.merge,
|
|
@@ -59,30 +63,53 @@ var import_language_common = require("@openfn/language-common");
|
|
|
59
63
|
var import_util = require("@openfn/language-common/util");
|
|
60
64
|
var import_googleapis = require("googleapis");
|
|
61
65
|
var import_language_common2 = require("@openfn/language-common");
|
|
66
|
+
var client = void 0;
|
|
67
|
+
function createConnection(state) {
|
|
68
|
+
const { accessToken } = state.configuration;
|
|
69
|
+
const auth = new import_googleapis.google.auth.OAuth2();
|
|
70
|
+
auth.credentials = { access_token: accessToken };
|
|
71
|
+
client = import_googleapis.google.sheets({ version: "v4", auth });
|
|
72
|
+
return state;
|
|
73
|
+
}
|
|
74
|
+
function removeConnection(state) {
|
|
75
|
+
client = void 0;
|
|
76
|
+
return state;
|
|
77
|
+
}
|
|
78
|
+
function logError(err) {
|
|
79
|
+
const { code, errors, response } = err;
|
|
80
|
+
if (code && errors && response) {
|
|
81
|
+
console.error("The API returned an error:", errors);
|
|
82
|
+
const { statusText, config } = response;
|
|
83
|
+
const { url, method, body } = config;
|
|
84
|
+
const message = `${method} ${url} - ${code}:${statusText}
|
|
85
|
+
body: ${body}`;
|
|
86
|
+
console.log(message);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
62
89
|
function execute(...operations) {
|
|
63
90
|
const initialState = {
|
|
64
91
|
references: [],
|
|
65
92
|
data: null
|
|
66
93
|
};
|
|
67
94
|
return (state) => {
|
|
68
|
-
return (0, import_language_common.execute)(
|
|
95
|
+
return (0, import_language_common.execute)(
|
|
96
|
+
createConnection,
|
|
97
|
+
...operations,
|
|
98
|
+
removeConnection
|
|
99
|
+
)({
|
|
69
100
|
...initialState,
|
|
70
101
|
...state,
|
|
71
102
|
configuration: (0, import_util.normalizeOauthConfig)(state.configuration)
|
|
72
103
|
});
|
|
73
104
|
};
|
|
74
105
|
}
|
|
75
|
-
function appendValues(params) {
|
|
106
|
+
function appendValues(params, callback = (s) => s) {
|
|
76
107
|
return (state) => {
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
oauth2Client.credentials = { access_token: accessToken };
|
|
80
|
-
const { spreadsheetId, range, values } = (0, import_language_common.expandReferences)(params)(state);
|
|
81
|
-
var sheets = import_googleapis.google.sheets("v4");
|
|
108
|
+
const [resolvedParams] = (0, import_util.expandReferences)(state, params);
|
|
109
|
+
const { spreadsheetId, range, values } = resolvedParams;
|
|
82
110
|
return new Promise((resolve, reject) => {
|
|
83
|
-
|
|
111
|
+
client.spreadsheets.values.append(
|
|
84
112
|
{
|
|
85
|
-
auth: oauth2Client,
|
|
86
113
|
spreadsheetId,
|
|
87
114
|
range,
|
|
88
115
|
valueInputOption: "USER_ENTERED",
|
|
@@ -94,19 +121,77 @@ function appendValues(params) {
|
|
|
94
121
|
},
|
|
95
122
|
function(err, response) {
|
|
96
123
|
if (err) {
|
|
97
|
-
|
|
98
|
-
console.log(err);
|
|
124
|
+
logError(err);
|
|
99
125
|
reject(err);
|
|
100
126
|
} else {
|
|
101
127
|
console.log("Success! Here is the response from Google:");
|
|
102
|
-
console.log(response);
|
|
103
|
-
resolve(
|
|
128
|
+
console.log(response.data);
|
|
129
|
+
resolve(
|
|
130
|
+
callback({
|
|
131
|
+
...(0, import_language_common.composeNextState)(state, response.data),
|
|
132
|
+
response
|
|
133
|
+
})
|
|
134
|
+
);
|
|
104
135
|
}
|
|
105
136
|
}
|
|
106
137
|
);
|
|
107
138
|
});
|
|
108
139
|
};
|
|
109
140
|
}
|
|
141
|
+
function batchUpdateValues(params, callback = (s) => s) {
|
|
142
|
+
return async (state) => {
|
|
143
|
+
const [resolvedParams] = (0, import_util.expandReferences)(state, params);
|
|
144
|
+
const {
|
|
145
|
+
spreadsheetId,
|
|
146
|
+
range,
|
|
147
|
+
valueInputOption = "USER_ENTERED",
|
|
148
|
+
values
|
|
149
|
+
} = resolvedParams;
|
|
150
|
+
const resource = {
|
|
151
|
+
data: [
|
|
152
|
+
{
|
|
153
|
+
range,
|
|
154
|
+
values
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
valueInputOption
|
|
158
|
+
};
|
|
159
|
+
try {
|
|
160
|
+
const response = await client.spreadsheets.values.batchUpdate({
|
|
161
|
+
spreadsheetId,
|
|
162
|
+
resource
|
|
163
|
+
});
|
|
164
|
+
console.log("%d cells updated.", response.data.totalUpdatedCells);
|
|
165
|
+
return callback({ ...(0, import_language_common.composeNextState)(state, response.data), response });
|
|
166
|
+
} catch (err) {
|
|
167
|
+
logError(err);
|
|
168
|
+
throw err;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function getValues(spreadsheetId, range, callback = (s) => s) {
|
|
173
|
+
return async (state) => {
|
|
174
|
+
var _a;
|
|
175
|
+
const [resolvedSheetId, resolvedRange] = (0, import_util.expandReferences)(
|
|
176
|
+
state,
|
|
177
|
+
spreadsheetId,
|
|
178
|
+
range
|
|
179
|
+
);
|
|
180
|
+
try {
|
|
181
|
+
const response = await client.spreadsheets.values.get({
|
|
182
|
+
spreadsheetId: resolvedSheetId,
|
|
183
|
+
range: resolvedRange
|
|
184
|
+
});
|
|
185
|
+
const numRows = ((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.values.length) ?? 0;
|
|
186
|
+
console.log(`${numRows} rows retrieved.`);
|
|
187
|
+
const nextState = { ...(0, import_language_common.composeNextState)(state, response.data), response };
|
|
188
|
+
return callback(nextState);
|
|
189
|
+
} catch (err) {
|
|
190
|
+
logError(err);
|
|
191
|
+
throw err;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
110
195
|
|
|
111
196
|
// src/index.js
|
|
112
197
|
var src_default = Adaptor_exports;
|
|
@@ -114,6 +199,7 @@ var src_default = Adaptor_exports;
|
|
|
114
199
|
0 && (module.exports = {
|
|
115
200
|
alterState,
|
|
116
201
|
appendValues,
|
|
202
|
+
batchUpdateValues,
|
|
117
203
|
combine,
|
|
118
204
|
dataPath,
|
|
119
205
|
dataValue,
|
|
@@ -122,6 +208,7 @@ var src_default = Adaptor_exports;
|
|
|
122
208
|
field,
|
|
123
209
|
fields,
|
|
124
210
|
fn,
|
|
211
|
+
getValues,
|
|
125
212
|
http,
|
|
126
213
|
lastReferenceValue,
|
|
127
214
|
merge,
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var Adaptor_exports = {};
|
|
|
9
9
|
__export(Adaptor_exports, {
|
|
10
10
|
alterState: () => alterState,
|
|
11
11
|
appendValues: () => appendValues,
|
|
12
|
+
batchUpdateValues: () => batchUpdateValues,
|
|
12
13
|
combine: () => combine,
|
|
13
14
|
dataPath: () => dataPath,
|
|
14
15
|
dataValue: () => dataValue,
|
|
@@ -17,6 +18,7 @@ __export(Adaptor_exports, {
|
|
|
17
18
|
field: () => field,
|
|
18
19
|
fields: () => fields,
|
|
19
20
|
fn: () => fn,
|
|
21
|
+
getValues: () => getValues,
|
|
20
22
|
http: () => http,
|
|
21
23
|
lastReferenceValue: () => lastReferenceValue,
|
|
22
24
|
merge: () => merge,
|
|
@@ -24,9 +26,12 @@ __export(Adaptor_exports, {
|
|
|
24
26
|
});
|
|
25
27
|
import {
|
|
26
28
|
execute as commonExecute,
|
|
27
|
-
|
|
29
|
+
composeNextState
|
|
28
30
|
} from "@openfn/language-common";
|
|
29
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
normalizeOauthConfig,
|
|
33
|
+
expandReferences
|
|
34
|
+
} from "@openfn/language-common/util";
|
|
30
35
|
import { google } from "googleapis";
|
|
31
36
|
import {
|
|
32
37
|
alterState,
|
|
@@ -42,30 +47,53 @@ import {
|
|
|
42
47
|
merge,
|
|
43
48
|
sourceValue
|
|
44
49
|
} from "@openfn/language-common";
|
|
50
|
+
var client = void 0;
|
|
51
|
+
function createConnection(state) {
|
|
52
|
+
const { accessToken } = state.configuration;
|
|
53
|
+
const auth = new google.auth.OAuth2();
|
|
54
|
+
auth.credentials = { access_token: accessToken };
|
|
55
|
+
client = google.sheets({ version: "v4", auth });
|
|
56
|
+
return state;
|
|
57
|
+
}
|
|
58
|
+
function removeConnection(state) {
|
|
59
|
+
client = void 0;
|
|
60
|
+
return state;
|
|
61
|
+
}
|
|
62
|
+
function logError(err) {
|
|
63
|
+
const { code, errors, response } = err;
|
|
64
|
+
if (code && errors && response) {
|
|
65
|
+
console.error("The API returned an error:", errors);
|
|
66
|
+
const { statusText, config } = response;
|
|
67
|
+
const { url, method, body } = config;
|
|
68
|
+
const message = `${method} ${url} - ${code}:${statusText}
|
|
69
|
+
body: ${body}`;
|
|
70
|
+
console.log(message);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
45
73
|
function execute(...operations) {
|
|
46
74
|
const initialState = {
|
|
47
75
|
references: [],
|
|
48
76
|
data: null
|
|
49
77
|
};
|
|
50
78
|
return (state) => {
|
|
51
|
-
return commonExecute(
|
|
79
|
+
return commonExecute(
|
|
80
|
+
createConnection,
|
|
81
|
+
...operations,
|
|
82
|
+
removeConnection
|
|
83
|
+
)({
|
|
52
84
|
...initialState,
|
|
53
85
|
...state,
|
|
54
86
|
configuration: normalizeOauthConfig(state.configuration)
|
|
55
87
|
});
|
|
56
88
|
};
|
|
57
89
|
}
|
|
58
|
-
function appendValues(params) {
|
|
90
|
+
function appendValues(params, callback = (s) => s) {
|
|
59
91
|
return (state) => {
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
oauth2Client.credentials = { access_token: accessToken };
|
|
63
|
-
const { spreadsheetId, range, values } = expandReferences(params)(state);
|
|
64
|
-
var sheets = google.sheets("v4");
|
|
92
|
+
const [resolvedParams] = expandReferences(state, params);
|
|
93
|
+
const { spreadsheetId, range, values } = resolvedParams;
|
|
65
94
|
return new Promise((resolve, reject) => {
|
|
66
|
-
|
|
95
|
+
client.spreadsheets.values.append(
|
|
67
96
|
{
|
|
68
|
-
auth: oauth2Client,
|
|
69
97
|
spreadsheetId,
|
|
70
98
|
range,
|
|
71
99
|
valueInputOption: "USER_ENTERED",
|
|
@@ -77,25 +105,84 @@ function appendValues(params) {
|
|
|
77
105
|
},
|
|
78
106
|
function(err, response) {
|
|
79
107
|
if (err) {
|
|
80
|
-
|
|
81
|
-
console.log(err);
|
|
108
|
+
logError(err);
|
|
82
109
|
reject(err);
|
|
83
110
|
} else {
|
|
84
111
|
console.log("Success! Here is the response from Google:");
|
|
85
|
-
console.log(response);
|
|
86
|
-
resolve(
|
|
112
|
+
console.log(response.data);
|
|
113
|
+
resolve(
|
|
114
|
+
callback({
|
|
115
|
+
...composeNextState(state, response.data),
|
|
116
|
+
response
|
|
117
|
+
})
|
|
118
|
+
);
|
|
87
119
|
}
|
|
88
120
|
}
|
|
89
121
|
);
|
|
90
122
|
});
|
|
91
123
|
};
|
|
92
124
|
}
|
|
125
|
+
function batchUpdateValues(params, callback = (s) => s) {
|
|
126
|
+
return async (state) => {
|
|
127
|
+
const [resolvedParams] = expandReferences(state, params);
|
|
128
|
+
const {
|
|
129
|
+
spreadsheetId,
|
|
130
|
+
range,
|
|
131
|
+
valueInputOption = "USER_ENTERED",
|
|
132
|
+
values
|
|
133
|
+
} = resolvedParams;
|
|
134
|
+
const resource = {
|
|
135
|
+
data: [
|
|
136
|
+
{
|
|
137
|
+
range,
|
|
138
|
+
values
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
valueInputOption
|
|
142
|
+
};
|
|
143
|
+
try {
|
|
144
|
+
const response = await client.spreadsheets.values.batchUpdate({
|
|
145
|
+
spreadsheetId,
|
|
146
|
+
resource
|
|
147
|
+
});
|
|
148
|
+
console.log("%d cells updated.", response.data.totalUpdatedCells);
|
|
149
|
+
return callback({ ...composeNextState(state, response.data), response });
|
|
150
|
+
} catch (err) {
|
|
151
|
+
logError(err);
|
|
152
|
+
throw err;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function getValues(spreadsheetId, range, callback = (s) => s) {
|
|
157
|
+
return async (state) => {
|
|
158
|
+
var _a;
|
|
159
|
+
const [resolvedSheetId, resolvedRange] = expandReferences(
|
|
160
|
+
state,
|
|
161
|
+
spreadsheetId,
|
|
162
|
+
range
|
|
163
|
+
);
|
|
164
|
+
try {
|
|
165
|
+
const response = await client.spreadsheets.values.get({
|
|
166
|
+
spreadsheetId: resolvedSheetId,
|
|
167
|
+
range: resolvedRange
|
|
168
|
+
});
|
|
169
|
+
const numRows = ((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.values.length) ?? 0;
|
|
170
|
+
console.log(`${numRows} rows retrieved.`);
|
|
171
|
+
const nextState = { ...composeNextState(state, response.data), response };
|
|
172
|
+
return callback(nextState);
|
|
173
|
+
} catch (err) {
|
|
174
|
+
logError(err);
|
|
175
|
+
throw err;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
93
179
|
|
|
94
180
|
// src/index.js
|
|
95
181
|
var src_default = Adaptor_exports;
|
|
96
182
|
export {
|
|
97
183
|
alterState,
|
|
98
184
|
appendValues,
|
|
185
|
+
batchUpdateValues,
|
|
99
186
|
combine,
|
|
100
187
|
dataPath,
|
|
101
188
|
dataValue,
|
|
@@ -105,6 +192,7 @@ export {
|
|
|
105
192
|
field,
|
|
106
193
|
fields,
|
|
107
194
|
fn,
|
|
195
|
+
getValues,
|
|
108
196
|
http,
|
|
109
197
|
lastReferenceValue,
|
|
110
198
|
merge,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-googlesheets",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "A Google Sheets Language Pack for OpenFn",
|
|
5
5
|
"homepage": "https://docs.openfn.org",
|
|
6
6
|
"repository": {
|
|
@@ -23,11 +23,10 @@
|
|
|
23
23
|
"configuration-schema.json"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@openfn/language-common": "^1.
|
|
26
|
+
"@openfn/language-common": "^1.12.0",
|
|
27
27
|
"googleapis": "100.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@openfn/buildtools": "^1.0.2",
|
|
31
30
|
"@openfn/simple-ast": "0.4.1",
|
|
32
31
|
"assertion-error": "1.1.0",
|
|
33
32
|
"chai": "4.3.6",
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -26,7 +26,50 @@ export function execute(...operations: Operations): Operation;
|
|
|
26
26
|
* })
|
|
27
27
|
* @function
|
|
28
28
|
* @param {Object} params - Data object to add to the spreadsheet.
|
|
29
|
+
* @param {string} [params.spreadsheetId] The spreadsheet ID.
|
|
30
|
+
* @param {string} [params.range] The range of values to update.
|
|
31
|
+
* @param {array} [params.values] A 2d array of values to update.
|
|
29
32
|
* @returns {Operation}
|
|
30
33
|
*/
|
|
31
|
-
export function appendValues(params:
|
|
34
|
+
export function appendValues(params: {
|
|
35
|
+
spreadsheetId?: string;
|
|
36
|
+
range?: string;
|
|
37
|
+
values?: any[];
|
|
38
|
+
}, callback?: (s: any) => any): Operation;
|
|
39
|
+
/**
|
|
40
|
+
* Batch update values in a Spreadsheet.
|
|
41
|
+
* @example
|
|
42
|
+
* batchUpdateValues({
|
|
43
|
+
* spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
|
|
44
|
+
* range: 'Sheet1!A1:E1',
|
|
45
|
+
* values: [
|
|
46
|
+
* ['From expression', '$15', '2', '3/15/2016'],
|
|
47
|
+
* ['Really now!', '$100', '1', '3/20/2016'],
|
|
48
|
+
* ],
|
|
49
|
+
* })
|
|
50
|
+
* @function
|
|
51
|
+
* @param {Object} params - Data object to add to the spreadsheet.
|
|
52
|
+
* @param {string} [params.spreadsheetId] The spreadsheet ID.
|
|
53
|
+
* @param {string} [params.range] The range of values to update.
|
|
54
|
+
* @param {string} [params.valueInputOption] (Optional) Value update options. Defaults to 'USER_ENTERED'
|
|
55
|
+
* @param {array} [params.values] A 2d array of values to update.
|
|
56
|
+
* @returns {Operation} spreadsheet information
|
|
57
|
+
*/
|
|
58
|
+
export function batchUpdateValues(params: {
|
|
59
|
+
spreadsheetId?: string;
|
|
60
|
+
range?: string;
|
|
61
|
+
valueInputOption?: string;
|
|
62
|
+
values?: any[];
|
|
63
|
+
}, callback?: (s: any) => any): Operation;
|
|
64
|
+
/**
|
|
65
|
+
* Gets cell values from a Spreadsheet.
|
|
66
|
+
* @public
|
|
67
|
+
* @example
|
|
68
|
+
* getValues('1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos','Sheet1!A1:E1')
|
|
69
|
+
* @function
|
|
70
|
+
* @param {string} spreadsheetId The spreadsheet ID.
|
|
71
|
+
* @param {string} range The sheet range.
|
|
72
|
+
* @returns {Operation} spreadsheet information
|
|
73
|
+
*/
|
|
74
|
+
export function getValues(spreadsheetId: string, range: string, callback?: (s: any) => any): Operation;
|
|
32
75
|
export { alterState, combine, dataPath, dataValue, each, field, fields, fn, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
|