@openfn/language-googlesheets 2.1.0 → 2.1.2

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Language Google Sheets [![Build Status](https://travis-ci.org/OpenFn/language-googlesheets.svg?branch=master)](https://travis-ci.org/OpenFn/language-googlesheets)
1
+ # Language Google Sheets
2
2
 
3
3
  Language Pack for building expressions and operations to make Google Sheets API
4
4
  calls.
@@ -28,8 +28,6 @@ appendValues({
28
28
  });
29
29
  ````
30
30
 
31
- [Docs](docs/index)
32
-
33
31
  ## Development
34
32
 
35
33
  Clone the [adaptors monorepo](https://github.com/OpenFn/adaptors). Follow the
package/ast.json CHANGED
@@ -77,6 +77,14 @@
77
77
  "name": "Function"
78
78
  },
79
79
  "name": "func"
80
+ },
81
+ {
82
+ "title": "returns",
83
+ "description": null,
84
+ "type": {
85
+ "type": "NameExpression",
86
+ "name": "Operation"
87
+ }
80
88
  }
81
89
  ]
82
90
  },
@@ -112,6 +120,14 @@
112
120
  "name": "String"
113
121
  },
114
122
  "name": "path"
123
+ },
124
+ {
125
+ "title": "returns",
126
+ "description": null,
127
+ "type": {
128
+ "type": "NameExpression",
129
+ "name": "Operation"
130
+ }
115
131
  }
116
132
  ]
117
133
  },
@@ -190,6 +206,14 @@
190
206
  "name": "String"
191
207
  },
192
208
  "name": "path"
209
+ },
210
+ {
211
+ "title": "returns",
212
+ "description": null,
213
+ "type": {
214
+ "type": "NameExpression",
215
+ "name": "Operation"
216
+ }
193
217
  }
194
218
  ]
195
219
  },
@@ -225,6 +249,14 @@
225
249
  "name": "String"
226
250
  },
227
251
  "name": "path"
252
+ },
253
+ {
254
+ "title": "returns",
255
+ "description": null,
256
+ "type": {
257
+ "type": "NameExpression",
258
+ "name": "Operation"
259
+ }
228
260
  }
229
261
  ]
230
262
  },
@@ -270,6 +302,14 @@
270
302
  "name": "Operation"
271
303
  },
272
304
  "name": "operation"
305
+ },
306
+ {
307
+ "title": "returns",
308
+ "description": null,
309
+ "type": {
310
+ "type": "NameExpression",
311
+ "name": "Operation"
312
+ }
273
313
  }
274
314
  ]
275
315
  },
@@ -358,6 +398,14 @@
358
398
  "name": "Value"
359
399
  },
360
400
  "name": "value"
401
+ },
402
+ {
403
+ "title": "returns",
404
+ "description": null,
405
+ "type": {
406
+ "type": "NameExpression",
407
+ "name": "Field"
408
+ }
361
409
  }
362
410
  ]
363
411
  },
package/dist/index.cjs CHANGED
@@ -19,8 +19,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/index.js
20
20
  var src_exports = {};
21
21
  __export(src_exports, {
22
- Adaptor: () => Adaptor_exports,
23
- default: () => src_default
22
+ alterState: () => import_language_common2.alterState,
23
+ appendValues: () => appendValues,
24
+ combine: () => import_language_common2.combine,
25
+ dataPath: () => import_language_common2.dataPath,
26
+ dataValue: () => import_language_common2.dataValue,
27
+ default: () => src_default,
28
+ each: () => import_language_common2.each,
29
+ execute: () => execute,
30
+ field: () => import_language_common2.field,
31
+ fields: () => import_language_common2.fields,
32
+ fn: () => import_language_common2.fn,
33
+ http: () => import_language_common2.http,
34
+ lastReferenceValue: () => import_language_common2.lastReferenceValue,
35
+ merge: () => import_language_common2.merge,
36
+ sourceValue: () => import_language_common2.sourceValue
24
37
  });
25
38
  module.exports = __toCommonJS(src_exports);
26
39
 
