@pittica/google-business-intelligence-csv 1.4.3 → 1.4.5

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/index.js CHANGED
@@ -12,6 +12,9 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
+ const {
16
+ config
17
+ } = require("@pittica/google-business-intelligence-configuration");
15
18
  const {
16
19
  bulk
17
20
  } = require("./scripts/bulk");
@@ -42,9 +45,6 @@ const {
42
45
  const {
43
46
  unlistened
44
47
  } = require("./scripts/unlistened");
45
- const {
46
- config
47
- } = require("./config");
48
48
  exports.config = config;
49
49
  exports.scripts = {
50
50
  bulk,
@@ -57,7 +57,7 @@ exports.day = async (date, source = null, temporary = null, destination = null)
57
57
  const day = formatDate(typeof date === "string" ? stringToDate(date) : date);
58
58
  const now = getNow();
59
59
  log.info(`Starting "${day}" day import...`);
60
- this.run(day, now, source ?? config.bucket.upload, temporary ?? config.bucket.temporary, destination ?? config.bucket.archive);
60
+ exports.run(day, now, source ?? config.bucket.upload, temporary ?? config.bucket.temporary, destination ?? config.bucket.archive);
61
61
  }
62
62
  };
63
63
 
@@ -78,7 +78,7 @@ exports.run = async (day, now, source, temporary, destination) => {
78
78
  const bucketSource = await storage.bucket(source);
79
79
  const bucketTemporary = await storage.bucket(temporary);
80
80
  const bucketDestination = await storage.bucket(destination);
81
- getFiles(storage, source, `${day}-`).then(response => this.process(dataset, bucketSource, bucketTemporary, bucketDestination, sort(mapStorageResponse(response, config.files.sql)), now));
81
+ getFiles(storage, source, `${day}-`).then(response => exports.process(dataset, bucketSource, bucketTemporary, bucketDestination, sort(mapStorageResponse(response, config.files.sql)), now));
82
82
  };
83
83
 
84
84
  /**
@@ -62,7 +62,7 @@ exports.file = async (name, bucketSource = null, bucketTemporary = null, bucketD
62
62
  });
63
63
  const day = getNow();
64
64
  const table = await ds.table(getTemporaryTableName(filedata, config.dataset.temporary.prefix));
65
- return await this.run(table, bucketDestination ?? config.bucket.archive, file, filedata, day, clean);
65
+ return await exports.run(table, bucketDestination ?? config.bucket.archive, file, filedata, day, clean);
66
66
  }
67
67
  return false;
68
68
  }).catch(logErrors);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pittica/google-business-intelligence-csv",
3
3
  "private": false,
4
- "version": "1.4.3",
4
+ "version": "1.4.5",
5
5
  "description": "CSV importer for business intelligence for Google Cloud.",
6
6
  "main": "dist/index.js",
7
7
  "scripts": {
@@ -25,16 +25,17 @@
25
25
  },
26
26
  "homepage": "https://github.com/pittica/google-business-intelligence-csv#README.md",
27
27
  "dependencies": {
28
- "@pittica/google-bigquery-helpers": "^1.4.5",
28
+ "@pittica/google-bigquery-helpers": "^1.4.6",
29
+ "@pittica/google-business-intelligence-configuration": "^1.0.0",
29
30
  "@pittica/google-business-intelligence-helpers": "^1.12.7",
30
- "@pittica/google-cloud-storage-helpers": "^1.3.5",
31
- "@pittica/logger-helpers": "^1.0.4",
32
- "date-and-time": "^4.1.2"
31
+ "@pittica/google-cloud-storage-helpers": "^1.3.6",
32
+ "@pittica/logger-helpers": "^1.0.5",
33
+ "date-and-time": "^4.3.0"
33
34
  },
34
35
  "devDependencies": {
35
- "@babel/cli": "^7.28.3",
36
+ "@babel/cli": "^7.28.6",
36
37
  "mkdirp": "^3.0.1",
37
- "prettier": "^3.7.4",
38
- "rimraf": "^6.1.2"
38
+ "prettier": "^3.8.1",
39
+ "rimraf": "^6.1.3"
39
40
  }
40
41
  }
package/dist/config.js DELETED
@@ -1,52 +0,0 @@
1
- // Copyright 2024-2026 Pittica S.r.l.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- const path = require("path");
16
-
17
- /**
18
- * Configuration.
19
- *
20
- * @param {object} config Configuration parameters.
21
- */
22
- exports.config = (config = {}) => {
23
- const initial = {
24
- bucket: {
25
- upload: "upload",
26
- temporary: "temp",
27
- archive: "archive"
28
- },
29
- pubSub: {
30
- message: "upload"
31
- },
32
- dataset: {
33
- temporary: {
34
- name: "tmp",
35
- prefix: "tmp_csv_",
36
- location: "us-central1"
37
- }
38
- },
39
- files: {
40
- json: path.join(process.cwd(), "json"),
41
- sql: path.join(process.cwd(), "sql"),
42
- bootstrap: null
43
- },
44
- order: [],
45
- bootstrap: []
46
- };
47
- global.config = {
48
- ...initial,
49
- ...config
50
- };
51
- return global.config;
52
- };