@oomol-lab/open-connector 1.6.5 → 1.7.0
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/assets/open-connector/catalog/apps/aisa.json +6138 -312
- package/assets/open-connector/catalog/apps/baizhi_mcp.json +135 -0
- package/assets/open-connector/catalog/apps/discordbot.json +2888 -248
- package/assets/open-connector/catalog/apps/drawio_mcp.json +192 -0
- package/assets/open-connector/catalog/apps/firecrawl.json +176 -32
- package/assets/open-connector/catalog/apps/framejet.json +273 -0
- package/assets/open-connector/catalog/apps/futunn.json +2967 -0
- package/assets/open-connector/catalog/apps/gmail.json +225 -0
- package/assets/open-connector/catalog/apps/google_analytics.json +4 -1
- package/assets/open-connector/catalog/apps/google_bigquery.json +4 -1
- package/assets/open-connector/catalog/apps/google_search_console.json +4 -1
- package/assets/open-connector/catalog/apps/googlecalendar.json +4 -1
- package/assets/open-connector/catalog/apps/googlechat.json +694 -7
- package/assets/open-connector/catalog/apps/googledocs.json +4 -1
- package/assets/open-connector/catalog/apps/googlesheets.json +4 -1
- package/assets/open-connector/catalog/apps/granola.json +23 -0
- package/assets/open-connector/catalog/apps/keepa.json +3534 -987
- package/assets/open-connector/catalog/apps/linear.json +17 -0
- package/assets/open-connector/catalog/apps/linear_mcp.json +510 -0
- package/assets/open-connector/catalog/apps/moneyforward_mcp.json +1432 -0
- package/assets/open-connector/catalog/apps/notion.json +446 -1
- package/assets/open-connector/catalog/apps/notion_mcp.json +490 -0
- package/assets/open-connector/catalog/apps/odoo.json +619 -0
- package/assets/open-connector/catalog/apps/outlook.json +30 -8
- package/assets/open-connector/catalog/apps/outlook_calendar.json +23 -2
- package/assets/open-connector/catalog/apps/postiz.json +334 -0
- package/assets/open-connector/catalog/apps/proworkflow.json +529 -0
- package/assets/open-connector/catalog/apps/sellersprite_mcp.json +2 -1
- package/assets/open-connector/catalog/apps/slack.json +223 -0
- package/assets/open-connector/catalog/apps/slackbot.json +214 -0
- package/assets/open-connector/catalog/apps/tencent_docs.json +3 -0
- package/assets/open-connector/catalog/apps/wisburg.json +1528 -0
- package/assets/open-connector/catalog/apps/youtube.json +4 -1
- package/assets/open-connector/catalog/apps/zerotier.json +3319 -0
- package/assets/open-connector/catalog/apps-index.json +1 -1
- package/package.json +1 -1
- package/src/core/cast.d.ts +10 -0
- package/src/core/cast.js +14 -0
- package/src/core/guarded-fetch.d.ts +6 -3
- package/src/core/guarded-fetch.js +6 -3
- package/src/core/provider-scenarios.js +67 -13
- package/src/core/request.js +4 -1
- package/src/core/types.d.ts +1 -1
- package/src/mcp.js +10 -7
- package/src/oauth/oauth-client-config-service.d.ts +16 -1
- package/src/oauth/oauth-client-config-service.js +59 -3
- package/src/oauth/oauth-flow-service.d.ts +6 -0
- package/src/oauth/oauth-flow-service.js +4 -2
- package/src/providers/17track/runtime.js +1 -1
- package/src/providers/action-contracts.generated.d.ts +17 -5
- package/src/providers/aifinmarket/runtime.js +1 -1
- package/src/providers/aisa/executors.js +734 -46
- package/src/providers/aliyun_ack/runtime.js +1 -1
- package/src/providers/aliyun_sls/runtime.js +1 -1
- package/src/providers/app_store_server/runtime-helpers.js +1 -1
- package/src/providers/baizhi_mcp/actions.d.ts +2 -0
- package/src/providers/baizhi_mcp/actions.js +40 -0
- package/src/providers/baizhi_mcp/executors.d.ts +3 -0
- package/src/providers/baizhi_mcp/executors.js +102 -0
- package/src/providers/bazhuayu/runtime.js +2 -2
- package/src/providers/bilibili/runtime.js +2 -4
- package/src/providers/bilibili/upload.js +9 -7
- package/src/providers/cloudflare_browser_rendering/executors.js +1 -1
- package/src/providers/cloudflare_dns/executors.js +1 -1
- package/src/providers/{cloudflare-current-user.js → cloudflare_dns/runtime-user.js} +2 -2
- package/src/providers/cloudflare_dns/runtime.d.ts +1 -1
- package/src/providers/cloudflare_dns/runtime.js +1 -1
- package/src/providers/cloudflare_r2/executors.js +1 -1
- package/src/providers/cloudflare_r2/runtime.d.ts +1 -1
- package/src/providers/cloudflare_r2/runtime.js +1 -1
- package/src/providers/cloudflare_worker/executors.js +1 -1
- package/src/providers/cloudflare_worker/runtime.d.ts +1 -1
- package/src/providers/cloudflare_worker/runtime.js +1 -1
- package/src/providers/dingtalk_mcp/runtime.js +1 -1
- package/src/providers/discordbot/executors.d.ts +0 -9
- package/src/providers/discordbot/executors.js +9 -101
- package/src/providers/discordbot/runtime-guilds.d.ts +3 -0
- package/src/providers/discordbot/runtime-guilds.js +464 -0
- package/src/providers/discordbot/runtime.d.ts +42 -0
- package/src/providers/discordbot/runtime.js +124 -0
- package/src/providers/drawio_mcp/executors.d.ts +3 -0
- package/src/providers/drawio_mcp/executors.js +19 -0
- package/src/providers/drawio_mcp/runtime.d.ts +8 -0
- package/src/providers/drawio_mcp/runtime.js +175 -0
- package/src/providers/fastmoss_mcp/executors.js +2 -2
- package/src/providers/finchina/executors.js +1 -1
- package/src/providers/framejet/executors.d.ts +4 -0
- package/src/providers/framejet/executors.js +19 -0
- package/src/providers/framejet/runtime.d.ts +16 -0
- package/src/providers/framejet/runtime.js +148 -0
- package/src/providers/futunn/actions.d.ts +2 -0
- package/src/providers/futunn/actions.js +152 -0
- package/src/providers/futunn/actions.research.d.ts +2 -0
- package/src/providers/futunn/actions.research.js +423 -0
- package/src/providers/futunn/actions.trading.d.ts +2 -0
- package/src/providers/futunn/actions.trading.js +204 -0
- package/src/providers/futunn/executors.d.ts +3 -0
- package/src/providers/futunn/executors.js +24 -0
- package/src/providers/futunn/runtime-research.d.ts +3 -0
- package/src/providers/futunn/runtime-research.js +133 -0
- package/src/providers/futunn/runtime-trading.d.ts +3 -0
- package/src/providers/futunn/runtime-trading.js +39 -0
- package/src/providers/futunn/runtime.d.ts +2 -0
- package/src/providers/futunn/runtime.js +50 -0
- package/src/providers/futunn/transport.d.ts +11 -0
- package/src/providers/futunn/transport.js +76 -0
- package/src/providers/gildata/executors.js +1 -1
- package/src/providers/gmail/executors.js +3 -3
- package/src/providers/gmail/message.d.ts +6 -8
- package/src/providers/gmail/message.js +4 -0
- package/src/providers/gmail/scopes.d.ts +32 -0
- package/src/providers/gmail/scopes.js +37 -0
- package/src/providers/google_analytics/executors.js +2 -2
- package/src/providers/google_analytics/scopes.js +6 -1
- package/src/providers/google_bigquery/executors.js +2 -2
- package/src/providers/google_bigquery/scopes.js +2 -0
- package/src/providers/google_search_console/executors.js +2 -2
- package/src/providers/google_search_console/scopes.js +2 -0
- package/src/providers/googleads/executors.js +1 -1
- package/src/providers/googleads/scopes.d.ts +1 -3
- package/src/providers/googleads/scopes.js +2 -4
- package/src/providers/googlecalendar/executors.js +1 -1
- package/src/providers/googlecalendar/runtime-shared.js +2 -2
- package/src/providers/googlecalendar/scopes.js +2 -0
- package/src/providers/googlechat/executors.d.ts +1 -3
- package/src/providers/googlechat/executors.js +219 -28
- package/src/providers/googlechat/members.d.ts +55 -0
- package/src/providers/googlechat/members.js +293 -0
- package/src/providers/googlechat/runtime.d.ts +16 -0
- package/src/providers/googlechat/runtime.js +25 -0
- package/src/providers/googlechat/scopes.d.ts +22 -3
- package/src/providers/googlechat/scopes.js +30 -7
- package/src/providers/googledocs/executors.js +1 -1
- package/src/providers/googledrive/executors.js +2 -2
- package/src/providers/{google-auth.d.ts → googledrive/runtime-auth.d.ts} +2 -2
- package/src/providers/{google-auth.js → googledrive/runtime-auth.js} +3 -3
- package/src/providers/googledrive/runtime-collaboration.js +1 -1
- package/src/providers/{google-runtime.d.ts → googledrive/runtime-request.d.ts} +1 -1
- package/src/providers/{google-runtime.js → googledrive/runtime-request.js} +2 -2
- package/src/providers/googleforms/executors.js +2 -2
- package/src/providers/googleforms/scopes.d.ts +0 -3
- package/src/providers/googleforms/scopes.js +2 -6
- package/src/providers/googlemeet/executors.js +2 -2
- package/src/providers/googlemeet/scopes.d.ts +0 -3
- package/src/providers/googlemeet/scopes.js +2 -6
- package/src/providers/googlesheets/executors.js +1 -1
- package/src/providers/googlesheets/scopes.js +2 -0
- package/src/providers/googleslides/executors.js +2 -2
- package/src/providers/googleslides/scopes.d.ts +0 -3
- package/src/providers/googleslides/scopes.js +2 -6
- package/src/providers/googletasks/executors.js +2 -2
- package/src/providers/googletasks/scopes.d.ts +0 -3
- package/src/providers/googletasks/scopes.js +2 -6
- package/src/providers/granola/actions.js +2 -0
- package/src/providers/granola/runtime-mcp.js +2 -0
- package/src/providers/granola/runtime.js +2 -2
- package/src/providers/indiegogo/executors.js +1 -1
- package/src/providers/investoday_mcp/executors.js +2 -2
- package/src/providers/iyunbiao/runtime.js +2 -2
- package/src/providers/keepa/actions.d.ts +1 -1
- package/src/providers/keepa/actions.js +371 -149
- package/src/providers/keepa/deal-attributes.d.ts +1 -0
- package/src/providers/keepa/deal-attributes.js +26 -0
- package/src/providers/keepa/runtime.js +212 -18
- package/src/providers/kingdee/executors.js +1 -1
- package/src/providers/kingdee/runtime.js +2 -2
- package/src/providers/kuaidi100/runtime.js +1 -1
- package/src/providers/linear/executors.js +12 -9
- package/src/providers/linear_mcp/actions.d.ts +47 -0
- package/src/providers/linear_mcp/actions.js +102 -0
- package/src/providers/linear_mcp/endpoints.d.ts +3 -0
- package/src/providers/linear_mcp/endpoints.js +3 -0
- package/src/providers/linear_mcp/executors.d.ts +3 -0
- package/src/providers/linear_mcp/executors.js +9 -0
- package/src/providers/linear_mcp/runtime-mcp.d.ts +15 -0
- package/src/providers/linear_mcp/runtime-mcp.js +238 -0
- package/src/providers/lingxing_mcp/runtime.js +1 -1
- package/src/providers/mcdonalds_cn_mcp/runtime.js +1 -1
- package/src/providers/metabase/mcp-runtime.js +1 -1
- package/src/providers/moneyforward_mcp/executors.d.ts +3 -0
- package/src/providers/moneyforward_mcp/executors.js +11 -0
- package/src/providers/moneyforward_mcp/manifest.d.ts +31 -0
- package/src/providers/moneyforward_mcp/manifest.js +204 -0
- package/src/providers/moneyforward_mcp/runtime.d.ts +18 -0
- package/src/providers/moneyforward_mcp/runtime.js +296 -0
- package/src/providers/notion/executors.js +39 -3
- package/src/providers/notion_mcp/endpoints.d.ts +3 -0
- package/src/providers/notion_mcp/endpoints.js +3 -0
- package/src/providers/notion_mcp/executors.d.ts +3 -0
- package/src/providers/notion_mcp/executors.js +176 -0
- package/src/providers/notion_mcp/mcp-response.d.ts +86 -0
- package/src/providers/notion_mcp/mcp-response.js +314 -0
- package/src/providers/odoo/executors.d.ts +3 -0
- package/src/providers/odoo/executors.js +32 -0
- package/src/providers/odoo/runtime.d.ts +16 -0
- package/src/providers/odoo/runtime.js +140 -0
- package/src/providers/outlook/executors.js +27 -6
- package/src/providers/outlook/microsoft-graph.js +17 -6
- package/src/providers/outlook_calendar/executors.js +24 -7
- package/src/providers/patsnap_mcp/executors.js +2 -2
- package/src/providers/postiz/executors.d.ts +4 -0
- package/src/providers/postiz/executors.js +83 -0
- package/src/providers/provider-runtime.d.ts +15 -0
- package/src/providers/provider-runtime.js +57 -4
- package/src/providers/proworkflow/executors.d.ts +4 -0
- package/src/providers/proworkflow/executors.js +135 -0
- package/src/providers/registry.generated.js +12 -0
- package/src/providers/scrape_creators/catalog.js +1 -1
- package/src/providers/scrape_creators/runtime.js +1 -1
- package/src/providers/sellersprite_mcp/executors.js +2 -2
- package/src/providers/sellersprite_mcp/official-actions.js +3 -2
- package/src/providers/sentry/runtime.js +6 -7
- package/src/providers/slack/actions.js +52 -3
- package/src/providers/slack/runtime.js +58 -21
- package/src/providers/slickdeals/runtime.js +1 -1
- package/src/providers/sorftime_mcp/executors.js +2 -2
- package/src/providers/tikhub/bounded-response.d.ts +1 -1
- package/src/providers/tikhub/bounded-response.js +8 -34
- package/src/providers/tikhub/endpoint-catalog.js +1 -1
- package/src/providers/tikhub/runtime.js +2 -2
- package/src/providers/tongdaxin/executors.js +79 -15
- package/src/providers/uspto/executors.js +1 -1
- package/src/providers/waffo/executors.js +1 -1
- package/src/providers/waffo/runtime.js +1 -1
- package/src/providers/wecom_mcp/runtime.js +1 -1
- package/src/providers/wisburg/executors.d.ts +4 -0
- package/src/providers/wisburg/executors.js +13 -0
- package/src/providers/wisburg/runtime.d.ts +12 -0
- package/src/providers/wisburg/runtime.js +133 -0
- package/src/providers/xydc_mcp/executors.js +2 -2
- package/src/providers/youtube/executors.js +1 -1
- package/src/providers/youtube/runtime.js +1 -1
- package/src/providers/zerotier/executors.d.ts +9 -0
- package/src/providers/zerotier/executors.js +629 -0
- package/src/providers/zerotier/runtime.d.ts +54 -0
- package/src/providers/zerotier/runtime.js +207 -0
- package/src/server/api/openapi.js +12 -2
- package/src/server/api/runtime-api.d.ts +8 -1
- package/src/server/api/runtime-api.js +19 -1
- package/src/server/connect-server.js +10 -2
- package/src/providers/sentry/scopes.d.ts +0 -1
- package/src/providers/sentry/scopes.js +0 -7
- /package/src/providers/{cloudflare-current-user.d.ts → cloudflare_dns/runtime-user.d.ts} +0 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { compactObject, looseArray, optionalRecord, optionalString, recordOrEmpty } from "../../core/cast.js";
|
|
2
|
+
import { ProviderRequestError, providerResponseError } from "../provider-runtime.js";
|
|
3
|
+
import { encodeResourceName, googleChatApiBaseUrl, googleChatJsonRequest, stripPrefix } from "./runtime.js";
|
|
4
|
+
const peopleApiBaseUrl = "https://people.googleapis.com/v1";
|
|
5
|
+
// A direct message has at most two members, so this only guards against a
|
|
6
|
+
// pagination token that never runs out.
|
|
7
|
+
const maxDirectMessageMemberPages = 20;
|
|
8
|
+
/** people:batchGet accepts at most this many resource names per call. */
|
|
9
|
+
export const maxProfilesPerLookup = 200;
|
|
10
|
+
// google.rpc.Code values a per-person batchGet status can carry.
|
|
11
|
+
const rpcNotFound = 5;
|
|
12
|
+
const rpcPermissionDenied = 7;
|
|
13
|
+
/**
|
|
14
|
+
* Name the other participant of a direct message. The authenticated user and the
|
|
15
|
+
* peer are told apart by id, because a Chat membership never says which member is
|
|
16
|
+
* "me". BOT and SELF are ordinary outcomes, not failures: they keep whatever name
|
|
17
|
+
* and email Chat reports for the membership and skip the directory.
|
|
18
|
+
*/
|
|
19
|
+
export async function resolveDirectMessagePeer(spaceName, context) {
|
|
20
|
+
const [selfUser, members] = await Promise.all([readSelfUserName(context), listAllMembers(spaceName, context)]);
|
|
21
|
+
const humans = members.filter((member) => member.type === "HUMAN");
|
|
22
|
+
const bots = members.filter((member) => member.type === "BOT");
|
|
23
|
+
const others = humans.filter((member) => member.name !== selfUser);
|
|
24
|
+
const self = humans.find((member) => member.name === selfUser);
|
|
25
|
+
if (others.length === 1) {
|
|
26
|
+
const [peer] = others;
|
|
27
|
+
const profiles = await lookupProfiles(missingChatProfiles(others), context);
|
|
28
|
+
return { kind: "HUMAN", user: peer.name, ...mergeProfile(peer, profiles.get(peer.name)) };
|
|
29
|
+
}
|
|
30
|
+
if (others.length > 1) {
|
|
31
|
+
return ambiguousPeer(others);
|
|
32
|
+
}
|
|
33
|
+
if (bots.length === 1) {
|
|
34
|
+
const [peer] = bots;
|
|
35
|
+
return { kind: "BOT", user: peer.name, ...mergeProfile(peer, undefined) };
|
|
36
|
+
}
|
|
37
|
+
if (bots.length === 0 && self) {
|
|
38
|
+
return { kind: "SELF", user: self.name, ...mergeProfile(self, undefined) };
|
|
39
|
+
}
|
|
40
|
+
return ambiguousPeer(bots);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* One page of a space's members. Every human Google Chat left without a name or
|
|
44
|
+
* email is looked up in a single batched directory call; the page size is capped
|
|
45
|
+
* so one call always covers the page.
|
|
46
|
+
*/
|
|
47
|
+
export async function listSpaceMembersPage(spaceName, request, context) {
|
|
48
|
+
const [selfUser, page] = await Promise.all([readSelfUserName(context), fetchMemberPage(spaceName, request, context)]);
|
|
49
|
+
const humans = page.members.filter((member) => member.type === "HUMAN");
|
|
50
|
+
const profiles = await lookupProfiles(missingChatProfiles(humans), context);
|
|
51
|
+
return {
|
|
52
|
+
members: page.members.map((member) => ({
|
|
53
|
+
user: member.name,
|
|
54
|
+
kind: member.type,
|
|
55
|
+
role: member.role,
|
|
56
|
+
isSelf: member.name === selfUser,
|
|
57
|
+
...mergeProfile(member, profiles.get(member.name)),
|
|
58
|
+
})),
|
|
59
|
+
nextPageToken: page.nextPageToken ?? null,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function ambiguousPeer(candidates) {
|
|
63
|
+
return {
|
|
64
|
+
kind: "AMBIGUOUS",
|
|
65
|
+
user: null,
|
|
66
|
+
displayName: null,
|
|
67
|
+
email: null,
|
|
68
|
+
candidates: candidates.map((member) => member.name),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** The authenticated user's own `users/{id}`; People and Chat share the id. */
|
|
72
|
+
async function readSelfUserName(context) {
|
|
73
|
+
let payload;
|
|
74
|
+
try {
|
|
75
|
+
payload = recordOrEmpty(await googleChatJsonRequest(`${peopleApiBaseUrl}/people/me`, {
|
|
76
|
+
context,
|
|
77
|
+
query: { personFields: "metadata" },
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
if (context.signal?.aborted) {
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
// Only a 403 can mean the People API is not enabled for the project.
|
|
85
|
+
throw explainLookupError("could not read the authenticated user's own id from the People API, so members cannot be told apart from the caller", error, "The People API must be enabled for the OAuth client's Google Cloud project.");
|
|
86
|
+
}
|
|
87
|
+
const resourceName = optionalString(payload.resourceName);
|
|
88
|
+
if (!resourceName?.startsWith("people/")) {
|
|
89
|
+
throw new ProviderRequestError(502, "the People API returned no resource name for the authenticated user");
|
|
90
|
+
}
|
|
91
|
+
return `users/${stripPrefix(resourceName, "people/")}`;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Say which Chat or People lookup failed. An HTTP failure keeps its status and
|
|
95
|
+
* details and gains forbiddenHint on a 403, the only status a console or consent
|
|
96
|
+
* change can fix; a 429, a 5xx, or a timeout needs a retry instead. A failure that
|
|
97
|
+
* is not an HTTP error, such as a response that is not JSON, becomes a 502 that
|
|
98
|
+
* names the lookup instead of reaching the caller as a raw internal error.
|
|
99
|
+
*/
|
|
100
|
+
function explainLookupError(summary, error, forbiddenHint) {
|
|
101
|
+
if (!(error instanceof ProviderRequestError)) {
|
|
102
|
+
return providerResponseError(`${summary}: ${error instanceof Error ? error.message : String(error)}`);
|
|
103
|
+
}
|
|
104
|
+
const hint = error.status === 403 ? ` ${forbiddenHint}` : "";
|
|
105
|
+
// Google's messages usually end in a period already; drop it so the sentence ends once.
|
|
106
|
+
const detail = error.message.replace(/\.\s*$/, "");
|
|
107
|
+
return new ProviderRequestError(error.status, `${summary}: ${detail}.${hint}`, error.details);
|
|
108
|
+
}
|
|
109
|
+
async function listAllMembers(spaceName, context) {
|
|
110
|
+
let members = [];
|
|
111
|
+
let pageToken;
|
|
112
|
+
for (let page = 0; page < maxDirectMessageMemberPages; page += 1) {
|
|
113
|
+
let result;
|
|
114
|
+
try {
|
|
115
|
+
// Chat leaves invited members out by default. A peer who has not joined the
|
|
116
|
+
// conversation yet is still the peer; without it the caller would be the only
|
|
117
|
+
// member left and the direct message would be misreported as SELF.
|
|
118
|
+
result = await fetchMemberPage(spaceName, { pageSize: 100, pageToken, showInvited: true }, context);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
if (context.signal?.aborted) {
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
// A 403 here is almost always the missing scope: the space itself was readable.
|
|
125
|
+
throw explainLookupError(`could not list the members of ${spaceName}, so the direct message's other participant is unknown`, error, "Listing members needs the chat.memberships.readonly scope, which service account connections never request; an OAuth connection authorized before this scope was added must be reconnected to grant it.");
|
|
126
|
+
}
|
|
127
|
+
members = [...members, ...result.members];
|
|
128
|
+
pageToken = result.nextPageToken;
|
|
129
|
+
if (!pageToken) {
|
|
130
|
+
return members;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
throw new ProviderRequestError(502, `Google Chat kept paginating the members of ${spaceName}`);
|
|
134
|
+
}
|
|
135
|
+
async function fetchMemberPage(spaceName, request, context) {
|
|
136
|
+
const payload = await googleChatJsonRequest(`${googleChatApiBaseUrl}/${encodeResourceName(spaceName)}/members`, {
|
|
137
|
+
context,
|
|
138
|
+
query: compactObject({
|
|
139
|
+
pageSize: String(request.pageSize),
|
|
140
|
+
pageToken: request.pageToken,
|
|
141
|
+
showInvited: request.showInvited ? "true" : undefined,
|
|
142
|
+
}),
|
|
143
|
+
});
|
|
144
|
+
return {
|
|
145
|
+
members: looseArray(payload.memberships).flatMap((item) => toChatMember(item)),
|
|
146
|
+
nextPageToken: optionalString(payload.nextPageToken),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function toChatMember(value) {
|
|
150
|
+
const membership = recordOrEmpty(value);
|
|
151
|
+
const member = recordOrEmpty(membership.member);
|
|
152
|
+
const name = optionalString(member.name);
|
|
153
|
+
return name
|
|
154
|
+
? [
|
|
155
|
+
{
|
|
156
|
+
name,
|
|
157
|
+
type: optionalString(member.type),
|
|
158
|
+
role: optionalString(membership.role),
|
|
159
|
+
displayName: optionalString(member.displayName),
|
|
160
|
+
email: optionalString(member.email),
|
|
161
|
+
},
|
|
162
|
+
]
|
|
163
|
+
: [];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Fill in each human sender's name and email on normalized messages. Under user
|
|
167
|
+
* authentication Chat reports them itself only for members of the space and users
|
|
168
|
+
* with prior affinity to the caller, so every human sender missing either is
|
|
169
|
+
* looked up in the directory. Distinct senders are looked up together, so a page
|
|
170
|
+
* costs one extra request per 200 senders. A failed lookup leaves the message
|
|
171
|
+
* intact with a null name and a reason; bots and messages without a sender are
|
|
172
|
+
* left as they are.
|
|
173
|
+
*/
|
|
174
|
+
export async function attachSenderProfiles(messages, context) {
|
|
175
|
+
const profiles = await lookupProfiles(missingChatProfiles(messages.flatMap((message) => humanSender(message))), context);
|
|
176
|
+
return messages.map((message) => {
|
|
177
|
+
const [sender] = humanSender(message);
|
|
178
|
+
return sender
|
|
179
|
+
? { ...message, sender: { ...recordOrEmpty(message.sender), ...mergeProfile(sender, profiles.get(sender.name)) } }
|
|
180
|
+
: message;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/** The human users/{id} sender of a normalized message, if it has one. */
|
|
184
|
+
function humanSender(message) {
|
|
185
|
+
const sender = optionalRecord(message.sender);
|
|
186
|
+
const name = optionalString(sender?.name);
|
|
187
|
+
return sender?.type === "HUMAN" && name?.startsWith("users/")
|
|
188
|
+
? [{ name, displayName: optionalString(sender.displayName), email: optionalString(sender.email) }]
|
|
189
|
+
: [];
|
|
190
|
+
}
|
|
191
|
+
/** The distinct users whose name or email Chat left out, which only the directory can fill in. */
|
|
192
|
+
function missingChatProfiles(users) {
|
|
193
|
+
const missing = users.filter((user) => user.displayName === undefined || user.email === undefined);
|
|
194
|
+
return [...new Set(missing.map((user) => user.name))];
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Combine what Chat reported with the directory profile. Chat's own name and email
|
|
198
|
+
* win and the directory only fills in what Chat left out, so a failed lookup never
|
|
199
|
+
* replaces a known value with null. profileUnavailableReason explains a null
|
|
200
|
+
* displayName, so it is only kept while the name is still missing.
|
|
201
|
+
*/
|
|
202
|
+
function mergeProfile(chat, directory) {
|
|
203
|
+
const displayName = chat.displayName ?? directory?.displayName ?? null;
|
|
204
|
+
return {
|
|
205
|
+
displayName,
|
|
206
|
+
email: chat.email ?? directory?.email ?? null,
|
|
207
|
+
profileUnavailableReason: displayName === null ? directory?.profileUnavailableReason : undefined,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Name `users/{id}` members through the Workspace directory, batching up to the
|
|
212
|
+
* People API limit per call. A member whose profile cannot be read keeps a null
|
|
213
|
+
* name and a reason; a failure of a whole call gives each member in it that reason.
|
|
214
|
+
*/
|
|
215
|
+
async function lookupProfiles(users, context) {
|
|
216
|
+
const batches = Array.from({ length: Math.ceil(users.length / maxProfilesPerLookup) }, (_, index) => users.slice(index * maxProfilesPerLookup, (index + 1) * maxProfilesPerLookup));
|
|
217
|
+
const results = await Promise.all(batches.map((batch) => lookupProfileBatch(batch, context)));
|
|
218
|
+
return new Map(results.flatMap((result) => [...result]));
|
|
219
|
+
}
|
|
220
|
+
async function lookupProfileBatch(users, context) {
|
|
221
|
+
let payload;
|
|
222
|
+
try {
|
|
223
|
+
payload = recordOrEmpty(await googleChatJsonRequest(`${peopleApiBaseUrl}/people:batchGet`, {
|
|
224
|
+
context,
|
|
225
|
+
query: {
|
|
226
|
+
resourceNames: users.map((user) => `people/${stripPrefix(user, "users/")}`),
|
|
227
|
+
personFields: "names,emailAddresses",
|
|
228
|
+
sources: "READ_SOURCE_TYPE_PROFILE",
|
|
229
|
+
},
|
|
230
|
+
}));
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
// Naming is best effort, so only a cancelled request stops the action. Any
|
|
234
|
+
// other failure, including a network error or a 200 whose body is not JSON,
|
|
235
|
+
// leaves the users unnamed with a reason.
|
|
236
|
+
if (context.signal?.aborted) {
|
|
237
|
+
throw error;
|
|
238
|
+
}
|
|
239
|
+
const reason = error instanceof ProviderRequestError ? httpFailureReason(error.status) : "people_request_failed";
|
|
240
|
+
return new Map(users.map((user) => [user, unavailableProfile(reason)]));
|
|
241
|
+
}
|
|
242
|
+
const responses = new Map(looseArray(payload.responses).map((entry) => {
|
|
243
|
+
const response = recordOrEmpty(entry);
|
|
244
|
+
return [optionalString(response.requestedResourceName), response];
|
|
245
|
+
}));
|
|
246
|
+
return new Map(users.map((user) => [user, toMemberProfile(responses.get(`people/${stripPrefix(user, "users/")}`))]));
|
|
247
|
+
}
|
|
248
|
+
function toMemberProfile(response) {
|
|
249
|
+
// A missing entry says nothing about the person: a genuine miss comes back as its
|
|
250
|
+
// own NOT_FOUND status, so an absent or unmatched entry is a malformed response.
|
|
251
|
+
if (!response) {
|
|
252
|
+
return unavailableProfile("people_request_failed");
|
|
253
|
+
}
|
|
254
|
+
const rpcCode = optionalRecord(response.status)?.code;
|
|
255
|
+
if (typeof rpcCode === "number" && rpcCode !== 0) {
|
|
256
|
+
return unavailableProfile(rpcFailureReason(rpcCode));
|
|
257
|
+
}
|
|
258
|
+
const person = recordOrEmpty(response.person);
|
|
259
|
+
const displayName = primaryProfileValue(person.names, "displayName");
|
|
260
|
+
return {
|
|
261
|
+
displayName: displayName ?? null,
|
|
262
|
+
email: primaryProfileValue(person.emailAddresses, "value") ?? null,
|
|
263
|
+
// A 200 without a name is what a Workspace with profile sharing turned off returns.
|
|
264
|
+
profileUnavailableReason: displayName ? undefined : "profile_name_missing",
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function unavailableProfile(reason) {
|
|
268
|
+
return { displayName: null, email: null, profileUnavailableReason: reason };
|
|
269
|
+
}
|
|
270
|
+
/** Only 403 and 404 say something about the profile; anything else is a failed request, not a hidden one. */
|
|
271
|
+
function httpFailureReason(status) {
|
|
272
|
+
if (status === 403) {
|
|
273
|
+
return "people_forbidden";
|
|
274
|
+
}
|
|
275
|
+
if (status === 404) {
|
|
276
|
+
return "people_not_found";
|
|
277
|
+
}
|
|
278
|
+
return "people_request_failed";
|
|
279
|
+
}
|
|
280
|
+
function rpcFailureReason(code) {
|
|
281
|
+
if (code === rpcPermissionDenied) {
|
|
282
|
+
return "people_forbidden";
|
|
283
|
+
}
|
|
284
|
+
if (code === rpcNotFound) {
|
|
285
|
+
return "people_not_found";
|
|
286
|
+
}
|
|
287
|
+
return "people_request_failed";
|
|
288
|
+
}
|
|
289
|
+
function primaryProfileValue(value, field) {
|
|
290
|
+
const entries = looseArray(value).map((entry) => recordOrEmpty(entry));
|
|
291
|
+
const primary = entries.find((entry) => optionalRecord(entry.metadata)?.primary === true) ?? entries[0];
|
|
292
|
+
return optionalString(primary?.[field]);
|
|
293
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GoogleQueryValue } from "../googledrive/runtime-request.ts";
|
|
2
|
+
import type { OAuthProviderContext } from "../provider-runtime.ts";
|
|
3
|
+
export declare const googleChatApiBaseUrl = "https://chat.googleapis.com/v1";
|
|
4
|
+
export type GoogleChatRuntimeContext = OAuthProviderContext;
|
|
5
|
+
interface GoogleChatRequestInput {
|
|
6
|
+
context: Pick<GoogleChatRuntimeContext, "accessToken" | "fetcher" | "signal">;
|
|
7
|
+
method?: string;
|
|
8
|
+
query?: Record<string, GoogleQueryValue>;
|
|
9
|
+
body?: unknown;
|
|
10
|
+
}
|
|
11
|
+
/** Send an authenticated JSON request on behalf of the Google Chat connection, to Chat or another Google API. */
|
|
12
|
+
export declare function googleChatJsonRequest<T>(url: string, input: GoogleChatRequestInput): Promise<T>;
|
|
13
|
+
/** Percent-encode each segment of a resource name such as spaces/{space}, keeping the separators. */
|
|
14
|
+
export declare function encodeResourceName(name: string): string;
|
|
15
|
+
export declare function stripPrefix(value: string, prefix: string): string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { googleJsonRequest } from "../googledrive/runtime-request.js";
|
|
2
|
+
export const googleChatApiBaseUrl = "https://chat.googleapis.com/v1";
|
|
3
|
+
const service = "googlechat";
|
|
4
|
+
/** Send an authenticated JSON request on behalf of the Google Chat connection, to Chat or another Google API. */
|
|
5
|
+
export function googleChatJsonRequest(url, input) {
|
|
6
|
+
return googleJsonRequest(url, {
|
|
7
|
+
accessToken: input.context.accessToken,
|
|
8
|
+
fetcher: input.context.fetcher,
|
|
9
|
+
signal: input.context.signal,
|
|
10
|
+
method: input.method,
|
|
11
|
+
query: input.query,
|
|
12
|
+
body: input.body,
|
|
13
|
+
service,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** Percent-encode each segment of a resource name such as spaces/{space}, keeping the separators. */
|
|
17
|
+
export function encodeResourceName(name) {
|
|
18
|
+
return name
|
|
19
|
+
.split("/")
|
|
20
|
+
.map((segment) => encodeURIComponent(segment))
|
|
21
|
+
.join("/");
|
|
22
|
+
}
|
|
23
|
+
export function stripPrefix(value, prefix) {
|
|
24
|
+
return value.startsWith(prefix) ? value.slice(prefix.length) : value;
|
|
25
|
+
}
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
export declare const googleChatSpacesReadonlyScope = "https://www.googleapis.com/auth/chat.spaces.readonly";
|
|
2
2
|
export declare const googleChatMessagesReadonlyScope = "https://www.googleapis.com/auth/chat.messages.readonly";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Grants only "compose and send messages". Deliberately not `chat.messages`,
|
|
5
|
+
* which Google describes as "see, compose, send, update, and delete messages"
|
|
6
|
+
* plus reactions — far beyond what sending a message needs.
|
|
7
|
+
*/
|
|
8
|
+
export declare const googleChatMessagesCreateScope = "https://www.googleapis.com/auth/chat.messages.create";
|
|
9
|
+
/** Lists the members of a space, which is the only way to learn a direct message's other participant. */
|
|
10
|
+
export declare const googleChatMembershipsReadonlyScope = "https://www.googleapis.com/auth/chat.memberships.readonly";
|
|
11
|
+
/**
|
|
12
|
+
* Reads Workspace directory profiles through the People API. Under user
|
|
13
|
+
* authentication Chat can report a member as just `users/{id}` with no name, and
|
|
14
|
+
* this is the narrowest scope that turns that id into a name. It exposes the organization directory, not
|
|
15
|
+
* just the peer, and Workspace admins can restrict it or disable profile sharing.
|
|
16
|
+
*/
|
|
17
|
+
export declare const googleDirectoryReadonlyScope = "https://www.googleapis.com/auth/directory.readonly";
|
|
18
|
+
/**
|
|
19
|
+
* Scopes minted into service account tokens. Frozen at what existing domain-wide
|
|
20
|
+
* delegations already grant: a token request that asks for an undelegated scope
|
|
21
|
+
* fails as a whole, which would break every Chat action, not just the new ones.
|
|
22
|
+
* Service account connections therefore cannot send messages or name members.
|
|
23
|
+
*/
|
|
24
|
+
export declare const googleChatServiceAccountScopes: string[];
|
|
6
25
|
export declare const googleChatOAuthScopes: string[];
|
|
@@ -1,12 +1,35 @@
|
|
|
1
|
+
import { googleIdentityScopes } from "../googleads/scopes.js";
|
|
1
2
|
export const googleChatSpacesReadonlyScope = "https://www.googleapis.com/auth/chat.spaces.readonly";
|
|
2
3
|
export const googleChatMessagesReadonlyScope = "https://www.googleapis.com/auth/chat.messages.readonly";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Grants only "compose and send messages". Deliberately not `chat.messages`,
|
|
6
|
+
* which Google describes as "see, compose, send, update, and delete messages"
|
|
7
|
+
* plus reactions — far beyond what sending a message needs.
|
|
8
|
+
*/
|
|
9
|
+
export const googleChatMessagesCreateScope = "https://www.googleapis.com/auth/chat.messages.create";
|
|
10
|
+
/** Lists the members of a space, which is the only way to learn a direct message's other participant. */
|
|
11
|
+
export const googleChatMembershipsReadonlyScope = "https://www.googleapis.com/auth/chat.memberships.readonly";
|
|
12
|
+
/**
|
|
13
|
+
* Reads Workspace directory profiles through the People API. Under user
|
|
14
|
+
* authentication Chat can report a member as just `users/{id}` with no name, and
|
|
15
|
+
* this is the narrowest scope that turns that id into a name. It exposes the organization directory, not
|
|
16
|
+
* just the peer, and Workspace admins can restrict it or disable profile sharing.
|
|
17
|
+
*/
|
|
18
|
+
export const googleDirectoryReadonlyScope = "https://www.googleapis.com/auth/directory.readonly";
|
|
19
|
+
/**
|
|
20
|
+
* Scopes minted into service account tokens. Frozen at what existing domain-wide
|
|
21
|
+
* delegations already grant: a token request that asks for an undelegated scope
|
|
22
|
+
* fails as a whole, which would break every Chat action, not just the new ones.
|
|
23
|
+
* Service account connections therefore cannot send messages or name members.
|
|
24
|
+
*/
|
|
25
|
+
export const googleChatServiceAccountScopes = [
|
|
7
26
|
googleChatSpacesReadonlyScope,
|
|
8
27
|
googleChatMessagesReadonlyScope,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
28
|
+
...googleIdentityScopes,
|
|
29
|
+
];
|
|
30
|
+
export const googleChatOAuthScopes = [
|
|
31
|
+
...googleChatServiceAccountScopes,
|
|
32
|
+
googleChatMessagesCreateScope,
|
|
33
|
+
googleChatMembershipsReadonlyScope,
|
|
34
|
+
googleDirectoryReadonlyScope,
|
|
12
35
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
import { integer, objectArray } from "../../core/cast.js";
|
|
3
|
-
import { googleJsonRequest as googleJsonRequestShared, googleRequest as googleRequestShared, } from "../
|
|
3
|
+
import { googleJsonRequest as googleJsonRequestShared, googleRequest as googleRequestShared, } from "../googledrive/runtime-request.js";
|
|
4
4
|
import { asObject, asOptionalObject, asStringArray, compactObject, optionalBoolean, } from "../googledrive/runtime-shared.js";
|
|
5
5
|
import { defineProviderExecutors, defineProviderProxy, ProviderRequestError, requireOAuthCredential, } from "../provider-runtime.js";
|
|
6
6
|
const docsApiBaseUrl = "https://docs.googleapis.com/v1";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { requiredRawString, requiredString } from "../../core/cast.js";
|
|
3
3
|
import { readBoundedResponseBytes } from "../../core/request.js";
|
|
4
|
-
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator } from "../google-auth.js";
|
|
5
|
-
import { googleJsonRequest, googleRequest } from "../google-runtime.js";
|
|
6
4
|
import { defineProviderProxy, providerProxyEndpointPrefixes, ProviderRequestError, providerResponseError, } from "../provider-runtime.js";
|
|
5
|
+
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator } from "./runtime-auth.js";
|
|
7
6
|
import { createComment, createPermission, createReply, deleteComment, deletePermission, deleteReply, deleteRevision, getAbout, getApp, getComment, getPermission, getReply, getRevision, listComments, listFileLabels, listPermissions, listReplies, listRevisions, modifyFileLabels, updateComment, updateFileRevisionMetadata, updatePermission, updateReply, } from "./runtime-collaboration.js";
|
|
7
|
+
import { googleJsonRequest, googleRequest } from "./runtime-request.js";
|
|
8
8
|
import { asObject, asOptionalObject, asOptionalInteger, asStringArray, asStringRecord, compactObject, compactUnknownObject, optionalBoolean, optionalNestedString, optionalString, parseSizeBytes, pickOptionalBoolean, pickOptionalInteger, pickOptionalString, resolveFileId, resolveRequiredString, resolveSupportsAllDrives, } from "./runtime-shared.js";
|
|
9
9
|
import { googledriveOAuthScopes } from "./scopes.js";
|
|
10
10
|
const service = "googledrive";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CredentialValidators, ProviderExecutors, ResolvedCredential } from "
|
|
2
|
-
import type { OAuthProviderContext, ProviderFetch, ProviderProxyAuth, ProviderRuntimeHandler } from "
|
|
1
|
+
import type { CredentialValidators, ProviderExecutors, ResolvedCredential } from "../../core/types.ts";
|
|
2
|
+
import type { OAuthProviderContext, ProviderFetch, ProviderProxyAuth, ProviderRuntimeHandler } from "../provider-runtime.ts";
|
|
3
3
|
/**
|
|
4
4
|
* A Google service account identity read from a stored custom credential.
|
|
5
5
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { importPKCS8, SignJWT } from "jose";
|
|
2
|
-
import { sha256Hex } from "
|
|
3
|
-
import { optionalNumberLike, optionalRecord, optionalString } from "
|
|
4
|
-
import { defineProviderExecutors, providerInputError, ProviderRequestError, providerUserAgent, requiredInputString, runProviderRequest, } from "
|
|
2
|
+
import { sha256Hex } from "../../core/aws-sigv4.js";
|
|
3
|
+
import { optionalNumberLike, optionalRecord, optionalString } from "../../core/cast.js";
|
|
4
|
+
import { defineProviderExecutors, providerInputError, ProviderRequestError, providerUserAgent, requiredInputString, runProviderRequest, } from "../provider-runtime.js";
|
|
5
5
|
const googleTokenUrl = "https://oauth2.googleapis.com/token";
|
|
6
6
|
const jwtBearerGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer";
|
|
7
7
|
/** Google issues one-hour access tokens for JWT bearer grants; assertions may ask for at most one hour. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { googleJsonRequest, googleRequest } from "../google-runtime.js";
|
|
2
1
|
import { ProviderRequestError } from "../provider-runtime.js";
|
|
2
|
+
import { googleJsonRequest, googleRequest } from "./runtime-request.js";
|
|
3
3
|
import { asObject, asOptionalObject, asStringArray, asStringRecordOrUndefined, compactObject, compactUnknownObject, optionalBoolean, optionalString, parseSizeBytes, pickOptionalBoolean, pickOptionalInteger, pickOptionalString, resolveFileId, resolveRequiredString, resolveSupportsAllDrives, } from "./runtime-shared.js";
|
|
4
4
|
const driveApiBaseUrl = "https://www.googleapis.com/drive/v3";
|
|
5
5
|
const permissionFields = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { optionalRecord, optionalString } from "
|
|
2
|
-
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, } from "
|
|
1
|
+
import { optionalRecord, optionalString } from "../../core/cast.js";
|
|
2
|
+
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, } from "../provider-runtime.js";
|
|
3
3
|
const defaultService = "googledrive";
|
|
4
4
|
const googleDefaultRequestTimeoutMs = 30_000;
|
|
5
5
|
export async function googleJsonRequest(url, input) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { compactObject, objectArray, optionalBoolean, optionalInteger, optionalRecord, optionalString, } from "../../core/cast.js";
|
|
2
|
-
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator } from "../
|
|
3
|
-
import { googleJsonRequest } from "../
|
|
2
|
+
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator, } from "../googledrive/runtime-auth.js";
|
|
3
|
+
import { googleJsonRequest } from "../googledrive/runtime-request.js";
|
|
4
4
|
import { defineProviderProxy, providerInputError, ProviderRequestError } from "../provider-runtime.js";
|
|
5
5
|
import { googleFormsOAuthScopes } from "./scopes.js";
|
|
6
6
|
export const googleFormsApiBaseUrl = "https://forms.googleapis.com/v1/forms";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export declare const googleFormsReadScope = "https://www.googleapis.com/auth/forms.body.readonly";
|
|
2
2
|
export declare const googleFormsWriteScope = "https://www.googleapis.com/auth/forms.body";
|
|
3
3
|
export declare const googleFormsResponsesReadScope = "https://www.googleapis.com/auth/forms.responses.readonly";
|
|
4
|
-
export declare const googleOpenIdScope = "openid";
|
|
5
|
-
export declare const googleEmailScope = "email";
|
|
6
|
-
export declare const googleProfileScope = "profile";
|
|
7
4
|
export declare const googleFormsOAuthScopes: string[];
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import { googleIdentityScopes } from "../googleads/scopes.js";
|
|
1
2
|
export const googleFormsReadScope = "https://www.googleapis.com/auth/forms.body.readonly";
|
|
2
3
|
export const googleFormsWriteScope = "https://www.googleapis.com/auth/forms.body";
|
|
3
4
|
export const googleFormsResponsesReadScope = "https://www.googleapis.com/auth/forms.responses.readonly";
|
|
4
|
-
export const googleOpenIdScope = "openid";
|
|
5
|
-
export const googleEmailScope = "email";
|
|
6
|
-
export const googleProfileScope = "profile";
|
|
7
5
|
export const googleFormsOAuthScopes = [
|
|
8
6
|
googleFormsReadScope,
|
|
9
7
|
googleFormsWriteScope,
|
|
10
8
|
googleFormsResponsesReadScope,
|
|
11
|
-
|
|
12
|
-
googleEmailScope,
|
|
13
|
-
googleProfileScope,
|
|
9
|
+
...googleIdentityScopes,
|
|
14
10
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { compactObject, looseArray, optionalInteger, optionalRecord, optionalString, requiredRecord, } from "../../core/cast.js";
|
|
2
|
-
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator } from "../
|
|
3
|
-
import { googleJsonRequest } from "../
|
|
2
|
+
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator, } from "../googledrive/runtime-auth.js";
|
|
3
|
+
import { googleJsonRequest } from "../googledrive/runtime-request.js";
|
|
4
4
|
import { defineProviderProxy, providerProxyEndpointPrefixes, ProviderRequestError } from "../provider-runtime.js";
|
|
5
5
|
import { googleMeetApiBaseUrl, googleMeetApiOrigin, googleMeetUserInfoUrl } from "./constants.js";
|
|
6
6
|
import { googleMeetOAuthScopes } from "./scopes.js";
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
export declare const googleMeetSpaceCreatedScope = "https://www.googleapis.com/auth/meetings.space.created";
|
|
2
2
|
export declare const googleMeetSpaceReadonlyScope = "https://www.googleapis.com/auth/meetings.space.readonly";
|
|
3
3
|
export declare const googleMeetSpaceSettingsScope = "https://www.googleapis.com/auth/meetings.space.settings";
|
|
4
|
-
export declare const googleOpenIdScope = "openid";
|
|
5
|
-
export declare const googleEmailScope = "email";
|
|
6
|
-
export declare const googleProfileScope = "profile";
|
|
7
4
|
export declare const googleMeetCreateScopes: string[];
|
|
8
5
|
export declare const googleMeetReadScopes: string[];
|
|
9
6
|
export declare const googleMeetSettingsScopes: string[];
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { googleIdentityScopes } from "../googleads/scopes.js";
|
|
1
2
|
export const googleMeetSpaceCreatedScope = "https://www.googleapis.com/auth/meetings.space.created";
|
|
2
3
|
export const googleMeetSpaceReadonlyScope = "https://www.googleapis.com/auth/meetings.space.readonly";
|
|
3
4
|
export const googleMeetSpaceSettingsScope = "https://www.googleapis.com/auth/meetings.space.settings";
|
|
4
|
-
export const googleOpenIdScope = "openid";
|
|
5
|
-
export const googleEmailScope = "email";
|
|
6
|
-
export const googleProfileScope = "profile";
|
|
7
5
|
export const googleMeetCreateScopes = [googleMeetSpaceCreatedScope];
|
|
8
6
|
export const googleMeetReadScopes = [googleMeetSpaceReadonlyScope];
|
|
9
7
|
export const googleMeetSettingsScopes = [googleMeetSpaceSettingsScope];
|
|
@@ -11,7 +9,5 @@ export const googleMeetOAuthScopes = [
|
|
|
11
9
|
googleMeetSpaceCreatedScope,
|
|
12
10
|
googleMeetSpaceReadonlyScope,
|
|
13
11
|
googleMeetSpaceSettingsScope,
|
|
14
|
-
|
|
15
|
-
googleEmailScope,
|
|
16
|
-
googleProfileScope,
|
|
12
|
+
...googleIdentityScopes,
|
|
17
13
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator } from "../
|
|
1
|
+
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator, } from "../googledrive/runtime-auth.js";
|
|
2
2
|
import { defineProviderProxy } from "../provider-runtime.js";
|
|
3
3
|
import { addSheet, appendDimension, autoResizeDimensions, clearBasicFilter, copySheetToOtherSpreadsheet, createChart, deleteDimension, deleteSheet, findReplace, formatCell, insertDimension, mutateConditionalFormatRules, setBasicFilter, setDataValidationRule, updateDimensionProperties, updateSheetProperties, updateSpreadsheetProperties, } from "./runtime-batch-update.js";
|
|
4
4
|
import { createGoogleSheet, getConditionalFormatRules, getDataValidationRules, getSheetNames, getSpreadsheetByDataFilter, getSpreadsheetInfo, searchDeveloperMetadata, searchSpreadsheets, } from "./runtime-metadata.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { googleIdentityScopes } from "../googleads/scopes.js";
|
|
1
2
|
export const googleSheetsReadonlyScope = "https://www.googleapis.com/auth/spreadsheets.readonly";
|
|
2
3
|
export const googleSheetsFullScope = "https://www.googleapis.com/auth/spreadsheets";
|
|
3
4
|
export const googleDriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly";
|
|
@@ -9,4 +10,5 @@ export const googlesheetsOAuthScopes = [
|
|
|
9
10
|
googleSheetsFullScope,
|
|
10
11
|
googleDriveReadonlyScope,
|
|
11
12
|
googleDriveFullScope,
|
|
13
|
+
...googleIdentityScopes,
|
|
12
14
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { compactObject, objectArray, optionalInteger, optionalRecord, optionalString } from "../../core/cast.js";
|
|
2
|
-
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator } from "../
|
|
3
|
-
import { googleJsonRequest } from "../
|
|
2
|
+
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator, } from "../googledrive/runtime-auth.js";
|
|
3
|
+
import { googleJsonRequest } from "../googledrive/runtime-request.js";
|
|
4
4
|
import { defineProviderProxy, providerInputError, ProviderRequestError } from "../provider-runtime.js";
|
|
5
5
|
import { googleSlidesOAuthScopes } from "./scopes.js";
|
|
6
6
|
export const slidesApiBaseUrl = "https://slides.googleapis.com/v1";
|
|
@@ -2,9 +2,6 @@ export declare const presentationsReadonlyScope = "https://www.googleapis.com/au
|
|
|
2
2
|
export declare const presentationsScope = "https://www.googleapis.com/auth/presentations";
|
|
3
3
|
export declare const googleDriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly";
|
|
4
4
|
export declare const googleDriveFullScope = "https://www.googleapis.com/auth/drive";
|
|
5
|
-
export declare const googleOpenIdScope = "openid";
|
|
6
|
-
export declare const googleEmailScope = "email";
|
|
7
|
-
export declare const googleProfileScope = "profile";
|
|
8
5
|
export declare const googleSlidesReadScopes: string[];
|
|
9
6
|
export declare const googleSlidesWriteScopes: string[];
|
|
10
7
|
export declare const googleSlidesOAuthScopes: string[];
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import { googleIdentityScopes } from "../googleads/scopes.js";
|
|
1
2
|
export const presentationsReadonlyScope = "https://www.googleapis.com/auth/presentations.readonly";
|
|
2
3
|
export const presentationsScope = "https://www.googleapis.com/auth/presentations";
|
|
3
4
|
export const googleDriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly";
|
|
4
5
|
export const googleDriveFullScope = "https://www.googleapis.com/auth/drive";
|
|
5
|
-
export const googleOpenIdScope = "openid";
|
|
6
|
-
export const googleEmailScope = "email";
|
|
7
|
-
export const googleProfileScope = "profile";
|
|
8
6
|
export const googleSlidesReadScopes = [presentationsReadonlyScope, googleDriveReadonlyScope];
|
|
9
7
|
export const googleSlidesWriteScopes = [presentationsScope, googleDriveFullScope];
|
|
10
8
|
export const googleSlidesOAuthScopes = [
|
|
@@ -12,7 +10,5 @@ export const googleSlidesOAuthScopes = [
|
|
|
12
10
|
presentationsScope,
|
|
13
11
|
googleDriveReadonlyScope,
|
|
14
12
|
googleDriveFullScope,
|
|
15
|
-
|
|
16
|
-
googleEmailScope,
|
|
17
|
-
googleProfileScope,
|
|
13
|
+
...googleIdentityScopes,
|
|
18
14
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { compactObject, optionalRecord, optionalString, pickOptionalBoolean, pickOptionalInteger, pickOptionalString, } from "../../core/cast.js";
|
|
2
|
-
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator } from "../
|
|
3
|
-
import { googleJsonRequest, googleRequest } from "../
|
|
2
|
+
import { defineGoogleProviderExecutors, googleBearerProxyAuth, googleServiceAccountValidator, } from "../googledrive/runtime-auth.js";
|
|
3
|
+
import { googleJsonRequest, googleRequest } from "../googledrive/runtime-request.js";
|
|
4
4
|
import { defineProviderProxy, ProviderRequestError } from "../provider-runtime.js";
|
|
5
5
|
import { googleTasksOAuthScopes } from "./scopes.js";
|
|
6
6
|
export const googleTasksApiBaseUrl = "https://tasks.googleapis.com/tasks/v1";
|