@squadbase/connectors 0.1.2-dev.4 → 0.1.2-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +116 -23
- package/dist/sdk.js +1 -1
- package/package.json +1 -1
- package/dist/{chunk-HHVJKPCD.js → chunk-5TTOOD5N.js} +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -709,8 +709,8 @@ declare const connectors: {
|
|
|
709
709
|
}>;
|
|
710
710
|
msTeams: ConnectorPlugin<{
|
|
711
711
|
clientId: ParameterDefinition;
|
|
712
|
-
clientSecret: ParameterDefinition;
|
|
713
712
|
tenantId: ParameterDefinition;
|
|
713
|
+
clientSecret: ParameterDefinition;
|
|
714
714
|
}, {}>;
|
|
715
715
|
msTeamsOauth: ConnectorPlugin<{}, {
|
|
716
716
|
request: ConnectorTool<{
|
|
@@ -1315,8 +1315,8 @@ declare const shopifyOauthConnector: ConnectorPlugin<{}, {
|
|
|
1315
1315
|
|
|
1316
1316
|
declare const msTeamsConnector: ConnectorPlugin<{
|
|
1317
1317
|
clientId: ParameterDefinition;
|
|
1318
|
-
clientSecret: ParameterDefinition;
|
|
1319
1318
|
tenantId: ParameterDefinition;
|
|
1319
|
+
clientSecret: ParameterDefinition;
|
|
1320
1320
|
}, {}>;
|
|
1321
1321
|
|
|
1322
1322
|
declare const msTeamsOauthConnector: ConnectorPlugin<{}, {
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parameters7,
|
|
19
19
|
parameters8,
|
|
20
20
|
parameters9
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5TTOOD5N.js";
|
|
22
22
|
|
|
23
23
|
// src/connector-setup.ts
|
|
24
24
|
var ConnectorSetup = class {
|
|
@@ -6019,6 +6019,90 @@ const data = await res.json();
|
|
|
6019
6019
|
tools: tools28
|
|
6020
6020
|
});
|
|
6021
6021
|
|
|
6022
|
+
// src/connectors/slack/setup.ts
|
|
6023
|
+
var slackSetup = new ConnectorSetup({
|
|
6024
|
+
ja: `## Slack \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806
|
|
6025
|
+
|
|
6026
|
+
\u4EE5\u4E0B\u306E\u624B\u9806\u3067Slack\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
6027
|
+
|
|
6028
|
+
### \u624B\u9806
|
|
6029
|
+
|
|
6030
|
+
#### \u30B9\u30C6\u30C3\u30D71: \u63A5\u7D9A\u78BA\u8A8D
|
|
6031
|
+
1. Slack API \`auth.test\` \u3092\u547C\u3073\u51FA\u3057\u3066 Bot Token \u306E\u6709\u52B9\u6027\u3092\u78BA\u8A8D\u3059\u308B:
|
|
6032
|
+
- URL: \`https://slack.com/api/auth.test\`
|
|
6033
|
+
- Header: \`Authorization: Bearer {botToken}\`
|
|
6034
|
+
2. \u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`ok\` \u304C \`false\` \u306E\u5834\u5408:
|
|
6035
|
+
- \`invalid_auth\`: Bot Token \u304C\u7121\u52B9\u3002\u30E6\u30FC\u30B6\u30FC\u306B\u30C8\u30FC\u30AF\u30F3\u306E\u518D\u78BA\u8A8D\u3092\u4F9D\u983C\u3059\u308B
|
|
6036
|
+
- \`missing_scope\` \u3084\u6A29\u9650\u30A8\u30E9\u30FC: \u5FC5\u8981\u306A\u30B9\u30B3\u30FC\u30D7\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u308B\u65E8\u3092\u6848\u5185\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u4FEE\u6B63\u3092\u4F9D\u983C\u3059\u308B
|
|
6037
|
+
|
|
6038
|
+
#### \u30B9\u30C6\u30C3\u30D72: \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u60C5\u5831\u306E\u53D6\u5F97
|
|
6039
|
+
3. \`team.info\` \u3092\u547C\u3073\u51FA\u3057\u3066\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u60C5\u5831\u3092\u53D6\u5F97\u3059\u308B:
|
|
6040
|
+
- URL: \`https://slack.com/api/team.info\`
|
|
6041
|
+
4. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\uFF08\u7279\u306B \`missing_scope\`\uFF09:
|
|
6042
|
+
- \u4E0D\u8DB3\u3057\u3066\u3044\u308B\u30B9\u30B3\u30FC\u30D7\u3092\u6848\u5185\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u8FFD\u52A0\u3092\u4F9D\u983C\u3059\u308B
|
|
6043
|
+
- \u30E6\u30FC\u30B6\u30FC\u304C\u4FEE\u6B63\u5F8C\u300C\u5B8C\u4E86\u3057\u305F\u300D\u3068\u8FD4\u7B54\u3057\u305F\u3089\u3001\u518D\u5EA6 \`team.info\` \u3092\u547C\u3073\u51FA\u3057\u3066\u78BA\u8A8D\u3059\u308B
|
|
6044
|
+
|
|
6045
|
+
#### \u30B9\u30C6\u30C3\u30D73: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86
|
|
6046
|
+
5. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3059:
|
|
6047
|
+
- \`workspace\`: \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u540D\u30FBID
|
|
6048
|
+
- \`note\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5185\u5BB9\u306E\u7C21\u5358\u306A\u8AAC\u660E
|
|
6049
|
+
|
|
6050
|
+
### \u63A8\u5968 Bot Token Scopes
|
|
6051
|
+
\u4EE5\u4E0B\u306E\u30B9\u30B3\u30FC\u30D7\u304C\u4E00\u822C\u7684\u306B\u5FC5\u8981\u3067\u3059\u3002\u4E0D\u8DB3\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u30E6\u30FC\u30B6\u30FC\u306B\u6848\u5185\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
6052
|
+
- \`channels:read\` \u2014 \u30D1\u30D6\u30EA\u30C3\u30AF\u30C1\u30E3\u30F3\u30CD\u30EB\u306E\u4E00\u89A7
|
|
6053
|
+
- \`groups:read\` \u2014 \u30D7\u30E9\u30A4\u30D9\u30FC\u30C8\u30C1\u30E3\u30F3\u30CD\u30EB\u306E\u4E00\u89A7
|
|
6054
|
+
- \`users:read\` \u2014 \u30E6\u30FC\u30B6\u30FC\u4E00\u89A7
|
|
6055
|
+
- \`team:read\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u60C5\u5831
|
|
6056
|
+
- \`chat:write\` \u2014 \u30E1\u30C3\u30BB\u30FC\u30B8\u9001\u4FE1
|
|
6057
|
+
|
|
6058
|
+
### \u91CD\u8981\u306A\u5236\u7D04
|
|
6059
|
+
- **\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u30C1\u30E3\u30F3\u30CD\u30EB\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u5185\u5BB9\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3053\u3068**\u3002\u5B9F\u884C\u3057\u3066\u3088\u3044\u306E\u306F\u4E0A\u8A18\u624B\u9806\u3067\u6307\u5B9A\u3055\u308C\u305F\u63A5\u7D9A\u78BA\u8A8D\u30FB\u30E1\u30BF\u30C7\u30FC\u30BF\u53D6\u5F97\u30EA\u30AF\u30A8\u30B9\u30C8\u306E\u307F
|
|
6060
|
+
|
|
6061
|
+
### \u5B9F\u884C\u65B9\u91DD
|
|
6062
|
+
- \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057
|
|
6063
|
+
- \u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
|
|
6064
|
+
en: `## Slack Setup Instructions
|
|
6065
|
+
|
|
6066
|
+
Follow these steps to set up the Slack connection.
|
|
6067
|
+
|
|
6068
|
+
### Steps
|
|
6069
|
+
|
|
6070
|
+
#### Step 1: Verify Connection
|
|
6071
|
+
1. Call Slack API \`auth.test\` to verify the Bot Token:
|
|
6072
|
+
- URL: \`https://slack.com/api/auth.test\`
|
|
6073
|
+
- Header: \`Authorization: Bearer {botToken}\`
|
|
6074
|
+
2. If the response \`ok\` is \`false\`:
|
|
6075
|
+
- \`invalid_auth\`: Bot Token is invalid. Ask the user to re-check the token
|
|
6076
|
+
- \`missing_scope\` or permission errors: Inform which scopes are missing and ask the user to fix
|
|
6077
|
+
|
|
6078
|
+
#### Step 2: Fetch Workspace Info
|
|
6079
|
+
3. Call \`team.info\` to get workspace info:
|
|
6080
|
+
- URL: \`https://slack.com/api/team.info\`
|
|
6081
|
+
4. If an error is returned (especially \`missing_scope\`):
|
|
6082
|
+
- Inform the user which scopes are missing and ask them to add the scopes
|
|
6083
|
+
- When the user confirms the fix, call \`team.info\` again to verify
|
|
6084
|
+
|
|
6085
|
+
#### Step 3: Complete Setup
|
|
6086
|
+
5. Call \`updateConnectionContext\`:
|
|
6087
|
+
- \`workspace\`: Workspace name and ID
|
|
6088
|
+
- \`note\`: Brief description of the setup
|
|
6089
|
+
|
|
6090
|
+
### Recommended Bot Token Scopes
|
|
6091
|
+
The following scopes are commonly required. Inform the user if any are missing:
|
|
6092
|
+
- \`channels:read\` \u2014 List public channels
|
|
6093
|
+
- \`groups:read\` \u2014 List private channels
|
|
6094
|
+
- \`users:read\` \u2014 List users
|
|
6095
|
+
- \`team:read\` \u2014 Get workspace info
|
|
6096
|
+
- \`chat:write\` \u2014 Send messages
|
|
6097
|
+
|
|
6098
|
+
### Important Constraints
|
|
6099
|
+
- **Do NOT read channel message content during setup**. Only the connection verification and metadata requests specified in the steps above are allowed
|
|
6100
|
+
|
|
6101
|
+
### Execution Policy
|
|
6102
|
+
- Write only 1 sentence between tool calls, then immediately call the next tool
|
|
6103
|
+
- Skip unnecessary explanations and proceed efficiently`
|
|
6104
|
+
});
|
|
6105
|
+
|
|
6022
6106
|
// src/connectors/slack/index.ts
|
|
6023
6107
|
var tools29 = {};
|
|
6024
6108
|
var slackConnector = new ConnectorPlugin({
|
|
@@ -6029,35 +6113,42 @@ var slackConnector = new ConnectorPlugin({
|
|
|
6029
6113
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/7zTp67vMTvAV1wPftt6Z9R/f859e25c223d9fe4c3fd4f83895acbf6/slack.svg",
|
|
6030
6114
|
parameters: parameters17,
|
|
6031
6115
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
6116
|
+
setup: slackSetup,
|
|
6032
6117
|
systemPrompt: `## Slack SDK (TypeScript handler)
|
|
6033
6118
|
Use the Slack connector via the SDK in TypeScript handlers:
|
|
6034
6119
|
|
|
6035
6120
|
\`\`\`ts
|
|
6036
6121
|
import { connection } from "@squadbase/vite-server/connectors/slack";
|
|
6037
|
-
import { WebClient } from "@slack/web-api";
|
|
6038
6122
|
|
|
6039
6123
|
const { botToken } = connection("<connectionId>");
|
|
6040
|
-
const client = new WebClient(botToken);
|
|
6041
6124
|
|
|
6042
|
-
|
|
6125
|
+
// Use the Slack Web API with fetch
|
|
6126
|
+
const res = await fetch("https://slack.com/api/conversations.list", {
|
|
6127
|
+
headers: {
|
|
6128
|
+
Authorization: "Bearer " + botToken,
|
|
6129
|
+
"Content-Type": "application/json",
|
|
6130
|
+
},
|
|
6131
|
+
});
|
|
6132
|
+
const data = await res.json();
|
|
6043
6133
|
\`\`\`
|
|
6044
6134
|
|
|
6045
|
-
### Common
|
|
6046
|
-
-
|
|
6047
|
-
-
|
|
6048
|
-
-
|
|
6049
|
-
-
|
|
6050
|
-
-
|
|
6051
|
-
-
|
|
6052
|
-
-
|
|
6053
|
-
-
|
|
6054
|
-
-
|
|
6055
|
-
-
|
|
6135
|
+
### Common Endpoints (Base URL: https://slack.com/api)
|
|
6136
|
+
- GET \`/conversations.list\` \u2014 List channels
|
|
6137
|
+
- GET \`/conversations.history?channel={id}\` \u2014 Get channel messages
|
|
6138
|
+
- GET \`/conversations.info?channel={id}\` \u2014 Get channel info
|
|
6139
|
+
- GET \`/conversations.members?channel={id}\` \u2014 List channel members
|
|
6140
|
+
- GET \`/users.list\` \u2014 List users
|
|
6141
|
+
- GET \`/users.info?user={id}\` \u2014 Get user info
|
|
6142
|
+
- POST \`/chat.postMessage\` \u2014 Send a message (JSON body: channel, text)
|
|
6143
|
+
- GET \`/reactions.list\` \u2014 List reactions
|
|
6144
|
+
- GET \`/search.messages?query={query}\` \u2014 Search messages (requires user token)
|
|
6145
|
+
- GET \`/team.info\` \u2014 Get team info
|
|
6056
6146
|
|
|
6057
6147
|
### Tips
|
|
6058
|
-
-
|
|
6148
|
+
- All endpoints accept GET with query params or POST with JSON body
|
|
6059
6149
|
- Pagination: use \`cursor\` parameter with \`response_metadata.next_cursor\`
|
|
6060
|
-
- Rate limits: Tier 1-4, most methods are Tier 3 (50+ per minute)
|
|
6150
|
+
- Rate limits: Tier 1-4, most methods are Tier 3 (50+ per minute)
|
|
6151
|
+
- Check \`data.ok\` field \u2014 Slack returns HTTP 200 even on errors`,
|
|
6061
6152
|
tools: tools29
|
|
6062
6153
|
});
|
|
6063
6154
|
|
|
@@ -6499,7 +6590,7 @@ var requestToolName6 = `microsoft-teams-oauth_${requestTool14.name}`;
|
|
|
6499
6590
|
var msTeamsOauthSetup = new ConnectorSetup({
|
|
6500
6591
|
ja: `## Microsoft Teams \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806
|
|
6501
6592
|
|
|
6502
|
-
\u4EE5\u4E0B\u306E\u624B\u9806\
|
|
6593
|
+
\u4EE5\u4E0B\u306E\u624B\u9806\u3092\u6B63\u78BA\u306B\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u624B\u9806\u306B\u8A18\u8F09\u306E\u306A\u3044\u8FFD\u52A0\u306EAPI\u30EA\u30AF\u30A8\u30B9\u30C8\u306F\u4E00\u5207\u884C\u308F\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
6503
6594
|
|
|
6504
6595
|
### \u624B\u9806
|
|
6505
6596
|
|
|
@@ -6511,18 +6602,19 @@ var msTeamsOauthSetup = new ConnectorSetup({
|
|
|
6511
6602
|
|
|
6512
6603
|
#### \u30B9\u30C6\u30C3\u30D72: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86
|
|
6513
6604
|
1. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3059:
|
|
6514
|
-
- \`user\`: Microsoft \u30E6\u30FC\u30B6\u30FC\u60C5\u5831
|
|
6605
|
+
- \`user\`: Microsoft \u30E6\u30FC\u30B6\u30FC\u60C5\u5831\uFF08displayName, mail \u306A\u3069\uFF09
|
|
6515
6606
|
- \`note\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5185\u5BB9\u306E\u7C21\u5358\u306A\u8AAC\u660E
|
|
6516
6607
|
|
|
6517
6608
|
### \u91CD\u8981\u306A\u5236\u7D04
|
|
6518
|
-
- **\
|
|
6609
|
+
- **\u4E0A\u8A182\u30B9\u30C6\u30C3\u30D7\u306E\u307F\u5B9F\u884C\u3059\u308B\u3053\u3068**\u3002Teams\u4E00\u89A7\u306E\u53D6\u5F97\u3001\u30C1\u30E3\u30F3\u30CD\u30EB\u4E00\u89A7\u306E\u53D6\u5F97\u3001\u30E1\u30C3\u30BB\u30FC\u30B8\u306E\u8AAD\u307F\u53D6\u308A\u306A\u3069\u3001\u624B\u9806\u306B\u8A18\u8F09\u306E\u306A\u3044API\u30EA\u30AF\u30A8\u30B9\u30C8\u306F\u4E00\u5207\u7981\u6B62
|
|
6610
|
+
- \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u306F\u63A5\u7D9A\u78BA\u8A8D\u306E\u307F\u304C\u76EE\u7684\u3002\u30C7\u30FC\u30BF\u63A2\u7D22\u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86\u5F8C\u306B\u30E6\u30FC\u30B6\u30FC\u304C\u884C\u3046
|
|
6519
6611
|
|
|
6520
6612
|
### \u5B9F\u884C\u65B9\u91DD
|
|
6521
6613
|
- \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057
|
|
6522
6614
|
- \u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
|
|
6523
6615
|
en: `## Microsoft Teams Setup Instructions
|
|
6524
6616
|
|
|
6525
|
-
Follow these steps
|
|
6617
|
+
Follow these steps exactly. Do NOT make any API requests not listed in the steps below.
|
|
6526
6618
|
|
|
6527
6619
|
### Steps
|
|
6528
6620
|
|
|
@@ -6534,11 +6626,12 @@ Follow these steps to set up the Microsoft Teams connection.
|
|
|
6534
6626
|
|
|
6535
6627
|
#### Step 2: Complete Setup
|
|
6536
6628
|
1. Call \`updateConnectionContext\`:
|
|
6537
|
-
- \`user\`: Microsoft user info
|
|
6629
|
+
- \`user\`: Microsoft user info (displayName, mail, etc.)
|
|
6538
6630
|
- \`note\`: Brief description of the setup
|
|
6539
6631
|
|
|
6540
6632
|
### Important Constraints
|
|
6541
|
-
- **Do NOT
|
|
6633
|
+
- **Only execute the 2 steps above**. Do NOT fetch Teams list, channels, messages, or make any API requests not specified in the steps
|
|
6634
|
+
- Setup is only for connection verification. Data exploration is done by the user after setup is complete
|
|
6542
6635
|
|
|
6543
6636
|
### Execution Policy
|
|
6544
6637
|
- Write only 1 sentence between tool calls, then immediately call the next tool
|
package/dist/sdk.js
CHANGED
package/package.json
CHANGED
|
@@ -391,15 +391,6 @@ var parameters18 = {
|
|
|
391
391
|
secret: false,
|
|
392
392
|
required: true
|
|
393
393
|
}),
|
|
394
|
-
clientSecret: new ParameterDefinition({
|
|
395
|
-
slug: "client-secret",
|
|
396
|
-
name: "Azure AD Client Secret",
|
|
397
|
-
description: "The client secret from your Azure AD app registration.",
|
|
398
|
-
envVarBaseKey: "MS_TEAMS_CLIENT_SECRET",
|
|
399
|
-
type: "text",
|
|
400
|
-
secret: true,
|
|
401
|
-
required: true
|
|
402
|
-
}),
|
|
403
394
|
tenantId: new ParameterDefinition({
|
|
404
395
|
slug: "tenant-id",
|
|
405
396
|
name: "Azure AD Tenant ID",
|
|
@@ -408,6 +399,15 @@ var parameters18 = {
|
|
|
408
399
|
type: "text",
|
|
409
400
|
secret: false,
|
|
410
401
|
required: true
|
|
402
|
+
}),
|
|
403
|
+
clientSecret: new ParameterDefinition({
|
|
404
|
+
slug: "client-secret",
|
|
405
|
+
name: "Azure AD Client Secret",
|
|
406
|
+
description: "The client secret from your Azure AD app registration.",
|
|
407
|
+
envVarBaseKey: "MS_TEAMS_CLIENT_SECRET",
|
|
408
|
+
type: "text",
|
|
409
|
+
secret: true,
|
|
410
|
+
required: true
|
|
411
411
|
})
|
|
412
412
|
};
|
|
413
413
|
|