@@ -94,5 +107,18 @@ function appendValues(params) {
94
107
  var src_default = Adaptor_exports;
95
108
  // Annotate the CommonJS export names for ESM import in node:
96
109
  0 && (module.exports = {
97
- Adaptor
110
+ alterState,
111
+ appendValues,
112
+ combine,
113
+ dataPath,
114
+ dataValue,
115
+ each,
116
+ execute,
117
+ field,
118
+ fields,
119
+ fn,
120
+ http,
121
+ lastReferenceValue,
122
+ merge,
123
+ sourceValue
98
124
  });
package/dist/index.js CHANGED
@@ -89,6 +89,19 @@ function appendValues(params) {
89
89
  // src/index.js
90
90
  var src_default = Adaptor_exports;
91
91
  export {
92
- Adaptor_exports as Adaptor,
93
- src_default as default
92
+ alterState,
93
+ appendValues,
94
+ combine,
95
+ dataPath,
96
+ dataValue,
97
+ src_default as default,
98
+ each,
99
+ execute,
100
+ field,
101
+ fields,
102
+ fn,
103
+ http,
104
+ lastReferenceValue,
105
+ merge,
106
+ sourceValue
94
107
  };
package/package.json CHANGED
@@ -1,13 +1,19 @@
1
1
  {
2
2
  "name": "@openfn/language-googlesheets",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "A Google Sheets Language Pack for OpenFn",
5
5
  "homepage": "https://docs.openfn.org",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/openfn/adaptors.git"
9
9
  },
10
- "main": "dist/index.cjs",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./package.json": "./package.json"
16
+ },
11
17
  "author": "Open Function Group",
12
18
  "license": "LGPLv3",
13
19
  "files": [
@@ -17,28 +23,28 @@
17
23
  "configuration-schema.json"
18
24
  ],
19
25
  "dependencies": {
20
- "@openfn/language-common": "1.7.1",
26
+ "@openfn/language-common": "^1.7.5",
21
27
  "googleapis": "100.0.0"
22
28
  },
23
29
  "devDependencies": {
30
+ "@openfn/buildtools": "^1.0.2",
24
31
  "@openfn/simple-ast": "0.4.1",
25
32
  "assertion-error": "1.1.0",
26
33
  "chai": "4.3.6",
27
34
  "deep-eql": "4.1.1",
35
+ "esno": "^0.16.3",
28
36
  "mocha": "9.2.2",
29
37
  "nock": "13.2.9",
30
- "sinon": "9.2.4",
31
- "esno": "0.16.3",
32
- "rimraf": "3.0.2",
33
- "@openfn/buildtools": "^1.0.0"
38
+ "rimraf": "3.0.2"
34
39
  },
35
40
  "type": "module",
36
41
  "types": "types/index.d.ts",
42
+ "main": "dist/index.cjs",
37
43
  "scripts": {
38
44
  "build": "pnpm clean && build-adaptor googlesheets",
39
45
  "test": "mocha --experimental-specifier-resolution=node --no-warnings",
40
46
  "test:watch": "mocha -w --experimental-specifier-resolution=node --no-warnings",
41
- "clean": "rm -rf dist types docs",
47
+ "clean": "rimraf dist types docs",
42
48
  "pack": "pnpm pack --pack-destination ../../dist"
43
49
  }
44
50
  }
