@squadbase/vite-server 0.1.3 → 0.1.4-dev.1
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/cli/index.js +265 -71
- package/dist/connectors/airtable-oauth.js +10 -0
- package/dist/connectors/airtable.js +10 -0
- package/dist/connectors/amplitude.js +10 -0
- package/dist/connectors/anthropic.js +10 -0
- package/dist/connectors/asana.js +10 -0
- package/dist/connectors/attio.js +487 -110
- package/dist/connectors/backlog-api-key.js +10 -0
- package/dist/connectors/customerio.js +10 -0
- package/dist/connectors/dbt.js +10 -0
- package/dist/connectors/gamma.js +10 -0
- package/dist/connectors/gemini.js +10 -0
- package/dist/connectors/gmail-oauth.js +10 -0
- package/dist/connectors/gmail.js +14 -4
- package/dist/connectors/google-ads.js +10 -0
- package/dist/connectors/google-analytics-oauth.js +10 -0
- package/dist/connectors/google-analytics.js +10 -0
- package/dist/connectors/google-calendar-oauth.js +10 -0
- package/dist/connectors/google-calendar.js +14 -6
- package/dist/connectors/google-docs.js +10 -0
- package/dist/connectors/google-drive.js +10 -0
- package/dist/connectors/google-sheets.js +10 -0
- package/dist/connectors/google-slides.js +10 -0
- package/dist/connectors/grafana.js +10 -0
- package/dist/connectors/hubspot-oauth.js +10 -0
- package/dist/connectors/hubspot.js +10 -0
- package/dist/connectors/intercom-oauth.js +10 -0
- package/dist/connectors/intercom.js +10 -0
- package/dist/connectors/jira-api-key.js +10 -0
- package/dist/connectors/kintone-api-token.js +10 -0
- package/dist/connectors/kintone.js +10 -0
- package/dist/connectors/linkedin-ads.js +10 -0
- package/dist/connectors/mailchimp-oauth.js +10 -0
- package/dist/connectors/mailchimp.js +10 -0
- package/dist/connectors/mixpanel.js +10 -0
- package/dist/connectors/notion-oauth.js +10 -0
- package/dist/connectors/notion.js +10 -0
- package/dist/connectors/openai.js +10 -0
- package/dist/connectors/sentry.js +10 -0
- package/dist/connectors/shopify-oauth.js +10 -0
- package/dist/connectors/shopify.js +10 -0
- package/dist/connectors/stripe-api-key.js +10 -0
- package/dist/connectors/stripe-oauth.js +10 -0
- package/dist/connectors/wix-store.js +10 -0
- package/dist/connectors/zendesk-oauth.js +10 -0
- package/dist/connectors/zendesk.js +10 -0
- package/dist/index.js +265 -71
- package/dist/main.js +265 -71
- package/dist/vite-plugin.js +265 -71
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -67299,7 +67299,8 @@ The business logic type for this connector is "sql".
|
|
|
67299
67299
|
},
|
|
67300
67300
|
async query(params, sql, namedParams) {
|
|
67301
67301
|
const { Pool } = await import("pg");
|
|
67302
|
-
const
|
|
67302
|
+
const cleanSql = sql.replace(/;\s*$/, "");
|
|
67303
|
+
const { text, values } = buildPositionalParams(cleanSql, namedParams);
|
|
67303
67304
|
const pool = new Pool({
|
|
67304
67305
|
connectionString: params[parameters3.connectionUrl.slug],
|
|
67305
67306
|
ssl: { rejectUnauthorized: false },
|
|
@@ -67651,7 +67652,7 @@ var bigqueryOnboarding = new ConnectorOnboarding({
|
|
|
67651
67652
|
- \`options\`: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3002\u5404 option \u306E \`label\` \u306F \`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D (id: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID)\` \u306E\u5F62\u5F0F\u3001\`value\` \u306F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID
|
|
67652
67653
|
3. \u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E \`label\` \u304C\u30E1\u30C3\u30BB\u30FC\u30B8\u3068\u3057\u3066\u5C4A\u304F\u306E\u3067\u3001\u6B21\u306E\u30B9\u30C6\u30C3\u30D7\u306B\u9032\u3080
|
|
67653
67654
|
4. \`${listDatasetsToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u9078\u629E\u3055\u308C\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
67654
|
-
5. \`askUserQuestion\` \u3092\u547C\u3073\u51FA\u3059\
|
|
67655
|
+
5. \`askUserQuestion\` \u3092\u547C\u3073\u51FA\u3059\uFF08type: "select", multiSelect: true, allowFreeText: true\uFF09:
|
|
67655
67656
|
- \`question\`: \u4F7F\u7528\u3059\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u9078\u629E\u3059\u308B\u3088\u3046\u4FC3\u3059\u3002\u300C\u4E0A\u8A18\u4EE5\u5916\u306E\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D}\` \u306E\u5F62\u5F0F\u3067\u81EA\u7531\u5165\u529B\u3067\u304D\u307E\u3059\u300D\u3068\u660E\u8A18\u3059\u308B
|
|
67656
67657
|
- \`options\`: \u4EE5\u4E0B\u3092\u9806\u756A\u306B\u7D50\u5408\u3059\u308B
|
|
67657
67658
|
1. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \u5404 \`{ label: datasetId, description: location }\`
|
|
@@ -67683,7 +67684,7 @@ var bigqueryOnboarding = new ConnectorOnboarding({
|
|
|
67683
67684
|
- \`options\`: The project list. Each option's \`label\` should be \`Project Name (id: project-id)\`, \`value\` should be the project ID
|
|
67684
67685
|
3. The \`label\` of the user's selected project will arrive as a message. Proceed to the next step
|
|
67685
67686
|
4. Call \`${listDatasetsToolName}\` to get the list of datasets in the selected project
|
|
67686
|
-
5. Call \`askUserQuestion\` (multiSelect: true):
|
|
67687
|
+
5. Call \`askUserQuestion\` (type: "select", multiSelect: true, allowFreeText: true):
|
|
67687
67688
|
- \`question\`: Ask the user to select datasets. State that other public datasets can be entered freely in the format \`bigquery-public-data.{dataset_name}\`
|
|
67688
67689
|
- \`options\`: Concatenate in order:
|
|
67689
67690
|
1. Project datasets: each \`{ label: datasetId, description: location }\`
|
|
@@ -68113,7 +68114,7 @@ var bigqueryOnboarding2 = new ConnectorOnboarding({
|
|
|
68113
68114
|
- \`options\`: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3002\u5404 option \u306E \`label\` \u306F \`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D (id: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID)\` \u306E\u5F62\u5F0F\u3001\`value\` \u306F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID
|
|
68114
68115
|
3. \u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E \`label\` \u304C\u30E1\u30C3\u30BB\u30FC\u30B8\u3068\u3057\u3066\u5C4A\u304F\u306E\u3067\u3001\u6B21\u306E\u30B9\u30C6\u30C3\u30D7\u306B\u9032\u3080
|
|
68115
68116
|
4. \`${listDatasetsToolName2}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u9078\u629E\u3055\u308C\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
68116
|
-
5. \`askUserQuestion\` \u3092\u547C\u3073\u51FA\u3059\
|
|
68117
|
+
5. \`askUserQuestion\` \u3092\u547C\u3073\u51FA\u3059\uFF08type: "select", multiSelect: true, allowFreeText: true\uFF09:
|
|
68117
68118
|
- \`question\`: \u4F7F\u7528\u3059\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u9078\u629E\u3059\u308B\u3088\u3046\u4FC3\u3059\u3002\u300C\u4E0A\u8A18\u4EE5\u5916\u306E\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D}\` \u306E\u5F62\u5F0F\u3067\u81EA\u7531\u5165\u529B\u3067\u304D\u307E\u3059\u300D\u3068\u660E\u8A18\u3059\u308B
|
|
68118
68119
|
- \`options\`: \u4EE5\u4E0B\u3092\u9806\u756A\u306B\u7D50\u5408\u3059\u308B
|
|
68119
68120
|
1. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \u5404 \`{ label: datasetId, description: location }\`
|
|
@@ -68145,7 +68146,7 @@ var bigqueryOnboarding2 = new ConnectorOnboarding({
|
|
|
68145
68146
|
- \`options\`: The project list. Each option's \`label\` should be \`Project Name (id: project-id)\`, \`value\` should be the project ID
|
|
68146
68147
|
3. The \`label\` of the user's selected project will arrive as a message. Proceed to the next step
|
|
68147
68148
|
4. Call \`${listDatasetsToolName2}\` to get the list of datasets in the selected project
|
|
68148
|
-
5. Call \`askUserQuestion\` (multiSelect: true):
|
|
68149
|
+
5. Call \`askUserQuestion\` (type: "select", multiSelect: true, allowFreeText: true):
|
|
68149
68150
|
- \`question\`: Ask the user to select datasets. State that other public datasets can be entered freely in the format \`bigquery-public-data.{dataset_name}\`
|
|
68150
68151
|
- \`options\`: Concatenate in order:
|
|
68151
68152
|
1. Project datasets: each \`{ label: datasetId, description: location }\`
|
|
@@ -71231,10 +71232,9 @@ var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
|
71231
71232
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Calendar\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u63A5\u7D9A\u4F5C\u6210\u6642\u306B\u306F\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8JSON\u306E\u307F\u304C\u8A2D\u5B9A\u6E08\u307F\u3067\u3001\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3084\u30AB\u30EC\u30F3\u30C0\u30FCID\u306F\u3053\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
71232
71233
|
|
|
71233
71234
|
1. \`askUserQuestion\` \u3067\u30E6\u30FC\u30B6\u30FC\u306B\u3001\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u304CDomain-wide Delegation\u3067\u4EE3\u7406\u30A2\u30AF\u30BB\u30B9\u3059\u308BGoogle Workspace\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u30D2\u30A2\u30EA\u30F3\u30B0\u3059\u308B:
|
|
71235
|
+
- \`type\`: \`"freeText"\`
|
|
71234
71236
|
- \`question\`: \u300C\u30A2\u30AF\u30BB\u30B9\u3057\u305F\u3044\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u6301\u3064\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u8907\u6570\u3042\u308B\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\u5165\u529B\u53EF\uFF09\u300D
|
|
71235
|
-
- \`
|
|
71236
|
-
- \`options\`: \`[]\`\uFF08\u9078\u629E\u80A2\u306A\u3057\u30FB\u81EA\u7531\u5165\u529B\u306E\u307F\uFF09
|
|
71237
|
-
- \`allowFreeText\`: \`true\`
|
|
71237
|
+
- \`placeholder\`: \`"user@example.com, admin@example.com"\`
|
|
71238
71238
|
2. \u30E6\u30FC\u30B6\u30FC\u304B\u3089\u53D7\u3051\u53D6\u3063\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u5BFE\u5FDC\uFF09\u3092 \`updateConnectionParameters\` \u3067\u4FDD\u5B58\u3059\u308B:
|
|
71239
71239
|
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
71240
71240
|
- \`options\`: \`[{ value: <\u5165\u529B\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u6587\u5B57\u5217>, label: <\u540C\u3058\u5024> }]\`\uFF081\u4EF6\u306E\u307F\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u81EA\u52D5\u9078\u629E\u3055\u308C\u308B\uFF09
|
|
@@ -71259,10 +71259,9 @@ var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
|
71259
71259
|
en: `Follow these steps to set up the Google Calendar connection. Only the service account JSON is provided at connection creation time \u2014 the target user email and calendar ID are collected during this setup flow.
|
|
71260
71260
|
|
|
71261
71261
|
1. Call \`askUserQuestion\` to ask the user for the Google Workspace user email the service account will impersonate via Domain-wide Delegation:
|
|
71262
|
+
- \`type\`: \`"freeText"\`
|
|
71262
71263
|
- \`question\`: "Please enter the email address of the user whose calendar you want to access (comma-separated list allowed for multiple users)"
|
|
71263
|
-
- \`
|
|
71264
|
-
- \`options\`: \`[]\` (no preset choices \u2014 free text only)
|
|
71265
|
-
- \`allowFreeText\`: \`true\`
|
|
71264
|
+
- \`placeholder\`: \`"user@example.com, admin@example.com"\`
|
|
71266
71265
|
2. Save the email(s) the user provided (comma-separated supported) via \`updateConnectionParameters\`:
|
|
71267
71266
|
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
71268
71267
|
- \`options\`: \`[{ value: <the email string entered>, label: <same value> }]\` (a single option is auto-selected)
|
|
@@ -76005,7 +76004,8 @@ The business logic type for this connector is "sql".
|
|
|
76005
76004
|
},
|
|
76006
76005
|
async query(params, sql, namedParams) {
|
|
76007
76006
|
const { Pool } = await import("pg");
|
|
76008
|
-
const
|
|
76007
|
+
const cleanSql = sql.replace(/;\s*$/, "");
|
|
76008
|
+
const { text, values } = buildPositionalParams(cleanSql, namedParams);
|
|
76009
76009
|
const pool = new Pool({
|
|
76010
76010
|
connectionString: params[parameters28.connectionUrl.slug],
|
|
76011
76011
|
ssl: { rejectUnauthorized: false },
|
|
@@ -76519,14 +76519,18 @@ export default async function handler(c: Context) {
|
|
|
76519
76519
|
// ../connectors/src/connectors/attio/setup.ts
|
|
76520
76520
|
var attioOnboarding = new ConnectorOnboarding({
|
|
76521
76521
|
dataOverviewInstructions: {
|
|
76522
|
-
en: `1. Call attio_request with GET /objects to
|
|
76523
|
-
2.
|
|
76524
|
-
3. Call attio_request with POST /objects/
|
|
76525
|
-
4.
|
|
76526
|
-
|
|
76527
|
-
|
|
76528
|
-
|
|
76529
|
-
|
|
76522
|
+
en: `1. Call attio_request with GET /objects to discover the object slugs actually configured in this workspace (typically people, companies, deals, plus any custom objects).
|
|
76523
|
+
2. For each object you plan to use, call attio_request with GET /objects/{slug}/attributes to explore its attributes
|
|
76524
|
+
3. Call attio_request with POST /objects/{slug}/records/query with { "limit": 5 } to sample records
|
|
76525
|
+
4. Call attio_request with GET /workspace_members (top-level, snake_case) to list team members. The response shape is \`{ data: [{ id: { workspace_member_id }, first_name, last_name, email_address, ... }] }\`. You need this mapping in dashboard handlers to resolve \`owner\` and other actor-reference fields (which return \`referenced_actor_id\`, not a name). Sample one record that has an \`owner\` and confirm the shape \`{ referenced_actor_type, referenced_actor_id }\`, then use \`client.getWorkspaceMemberMap()\` in handlers to resolve IDs to names.
|
|
76526
|
+
5. If an endpoint later returns 403 (tasks / threads / webhooks / meetings require specific scopes), call GET /self to inspect the token's active scopes.
|
|
76527
|
+
6. Explore lists via GET /lists as needed, and use /notes, /tasks, /threads, /comments, /webhooks, /meetings when the question requires them.`,
|
|
76528
|
+
ja: `1. attio_request \u3067 GET /objects \u3092\u547C\u3073\u51FA\u3057\u3001\u3053\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5B9F\u5728\u3059\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8slug\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u901A\u5E38\u306F people / companies / deals\u3001\u52A0\u3048\u3066\u8A2D\u5B9A\u6E08\u307F\u306E\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF09
|
|
76529
|
+
2. \u4F7F\u3046\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3054\u3068\u306B attio_request \u3067 GET /objects/{slug}/attributes \u3092\u547C\u3073\u51FA\u3057\u3001\u5C5E\u6027\u3092\u78BA\u8A8D
|
|
76530
|
+
3. attio_request \u3067 POST /objects/{slug}/records/query \u3092 { "limit": 5 } \u3067\u547C\u3073\u51FA\u3057\u3001\u30EC\u30B3\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
|
|
76531
|
+
4. attio_request \u3067 GET /workspace_members\uFF08\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u3001\u30B9\u30CD\u30FC\u30AF\u30B1\u30FC\u30B9\uFF09\u3092\u547C\u3073\u51FA\u3057\u3001\u30C1\u30FC\u30E0\u30E1\u30F3\u30D0\u30FC\u4E00\u89A7\u3092\u53D6\u5F97\u3002\u30EC\u30B9\u30DD\u30F3\u30B9\u306F \`{ data: [{ id: { workspace_member_id }, first_name, last_name, email_address, ... }] }\` \u306E\u5F62\u5F0F\u3067\u3059\u3002\u3053\u306E\u30DE\u30C3\u30D4\u30F3\u30B0\u306F\u3001\`owner\` \u306A\u3069\u306E actor-reference \u30D5\u30A3\u30FC\u30EB\u30C9\uFF08\`referenced_actor_id\` \u3092\u8FD4\u3059\uFF09\u3092\u540D\u524D\u306B\u89E3\u6C7A\u3059\u308B\u305F\u3081\u306B\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30CF\u30F3\u30C9\u30E9\u3067\u5FC5\u9808\u3067\u3059\u3002\`owner\` \u3092\u6301\u3064\u30EC\u30B3\u30FC\u30C9\u30921\u4EF6\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u3001\`{ referenced_actor_type, referenced_actor_id }\` \u306E\u5F62\u3092\u78BA\u8A8D\u3057\u305F\u4E0A\u3067\u3001\u30CF\u30F3\u30C9\u30E9\u3067\u306F \`client.getWorkspaceMemberMap()\` \u3092\u4F7F\u3063\u3066 ID \u2192 \u540D\u524D \u306B\u89E3\u6C7A\u3057\u3066\u304F\u3060\u3055\u3044
|
|
76532
|
+
5. \u5F8C\u6BB5\u3067 403 \u304C\u51FA\u305F\u5834\u5408\uFF08tasks / threads / webhooks / meetings \u306A\u3069\u306F\u500B\u5225\u306E scope \u304C\u5FC5\u8981\uFF09\u306F\u3001GET /self \u3092\u547C\u3073\u51FA\u3057\u3066API\u30C8\u30FC\u30AF\u30F3\u306E\u6709\u52B9 scope \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044
|
|
76533
|
+
6. \u5FC5\u8981\u306B\u5FDC\u3058\u3066 GET /lists \u3067\u30EA\u30B9\u30C8\u3092\u63A2\u7D22\u3057\u3001/notes\u3001/tasks\u3001/threads\u3001/comments\u3001/webhooks\u3001/meetings \u3082\u6D3B\u7528\u3057\u3066\u304F\u3060\u3055\u3044`
|
|
76530
76534
|
}
|
|
76531
76535
|
});
|
|
76532
76536
|
|
|
@@ -76552,11 +76556,11 @@ var inputSchema39 = z39.object({
|
|
|
76552
76556
|
"Brief description of what you intend to accomplish with this tool call"
|
|
76553
76557
|
),
|
|
76554
76558
|
connectionId: z39.string().describe("ID of the Attio connection to use"),
|
|
76555
|
-
method: z39.enum(["GET", "POST", "PATCH", "DELETE"]).describe(
|
|
76556
|
-
"HTTP method. GET for reading resources, POST for creating
|
|
76559
|
+
method: z39.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).describe(
|
|
76560
|
+
"HTTP method. GET for reading resources and list endpoints, POST for creating records/querying/asserting, PATCH for partial updates (append multiselect), PUT for full updates (overwrite multiselect), DELETE for removing."
|
|
76557
76561
|
),
|
|
76558
76562
|
path: z39.string().describe(
|
|
76559
|
-
"API path (
|
|
76563
|
+
"Attio REST API path relative to https://api.attio.com/v2 (include the leading slash). Examples: '/self', '/objects', '/objects/people/attributes', '/objects/people/records/query', '/objects/companies/records/{record_id}', '/workspace_members', '/workspace_members/{workspace_member_id}', '/lists', '/lists/{list_id}/entries/query', '/notes', '/tasks', '/threads', '/comments', '/webhooks', '/meetings'."
|
|
76560
76564
|
),
|
|
76561
76565
|
body: z39.record(z39.string(), z39.unknown()).optional().describe("Request body (JSON) for POST/PATCH requests")
|
|
76562
76566
|
});
|
|
@@ -76573,10 +76577,10 @@ var outputSchema39 = z39.discriminatedUnion("success", [
|
|
|
76573
76577
|
]);
|
|
76574
76578
|
var requestTool20 = new ConnectorTool({
|
|
76575
76579
|
name: "request",
|
|
76576
|
-
description: `Send authenticated requests to the Attio REST API.
|
|
76580
|
+
description: `Send authenticated requests to the Attio REST API (base URL: https://api.attio.com/v2).
|
|
76577
76581
|
Authentication is handled automatically using the API Key (Bearer token).
|
|
76578
|
-
Use this tool for
|
|
76579
|
-
|
|
76582
|
+
Use this tool for every Attio API interaction, including: querying records (people, companies, deals, and any custom objects configured in the workspace) and their attributes, listing/getting/creating/updating/deleting records and list entries, reading workspace members, and working with notes, tasks, threads, comments, webhooks, and meetings. Call GET /self to introspect the current API token.
|
|
76583
|
+
Record queries use POST /objects/{object}/records/query with a JSON body containing \`filter\`, \`sorts\`, \`limit\`, and \`offset\`. Record updates use PATCH (append multiselect) or PUT (overwrite multiselect). Workspace members, tasks, webhooks, notes, threads, comments, and meetings live at top-level paths \u2014 the workspace-members path uses a snake_case underscore: /workspace_members.`,
|
|
76580
76584
|
inputSchema: inputSchema39,
|
|
76581
76585
|
outputSchema: outputSchema39,
|
|
76582
76586
|
async execute({ connectionId, method, path: path5, body }, connections) {
|
|
@@ -76635,19 +76639,69 @@ var attioConnector = new ConnectorPlugin({
|
|
|
76635
76639
|
systemPrompt: {
|
|
76636
76640
|
en: `### Tools
|
|
76637
76641
|
|
|
76638
|
-
- \`attio_request\`: The only way to call the Attio REST API. Use it
|
|
76642
|
+
- \`attio_request\`: The only way to call the Attio REST API. Use it for every Attio resource \u2014 records (people, companies, deals, and any custom objects configured in the workspace), their attributes, lists and entries, workspace members, notes, tasks, threads, comments, webhooks, and meetings. Authentication (Bearer token) is configured automatically. Querying records uses POST \`/objects/{object}/records/query\` with a JSON body. Use PATCH for partial updates (append multiselect) and PUT for full updates (overwrite multiselect). Always call GET \`/objects\` first to discover the actual object slugs in this workspace.
|
|
76639
76643
|
|
|
76640
76644
|
### Business Logic
|
|
76641
76645
|
|
|
76642
|
-
The business logic type for this connector is "typescript". Use the connector SDK in your handler
|
|
76646
|
+
The business logic type for this connector is "typescript". Use the connector SDK in your handler; authentication is handled by the SDK client.
|
|
76643
76647
|
|
|
76644
76648
|
SDK methods (client created via \`connection(connectionId)\`):
|
|
76645
76649
|
- \`client.request(path, init?)\` \u2014 low-level authenticated fetch
|
|
76646
|
-
- \`client.
|
|
76647
|
-
- \`client.
|
|
76648
|
-
- \`client.
|
|
76649
|
-
- \`client.getRecord(object, recordId)\`
|
|
76650
|
-
- \`client.queryListEntries(listId, options?)\`
|
|
76650
|
+
- \`client.self()\` \u2014 current API token introspection (GET /self) \u2014 returns workspace id, scopes, token status
|
|
76651
|
+
- Objects: \`client.listObjects()\`, \`client.getObject(object)\`, \`client.listObjectViews(object)\`
|
|
76652
|
+
- Attributes: \`client.listAttributes(object)\`, \`client.getAttribute(object, attribute)\`, \`client.listSelectOptions(object, attribute)\`, \`client.listStatuses(object, attribute)\`
|
|
76653
|
+
- Records: \`client.queryRecords(object, options?)\`, \`client.getRecord(object, recordId)\`, \`client.createRecord(object, data)\`, \`client.updateRecord(object, recordId, data)\` (PATCH), \`client.overwriteRecord(object, recordId, data)\` (PUT), \`client.deleteRecord(object, recordId)\`, \`client.assertRecord(object, data)\`, \`client.listRecordEntries(object, recordId)\`
|
|
76654
|
+
- Lists & entries: \`client.listLists()\`, \`client.getList(listId)\`, \`client.listListViews(listId)\`, \`client.queryListEntries(listId, options?)\`, \`client.getListEntry(listId, entryId)\`, \`client.createListEntry(listId, data)\`, \`client.updateListEntry(listId, entryId, data)\`, \`client.overwriteListEntry(listId, entryId, data)\`, \`client.deleteListEntry(listId, entryId)\`, \`client.assertListEntry(listId, data)\`
|
|
76655
|
+
- Workspace members: \`client.listWorkspaceMembers()\`, \`client.getWorkspaceMember(workspaceMemberId)\`, \`client.getWorkspaceMemberMap()\` (returns \`Map<workspace_member_id, { id, name, email }>\` \u2014 use to resolve \`owner\` / actor-reference fields to names)
|
|
76656
|
+
- Notes: \`client.listNotes(options?)\`, \`client.getNote(noteId)\`, \`client.createNote(data)\`, \`client.updateNote(noteId, data)\`, \`client.deleteNote(noteId)\`
|
|
76657
|
+
- Tasks: \`client.listTasks(options?)\`, \`client.getTask(taskId)\`, \`client.createTask(data)\`, \`client.updateTask(taskId, data)\`, \`client.deleteTask(taskId)\`
|
|
76658
|
+
- Threads & comments: \`client.listThreads(options?)\`, \`client.getThread(threadId)\`, \`client.createComment(data)\`, \`client.getComment(commentId)\`, \`client.updateComment(commentId, data)\`, \`client.deleteComment(commentId)\`
|
|
76659
|
+
- Webhooks: \`client.listWebhooks()\`, \`client.getWebhook(webhookId)\`, \`client.createWebhook(data)\`, \`client.updateWebhook(webhookId, data)\`, \`client.deleteWebhook(webhookId)\`
|
|
76660
|
+
- Meetings: \`client.listMeetings(options?)\`, \`client.getMeeting(meetingId)\`
|
|
76661
|
+
|
|
76662
|
+
### CRITICAL: Owner / Actor reference resolution
|
|
76663
|
+
|
|
76664
|
+
Fields like \`owner\` \u2014 and any \`actor-reference\` attribute \u2014 in Attio record \`values\` do **not** contain names. They carry actor IDs shaped like:
|
|
76665
|
+
\`\`\`json
|
|
76666
|
+
{ "referenced_actor_type": "workspace-member", "referenced_actor_id": "<workspace_member_id>" }
|
|
76667
|
+
\`\`\`
|
|
76668
|
+
Rendering that raw leaves opaque IDs in the UI (e.g. \`owner_name\` stays as a UUID). **Always** resolve these IDs to names before returning them. Do this by fetching workspace members once and joining on \`workspace_member_id\`.
|
|
76669
|
+
|
|
76670
|
+
- Use \`client.getWorkspaceMemberMap()\` \u2014 it returns a typed \`Map<workspace_member_id, { id, name, email }>\` ready to join with actor references.
|
|
76671
|
+
- The workspace-member endpoint is top-level: \`GET /workspace_members\`.
|
|
76672
|
+
- Fetch \`client.getWorkspaceMemberMap()\` in parallel with \`queryRecords\` via \`Promise.all\` (single fetch, joined in-memory).
|
|
76673
|
+
|
|
76674
|
+
Example \u2014 owner-based performance with names resolved:
|
|
76675
|
+
\`\`\`ts
|
|
76676
|
+
import type { Context } from "hono";
|
|
76677
|
+
import { connection } from "@squadbase/vite-server/connectors/attio";
|
|
76678
|
+
|
|
76679
|
+
const attio = connection("<connectionId>");
|
|
76680
|
+
|
|
76681
|
+
export default async function handler(c: Context) {
|
|
76682
|
+
const [{ data: deals }, memberMap] = await Promise.all([
|
|
76683
|
+
attio.queryRecords("deals", { limit: 500 }),
|
|
76684
|
+
attio.getWorkspaceMemberMap(),
|
|
76685
|
+
]);
|
|
76686
|
+
|
|
76687
|
+
const byOwner = new Map<string, { owner_name: string; count: number }>();
|
|
76688
|
+
for (const deal of deals) {
|
|
76689
|
+
const values = (deal as { values?: Record<string, unknown[]> }).values ?? {};
|
|
76690
|
+
const ownerCell = (values.owner ?? [])[0] as
|
|
76691
|
+
| { referenced_actor_id?: string }
|
|
76692
|
+
| undefined;
|
|
76693
|
+
const ownerId = ownerCell?.referenced_actor_id ?? "unassigned";
|
|
76694
|
+
const ownerName = memberMap.get(ownerId)?.name ?? "Unassigned";
|
|
76695
|
+
const prev = byOwner.get(ownerId) ?? { owner_name: ownerName, count: 0 };
|
|
76696
|
+
prev.count += 1;
|
|
76697
|
+
byOwner.set(ownerId, prev);
|
|
76698
|
+
}
|
|
76699
|
+
|
|
76700
|
+
return c.json({ rows: Array.from(byOwner.values()) });
|
|
76701
|
+
}
|
|
76702
|
+
\`\`\`
|
|
76703
|
+
|
|
76704
|
+
### Minimal example
|
|
76651
76705
|
|
|
76652
76706
|
\`\`\`ts
|
|
76653
76707
|
import type { Context } from "hono";
|
|
@@ -76672,39 +76726,129 @@ export default async function handler(c: Context) {
|
|
|
76672
76726
|
- Base URL: \`https://api.attio.com/v2\`
|
|
76673
76727
|
- Authentication: Bearer token (handled automatically)
|
|
76674
76728
|
- Querying records uses POST with JSON body (not GET with query params)
|
|
76675
|
-
|
|
76676
|
-
|
|
76677
|
-
|
|
76678
|
-
|
|
76679
|
-
-
|
|
76680
|
-
|
|
76681
|
-
|
|
76682
|
-
-
|
|
76683
|
-
-
|
|
76684
|
-
-
|
|
76685
|
-
-
|
|
76686
|
-
- GET \`/
|
|
76687
|
-
|
|
76688
|
-
|
|
76689
|
-
|
|
76690
|
-
|
|
76691
|
-
- \`
|
|
76692
|
-
- \`
|
|
76729
|
+
- Update semantics: PATCH appends multiselect values, PUT overwrites them
|
|
76730
|
+
- Many list endpoints support \`limit\` and \`offset\` for pagination
|
|
76731
|
+
|
|
76732
|
+
#### Meta
|
|
76733
|
+
- GET \`/self\` \u2014 current API token introspection (workspace id, scopes, token status)
|
|
76734
|
+
|
|
76735
|
+
#### Objects & Attributes
|
|
76736
|
+
- GET \`/objects\` \u2014 list all objects in the workspace (default: people, companies, deals; plus any custom objects configured)
|
|
76737
|
+
- GET \`/objects/{object}\` \u2014 get a single object
|
|
76738
|
+
- GET \`/objects/{object}/views\` \u2014 list views for an object
|
|
76739
|
+
- GET \`/objects/{object}/attributes\` \u2014 list attributes for an object
|
|
76740
|
+
- GET \`/objects/{object}/attributes/{attribute}\` \u2014 get an attribute
|
|
76741
|
+
- GET \`/objects/{object}/attributes/{attribute}/options\` \u2014 list select options
|
|
76742
|
+
- GET \`/objects/{object}/attributes/{attribute}/statuses\` \u2014 list statuses
|
|
76743
|
+
|
|
76744
|
+
#### Records
|
|
76745
|
+
- POST \`/objects/{object}/records/query\` \u2014 query records (filter / sorts / limit / offset)
|
|
76746
|
+
- GET \`/objects/{object}/records/{record_id}\` \u2014 get a record
|
|
76747
|
+
- POST \`/objects/{object}/records\` \u2014 create a record (body: \`{ "data": { ... } }\`)
|
|
76748
|
+
- PATCH \`/objects/{object}/records/{record_id}\` \u2014 update (append multiselect)
|
|
76749
|
+
- PUT \`/objects/{object}/records/{record_id}\` \u2014 update (overwrite multiselect)
|
|
76750
|
+
- DELETE \`/objects/{object}/records/{record_id}\` \u2014 delete a record
|
|
76751
|
+
- PUT \`/objects/{object}/records\` \u2014 assert (upsert) by matching attribute
|
|
76752
|
+
- GET \`/objects/{object}/records/{record_id}/entries\` \u2014 list list entries that reference the record
|
|
76753
|
+
|
|
76754
|
+
#### Lists & Entries
|
|
76755
|
+
- GET \`/lists\` \u2014 list all lists
|
|
76756
|
+
- GET \`/lists/{list_id}\` \u2014 get a list
|
|
76757
|
+
- GET \`/lists/{list_id}/views\` \u2014 list views for a list
|
|
76758
|
+
- POST \`/lists/{list_id}/entries/query\` \u2014 query list entries
|
|
76759
|
+
- GET \`/lists/{list_id}/entries/{entry_id}\` \u2014 get a list entry
|
|
76760
|
+
- POST \`/lists/{list_id}/entries\` \u2014 create an entry
|
|
76761
|
+
- PATCH \`/lists/{list_id}/entries/{entry_id}\` \u2014 update (append multiselect)
|
|
76762
|
+
- PUT \`/lists/{list_id}/entries/{entry_id}\` \u2014 update (overwrite multiselect)
|
|
76763
|
+
- DELETE \`/lists/{list_id}/entries/{entry_id}\` \u2014 delete an entry
|
|
76764
|
+
- PUT \`/lists/{list_id}/entries\` \u2014 assert (upsert) a list entry by parent
|
|
76765
|
+
|
|
76766
|
+
#### Workspace Members
|
|
76767
|
+
- GET \`/workspace_members\` \u2014 list every member of the workspace (team members, their roles, and access levels)
|
|
76768
|
+
- GET \`/workspace_members/{workspace_member_id}\` \u2014 get a single workspace member
|
|
76769
|
+
|
|
76770
|
+
#### Notes, Tasks, Threads & Comments
|
|
76771
|
+
- \`/notes\` (GET list, POST create) and \`/notes/{note_id}\` (GET / PATCH / DELETE). Filter list notes with \`?parent_object={object}&parent_record_id={id}\`.
|
|
76772
|
+
- \`/tasks\` (GET list, POST create) and \`/tasks/{task_id}\` (GET / PATCH / DELETE)
|
|
76773
|
+
- \`/threads\` (GET list) and \`/threads/{thread_id}\` (GET)
|
|
76774
|
+
- \`/comments\` (POST create) and \`/comments/{comment_id}\` (GET / PATCH / DELETE)
|
|
76775
|
+
|
|
76776
|
+
#### Webhooks
|
|
76777
|
+
- GET \`/webhooks\`, POST \`/webhooks\`, GET/PATCH/DELETE \`/webhooks/{webhook_id}\`
|
|
76778
|
+
|
|
76779
|
+
#### Meetings
|
|
76780
|
+
- GET \`/meetings\`, GET \`/meetings/{meeting_id}\`
|
|
76781
|
+
|
|
76782
|
+
#### Query Body (for POST /objects/{object}/records/query and /lists/{list_id}/entries/query)
|
|
76783
|
+
- \`filter\` \u2014 filter conditions
|
|
76784
|
+
- \`sorts\` \u2014 array of sort specifications
|
|
76785
|
+
- \`limit\` \u2014 max records per page (default 25)
|
|
76786
|
+
- \`offset\` \u2014 pagination offset`,
|
|
76693
76787
|
ja: `### \u30C4\u30FC\u30EB
|
|
76694
76788
|
|
|
76695
|
-
- \`attio_request\`: Attio REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EC\u30B3\u30FC\u30C9\uFF08people\u3001companies\u3001deals\
|
|
76789
|
+
- \`attio_request\`: Attio REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EC\u30B3\u30FC\u30C9\uFF08people\u3001companies\u3001deals\u3001\u304A\u3088\u3073\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u8A2D\u5B9A\u3055\u308C\u305F\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF09\u3068\u305D\u306E\u5C5E\u6027\u3001\u30EA\u30B9\u30C8\u3068\u30A8\u30F3\u30C8\u30EA\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30E1\u30F3\u30D0\u30FC\u3001\u30CE\u30FC\u30C8\u3001\u30BF\u30B9\u30AF\u3001\u30B9\u30EC\u30C3\u30C9\u3001\u30B3\u30E1\u30F3\u30C8\u3001Webhook\u3001\u30DF\u30FC\u30C6\u30A3\u30F3\u30B0\u306A\u3069\u3001\u3059\u3079\u3066\u306EAttio\u30EA\u30BD\u30FC\u30B9\u306E\u64CD\u4F5C\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Bearer\u30C8\u30FC\u30AF\u30F3\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30EC\u30B3\u30FC\u30C9\u306E\u30AF\u30A8\u30EA\u306B\u306F POST \`/objects/{object}/records/query\` \u3092\u30D5\u30A3\u30EB\u30BF\u4ED8\u304D\u306EJSON\u30DC\u30C7\u30A3\u3067\u4F7F\u7528\u3057\u307E\u3059\u3002\u90E8\u5206\u66F4\u65B0\uFF08multiselect\u306E\u8FFD\u52A0\uFF09\u306B\u306FPATCH\u3001\u5168\u7F6E\u63DB\uFF08multiselect\u306E\u4E0A\u66F8\u304D\uFF09\u306B\u306FPUT\u3092\u4F7F\u3044\u307E\u3059\u3002**\u5FC5\u305A** \u6700\u521D\u306B GET \`/objects\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u3053\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5B9F\u5728\u3059\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8slug\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
76696
76790
|
|
|
76697
76791
|
### Business Logic
|
|
76698
76792
|
|
|
76699
|
-
\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u306F\u30B3\u30CD\u30AF\u30BFSDK\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\
|
|
76793
|
+
\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u306F\u30B3\u30CD\u30AF\u30BFSDK\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u8A8D\u8A3C\u306FSDK\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u5074\u3067\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
76700
76794
|
|
|
76701
76795
|
SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
|
|
76702
76796
|
- \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304Dfetch
|
|
76703
|
-
- \`client.
|
|
76704
|
-
- \`client.
|
|
76705
|
-
- \`client.
|
|
76706
|
-
- \`client.getRecord(object, recordId)\`
|
|
76707
|
-
- \`client.queryListEntries(listId, options?)\`
|
|
76797
|
+
- \`client.identify()\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9/\u30C8\u30FC\u30AF\u30F3\u60C5\u5831\uFF08GET /meta/identify\uFF09
|
|
76798
|
+
- Objects: \`client.listObjects()\`, \`client.getObject(object)\`, \`client.listObjectViews(object)\`
|
|
76799
|
+
- Attributes: \`client.listAttributes(object)\`, \`client.getAttribute(object, attribute)\`, \`client.listSelectOptions(object, attribute)\`, \`client.listStatuses(object, attribute)\`
|
|
76800
|
+
- Records: \`client.queryRecords(object, options?)\`, \`client.getRecord(object, recordId)\`, \`client.createRecord(object, data)\`, \`client.updateRecord(object, recordId, data)\` (PATCH), \`client.overwriteRecord(object, recordId, data)\` (PUT), \`client.deleteRecord(object, recordId)\`, \`client.assertRecord(object, data)\`, \`client.listRecordEntries(object, recordId)\`
|
|
76801
|
+
- Lists & entries: \`client.listLists()\`, \`client.getList(listId)\`, \`client.listListViews(listId)\`, \`client.queryListEntries(listId, options?)\`, \`client.getListEntry(listId, entryId)\`, \`client.createListEntry(listId, data)\`, \`client.updateListEntry(listId, entryId, data)\`, \`client.overwriteListEntry(listId, entryId, data)\`, \`client.deleteListEntry(listId, entryId)\`, \`client.assertListEntry(listId, data)\`
|
|
76802
|
+
- Workspace members: \`client.listWorkspaceMembers()\`, \`client.getWorkspaceMember(workspaceMemberId)\`, \`client.getWorkspaceMemberMap()\` (returns \`Map<workspace_member_id, { id, name, email }>\` \u2014 use to resolve \`owner\` / actor-reference fields to names)
|
|
76803
|
+
- Notes: \`client.listNotes(options?)\`, \`client.getNote(noteId)\`, \`client.createNote(data)\`, \`client.updateNote(noteId, data)\`, \`client.deleteNote(noteId)\`
|
|
76804
|
+
- Tasks: \`client.listTasks(options?)\`, \`client.getTask(taskId)\`, \`client.createTask(data)\`, \`client.updateTask(taskId, data)\`, \`client.deleteTask(taskId)\`
|
|
76805
|
+
- Threads & comments: \`client.listThreads(options?)\`, \`client.getThread(threadId)\`, \`client.createComment(data)\`, \`client.getComment(commentId)\`, \`client.updateComment(commentId, data)\`, \`client.deleteComment(commentId)\`
|
|
76806
|
+
- Webhooks: \`client.listWebhooks()\`, \`client.getWebhook(webhookId)\`, \`client.createWebhook(data)\`, \`client.updateWebhook(webhookId, data)\`, \`client.deleteWebhook(webhookId)\`
|
|
76807
|
+
- Meetings: \`client.listMeetings(options?)\`, \`client.getMeeting(meetingId)\`
|
|
76808
|
+
|
|
76809
|
+
### \u91CD\u8981: Owner / Actor reference \u306E\u540D\u524D\u89E3\u6C7A
|
|
76810
|
+
|
|
76811
|
+
\u30EC\u30B3\u30FC\u30C9\u5024\u306E \`owner\`\uFF08\u304A\u3088\u3073 \`actor-reference\` \u578B\u306E\u5C5E\u6027\uFF09\u306F\u540D\u524D\u3067\u306F\u306A\u304F\u3001\u6B21\u306E\u3088\u3046\u306Aactor ID\u3092\u542B\u307F\u307E\u3059\uFF1A
|
|
76812
|
+
\`\`\`json
|
|
76813
|
+
{ "referenced_actor_type": "workspace-member", "referenced_actor_id": "<workspace_member_id>" }
|
|
76814
|
+
\`\`\`
|
|
76815
|
+
\u3053\u308C\u3092\u305D\u306E\u307E\u307E\u8FD4\u3059\u3068UI\u306B\u4E0D\u900F\u660E\u306AID\uFF08\`owner_name\` \u304CUUID\u306E\u307E\u307E\u7B49\uFF09\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002**\u5FC5\u305A** \u30CF\u30F3\u30C9\u30E9\u5185\u3067 \`workspace_member_id\` \u2192 \u540D\u524D\u3078\u89E3\u6C7A\u3057\u3066\u304B\u3089\u8FD4\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
76816
|
+
|
|
76817
|
+
- \u89E3\u6C7A\u306B\u306F \`client.getWorkspaceMemberMap()\` \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u3053\u308C\u306F \`Map<workspace_member_id, { id, name, email }>\` \u3092\u8FD4\u3057\u3001\u305D\u306E\u307E\u307Eactor reference\u3068\u7D50\u5408\u3067\u304D\u307E\u3059\u3002
|
|
76818
|
+
- \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30E1\u30F3\u30D0\u30FC\u306E\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306F\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u306E \`GET /workspace_members\` \u3067\u3059\u3002
|
|
76819
|
+
- \`queryRecords\` \u3068 \`getWorkspaceMemberMap\` \u306F \`Promise.all\` \u3067\u4E26\u5217\u53D6\u5F97\u3057\u3001\u30E1\u30E2\u30EA\u4E0A\u3067\u7D50\u5408\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u90FD\u5EA6\u53D6\u5F97\u305B\u305A\u4E00\u62EC\u53D6\u5F97\uFF09\u3002
|
|
76820
|
+
|
|
76821
|
+
\u4F8B \u2014 owner\u3054\u3068\u306E\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\uFF08\u540D\u524D\u89E3\u6C7A\u8FBC\u307F\uFF09:
|
|
76822
|
+
\`\`\`ts
|
|
76823
|
+
import type { Context } from "hono";
|
|
76824
|
+
import { connection } from "@squadbase/vite-server/connectors/attio";
|
|
76825
|
+
|
|
76826
|
+
const attio = connection("<connectionId>");
|
|
76827
|
+
|
|
76828
|
+
export default async function handler(c: Context) {
|
|
76829
|
+
const [{ data: deals }, memberMap] = await Promise.all([
|
|
76830
|
+
attio.queryRecords("deals", { limit: 500 }),
|
|
76831
|
+
attio.getWorkspaceMemberMap(),
|
|
76832
|
+
]);
|
|
76833
|
+
|
|
76834
|
+
const byOwner = new Map<string, { owner_name: string; count: number }>();
|
|
76835
|
+
for (const deal of deals) {
|
|
76836
|
+
const values = (deal as { values?: Record<string, unknown[]> }).values ?? {};
|
|
76837
|
+
const ownerCell = (values.owner ?? [])[0] as
|
|
76838
|
+
| { referenced_actor_id?: string }
|
|
76839
|
+
| undefined;
|
|
76840
|
+
const ownerId = ownerCell?.referenced_actor_id ?? "unassigned";
|
|
76841
|
+
const ownerName = memberMap.get(ownerId)?.name ?? "\u672A\u5272\u5F53";
|
|
76842
|
+
const prev = byOwner.get(ownerId) ?? { owner_name: ownerName, count: 0 };
|
|
76843
|
+
prev.count += 1;
|
|
76844
|
+
byOwner.set(ownerId, prev);
|
|
76845
|
+
}
|
|
76846
|
+
|
|
76847
|
+
return c.json({ rows: Array.from(byOwner.values()) });
|
|
76848
|
+
}
|
|
76849
|
+
\`\`\`
|
|
76850
|
+
|
|
76851
|
+
### \u6700\u5C0F\u30B5\u30F3\u30D7\u30EB
|
|
76708
76852
|
|
|
76709
76853
|
\`\`\`ts
|
|
76710
76854
|
import type { Context } from "hono";
|
|
@@ -76729,20 +76873,60 @@ export default async function handler(c: Context) {
|
|
|
76729
76873
|
- \u30D9\u30FC\u30B9URL: \`https://api.attio.com/v2\`
|
|
76730
76874
|
- \u8A8D\u8A3C: Bearer\u30C8\u30FC\u30AF\u30F3\uFF08\u81EA\u52D5\u8A2D\u5B9A\uFF09
|
|
76731
76875
|
- \u30EC\u30B3\u30FC\u30C9\u306E\u30AF\u30A8\u30EA\u306B\u306FGET\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u306F\u306A\u304FPOST\u3067JSON\u30DC\u30C7\u30A3\u3092\u4F7F\u7528\u3057\u307E\u3059
|
|
76876
|
+
- \u66F4\u65B0\u30BB\u30DE\u30F3\u30C6\u30A3\u30AF\u30B9: PATCH\u306Fmultiselect\u5024\u3092\u8FFD\u52A0\u3001PUT\u306F\u4E0A\u66F8\u304D
|
|
76877
|
+
- \u591A\u304F\u306E\u4E00\u89A7\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306F \`limit\` \u3068 \`offset\` \u306B\u3088\u308B\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u3092\u30B5\u30DD\u30FC\u30C8
|
|
76732
76878
|
|
|
76733
|
-
####
|
|
76734
|
-
- GET \`/
|
|
76879
|
+
#### Meta
|
|
76880
|
+
- GET \`/self\` \u2014 \u73FE\u5728\u306EAPI\u30C8\u30FC\u30AF\u30F3\u306E\u60C5\u5831\uFF08workspace id / scopes / \u6709\u52B9\u72B6\u614B\uFF09
|
|
76881
|
+
|
|
76882
|
+
#### Objects & Attributes
|
|
76883
|
+
- GET \`/objects\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306E\u5168\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8\u306F people / companies / deals\u3001\u52A0\u3048\u3066\u8A2D\u5B9A\u6E08\u307F\u306E\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF09
|
|
76884
|
+
- GET \`/objects/{object}\` \u2014 \u5358\u4E00\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u53D6\u5F97
|
|
76885
|
+
- GET \`/objects/{object}/views\` \u2014 \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30D3\u30E5\u30FC\u4E00\u89A7
|
|
76735
76886
|
- GET \`/objects/{object}/attributes\` \u2014 \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u5C5E\u6027\u4E00\u89A7
|
|
76736
|
-
-
|
|
76887
|
+
- GET \`/objects/{object}/attributes/{attribute}\` \u2014 \u5C5E\u6027\u306E\u53D6\u5F97
|
|
76888
|
+
- GET \`/objects/{object}/attributes/{attribute}/options\` \u2014 \u30BB\u30EC\u30AF\u30C8\u9078\u629E\u80A2\u306E\u4E00\u89A7
|
|
76889
|
+
- GET \`/objects/{object}/attributes/{attribute}/statuses\` \u2014 \u30B9\u30C6\u30FC\u30BF\u30B9\u4E00\u89A7
|
|
76890
|
+
|
|
76891
|
+
#### Records
|
|
76892
|
+
- POST \`/objects/{object}/records/query\` \u2014 \u30EC\u30B3\u30FC\u30C9\u306E\u691C\u7D22\uFF08filter / sorts / limit / offset\uFF09
|
|
76737
76893
|
- GET \`/objects/{object}/records/{record_id}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u306E\u53D6\u5F97
|
|
76738
|
-
- POST \`/objects/{object}/records\` \u2014 \u30EC\u30B3\u30FC\u30C9\u306E\u4F5C\u6210
|
|
76739
|
-
- PATCH \`/objects/{object}/records/{record_id}\` \u2014 \
|
|
76894
|
+
- POST \`/objects/{object}/records\` \u2014 \u30EC\u30B3\u30FC\u30C9\u306E\u4F5C\u6210\uFF08body: \`{ "data": { ... } }\`\uFF09
|
|
76895
|
+
- PATCH \`/objects/{object}/records/{record_id}\` \u2014 \u66F4\u65B0\uFF08multiselect\u8FFD\u52A0\uFF09
|
|
76896
|
+
- PUT \`/objects/{object}/records/{record_id}\` \u2014 \u66F4\u65B0\uFF08multiselect\u4E0A\u66F8\u304D\uFF09
|
|
76740
76897
|
- DELETE \`/objects/{object}/records/{record_id}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u306E\u524A\u9664
|
|
76741
|
-
-
|
|
76742
|
-
-
|
|
76743
|
-
- GET \`/notes?parent_object={object}&parent_record_id={id}\` \u2014 \u30EC\u30B3\u30FC\u30C9\u306E\u30CE\u30FC\u30C8\u3092\u53D6\u5F97
|
|
76898
|
+
- PUT \`/objects/{object}/records\` \u2014 \u4E00\u81F4\u5C5E\u6027\u306B\u3088\u308B\u30A2\u30B5\u30FC\u30C8\uFF08upsert\uFF09
|
|
76899
|
+
- GET \`/objects/{object}/records/{record_id}/entries\` \u2014 \u30EC\u30B3\u30FC\u30C9\u3092\u53C2\u7167\u3059\u308B\u30EA\u30B9\u30C8\u30A8\u30F3\u30C8\u30EA\u4E00\u89A7
|
|
76744
76900
|
|
|
76745
|
-
####
|
|
76901
|
+
#### Lists & Entries
|
|
76902
|
+
- GET \`/lists\` \u2014 \u30EA\u30B9\u30C8\u4E00\u89A7
|
|
76903
|
+
- GET \`/lists/{list_id}\` \u2014 \u30EA\u30B9\u30C8\u306E\u53D6\u5F97
|
|
76904
|
+
- GET \`/lists/{list_id}/views\` \u2014 \u30EA\u30B9\u30C8\u306E\u30D3\u30E5\u30FC\u4E00\u89A7
|
|
76905
|
+
- POST \`/lists/{list_id}/entries/query\` \u2014 \u30EA\u30B9\u30C8\u30A8\u30F3\u30C8\u30EA\u306E\u691C\u7D22
|
|
76906
|
+
- GET \`/lists/{list_id}/entries/{entry_id}\` \u2014 \u30EA\u30B9\u30C8\u30A8\u30F3\u30C8\u30EA\u306E\u53D6\u5F97
|
|
76907
|
+
- POST \`/lists/{list_id}/entries\` \u2014 \u30A8\u30F3\u30C8\u30EA\u4F5C\u6210
|
|
76908
|
+
- PATCH \`/lists/{list_id}/entries/{entry_id}\` \u2014 \u66F4\u65B0\uFF08multiselect\u8FFD\u52A0\uFF09
|
|
76909
|
+
- PUT \`/lists/{list_id}/entries/{entry_id}\` \u2014 \u66F4\u65B0\uFF08multiselect\u4E0A\u66F8\u304D\uFF09
|
|
76910
|
+
- DELETE \`/lists/{list_id}/entries/{entry_id}\` \u2014 \u30A8\u30F3\u30C8\u30EA\u524A\u9664
|
|
76911
|
+
- PUT \`/lists/{list_id}/entries\` \u2014 \u89AA\u30EC\u30B3\u30FC\u30C9\u306B\u3088\u308B\u30A2\u30B5\u30FC\u30C8\uFF08upsert\uFF09
|
|
76912
|
+
|
|
76913
|
+
#### Workspace Members\uFF08\u30C1\u30FC\u30E0\u30E1\u30F3\u30D0\u30FC\uFF09
|
|
76914
|
+
- GET \`/workspace_members\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306E\u5168\u30E1\u30F3\u30D0\u30FC\u4E00\u89A7\uFF08\u30ED\u30FC\u30EB\u3084\u30A2\u30AF\u30BB\u30B9\u30EC\u30D9\u30EB\u3092\u542B\u3080\uFF09
|
|
76915
|
+
- GET \`/workspace_members/{workspace_member_id}\` \u2014 \u5358\u4E00\u30E1\u30F3\u30D0\u30FC\u306E\u53D6\u5F97
|
|
76916
|
+
|
|
76917
|
+
#### Notes, Tasks, Threads & Comments
|
|
76918
|
+
- \`/notes\`\uFF08GET \u4E00\u89A7 / POST \u4F5C\u6210\uFF09\u3001\`/notes/{note_id}\`\uFF08GET / PATCH / DELETE\uFF09\u3002\u4E00\u89A7\u306F \`?parent_object={object}&parent_record_id={id}\` \u3067\u7D5E\u308A\u8FBC\u307F\u53EF\u80FD
|
|
76919
|
+
- \`/tasks\`\uFF08GET \u4E00\u89A7 / POST \u4F5C\u6210\uFF09\u3001\`/tasks/{task_id}\`\uFF08GET / PATCH / DELETE\uFF09
|
|
76920
|
+
- \`/threads\`\uFF08GET \u4E00\u89A7\uFF09\u3001\`/threads/{thread_id}\`\uFF08GET\uFF09
|
|
76921
|
+
- \`/comments\`\uFF08POST \u4F5C\u6210\uFF09\u3001\`/comments/{comment_id}\`\uFF08GET / PATCH / DELETE\uFF09
|
|
76922
|
+
|
|
76923
|
+
#### Webhooks
|
|
76924
|
+
- GET \`/webhooks\`\u3001POST \`/webhooks\`\u3001GET/PATCH/DELETE \`/webhooks/{webhook_id}\`
|
|
76925
|
+
|
|
76926
|
+
#### Meetings
|
|
76927
|
+
- GET \`/meetings\`\u3001GET \`/meetings/{meeting_id}\`
|
|
76928
|
+
|
|
76929
|
+
#### \u30AF\u30A8\u30EA\u30DC\u30C7\u30A3 (POST /objects/{object}/records/query \u304A\u3088\u3073 /lists/{list_id}/entries/query)
|
|
76746
76930
|
- \`filter\` \u2014 \u30D5\u30A3\u30EB\u30BF\u6761\u4EF6
|
|
76747
76931
|
- \`sorts\` \u2014 \u30BD\u30FC\u30C8\u6307\u5B9A\u306E\u914D\u5217
|
|
76748
76932
|
- \`limit\` \u2014 \u30DA\u30FC\u30B8\u3042\u305F\u308A\u306E\u6700\u5927\u30EC\u30B3\u30FC\u30C9\u6570\uFF08\u30C7\u30D5\u30A9\u30EB\u30C825\uFF09
|
|
@@ -82069,9 +82253,9 @@ var gmailOnboarding = new ConnectorOnboarding({
|
|
|
82069
82253
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Gmail\uFF08\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\uFF09\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u63A5\u7D9A\u4F5C\u6210\u6642\u306B\u306F\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8JSON\u306E\u307F\u304C\u8A2D\u5B9A\u6E08\u307F\u3067\u3001\u59D4\u4EFB\u5BFE\u8C61\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3053\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
82070
82254
|
|
|
82071
82255
|
1. \`askUserQuestion\` \u3067\u3001\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u304CDomain-wide Delegation\u3067\u4EE3\u7406\u30A2\u30AF\u30BB\u30B9\u3059\u308BGoogle Workspace\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u30D2\u30A2\u30EA\u30F3\u30B0\u3059\u308B:
|
|
82256
|
+
- \`type\`: \`"freeText"\`
|
|
82072
82257
|
- \`question\`: \u300CGmail\u3092\u53C2\u7167\u3059\u308BGoogle Workspace\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u300D
|
|
82073
|
-
- \`
|
|
82074
|
-
- \`options\`: \`[{ label: "\u4F8B: user@example.com", description: "\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u4EE3\u7406\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B" }, { label: "\u5225\u306E\u4F8B: admin@example.com", description: "\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u3084\u5171\u6709\u30E1\u30FC\u30EB\u30DC\u30C3\u30AF\u30B9\u306E\u30A2\u30C9\u30EC\u30B9\u3067\u3082\u53EF" }]\` \uFF08\`allowFreeText: true\` \u306E\u305F\u3081\u81EA\u7531\u5165\u529B\u53EF\uFF09
|
|
82258
|
+
- \`placeholder\`: \`"user@example.com"\`
|
|
82075
82259
|
2. \u53D7\u3051\u53D6\u3063\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`updateConnectionParameters\` \u3067\u4FDD\u5B58\u3059\u308B:
|
|
82076
82260
|
- \`parameterSlug\`: \`"delegated-user-email"\`
|
|
82077
82261
|
- \`options\`: \`[{ value: <\u5165\u529B\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9>, label: <\u540C\u3058\u5024> }]\`\uFF081\u4EF6\u306E\u307F\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u81EA\u52D5\u9078\u629E\u3055\u308C\u308B\uFF09
|
|
@@ -82096,9 +82280,9 @@ var gmailOnboarding = new ConnectorOnboarding({
|
|
|
82096
82280
|
en: `Follow these steps to set up the Gmail (Service Account) connection. Only the service account JSON is provided at connection creation time \u2014 the delegated user email is collected during this setup flow.
|
|
82097
82281
|
|
|
82098
82282
|
1. Call \`askUserQuestion\` to ask the user for the Google Workspace user email the service account will impersonate via Domain-wide Delegation:
|
|
82283
|
+
- \`type\`: \`"freeText"\`
|
|
82099
82284
|
- \`question\`: "Please enter the email address of the Google Workspace user whose Gmail mailbox you want to access"
|
|
82100
|
-
- \`
|
|
82101
|
-
- \`options\`: \`[{ label: "e.g., user@example.com", description: "The user whose mailbox the service account will impersonate" }, { label: "e.g., admin@example.com", description: "An admin user or shared mailbox is also fine" }]\` (free text entry is allowed because \`allowFreeText: true\`)
|
|
82285
|
+
- \`placeholder\`: \`"user@example.com"\`
|
|
82102
82286
|
2. Save the email via \`updateConnectionParameters\`:
|
|
82103
82287
|
- \`parameterSlug\`: \`"delegated-user-email"\`
|
|
82104
82288
|
- \`options\`: \`[{ value: <entered email>, label: <same value> }]\` (a single option is auto-selected)
|
|
@@ -86277,6 +86461,14 @@ function resolveEnvVarOptional(entry, key) {
|
|
|
86277
86461
|
import { getContext } from "hono/context-storage";
|
|
86278
86462
|
import { getCookie } from "hono/cookie";
|
|
86279
86463
|
var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
|
|
86464
|
+
function normalizeHeaders(input) {
|
|
86465
|
+
const out = {};
|
|
86466
|
+
if (!input) return out;
|
|
86467
|
+
new Headers(input).forEach((value, key) => {
|
|
86468
|
+
out[key] = value;
|
|
86469
|
+
});
|
|
86470
|
+
return out;
|
|
86471
|
+
}
|
|
86280
86472
|
function createSandboxProxyFetch(connectionId) {
|
|
86281
86473
|
return async (input, init) => {
|
|
86282
86474
|
const token = process.env.INTERNAL_SQUADBASE_OAUTH_MACHINE_CREDENTIAL;
|
|
@@ -86300,6 +86492,7 @@ function createSandboxProxyFetch(connectionId) {
|
|
|
86300
86492
|
body: JSON.stringify({
|
|
86301
86493
|
url: originalUrl,
|
|
86302
86494
|
method: originalMethod,
|
|
86495
|
+
headers: normalizeHeaders(init?.headers),
|
|
86303
86496
|
body: originalBody
|
|
86304
86497
|
})
|
|
86305
86498
|
});
|
|
@@ -86334,6 +86527,7 @@ function createDeployedAppProxyFetch(connectionId) {
|
|
|
86334
86527
|
body: JSON.stringify({
|
|
86335
86528
|
url: originalUrl,
|
|
86336
86529
|
method: originalMethod,
|
|
86530
|
+
headers: normalizeHeaders(init?.headers),
|
|
86337
86531
|
body: originalBody
|
|
86338
86532
|
})
|
|
86339
86533
|
});
|
|
@@ -555,6 +555,14 @@ function resolveEnvVarOptional(entry, key) {
|
|
|
555
555
|
import { getContext } from "hono/context-storage";
|
|
556
556
|
import { getCookie } from "hono/cookie";
|
|
557
557
|
var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
|
|
558
|
+
function normalizeHeaders(input) {
|
|
559
|
+
const out = {};
|
|
560
|
+
if (!input) return out;
|
|
561
|
+
new Headers(input).forEach((value, key) => {
|
|
562
|
+
out[key] = value;
|
|
563
|
+
});
|
|
564
|
+
return out;
|
|
565
|
+
}
|
|
558
566
|
function createSandboxProxyFetch(connectionId) {
|
|
559
567
|
return async (input, init) => {
|
|
560
568
|
const token = process.env.INTERNAL_SQUADBASE_OAUTH_MACHINE_CREDENTIAL;
|
|
@@ -578,6 +586,7 @@ function createSandboxProxyFetch(connectionId) {
|
|
|
578
586
|
body: JSON.stringify({
|
|
579
587
|
url: originalUrl,
|
|
580
588
|
method: originalMethod,
|
|
589
|
+
headers: normalizeHeaders(init?.headers),
|
|
581
590
|
body: originalBody
|
|
582
591
|
})
|
|
583
592
|
});
|
|
@@ -612,6 +621,7 @@ function createDeployedAppProxyFetch(connectionId) {
|
|
|
612
621
|
body: JSON.stringify({
|
|
613
622
|
url: originalUrl,
|
|
614
623
|
method: originalMethod,
|
|
624
|
+
headers: normalizeHeaders(init?.headers),
|
|
615
625
|
body: originalBody
|
|
616
626
|
})
|
|
617
627
|
});
|
|
@@ -585,6 +585,14 @@ function resolveEnvVarOptional(entry, key) {
|
|
|
585
585
|
import { getContext } from "hono/context-storage";
|
|
586
586
|
import { getCookie } from "hono/cookie";
|
|
587
587
|
var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
|
|
588
|
+
function normalizeHeaders(input) {
|
|
589
|
+
const out = {};
|
|
590
|
+
if (!input) return out;
|
|
591
|
+
new Headers(input).forEach((value, key) => {
|
|
592
|
+
out[key] = value;
|
|
593
|
+
});
|
|
594
|
+
return out;
|
|
595
|
+
}
|
|
588
596
|
function createSandboxProxyFetch(connectionId) {
|
|
589
597
|
return async (input, init) => {
|
|
590
598
|
const token = process.env.INTERNAL_SQUADBASE_OAUTH_MACHINE_CREDENTIAL;
|
|
@@ -608,6 +616,7 @@ function createSandboxProxyFetch(connectionId) {
|
|
|
608
616
|
body: JSON.stringify({
|
|
609
617
|
url: originalUrl,
|
|
610
618
|
method: originalMethod,
|
|
619
|
+
headers: normalizeHeaders(init?.headers),
|
|
611
620
|
body: originalBody
|
|
612
621
|
})
|
|
613
622
|
});
|
|
@@ -642,6 +651,7 @@ function createDeployedAppProxyFetch(connectionId) {
|
|
|
642
651
|
body: JSON.stringify({
|
|
643
652
|
url: originalUrl,
|
|
644
653
|
method: originalMethod,
|
|
654
|
+
headers: normalizeHeaders(init?.headers),
|
|
645
655
|
body: originalBody
|
|
646
656
|
})
|
|
647
657
|
});
|
|
@@ -576,6 +576,14 @@ function resolveEnvVarOptional(entry, key) {
|
|
|
576
576
|
import { getContext } from "hono/context-storage";
|
|
577
577
|
import { getCookie } from "hono/cookie";
|
|
578
578
|
var APP_SESSION_COOKIE_NAME = "__Host-squadbase-session";
|
|
579
|
+
function normalizeHeaders(input) {
|
|
580
|
+
const out = {};
|
|
581
|
+
if (!input) return out;
|
|
582
|
+
new Headers(input).forEach((value, key) => {
|
|
583
|
+
out[key] = value;
|
|
584
|
+
});
|
|
585
|
+
return out;
|
|
586
|
+
}
|
|
579
587
|
function createSandboxProxyFetch(connectionId) {
|
|
580
588
|
return async (input, init) => {
|
|
581
589
|
const token = process.env.INTERNAL_SQUADBASE_OAUTH_MACHINE_CREDENTIAL;
|
|
@@ -599,6 +607,7 @@ function createSandboxProxyFetch(connectionId) {
|
|
|
599
607
|
body: JSON.stringify({
|
|
600
608
|
url: originalUrl,
|
|
601
609
|
method: originalMethod,
|
|
610
|
+
headers: normalizeHeaders(init?.headers),
|
|
602
611
|
body: originalBody
|
|
603
612
|
})
|
|
604
613
|
});
|
|
@@ -633,6 +642,7 @@ function createDeployedAppProxyFetch(connectionId) {
|
|
|
633
642
|
body: JSON.stringify({
|
|
634
643
|
url: originalUrl,
|
|
635
644
|
method: originalMethod,
|
|
645
|
+
headers: normalizeHeaders(init?.headers),
|
|
636
646
|
body: originalBody
|
|
637
647
|
})
|
|
638
648
|
});
|