@openclaw/googlechat 2026.9.1-beta.1 → 2026.9.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/dist/{actions-DUdoL8WV.js → actions-6QiB4LOV.js} +10 -9
- package/dist/api.js +2 -2
- package/dist/{approval-auth-Pxi5Q60c.js → approval-auth-CEu4-wG6.js} +2 -2
- package/dist/approval-card-text-ChngxXdJ.js +6 -0
- package/dist/{approval-handler.runtime-Bhm1R0FC.js → approval-handler.runtime-BlNZVfJD.js} +24 -13
- package/dist/{channel-D2PMvPgX.js → channel-C_PzX4pt.js} +44 -35
- package/dist/{channel-base-BpHXDsur.js → channel-base-B3EzcV7X.js} +35 -23
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.adapters-aCFAB5lK.js → channel.adapters-CQxQqwUQ.js} +58 -25
- package/dist/{channel.runtime-CDUYuYp7.js → channel.runtime-DBXW-pey.js} +35 -53
- package/dist/directory-contract-api.js +1 -1
- package/dist/{secret-contract-BFYyuE0F.js → secret-contract-DmWM0kwM.js} +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/build/src/index.js +59 -40
- package/node_modules/google-auth-library/node_modules/gcp-metadata/build/src/index.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/package.json +20 -23
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.d.ts +1 -29
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.js +13 -13
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.d.ts +1 -0
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.js +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/logging-utils.d.ts +2 -135
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/logging-utils.js +35 -58
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/logging-utils.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/temporal.js +8 -8
- package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/temporal.js.map +1 -1
- package/node_modules/google-auth-library/node_modules/google-logging-utils/package.json +16 -14
- package/node_modules/google-auth-library/package.json +7 -7
- package/openclaw.plugin.json +0 -5
- package/package.json +5 -5
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/LICENSE +0 -202
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/README.md +0 -73
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/colours.d.ts +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/colours.js +0 -81
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/colours.js.map +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/index.d.ts +0 -2
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/index.js +0 -31
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/index.js.map +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/logging-utils.d.ts +0 -89
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/logging-utils.js +0 -414
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/logging-utils.js.map +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/temporal.d.ts +0 -45
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/temporal.js +0 -68
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/build/src/temporal.js.map +0 -1
- package/node_modules/google-auth-library/node_modules/gcp-metadata/node_modules/google-logging-utils/package.json +0 -47
- /package/node_modules/google-auth-library/node_modules/{gcp-metadata/node_modules/google-logging-utils → google-logging-utils}/build/src/types.d.ts +0 -0
- /package/node_modules/google-auth-library/node_modules/{gcp-metadata/node_modules/google-logging-utils → google-logging-utils}/build/src/types.js +0 -0
- /package/node_modules/google-auth-library/node_modules/{gcp-metadata/node_modules/google-logging-utils → google-logging-utils}/build/src/types.js.map +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as readGoogleChatApprovalActionToken, C as verifyGoogleChatRequest, D as completeGoogleChatApprovalCardBinding, E as claimGoogleChatApprovalCardBinding, N as releaseGoogleChatApprovalCardBinding, S as updateGoogleChatMessage, _ as GoogleChatApiError, b as probeGoogleChat, c as googleChatIngressIdentity, d as isGoogleChatGroupSpace, k as getGoogleChatApprovalCardBinding, l as normalizeGoogleChatUserId, u as buildGoogleChatGroupPolicyScope, v as deleteGoogleChatMessage, x as sendGoogleChatMessage, y as downloadGoogleChatMedia } from "./channel.adapters-CQxQqwUQ.js";
|
|
2
2
|
import { C as resolveWebhookPath, E as warnMissingProviderGroupPolicyFallbackOnce, O as getGoogleChatRuntime, b as resolveAllowlistProviderRuntimeGroupPolicy, c as createChannelPairingController, f as isDangerousNameMatchingEnabled, n as GROUP_POLICY_BLOCKED_LABEL, x as resolveDefaultGroupPolicy } from "./runtime-api-Dh0CNVS4.js";
|
|
3
|
-
import { n as googleChatApprovalAuth } from "./approval-auth-
|
|
3
|
+
import { n as googleChatApprovalAuth } from "./approval-auth-CEu4-wG6.js";
|
|
4
|
+
import { t as escapeGoogleChatApprovalCardText } from "./approval-card-text-ChngxXdJ.js";
|
|
4
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
6
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
6
7
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -11,21 +12,18 @@ import { createChannelPartialDeliveryError, formatInboundMediaUnavailableText, r
|
|
|
11
12
|
import { WEBHOOK_RATE_LIMIT_DEFAULTS, canonicalizeWebhookRouteKey, createFixedWindowRateLimiter, resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
12
13
|
import { registerWebhookTargetWithPluginRoute, resolveWebhookTargetWithAuthOrReject, withResolvedWebhookRequestPipeline } from "openclaw/plugin-sdk/webhook-targets";
|
|
13
14
|
import { createWebhookInFlightLimiter, readJsonWebhookBodyOrReject, runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
15
|
+
import { channelIngressRoutes, createChannelIngressResolver, createStandardRawEventIngressMonitor } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
14
16
|
import { channelBlockedPatch, channelReadyPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
15
17
|
import { isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
16
18
|
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
17
19
|
import { parseDateStringTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
18
20
|
import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
|
|
19
|
-
import { channelIngressRoutes, createChannelIngressResolver, createStandardRawEventIngressMonitor, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
20
21
|
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
21
22
|
//#region extensions/googlechat/src/approval-terminal-card.ts
|
|
22
23
|
const GOOGLECHAT_APPROVAL_CARD_ID = "openclaw-approval";
|
|
23
24
|
const MAX_TEXT_PARAGRAPH_CHARS = 1800;
|
|
24
|
-
function escapeGoogleChatText(text) {
|
|
25
|
-
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
26
|
-
}
|
|
27
25
|
function truncateText(text) {
|
|
28
|
-
return text.length <= MAX_TEXT_PARAGRAPH_CHARS ? text : `${truncateUtf16Safe(text,
|
|
26
|
+
return text.length <= MAX_TEXT_PARAGRAPH_CHARS ? text : `${truncateUtf16Safe(text, 1797)}...`;
|
|
29
27
|
}
|
|
30
28
|
function formatApprovalId(value) {
|
|
31
29
|
return JSON.stringify(value).slice(1, -1);
|
|
@@ -42,12 +40,12 @@ function formatCanonicalOutcome(approval) {
|
|
|
42
40
|
function buildSubjectSection(presentation) {
|
|
43
41
|
if (presentation.kind === "exec") return {
|
|
44
42
|
header: "Command",
|
|
45
|
-
widgets: [{ textParagraph: { text:
|
|
43
|
+
widgets: [{ textParagraph: { text: escapeGoogleChatApprovalCardText(truncateText(presentation.commandPreview ?? presentation.commandText)) } }]
|
|
46
44
|
};
|
|
47
45
|
const description = presentation.description.trim();
|
|
48
46
|
return {
|
|
49
47
|
header: "Request",
|
|
50
|
-
widgets: [{ textParagraph: { text: truncateText(`<b>${
|
|
48
|
+
widgets: [{ textParagraph: { text: truncateText(`<b>${escapeGoogleChatApprovalCardText(presentation.title)}</b>${description ? `<br>${escapeGoogleChatApprovalCardText(description)}` : ""}`) } }]
|
|
51
49
|
};
|
|
52
50
|
}
|
|
53
51
|
/** Render the canonical first-answer result without retaining any actionable buttons. */
|
|
@@ -55,10 +53,10 @@ function buildGoogleChatCanonicalApprovalTerminalCards(result) {
|
|
|
55
53
|
const { approval } = result;
|
|
56
54
|
const kindLabel = approval.presentation.kind === "plugin" ? "Plugin" : "Exec";
|
|
57
55
|
const detailLines = [
|
|
58
|
-
`<b>Approval ID:</b> ${
|
|
59
|
-
`<b>Status:</b> ${
|
|
60
|
-
...approval.status === "allowed" || approval.status === "denied" ? [`<b>Decision:</b> ${
|
|
61
|
-
`<b>Reason:</b> ${
|
|
56
|
+
`<b>Approval ID:</b> ${escapeGoogleChatApprovalCardText(formatApprovalId(approval.id))}`,
|
|
57
|
+
`<b>Status:</b> ${escapeGoogleChatApprovalCardText(approval.status)}`,
|
|
58
|
+
...approval.status === "allowed" || approval.status === "denied" ? [`<b>Decision:</b> ${escapeGoogleChatApprovalCardText(approval.decision)}`] : [],
|
|
59
|
+
`<b>Reason:</b> ${escapeGoogleChatApprovalCardText(approval.reason)}`
|
|
62
60
|
];
|
|
63
61
|
return [{
|
|
64
62
|
cardId: GOOGLECHAT_APPROVAL_CARD_ID,
|
|
@@ -158,39 +156,6 @@ async function maybeHandleGoogleChatApprovalCardClick(params) {
|
|
|
158
156
|
}
|
|
159
157
|
//#endregion
|
|
160
158
|
//#region extensions/googlechat/src/monitor-access.ts
|
|
161
|
-
function normalizeUserId(raw) {
|
|
162
|
-
const trimmed = normalizeOptionalString(raw) ?? "";
|
|
163
|
-
if (!trimmed) return "";
|
|
164
|
-
return normalizeLowercaseStringOrEmpty(trimmed.replace(/^users\//i, ""));
|
|
165
|
-
}
|
|
166
|
-
const GOOGLECHAT_EMAIL_KIND = "plugin:googlechat-email";
|
|
167
|
-
function normalizeEntryValue(raw) {
|
|
168
|
-
return normalizeLowercaseStringOrEmpty(raw ?? "");
|
|
169
|
-
}
|
|
170
|
-
function normalizeGoogleChatStableEntry(entry) {
|
|
171
|
-
const withoutProvider = normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "");
|
|
172
|
-
if (!withoutProvider) return null;
|
|
173
|
-
return withoutProvider.startsWith("users/") ? normalizeUserId(withoutProvider) : withoutProvider;
|
|
174
|
-
}
|
|
175
|
-
function normalizeGoogleChatEmailEntry(entry) {
|
|
176
|
-
if (normalizeEntryValue(entry).replace(/^(googlechat|google-chat|gchat):/i, "").startsWith("users/")) return null;
|
|
177
|
-
const stable = normalizeGoogleChatStableEntry(entry);
|
|
178
|
-
return stable?.includes("@") ? stable : null;
|
|
179
|
-
}
|
|
180
|
-
const googleChatIngressIdentity = defineStableChannelIngressIdentity({
|
|
181
|
-
key: "sender-id",
|
|
182
|
-
normalizeEntry: normalizeGoogleChatStableEntry,
|
|
183
|
-
normalizeSubject: normalizeUserId,
|
|
184
|
-
aliases: [{
|
|
185
|
-
key: "email",
|
|
186
|
-
kind: GOOGLECHAT_EMAIL_KIND,
|
|
187
|
-
normalizeEntry: normalizeGoogleChatEmailEntry,
|
|
188
|
-
normalizeSubject: normalizeEntryValue,
|
|
189
|
-
dangerous: true
|
|
190
|
-
}],
|
|
191
|
-
isWildcardEntry: (entry) => normalizeEntryValue(entry) === "*",
|
|
192
|
-
resolveEntryId: ({ entryIndex, fieldKey }) => fieldKey === "stableId" ? `entry-${entryIndex + 1}:user` : `entry-${entryIndex + 1}:${fieldKey}`
|
|
193
|
-
});
|
|
194
159
|
function resolveGoogleChatGroupConfig(params) {
|
|
195
160
|
const { groupId, groupName, groups } = params;
|
|
196
161
|
const entries = groups ?? {};
|
|
@@ -232,7 +197,7 @@ function extractMentionInfo(annotations, botUser) {
|
|
|
232
197
|
const userName = entry.userMention?.user?.name;
|
|
233
198
|
if (!userName) return false;
|
|
234
199
|
if (botTargets.has(userName)) return true;
|
|
235
|
-
return
|
|
200
|
+
return normalizeGoogleChatUserId(userName) === "app";
|
|
236
201
|
})
|
|
237
202
|
};
|
|
238
203
|
}
|
|
@@ -727,7 +692,7 @@ function extractBearerToken(header) {
|
|
|
727
692
|
const authHeader = Array.isArray(header) ? typeof header[0] === "string" ? header[0] : "" : typeof header === "string" ? header : "";
|
|
728
693
|
return normalizeLowercaseStringOrEmpty(authHeader).startsWith("bearer ") ? authHeader.slice(7).trim() : "";
|
|
729
694
|
}
|
|
730
|
-
const ADD_ON_PREAUTH_MAX_BYTES =
|
|
695
|
+
const ADD_ON_PREAUTH_MAX_BYTES = 16384;
|
|
731
696
|
const ADD_ON_PREAUTH_TIMEOUT_MS = 3e3;
|
|
732
697
|
const GOOGLECHAT_WEBHOOK_ACCEPTED_HEADER = "x-openclaw-delivery-accepted";
|
|
733
698
|
const GOOGLECHAT_WEBHOOK_ACCEPTED_VALUE = "durable";
|
|
@@ -1098,6 +1063,14 @@ async function processMessageWithPipeline(params) {
|
|
|
1098
1063
|
url: attachmentData.path,
|
|
1099
1064
|
contentType: attachmentData.contentType ?? first.contentType
|
|
1100
1065
|
};
|
|
1066
|
+
else {
|
|
1067
|
+
const notice = `[Google Chat attachment unavailable: ${first.driveDataRef ? "Google Drive files are not downloadable" : "unsupported attachment source"}; upload the file directly]`;
|
|
1068
|
+
rawBody = formatInboundMediaUnavailableText({
|
|
1069
|
+
body: rawBody,
|
|
1070
|
+
notice
|
|
1071
|
+
});
|
|
1072
|
+
runtime.error?.(`[${account.accountId}] ${notice}`);
|
|
1073
|
+
}
|
|
1101
1074
|
} catch (error) {
|
|
1102
1075
|
if (!(error instanceof MediaFetchError) || error.code !== "max_bytes") throw error;
|
|
1103
1076
|
const notice = `[Google Chat attachment too large; maximum ${mediaMaxMb} MB]`;
|
|
@@ -1107,6 +1080,14 @@ async function processMessageWithPipeline(params) {
|
|
|
1107
1080
|
});
|
|
1108
1081
|
runtime.error?.(`[${account.accountId}] ${notice} Increase channels.googlechat.mediaMaxMb to process larger attachments.`);
|
|
1109
1082
|
}
|
|
1083
|
+
const additionalCount = attachments.length - 1;
|
|
1084
|
+
if (additionalCount > 0) {
|
|
1085
|
+
const notice = `[Google Chat: ${additionalCount} additional ${additionalCount === 1 ? "attachment was" : "attachments were"} not processed; only the first attachment is supported]`;
|
|
1086
|
+
rawBody = formatInboundMediaUnavailableText({
|
|
1087
|
+
body: rawBody,
|
|
1088
|
+
notice
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1110
1091
|
const media = mediaInputs.length === 0 ? [] : await toInboundMediaFactsWithMetadata(mediaInputs);
|
|
1111
1092
|
const fromLabel = isGroup ? space.displayName || `space:${spaceId}` : senderName || `user:${senderId}`;
|
|
1112
1093
|
const timestampMs = parseDateStringTimestampMs(event.eventTime);
|
|
@@ -1172,14 +1153,15 @@ async function processMessageWithPipeline(params) {
|
|
|
1172
1153
|
let typingMessage;
|
|
1173
1154
|
const typingMessageThreadName = account.config.replyToMode && account.config.replyToMode !== "off" ? replyThreadName : void 0;
|
|
1174
1155
|
if (typingIndicator === "message") try {
|
|
1156
|
+
const botName = resolveBotDisplayName({
|
|
1157
|
+
accountName: account.config.name,
|
|
1158
|
+
agentId: route.agentId,
|
|
1159
|
+
config
|
|
1160
|
+
});
|
|
1175
1161
|
const result = await sendGoogleChatMessage({
|
|
1176
1162
|
account,
|
|
1177
1163
|
space: spaceId,
|
|
1178
|
-
text: `_${
|
|
1179
|
-
accountName: account.config.name,
|
|
1180
|
-
agentId: route.agentId,
|
|
1181
|
-
config
|
|
1182
|
-
})} is typing..._`,
|
|
1164
|
+
text: `_${botName} is typing..._`,
|
|
1183
1165
|
thread: typingMessageThreadName
|
|
1184
1166
|
});
|
|
1185
1167
|
if (result?.messageName) typingMessage = createGoogleChatTypingMessage({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as googlechatDirectoryAdapter } from "./channel.adapters-
|
|
1
|
+
import { t as googlechatDirectoryAdapter } from "./channel.adapters-CQxQqwUQ.js";
|
|
2
2
|
//#region extensions/googlechat/directory-contract-api.ts
|
|
3
3
|
const googlechatDirectoryContractPlugin = {
|
|
4
4
|
id: "googlechat",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { coerceSecretRef } from "openclaw/plugin-sdk/secret-input";
|
|
1
2
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
2
3
|
import { createChannelSecretTargetRegistryEntries, getChannelSurface, hasOwnProperty, pushAssignment, pushInactiveSurfaceWarning, resolveChannelAccountSurface } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
3
|
-
import { coerceSecretRef } from "openclaw/plugin-sdk/secret-ref-runtime";
|
|
4
4
|
//#region extensions/googlechat/src/secret-contract.ts
|
|
5
5
|
function accountSecretOwner(accountId) {
|
|
6
6
|
return {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-DmWM0kwM.js";
|
|
2
2
|
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as createGoogleChatPluginBase } from "./channel-base-
|
|
1
|
+
import { n as createGoogleChatPluginBase } from "./channel-base-B3EzcV7X.js";
|
|
2
2
|
//#region extensions/googlechat/src/channel.setup.ts
|
|
3
3
|
const googlechatSetupPlugin = createGoogleChatPluginBase();
|
|
4
4
|
//#endregion
|
|
@@ -309,49 +309,68 @@ async function isAvailable() {
|
|
|
309
309
|
// runtime environment. We use the same promise for each of these calls
|
|
310
310
|
// to reduce the network load.
|
|
311
311
|
if (cachedIsAvailableResponse === undefined) {
|
|
312
|
-
cachedIsAvailableResponse =
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
312
|
+
cachedIsAvailableResponse = (async () => {
|
|
313
|
+
try {
|
|
314
|
+
await metadataAccessor('instance', undefined, detectGCPAvailableRetries(),
|
|
315
|
+
// If the default HOST_ADDRESS has been overridden, we should not
|
|
316
|
+
// make an effort to try SECONDARY_HOST_ADDRESS (as we are likely in
|
|
317
|
+
// a non-GCP environment):
|
|
318
|
+
!(process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST));
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
catch (e) {
|
|
322
|
+
const err = e;
|
|
323
|
+
if (process.env.DEBUG_AUTH) {
|
|
324
|
+
console.info(err);
|
|
325
|
+
}
|
|
326
|
+
if (err.type === 'request-timeout') {
|
|
327
|
+
// If running in a GCP environment, metadata endpoint should return
|
|
328
|
+
// within ms.
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
if (err.response && err.response.status === 404) {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
const errObj = e;
|
|
336
|
+
const getErrorCodes = (err) => {
|
|
337
|
+
if (!err)
|
|
338
|
+
return ['UNKNOWN'];
|
|
339
|
+
if (err.name === 'AggregateError' && Array.isArray(err.errors)) {
|
|
340
|
+
return err.errors.flatMap(getErrorCodes);
|
|
341
|
+
}
|
|
342
|
+
if (err.code) {
|
|
343
|
+
return [err.code.toString()];
|
|
344
|
+
}
|
|
345
|
+
if (err.cause) {
|
|
346
|
+
return getErrorCodes(err.cause);
|
|
347
|
+
}
|
|
348
|
+
return ['UNKNOWN'];
|
|
349
|
+
};
|
|
350
|
+
const codes = getErrorCodes(errObj);
|
|
351
|
+
const isExpected = codes.every((code) => [
|
|
352
|
+
'EHOSTDOWN',
|
|
353
|
+
'EHOSTUNREACH',
|
|
354
|
+
'ENETUNREACH',
|
|
355
|
+
'ENOENT',
|
|
356
|
+
'ENOTFOUND',
|
|
357
|
+
'ECONNREFUSED',
|
|
358
|
+
].includes(code));
|
|
359
|
+
if (!isExpected) {
|
|
360
|
+
const code = err.code ? err.code.toString() : 'UNKNOWN';
|
|
361
|
+
process.emitWarning(`received unexpected error = ${err.message} code = ${code}`, 'MetadataLookupWarning');
|
|
362
|
+
}
|
|
363
|
+
// Failure to resolve the metadata service means that it is not available.
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
})();
|
|
317
368
|
}
|
|
318
|
-
await cachedIsAvailableResponse;
|
|
319
|
-
return true;
|
|
369
|
+
return await cachedIsAvailableResponse;
|
|
320
370
|
}
|
|
321
371
|
catch (e) {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
console.info(err);
|
|
325
|
-
}
|
|
326
|
-
if (err.type === 'request-timeout') {
|
|
327
|
-
// If running in a GCP environment, metadata endpoint should return
|
|
328
|
-
// within ms.
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
if (err.response && err.response.status === 404) {
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
if (!(err.response && err.response.status === 404) &&
|
|
336
|
-
// A warning is emitted if we see an unexpected err.code, or err.code
|
|
337
|
-
// is not populated:
|
|
338
|
-
(!err.code ||
|
|
339
|
-
![
|
|
340
|
-
'EHOSTDOWN',
|
|
341
|
-
'EHOSTUNREACH',
|
|
342
|
-
'ENETUNREACH',
|
|
343
|
-
'ENOENT',
|
|
344
|
-
'ENOTFOUND',
|
|
345
|
-
'ECONNREFUSED',
|
|
346
|
-
].includes(err.code.toString()))) {
|
|
347
|
-
let code = 'UNKNOWN';
|
|
348
|
-
if (err.code)
|
|
349
|
-
code = err.code.toString();
|
|
350
|
-
process.emitWarning(`received unexpected error = ${err.message} code = ${code}`, 'MetadataLookupWarning');
|
|
351
|
-
}
|
|
352
|
-
// Failure to resolve the metadata service means that it is not available.
|
|
353
|
-
return false;
|
|
354
|
-
}
|
|
372
|
+
// This block should technically not be reached because the async IIFE catches its own errors
|
|
373
|
+
return false;
|
|
355
374
|
}
|
|
356
375
|
}
|
|
357
376
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6OA,4BAEC;AAcD,0BAEC;AAYD,4BAEC;AAyBD,oBAkBC;AAgBD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6OA,4BAEC;AAcD,0BAEC;AAYD,4BAEC;AAyBD,oBAkBC;AAgBD,kCAwGC;AAKD,sDAEC;AAaD,0CAMC;AASD,0CAEC;AAWD,wCAEC;AAleD;;;;;;;;;;;;;;G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B,IAAI,CAAC;AAEpD;;;;;GAKG;AACH,SAAgB,eAAe;IAC7B,IAAI,yBAAiB,KAAK,IAAI,EAAE,CAAC;QAC/B,eAAe,EAAE,CAAC;IACpB,CAAC;IAED,OAAO,yBAAkB,CAAC;AAC5B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,QAAwB,IAAI;IAC1D,yBAAiB,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,kCAAkB,GAAE,CAAC;AACpE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,cAAc;IAC5B,OAAO,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACtC,CAAC;AAED,kDAAgC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gcp-metadata",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.3",
|
|
4
4
|
"description": "Get the metadata from a Google Cloud Platform environment",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"directory": "packages/gcp-metadata",
|
|
8
|
-
"url": "https://github.com/googleapis/google-cloud-node
|
|
7
|
+
"directory": "core/packages/gcp-metadata",
|
|
8
|
+
"url": "https://github.com/googleapis/google-cloud-node.git"
|
|
9
9
|
},
|
|
10
10
|
"main": "./build/src/index.js",
|
|
11
11
|
"types": "./build/src/index.d.ts",
|
|
@@ -24,8 +24,6 @@
|
|
|
24
24
|
"test": "c8 mocha --timeout=5000 build/test",
|
|
25
25
|
"docs": "jsdoc -c .jsdoc.js",
|
|
26
26
|
"lint": "gts check",
|
|
27
|
-
"docs-test": "linkinator docs",
|
|
28
|
-
"predocs-test": "npm run docs",
|
|
29
27
|
"prelint": "cd samples; npm link ../; npm install",
|
|
30
28
|
"clean": "gts clean",
|
|
31
29
|
"precompile": "gts clean"
|
|
@@ -42,36 +40,35 @@
|
|
|
42
40
|
"author": "Google LLC",
|
|
43
41
|
"license": "Apache-2.0",
|
|
44
42
|
"dependencies": {
|
|
45
|
-
"gaxios": "^7.
|
|
46
|
-
"google-logging-utils": "^
|
|
43
|
+
"gaxios": "^7.1.3",
|
|
44
|
+
"google-logging-utils": "^2.0.0",
|
|
47
45
|
"json-bigint": "^1.0.0"
|
|
48
46
|
},
|
|
49
47
|
"devDependencies": {
|
|
50
|
-
"@google-cloud/functions": "^
|
|
48
|
+
"@google-cloud/functions": "^5.0.0",
|
|
51
49
|
"@types/json-bigint": "^1.0.4",
|
|
52
|
-
"@types/mocha": "^10.0.
|
|
50
|
+
"@types/mocha": "^10.0.10",
|
|
53
51
|
"@types/ncp": "^2.0.8",
|
|
54
|
-
"@types/node": "^
|
|
55
|
-
"@types/sinon": "^
|
|
52
|
+
"@types/node": "^24.0.0",
|
|
53
|
+
"@types/sinon": "^21.0.0",
|
|
56
54
|
"@types/tmp": "^0.2.6",
|
|
57
|
-
"c8": "^10.1.
|
|
55
|
+
"c8": "^10.1.3",
|
|
56
|
+
"chai": "^4.3.10",
|
|
58
57
|
"cross-env": "^7.0.3",
|
|
59
58
|
"gcbuild": "^1.3.39",
|
|
60
|
-
"gcx": "^2.0.27",
|
|
61
59
|
"gts": "^6.0.2",
|
|
62
60
|
"jsdoc": "^4.0.4",
|
|
63
|
-
"jsdoc-fresh": "^
|
|
64
|
-
"jsdoc-region-tag": "^
|
|
65
|
-
"linkinator": "^6.1.2",
|
|
61
|
+
"jsdoc-fresh": "^6.0.0",
|
|
62
|
+
"jsdoc-region-tag": "^5.0.0",
|
|
66
63
|
"mocha": "^11.1.0",
|
|
67
64
|
"ncp": "^2.0.0",
|
|
68
|
-
"nock": "^14.0.
|
|
69
|
-
"sinon": "
|
|
70
|
-
"tmp": "
|
|
71
|
-
"typescript": "
|
|
65
|
+
"nock": "^14.0.5",
|
|
66
|
+
"sinon": "21.0.3",
|
|
67
|
+
"tmp": "0.2.5",
|
|
68
|
+
"typescript": "5.8.3"
|
|
72
69
|
},
|
|
73
70
|
"engines": {
|
|
74
|
-
"node": ">=
|
|
71
|
+
"node": ">=22"
|
|
75
72
|
},
|
|
76
|
-
"homepage": "https://github.com/googleapis/google-cloud-node
|
|
77
|
-
}
|
|
73
|
+
"homepage": "https://github.com/googleapis/google-cloud-node/tree/main/core/packages/gcp-metadata"
|
|
74
|
+
}
|
package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.d.ts
CHANGED
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Handles figuring out if we can use ANSI colours and handing out the escape codes.
|
|
4
|
-
*
|
|
5
|
-
* This is for package-internal use only, and may change at any time.
|
|
6
|
-
*
|
|
7
|
-
* @private
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
export declare class Colours {
|
|
11
|
-
static enabled: boolean;
|
|
12
|
-
static reset: string;
|
|
13
|
-
static bright: string;
|
|
14
|
-
static dim: string;
|
|
15
|
-
static red: string;
|
|
16
|
-
static green: string;
|
|
17
|
-
static yellow: string;
|
|
18
|
-
static blue: string;
|
|
19
|
-
static magenta: string;
|
|
20
|
-
static cyan: string;
|
|
21
|
-
static white: string;
|
|
22
|
-
static grey: string;
|
|
23
|
-
/**
|
|
24
|
-
* @param stream The stream (e.g. process.stderr)
|
|
25
|
-
* @returns true if the stream should have colourization enabled
|
|
26
|
-
*/
|
|
27
|
-
static isEnabled(stream: tty.WriteStream): boolean;
|
|
28
|
-
static refresh(): void;
|
|
29
|
-
}
|
|
1
|
+
export {};
|
package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.js
CHANGED
|
@@ -23,6 +23,18 @@ exports.Colours = void 0;
|
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
25
|
class Colours {
|
|
26
|
+
static enabled = false;
|
|
27
|
+
static reset = '';
|
|
28
|
+
static bright = '';
|
|
29
|
+
static dim = '';
|
|
30
|
+
static red = '';
|
|
31
|
+
static green = '';
|
|
32
|
+
static yellow = '';
|
|
33
|
+
static blue = '';
|
|
34
|
+
static magenta = '';
|
|
35
|
+
static cyan = '';
|
|
36
|
+
static white = '';
|
|
37
|
+
static grey = '';
|
|
26
38
|
/**
|
|
27
39
|
* @param stream The stream (e.g. process.stderr)
|
|
28
40
|
* @returns true if the stream should have colourization enabled
|
|
@@ -35,7 +47,7 @@ class Colours {
|
|
|
35
47
|
: true));
|
|
36
48
|
}
|
|
37
49
|
static refresh() {
|
|
38
|
-
Colours.enabled = Colours.isEnabled(process
|
|
50
|
+
Colours.enabled = Colours.isEnabled(process?.stderr);
|
|
39
51
|
if (!this.enabled) {
|
|
40
52
|
Colours.reset = '';
|
|
41
53
|
Colours.bright = '';
|
|
@@ -65,17 +77,5 @@ class Colours {
|
|
|
65
77
|
}
|
|
66
78
|
}
|
|
67
79
|
exports.Colours = Colours;
|
|
68
|
-
Colours.enabled = false;
|
|
69
|
-
Colours.reset = '';
|
|
70
|
-
Colours.bright = '';
|
|
71
|
-
Colours.dim = '';
|
|
72
|
-
Colours.red = '';
|
|
73
|
-
Colours.green = '';
|
|
74
|
-
Colours.yellow = '';
|
|
75
|
-
Colours.blue = '';
|
|
76
|
-
Colours.magenta = '';
|
|
77
|
-
Colours.cyan = '';
|
|
78
|
-
Colours.white = '';
|
|
79
|
-
Colours.grey = '';
|
|
80
80
|
Colours.refresh();
|
|
81
81
|
//# sourceMappingURL=colours.js.map
|
package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/colours.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colours.js","sourceRoot":"","sources":["../../src/colours.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,kDAAkD;AAClD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAUjC;;;;;;;GAOG;AACH,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,CAAC;YAClB,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;YACnB,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC;YACpB,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC;YACjB,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;YACnB,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC;YAClB,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC;YAClB,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC;YAC5B,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC;YAC7B,OAAO,CAAC,GAAG,GAAG,WAAW,CAAC;YAC1B,OAAO,CAAC,GAAG,GAAG,YAAY,CAAC;YAC3B,OAAO,CAAC,KAAK,GAAG,YAAY,CAAC;YAC7B,OAAO,CAAC,MAAM,GAAG,YAAY,CAAC;YAC9B,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC;YAC5B,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC;YAC/B,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC;YAC5B,OAAO,CAAC,KAAK,GAAG,YAAY,CAAC;YAC7B,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC;QAC9B,CAAC;IACH,CAAC;;AAxDH,0BAyDC;AAED,OAAO,CAAC,OAAO,EAAE,CAAC"}
|
package/node_modules/google-auth-library/node_modules/google-logging-utils/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,kDAAkD;AAClD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;;;;;AAEjC,kDAAgC"}
|