@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.
@@ -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);
@@ -73566,7 +73566,9 @@ Use this tool for all Stripe API interactions: querying charges, customers, invo
73566
73566
  if (body) {
73567
73567
  headers["Content-Type"] = "application/x-www-form-urlencoded";
73568
73568
  requestBody = new URLSearchParams(
73569
- Object.entries(body).map(([k6, v7]) => [k6, String(v7)])
73569
+ Object.entries(body).map(
73570
+ ([k6, v7]) => [k6, String(v7)]
73571
+ )
73570
73572
  ).toString();
73571
73573
  }
73572
73574
  const response = await fetch(url, {
@@ -85352,6 +85354,714 @@ export default async function handler(c: Context) {
85352
85354
  tools: tools59
85353
85355
  });
85354
85356
 
85357
+ // ../connectors/src/connectors/backlog/setup.ts
85358
+ var backlogOnboarding = new ConnectorOnboarding({
85359
+ dataOverviewInstructions: {
85360
+ en: `1. Call backlog-api-key_request with GET space to verify the connection and get space information
85361
+ 2. Call backlog-api-key_request with GET projects to list all accessible projects
85362
+ 3. For key projects, call backlog-api-key_request with GET issues?projectId[]={projectId}&count=5&order=desc to retrieve recent issues
85363
+ 4. Call backlog-api-key_request with GET projects/{projectIdOrKey}/statuses to understand the workflow statuses`,
85364
+ 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
85365
+ 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
85366
+ 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
85367
+ 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`
85368
+ }
85369
+ });
85370
+
85371
+ // ../connectors/src/connectors/backlog/parameters.ts
85372
+ var parameters60 = {
85373
+ spaceUrl: new ParameterDefinition({
85374
+ slug: "space-url",
85375
+ name: "Backlog Space URL",
85376
+ 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",
85377
+ envVarBaseKey: "BACKLOG_SPACE_URL",
85378
+ type: "text",
85379
+ secret: false,
85380
+ required: true
85381
+ }),
85382
+ apiKey: new ParameterDefinition({
85383
+ slug: "api-key",
85384
+ name: "API Key",
85385
+ description: "Your Backlog API key. You can generate one at: Your Space > Personal Settings > API (https://your-space.backlog.com/EditApiSettings.action).",
85386
+ envVarBaseKey: "BACKLOG_API_KEY",
85387
+ type: "text",
85388
+ secret: true,
85389
+ required: true
85390
+ })
85391
+ };
85392
+
85393
+ // ../connectors/src/connectors/backlog/tools/request.ts
85394
+ import { z as z76 } from "zod";
85395
+ var REQUEST_TIMEOUT_MS59 = 6e4;
85396
+ var inputSchema74 = z76.object({
85397
+ toolUseIntent: z76.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
85398
+ connectionId: z76.string().describe("ID of the Backlog connection to use"),
85399
+ 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."),
85400
+ 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."),
85401
+ 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).")
85402
+ });
85403
+ var outputSchema74 = z76.discriminatedUnion("success", [
85404
+ z76.object({
85405
+ success: z76.literal(true),
85406
+ status: z76.number(),
85407
+ data: z76.union([z76.record(z76.string(), z76.unknown()), z76.array(z76.unknown())])
85408
+ }),
85409
+ z76.object({
85410
+ success: z76.literal(false),
85411
+ error: z76.string()
85412
+ })
85413
+ ]);
85414
+ var requestTool45 = new ConnectorTool({
85415
+ name: "request",
85416
+ description: `Send authenticated requests to the Backlog REST API (v2).
85417
+ Authentication is handled automatically by appending the apiKey query parameter to every request.
85418
+ Use this tool for all Backlog operations: listing projects, searching and creating issues, managing wikis, retrieving users, and more.
85419
+ The base URL and API key are configured per connection \u2014 only specify the API path relative to /api/v2/.
85420
+ Do NOT include the apiKey parameter yourself; it is injected automatically.`,
85421
+ inputSchema: inputSchema74,
85422
+ outputSchema: outputSchema74,
85423
+ async execute({ connectionId, method, path: path4, body }, connections) {
85424
+ const connection = connections.find((c6) => c6.id === connectionId);
85425
+ if (!connection) {
85426
+ return { success: false, error: `Connection ${connectionId} not found` };
85427
+ }
85428
+ console.log(`[connector-request] backlog-api-key/${connection.name}: ${method} ${path4}`);
85429
+ try {
85430
+ const spaceUrl = parameters60.spaceUrl.getValue(connection);
85431
+ const apiKey = parameters60.apiKey.getValue(connection);
85432
+ const separator = path4.includes("?") ? "&" : "?";
85433
+ const url = `${spaceUrl.replace(/\/+$/, "")}/api/v2/${path4}${separator}apiKey=${apiKey}`;
85434
+ const controller = new AbortController();
85435
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS59);
85436
+ try {
85437
+ const headers = {
85438
+ Accept: "application/json"
85439
+ };
85440
+ if (body) {
85441
+ headers["Content-Type"] = "application/json";
85442
+ }
85443
+ const response = await fetch(url, {
85444
+ method,
85445
+ headers,
85446
+ body: body ? JSON.stringify(body) : void 0,
85447
+ signal: controller.signal
85448
+ });
85449
+ if (response.status === 204) {
85450
+ return { success: true, status: 204, data: {} };
85451
+ }
85452
+ const data = await response.json();
85453
+ if (!response.ok) {
85454
+ const errData = data;
85455
+ const errors2 = errData?.errors;
85456
+ const errorMessage = Array.isArray(errors2) ? errors2.map((e6) => e6.message).join("; ") : errData?.message ?? `HTTP ${response.status} ${response.statusText}`;
85457
+ return { success: false, error: errorMessage };
85458
+ }
85459
+ return { success: true, status: response.status, data };
85460
+ } finally {
85461
+ clearTimeout(timeout);
85462
+ }
85463
+ } catch (err) {
85464
+ const msg = err instanceof Error ? err.message : String(err);
85465
+ return { success: false, error: msg };
85466
+ }
85467
+ }
85468
+ });
85469
+
85470
+ // ../connectors/src/connectors/backlog/index.ts
85471
+ var tools60 = { request: requestTool45 };
85472
+ var backlogConnector = new ConnectorPlugin({
85473
+ slug: "backlog",
85474
+ authType: AUTH_TYPES.API_KEY,
85475
+ name: "Backlog",
85476
+ description: "Connect to Nulab Backlog for project management, issue tracking, and wiki data retrieval using API key authentication.",
85477
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6KcVBGf3mUHnuCOQgQMvtT/e8558c7990e40e3be46948e9476190fb/backlog-favicon.svg",
85478
+ parameters: parameters60,
85479
+ releaseFlag: { dev1: true, dev2: true, prod: false },
85480
+ onboarding: backlogOnboarding,
85481
+ systemPrompt: {
85482
+ en: `### Tools
85483
+
85484
+ - \`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.
85485
+
85486
+ ### Business Logic
85487
+
85488
+ 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.
85489
+
85490
+ #### Example
85491
+
85492
+ \`\`\`ts
85493
+ import { connection } from "@squadbase/vite-server/connectors/backlog-api-key";
85494
+
85495
+ const backlog = connection("<connectionId>");
85496
+
85497
+ // List projects
85498
+ const res = await backlog.request("/api/v2/projects");
85499
+ const projects = await res.json();
85500
+
85501
+ // Get issues for a project
85502
+ const issuesRes = await backlog.request("/api/v2/issues?projectId[]=12345&count=20&sort=updated&order=desc");
85503
+ const issues = await issuesRes.json();
85504
+
85505
+ // Create an issue
85506
+ await backlog.request("/api/v2/issues", {
85507
+ method: "POST",
85508
+ body: JSON.stringify({
85509
+ projectId: 12345,
85510
+ summary: "New issue title",
85511
+ issueTypeId: 67890,
85512
+ priorityId: 3,
85513
+ }),
85514
+ });
85515
+ \`\`\`
85516
+
85517
+ ### Backlog REST API v2 Reference
85518
+
85519
+ #### Space
85520
+ - GET space \u2014 Get space information
85521
+ - GET space/activities \u2014 Get recent activities in the space
85522
+
85523
+ #### Projects
85524
+ - GET projects \u2014 List all projects (query params: archived, all)
85525
+ - GET projects/{projectIdOrKey} \u2014 Get project details
85526
+ - GET projects/{projectIdOrKey}/statuses \u2014 List issue statuses
85527
+ - GET projects/{projectIdOrKey}/issueTypes \u2014 List issue types
85528
+ - GET projects/{projectIdOrKey}/categories \u2014 List issue categories
85529
+
85530
+ #### Issues
85531
+ - GET issues \u2014 Search issues (query params: projectId[], statusId[], assigneeId[], sort, order, count, offset, keyword)
85532
+ - GET issues/{issueIdOrKey} \u2014 Get issue details
85533
+ - GET issues/count \u2014 Get issue count
85534
+ - POST issues \u2014 Create an issue (body: projectId, summary, issueTypeId, priorityId, and optional fields)
85535
+ - PATCH issues/{issueIdOrKey} \u2014 Update an issue
85536
+ - DELETE issues/{issueIdOrKey} \u2014 Delete an issue
85537
+ - GET issues/{issueIdOrKey}/comments \u2014 List comments
85538
+ - POST issues/{issueIdOrKey}/comments \u2014 Add a comment (body: { content: "comment text" })
85539
+
85540
+ #### Wiki
85541
+ - GET wikis \u2014 List wiki pages (query params: projectIdOrKey, keyword)
85542
+ - GET wikis/{wikiId} \u2014 Get wiki page details
85543
+ - POST wikis \u2014 Create a wiki page (body: projectId, name, content)
85544
+ - PATCH wikis/{wikiId} \u2014 Update a wiki page
85545
+
85546
+ #### Users
85547
+ - GET users \u2014 List users in the space
85548
+ - GET users/myself \u2014 Get authenticated user info
85549
+
85550
+ #### Pagination
85551
+ - Use count (max 100, default 20) and offset parameters for pagination
85552
+ - sort: "created", "updated", "issueType", "category", "priority", etc.
85553
+ - order: "asc" or "desc"`,
85554
+ ja: `### \u30C4\u30FC\u30EB
85555
+
85556
+ - \`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
85557
+
85558
+ ### Business Logic
85559
+
85560
+ \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
85561
+
85562
+ #### Example
85563
+
85564
+ \`\`\`ts
85565
+ import { connection } from "@squadbase/vite-server/connectors/backlog-api-key";
85566
+
85567
+ const backlog = connection("<connectionId>");
85568
+
85569
+ // \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
85570
+ const res = await backlog.request("/api/v2/projects");
85571
+ const projects = await res.json();
85572
+
85573
+ // \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u8AB2\u984C\u3092\u53D6\u5F97
85574
+ const issuesRes = await backlog.request("/api/v2/issues?projectId[]=12345&count=20&sort=updated&order=desc");
85575
+ const issues = await issuesRes.json();
85576
+
85577
+ // \u8AB2\u984C\u3092\u4F5C\u6210
85578
+ await backlog.request("/api/v2/issues", {
85579
+ method: "POST",
85580
+ body: JSON.stringify({
85581
+ projectId: 12345,
85582
+ summary: "\u65B0\u3057\u3044\u8AB2\u984C",
85583
+ issueTypeId: 67890,
85584
+ priorityId: 3,
85585
+ }),
85586
+ });
85587
+ \`\`\`
85588
+
85589
+ ### Backlog REST API v2 \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
85590
+
85591
+ #### \u30B9\u30DA\u30FC\u30B9
85592
+ - GET space \u2014 \u30B9\u30DA\u30FC\u30B9\u60C5\u5831\u306E\u53D6\u5F97
85593
+ - GET space/activities \u2014 \u30B9\u30DA\u30FC\u30B9\u306E\u6700\u8FD1\u306E\u6D3B\u52D5\u3092\u53D6\u5F97
85594
+
85595
+ #### \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8
85596
+ - 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
85597
+ - GET projects/{projectIdOrKey} \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8A73\u7D30\u306E\u53D6\u5F97
85598
+ - GET projects/{projectIdOrKey}/statuses \u2014 \u8AB2\u984C\u30B9\u30C6\u30FC\u30BF\u30B9\u4E00\u89A7
85599
+ - GET projects/{projectIdOrKey}/issueTypes \u2014 \u8AB2\u984C\u7A2E\u5225\u4E00\u89A7
85600
+ - GET projects/{projectIdOrKey}/categories \u2014 \u8AB2\u984C\u30AB\u30C6\u30B4\u30EA\u4E00\u89A7
85601
+
85602
+ #### \u8AB2\u984C
85603
+ - 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
85604
+ - GET issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u8A73\u7D30\u306E\u53D6\u5F97
85605
+ - GET issues/count \u2014 \u8AB2\u984C\u6570\u306E\u53D6\u5F97
85606
+ - 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
85607
+ - PATCH issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u306E\u66F4\u65B0
85608
+ - DELETE issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u306E\u524A\u9664
85609
+ - GET issues/{issueIdOrKey}/comments \u2014 \u30B3\u30E1\u30F3\u30C8\u4E00\u89A7
85610
+ - POST issues/{issueIdOrKey}/comments \u2014 \u30B3\u30E1\u30F3\u30C8\u306E\u8FFD\u52A0\uFF08body: { content: "\u30B3\u30E1\u30F3\u30C8\u5185\u5BB9" }\uFF09
85611
+
85612
+ #### Wiki
85613
+ - GET wikis \u2014 Wiki\u30DA\u30FC\u30B8\u4E00\u89A7\u306E\u53D6\u5F97\uFF08\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF: projectIdOrKey, keyword\uFF09
85614
+ - GET wikis/{wikiId} \u2014 Wiki\u30DA\u30FC\u30B8\u8A73\u7D30\u306E\u53D6\u5F97
85615
+ - POST wikis \u2014 Wiki\u30DA\u30FC\u30B8\u306E\u4F5C\u6210\uFF08body: projectId, name, content\uFF09
85616
+ - PATCH wikis/{wikiId} \u2014 Wiki\u30DA\u30FC\u30B8\u306E\u66F4\u65B0
85617
+
85618
+ #### \u30E6\u30FC\u30B6\u30FC
85619
+ - GET users \u2014 \u30B9\u30DA\u30FC\u30B9\u5185\u306E\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7
85620
+ - GET users/myself \u2014 \u8A8D\u8A3C\u6E08\u307F\u30E6\u30FC\u30B6\u30FC\u60C5\u5831\u306E\u53D6\u5F97
85621
+
85622
+ #### \u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3
85623
+ - 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
85624
+ - sort: "created", "updated", "issueType", "category", "priority" \u7B49
85625
+ - order: "asc" \u307E\u305F\u306F "desc"`
85626
+ },
85627
+ tools: tools60
85628
+ });
85629
+
85630
+ // ../connectors/src/connectors/gamma/setup.ts
85631
+ var gammaOnboarding = new ConnectorOnboarding({
85632
+ dataOverviewInstructions: {
85633
+ en: `1. Call gamma_request with GET /themes to list available themes in the workspace
85634
+ 2. Call gamma_request with GET /folders to list workspace folders
85635
+ 3. Try generating a simple presentation with gamma_generate: inputText "Sample presentation about AI", textMode "generate", numCards 3`,
85636
+ 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
85637
+ 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
85638
+ 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`
85639
+ }
85640
+ });
85641
+
85642
+ // ../connectors/src/connectors/gamma/parameters.ts
85643
+ var parameters61 = {
85644
+ apiKey: new ParameterDefinition({
85645
+ slug: "api-key",
85646
+ name: "Gamma API Key",
85647
+ description: "The Gamma API key for authentication. Generate from Account Settings > API Keys. Requires Pro, Ultra, Teams, or Business plan.",
85648
+ envVarBaseKey: "GAMMA_API_KEY",
85649
+ type: "text",
85650
+ secret: true,
85651
+ required: true
85652
+ })
85653
+ };
85654
+
85655
+ // ../connectors/src/connectors/gamma/tools/request.ts
85656
+ import { z as z77 } from "zod";
85657
+ var BASE_URL40 = "https://public-api.gamma.app/v1.0";
85658
+ var REQUEST_TIMEOUT_MS60 = 6e4;
85659
+ var inputSchema75 = z77.object({
85660
+ toolUseIntent: z77.string().optional().describe(
85661
+ "Brief description of what you intend to accomplish with this tool call"
85662
+ ),
85663
+ connectionId: z77.string().describe("ID of the Gamma connection to use"),
85664
+ method: z77.enum(["GET", "POST"]).describe("HTTP method. GET for listing resources, POST for creating."),
85665
+ path: z77.string().describe(
85666
+ "API path (e.g., '/themes', '/folders', '/generations', '/generations/{generationId}')"
85667
+ ),
85668
+ body: z77.record(z77.string(), z77.unknown()).optional().describe("Request body (JSON) for POST requests")
85669
+ });
85670
+ var outputSchema75 = z77.discriminatedUnion("success", [
85671
+ z77.object({
85672
+ success: z77.literal(true),
85673
+ status: z77.number(),
85674
+ data: z77.unknown()
85675
+ }),
85676
+ z77.object({
85677
+ success: z77.literal(false),
85678
+ error: z77.string()
85679
+ })
85680
+ ]);
85681
+ var requestTool46 = new ConnectorTool({
85682
+ name: "request",
85683
+ description: `Send authenticated requests to the Gamma REST API.
85684
+ Authentication is handled automatically using the API Key (X-API-KEY header).
85685
+ Use this tool for listing themes, listing folders, checking generation status, and other read operations.
85686
+ For creating presentations/documents, prefer the gamma_generate tool instead.`,
85687
+ inputSchema: inputSchema75,
85688
+ outputSchema: outputSchema75,
85689
+ async execute({ connectionId, method, path: path4, body }, connections) {
85690
+ const connection = connections.find((c6) => c6.id === connectionId);
85691
+ if (!connection) {
85692
+ return {
85693
+ success: false,
85694
+ error: `Connection ${connectionId} not found`
85695
+ };
85696
+ }
85697
+ console.log(
85698
+ `[connector-request] gamma/${connection.name}: ${method} ${path4}`
85699
+ );
85700
+ try {
85701
+ const apiKey = parameters61.apiKey.getValue(connection);
85702
+ const url = `${BASE_URL40}${path4}`;
85703
+ const controller = new AbortController();
85704
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS60);
85705
+ try {
85706
+ const response = await fetch(url, {
85707
+ method,
85708
+ headers: {
85709
+ "X-API-KEY": apiKey,
85710
+ "Content-Type": "application/json"
85711
+ },
85712
+ body: body ? JSON.stringify(body) : void 0,
85713
+ signal: controller.signal
85714
+ });
85715
+ const data = await response.json();
85716
+ if (!response.ok) {
85717
+ const err = data;
85718
+ const errorMessage = typeof err?.message === "string" ? err.message : typeof err?.error === "string" ? err.error : `HTTP ${response.status} ${response.statusText}`;
85719
+ return { success: false, error: errorMessage };
85720
+ }
85721
+ return { success: true, status: response.status, data };
85722
+ } finally {
85723
+ clearTimeout(timeout);
85724
+ }
85725
+ } catch (err) {
85726
+ const msg = err instanceof Error ? err.message : String(err);
85727
+ return { success: false, error: msg };
85728
+ }
85729
+ }
85730
+ });
85731
+
85732
+ // ../connectors/src/connectors/gamma/tools/generate.ts
85733
+ import { z as z78 } from "zod";
85734
+ var BASE_URL41 = "https://public-api.gamma.app/v1.0";
85735
+ var POLL_INTERVAL_MS3 = 5e3;
85736
+ var MAX_POLL_DURATION_MS = 3e5;
85737
+ var inputSchema76 = z78.object({
85738
+ toolUseIntent: z78.string().optional().describe(
85739
+ "Brief description of what you intend to accomplish with this tool call"
85740
+ ),
85741
+ connectionId: z78.string().describe("ID of the Gamma connection to use"),
85742
+ inputText: z78.string().describe(
85743
+ "Content for the generation. Can include text and image URLs. Max ~400,000 characters."
85744
+ ),
85745
+ textMode: z78.enum(["generate", "condense", "preserve"]).describe(
85746
+ "How inputText is modified: 'generate' creates new content from the topic, 'condense' shortens existing text, 'preserve' keeps text as-is."
85747
+ ),
85748
+ format: z78.enum(["presentation", "document", "webpage", "social"]).optional().describe("Type of artifact to create. Defaults to 'presentation'."),
85749
+ numCards: z78.number().int().min(1).max(75).optional().describe("Number of cards/slides. Defaults to 10."),
85750
+ themeId: z78.string().optional().describe(
85751
+ "Theme ID for look and feel. Use gamma_request GET /themes to list available themes."
85752
+ ),
85753
+ tone: z78.string().optional().describe(
85754
+ "Tone/voice of the output (e.g., 'professional', 'casual', 'academic'). Max 500 chars."
85755
+ ),
85756
+ audience: z78.string().optional().describe(
85757
+ "Target audience description (e.g., 'marketing executives'). Max 500 chars."
85758
+ ),
85759
+ language: z78.string().optional().describe("Output language code (e.g., 'en', 'ja'). Defaults to 'en'."),
85760
+ textAmount: z78.enum(["brief", "medium", "detailed", "extensive"]).optional().describe("Text volume per card. Defaults to 'medium'."),
85761
+ imageSource: z78.enum([
85762
+ "aiGenerated",
85763
+ "pictographic",
85764
+ "pexels",
85765
+ "giphy",
85766
+ "webAllImages",
85767
+ "webFreeToUse",
85768
+ "webFreeToUseCommercially",
85769
+ "themeAccent",
85770
+ "placeholder",
85771
+ "noImages"
85772
+ ]).optional().describe("Image source. Defaults to 'aiGenerated'."),
85773
+ additionalInstructions: z78.string().optional().describe(
85774
+ "Additional specifications for content, layout, and aesthetics. Max 5000 chars."
85775
+ ),
85776
+ exportAs: z78.enum(["pdf", "pptx", "png"]).optional().describe("Export file format. If omitted, no export file is generated.")
85777
+ });
85778
+ var outputSchema76 = z78.discriminatedUnion("success", [
85779
+ z78.object({
85780
+ success: z78.literal(true),
85781
+ generationId: z78.string(),
85782
+ gammaId: z78.string(),
85783
+ gammaUrl: z78.string(),
85784
+ exportUrl: z78.string().optional(),
85785
+ credits: z78.object({
85786
+ deducted: z78.number(),
85787
+ remaining: z78.number()
85788
+ }).optional()
85789
+ }),
85790
+ z78.object({
85791
+ success: z78.literal(false),
85792
+ error: z78.string()
85793
+ })
85794
+ ]);
85795
+ var generateTool = new ConnectorTool({
85796
+ name: "generate",
85797
+ description: `Generate a presentation, document, webpage, or social post using Gamma AI.
85798
+ This tool creates the generation, then automatically polls until completion and returns the result URL.
85799
+ Use gamma_request GET /themes first if you want to pick a specific theme.`,
85800
+ inputSchema: inputSchema76,
85801
+ outputSchema: outputSchema76,
85802
+ async execute({
85803
+ connectionId,
85804
+ inputText,
85805
+ textMode,
85806
+ format: format2,
85807
+ numCards,
85808
+ themeId,
85809
+ tone,
85810
+ audience,
85811
+ language,
85812
+ textAmount,
85813
+ imageSource,
85814
+ additionalInstructions,
85815
+ exportAs
85816
+ }, connections) {
85817
+ const connection = connections.find((c6) => c6.id === connectionId);
85818
+ if (!connection) {
85819
+ return {
85820
+ success: false,
85821
+ error: `Connection ${connectionId} not found`
85822
+ };
85823
+ }
85824
+ console.log(
85825
+ `[connector-generate] gamma/${connection.name}: creating ${format2 ?? "presentation"}`
85826
+ );
85827
+ try {
85828
+ const apiKey = parameters61.apiKey.getValue(connection);
85829
+ const headers = {
85830
+ "X-API-KEY": apiKey,
85831
+ "Content-Type": "application/json"
85832
+ };
85833
+ const body = {
85834
+ inputText,
85835
+ textMode
85836
+ };
85837
+ if (format2) body.format = format2;
85838
+ if (numCards) body.numCards = numCards;
85839
+ if (themeId) body.themeId = themeId;
85840
+ if (additionalInstructions)
85841
+ body.additionalInstructions = additionalInstructions;
85842
+ if (exportAs) body.exportAs = exportAs;
85843
+ const textOptions = {};
85844
+ if (tone) textOptions.tone = tone;
85845
+ if (audience) textOptions.audience = audience;
85846
+ if (language) textOptions.language = language;
85847
+ if (textAmount) textOptions.amount = textAmount;
85848
+ if (Object.keys(textOptions).length > 0) body.textOptions = textOptions;
85849
+ if (imageSource) body.imageOptions = { source: imageSource };
85850
+ const createRes = await fetch(`${BASE_URL41}/generations`, {
85851
+ method: "POST",
85852
+ headers,
85853
+ body: JSON.stringify(body)
85854
+ });
85855
+ const createData = await createRes.json();
85856
+ if (!createRes.ok) {
85857
+ const errorMessage = typeof createData?.message === "string" ? createData.message : typeof createData?.error === "string" ? createData.error : `HTTP ${createRes.status} ${createRes.statusText}`;
85858
+ return { success: false, error: errorMessage };
85859
+ }
85860
+ const generationId = createData.generationId;
85861
+ if (!generationId) {
85862
+ return {
85863
+ success: false,
85864
+ error: "No generationId returned from API"
85865
+ };
85866
+ }
85867
+ const deadline = Date.now() + MAX_POLL_DURATION_MS;
85868
+ while (Date.now() < deadline) {
85869
+ await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS3));
85870
+ const pollRes = await fetch(`${BASE_URL41}/generations/${generationId}`, {
85871
+ method: "GET",
85872
+ headers
85873
+ });
85874
+ const pollData = await pollRes.json();
85875
+ if (!pollRes.ok) {
85876
+ const errorMessage = typeof pollData?.message === "string" ? pollData.message : `Polling failed: HTTP ${pollRes.status}`;
85877
+ return { success: false, error: errorMessage };
85878
+ }
85879
+ const status = pollData.status;
85880
+ if (status === "completed") {
85881
+ return {
85882
+ success: true,
85883
+ generationId,
85884
+ gammaId: pollData.gammaId,
85885
+ gammaUrl: pollData.gammaUrl,
85886
+ exportUrl: pollData.exportUrl || void 0,
85887
+ credits: pollData.credits
85888
+ };
85889
+ }
85890
+ if (status === "failed") {
85891
+ const error2 = pollData.error;
85892
+ const errorMessage = typeof error2?.message === "string" ? error2.message : "Generation failed";
85893
+ return { success: false, error: errorMessage };
85894
+ }
85895
+ }
85896
+ return {
85897
+ success: false,
85898
+ error: `Generation timed out after ${MAX_POLL_DURATION_MS / 1e3}s. generationId: ${generationId} \u2014 you can check status with GET /generations/${generationId}`
85899
+ };
85900
+ } catch (err) {
85901
+ const msg = err instanceof Error ? err.message : String(err);
85902
+ return { success: false, error: msg };
85903
+ }
85904
+ }
85905
+ });
85906
+
85907
+ // ../connectors/src/connectors/gamma/index.ts
85908
+ var tools61 = { request: requestTool46, generate: generateTool };
85909
+ var gammaConnector = new ConnectorPlugin({
85910
+ slug: "gamma",
85911
+ authType: AUTH_TYPES.API_KEY,
85912
+ name: "Gamma",
85913
+ description: "Connect to Gamma for AI-powered presentation, document, webpage, and social post generation.",
85914
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/KoMGPpPcgtB9oDYe1OBjS/1ba7eb061c4497106bf6d249866dc471/gamma.svg",
85915
+ parameters: parameters61,
85916
+ releaseFlag: { dev1: true, dev2: false, prod: false },
85917
+ onboarding: gammaOnboarding,
85918
+ systemPrompt: {
85919
+ en: `### Tools
85920
+
85921
+ - \`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.
85922
+ - \`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.
85923
+
85924
+ ### Business Logic
85925
+
85926
+ The business logic type for this connector is "typescript". Use the connector SDK in your handler. Do NOT read credentials from environment variables.
85927
+
85928
+ SDK methods (client created via \`connection(connectionId)\`):
85929
+ - \`client.request(path, init?)\` \u2014 low-level authenticated fetch
85930
+ - \`client.listThemes(options?)\` \u2014 list available themes (query, limit, after)
85931
+ - \`client.listFolders(options?)\` \u2014 list workspace folders (query, limit, after)
85932
+ - \`client.createGeneration(options)\` \u2014 create a generation, returns generationId
85933
+ - \`client.getGeneration(generationId)\` \u2014 get generation status and result
85934
+ - \`client.generateAndWait(options)\` \u2014 create generation and poll until completion
85935
+
85936
+ \`\`\`ts
85937
+ import type { Context } from "hono";
85938
+ import { connection } from "@squadbase/vite-server/connectors/gamma";
85939
+
85940
+ const gamma = connection("<connectionId>");
85941
+
85942
+ export default async function handler(c: Context) {
85943
+ const { topic, numCards = 5 } = await c.req.json<{
85944
+ topic: string;
85945
+ numCards?: number;
85946
+ }>();
85947
+
85948
+ const result = await gamma.generateAndWait({
85949
+ inputText: topic,
85950
+ textMode: "generate",
85951
+ format: "presentation",
85952
+ numCards,
85953
+ });
85954
+
85955
+ return c.json(result);
85956
+ }
85957
+ \`\`\`
85958
+
85959
+ ### Gamma REST API Reference
85960
+
85961
+ - Base URL: \`https://public-api.gamma.app/v1.0\`
85962
+ - Authentication: X-API-KEY header (handled automatically)
85963
+
85964
+ #### Endpoints
85965
+
85966
+ - POST \`/generations\` \u2014 Create a generation (presentation, document, webpage, social)
85967
+ - Required: \`inputText\` (string), \`textMode\` ("generate" | "condense" | "preserve")
85968
+ - Optional: \`format\`, \`numCards\`, \`themeId\`, \`textOptions\` (tone, audience, language, amount), \`imageOptions\` (source, model, style), \`additionalInstructions\`, \`exportAs\` (pdf, pptx, png), \`folderIds\`, \`sharingOptions\`
85969
+ - Returns: \`{ generationId }\`
85970
+ - GET \`/generations/{generationId}\` \u2014 Poll generation status
85971
+ - Returns: \`{ generationId, status, gammaId?, gammaUrl?, exportUrl?, credits?, error? }\`
85972
+ - Status values: "pending", "completed", "failed"
85973
+ - Poll every 5 seconds until status changes from "pending"
85974
+ - GET \`/themes\` \u2014 List available themes (query, limit, after for pagination)
85975
+ - GET \`/folders\` \u2014 List workspace folders (query, limit, after for pagination)
85976
+
85977
+ #### Generation Formats
85978
+ - \`presentation\` \u2014 Slide deck (dimensions: fluid, 16x9, 4x3)
85979
+ - \`document\` \u2014 Document (dimensions: fluid, pageless, letter, a4)
85980
+ - \`webpage\` \u2014 Web page
85981
+ - \`social\` \u2014 Social media post (dimensions: 1x1, 4x5, 9x16)
85982
+
85983
+ #### Text Modes
85984
+ - \`generate\` \u2014 AI generates new content from the input topic
85985
+ - \`condense\` \u2014 AI shortens the provided text
85986
+ - \`preserve\` \u2014 Input text is used as-is
85987
+
85988
+ #### Image Sources
85989
+ - \`aiGenerated\`, \`pictographic\`, \`pexels\`, \`giphy\`, \`webFreeToUseCommercially\`, \`noImages\`, etc.`,
85990
+ ja: `### \u30C4\u30FC\u30EB
85991
+
85992
+ - \`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
85993
+ - \`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
85994
+
85995
+ ### Business Logic
85996
+
85997
+ \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
85998
+
85999
+ SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
86000
+ - \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304Dfetch
86001
+ - \`client.listThemes(options?)\` \u2014 \u30C6\u30FC\u30DE\u4E00\u89A7\u306E\u53D6\u5F97\uFF08query, limit, after\uFF09
86002
+ - \`client.listFolders(options?)\` \u2014 \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\u306E\u53D6\u5F97\uFF08query, limit, after\uFF09
86003
+ - \`client.createGeneration(options)\` \u2014 \u751F\u6210\u306E\u4F5C\u6210\u3001generationId\u3092\u8FD4\u3059
86004
+ - \`client.getGeneration(generationId)\` \u2014 \u751F\u6210\u30B9\u30C6\u30FC\u30BF\u30B9\u3068\u7D50\u679C\u306E\u53D6\u5F97
86005
+ - \`client.generateAndWait(options)\` \u2014 \u751F\u6210\u3092\u4F5C\u6210\u3057\u5B8C\u4E86\u307E\u3067\u30DD\u30FC\u30EA\u30F3\u30B0
86006
+
86007
+ \`\`\`ts
86008
+ import type { Context } from "hono";
86009
+ import { connection } from "@squadbase/vite-server/connectors/gamma";
86010
+
86011
+ const gamma = connection("<connectionId>");
86012
+
86013
+ export default async function handler(c: Context) {
86014
+ const { topic, numCards = 5 } = await c.req.json<{
86015
+ topic: string;
86016
+ numCards?: number;
86017
+ }>();
86018
+
86019
+ const result = await gamma.generateAndWait({
86020
+ inputText: topic,
86021
+ textMode: "generate",
86022
+ format: "presentation",
86023
+ numCards,
86024
+ });
86025
+
86026
+ return c.json(result);
86027
+ }
86028
+ \`\`\`
86029
+
86030
+ ### Gamma REST API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
86031
+
86032
+ - \u30D9\u30FC\u30B9URL: \`https://public-api.gamma.app/v1.0\`
86033
+ - \u8A8D\u8A3C: X-API-KEY\u30D8\u30C3\u30C0\u30FC\uFF08\u81EA\u52D5\u8A2D\u5B9A\uFF09
86034
+
86035
+ #### \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8
86036
+
86037
+ - 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
86038
+ - \u5FC5\u9808: \`inputText\`\uFF08\u6587\u5B57\u5217\uFF09\u3001\`textMode\`\uFF08"generate" | "condense" | "preserve"\uFF09
86039
+ - \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\`
86040
+ - \u8FD4\u5374: \`{ generationId }\`
86041
+ - GET \`/generations/{generationId}\` \u2014 \u751F\u6210\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30DD\u30FC\u30EA\u30F3\u30B0
86042
+ - \u8FD4\u5374: \`{ generationId, status, gammaId?, gammaUrl?, exportUrl?, credits?, error? }\`
86043
+ - \u30B9\u30C6\u30FC\u30BF\u30B9\u5024: "pending", "completed", "failed"
86044
+ - status\u304C"pending"\u3067\u306A\u304F\u306A\u308B\u307E\u30675\u79D2\u3054\u3068\u306B\u30DD\u30FC\u30EA\u30F3\u30B0
86045
+ - GET \`/themes\` \u2014 \u30C6\u30FC\u30DE\u4E00\u89A7\uFF08query, limit, after\u3067\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\uFF09
86046
+ - GET \`/folders\` \u2014 \u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\uFF08query, limit, after\u3067\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\uFF09
86047
+
86048
+ #### \u751F\u6210\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8
86049
+ - \`presentation\` \u2014 \u30B9\u30E9\u30A4\u30C9\u30C7\u30C3\u30AD\uFF08\u5BF8\u6CD5: fluid, 16x9, 4x3\uFF09
86050
+ - \`document\` \u2014 \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\uFF08\u5BF8\u6CD5: fluid, pageless, letter, a4\uFF09
86051
+ - \`webpage\` \u2014 \u30A6\u30A7\u30D6\u30DA\u30FC\u30B8
86052
+ - \`social\` \u2014 \u30BD\u30FC\u30B7\u30E3\u30EB\u30E1\u30C7\u30A3\u30A2\u6295\u7A3F\uFF08\u5BF8\u6CD5: 1x1, 4x5, 9x16\uFF09
86053
+
86054
+ #### \u30C6\u30AD\u30B9\u30C8\u30E2\u30FC\u30C9
86055
+ - \`generate\` \u2014 AI\u304C\u5165\u529B\u30C8\u30D4\u30C3\u30AF\u304B\u3089\u65B0\u3057\u3044\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u751F\u6210
86056
+ - \`condense\` \u2014 AI\u304C\u63D0\u4F9B\u3055\u308C\u305F\u30C6\u30AD\u30B9\u30C8\u3092\u77ED\u7E2E
86057
+ - \`preserve\` \u2014 \u5165\u529B\u30C6\u30AD\u30B9\u30C8\u3092\u305D\u306E\u307E\u307E\u4F7F\u7528
86058
+
86059
+ #### \u753B\u50CF\u30BD\u30FC\u30B9
86060
+ - \`aiGenerated\`, \`pictographic\`, \`pexels\`, \`giphy\`, \`webFreeToUseCommercially\`, \`noImages\` \u306A\u3069`
86061
+ },
86062
+ tools: tools61
86063
+ });
86064
+
85355
86065
  // ../connectors/src/connectors/registry.ts
85356
86066
  var plugins = {
85357
86067
  snowflake: snowflakeConnector,
@@ -85412,7 +86122,9 @@ var plugins = {
85412
86122
  intercom: intercomConnector,
85413
86123
  intercomOauth: intercomOauthConnector,
85414
86124
  mixpanel: mixpanelConnector,
85415
- grafana: grafanaConnector
86125
+ grafana: grafanaConnector,
86126
+ backlog: backlogConnector,
86127
+ gamma: gammaConnector
85416
86128
  };
85417
86129
  var connectors = {
85418
86130
  ...plugins,
@@ -85613,62 +86325,62 @@ function resolveParams2(entry, connectionId, plugin) {
85613
86325
  var { getQuery, loadConnections, reloadEnvFile, watchConnectionsFile } = createConnectorRegistry();
85614
86326
 
85615
86327
  // src/types/server-logic.ts
85616
- import { z as z76 } from "zod";
85617
- var parameterMetaSchema = z76.object({
85618
- name: z76.string(),
85619
- type: z76.enum(["string", "number", "boolean"]),
85620
- description: z76.string(),
85621
- required: z76.boolean().optional(),
85622
- default: z76.union([z76.string(), z76.number(), z76.boolean()]).optional()
85623
- });
85624
- var serverLogicCacheConfigSchema = z76.object({
85625
- ttl: z76.number(),
85626
- staleWhileRevalidate: z76.boolean().optional()
85627
- });
85628
- var serverLogicSchemaObjectSchema = z76.lazy(
85629
- () => z76.object({
85630
- type: z76.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
85631
- format: z76.string().optional(),
85632
- description: z76.string().optional(),
85633
- nullable: z76.boolean().optional(),
85634
- enum: z76.array(z76.union([z76.string(), z76.number(), z76.boolean(), z76.null()])).optional(),
86328
+ import { z as z79 } from "zod";
86329
+ var parameterMetaSchema = z79.object({
86330
+ name: z79.string(),
86331
+ type: z79.enum(["string", "number", "boolean"]),
86332
+ description: z79.string(),
86333
+ required: z79.boolean().optional(),
86334
+ default: z79.union([z79.string(), z79.number(), z79.boolean()]).optional()
86335
+ });
86336
+ var serverLogicCacheConfigSchema = z79.object({
86337
+ ttl: z79.number(),
86338
+ staleWhileRevalidate: z79.boolean().optional()
86339
+ });
86340
+ var serverLogicSchemaObjectSchema = z79.lazy(
86341
+ () => z79.object({
86342
+ type: z79.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
86343
+ format: z79.string().optional(),
86344
+ description: z79.string().optional(),
86345
+ nullable: z79.boolean().optional(),
86346
+ enum: z79.array(z79.union([z79.string(), z79.number(), z79.boolean(), z79.null()])).optional(),
85635
86347
  items: serverLogicSchemaObjectSchema.optional(),
85636
- properties: z76.record(z76.string(), serverLogicSchemaObjectSchema).optional(),
85637
- required: z76.array(z76.string()).optional(),
85638
- additionalProperties: z76.union([z76.boolean(), serverLogicSchemaObjectSchema]).optional(),
85639
- minimum: z76.number().optional(),
85640
- maximum: z76.number().optional(),
85641
- minLength: z76.number().optional(),
85642
- maxLength: z76.number().optional(),
85643
- pattern: z76.string().optional()
86348
+ properties: z79.record(z79.string(), serverLogicSchemaObjectSchema).optional(),
86349
+ required: z79.array(z79.string()).optional(),
86350
+ additionalProperties: z79.union([z79.boolean(), serverLogicSchemaObjectSchema]).optional(),
86351
+ minimum: z79.number().optional(),
86352
+ maximum: z79.number().optional(),
86353
+ minLength: z79.number().optional(),
86354
+ maxLength: z79.number().optional(),
86355
+ pattern: z79.string().optional()
85644
86356
  })
85645
86357
  );
85646
- var serverLogicMediaTypeSchema = z76.object({
86358
+ var serverLogicMediaTypeSchema = z79.object({
85647
86359
  schema: serverLogicSchemaObjectSchema.optional(),
85648
- example: z76.unknown().optional()
86360
+ example: z79.unknown().optional()
85649
86361
  });
85650
- var serverLogicResponseSchema = z76.object({
85651
- description: z76.string().optional(),
85652
- content: z76.record(z76.string(), serverLogicMediaTypeSchema).optional()
86362
+ var serverLogicResponseSchema = z79.object({
86363
+ description: z79.string().optional(),
86364
+ content: z79.record(z79.string(), serverLogicMediaTypeSchema).optional()
85653
86365
  });
85654
86366
  var jsonBaseFields = {
85655
- description: z76.string(),
85656
- parameters: z76.array(parameterMetaSchema).optional(),
86367
+ description: z79.string(),
86368
+ parameters: z79.array(parameterMetaSchema).optional(),
85657
86369
  response: serverLogicResponseSchema.optional(),
85658
86370
  cache: serverLogicCacheConfigSchema.optional()
85659
86371
  };
85660
- var jsonSqlServerLogicSchema = z76.object({
86372
+ var jsonSqlServerLogicSchema = z79.object({
85661
86373
  ...jsonBaseFields,
85662
- type: z76.literal("sql").optional(),
85663
- query: z76.string(),
85664
- connectionId: z76.string()
86374
+ type: z79.literal("sql").optional(),
86375
+ query: z79.string(),
86376
+ connectionId: z79.string()
85665
86377
  });
85666
- var jsonTypeScriptServerLogicSchema = z76.object({
86378
+ var jsonTypeScriptServerLogicSchema = z79.object({
85667
86379
  ...jsonBaseFields,
85668
- type: z76.literal("typescript"),
85669
- handlerPath: z76.string()
86380
+ type: z79.literal("typescript"),
86381
+ handlerPath: z79.string()
85670
86382
  });
85671
- var anyJsonServerLogicSchema = z76.union([
86383
+ var anyJsonServerLogicSchema = z79.union([
85672
86384
  jsonTypeScriptServerLogicSchema,
85673
86385
  jsonSqlServerLogicSchema
85674
86386
  ]);