@@ -0,0 +1,69 @@
1
+ /** @module Adaptor */
2
+ /**
3
+ * Execute a sequence of operations.
4
+ * Wraps `language-common/execute`, and prepends initial state for http.
5
+ * @example
6
+ * execute(
7
+ * create('foo'),
8
+ * delete('bar')
9
+ * )(state)
10
+ * @constructor
11
+ * @param {Operations} operations - Operations to be performed.
12
+ * @returns {Operation}
13
+ */
14
+ export function execute(...operations: Operations): Operation;
15
+ export class execute {
16
+ /** @module Adaptor */
17
+ /**
18
+ * Execute a sequence of operations.
19
+ * Wraps `language-common/execute`, and prepends initial state for http.
20
+ * @example
21
+ * execute(
22
+ * create('foo'),
23
+ * delete('bar')
24
+ * )(state)
25
+ * @constructor
26
+ * @param {Operations} operations - Operations to be performed.
27
+ * @returns {Operation}
28
+ */
29
+ constructor(...operations: Operations);
30
+ }
31
+ /**
32
+ * Add an array of rows to the spreadsheet.
33
+ * https://developers.google.com/sheets/api/samples/writing#append_values
34
+ * @public
35
+ * @example
36
+ * appendValues({
37
+ * spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
38
+ * range: 'Sheet1!A1:E1',
39
+ * values: [
40
+ * ['From expression', '$15', '2', '3/15/2016'],
41
+ * ['Really now!', '$100', '1', '3/20/2016'],
42
+ * ],
43
+ * })
44
+ * @constructor
45
+ * @param {Object} params - Data object to add to the spreadsheet.
46
+ * @returns {Operation}
47
+ */
48
+ export function appendValues(params: any): Operation;
49
+ export class appendValues {
50
+ /**
51
+ * Add an array of rows to the spreadsheet.
52
+ * https://developers.google.com/sheets/api/samples/writing#append_values
53
+ * @public
54
+ * @example
55
+ * appendValues({
56
+ * spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
57
+ * range: 'Sheet1!A1:E1',
58
+ * values: [
59
+ * ['From expression', '$15', '2', '3/15/2016'],
60
+ * ['Really now!', '$100', '1', '3/20/2016'],
61
+ * ],
62
+ * })
63
+ * @constructor
64
+ * @param {Object} params - Data object to add to the spreadsheet.
65
+ * @returns {Operation}
66
+ */
67
+ constructor(params: any);
68
+ }
69
+ export { alterState, combine, dataPath, dataValue, each, field, fields, fn, http, lastReferenceValue, merge, sourceValue } from "@openfn/language-common";
package/types/index.d.ts CHANGED
@@ -1,81 +1,3 @@
1
- /** @module Adaptor */
2
- /**
3
- * Execute a sequence of operations.
4
- * Wraps `language-common/execute`, and prepends initial state for http.
5
- * @example
6
- * execute(
7
- * create('foo'),
8
- * delete('bar')
9
- * )(state)
10
- * @constructor
11
- * @param {Operations} operations - Operations to be performed.
12
- * @returns {Operation}
13
- */
14
- declare function execute(...operations: Operations): Operation;
15
- declare class execute {
16
- /** @module Adaptor */
17
- /**
18
- * Execute a sequence of operations.
19
- * Wraps `language-common/execute`, and prepends initial state for http.
20
- * @example
21
- * execute(
22
- * create('foo'),
23
- * delete('bar')
24
- * )(state)
25
- * @constructor
26
- * @param {Operations} operations - Operations to be performed.
27
- * @returns {Operation}
28
- */
29
- constructor(...operations: Operations);
30
- }
31
- /**
32
- * Add an array of rows to the spreadsheet.
33
- * https://developers.google.com/sheets/api/samples/writing#append_values
34
- * @public
35
- * @example
36
- * appendValues({
37
- * spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
38
- * range: 'Sheet1!A1:E1',
39
- * values: [
40
- * ['From expression', '$15', '2', '3/15/2016'],
41
- * ['Really now!', '$100', '1', '3/20/2016'],
42
- * ],
43
- * })
44
- * @constructor
45
- * @param {Object} params - Data object to add to the spreadsheet.
46
- * @returns {Operation}
47
- */
48
- declare function appendValues(params: any): Operation;
49
- declare class appendValues {
50
- /**
51
- * Add an array of rows to the spreadsheet.
52
- * https://developers.google.com/sheets/api/samples/writing#append_values
53
- * @public
54
- * @example
55
- * appendValues({
56
- * spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
57
- * range: 'Sheet1!A1:E1',
58
- * values: [
59
- * ['From expression', '$15', '2', '3/15/2016'],
60
- * ['Really now!', '$100', '1', '3/20/2016'],
61
- * ],
62
- * })
63
- * @constructor
64
- * @param {Object} params - Data object to add to the spreadsheet.
65
- * @returns {Operation}
66
- */
67
- constructor(params: any);
68
- }
69
-
70
- type Adaptor_execute = execute;
71
- declare const Adaptor_execute: typeof execute;
72
- type Adaptor_appendValues = appendValues;
73
- declare const Adaptor_appendValues: typeof appendValues;
74
- declare namespace Adaptor {
75
- export {
76
- Adaptor_execute as execute,
77
- Adaptor_appendValues as appendValues,
78
- };
79
- }
80
-
81
- export { Adaptor, Adaptor as default };
1
+ export default Adaptor;
2
+ export * from "./Adaptor";
3
+ import * as Adaptor from "./Adaptor";