@squadbase/vite-server 0.1.3-dev.10 → 0.1.3-dev.12

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/main.js CHANGED
@@ -18892,14 +18892,14 @@ var init_NormalizedSchema = __esm({
18892
18892
  throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
18893
18893
  }
18894
18894
  const struct = this.getSchema();
18895
- const z77 = struct[4].length;
18895
+ const z80 = struct[4].length;
18896
18896
  let it = struct[anno.it];
18897
- if (it && z77 === it.length) {
18897
+ if (it && z80 === it.length) {
18898
18898
  yield* it;
18899
18899
  return;
18900
18900
  }
18901
- it = Array(z77);
18902
- for (let i6 = 0; i6 < z77; ++i6) {
18901
+ it = Array(z80);
18902
+ for (let i6 = 0; i6 < z80; ++i6) {
18903
18903
  const k6 = struct[4][i6];
18904
18904
  const v7 = member([struct[5][i6], 0], k6);
18905
18905
  yield it[i6] = [k6, v7];
@@ -19575,12 +19575,12 @@ var init_split_header = __esm({
19575
19575
  "../../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js"() {
19576
19576
  "use strict";
19577
19577
  splitHeader = (value) => {
19578
- const z77 = value.length;
19578
+ const z80 = value.length;
19579
19579
  const values = [];
19580
19580
  let withinQuotes = false;
19581
19581
  let prevChar = void 0;
19582
19582
  let anchor = 0;
19583
- for (let i6 = 0; i6 < z77; ++i6) {
19583
+ for (let i6 = 0; i6 < z80; ++i6) {
19584
19584
  const char = value[i6];
19585
19585
  switch (char) {
19586
19586
  case `"`:
@@ -19601,12 +19601,12 @@ var init_split_header = __esm({
19601
19601
  values.push(value.slice(anchor));
19602
19602
  return values.map((v7) => {
19603
19603
  v7 = v7.trim();
19604
- const z78 = v7.length;
19605
- if (z78 < 2) {
19604
+ const z81 = v7.length;
19605
+ if (z81 < 2) {
19606
19606
  return v7;
19607
19607
  }
19608
- if (v7[0] === `"` && v7[z78 - 1] === `"`) {
19609
- v7 = v7.slice(1, z78 - 1);
19608
+ if (v7[0] === `"` && v7[z81 - 1] === `"`) {
19609
+ v7 = v7.slice(1, z81 - 1);
19610
19610
  }
19611
19611
  return v7.replace(/\\"/g, '"');
19612
19612
  });
@@ -21004,11 +21004,11 @@ var init_EndpointCache = __esm({
21004
21004
  }
21005
21005
  hash(endpointParams) {
21006
21006
  let buffer = "";
21007
- const { parameters: parameters60 } = this;
21008
- if (parameters60.length === 0) {
21007
+ const { parameters: parameters62 } = this;
21008
+ if (parameters62.length === 0) {
21009
21009
  return false;
21010
21010
  }
21011
- for (const param of parameters60) {
21011
+ for (const param of parameters62) {
21012
21012
  const val = String(endpointParams[param] ?? "");
21013
21013
  if (val.includes("|;")) {
21014
21014
  return false;
@@ -21725,15 +21725,15 @@ var init_resolveEndpoint = __esm({
21725
21725
  init_utils3();
21726
21726
  resolveEndpoint = (ruleSetObject, options) => {
21727
21727
  const { endpointParams, logger: logger2 } = options;
21728
- const { parameters: parameters60, rules } = ruleSetObject;
21728
+ const { parameters: parameters62, rules } = ruleSetObject;
21729
21729
  options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
21730
- const paramsWithDefault = Object.entries(parameters60).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]);
21730
+ const paramsWithDefault = Object.entries(parameters62).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]);
21731
21731
  if (paramsWithDefault.length > 0) {
21732
21732
  for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
21733
21733
  endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
21734
21734
  }
21735
21735
  }
21736
- const requiredParams = Object.entries(parameters60).filter(([, v7]) => v7.required).map(([k6]) => k6);
21736
+ const requiredParams = Object.entries(parameters62).filter(([, v7]) => v7.required).map(([k6]) => k6);
21737
21737
  for (const requiredParam of requiredParams) {
21738
21738
  if (endpointParams[requiredParam] == null) {
21739
21739
  throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
@@ -27343,8 +27343,8 @@ var init_ProtocolLib = __esm({
27343
27343
  constructor(queryCompat = false) {
27344
27344
  this.queryCompat = queryCompat;
27345
27345
  }
27346
- resolveRestContentType(defaultContentType, inputSchema74) {
27347
- const members = inputSchema74.getMemberSchemas();
27346
+ resolveRestContentType(defaultContentType, inputSchema77) {
27347
+ const members = inputSchema77.getMemberSchemas();
27348
27348
  const httpPayloadMember = Object.values(members).find((m6) => {
27349
27349
  return !!m6.getMergedTraits().httpPayload;
27350
27350
  });
@@ -27359,7 +27359,7 @@ var init_ProtocolLib = __esm({
27359
27359
  } else {
27360
27360
  return defaultContentType;
27361
27361
  }
27362
- } else if (!inputSchema74.isUnitSchema()) {
27362
+ } else if (!inputSchema77.isUnitSchema()) {
27363
27363
  const hasBody = Object.values(members).find((m6) => {
27364
27364
  const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m6.getMergedTraits();
27365
27365
  const noPrefixHeaders = httpPrefixHeaders === void 0;
@@ -28202,9 +28202,9 @@ var init_AwsRestJsonProtocol = __esm({
28202
28202
  }
28203
28203
  async serializeRequest(operationSchema, input, context) {
28204
28204
  const request2 = await super.serializeRequest(operationSchema, input, context);
28205
- const inputSchema74 = NormalizedSchema.of(operationSchema.input);
28205
+ const inputSchema77 = NormalizedSchema.of(operationSchema.input);
28206
28206
  if (!request2.headers["content-type"]) {
28207
- const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema74);
28207
+ const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema77);
28208
28208
  if (contentType) {
28209
28209
  request2.headers["content-type"] = contentType;
28210
28210
  }
@@ -28216,8 +28216,8 @@ var init_AwsRestJsonProtocol = __esm({
28216
28216
  }
28217
28217
  async deserializeResponse(operationSchema, context, response) {
28218
28218
  const output = await super.deserializeResponse(operationSchema, context, response);
28219
- const outputSchema74 = NormalizedSchema.of(operationSchema.output);
28220
- for (const [name, member2] of outputSchema74.structIterator()) {
28219
+ const outputSchema77 = NormalizedSchema.of(operationSchema.output);
28220
+ for (const [name, member2] of outputSchema77.structIterator()) {
28221
28221
  if (member2.getMemberTraits().httpPayload && !(name in output)) {
28222
28222
  output[name] = null;
28223
28223
  }
@@ -32081,22 +32081,22 @@ var init_loadCognitoIdentity = __esm({
32081
32081
  });
32082
32082
 
32083
32083
  // ../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js
32084
- function fromCognitoIdentity(parameters60) {
32084
+ function fromCognitoIdentity(parameters62) {
32085
32085
  return async (awsIdentityProperties) => {
32086
- parameters60.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
32086
+ parameters62.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
32087
32087
  const { GetCredentialsForIdentityCommand: GetCredentialsForIdentityCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
32088
- const fromConfigs = (property) => parameters60.clientConfig?.[property] ?? parameters60.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
32089
- const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters60.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters60.logger), SessionToken } = throwOnMissingCredentials(parameters60.logger) } = await (parameters60.client ?? new CognitoIdentityClient2(Object.assign({}, parameters60.clientConfig ?? {}, {
32088
+ const fromConfigs = (property) => parameters62.clientConfig?.[property] ?? parameters62.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
32089
+ const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters62.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters62.logger), SessionToken } = throwOnMissingCredentials(parameters62.logger) } = await (parameters62.client ?? new CognitoIdentityClient2(Object.assign({}, parameters62.clientConfig ?? {}, {
32090
32090
  region: fromConfigs("region"),
32091
32091
  profile: fromConfigs("profile"),
32092
32092
  userAgentAppId: fromConfigs("userAgentAppId")
32093
32093
  }))).send(new GetCredentialsForIdentityCommand2({
32094
- CustomRoleArn: parameters60.customRoleArn,
32095
- IdentityId: parameters60.identityId,
32096
- Logins: parameters60.logins ? await resolveLogins(parameters60.logins) : void 0
32094
+ CustomRoleArn: parameters62.customRoleArn,
32095
+ IdentityId: parameters62.identityId,
32096
+ Logins: parameters62.logins ? await resolveLogins(parameters62.logins) : void 0
32097
32097
  }));
32098
32098
  return {
32099
- identityId: parameters60.identityId,
32099
+ identityId: parameters62.identityId,
32100
32100
  accessKeyId: AccessKeyId,
32101
32101
  secretAccessKey: SecretKey,
32102
32102
  sessionToken: SessionToken,
@@ -44657,11 +44657,11 @@ var require_bignumber = __commonJS({
44657
44657
  return n6 > 0 || n6 === i6 ? i6 : i6 - 1;
44658
44658
  }
44659
44659
  function coeffToString(a6) {
44660
- var s6, z77, i6 = 1, j6 = a6.length, r6 = a6[0] + "";
44660
+ var s6, z80, i6 = 1, j6 = a6.length, r6 = a6[0] + "";
44661
44661
  for (; i6 < j6; ) {
44662
44662
  s6 = a6[i6++] + "";
44663
- z77 = LOG_BASE - s6.length;
44664
- for (; z77--; s6 = "0" + s6) ;
44663
+ z80 = LOG_BASE - s6.length;
44664
+ for (; z80--; s6 = "0" + s6) ;
44665
44665
  r6 += s6;
44666
44666
  }
44667
44667
  for (j6 = r6.length; r6.charCodeAt(--j6) === 48; ) ;
@@ -44694,15 +44694,15 @@ var require_bignumber = __commonJS({
44694
44694
  function toExponential(str, e6) {
44695
44695
  return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e6 < 0 ? "e" : "e+") + e6;
44696
44696
  }
44697
- function toFixedPoint(str, e6, z77) {
44697
+ function toFixedPoint(str, e6, z80) {
44698
44698
  var len, zs;
44699
44699
  if (e6 < 0) {
44700
- for (zs = z77 + "."; ++e6; zs += z77) ;
44700
+ for (zs = z80 + "."; ++e6; zs += z80) ;
44701
44701
  str = zs + str;
44702
44702
  } else {
44703
44703
  len = str.length;
44704
44704
  if (++e6 > len) {
44705
- for (zs = z77, e6 -= len; --e6; zs += z77) ;
44705
+ for (zs = z80, e6 -= len; --e6; zs += z80) ;
44706
44706
  str += zs;
44707
44707
  } else if (e6 < len) {
44708
44708
  str = str.slice(0, e6) + "." + str.slice(e6);
@@ -73565,7 +73565,9 @@ Use this tool for all Stripe API interactions: querying charges, customers, invo
73565
73565
  if (body) {
73566
73566
  headers["Content-Type"] = "application/x-www-form-urlencoded";
73567
73567
  requestBody = new URLSearchParams(
73568
- Object.entries(body).map(([k6, v7]) => [k6, String(v7)])
73568
+ Object.entries(body).map(
73569
+ ([k6, v7]) => [k6, String(v7)]
73570
+ )
73569
73571
  ).toString();
73570
73572
  }
73571
73573
  const response = await fetch(url, {
@@ -85351,6 +85353,714 @@ export default async function handler(c: Context) {
85351
85353
  tools: tools59
85352
85354
  });
85353
85355
 
85356
+ // ../connectors/src/connectors/backlog/setup.ts
85357
+ var backlogOnboarding = new ConnectorOnboarding({
85358
+ dataOverviewInstructions: {
85359
+ en: `1. Call backlog-api-key_request with GET space to verify the connection and get space information
85360
+ 2. Call backlog-api-key_request with GET projects to list all accessible projects
85361
+ 3. For key projects, call backlog-api-key_request with GET issues?projectId[]={projectId}&count=5&order=desc to retrieve recent issues
85362
+ 4. Call backlog-api-key_request with GET projects/{projectIdOrKey}/statuses to understand the workflow statuses`,
85363
+ ja: `1. backlog-api-key_request \u3067 GET space \u3092\u547C\u3073\u51FA\u3057\u3001\u63A5\u7D9A\u78BA\u8A8D\u3068\u30B9\u30DA\u30FC\u30B9\u60C5\u5831\u3092\u53D6\u5F97
85364
+ 2. backlog-api-key_request \u3067 GET projects \u3092\u547C\u3073\u51FA\u3057\u3001\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
85365
+ 3. \u4E3B\u8981\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u3064\u3044\u3066 backlog-api-key_request \u3067 GET issues?projectId[]={projectId}&count=5&order=desc \u3092\u547C\u3073\u51FA\u3057\u3001\u6700\u8FD1\u306E\u8AB2\u984C\u3092\u53D6\u5F97
85366
+ 4. backlog-api-key_request \u3067 GET projects/{projectIdOrKey}/statuses \u3092\u547C\u3073\u51FA\u3057\u3001\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u306E\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u78BA\u8A8D`
85367
+ }
85368
+ });
85369
+
85370
+ // ../connectors/src/connectors/backlog/parameters.ts
85371
+ var parameters60 = {
85372
+ spaceUrl: new ParameterDefinition({
85373
+ slug: "space-url",
85374
+ name: "Backlog Space URL",
85375
+ description: "Your Backlog space URL \u2014 just the base address, without any trailing path. For example: https://your-space.backlog.com or https://your-space.backlog.jp",
85376
+ envVarBaseKey: "BACKLOG_SPACE_URL",
85377
+ type: "text",
85378
+ secret: false,
85379
+ required: true
85380
+ }),
85381
+ apiKey: new ParameterDefinition({
85382
+ slug: "api-key",
85383
+ name: "API Key",
85384
+ description: "Your Backlog API key. You can generate one at: Your Space > Personal Settings > API (https://your-space.backlog.com/EditApiSettings.action).",
85385
+ envVarBaseKey: "BACKLOG_API_KEY",
85386
+ type: "text",
85387
+ secret: true,
85388
+ required: true
85389
+ })
85390
+ };
85391
+
85392
+ // ../connectors/src/connectors/backlog/tools/request.ts
85393
+ import { z as z76 } from "zod";
85394
+ var REQUEST_TIMEOUT_MS59 = 6e4;
85395
+ var inputSchema74 = z76.object({
85396
+ toolUseIntent: z76.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
85397
+ connectionId: z76.string().describe("ID of the Backlog connection to use"),
85398
+ method: z76.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).describe("HTTP method. Use GET to read resources, POST to create, PATCH/PUT to update, DELETE to remove."),
85399
+ path: z76.string().describe("API path relative to /api/v2/ (e.g., 'space', 'projects', 'issues?projectId[]=12345'). Query parameters can be appended. The apiKey query parameter is added automatically \u2014 do NOT include it."),
85400
+ body: z76.record(z76.string(), z76.unknown()).optional().describe("Request body as JSON object. Required for POST, PUT, and PATCH requests (e.g., issue creation, comment addition).")
85401
+ });
85402
+ var outputSchema74 = z76.discriminatedUnion("success", [
85403
+ z76.object({
85404
+ success: z76.literal(true),
85405
+ status: z76.number(),
85406
+ data: z76.union([z76.record(z76.string(), z76.unknown()), z76.array(z76.unknown())])
85407
+ }),
85408
+ z76.object({
85409
+ success: z76.literal(false),
85410
+ error: z76.string()
85411
+ })
85412
+ ]);
85413
+ var requestTool45 = new ConnectorTool({
85414
+ name: "request",
85415
+ description: `Send authenticated requests to the Backlog REST API (v2).
85416
+ Authentication is handled automatically by appending the apiKey query parameter to every request.
85417
+ Use this tool for all Backlog operations: listing projects, searching and creating issues, managing wikis, retrieving users, and more.
85418
+ The base URL and API key are configured per connection \u2014 only specify the API path relative to /api/v2/.
85419
+ Do NOT include the apiKey parameter yourself; it is injected automatically.`,
85420
+ inputSchema: inputSchema74,
85421
+ outputSchema: outputSchema74,
85422
+ async execute({ connectionId, method, path: path6, body }, connections) {
85423
+ const connection2 = connections.find((c6) => c6.id === connectionId);
85424
+ if (!connection2) {
85425
+ return { success: false, error: `Connection ${connectionId} not found` };
85426
+ }
85427
+ console.log(`[connector-request] backlog-api-key/${connection2.name}: ${method} ${path6}`);
85428
+ try {
85429
+ const spaceUrl = parameters60.spaceUrl.getValue(connection2);
85430
+ const apiKey = parameters60.apiKey.getValue(connection2);
85431
+ const separator = path6.includes("?") ? "&" : "?";
85432
+ const url = `${spaceUrl.replace(/\/+$/, "")}/api/v2/${path6}${separator}apiKey=${apiKey}`;
85433
+ const controller = new AbortController();
85434
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS59);
85435
+ try {
85436
+ const headers = {
85437
+ Accept: "application/json"
85438
+ };
85439
+ if (body) {
85440
+ headers["Content-Type"] = "application/json";
85441
+ }
85442
+ const response = await fetch(url, {
85443
+ method,
85444
+ headers,
85445
+ body: body ? JSON.stringify(body) : void 0,
85446
+ signal: controller.signal
85447
+ });
85448
+ if (response.status === 204) {
85449
+ return { success: true, status: 204, data: {} };
85450
+ }
85451
+ const data = await response.json();
85452
+ if (!response.ok) {
85453
+ const errData = data;
85454
+ const errors2 = errData?.errors;
85455
+ const errorMessage = Array.isArray(errors2) ? errors2.map((e6) => e6.message).join("; ") : errData?.message ?? `HTTP ${response.status} ${response.statusText}`;
85456
+ return { success: false, error: errorMessage };
85457
+ }
85458
+ return { success: true, status: response.status, data };
85459
+ } finally {
85460
+ clearTimeout(timeout);
85461
+ }
85462
+ } catch (err) {
85463
+ const msg = err instanceof Error ? err.message : String(err);
85464
+ return { success: false, error: msg };
85465
+ }
85466
+ }
85467
+ });
85468
+
85469
+ // ../connectors/src/connectors/backlog/index.ts
85470
+ var tools60 = { request: requestTool45 };
85471
+ var backlogConnector = new ConnectorPlugin({
85472
+ slug: "backlog",
85473
+ authType: AUTH_TYPES.API_KEY,
85474
+ name: "Backlog",
85475
+ description: "Connect to Nulab Backlog for project management, issue tracking, and wiki data retrieval using API key authentication.",
85476
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6KcVBGf3mUHnuCOQgQMvtT/e8558c7990e40e3be46948e9476190fb/backlog-favicon.svg",
85477
+ parameters: parameters60,
85478
+ releaseFlag: { dev1: true, dev2: true, prod: false },
85479
+ onboarding: backlogOnboarding,
85480
+ systemPrompt: {
85481
+ en: `### Tools
85482
+
85483
+ - \`backlog-api-key_request\`: The only way to call the Backlog REST API (v2). Use it to list projects, search issues, get issue details, create/update issues, manage wikis, and retrieve users. Authentication (API key as query parameter) and space URL are configured automatically.
85484
+
85485
+ ### Business Logic
85486
+
85487
+ The business logic type for this connector is "typescript". Write handler code using the connector SDK shown below. Do NOT access credentials directly from environment variables.
85488
+
85489
+ #### Example
85490
+
85491
+ \`\`\`ts
85492
+ import { connection } from "@squadbase/vite-server/connectors/backlog-api-key";
85493
+
85494
+ const backlog = connection("<connectionId>");
85495
+
85496
+ // List projects
85497
+ const res = await backlog.request("/api/v2/projects");
85498
+ const projects = await res.json();
85499
+
85500
+ // Get issues for a project
85501
+ const issuesRes = await backlog.request("/api/v2/issues?projectId[]=12345&count=20&sort=updated&order=desc");
85502
+ const issues = await issuesRes.json();
85503
+
85504
+ // Create an issue
85505
+ await backlog.request("/api/v2/issues", {
85506
+ method: "POST",
85507
+ body: JSON.stringify({
85508
+ projectId: 12345,
85509
+ summary: "New issue title",
85510
+ issueTypeId: 67890,
85511
+ priorityId: 3,
85512
+ }),
85513
+ });
85514
+ \`\`\`
85515
+
85516
+ ### Backlog REST API v2 Reference
85517
+
85518
+ #### Space
85519
+ - GET space \u2014 Get space information
85520
+ - GET space/activities \u2014 Get recent activities in the space
85521
+
85522
+ #### Projects
85523
+ - GET projects \u2014 List all projects (query params: archived, all)
85524
+ - GET projects/{projectIdOrKey} \u2014 Get project details
85525
+ - GET projects/{projectIdOrKey}/statuses \u2014 List issue statuses
85526
+ - GET projects/{projectIdOrKey}/issueTypes \u2014 List issue types
85527
+ - GET projects/{projectIdOrKey}/categories \u2014 List issue categories
85528
+
85529
+ #### Issues
85530
+ - GET issues \u2014 Search issues (query params: projectId[], statusId[], assigneeId[], sort, order, count, offset, keyword)
85531
+ - GET issues/{issueIdOrKey} \u2014 Get issue details
85532
+ - GET issues/count \u2014 Get issue count
85533
+ - POST issues \u2014 Create an issue (body: projectId, summary, issueTypeId, priorityId, and optional fields)
85534
+ - PATCH issues/{issueIdOrKey} \u2014 Update an issue
85535
+ - DELETE issues/{issueIdOrKey} \u2014 Delete an issue
85536
+ - GET issues/{issueIdOrKey}/comments \u2014 List comments
85537
+ - POST issues/{issueIdOrKey}/comments \u2014 Add a comment (body: { content: "comment text" })
85538
+
85539
+ #### Wiki
85540
+ - GET wikis \u2014 List wiki pages (query params: projectIdOrKey, keyword)
85541
+ - GET wikis/{wikiId} \u2014 Get wiki page details
85542
+ - POST wikis \u2014 Create a wiki page (body: projectId, name, content)
85543
+ - PATCH wikis/{wikiId} \u2014 Update a wiki page
85544
+
85545
+ #### Users
85546
+ - GET users \u2014 List users in the space
85547
+ - GET users/myself \u2014 Get authenticated user info
85548
+
85549
+ #### Pagination
85550
+ - Use count (max 100, default 20) and offset parameters for pagination
85551
+ - sort: "created", "updated", "issueType", "category", "priority", etc.
85552
+ - order: "asc" or "desc"`,
85553
+ ja: `### \u30C4\u30FC\u30EB
85554
+
85555
+ - \`backlog-api-key_request\`: Backlog REST API\uFF08v2\uFF09\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u306E\u53D6\u5F97\u3001\u8AB2\u984C\u306E\u691C\u7D22\u3001\u8AB2\u984C\u8A73\u7D30\u306E\u53D6\u5F97\u3001\u8AB2\u984C\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u3001Wiki\u7BA1\u7406\u3001\u30E6\u30FC\u30B6\u30FC\u53D6\u5F97\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08API\u30AD\u30FC\u3092\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3068\u3057\u3066\u4ED8\u4E0E\uFF09\u3068\u30B9\u30DA\u30FC\u30B9URL\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
85556
+
85557
+ ### Business Logic
85558
+
85559
+ \u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u4EE5\u4E0B\u306B\u793A\u3059\u30B3\u30CD\u30AF\u30BFSDK\u3092\u4F7F\u7528\u3057\u3066\u30CF\u30F3\u30C9\u30E9\u30B3\u30FC\u30C9\u3092\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089\u76F4\u63A5\u8A8D\u8A3C\u60C5\u5831\u306B\u30A2\u30AF\u30BB\u30B9\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
85560
+
85561
+ #### Example
85562
+
85563
+ \`\`\`ts
85564
+ import { connection } from "@squadbase/vite-server/connectors/backlog-api-key";
85565
+
85566
+ const backlog = connection("<connectionId>");
85567
+
85568
+ // \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
85569
+ const res = await backlog.request("/api/v2/projects");
85570
+ const projects = await res.json();
85571
+
85572
+ // \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u8AB2\u984C\u3092\u53D6\u5F97
85573
+ const issuesRes = await backlog.request("/api/v2/issues?projectId[]=12345&count=20&sort=updated&order=desc");
85574
+ const issues = await issuesRes.json();
85575
+
85576
+ // \u8AB2\u984C\u3092\u4F5C\u6210
85577
+ await backlog.request("/api/v2/issues", {
85578
+ method: "POST",
85579
+ body: JSON.stringify({
85580
+ projectId: 12345,
85581
+ summary: "\u65B0\u3057\u3044\u8AB2\u984C",
85582
+ issueTypeId: 67890,
85583
+ priorityId: 3,
85584
+ }),
85585
+ });
85586
+ \`\`\`
85587
+
85588
+ ### Backlog REST API v2 \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
85589
+
85590
+ #### \u30B9\u30DA\u30FC\u30B9
85591
+ - GET space \u2014 \u30B9\u30DA\u30FC\u30B9\u60C5\u5831\u306E\u53D6\u5F97
85592
+ - GET space/activities \u2014 \u30B9\u30DA\u30FC\u30B9\u306E\u6700\u8FD1\u306E\u6D3B\u52D5\u3092\u53D6\u5F97
85593
+
85594
+ #### \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8
85595
+ - GET projects \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u306E\u53D6\u5F97\uFF08\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF: archived, all\uFF09
85596
+ - GET projects/{projectIdOrKey} \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8A73\u7D30\u306E\u53D6\u5F97
85597
+ - GET projects/{projectIdOrKey}/statuses \u2014 \u8AB2\u984C\u30B9\u30C6\u30FC\u30BF\u30B9\u4E00\u89A7
85598
+ - GET projects/{projectIdOrKey}/issueTypes \u2014 \u8AB2\u984C\u7A2E\u5225\u4E00\u89A7
85599
+ - GET projects/{projectIdOrKey}/categories \u2014 \u8AB2\u984C\u30AB\u30C6\u30B4\u30EA\u4E00\u89A7
85600
+
85601
+ #### \u8AB2\u984C
85602
+ - GET issues \u2014 \u8AB2\u984C\u306E\u691C\u7D22\uFF08\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF: projectId[], statusId[], assigneeId[], sort, order, count, offset, keyword\uFF09
85603
+ - GET issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u8A73\u7D30\u306E\u53D6\u5F97
85604
+ - GET issues/count \u2014 \u8AB2\u984C\u6570\u306E\u53D6\u5F97
85605
+ - POST issues \u2014 \u8AB2\u984C\u306E\u4F5C\u6210\uFF08body: projectId, summary, issueTypeId, priorityId, \u305D\u306E\u4ED6\u30AA\u30D7\u30B7\u30E7\u30F3\u30D5\u30A3\u30FC\u30EB\u30C9\uFF09
85606
+ - PATCH issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u306E\u66F4\u65B0
85607
+ - DELETE issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u306E\u524A\u9664
85608
+ - GET issues/{issueIdOrKey}/comments \u2014 \u30B3\u30E1\u30F3\u30C8\u4E00\u89A7
85609
+ - POST issues/{issueIdOrKey}/comments \u2014 \u30B3\u30E1\u30F3\u30C8\u306E\u8FFD\u52A0\uFF08body: { content: "\u30B3\u30E1\u30F3\u30C8\u5185\u5BB9" }\uFF09
85610
+
85611
+ #### Wiki
85612
+ - GET wikis \u2014 Wiki\u30DA\u30FC\u30B8\u4E00\u89A7\u306E\u53D6\u5F97\uFF08\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF: projectIdOrKey, keyword\uFF09
85613
+ - GET wikis/{wikiId} \u2014 Wiki\u30DA\u30FC\u30B8\u8A73\u7D30\u306E\u53D6\u5F97
85614
+ - POST wikis \u2014 Wiki\u30DA\u30FC\u30B8\u306E\u4F5C\u6210\uFF08body: projectId, name, content\uFF09
85615
+ - PATCH wikis/{wikiId} \u2014 Wiki\u30DA\u30FC\u30B8\u306E\u66F4\u65B0
85616
+
85617
+ #### \u30E6\u30FC\u30B6\u30FC
85618
+ - GET users \u2014 \u30B9\u30DA\u30FC\u30B9\u5185\u306E\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7
85619
+ - GET users/myself \u2014 \u8A8D\u8A3C\u6E08\u307F\u30E6\u30FC\u30B6\u30FC\u60C5\u5831\u306E\u53D6\u5F97
85620
+
85621
+ #### \u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3
85622
+ - count\uFF08\u6700\u5927100\u3001\u30C7\u30D5\u30A9\u30EB\u30C820\uFF09\u3068 offset \u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3
85623
+ - sort: "created", "updated", "issueType", "category", "priority" \u7B49
85624
+ - order: "asc" \u307E\u305F\u306F "desc"`
85625
+ },
85626
+ tools: tools60
85627
+ });
85628
+
85629
+ // ../connectors/src/connectors/gamma/setup.ts
85630
+ var gammaOnboarding = new ConnectorOnboarding({
85631
+ dataOverviewInstructions: {
85632
+ en: `1. Call gamma_request with GET /themes to list available themes in the workspace
85633
+ 2. Call gamma_request with GET /folders to list workspace folders
85634
+ 3. Try generating a simple presentation with gamma_generate: inputText "Sample presentation about AI", textMode "generate", numCards 3`,
85635
+ ja: `1. gamma_request \u3067 GET /themes \u3092\u547C\u3073\u51FA\u3057\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3067\u5229\u7528\u53EF\u80FD\u306A\u30C6\u30FC\u30DE\u4E00\u89A7\u3092\u53D6\u5F97
85636
+ 2. gamma_request \u3067 GET /folders \u3092\u547C\u3073\u51FA\u3057\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306E\u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\u3092\u53D6\u5F97
85637
+ 3. gamma_generate \u3067\u30B7\u30F3\u30D7\u30EB\u306A\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3092\u8A66\u4F5C: inputText "AI\u306B\u3064\u3044\u3066\u306E\u30B5\u30F3\u30D7\u30EB\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3", textMode "generate", numCards 3`
85638
+ }
85639
+ });
85640
+
85641
+ // ../connectors/src/connectors/gamma/parameters.ts
85642
+ var parameters61 = {
85643
+ apiKey: new ParameterDefinition({
85644
+ slug: "api-key",
85645
+ name: "Gamma API Key",
85646
+ description: "The Gamma API key for authentication. Generate from Account Settings > API Keys. Requires Pro, Ultra, Teams, or Business plan.",
85647
+ envVarBaseKey: "GAMMA_API_KEY",
85648
+ type: "text",
85649
+ secret: true,
85650
+ required: true
85651
+ })
85652
+ };
85653
+
85654
+ // ../connectors/src/connectors/gamma/tools/request.ts
85655
+ import { z as z77 } from "zod";
85656
+ var BASE_URL40 = "https://public-api.gamma.app/v1.0";
85657
+ var REQUEST_TIMEOUT_MS60 = 6e4;
85658
+ var inputSchema75 = z77.object({
85659
+ toolUseIntent: z77.string().optional().describe(
85660
+ "Brief description of what you intend to accomplish with this tool call"
85661
+ ),
85662
+ connectionId: z77.string().describe("ID of the Gamma connection to use"),
85663
+ method: z77.enum(["GET", "POST"]).describe("HTTP method. GET for listing resources, POST for creating."),
85664
+ path: z77.string().describe(
85665
+ "API path (e.g., '/themes', '/folders', '/generations', '/generations/{generationId}')"
85666
+ ),
85667
+ body: z77.record(z77.string(), z77.unknown()).optional().describe("Request body (JSON) for POST requests")
85668
+ });
85669
+ var outputSchema75 = z77.discriminatedUnion("success", [
85670
+ z77.object({
85671
+ success: z77.literal(true),
85672
+ status: z77.number(),
85673
+ data: z77.unknown()
85674
+ }),
85675
+ z77.object({
85676
+ success: z77.literal(false),
85677
+ error: z77.string()
85678
+ })
85679
+ ]);
85680
+ var requestTool46 = new ConnectorTool({
85681
+ name: "request",
85682
+ description: `Send authenticated requests to the Gamma REST API.
85683
+ Authentication is handled automatically using the API Key (X-API-KEY header).
85684
+ Use this tool for listing themes, listing folders, checking generation status, and other read operations.
85685
+ For creating presentations/documents, prefer the gamma_generate tool instead.`,
85686
+ inputSchema: inputSchema75,
85687
+ outputSchema: outputSchema75,
85688
+ async execute({ connectionId, method, path: path6, body }, connections) {
85689
+ const connection2 = connections.find((c6) => c6.id === connectionId);
85690
+ if (!connection2) {
85691
+ return {
85692
+ success: false,
85693
+ error: `Connection ${connectionId} not found`
85694
+ };
85695
+ }
85696
+ console.log(
85697
+ `[connector-request] gamma/${connection2.name}: ${method} ${path6}`
85698
+ );
85699
+ try {
85700
+ const apiKey = parameters61.apiKey.getValue(connection2);
85701
+ const url = `${BASE_URL40}${path6}`;
85702
+ const controller = new AbortController();
85703
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS60);
85704
+ try {
85705
+ const response = await fetch(url, {
85706
+ method,
85707
+ headers: {
85708
+ "X-API-KEY": apiKey,
85709
+ "Content-Type": "application/json"
85710
+ },
85711
+ body: body ? JSON.stringify(body) : void 0,
85712
+ signal: controller.signal
85713
+ });
85714
+ const data = await response.json();
85715
+ if (!response.ok) {
85716
+ const err = data;
85717
+ const errorMessage = typeof err?.message === "string" ? err.message : typeof err?.error === "string" ? err.error : `HTTP ${response.status} ${response.statusText}`;
85718
+ return { success: false, error: errorMessage };
85719
+ }
85720
+ return { success: true, status: response.status, data };
85721
+ } finally {
85722
+ clearTimeout(timeout);
85723
+ }
85724
+ } catch (err) {
85725
+ const msg = err instanceof Error ? err.message : String(err);
85726
+ return { success: false, error: msg };
85727
+ }
85728
+ }
85729
+ });
85730
+
85731
+ // ../connectors/src/connectors/gamma/tools/generate.ts
85732
+ import { z as z78 } from "zod";
85733
+ var BASE_URL41 = "https://public-api.gamma.app/v1.0";
85734
+ var POLL_INTERVAL_MS3 = 5e3;
85735
+ var MAX_POLL_DURATION_MS = 3e5;
85736
+ var inputSchema76 = z78.object({
85737
+ toolUseIntent: z78.string().optional().describe(
85738
+ "Brief description of what you intend to accomplish with this tool call"
85739
+ ),
85740
+ connectionId: z78.string().describe("ID of the Gamma connection to use"),
85741
+ inputText: z78.string().describe(
85742
+ "Content for the generation. Can include text and image URLs. Max ~400,000 characters."
85743
+ ),
85744
+ textMode: z78.enum(["generate", "condense", "preserve"]).describe(
85745
+ "How inputText is modified: 'generate' creates new content from the topic, 'condense' shortens existing text, 'preserve' keeps text as-is."
85746
+ ),
85747
+ format: z78.enum(["presentation", "document", "webpage", "social"]).optional().describe("Type of artifact to create. Defaults to 'presentation'."),
85748
+ numCards: z78.number().int().min(1).max(75).optional().describe("Number of cards/slides. Defaults to 10."),
85749
+ themeId: z78.string().optional().describe(
85750
+ "Theme ID for look and feel. Use gamma_request GET /themes to list available themes."
85751
+ ),
85752
+ tone: z78.string().optional().describe(
85753
+ "Tone/voice of the output (e.g., 'professional', 'casual', 'academic'). Max 500 chars."
85754
+ ),
85755
+ audience: z78.string().optional().describe(
85756
+ "Target audience description (e.g., 'marketing executives'). Max 500 chars."
85757
+ ),
85758
+ language: z78.string().optional().describe("Output language code (e.g., 'en', 'ja'). Defaults to 'en'."),
85759
+ textAmount: z78.enum(["brief", "medium", "detailed", "extensive"]).optional().describe("Text volume per card. Defaults to 'medium'."),
85760
+ imageSource: z78.enum([
85761
+ "aiGenerated",
85762
+ "pictographic",
85763
+ "pexels",
85764
+ "giphy",
85765
+ "webAllImages",
85766
+ "webFreeToUse",
85767
+ "webFreeToUseCommercially",
85768
+ "themeAccent",
85769
+ "placeholder",
85770
+ "noImages"
85771
+ ]).optional().describe("Image source. Defaults to 'aiGenerated'."),
85772
+ additionalInstructions: z78.string().optional().describe(
85773
+ "Additional specifications for content, layout, and aesthetics. Max 5000 chars."
85774
+ ),
85775
+ exportAs: z78.enum(["pdf", "pptx", "png"]).optional().describe("Export file format. If omitted, no export file is generated.")
85776
+ });
85777
+ var outputSchema76 = z78.discriminatedUnion("success", [
85778
+ z78.object({
85779
+ success: z78.literal(true),
85780
+ generationId: z78.string(),
85781
+ gammaId: z78.string(),
85782
+ gammaUrl: z78.string(),
85783
+ exportUrl: z78.string().optional(),
85784
+ credits: z78.object({
85785
+ deducted: z78.number(),
85786
+ remaining: z78.number()
85787
+ }).optional()
85788
+ }),
85789
+ z78.object({
85790
+ success: z78.literal(false),
85791
+ error: z78.string()
85792
+ })
85793
+ ]);
85794
+ var generateTool = new ConnectorTool({
85795
+ name: "generate",
85796
+ description: `Generate a presentation, document, webpage, or social post using Gamma AI.
85797
+ This tool creates the generation, then automatically polls until completion and returns the result URL.
85798
+ Use gamma_request GET /themes first if you want to pick a specific theme.`,
85799
+ inputSchema: inputSchema76,
85800
+ outputSchema: outputSchema76,
85801
+ async execute({
85802
+ connectionId,
85803
+ inputText,
85804
+ textMode,
85805
+ format: format2,
85806
+ numCards,
85807
+ themeId,
85808
+ tone,
85809
+ audience,
85810
+ language,
85811
+ textAmount,
85812
+ imageSource,
85813
+ additionalInstructions,
85814
+ exportAs
85815
+ }, connections) {
85816
+ const connection2 = connections.find((c6) => c6.id === connectionId);
85817
+ if (!connection2) {
85818
+ return {
85819
+ success: false,
85820
+ error: `Connection ${connectionId} not found`
85821
+ };
85822
+ }
85823
+ console.log(
85824
+ `[connector-generate] gamma/${connection2.name}: creating ${format2 ?? "presentation"}`
85825
+ );
85826
+ try {
85827
+ const apiKey = parameters61.apiKey.getValue(connection2);
85828
+ const headers = {
85829
+ "X-API-KEY": apiKey,
85830
+ "Content-Type": "application/json"
85831
+ };
85832
+ const body = {
85833
+ inputText,
85834
+ textMode
85835
+ };
85836
+ if (format2) body.format = format2;
85837
+ if (numCards) body.numCards = numCards;
85838
+ if (themeId) body.themeId = themeId;
85839
+ if (additionalInstructions)
85840
+ body.additionalInstructions = additionalInstructions;
85841
+ if (exportAs) body.exportAs = exportAs;
85842
+ const textOptions = {};
85843
+ if (tone) textOptions.tone = tone;
85844
+ if (audience) textOptions.audience = audience;
85845
+ if (language) textOptions.language = language;
85846
+ if (textAmount) textOptions.amount = textAmount;
85847
+ if (Object.keys(textOptions).length > 0) body.textOptions = textOptions;
85848
+ if (imageSource) body.imageOptions = { source: imageSource };
85849
+ const createRes = await fetch(`${BASE_URL41}/generations`, {
85850
+ method: "POST",
85851
+ headers,
85852
+ body: JSON.stringify(body)
85853
+ });
85854
+ const createData = await createRes.json();
85855
+ if (!createRes.ok) {
85856
+ const errorMessage = typeof createData?.message === "string" ? createData.message : typeof createData?.error === "string" ? createData.error : `HTTP ${createRes.status} ${createRes.statusText}`;
85857
+ return { success: false, error: errorMessage };
85858
+ }
85859
+ const generationId = createData.generationId;
85860
+ if (!generationId) {
85861
+ return {
85862
+ success: false,
85863
+ error: "No generationId returned from API"
85864
+ };
85865
+ }
85866
+ const deadline = Date.now() + MAX_POLL_DURATION_MS;
85867
+ while (Date.now() < deadline) {
85868
+ await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS3));
85869
+ const pollRes = await fetch(`${BASE_URL41}/generations/${generationId}`, {
85870
+ method: "GET",
85871
+ headers
85872
+ });
85873
+ const pollData = await pollRes.json();
85874
+ if (!pollRes.ok) {
85875
+ const errorMessage = typeof pollData?.message === "string" ? pollData.message : `Polling failed: HTTP ${pollRes.status}`;
85876
+ return { success: false, error: errorMessage };
85877
+ }
85878
+ const status = pollData.status;
85879
+ if (status === "completed") {
85880
+ return {
85881
+ success: true,
85882
+ generationId,
85883
+ gammaId: pollData.gammaId,
85884
+ gammaUrl: pollData.gammaUrl,
85885
+ exportUrl: pollData.exportUrl || void 0,
85886
+ credits: pollData.credits
85887
+ };
85888
+ }
85889
+ if (status === "failed") {
85890
+ const error2 = pollData.error;
85891
+ const errorMessage = typeof error2?.message === "string" ? error2.message : "Generation failed";
85892
+ return { success: false, error: errorMessage };
85893
+ }
85894
+ }
85895
+ return {
85896
+ success: false,
85897
+ error: `Generation timed out after ${MAX_POLL_DURATION_MS / 1e3}s. generationId: ${generationId} \u2014 you can check status with GET /generations/${generationId}`
85898
+ };
85899
+ } catch (err) {
85900
+ const msg = err instanceof Error ? err.message : String(err);
85901
+ return { success: false, error: msg };
85902
+ }
85903
+ }
85904
+ });
85905
+
85906
+ // ../connectors/src/connectors/gamma/index.ts
85907
+ var tools61 = { request: requestTool46, generate: generateTool };
85908
+ var gammaConnector = new ConnectorPlugin({
85909
+ slug: "gamma",
85910
+ authType: AUTH_TYPES.API_KEY,
85911
+ name: "Gamma",
85912
+ description: "Connect to Gamma for AI-powered presentation, document, webpage, and social post generation.",
85913
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/KoMGPpPcgtB9oDYe1OBjS/1ba7eb061c4497106bf6d249866dc471/gamma.svg",
85914
+ parameters: parameters61,
85915
+ releaseFlag: { dev1: true, dev2: false, prod: false },
85916
+ onboarding: gammaOnboarding,
85917
+ systemPrompt: {
85918
+ en: `### Tools
85919
+
85920
+ - \`gamma_request\`: Send authenticated requests to the Gamma REST API. Use for listing themes, folders, and checking generation status. Authentication (X-API-KEY) is configured automatically.
85921
+ - \`gamma_generate\`: Generate a presentation, document, webpage, or social post using Gamma AI. This tool handles the full workflow: creates the generation, polls for completion, and returns the result URL. Prefer this over manually calling POST /generations + polling.
85922
+
85923
+ ### Business Logic
85924
+
85925
+ The business logic type for this connector is "typescript". Use the connector SDK in your handler. Do NOT read credentials from environment variables.
85926
+
85927
+ SDK methods (client created via \`connection(connectionId)\`):
85928
+ - \`client.request(path, init?)\` \u2014 low-level authenticated fetch
85929
+ - \`client.listThemes(options?)\` \u2014 list available themes (query, limit, after)
85930
+ - \`client.listFolders(options?)\` \u2014 list workspace folders (query, limit, after)
85931
+ - \`client.createGeneration(options)\` \u2014 create a generation, returns generationId
85932
+ - \`client.getGeneration(generationId)\` \u2014 get generation status and result
85933
+ - \`client.generateAndWait(options)\` \u2014 create generation and poll until completion
85934
+
85935
+ \`\`\`ts
85936
+ import type { Context } from "hono";
85937
+ import { connection } from "@squadbase/vite-server/connectors/gamma";
85938
+
85939
+ const gamma = connection("<connectionId>");
85940
+
85941
+ export default async function handler(c: Context) {
85942
+ const { topic, numCards = 5 } = await c.req.json<{
85943
+ topic: string;
85944
+ numCards?: number;
85945
+ }>();
85946
+
85947
+ const result = await gamma.generateAndWait({
85948
+ inputText: topic,
85949
+ textMode: "generate",
85950
+ format: "presentation",
85951
+ numCards,
85952
+ });
85953
+
85954
+ return c.json(result);
85955
+ }
85956
+ \`\`\`
85957
+
85958
+ ### Gamma REST API Reference
85959
+
85960
+ - Base URL: \`https://public-api.gamma.app/v1.0\`
85961
+ - Authentication: X-API-KEY header (handled automatically)
85962
+
85963
+ #### Endpoints
85964
+
85965
+ - POST \`/generations\` \u2014 Create a generation (presentation, document, webpage, social)
85966
+ - Required: \`inputText\` (string), \`textMode\` ("generate" | "condense" | "preserve")
85967
+ - Optional: \`format\`, \`numCards\`, \`themeId\`, \`textOptions\` (tone, audience, language, amount), \`imageOptions\` (source, model, style), \`additionalInstructions\`, \`exportAs\` (pdf, pptx, png), \`folderIds\`, \`sharingOptions\`
85968
+ - Returns: \`{ generationId }\`
85969
+ - GET \`/generations/{generationId}\` \u2014 Poll generation status
85970
+ - Returns: \`{ generationId, status, gammaId?, gammaUrl?, exportUrl?, credits?, error? }\`
85971
+ - Status values: "pending", "completed", "failed"
85972
+ - Poll every 5 seconds until status changes from "pending"
85973
+ - GET \`/themes\` \u2014 List available themes (query, limit, after for pagination)
85974
+ - GET \`/folders\` \u2014 List workspace folders (query, limit, after for pagination)
85975
+
85976
+ #### Generation Formats
85977
+ - \`presentation\` \u2014 Slide deck (dimensions: fluid, 16x9, 4x3)
85978
+ - \`document\` \u2014 Document (dimensions: fluid, pageless, letter, a4)
85979
+ - \`webpage\` \u2014 Web page
85980
+ - \`social\` \u2014 Social media post (dimensions: 1x1, 4x5, 9x16)
85981
+
85982
+ #### Text Modes
85983
+ - \`generate\` \u2014 AI generates new content from the input topic
85984
+ - \`condense\` \u2014 AI shortens the provided text
85985
+ - \`preserve\` \u2014 Input text is used as-is
85986
+
85987
+ #### Image Sources
85988
+ - \`aiGenerated\`, \`pictographic\`, \`pexels\`, \`giphy\`, \`webFreeToUseCommercially\`, \`noImages\`, etc.`,
85989
+ ja: `### \u30C4\u30FC\u30EB
85990
+
85991
+ - \`gamma_request\`: Gamma REST API\u306B\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30C6\u30FC\u30DE\u4E00\u89A7\u3001\u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\u3001\u751F\u6210\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u78BA\u8A8D\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08X-API-KEY\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
85992
+ - \`gamma_generate\`: Gamma AI\u3092\u4F7F\u3063\u3066\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3001\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8\u3001\u30BD\u30FC\u30B7\u30E3\u30EB\u6295\u7A3F\u3092\u751F\u6210\u3057\u307E\u3059\u3002\u751F\u6210\u306E\u4F5C\u6210\u304B\u3089\u30DD\u30FC\u30EA\u30F3\u30B0\u3001\u7D50\u679CURL\u306E\u8FD4\u5374\u307E\u3067\u4E00\u62EC\u3067\u51E6\u7406\u3057\u307E\u3059\u3002\u624B\u52D5\u3067POST /generations + \u30DD\u30FC\u30EA\u30F3\u30B0\u3059\u308B\u3088\u308A\u3082\u3053\u3061\u3089\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
85993
+
85994
+ ### Business Logic
85995
+
85996
+ \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\u74B0\u5883\u5909\u6570\u304B\u3089\u8A8D\u8A3C\u60C5\u5831\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
85997
+
85998
+ SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
85999
+ - \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304Dfetch
86000
+ - \`client.listThemes(options?)\` \u2014 \u30C6\u30FC\u30DE\u4E00\u89A7\u306E\u53D6\u5F97\uFF08query, limit, after\uFF09
86001
+ - \`client.listFolders(options?)\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\u306E\u53D6\u5F97\uFF08query, limit, after\uFF09
86002
+ - \`client.createGeneration(options)\` \u2014 \u751F\u6210\u306E\u4F5C\u6210\u3001generationId\u3092\u8FD4\u3059
86003
+ - \`client.getGeneration(generationId)\` \u2014 \u751F\u6210\u30B9\u30C6\u30FC\u30BF\u30B9\u3068\u7D50\u679C\u306E\u53D6\u5F97
86004
+ - \`client.generateAndWait(options)\` \u2014 \u751F\u6210\u3092\u4F5C\u6210\u3057\u5B8C\u4E86\u307E\u3067\u30DD\u30FC\u30EA\u30F3\u30B0
86005
+
86006
+ \`\`\`ts
86007
+ import type { Context } from "hono";
86008
+ import { connection } from "@squadbase/vite-server/connectors/gamma";
86009
+
86010
+ const gamma = connection("<connectionId>");
86011
+
86012
+ export default async function handler(c: Context) {
86013
+ const { topic, numCards = 5 } = await c.req.json<{
86014
+ topic: string;
86015
+ numCards?: number;
86016
+ }>();
86017
+
86018
+ const result = await gamma.generateAndWait({
86019
+ inputText: topic,
86020
+ textMode: "generate",
86021
+ format: "presentation",
86022
+ numCards,
86023
+ });
86024
+
86025
+ return c.json(result);
86026
+ }
86027
+ \`\`\`
86028
+
86029
+ ### Gamma REST API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
86030
+
86031
+ - \u30D9\u30FC\u30B9URL: \`https://public-api.gamma.app/v1.0\`
86032
+ - \u8A8D\u8A3C: X-API-KEY\u30D8\u30C3\u30C0\u30FC\uFF08\u81EA\u52D5\u8A2D\u5B9A\uFF09
86033
+
86034
+ #### \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8
86035
+
86036
+ - POST \`/generations\` \u2014 \u751F\u6210\u306E\u4F5C\u6210\uFF08\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3001\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8\u3001\u30BD\u30FC\u30B7\u30E3\u30EB\uFF09
86037
+ - \u5FC5\u9808: \`inputText\`\uFF08\u6587\u5B57\u5217\uFF09\u3001\`textMode\`\uFF08"generate" | "condense" | "preserve"\uFF09
86038
+ - \u30AA\u30D7\u30B7\u30E7\u30F3: \`format\`, \`numCards\`, \`themeId\`, \`textOptions\`\uFF08tone, audience, language, amount\uFF09, \`imageOptions\`\uFF08source, model, style\uFF09, \`additionalInstructions\`, \`exportAs\`\uFF08pdf, pptx, png\uFF09, \`folderIds\`, \`sharingOptions\`
86039
+ - \u8FD4\u5374: \`{ generationId }\`
86040
+ - GET \`/generations/{generationId}\` \u2014 \u751F\u6210\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30DD\u30FC\u30EA\u30F3\u30B0
86041
+ - \u8FD4\u5374: \`{ generationId, status, gammaId?, gammaUrl?, exportUrl?, credits?, error? }\`
86042
+ - \u30B9\u30C6\u30FC\u30BF\u30B9\u5024: "pending", "completed", "failed"
86043
+ - status\u304C"pending"\u3067\u306A\u304F\u306A\u308B\u307E\u30675\u79D2\u3054\u3068\u306B\u30DD\u30FC\u30EA\u30F3\u30B0
86044
+ - GET \`/themes\` \u2014 \u30C6\u30FC\u30DE\u4E00\u89A7\uFF08query, limit, after\u3067\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\uFF09
86045
+ - GET \`/folders\` \u2014 \u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\uFF08query, limit, after\u3067\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\uFF09
86046
+
86047
+ #### \u751F\u6210\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8
86048
+ - \`presentation\` \u2014 \u30B9\u30E9\u30A4\u30C9\u30C7\u30C3\u30AD\uFF08\u5BF8\u6CD5: fluid, 16x9, 4x3\uFF09
86049
+ - \`document\` \u2014 \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\uFF08\u5BF8\u6CD5: fluid, pageless, letter, a4\uFF09
86050
+ - \`webpage\` \u2014 \u30A6\u30A7\u30D6\u30DA\u30FC\u30B8
86051
+ - \`social\` \u2014 \u30BD\u30FC\u30B7\u30E3\u30EB\u30E1\u30C7\u30A3\u30A2\u6295\u7A3F\uFF08\u5BF8\u6CD5: 1x1, 4x5, 9x16\uFF09
86052
+
86053
+ #### \u30C6\u30AD\u30B9\u30C8\u30E2\u30FC\u30C9
86054
+ - \`generate\` \u2014 AI\u304C\u5165\u529B\u30C8\u30D4\u30C3\u30AF\u304B\u3089\u65B0\u3057\u3044\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u751F\u6210
86055
+ - \`condense\` \u2014 AI\u304C\u63D0\u4F9B\u3055\u308C\u305F\u30C6\u30AD\u30B9\u30C8\u3092\u77ED\u7E2E
86056
+ - \`preserve\` \u2014 \u5165\u529B\u30C6\u30AD\u30B9\u30C8\u3092\u305D\u306E\u307E\u307E\u4F7F\u7528
86057
+
86058
+ #### \u753B\u50CF\u30BD\u30FC\u30B9
86059
+ - \`aiGenerated\`, \`pictographic\`, \`pexels\`, \`giphy\`, \`webFreeToUseCommercially\`, \`noImages\` \u306A\u3069`
86060
+ },
86061
+ tools: tools61
86062
+ });
86063
+
85354
86064
  // ../connectors/src/connectors/registry.ts
85355
86065
  var plugins = {
85356
86066
  snowflake: snowflakeConnector,
@@ -85411,7 +86121,9 @@ var plugins = {
85411
86121
  intercom: intercomConnector,
85412
86122
  intercomOauth: intercomOauthConnector,
85413
86123
  mixpanel: mixpanelConnector,
85414
- grafana: grafanaConnector
86124
+ grafana: grafanaConnector,
86125
+ backlog: backlogConnector,
86126
+ gamma: gammaConnector
85415
86127
  };
85416
86128
  var connectors = {
85417
86129
  ...plugins,
@@ -85612,62 +86324,62 @@ function resolveParams2(entry, connectionId, plugin) {
85612
86324
  var { getQuery, loadConnections, reloadEnvFile, watchConnectionsFile } = createConnectorRegistry();
85613
86325
 
85614
86326
  // src/types/server-logic.ts
85615
- import { z as z76 } from "zod";
85616
- var parameterMetaSchema = z76.object({
85617
- name: z76.string(),
85618
- type: z76.enum(["string", "number", "boolean"]),
85619
- description: z76.string(),
85620
- required: z76.boolean().optional(),
85621
- default: z76.union([z76.string(), z76.number(), z76.boolean()]).optional()
85622
- });
85623
- var serverLogicCacheConfigSchema = z76.object({
85624
- ttl: z76.number(),
85625
- staleWhileRevalidate: z76.boolean().optional()
85626
- });
85627
- var serverLogicSchemaObjectSchema = z76.lazy(
85628
- () => z76.object({
85629
- type: z76.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
85630
- format: z76.string().optional(),
85631
- description: z76.string().optional(),
85632
- nullable: z76.boolean().optional(),
85633
- enum: z76.array(z76.union([z76.string(), z76.number(), z76.boolean(), z76.null()])).optional(),
86327
+ import { z as z79 } from "zod";
86328
+ var parameterMetaSchema = z79.object({
86329
+ name: z79.string(),
86330
+ type: z79.enum(["string", "number", "boolean"]),
86331
+ description: z79.string(),
86332
+ required: z79.boolean().optional(),
86333
+ default: z79.union([z79.string(), z79.number(), z79.boolean()]).optional()
86334
+ });
86335
+ var serverLogicCacheConfigSchema = z79.object({
86336
+ ttl: z79.number(),
86337
+ staleWhileRevalidate: z79.boolean().optional()
86338
+ });
86339
+ var serverLogicSchemaObjectSchema = z79.lazy(
86340
+ () => z79.object({
86341
+ type: z79.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
86342
+ format: z79.string().optional(),
86343
+ description: z79.string().optional(),
86344
+ nullable: z79.boolean().optional(),
86345
+ enum: z79.array(z79.union([z79.string(), z79.number(), z79.boolean(), z79.null()])).optional(),
85634
86346
  items: serverLogicSchemaObjectSchema.optional(),
85635
- properties: z76.record(z76.string(), serverLogicSchemaObjectSchema).optional(),
85636
- required: z76.array(z76.string()).optional(),
85637
- additionalProperties: z76.union([z76.boolean(), serverLogicSchemaObjectSchema]).optional(),
85638
- minimum: z76.number().optional(),
85639
- maximum: z76.number().optional(),
85640
- minLength: z76.number().optional(),
85641
- maxLength: z76.number().optional(),
85642
- pattern: z76.string().optional()
86347
+ properties: z79.record(z79.string(), serverLogicSchemaObjectSchema).optional(),
86348
+ required: z79.array(z79.string()).optional(),
86349
+ additionalProperties: z79.union([z79.boolean(), serverLogicSchemaObjectSchema]).optional(),
86350
+ minimum: z79.number().optional(),
86351
+ maximum: z79.number().optional(),
86352
+ minLength: z79.number().optional(),
86353
+ maxLength: z79.number().optional(),
86354
+ pattern: z79.string().optional()
85643
86355
  })
85644
86356
  );
85645
- var serverLogicMediaTypeSchema = z76.object({
86357
+ var serverLogicMediaTypeSchema = z79.object({
85646
86358
  schema: serverLogicSchemaObjectSchema.optional(),
85647
- example: z76.unknown().optional()
86359
+ example: z79.unknown().optional()
85648
86360
  });
85649
- var serverLogicResponseSchema = z76.object({
85650
- description: z76.string().optional(),
85651
- content: z76.record(z76.string(), serverLogicMediaTypeSchema).optional()
86361
+ var serverLogicResponseSchema = z79.object({
86362
+ description: z79.string().optional(),
86363
+ content: z79.record(z79.string(), serverLogicMediaTypeSchema).optional()
85652
86364
  });
85653
86365
  var jsonBaseFields = {
85654
- description: z76.string(),
85655
- parameters: z76.array(parameterMetaSchema).optional(),
86366
+ description: z79.string(),
86367
+ parameters: z79.array(parameterMetaSchema).optional(),
85656
86368
  response: serverLogicResponseSchema.optional(),
85657
86369
  cache: serverLogicCacheConfigSchema.optional()
85658
86370
  };
85659
- var jsonSqlServerLogicSchema = z76.object({
86371
+ var jsonSqlServerLogicSchema = z79.object({
85660
86372
  ...jsonBaseFields,
85661
- type: z76.literal("sql").optional(),
85662
- query: z76.string(),
85663
- connectionId: z76.string()
86373
+ type: z79.literal("sql").optional(),
86374
+ query: z79.string(),
86375
+ connectionId: z79.string()
85664
86376
  });
85665
- var jsonTypeScriptServerLogicSchema = z76.object({
86377
+ var jsonTypeScriptServerLogicSchema = z79.object({
85666
86378
  ...jsonBaseFields,
85667
- type: z76.literal("typescript"),
85668
- handlerPath: z76.string()
86379
+ type: z79.literal("typescript"),
86380
+ handlerPath: z79.string()
85669
86381
  });
85670
- var anyJsonServerLogicSchema = z76.union([
86382
+ var anyJsonServerLogicSchema = z79.union([
85671
86383
  jsonTypeScriptServerLogicSchema,
85672
86384
  jsonSqlServerLogicSchema
85673
86385
  ]);