@el-j/google-sheet-translations 2.2.0-beta.5 → 2.2.0-beta.6
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/esm/index.js +19 -1
- package/dist/index.js +19 -1
- package/dist/setup/wifSetup.d.ts.map +1 -1
- package/dist-cli/setup-wif.mjs +186 -127
- package/package.json +20 -20
package/dist/esm/index.js
CHANGED
|
@@ -2442,7 +2442,25 @@ async function gcpFetch(url, token, method = "GET", body) {
|
|
|
2442
2442
|
return data;
|
|
2443
2443
|
}
|
|
2444
2444
|
async function pollOperation(operationName, token, maxWaitMs = 6e4) {
|
|
2445
|
-
|
|
2445
|
+
let opUrl;
|
|
2446
|
+
if (operationName.startsWith("http")) {
|
|
2447
|
+
let isGoogleHost;
|
|
2448
|
+
try {
|
|
2449
|
+
const parsedUrl = new URL(operationName);
|
|
2450
|
+
const hostname = (parsedUrl.hostname || "").toLowerCase();
|
|
2451
|
+
isGoogleHost = hostname === "iam.googleapis.com" || hostname.endsWith(".iam.googleapis.com") || hostname === "googleapis.com" || hostname.endsWith(".googleapis.com");
|
|
2452
|
+
} catch {
|
|
2453
|
+
isGoogleHost = false;
|
|
2454
|
+
}
|
|
2455
|
+
if (!isGoogleHost) {
|
|
2456
|
+
throw new Error(
|
|
2457
|
+
`Invalid operation URL: hostname must be a Google API endpoint (*.googleapis.com), got: ${operationName}`
|
|
2458
|
+
);
|
|
2459
|
+
}
|
|
2460
|
+
opUrl = operationName;
|
|
2461
|
+
} else {
|
|
2462
|
+
opUrl = `https://iam.googleapis.com/v1/${operationName}`;
|
|
2463
|
+
}
|
|
2446
2464
|
const deadline = Date.now() + maxWaitMs;
|
|
2447
2465
|
const maxWaitSecs = Math.round(maxWaitMs / 1e3);
|
|
2448
2466
|
while (Date.now() < deadline) {
|
package/dist/index.js
CHANGED
|
@@ -2533,7 +2533,25 @@ async function gcpFetch(url, token, method = "GET", body) {
|
|
|
2533
2533
|
return data;
|
|
2534
2534
|
}
|
|
2535
2535
|
async function pollOperation(operationName, token, maxWaitMs = 6e4) {
|
|
2536
|
-
|
|
2536
|
+
let opUrl;
|
|
2537
|
+
if (operationName.startsWith("http")) {
|
|
2538
|
+
let isGoogleHost;
|
|
2539
|
+
try {
|
|
2540
|
+
const parsedUrl = new URL(operationName);
|
|
2541
|
+
const hostname = (parsedUrl.hostname || "").toLowerCase();
|
|
2542
|
+
isGoogleHost = hostname === "iam.googleapis.com" || hostname.endsWith(".iam.googleapis.com") || hostname === "googleapis.com" || hostname.endsWith(".googleapis.com");
|
|
2543
|
+
} catch {
|
|
2544
|
+
isGoogleHost = false;
|
|
2545
|
+
}
|
|
2546
|
+
if (!isGoogleHost) {
|
|
2547
|
+
throw new Error(
|
|
2548
|
+
`Invalid operation URL: hostname must be a Google API endpoint (*.googleapis.com), got: ${operationName}`
|
|
2549
|
+
);
|
|
2550
|
+
}
|
|
2551
|
+
opUrl = operationName;
|
|
2552
|
+
} else {
|
|
2553
|
+
opUrl = `https://iam.googleapis.com/v1/${operationName}`;
|
|
2554
|
+
}
|
|
2537
2555
|
const deadline = Date.now() + maxWaitMs;
|
|
2538
2556
|
const maxWaitSecs = Math.round(maxWaitMs / 1e3);
|
|
2539
2557
|
while (Date.now() < deadline) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wifSetup.d.ts","sourceRoot":"","sources":["../../src/setup/wifSetup.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC/B,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;sEACkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC9B,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC5C,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAkBD,qBAAa,WAAY,SAAQ,KAAK;aAGpB,MAAM,EAAE,MAAM;gBAD9B,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,MAAM;CAK/B;
|
|
1
|
+
{"version":3,"file":"wifSetup.d.ts","sourceRoot":"","sources":["../../src/setup/wifSetup.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC/B,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;sEACkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC9B,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC5C,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAkBD,qBAAa,WAAY,SAAQ,KAAK;aAGpB,MAAM,EAAE,MAAM;gBAD9B,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,MAAM;CAK/B;AAyND;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAyChF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,4BAA4B,GACnC,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
package/dist-cli/setup-wif.mjs
CHANGED
|
@@ -11,11 +11,20 @@ var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? requir
|
|
|
11
11
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
12
|
throw Error('Dynamic require of "' + x2 + '" is not supported');
|
|
13
13
|
});
|
|
14
|
-
var __esm = (fn, res) => function __init() {
|
|
15
|
-
|
|
14
|
+
var __esm = (fn, res, err) => function __init() {
|
|
15
|
+
if (err) throw err[0];
|
|
16
|
+
try {
|
|
17
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
18
|
+
} catch (e2) {
|
|
19
|
+
throw err = [e2], e2;
|
|
20
|
+
}
|
|
16
21
|
};
|
|
17
22
|
var __commonJS = (cb, mod) => function __require2() {
|
|
18
|
-
|
|
23
|
+
try {
|
|
24
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
25
|
+
} catch (e2) {
|
|
26
|
+
throw mod = 0, e2;
|
|
27
|
+
}
|
|
19
28
|
};
|
|
20
29
|
var __export = (target, all) => {
|
|
21
30
|
for (var name in all)
|
|
@@ -134,7 +143,7 @@ var require_package = __commonJS({
|
|
|
134
143
|
"node_modules/gaxios/package.json"(exports, module) {
|
|
135
144
|
module.exports = {
|
|
136
145
|
name: "gaxios",
|
|
137
|
-
version: "7.1
|
|
146
|
+
version: "7.3.1",
|
|
138
147
|
description: "A simple common HTTP client specifically for Google APIs and services.",
|
|
139
148
|
main: "build/cjs/src/index.js",
|
|
140
149
|
types: "build/cjs/src/index.d.ts",
|
|
@@ -172,8 +181,8 @@ var require_package = __commonJS({
|
|
|
172
181
|
},
|
|
173
182
|
repository: {
|
|
174
183
|
type: "git",
|
|
175
|
-
directory: "packages/gaxios",
|
|
176
|
-
url: "https://github.com/googleapis/google-cloud-node
|
|
184
|
+
directory: "core/packages/gaxios",
|
|
185
|
+
url: "https://github.com/googleapis/google-cloud-node.git"
|
|
177
186
|
},
|
|
178
187
|
keywords: [
|
|
179
188
|
"google"
|
|
@@ -212,7 +221,7 @@ var require_package = __commonJS({
|
|
|
212
221
|
"karma-mocha": "^2.0.0",
|
|
213
222
|
"karma-remap-coverage": "^0.1.5",
|
|
214
223
|
"karma-sourcemap-loader": "^0.4.0",
|
|
215
|
-
"karma-webpack": "^5.0.
|
|
224
|
+
"karma-webpack": "^5.0.0",
|
|
216
225
|
mocha: "^11.1.0",
|
|
217
226
|
multiparty: "^4.2.1",
|
|
218
227
|
mv: "^2.1.1",
|
|
@@ -223,7 +232,7 @@ var require_package = __commonJS({
|
|
|
223
232
|
puppeteer: "^24.0.0",
|
|
224
233
|
sinon: "21.0.3",
|
|
225
234
|
"stream-browserify": "^3.0.0",
|
|
226
|
-
tmp: "0.2.
|
|
235
|
+
tmp: "0.2.7",
|
|
227
236
|
"ts-loader": "^9.5.2",
|
|
228
237
|
typescript: "5.8.3",
|
|
229
238
|
"undici-types": "^7.24.1",
|
|
@@ -235,7 +244,7 @@ var require_package = __commonJS({
|
|
|
235
244
|
"https-proxy-agent": "^7.0.1",
|
|
236
245
|
"node-fetch": "^3.3.2"
|
|
237
246
|
},
|
|
238
|
-
homepage: "https://github.com/googleapis/google-cloud-node
|
|
247
|
+
homepage: "https://github.com/googleapis/google-cloud-node/tree/main/core/packages/gaxios"
|
|
239
248
|
};
|
|
240
249
|
}
|
|
241
250
|
});
|
|
@@ -8456,7 +8465,7 @@ var require_gaxios = __commonJS({
|
|
|
8456
8465
|
for await (const chunk of translatedResponse.data) {
|
|
8457
8466
|
response.push(chunk);
|
|
8458
8467
|
}
|
|
8459
|
-
translatedResponse.data = response.toString();
|
|
8468
|
+
translatedResponse.data = Buffer.concat(response.map((c) => typeof c === "string" ? Buffer.from(c) : c)).toString("utf8");
|
|
8460
8469
|
}
|
|
8461
8470
|
const errorInfo = common_js_1.GaxiosError.extractAPIErrorFromResponse(translatedResponse, `Request failed with status code ${translatedResponse.status}`);
|
|
8462
8471
|
throw new common_js_1.GaxiosError(errorInfo?.message, opts, translatedResponse, errorInfo);
|
|
@@ -10665,6 +10674,18 @@ var require_colours = __commonJS({
|
|
|
10665
10674
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10666
10675
|
exports.Colours = void 0;
|
|
10667
10676
|
var Colours = class _Colours {
|
|
10677
|
+
static enabled = false;
|
|
10678
|
+
static reset = "";
|
|
10679
|
+
static bright = "";
|
|
10680
|
+
static dim = "";
|
|
10681
|
+
static red = "";
|
|
10682
|
+
static green = "";
|
|
10683
|
+
static yellow = "";
|
|
10684
|
+
static blue = "";
|
|
10685
|
+
static magenta = "";
|
|
10686
|
+
static cyan = "";
|
|
10687
|
+
static white = "";
|
|
10688
|
+
static grey = "";
|
|
10668
10689
|
/**
|
|
10669
10690
|
* @param stream The stream (e.g. process.stderr)
|
|
10670
10691
|
* @returns true if the stream should have colourization enabled
|
|
@@ -10674,7 +10695,7 @@ var require_colours = __commonJS({
|
|
|
10674
10695
|
stream.isTTY && (typeof stream.getColorDepth === "function" ? stream.getColorDepth() > 2 : true);
|
|
10675
10696
|
}
|
|
10676
10697
|
static refresh() {
|
|
10677
|
-
_Colours.enabled = _Colours.isEnabled(process
|
|
10698
|
+
_Colours.enabled = _Colours.isEnabled(process?.stderr);
|
|
10678
10699
|
if (!this.enabled) {
|
|
10679
10700
|
_Colours.reset = "";
|
|
10680
10701
|
_Colours.bright = "";
|
|
@@ -10703,22 +10724,27 @@ var require_colours = __commonJS({
|
|
|
10703
10724
|
}
|
|
10704
10725
|
};
|
|
10705
10726
|
exports.Colours = Colours;
|
|
10706
|
-
Colours.enabled = false;
|
|
10707
|
-
Colours.reset = "";
|
|
10708
|
-
Colours.bright = "";
|
|
10709
|
-
Colours.dim = "";
|
|
10710
|
-
Colours.red = "";
|
|
10711
|
-
Colours.green = "";
|
|
10712
|
-
Colours.yellow = "";
|
|
10713
|
-
Colours.blue = "";
|
|
10714
|
-
Colours.magenta = "";
|
|
10715
|
-
Colours.cyan = "";
|
|
10716
|
-
Colours.white = "";
|
|
10717
|
-
Colours.grey = "";
|
|
10718
10727
|
Colours.refresh();
|
|
10719
10728
|
}
|
|
10720
10729
|
});
|
|
10721
10730
|
|
|
10731
|
+
// node_modules/google-logging-utils/build/src/types.js
|
|
10732
|
+
var require_types = __commonJS({
|
|
10733
|
+
"node_modules/google-logging-utils/build/src/types.js"(exports) {
|
|
10734
|
+
"use strict";
|
|
10735
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10736
|
+
exports.LogSeverity = void 0;
|
|
10737
|
+
var LogSeverity;
|
|
10738
|
+
(function(LogSeverity2) {
|
|
10739
|
+
LogSeverity2["DEFAULT"] = "DEFAULT";
|
|
10740
|
+
LogSeverity2["DEBUG"] = "DEBUG";
|
|
10741
|
+
LogSeverity2["INFO"] = "INFO";
|
|
10742
|
+
LogSeverity2["WARNING"] = "WARNING";
|
|
10743
|
+
LogSeverity2["ERROR"] = "ERROR";
|
|
10744
|
+
})(LogSeverity || (exports.LogSeverity = LogSeverity = {}));
|
|
10745
|
+
}
|
|
10746
|
+
});
|
|
10747
|
+
|
|
10722
10748
|
// node_modules/google-logging-utils/build/src/logging-utils.js
|
|
10723
10749
|
var require_logging_utils = __commonJS({
|
|
10724
10750
|
"node_modules/google-logging-utils/build/src/logging-utils.js"(exports) {
|
|
@@ -10761,7 +10787,7 @@ var require_logging_utils = __commonJS({
|
|
|
10761
10787
|
};
|
|
10762
10788
|
})();
|
|
10763
10789
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10764
|
-
exports.env = exports.DebugLogBackendBase = exports.placeholder = exports.AdhocDebugLogger =
|
|
10790
|
+
exports.env = exports.DebugLogBackendBase = exports.placeholder = exports.AdhocDebugLogger = void 0;
|
|
10765
10791
|
exports.getNodeBackend = getNodeBackend;
|
|
10766
10792
|
exports.getDebugBackend = getDebugBackend;
|
|
10767
10793
|
exports.getStructuredBackend = getStructuredBackend;
|
|
@@ -10771,18 +10797,18 @@ var require_logging_utils = __commonJS({
|
|
|
10771
10797
|
var process2 = __importStar(__require("process"));
|
|
10772
10798
|
var util = __importStar(__require("util"));
|
|
10773
10799
|
var colours_1 = require_colours();
|
|
10774
|
-
var
|
|
10775
|
-
(function(LogSeverity2) {
|
|
10776
|
-
LogSeverity2["DEFAULT"] = "DEFAULT";
|
|
10777
|
-
LogSeverity2["DEBUG"] = "DEBUG";
|
|
10778
|
-
LogSeverity2["INFO"] = "INFO";
|
|
10779
|
-
LogSeverity2["WARNING"] = "WARNING";
|
|
10780
|
-
LogSeverity2["ERROR"] = "ERROR";
|
|
10781
|
-
})(LogSeverity || (exports.LogSeverity = LogSeverity = {}));
|
|
10800
|
+
var types_1 = require_types();
|
|
10782
10801
|
var AdhocDebugLogger = class extends events_1.EventEmitter {
|
|
10802
|
+
// Our namespace (system/subsystem/etc)
|
|
10803
|
+
namespace;
|
|
10804
|
+
// The function we'll call with new log lines.
|
|
10805
|
+
// Should be built in Node util stuff, or the "debug" package, or whatever.
|
|
10806
|
+
upstream;
|
|
10807
|
+
// Self-referential function wrapper that calls invoke() on us.
|
|
10808
|
+
func;
|
|
10783
10809
|
/**
|
|
10784
10810
|
* @param upstream The backend will pass a function that will be
|
|
10785
|
-
*
|
|
10811
|
+
* called whenever our logger function is invoked.
|
|
10786
10812
|
*/
|
|
10787
10813
|
constructor(namespace, upstream) {
|
|
10788
10814
|
super();
|
|
@@ -10794,10 +10820,10 @@ var require_logging_utils = __commonJS({
|
|
|
10794
10820
|
// And pull over the EventEmitter functionality.
|
|
10795
10821
|
on: (event, listener) => this.on(event, listener)
|
|
10796
10822
|
});
|
|
10797
|
-
this.func.debug = (...args) => this.invokeSeverity(LogSeverity.DEBUG, ...args);
|
|
10798
|
-
this.func.info = (...args) => this.invokeSeverity(LogSeverity.INFO, ...args);
|
|
10799
|
-
this.func.warn = (...args) => this.invokeSeverity(LogSeverity.WARNING, ...args);
|
|
10800
|
-
this.func.error = (...args) => this.invokeSeverity(LogSeverity.ERROR, ...args);
|
|
10823
|
+
this.func.debug = (...args) => this.invokeSeverity(types_1.LogSeverity.DEBUG, ...args);
|
|
10824
|
+
this.func.info = (...args) => this.invokeSeverity(types_1.LogSeverity.INFO, ...args);
|
|
10825
|
+
this.func.warn = (...args) => this.invokeSeverity(types_1.LogSeverity.WARNING, ...args);
|
|
10826
|
+
this.func.error = (...args) => this.invokeSeverity(types_1.LogSeverity.ERROR, ...args);
|
|
10801
10827
|
this.func.sublog = (namespace2) => log(namespace2, this.func);
|
|
10802
10828
|
}
|
|
10803
10829
|
invoke(fields, ...args) {
|
|
@@ -10820,12 +10846,11 @@ var require_logging_utils = __commonJS({
|
|
|
10820
10846
|
exports.placeholder = new AdhocDebugLogger("", () => {
|
|
10821
10847
|
}).func;
|
|
10822
10848
|
var DebugLogBackendBase = class {
|
|
10849
|
+
cached = /* @__PURE__ */ new Map();
|
|
10850
|
+
filters = [];
|
|
10851
|
+
filtersSet = false;
|
|
10823
10852
|
constructor() {
|
|
10824
|
-
|
|
10825
|
-
this.cached = /* @__PURE__ */ new Map();
|
|
10826
|
-
this.filters = [];
|
|
10827
|
-
this.filtersSet = false;
|
|
10828
|
-
let nodeFlag = (_a = process2.env[exports.env.nodeEnables]) !== null && _a !== void 0 ? _a : "*";
|
|
10853
|
+
let nodeFlag = process2.env[exports.env.nodeEnables] ?? "*";
|
|
10829
10854
|
if (nodeFlag === "all") {
|
|
10830
10855
|
nodeFlag = "*";
|
|
10831
10856
|
}
|
|
@@ -10850,10 +10875,9 @@ var require_logging_utils = __commonJS({
|
|
|
10850
10875
|
};
|
|
10851
10876
|
exports.DebugLogBackendBase = DebugLogBackendBase;
|
|
10852
10877
|
var NodeBackend = class extends DebugLogBackendBase {
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
}
|
|
10878
|
+
// Default to allowing all systems, since we gate earlier based on whether the
|
|
10879
|
+
// variable is empty.
|
|
10880
|
+
enabledRegexp = /.*/g;
|
|
10857
10881
|
isEnabled(namespace) {
|
|
10858
10882
|
return this.enabledRegexp.test(namespace);
|
|
10859
10883
|
}
|
|
@@ -10863,22 +10887,21 @@ var require_logging_utils = __commonJS({
|
|
|
10863
10887
|
};
|
|
10864
10888
|
}
|
|
10865
10889
|
return (fields, ...args) => {
|
|
10866
|
-
var _a;
|
|
10867
10890
|
const nscolour = `${colours_1.Colours.green}${namespace}${colours_1.Colours.reset}`;
|
|
10868
10891
|
const pid = `${colours_1.Colours.yellow}${process2.pid}${colours_1.Colours.reset}`;
|
|
10869
10892
|
let level;
|
|
10870
10893
|
switch (fields.severity) {
|
|
10871
|
-
case LogSeverity.ERROR:
|
|
10894
|
+
case types_1.LogSeverity.ERROR:
|
|
10872
10895
|
level = `${colours_1.Colours.red}${fields.severity}${colours_1.Colours.reset}`;
|
|
10873
10896
|
break;
|
|
10874
|
-
case LogSeverity.INFO:
|
|
10897
|
+
case types_1.LogSeverity.INFO:
|
|
10875
10898
|
level = `${colours_1.Colours.magenta}${fields.severity}${colours_1.Colours.reset}`;
|
|
10876
10899
|
break;
|
|
10877
|
-
case LogSeverity.WARNING:
|
|
10900
|
+
case types_1.LogSeverity.WARNING:
|
|
10878
10901
|
level = `${colours_1.Colours.yellow}${fields.severity}${colours_1.Colours.reset}`;
|
|
10879
10902
|
break;
|
|
10880
10903
|
default:
|
|
10881
|
-
level =
|
|
10904
|
+
level = fields.severity ?? types_1.LogSeverity.DEFAULT;
|
|
10882
10905
|
break;
|
|
10883
10906
|
}
|
|
10884
10907
|
const msg = util.formatWithOptions({ colors: colours_1.Colours.enabled }, ...args);
|
|
@@ -10901,6 +10924,7 @@ var require_logging_utils = __commonJS({
|
|
|
10901
10924
|
return new NodeBackend();
|
|
10902
10925
|
}
|
|
10903
10926
|
var DebugBackend = class extends DebugLogBackendBase {
|
|
10927
|
+
debugPkg;
|
|
10904
10928
|
constructor(pkg) {
|
|
10905
10929
|
super();
|
|
10906
10930
|
this.debugPkg = pkg;
|
|
@@ -10912,8 +10936,7 @@ var require_logging_utils = __commonJS({
|
|
|
10912
10936
|
};
|
|
10913
10937
|
}
|
|
10914
10938
|
setFilters() {
|
|
10915
|
-
|
|
10916
|
-
const existingFilters = (_a = process2.env["NODE_DEBUG"]) !== null && _a !== void 0 ? _a : "";
|
|
10939
|
+
const existingFilters = process2.env["NODE_DEBUG"] ?? "";
|
|
10917
10940
|
process2.env["NODE_DEBUG"] = `${existingFilters}${existingFilters ? "," : ""}${this.filters.join(",")}`;
|
|
10918
10941
|
}
|
|
10919
10942
|
};
|
|
@@ -10921,17 +10944,15 @@ var require_logging_utils = __commonJS({
|
|
|
10921
10944
|
return new DebugBackend(debugPkg);
|
|
10922
10945
|
}
|
|
10923
10946
|
var StructuredBackend = class extends DebugLogBackendBase {
|
|
10947
|
+
upstream;
|
|
10924
10948
|
constructor(upstream) {
|
|
10925
|
-
var _a;
|
|
10926
10949
|
super();
|
|
10927
|
-
this.upstream =
|
|
10950
|
+
this.upstream = upstream ?? void 0;
|
|
10928
10951
|
}
|
|
10929
10952
|
makeLogger(namespace) {
|
|
10930
|
-
|
|
10931
|
-
const debugLogger = (_a = this.upstream) === null || _a === void 0 ? void 0 : _a.makeLogger(namespace);
|
|
10953
|
+
const debugLogger = this.upstream?.makeLogger(namespace);
|
|
10932
10954
|
return (fields, ...args) => {
|
|
10933
|
-
|
|
10934
|
-
const severity = (_a2 = fields.severity) !== null && _a2 !== void 0 ? _a2 : LogSeverity.INFO;
|
|
10955
|
+
const severity = fields.severity ?? types_1.LogSeverity.INFO;
|
|
10935
10956
|
const json = Object.assign({
|
|
10936
10957
|
severity,
|
|
10937
10958
|
message: util.format(...args)
|
|
@@ -10945,8 +10966,7 @@ var require_logging_utils = __commonJS({
|
|
|
10945
10966
|
};
|
|
10946
10967
|
}
|
|
10947
10968
|
setFilters() {
|
|
10948
|
-
|
|
10949
|
-
(_a = this.upstream) === null || _a === void 0 ? void 0 : _a.setFilters();
|
|
10969
|
+
this.upstream?.setFilters();
|
|
10950
10970
|
}
|
|
10951
10971
|
};
|
|
10952
10972
|
function getStructuredBackend(upstream) {
|
|
@@ -10998,7 +11018,7 @@ var require_logging_utils = __commonJS({
|
|
|
10998
11018
|
}
|
|
10999
11019
|
previousBackend = cachedBackend;
|
|
11000
11020
|
}
|
|
11001
|
-
cachedBackend
|
|
11021
|
+
cachedBackend?.log(namespace, fields, ...args);
|
|
11002
11022
|
});
|
|
11003
11023
|
return newLogger;
|
|
11004
11024
|
})();
|
|
@@ -11227,46 +11247,65 @@ var require_src4 = __commonJS({
|
|
|
11227
11247
|
}
|
|
11228
11248
|
try {
|
|
11229
11249
|
if (cachedIsAvailableResponse === void 0) {
|
|
11230
|
-
cachedIsAvailableResponse =
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11250
|
+
cachedIsAvailableResponse = (async () => {
|
|
11251
|
+
try {
|
|
11252
|
+
await metadataAccessor(
|
|
11253
|
+
"instance",
|
|
11254
|
+
void 0,
|
|
11255
|
+
detectGCPAvailableRetries(),
|
|
11256
|
+
// If the default HOST_ADDRESS has been overridden, we should not
|
|
11257
|
+
// make an effort to try SECONDARY_HOST_ADDRESS (as we are likely in
|
|
11258
|
+
// a non-GCP environment):
|
|
11259
|
+
!(process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST)
|
|
11260
|
+
);
|
|
11261
|
+
return true;
|
|
11262
|
+
} catch (e2) {
|
|
11263
|
+
const err = e2;
|
|
11264
|
+
if (process.env.DEBUG_AUTH) {
|
|
11265
|
+
console.info(err);
|
|
11266
|
+
}
|
|
11267
|
+
if (err.type === "request-timeout") {
|
|
11268
|
+
return false;
|
|
11269
|
+
}
|
|
11270
|
+
if (err.response && err.response.status === 404) {
|
|
11271
|
+
return false;
|
|
11272
|
+
} else {
|
|
11273
|
+
const errObj = e2;
|
|
11274
|
+
const getErrorCodes = (err2) => {
|
|
11275
|
+
if (!err2)
|
|
11276
|
+
return ["UNKNOWN"];
|
|
11277
|
+
if (err2.name === "AggregateError" && Array.isArray(err2.errors)) {
|
|
11278
|
+
return err2.errors.flatMap(getErrorCodes);
|
|
11279
|
+
}
|
|
11280
|
+
if (err2.code) {
|
|
11281
|
+
return [err2.code.toString()];
|
|
11282
|
+
}
|
|
11283
|
+
if (err2.cause) {
|
|
11284
|
+
return getErrorCodes(err2.cause);
|
|
11285
|
+
}
|
|
11286
|
+
return ["UNKNOWN"];
|
|
11287
|
+
};
|
|
11288
|
+
const codes = getErrorCodes(errObj);
|
|
11289
|
+
const isExpected = codes.every((code) => [
|
|
11290
|
+
"EHOSTDOWN",
|
|
11291
|
+
"EHOSTUNREACH",
|
|
11292
|
+
"ENETUNREACH",
|
|
11293
|
+
"ENOENT",
|
|
11294
|
+
"ENOTFOUND",
|
|
11295
|
+
"ECONNREFUSED"
|
|
11296
|
+
].includes(code));
|
|
11297
|
+
if (!isExpected) {
|
|
11298
|
+
const code = err.code ? err.code.toString() : "UNKNOWN";
|
|
11299
|
+
process.emitWarning(`received unexpected error = ${err.message} code = ${code}`, "MetadataLookupWarning");
|
|
11300
|
+
}
|
|
11301
|
+
return false;
|
|
11302
|
+
}
|
|
11303
|
+
}
|
|
11304
|
+
})();
|
|
11269
11305
|
}
|
|
11306
|
+
return await cachedIsAvailableResponse;
|
|
11307
|
+
} catch (e2) {
|
|
11308
|
+
return false;
|
|
11270
11309
|
}
|
|
11271
11310
|
}
|
|
11272
11311
|
function resetIsAvailableCache() {
|
|
@@ -11950,18 +11989,18 @@ var require_package2 = __commonJS({
|
|
|
11950
11989
|
"node_modules/google-auth-library/package.json"(exports, module) {
|
|
11951
11990
|
module.exports = {
|
|
11952
11991
|
name: "google-auth-library",
|
|
11953
|
-
version: "
|
|
11992
|
+
version: "11.0.2",
|
|
11954
11993
|
author: "Google Inc.",
|
|
11955
11994
|
description: "Google APIs Authentication Client Library for Node.js",
|
|
11956
11995
|
engines: {
|
|
11957
|
-
node: ">=
|
|
11996
|
+
node: ">=22"
|
|
11958
11997
|
},
|
|
11959
11998
|
main: "./build/src/index.js",
|
|
11960
11999
|
types: "./build/src/index.d.ts",
|
|
11961
12000
|
repository: {
|
|
11962
12001
|
type: "git",
|
|
11963
|
-
directory: "packages/google-auth-library-nodejs",
|
|
11964
|
-
url: "https://github.com/googleapis/google-cloud-node
|
|
12002
|
+
directory: "core/packages/google-auth-library-nodejs",
|
|
12003
|
+
url: "https://github.com/googleapis/google-cloud-node.git"
|
|
11965
12004
|
},
|
|
11966
12005
|
keywords: [
|
|
11967
12006
|
"google",
|
|
@@ -11974,8 +12013,8 @@ var require_package2 = __commonJS({
|
|
|
11974
12013
|
"base64-js": "^1.3.0",
|
|
11975
12014
|
"ecdsa-sig-formatter": "^1.0.11",
|
|
11976
12015
|
gaxios: "^7.1.4",
|
|
11977
|
-
"gcp-metadata": "
|
|
11978
|
-
"google-logging-utils": "
|
|
12016
|
+
"gcp-metadata": "^9.0.0",
|
|
12017
|
+
"google-logging-utils": "^2.0.0",
|
|
11979
12018
|
jws: "^4.0.0"
|
|
11980
12019
|
},
|
|
11981
12020
|
devDependencies: {
|
|
@@ -11992,15 +12031,15 @@ var require_package2 = __commonJS({
|
|
|
11992
12031
|
gts: "^6.0.2",
|
|
11993
12032
|
"is-docker": "^3.0.0",
|
|
11994
12033
|
jsdoc: "^4.0.4",
|
|
11995
|
-
"jsdoc-fresh": "^
|
|
11996
|
-
"jsdoc-region-tag": "^
|
|
12034
|
+
"jsdoc-fresh": "^6.0.0",
|
|
12035
|
+
"jsdoc-region-tag": "^5.0.0",
|
|
11997
12036
|
karma: "^6.0.0",
|
|
11998
12037
|
"karma-chrome-launcher": "^3.0.0",
|
|
11999
12038
|
"karma-coverage": "^2.0.0",
|
|
12000
12039
|
"karma-firefox-launcher": "^2.0.0",
|
|
12001
12040
|
"karma-mocha": "^2.0.0",
|
|
12002
12041
|
"karma-sourcemap-loader": "^0.4.0",
|
|
12003
|
-
"karma-webpack": "^5.0.
|
|
12042
|
+
"karma-webpack": "^5.0.0",
|
|
12004
12043
|
keypair: "^1.0.4",
|
|
12005
12044
|
mocha: "^11.1.0",
|
|
12006
12045
|
mv: "^2.1.1",
|
|
@@ -12036,7 +12075,7 @@ var require_package2 = __commonJS({
|
|
|
12036
12075
|
prelint: "cd samples; npm link ../; npm install"
|
|
12037
12076
|
},
|
|
12038
12077
|
license: "Apache-2.0",
|
|
12039
|
-
homepage: "https://github.com/googleapis/google-cloud-node
|
|
12078
|
+
homepage: "https://github.com/googleapis/google-cloud-node/tree/main/core/packages/google-auth-library-nodejs"
|
|
12040
12079
|
};
|
|
12041
12080
|
}
|
|
12042
12081
|
});
|
|
@@ -17591,7 +17630,7 @@ var require_googleauth = __commonJS({
|
|
|
17591
17630
|
return null;
|
|
17592
17631
|
}
|
|
17593
17632
|
try {
|
|
17594
|
-
return this._getApplicationCredentialsFromFilePath(credentialsPath, options);
|
|
17633
|
+
return await this._getApplicationCredentialsFromFilePath(credentialsPath, options);
|
|
17595
17634
|
} catch (e2) {
|
|
17596
17635
|
if (e2 instanceof Error) {
|
|
17597
17636
|
e2.message = `Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${e2.message}`;
|
|
@@ -17605,22 +17644,24 @@ var require_googleauth = __commonJS({
|
|
|
17605
17644
|
* @api private
|
|
17606
17645
|
*/
|
|
17607
17646
|
async _tryGetApplicationCredentialsFromWellKnownFile(options) {
|
|
17608
|
-
let
|
|
17609
|
-
if (
|
|
17610
|
-
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
|
|
17647
|
+
let configDir = process.env["CLOUDSDK_CONFIG"];
|
|
17648
|
+
if (!configDir) {
|
|
17649
|
+
if (this._isWindows()) {
|
|
17650
|
+
if (process.env["APPDATA"]) {
|
|
17651
|
+
configDir = path.join(process.env["APPDATA"], "gcloud");
|
|
17652
|
+
}
|
|
17653
|
+
} else {
|
|
17654
|
+
const home = process.env["HOME"];
|
|
17655
|
+
if (home) {
|
|
17656
|
+
configDir = path.join(home, ".config", "gcloud");
|
|
17657
|
+
}
|
|
17615
17658
|
}
|
|
17616
17659
|
}
|
|
17617
|
-
if (
|
|
17618
|
-
|
|
17619
|
-
if (!fs2.existsSync(location)) {
|
|
17620
|
-
location = null;
|
|
17621
|
-
}
|
|
17660
|
+
if (!configDir) {
|
|
17661
|
+
return null;
|
|
17622
17662
|
}
|
|
17623
|
-
|
|
17663
|
+
const location = path.join(configDir, "application_default_credentials.json");
|
|
17664
|
+
if (!fs2.existsSync(location)) {
|
|
17624
17665
|
return null;
|
|
17625
17666
|
}
|
|
17626
17667
|
const client = await this._getApplicationCredentialsFromFilePath(location, options);
|
|
@@ -17959,7 +18000,7 @@ var require_googleauth = __commonJS({
|
|
|
17959
18000
|
const endpoint = opts.apiEndpoint || opts.servicePath;
|
|
17960
18001
|
if (endpoint) {
|
|
17961
18002
|
const scheme = endpoint.startsWith("http") ? "" : "https://";
|
|
17962
|
-
const formattedAudience = `${scheme}${endpoint}
|
|
18003
|
+
const formattedAudience = `${scheme}${endpoint}`.replace(/\/+$/, "");
|
|
17963
18004
|
const newClient = client.createWithGdchAudience(formattedAudience);
|
|
17964
18005
|
this.cachedCredential = newClient;
|
|
17965
18006
|
return newClient;
|
|
@@ -18565,7 +18606,25 @@ async function gcpFetch(url, token, method = "GET", body) {
|
|
|
18565
18606
|
return data;
|
|
18566
18607
|
}
|
|
18567
18608
|
async function pollOperation(operationName, token, maxWaitMs = 6e4) {
|
|
18568
|
-
|
|
18609
|
+
let opUrl;
|
|
18610
|
+
if (operationName.startsWith("http")) {
|
|
18611
|
+
let isGoogleHost;
|
|
18612
|
+
try {
|
|
18613
|
+
const parsedUrl = new URL(operationName);
|
|
18614
|
+
const hostname = (parsedUrl.hostname || "").toLowerCase();
|
|
18615
|
+
isGoogleHost = hostname === "iam.googleapis.com" || hostname.endsWith(".iam.googleapis.com") || hostname === "googleapis.com" || hostname.endsWith(".googleapis.com");
|
|
18616
|
+
} catch {
|
|
18617
|
+
isGoogleHost = false;
|
|
18618
|
+
}
|
|
18619
|
+
if (!isGoogleHost) {
|
|
18620
|
+
throw new Error(
|
|
18621
|
+
`Invalid operation URL: hostname must be a Google API endpoint (*.googleapis.com), got: ${operationName}`
|
|
18622
|
+
);
|
|
18623
|
+
}
|
|
18624
|
+
opUrl = operationName;
|
|
18625
|
+
} else {
|
|
18626
|
+
opUrl = `https://iam.googleapis.com/v1/${operationName}`;
|
|
18627
|
+
}
|
|
18569
18628
|
const deadline = Date.now() + maxWaitMs;
|
|
18570
18629
|
const maxWaitSecs = Math.round(maxWaitMs / 1e3);
|
|
18571
18630
|
while (Date.now() < deadline) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@el-j/google-sheet-translations",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.6",
|
|
4
4
|
"description": "A package to manage translations stored in Google Spreadsheets",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"license": "MIT",
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@actions/core": "^3.0.1",
|
|
69
|
-
"google-auth-library": "^
|
|
69
|
+
"google-auth-library": "^11.0.2",
|
|
70
70
|
"google-spreadsheet": "^5.3.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
@@ -74,41 +74,41 @@
|
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@eslint/js": "^10.0.1",
|
|
77
|
-
"@semantic-release/changelog": "^
|
|
77
|
+
"@semantic-release/changelog": "^7.0.0",
|
|
78
78
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
79
|
-
"@semantic-release/git": "^
|
|
80
|
-
"@semantic-release/github": "^12.0.
|
|
79
|
+
"@semantic-release/git": "^11.0.1",
|
|
80
|
+
"@semantic-release/github": "^12.0.9",
|
|
81
81
|
"@semantic-release/npm": "^13.1.5",
|
|
82
82
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
83
|
-
"@types/node": "^
|
|
84
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
85
|
-
"@typescript-eslint/parser": "^8.
|
|
86
|
-
"@vitest/coverage-v8": "^4.1.
|
|
83
|
+
"@types/node": "^26.4.0",
|
|
84
|
+
"@typescript-eslint/eslint-plugin": "^8.68.0",
|
|
85
|
+
"@typescript-eslint/parser": "^8.68.0",
|
|
86
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
87
87
|
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
88
88
|
"dotenv": "17.4.2",
|
|
89
|
-
"esbuild": "^0.28.
|
|
90
|
-
"eslint": "^10.
|
|
91
|
-
"npm-check-updates": "^
|
|
89
|
+
"esbuild": "^0.28.2",
|
|
90
|
+
"eslint": "^10.9.1",
|
|
91
|
+
"npm-check-updates": "^23.1.0",
|
|
92
92
|
"rimraf": "^6.1.3",
|
|
93
|
-
"semantic-release": "^25.0.
|
|
93
|
+
"semantic-release": "^25.0.9",
|
|
94
94
|
"ts-node": "^10.9.2",
|
|
95
95
|
"typescript": "^6.0.3",
|
|
96
|
-
"vitepress": "
|
|
97
|
-
"vitest": "^4.1.
|
|
98
|
-
"vitest-mock-extended": "^
|
|
96
|
+
"vitepress": "2.0.0-alpha.19",
|
|
97
|
+
"vitest": "^4.1.11",
|
|
98
|
+
"vitest-mock-extended": "^5.1.1"
|
|
99
99
|
},
|
|
100
100
|
"engines": {
|
|
101
101
|
"node": ">=18.0.0"
|
|
102
102
|
},
|
|
103
103
|
"overrides": {
|
|
104
104
|
"google-spreadsheet": {
|
|
105
|
-
"google-auth-library": "^
|
|
106
|
-
},
|
|
107
|
-
"vite": {
|
|
108
|
-
"esbuild": "^0.25.0"
|
|
105
|
+
"google-auth-library": "^11.0.2"
|
|
109
106
|
},
|
|
110
107
|
"@actions/http-client": {
|
|
111
108
|
"undici": "^7.0.0"
|
|
112
109
|
}
|
|
110
|
+
},
|
|
111
|
+
"allowScripts": {
|
|
112
|
+
"esbuild@0.28.2": true
|
|
113
113
|
}
|
|
114
114
|
}
|