google-sheets-automation 0.1.1 → 0.1.3
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
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./providers/google"), exports);
|
package/dist/providers/google.js
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SheetClient = exports.GoogleSheetProvider = void 0;
|
|
4
|
+
var googleProvider_1 = require("./googleProvider");
|
|
5
|
+
Object.defineProperty(exports, "GoogleSheetProvider", { enumerable: true, get: function () { return googleProvider_1.GoogleSheetProvider; } });
|
|
6
|
+
var sheetClient_1 = require("./sheetClient");
|
|
7
|
+
Object.defineProperty(exports, "SheetClient", { enumerable: true, get: function () { return sheetClient_1.SheetClient; } });
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleSheetProvider = void 0;
|
|
1
4
|
// Only import google-auth-library in Node.js
|
|
2
5
|
let GoogleAuth = undefined;
|
|
3
6
|
if (typeof process !== 'undefined' && process.versions?.node) {
|
|
@@ -6,7 +9,7 @@ if (typeof process !== 'undefined' && process.versions?.node) {
|
|
|
6
9
|
}
|
|
7
10
|
catch { }
|
|
8
11
|
}
|
|
9
|
-
|
|
12
|
+
class GoogleSheetProvider {
|
|
10
13
|
getBaseUrl() {
|
|
11
14
|
return 'https://sheets.googleapis.com/v4/spreadsheets';
|
|
12
15
|
}
|
|
@@ -166,3 +169,4 @@ export class GoogleSheetProvider {
|
|
|
166
169
|
return mapped;
|
|
167
170
|
}
|
|
168
171
|
}
|
|
172
|
+
exports.GoogleSheetProvider = GoogleSheetProvider;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SheetClient = void 0;
|
|
4
|
+
const googleProvider_1 = require("./googleProvider");
|
|
5
|
+
class SheetClient {
|
|
3
6
|
constructor(config) {
|
|
4
7
|
if (config.provider === 'google') {
|
|
5
|
-
this.provider = new GoogleSheetProvider(config.credentials);
|
|
8
|
+
this.provider = new googleProvider_1.GoogleSheetProvider(config.credentials);
|
|
6
9
|
}
|
|
7
10
|
else {
|
|
8
11
|
throw new Error('Provider not supported');
|
|
@@ -24,6 +27,7 @@ export class SheetClient {
|
|
|
24
27
|
return this.provider.createSheet(options);
|
|
25
28
|
}
|
|
26
29
|
static mapHeaders(input, headerMap) {
|
|
27
|
-
return GoogleSheetProvider.mapHeaders(input, headerMap);
|
|
30
|
+
return googleProvider_1.GoogleSheetProvider.mapHeaders(input, headerMap);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
33
|
+
exports.SheetClient = SheetClient;
|
package/dist/providers/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseInput = parseInput;
|
|
1
4
|
// Utility to parse various input formats into rows for sheets
|
|
2
|
-
|
|
5
|
+
function parseInput(input) {
|
|
3
6
|
if (Array.isArray(input))
|
|
4
7
|
return input;
|
|
5
8
|
if (typeof input === 'object')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "google-sheets-automation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Automate Google Sheets from Node.js: add, update, and read rows with simple API. Supports service accounts, header mapping, and batch operations.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"url": "https://github.com/CaesarSage"
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
|
-
"homepage": "https://github.com/
|
|
37
|
+
"homepage": "https://github.com/Caesarsage/googlesheet-automation#readme",
|
|
38
38
|
"bugs": {
|
|
39
|
-
"url": "https://github.com/
|
|
39
|
+
"url": "https://github.com/Caesarsage/googlesheet-automation/issues"
|
|
40
40
|
},
|
|
41
41
|
"funding": {
|
|
42
42
|
"type": "github",
|
|
43
|
-
"url": "https://github.com/sponsors/
|
|
43
|
+
"url": "https://github.com/sponsors/Caesarsage"
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
47
|
-
"url": "git+https://github.com/
|
|
47
|
+
"url": "git+https://github.com/Caesarsage/googlesheet-automation.git"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/jest": "^30.0.0",
|