@every-app/sdk 0.3.0-rc.13 → 0.3.0-rc.15
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/README.md +15 -14
- package/dist/cloudflare/catalogSettings.generated.d.ts +17 -7
- package/dist/cloudflare/catalogSettings.generated.d.ts.map +1 -1
- package/dist/cloudflare/catalogSettings.generated.js +40 -12
- package/dist/cloudflare/worker.d.ts +27 -7
- package/dist/cloudflare/worker.d.ts.map +1 -1
- package/dist/cloudflare/worker.js +13 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/appSettings.d.ts +124 -79
- package/dist/internal/appSettings.d.ts.map +1 -1
- package/dist/internal/appSettings.js +240 -125
- package/dist/internal/capabilities.d.ts +5 -29
- package/dist/internal/capabilities.d.ts.map +1 -1
- package/dist/internal/capabilities.js +4 -24
- package/dist/internal/devProviders.d.ts +1 -19
- package/dist/internal/devProviders.d.ts.map +1 -1
- package/dist/internal/devProviders.js +7 -1
- package/dist/internal/oauthPresets.d.ts +351 -14
- package/dist/internal/oauthPresets.d.ts.map +1 -1
- package/dist/internal/oauthPresets.js +155 -22
- package/dist/internal/oauthSpec.d.ts +2 -46
- package/dist/internal/oauthSpec.d.ts.map +1 -1
- package/dist/internal/oauthSpec.js +0 -57
- package/dist/internal/remoteMcp.d.ts.map +1 -1
- package/dist/internal/remoteMcp.js +4 -3
- package/dist/internal/tools.d.ts +3 -1
- package/dist/internal/tools.d.ts.map +1 -1
- package/dist/manifest.d.ts +49 -13
- package/dist/manifest.d.ts.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/integrationFetch.d.ts +7 -7
- package/dist/server/integrationFetch.d.ts.map +1 -1
- package/dist/server/integrationFetch.js +4 -2
- package/dist/server/tools.d.ts +5 -2
- package/dist/server/tools.d.ts.map +1 -1
- package/dist/server/tools.js +5 -2
- package/package.json +1 -1
- package/dist/internal/oauthBuiltIns.d.ts +0 -101
- package/dist/internal/oauthBuiltIns.d.ts.map +0 -1
- package/dist/internal/oauthBuiltIns.js +0 -122
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APP_ID_ENV, CATALOG, ConfigurationError, GATEWAY_ERROR_HEADER, INTEGRATION_PROXY_PREFIX, apiKeyHosts, authorizationFor, capabilitySettings, devProviderFile, integrationProxyPath, providerSettingPrefix, resolveDevProvider, EMAIL_SENDERS_ENV, chooseEmailProvider, parseEmailList, parseEmailSender, } from "../internal/index.js";
|
|
1
|
+
import { APP_ID_ENV, CATALOG, ConfigurationError, GATEWAY_ERROR_HEADER, INTEGRATION_PROXY_PREFIX, oauthPreset, apiKeyHosts, authorizationFor, capabilitySettings, devProviderFile, integrationProxyPath, providerSettingPrefix, resolveDevProvider, EMAIL_SENDERS_ENV, chooseEmailProvider, parseEmailList, parseEmailSender, } from "../internal/index.js";
|
|
2
2
|
import { applyAttribution, attributionFor, } from "./attribution.js";
|
|
3
3
|
import { connectPath } from "./connectUrl.js";
|
|
4
4
|
import { BINDING_ORIGIN, gatewayBinding, streamingRequest, } from "./gatewayFetch.js";
|
|
@@ -278,7 +278,9 @@ async function readIntegrationStatus({ env, provider, for: explicitTarget, }) {
|
|
|
278
278
|
// without one, the catalog, or in local dev the row's spec from
|
|
279
279
|
// `.everyapp/providers/<id>.json`.
|
|
280
280
|
const integration = binding && typeof binding.fetch === "function"
|
|
281
|
-
? CATALOG.get(String(provider))
|
|
281
|
+
? (CATALOG.get(String(provider)) ??
|
|
282
|
+
oauthPreset(String(provider)) ??
|
|
283
|
+
undefined)
|
|
282
284
|
: (CATALOG.get(String(provider)) ??
|
|
283
285
|
devRegisteredProvider(String(provider), values));
|
|
284
286
|
if (integration?.mode === "ai") {
|
package/dist/server/tools.d.ts
CHANGED
|
@@ -26,8 +26,11 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import { type EveryAppUser, type ToolCallResultV1, type ToolDescriptorV1, type ToolIssueV1, type ToolRisk } from "../internal/index.js";
|
|
28
28
|
import type { ExecutionContextLike } from "./everyApp.js";
|
|
29
|
-
/**
|
|
30
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Reported with every catalog; must match package.json (a test checks).
|
|
31
|
+
* scripts/publish-rc.mjs sets both for the build it publishes.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SDK_VERSION = "0.3.0-rc.15";
|
|
31
34
|
/**
|
|
32
35
|
* Throw from a tool handler to return an error the model can read and act on
|
|
33
36
|
* ("No todo with that id"). Any other error is logged here and reaches the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,WAAW,gBAAgB,CAAC;AASzC;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,OAAO,EAAE,MAAM;CAI5B;AAID,KAAK,mBAAmB,GAAG,WAAW,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;CAAE,CAAC;AAEvE,UAAU,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AgB,WAAW,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,KAAK,EAAE;KAAG,CAAC,IAAI,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CAAE,EAC3D,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CA+BT;AAuOD,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC;AAEzC,qCAAqC;AACrC,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAQ/B;AAiBD;;;GAGG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,gBAAgB,CAAC,CAuC3B"}
|
package/dist/server/tools.js
CHANGED
|
@@ -25,8 +25,11 @@
|
|
|
25
25
|
* `{ jsonSchema, validate }` pair. The SDK itself takes no dependency.
|
|
26
26
|
*/
|
|
27
27
|
import { TOOL_NAME_PATTERN, catalogHash, isToolRisk, } from "../internal/index.js";
|
|
28
|
-
/**
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Reported with every catalog; must match package.json (a test checks).
|
|
30
|
+
* scripts/publish-rc.mjs sets both for the build it publishes.
|
|
31
|
+
*/
|
|
32
|
+
export const SDK_VERSION = "0.3.0-rc.15";
|
|
30
33
|
const JSON_SCHEMA_TARGET = "draft-2020-12";
|
|
31
34
|
const DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
32
35
|
// The 2026-07-28 MCP revision lets a schema property ask clients to mirror an
|
package/package.json
CHANGED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The OAuth providers every Gateway has built in, as `oauth2-user` specs:
|
|
3
|
-
* the same JSON shape as the presets (./oauthPresets.ts) and a registered
|
|
4
|
-
* row (`everyapp provider add`). What differs between Google, Microsoft
|
|
5
|
-
* and Slack is here as data: the endpoints, the API hosts, how scopes are
|
|
6
|
-
* separated and prefixed, the extra authorize parameters, how the account
|
|
7
|
-
* is named, and the scopes a token may carry beyond what the app asked.
|
|
8
|
-
* No code anywhere reads a provider id to decide anything.
|
|
9
|
-
*
|
|
10
|
-
* Pure data with no imports, so the catalog (./capabilities.ts) can build
|
|
11
|
-
* its entries from it without an import cycle. Each spec parses with
|
|
12
|
-
* `parseProviderSpec` and round-trips through `oauthSpecOf`
|
|
13
|
-
* (oauthBuiltIns.test.ts).
|
|
14
|
-
*/
|
|
15
|
-
export declare const BUILT_IN_OAUTH_SPECS: {
|
|
16
|
-
readonly "google-workspace": {
|
|
17
|
-
readonly id: "google-workspace";
|
|
18
|
-
readonly name: "Google";
|
|
19
|
-
readonly description: "Gmail, Calendar, Drive, Search Console, Analytics and the other Google APIs, as the person who connects.";
|
|
20
|
-
readonly docs: "https://console.cloud.google.com/apis/credentials";
|
|
21
|
-
readonly api: "https://developers.google.com/identity/protocols/oauth2/scopes";
|
|
22
|
-
readonly hosts: readonly ["gmail.googleapis.com", "www.googleapis.com", "searchconsole.googleapis.com", "analyticsdata.googleapis.com", "analyticsadmin.googleapis.com", "openidconnect.googleapis.com"];
|
|
23
|
-
readonly auth: {
|
|
24
|
-
readonly kind: "oauth2-user";
|
|
25
|
-
readonly authorizeUrl: "https://accounts.google.com/o/oauth2/v2/auth";
|
|
26
|
-
readonly tokenUrl: "https://oauth2.googleapis.com/token";
|
|
27
|
-
readonly clientId: "GOOGLE_WORKSPACE_CLIENT_ID";
|
|
28
|
-
readonly clientSecret: "GOOGLE_WORKSPACE_CLIENT_SECRET";
|
|
29
|
-
readonly inject: "form";
|
|
30
|
-
readonly pkce: true;
|
|
31
|
-
readonly scopeSeparator: "space";
|
|
32
|
-
readonly scopePrefix: "https://www.googleapis.com/auth/";
|
|
33
|
-
readonly authorizeParams: {
|
|
34
|
-
readonly access_type: "offline";
|
|
35
|
-
readonly prompt: "consent";
|
|
36
|
-
};
|
|
37
|
-
readonly identity: {
|
|
38
|
-
readonly url: "https://openidconnect.googleapis.com/v1/userinfo";
|
|
39
|
-
readonly label: "email";
|
|
40
|
-
readonly id: "sub";
|
|
41
|
-
readonly scopes: readonly ["openid", "email"];
|
|
42
|
-
};
|
|
43
|
-
readonly tolerated: readonly ["profile", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"];
|
|
44
|
-
};
|
|
45
|
-
readonly hint: "A Web application OAuth client in Google Cloud, with the Gateway's callback as its redirect URI and the scopes your apps list on its consent screen.";
|
|
46
|
-
};
|
|
47
|
-
readonly "microsoft-365": {
|
|
48
|
-
readonly id: "microsoft-365";
|
|
49
|
-
readonly name: "Microsoft 365";
|
|
50
|
-
readonly description: "Outlook mail and calendar, OneDrive and the rest of Microsoft Graph, as the person who connects.";
|
|
51
|
-
readonly docs: "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade";
|
|
52
|
-
readonly api: "https://learn.microsoft.com/graph/permissions-reference";
|
|
53
|
-
readonly hosts: readonly ["graph.microsoft.com"];
|
|
54
|
-
readonly auth: {
|
|
55
|
-
readonly kind: "oauth2-user";
|
|
56
|
-
readonly authorizeUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
|
|
57
|
-
readonly tokenUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/token";
|
|
58
|
-
readonly clientId: "MICROSOFT_365_CLIENT_ID";
|
|
59
|
-
readonly clientSecret: "MICROSOFT_365_CLIENT_SECRET";
|
|
60
|
-
readonly inject: "form";
|
|
61
|
-
readonly pkce: true;
|
|
62
|
-
readonly scopeSeparator: "space";
|
|
63
|
-
readonly scopePrefix: "https://graph.microsoft.com/";
|
|
64
|
-
readonly identity: {
|
|
65
|
-
readonly url: "https://graph.microsoft.com/v1.0/me";
|
|
66
|
-
readonly label: "userPrincipalName";
|
|
67
|
-
readonly id: "id";
|
|
68
|
-
readonly scopes: readonly ["User.Read", "offline_access"];
|
|
69
|
-
};
|
|
70
|
-
readonly tolerated: readonly ["openid", "profile", "email"];
|
|
71
|
-
};
|
|
72
|
-
readonly hint: "An app registration in Entra for accounts in any organization and personal accounts, with the Gateway's callback as a Web redirect URI. If two apps share this client with different scopes, Microsoft may hand back both apps' scopes and the Gateway refuses the token: give each app its own client.";
|
|
73
|
-
};
|
|
74
|
-
readonly slack: {
|
|
75
|
-
readonly id: "slack";
|
|
76
|
-
readonly name: "Slack";
|
|
77
|
-
readonly description: "Channels, members and messages, as the Slack app.";
|
|
78
|
-
readonly docs: "https://api.slack.com/apps";
|
|
79
|
-
readonly api: "https://api.slack.com/scopes";
|
|
80
|
-
readonly hosts: readonly ["slack.com"];
|
|
81
|
-
readonly auth: {
|
|
82
|
-
readonly kind: "oauth2-user";
|
|
83
|
-
readonly authorizeUrl: "https://slack.com/oauth/v2/authorize";
|
|
84
|
-
readonly tokenUrl: "https://slack.com/api/oauth.v2.access";
|
|
85
|
-
readonly revokeUrl: "https://slack.com/api/auth.revoke";
|
|
86
|
-
readonly clientId: "SLACK_CLIENT_ID";
|
|
87
|
-
readonly clientSecret: "SLACK_CLIENT_SECRET";
|
|
88
|
-
readonly inject: "form";
|
|
89
|
-
readonly pkce: false;
|
|
90
|
-
readonly scopeSeparator: "comma";
|
|
91
|
-
readonly identity: {
|
|
92
|
-
readonly url: "https://slack.com/api/auth.test";
|
|
93
|
-
readonly label: "team";
|
|
94
|
-
readonly id: "team_id";
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
readonly hint: "A Slack app with the Gateway's callback as its redirect URL and the bot scopes your apps list. The Gateway takes its Client ID and Client Secret, not a bot token (xoxb-).";
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
export type BuiltInOAuthId = keyof typeof BUILT_IN_OAUTH_SPECS;
|
|
101
|
-
//# sourceMappingURL=oauthBuiltIns.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauthBuiltIns.d.ts","sourceRoot":"","sources":["../../src/internal/oauthBuiltIns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GvB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,oBAAoB,CAAC"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The OAuth providers every Gateway has built in, as `oauth2-user` specs:
|
|
3
|
-
* the same JSON shape as the presets (./oauthPresets.ts) and a registered
|
|
4
|
-
* row (`everyapp provider add`). What differs between Google, Microsoft
|
|
5
|
-
* and Slack is here as data: the endpoints, the API hosts, how scopes are
|
|
6
|
-
* separated and prefixed, the extra authorize parameters, how the account
|
|
7
|
-
* is named, and the scopes a token may carry beyond what the app asked.
|
|
8
|
-
* No code anywhere reads a provider id to decide anything.
|
|
9
|
-
*
|
|
10
|
-
* Pure data with no imports, so the catalog (./capabilities.ts) can build
|
|
11
|
-
* its entries from it without an import cycle. Each spec parses with
|
|
12
|
-
* `parseProviderSpec` and round-trips through `oauthSpecOf`
|
|
13
|
-
* (oauthBuiltIns.test.ts).
|
|
14
|
-
*/
|
|
15
|
-
export const BUILT_IN_OAUTH_SPECS = {
|
|
16
|
-
// One Google Cloud project's OAuth client: Gmail, Calendar, Search
|
|
17
|
-
// Console, Analytics and any other Google API an app names a scope for.
|
|
18
|
-
"google-workspace": {
|
|
19
|
-
id: "google-workspace",
|
|
20
|
-
name: "Google",
|
|
21
|
-
description: "Gmail, Calendar, Drive, Search Console, Analytics and the other Google APIs, as the person who connects.",
|
|
22
|
-
docs: "https://console.cloud.google.com/apis/credentials",
|
|
23
|
-
api: "https://developers.google.com/identity/protocols/oauth2/scopes",
|
|
24
|
-
hosts: [
|
|
25
|
-
"gmail.googleapis.com",
|
|
26
|
-
"www.googleapis.com",
|
|
27
|
-
"searchconsole.googleapis.com",
|
|
28
|
-
"analyticsdata.googleapis.com",
|
|
29
|
-
"analyticsadmin.googleapis.com",
|
|
30
|
-
"openidconnect.googleapis.com",
|
|
31
|
-
],
|
|
32
|
-
auth: {
|
|
33
|
-
kind: "oauth2-user",
|
|
34
|
-
authorizeUrl: "https://accounts.google.com/o/oauth2/v2/auth",
|
|
35
|
-
tokenUrl: "https://oauth2.googleapis.com/token",
|
|
36
|
-
clientId: "GOOGLE_WORKSPACE_CLIENT_ID",
|
|
37
|
-
clientSecret: "GOOGLE_WORKSPACE_CLIENT_SECRET",
|
|
38
|
-
inject: "form",
|
|
39
|
-
pkce: true,
|
|
40
|
-
scopeSeparator: "space",
|
|
41
|
-
// An app writes `gmail.modify`; the authorize URL carries the full
|
|
42
|
-
// `https://www.googleapis.com/auth/gmail.modify`.
|
|
43
|
-
scopePrefix: "https://www.googleapis.com/auth/",
|
|
44
|
-
// A refresh token needs `access_type=offline`; `prompt=consent`
|
|
45
|
-
// makes Google issue one on every connect.
|
|
46
|
-
authorizeParams: { access_type: "offline", prompt: "consent" },
|
|
47
|
-
identity: {
|
|
48
|
-
url: "https://openidconnect.googleapis.com/v1/userinfo",
|
|
49
|
-
label: "email",
|
|
50
|
-
id: "sub",
|
|
51
|
-
scopes: ["openid", "email"],
|
|
52
|
-
},
|
|
53
|
-
// Google answers `email` and `profile` as the userinfo URLs, and may
|
|
54
|
-
// add `profile` beside `openid`.
|
|
55
|
-
tolerated: [
|
|
56
|
-
"profile",
|
|
57
|
-
"https://www.googleapis.com/auth/userinfo.email",
|
|
58
|
-
"https://www.googleapis.com/auth/userinfo.profile",
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
hint: "A Web application OAuth client in Google Cloud, with the Gateway's callback as its redirect URI and the scopes your apps list on its consent screen.",
|
|
62
|
-
},
|
|
63
|
-
// The multi-tenant Entra endpoints: register the client for accounts in
|
|
64
|
-
// any organization and personal accounts.
|
|
65
|
-
"microsoft-365": {
|
|
66
|
-
id: "microsoft-365",
|
|
67
|
-
name: "Microsoft 365",
|
|
68
|
-
description: "Outlook mail and calendar, OneDrive and the rest of Microsoft Graph, as the person who connects.",
|
|
69
|
-
docs: "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade",
|
|
70
|
-
api: "https://learn.microsoft.com/graph/permissions-reference",
|
|
71
|
-
hosts: ["graph.microsoft.com"],
|
|
72
|
-
auth: {
|
|
73
|
-
kind: "oauth2-user",
|
|
74
|
-
authorizeUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
|
|
75
|
-
tokenUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/token",
|
|
76
|
-
clientId: "MICROSOFT_365_CLIENT_ID",
|
|
77
|
-
clientSecret: "MICROSOFT_365_CLIENT_SECRET",
|
|
78
|
-
inject: "form",
|
|
79
|
-
pkce: true,
|
|
80
|
-
scopeSeparator: "space",
|
|
81
|
-
// An app writes `Mail.Read`; Graph's scopes are fully qualified on
|
|
82
|
-
// the wire and may come back either way.
|
|
83
|
-
scopePrefix: "https://graph.microsoft.com/",
|
|
84
|
-
identity: {
|
|
85
|
-
url: "https://graph.microsoft.com/v1.0/me",
|
|
86
|
-
label: "userPrincipalName",
|
|
87
|
-
id: "id",
|
|
88
|
-
// `offline_access` is what makes Entra issue a refresh token.
|
|
89
|
-
scopes: ["User.Read", "offline_access"],
|
|
90
|
-
},
|
|
91
|
-
tolerated: ["openid", "profile", "email"],
|
|
92
|
-
},
|
|
93
|
-
hint: "An app registration in Entra for accounts in any organization and personal accounts, with the Gateway's callback as a Web redirect URI. If two apps share this client with different scopes, Microsoft may hand back both apps' scopes and the Gateway refuses the token: give each app its own client.",
|
|
94
|
-
},
|
|
95
|
-
// A Slack app's bot token: the top-level token of `oauth.v2.access`.
|
|
96
|
-
slack: {
|
|
97
|
-
id: "slack",
|
|
98
|
-
name: "Slack",
|
|
99
|
-
description: "Channels, members and messages, as the Slack app.",
|
|
100
|
-
docs: "https://api.slack.com/apps",
|
|
101
|
-
api: "https://api.slack.com/scopes",
|
|
102
|
-
hosts: ["slack.com"],
|
|
103
|
-
auth: {
|
|
104
|
-
kind: "oauth2-user",
|
|
105
|
-
authorizeUrl: "https://slack.com/oauth/v2/authorize",
|
|
106
|
-
tokenUrl: "https://slack.com/api/oauth.v2.access",
|
|
107
|
-
revokeUrl: "https://slack.com/api/auth.revoke",
|
|
108
|
-
clientId: "SLACK_CLIENT_ID",
|
|
109
|
-
clientSecret: "SLACK_CLIENT_SECRET",
|
|
110
|
-
inject: "form",
|
|
111
|
-
// Slack refuses `code_challenge`.
|
|
112
|
-
pkce: false,
|
|
113
|
-
scopeSeparator: "comma",
|
|
114
|
-
identity: {
|
|
115
|
-
url: "https://slack.com/api/auth.test",
|
|
116
|
-
label: "team",
|
|
117
|
-
id: "team_id",
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
hint: "A Slack app with the Gateway's callback as its redirect URL and the bot scopes your apps list. The Gateway takes its Client ID and Client Secret, not a bot token (xoxb-).",
|
|
121
|
-
},
|
|
122
|
-
};
|