@lowdefy/connection-google-sheets 4.0.0-rc.1 → 4.0.0-rc.11

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.
@@ -15,9 +15,9 @@
15
15
  */ import getSheet from '../getSheet.js';
16
16
  import { transformWrite } from '../transformTypes.js';
17
17
  import schema from './schema.js';
18
- async function GoogleSheetAppendMany({ request , connection }) {
19
- const { rows , options ={} } = request;
20
- const { raw } = options;
18
+ async function GoogleSheetAppendMany({ request, connection }) {
19
+ const { rows, options = {} } = request;
20
+ const { raw } = options;
21
21
  const sheet = await getSheet({
22
22
  connection
23
23
  });
@@ -16,9 +16,9 @@
16
16
  import cleanRows from '../cleanRows.js';
17
17
  import { transformWrite } from '../transformTypes.js';
18
18
  import schema from './schema.js';
19
- async function GoogleSheetAppendOne({ request , connection }) {
20
- const { row , options ={} } = request;
21
- const { raw } = options;
19
+ async function GoogleSheetAppendOne({ request, connection }) {
20
+ const { row, options = {} } = request;
21
+ const { raw } = options;
22
22
  const sheet = await getSheet({
23
23
  connection
24
24
  });
@@ -17,9 +17,9 @@ import getSheet from '../getSheet.js';
17
17
  import { transformRead } from '../transformTypes.js';
18
18
  import mingoFilter from '../mingoFilter.js';
19
19
  import schema from './schema.js';
20
- async function GoogleSheetDeleteOne({ request , connection }) {
21
- const { filter , options ={} } = request;
22
- const { limit , skip } = options;
20
+ async function GoogleSheetDeleteOne({ request, connection }) {
21
+ const { filter, options = {} } = request;
22
+ const { limit, skip } = options;
23
23
  const sheet = await getSheet({
24
24
  connection
25
25
  });
@@ -18,9 +18,9 @@ import { transformRead } from '../transformTypes.js';
18
18
  import mingoAggregation from '../mingoAggregation.js';
19
19
  import mingoFilter from '../mingoFilter.js';
20
20
  import schema from './schema.js';
21
- async function GoogleSheetGetMany({ request , connection }) {
22
- const { filter , pipeline , options ={} } = request;
23
- const { limit , skip } = options;
21
+ async function GoogleSheetGetMany({ request, connection }) {
22
+ const { filter, pipeline, options = {} } = request;
23
+ const { limit, skip } = options;
24
24
  const sheet = await getSheet({
25
25
  connection
26
26
  });
@@ -17,9 +17,9 @@ import getSheet from '../getSheet.js';
17
17
  import { transformRead } from '../transformTypes.js';
18
18
  import mingoFilter from '../mingoFilter.js';
19
19
  import schema from './schema.js';
20
- async function GoogleSheetGetOne({ request , connection }) {
21
- const { filter , options ={} } = request;
22
- const { limit , skip } = options;
20
+ async function GoogleSheetGetOne({ request, connection }) {
21
+ const { filter, options = {} } = request;
22
+ const { limit, skip } = options;
23
23
  const sheet = await getSheet({
24
24
  connection
25
25
  });
@@ -16,9 +16,9 @@
16
16
  import { transformRead, transformWrite } from '../transformTypes.js';
17
17
  import mingoFilter from '../mingoFilter.js';
18
18
  import schema from './schema.js';
19
- async function GoogleSheetUpdateMany({ request , connection }) {
20
- const { filter , update , options ={} } = request;
21
- const { limit , skip , raw } = options;
19
+ async function GoogleSheetUpdateMany({ request, connection }) {
20
+ const { filter, update, options = {} } = request;
21
+ const { limit, skip, raw } = options;
22
22
  const sheet = await getSheet({
23
23
  connection
24
24
  });
@@ -17,9 +17,9 @@ import getSheet from '../getSheet.js';
17
17
  import { transformRead, transformWrite } from '../transformTypes.js';
18
18
  import mingoFilter from '../mingoFilter.js';
19
19
  import schema from './schema.js';
20
- async function GoogleSheetUpdateOne({ request , connection }) {
21
- const { filter , update , options ={} } = request;
22
- const { limit , skip , upsert , raw } = options;
20
+ async function GoogleSheetUpdateOne({ request, connection }) {
21
+ const { filter, update, options = {} } = request;
22
+ const { limit, skip, upsert, raw } = options;
23
23
  const sheet = await getSheet({
24
24
  connection
25
25
  });
@@ -15,7 +15,7 @@
15
15
  */ import { type } from '@lowdefy/helpers';
16
16
  function cleanRow(row) {
17
17
  // eslint-disable-next-line no-unused-vars
18
- const { _sheet , ...rest } = row;
18
+ const { _sheet, ...rest } = row;
19
19
  return {
20
20
  ...rest
21
21
  };
@@ -13,7 +13,7 @@
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  */ import { GoogleSpreadsheet } from 'google-spreadsheet';
16
- async function authenticate({ doc , apiKey , client_email , private_key }) {
16
+ async function authenticate({ doc, apiKey, client_email, private_key }) {
17
17
  if (apiKey) {
18
18
  doc.useApiKey(apiKey);
19
19
  } else {
@@ -23,7 +23,7 @@ async function authenticate({ doc , apiKey , client_email , private_key }) {
23
23
  });
24
24
  }
25
25
  }
26
- function getSheetFromDoc({ doc , sheetId , sheetIndex }) {
26
+ function getSheetFromDoc({ doc, sheetId, sheetIndex }) {
27
27
  let sheet;
28
28
  if (sheetId) {
29
29
  sheet = doc.sheetsById[sheetId];
@@ -38,8 +38,8 @@ function getSheetFromDoc({ doc , sheetId , sheetIndex }) {
38
38
  }
39
39
  return sheet;
40
40
  }
41
- async function getSheet({ connection }) {
42
- const { apiKey , client_email , private_key , sheetId , sheetIndex , spreadsheetId } = connection;
41
+ async function getSheet({ connection }) {
42
+ const { apiKey, client_email, private_key, sheetId, sheetIndex, spreadsheetId } = connection;
43
43
  const doc = new GoogleSpreadsheet(spreadsheetId);
44
44
  await authenticate({
45
45
  doc,
@@ -15,23 +15,23 @@
15
15
  */ import { type } from '@lowdefy/helpers';
16
16
  import mingo from 'mingo';
17
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);
34
- function mingoAggregation({ input =[] , pipeline =[] }) {
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);
34
+ function mingoAggregation({ input = [], pipeline = [] }) {
35
35
  if (!type.isArray(input)) {
36
36
  throw new Error('Mingo aggregation error. Argument "input" should be an array.');
37
37
  }
@@ -14,7 +14,7 @@
14
14
  limitations under the License.
15
15
  */ import { type } from '@lowdefy/helpers';
16
16
  import mingoAggregation from './mingoAggregation.js';
17
- function mingoFilter({ input =[] , filter ={} }) {
17
+ function mingoFilter({ input = [], filter = {} }) {
18
18
  if (!type.isObject(filter)) {
19
19
  throw new Error('Mingo filter error. Argument "filter" should be an object.');
20
20
  }
@@ -52,7 +52,7 @@ const writeTransformers = {
52
52
  }
53
53
  }
54
54
  };
55
- const transformObject = ({ transformers , types })=>(object)=>{
55
+ const transformObject = ({ transformers, types })=>(object)=>{
56
56
  Object.keys(object).forEach((key)=>{
57
57
  if (types[key]) {
58
58
  object[key] = transformers[types[key]](object[key]);
@@ -60,7 +60,7 @@ const transformObject = ({ transformers , types })=>(object)=>{
60
60
  });
61
61
  return object;
62
62
  };
63
- function transformRead({ input , types ={} }) {
63
+ function transformRead({ input, types = {} }) {
64
64
  if (type.isObject(input)) {
65
65
  return transformObject({
66
66
  transformers: readTransformers,
@@ -75,7 +75,7 @@ function transformRead({ input , types ={} }) {
75
75
  }
76
76
  throw new Error(`transformRead received invalid input type ${type.typeOf(input)}.`);
77
77
  }
78
- function transformWrite({ input , types ={} }) {
78
+ function transformWrite({ input, types = {} }) {
79
79
  if (type.isObject(input)) {
80
80
  return transformObject({
81
81
  transformers: writeTransformers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/connection-google-sheets",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.11",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -41,21 +41,21 @@
41
41
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
42
42
  },
43
43
  "dependencies": {
44
- "@lowdefy/helpers": "4.0.0-rc.1",
44
+ "@lowdefy/helpers": "4.0.0-rc.11",
45
45
  "google-spreadsheet": "3.3.0",
46
- "mingo": "6.2.1",
46
+ "mingo": "6.4.6",
47
47
  "moment": "2.29.4"
48
48
  },
49
49
  "devDependencies": {
50
- "@jest/globals": "28.1.0",
51
- "@lowdefy/ajv": "4.0.0-rc.1",
52
- "@swc/cli": "0.1.59",
53
- "@swc/core": "1.3.24",
54
- "@swc/jest": "0.2.24",
55
- "jest": "28.1.0"
50
+ "@jest/globals": "28.1.3",
51
+ "@lowdefy/ajv": "4.0.0-rc.11",
52
+ "@swc/cli": "0.1.62",
53
+ "@swc/core": "1.3.92",
54
+ "@swc/jest": "0.2.29",
55
+ "jest": "28.1.3"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "ecc4f16c19eede929eda177db524cf13a8053379"
60
+ "gitHead": "dbc49d3688a6d2f44de25cc3f4bc071627f7ebfa"
61
61
  }