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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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 z78 = struct[4].length;
18896
18896
  let it = struct[anno.it];
18897
- if (it && z77 === it.length) {
18897
+ if (it && z78 === 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(z78);
18902
+ for (let i6 = 0; i6 < z78; ++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 z78 = 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 < z78; ++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 z79 = v7.length;
19605
+ if (z79 < 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[z79 - 1] === `"`) {
19609
+ v7 = v7.slice(1, z79 - 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: parameters61 } = this;
21008
+ if (parameters61.length === 0) {
21009
21009
  return false;
21010
21010
  }
21011
- for (const param of parameters60) {
21011
+ for (const param of parameters61) {
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: parameters61, 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(parameters61).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(parameters61).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, inputSchema75) {
27347
+ const members = inputSchema75.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 (!inputSchema75.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 inputSchema75 = 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(), inputSchema75);
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 outputSchema75 = NormalizedSchema.of(operationSchema.output);
28220
+ for (const [name, member2] of outputSchema75.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(parameters61) {
32085
32085
  return async (awsIdentityProperties) => {
32086
- parameters60.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
32086
+ parameters61.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) => parameters61.clientConfig?.[property] ?? parameters61.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
32089
+ const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters61.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters61.logger), SessionToken } = throwOnMissingCredentials(parameters61.logger) } = await (parameters61.client ?? new CognitoIdentityClient2(Object.assign({}, parameters61.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: parameters61.customRoleArn,
32095
+ IdentityId: parameters61.identityId,
32096
+ Logins: parameters61.logins ? await resolveLogins(parameters61.logins) : void 0
32097
32097
  }));
32098
32098
  return {
32099
- identityId: parameters60.identityId,
32099
+ identityId: parameters61.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, z78, 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
+ z78 = LOG_BASE - s6.length;
44664
+ for (; z78--; 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, z78) {
44698
44698
  var len, zs;
44699
44699
  if (e6 < 0) {
44700
- for (zs = z77 + "."; ++e6; zs += z77) ;
44700
+ for (zs = z78 + "."; ++e6; zs += z78) ;
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 = z78, e6 -= len; --e6; zs += z78) ;
44706
44706
  str += zs;
44707
44707
  } else if (e6 < len) {
44708
44708
  str = str.slice(0, e6) + "." + str.slice(e6);
@@ -85351,6 +85351,279 @@ export default async function handler(c: Context) {
85351
85351
  tools: tools59
85352
85352
  });
85353
85353
 
85354
+ // ../connectors/src/connectors/backlog/setup.ts
85355
+ var backlogOnboarding = new ConnectorOnboarding({
85356
+ dataOverviewInstructions: {
85357
+ en: `1. Call backlog-api-key_request with GET space to verify the connection and get space information
85358
+ 2. Call backlog-api-key_request with GET projects to list all accessible projects
85359
+ 3. For key projects, call backlog-api-key_request with GET issues?projectId[]={projectId}&count=5&order=desc to retrieve recent issues
85360
+ 4. Call backlog-api-key_request with GET projects/{projectIdOrKey}/statuses to understand the workflow statuses`,
85361
+ 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
85362
+ 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
85363
+ 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
85364
+ 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`
85365
+ }
85366
+ });
85367
+
85368
+ // ../connectors/src/connectors/backlog/parameters.ts
85369
+ var parameters60 = {
85370
+ spaceUrl: new ParameterDefinition({
85371
+ slug: "space-url",
85372
+ name: "Backlog Space URL",
85373
+ 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",
85374
+ envVarBaseKey: "BACKLOG_SPACE_URL",
85375
+ type: "text",
85376
+ secret: false,
85377
+ required: true
85378
+ }),
85379
+ apiKey: new ParameterDefinition({
85380
+ slug: "api-key",
85381
+ name: "API Key",
85382
+ description: "Your Backlog API key. You can generate one at: Your Space > Personal Settings > API (https://your-space.backlog.com/EditApiSettings.action).",
85383
+ envVarBaseKey: "BACKLOG_API_KEY",
85384
+ type: "text",
85385
+ secret: true,
85386
+ required: true
85387
+ })
85388
+ };
85389
+
85390
+ // ../connectors/src/connectors/backlog/tools/request.ts
85391
+ import { z as z76 } from "zod";
85392
+ var REQUEST_TIMEOUT_MS59 = 6e4;
85393
+ var inputSchema74 = z76.object({
85394
+ toolUseIntent: z76.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
85395
+ connectionId: z76.string().describe("ID of the Backlog connection to use"),
85396
+ 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."),
85397
+ 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."),
85398
+ 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).")
85399
+ });
85400
+ var outputSchema74 = z76.discriminatedUnion("success", [
85401
+ z76.object({
85402
+ success: z76.literal(true),
85403
+ status: z76.number(),
85404
+ data: z76.union([z76.record(z76.string(), z76.unknown()), z76.array(z76.unknown())])
85405
+ }),
85406
+ z76.object({
85407
+ success: z76.literal(false),
85408
+ error: z76.string()
85409
+ })
85410
+ ]);
85411
+ var requestTool45 = new ConnectorTool({
85412
+ name: "request",
85413
+ description: `Send authenticated requests to the Backlog REST API (v2).
85414
+ Authentication is handled automatically by appending the apiKey query parameter to every request.
85415
+ Use this tool for all Backlog operations: listing projects, searching and creating issues, managing wikis, retrieving users, and more.
85416
+ The base URL and API key are configured per connection \u2014 only specify the API path relative to /api/v2/.
85417
+ Do NOT include the apiKey parameter yourself; it is injected automatically.`,
85418
+ inputSchema: inputSchema74,
85419
+ outputSchema: outputSchema74,
85420
+ async execute({ connectionId, method, path: path5, body }, connections) {
85421
+ const connection2 = connections.find((c6) => c6.id === connectionId);
85422
+ if (!connection2) {
85423
+ return { success: false, error: `Connection ${connectionId} not found` };
85424
+ }
85425
+ console.log(`[connector-request] backlog-api-key/${connection2.name}: ${method} ${path5}`);
85426
+ try {
85427
+ const spaceUrl = parameters60.spaceUrl.getValue(connection2);
85428
+ const apiKey = parameters60.apiKey.getValue(connection2);
85429
+ const separator = path5.includes("?") ? "&" : "?";
85430
+ const url = `${spaceUrl.replace(/\/+$/, "")}/api/v2/${path5}${separator}apiKey=${apiKey}`;
85431
+ const controller = new AbortController();
85432
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS59);
85433
+ try {
85434
+ const headers = {
85435
+ Accept: "application/json"
85436
+ };
85437
+ if (body) {
85438
+ headers["Content-Type"] = "application/json";
85439
+ }
85440
+ const response = await fetch(url, {
85441
+ method,
85442
+ headers,
85443
+ body: body ? JSON.stringify(body) : void 0,
85444
+ signal: controller.signal
85445
+ });
85446
+ if (response.status === 204) {
85447
+ return { success: true, status: 204, data: {} };
85448
+ }
85449
+ const data = await response.json();
85450
+ if (!response.ok) {
85451
+ const errData = data;
85452
+ const errors2 = errData?.errors;
85453
+ const errorMessage = Array.isArray(errors2) ? errors2.map((e6) => e6.message).join("; ") : errData?.message ?? `HTTP ${response.status} ${response.statusText}`;
85454
+ return { success: false, error: errorMessage };
85455
+ }
85456
+ return { success: true, status: response.status, data };
85457
+ } finally {
85458
+ clearTimeout(timeout);
85459
+ }
85460
+ } catch (err) {
85461
+ const msg = err instanceof Error ? err.message : String(err);
85462
+ return { success: false, error: msg };
85463
+ }
85464
+ }
85465
+ });
85466
+
85467
+ // ../connectors/src/connectors/backlog/index.ts
85468
+ var tools60 = { request: requestTool45 };
85469
+ var backlogConnector = new ConnectorPlugin({
85470
+ slug: "backlog",
85471
+ authType: AUTH_TYPES.API_KEY,
85472
+ name: "Backlog",
85473
+ description: "Connect to Nulab Backlog for project management, issue tracking, and wiki data retrieval using API key authentication.",
85474
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6KcVBGf3mUHnuCOQgQMvtT/e8558c7990e40e3be46948e9476190fb/backlog-favicon.svg",
85475
+ parameters: parameters60,
85476
+ releaseFlag: { dev1: true, dev2: true, prod: false },
85477
+ onboarding: backlogOnboarding,
85478
+ systemPrompt: {
85479
+ en: `### Tools
85480
+
85481
+ - \`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.
85482
+
85483
+ ### Business Logic
85484
+
85485
+ 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.
85486
+
85487
+ #### Example
85488
+
85489
+ \`\`\`ts
85490
+ import { connection } from "@squadbase/vite-server/connectors/backlog-api-key";
85491
+
85492
+ const backlog = connection("<connectionId>");
85493
+
85494
+ // List projects
85495
+ const res = await backlog.request("/api/v2/projects");
85496
+ const projects = await res.json();
85497
+
85498
+ // Get issues for a project
85499
+ const issuesRes = await backlog.request("/api/v2/issues?projectId[]=12345&count=20&sort=updated&order=desc");
85500
+ const issues = await issuesRes.json();
85501
+
85502
+ // Create an issue
85503
+ await backlog.request("/api/v2/issues", {
85504
+ method: "POST",
85505
+ body: JSON.stringify({
85506
+ projectId: 12345,
85507
+ summary: "New issue title",
85508
+ issueTypeId: 67890,
85509
+ priorityId: 3,
85510
+ }),
85511
+ });
85512
+ \`\`\`
85513
+
85514
+ ### Backlog REST API v2 Reference
85515
+
85516
+ #### Space
85517
+ - GET space \u2014 Get space information
85518
+ - GET space/activities \u2014 Get recent activities in the space
85519
+
85520
+ #### Projects
85521
+ - GET projects \u2014 List all projects (query params: archived, all)
85522
+ - GET projects/{projectIdOrKey} \u2014 Get project details
85523
+ - GET projects/{projectIdOrKey}/statuses \u2014 List issue statuses
85524
+ - GET projects/{projectIdOrKey}/issueTypes \u2014 List issue types
85525
+ - GET projects/{projectIdOrKey}/categories \u2014 List issue categories
85526
+
85527
+ #### Issues
85528
+ - GET issues \u2014 Search issues (query params: projectId[], statusId[], assigneeId[], sort, order, count, offset, keyword)
85529
+ - GET issues/{issueIdOrKey} \u2014 Get issue details
85530
+ - GET issues/count \u2014 Get issue count
85531
+ - POST issues \u2014 Create an issue (body: projectId, summary, issueTypeId, priorityId, and optional fields)
85532
+ - PATCH issues/{issueIdOrKey} \u2014 Update an issue
85533
+ - DELETE issues/{issueIdOrKey} \u2014 Delete an issue
85534
+ - GET issues/{issueIdOrKey}/comments \u2014 List comments
85535
+ - POST issues/{issueIdOrKey}/comments \u2014 Add a comment (body: { content: "comment text" })
85536
+
85537
+ #### Wiki
85538
+ - GET wikis \u2014 List wiki pages (query params: projectIdOrKey, keyword)
85539
+ - GET wikis/{wikiId} \u2014 Get wiki page details
85540
+ - POST wikis \u2014 Create a wiki page (body: projectId, name, content)
85541
+ - PATCH wikis/{wikiId} \u2014 Update a wiki page
85542
+
85543
+ #### Users
85544
+ - GET users \u2014 List users in the space
85545
+ - GET users/myself \u2014 Get authenticated user info
85546
+
85547
+ #### Pagination
85548
+ - Use count (max 100, default 20) and offset parameters for pagination
85549
+ - sort: "created", "updated", "issueType", "category", "priority", etc.
85550
+ - order: "asc" or "desc"`,
85551
+ ja: `### \u30C4\u30FC\u30EB
85552
+
85553
+ - \`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
85554
+
85555
+ ### Business Logic
85556
+
85557
+ \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
85558
+
85559
+ #### Example
85560
+
85561
+ \`\`\`ts
85562
+ import { connection } from "@squadbase/vite-server/connectors/backlog-api-key";
85563
+
85564
+ const backlog = connection("<connectionId>");
85565
+
85566
+ // \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
85567
+ const res = await backlog.request("/api/v2/projects");
85568
+ const projects = await res.json();
85569
+
85570
+ // \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u8AB2\u984C\u3092\u53D6\u5F97
85571
+ const issuesRes = await backlog.request("/api/v2/issues?projectId[]=12345&count=20&sort=updated&order=desc");
85572
+ const issues = await issuesRes.json();
85573
+
85574
+ // \u8AB2\u984C\u3092\u4F5C\u6210
85575
+ await backlog.request("/api/v2/issues", {
85576
+ method: "POST",
85577
+ body: JSON.stringify({
85578
+ projectId: 12345,
85579
+ summary: "\u65B0\u3057\u3044\u8AB2\u984C",
85580
+ issueTypeId: 67890,
85581
+ priorityId: 3,
85582
+ }),
85583
+ });
85584
+ \`\`\`
85585
+
85586
+ ### Backlog REST API v2 \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
85587
+
85588
+ #### \u30B9\u30DA\u30FC\u30B9
85589
+ - GET space \u2014 \u30B9\u30DA\u30FC\u30B9\u60C5\u5831\u306E\u53D6\u5F97
85590
+ - GET space/activities \u2014 \u30B9\u30DA\u30FC\u30B9\u306E\u6700\u8FD1\u306E\u6D3B\u52D5\u3092\u53D6\u5F97
85591
+
85592
+ #### \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8
85593
+ - 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
85594
+ - GET projects/{projectIdOrKey} \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8A73\u7D30\u306E\u53D6\u5F97
85595
+ - GET projects/{projectIdOrKey}/statuses \u2014 \u8AB2\u984C\u30B9\u30C6\u30FC\u30BF\u30B9\u4E00\u89A7
85596
+ - GET projects/{projectIdOrKey}/issueTypes \u2014 \u8AB2\u984C\u7A2E\u5225\u4E00\u89A7
85597
+ - GET projects/{projectIdOrKey}/categories \u2014 \u8AB2\u984C\u30AB\u30C6\u30B4\u30EA\u4E00\u89A7
85598
+
85599
+ #### \u8AB2\u984C
85600
+ - 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
85601
+ - GET issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u8A73\u7D30\u306E\u53D6\u5F97
85602
+ - GET issues/count \u2014 \u8AB2\u984C\u6570\u306E\u53D6\u5F97
85603
+ - 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
85604
+ - PATCH issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u306E\u66F4\u65B0
85605
+ - DELETE issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u306E\u524A\u9664
85606
+ - GET issues/{issueIdOrKey}/comments \u2014 \u30B3\u30E1\u30F3\u30C8\u4E00\u89A7
85607
+ - POST issues/{issueIdOrKey}/comments \u2014 \u30B3\u30E1\u30F3\u30C8\u306E\u8FFD\u52A0\uFF08body: { content: "\u30B3\u30E1\u30F3\u30C8\u5185\u5BB9" }\uFF09
85608
+
85609
+ #### Wiki
85610
+ - GET wikis \u2014 Wiki\u30DA\u30FC\u30B8\u4E00\u89A7\u306E\u53D6\u5F97\uFF08\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF: projectIdOrKey, keyword\uFF09
85611
+ - GET wikis/{wikiId} \u2014 Wiki\u30DA\u30FC\u30B8\u8A73\u7D30\u306E\u53D6\u5F97
85612
+ - POST wikis \u2014 Wiki\u30DA\u30FC\u30B8\u306E\u4F5C\u6210\uFF08body: projectId, name, content\uFF09
85613
+ - PATCH wikis/{wikiId} \u2014 Wiki\u30DA\u30FC\u30B8\u306E\u66F4\u65B0
85614
+
85615
+ #### \u30E6\u30FC\u30B6\u30FC
85616
+ - GET users \u2014 \u30B9\u30DA\u30FC\u30B9\u5185\u306E\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7
85617
+ - GET users/myself \u2014 \u8A8D\u8A3C\u6E08\u307F\u30E6\u30FC\u30B6\u30FC\u60C5\u5831\u306E\u53D6\u5F97
85618
+
85619
+ #### \u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3
85620
+ - 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
85621
+ - sort: "created", "updated", "issueType", "category", "priority" \u7B49
85622
+ - order: "asc" \u307E\u305F\u306F "desc"`
85623
+ },
85624
+ tools: tools60
85625
+ });
85626
+
85354
85627
  // ../connectors/src/connectors/registry.ts
85355
85628
  var plugins = {
85356
85629
  snowflake: snowflakeConnector,
@@ -85411,7 +85684,8 @@ var plugins = {
85411
85684
  intercom: intercomConnector,
85412
85685
  intercomOauth: intercomOauthConnector,
85413
85686
  mixpanel: mixpanelConnector,
85414
- grafana: grafanaConnector
85687
+ grafana: grafanaConnector,
85688
+ backlog: backlogConnector
85415
85689
  };
85416
85690
  var connectors = {
85417
85691
  ...plugins,
@@ -85874,62 +86148,62 @@ function createDbtClient(entry, slug) {
85874
86148
  var { getQuery, loadConnections, reloadEnvFile, watchConnectionsFile } = createConnectorRegistry();
85875
86149
 
85876
86150
  // src/types/server-logic.ts
85877
- import { z as z76 } from "zod";
85878
- var parameterMetaSchema = z76.object({
85879
- name: z76.string(),
85880
- type: z76.enum(["string", "number", "boolean"]),
85881
- description: z76.string(),
85882
- required: z76.boolean().optional(),
85883
- default: z76.union([z76.string(), z76.number(), z76.boolean()]).optional()
85884
- });
85885
- var serverLogicCacheConfigSchema = z76.object({
85886
- ttl: z76.number(),
85887
- staleWhileRevalidate: z76.boolean().optional()
85888
- });
85889
- var serverLogicSchemaObjectSchema = z76.lazy(
85890
- () => z76.object({
85891
- type: z76.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
85892
- format: z76.string().optional(),
85893
- description: z76.string().optional(),
85894
- nullable: z76.boolean().optional(),
85895
- enum: z76.array(z76.union([z76.string(), z76.number(), z76.boolean(), z76.null()])).optional(),
86151
+ import { z as z77 } from "zod";
86152
+ var parameterMetaSchema = z77.object({
86153
+ name: z77.string(),
86154
+ type: z77.enum(["string", "number", "boolean"]),
86155
+ description: z77.string(),
86156
+ required: z77.boolean().optional(),
86157
+ default: z77.union([z77.string(), z77.number(), z77.boolean()]).optional()
86158
+ });
86159
+ var serverLogicCacheConfigSchema = z77.object({
86160
+ ttl: z77.number(),
86161
+ staleWhileRevalidate: z77.boolean().optional()
86162
+ });
86163
+ var serverLogicSchemaObjectSchema = z77.lazy(
86164
+ () => z77.object({
86165
+ type: z77.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
86166
+ format: z77.string().optional(),
86167
+ description: z77.string().optional(),
86168
+ nullable: z77.boolean().optional(),
86169
+ enum: z77.array(z77.union([z77.string(), z77.number(), z77.boolean(), z77.null()])).optional(),
85896
86170
  items: serverLogicSchemaObjectSchema.optional(),
85897
- properties: z76.record(z76.string(), serverLogicSchemaObjectSchema).optional(),
85898
- required: z76.array(z76.string()).optional(),
85899
- additionalProperties: z76.union([z76.boolean(), serverLogicSchemaObjectSchema]).optional(),
85900
- minimum: z76.number().optional(),
85901
- maximum: z76.number().optional(),
85902
- minLength: z76.number().optional(),
85903
- maxLength: z76.number().optional(),
85904
- pattern: z76.string().optional()
86171
+ properties: z77.record(z77.string(), serverLogicSchemaObjectSchema).optional(),
86172
+ required: z77.array(z77.string()).optional(),
86173
+ additionalProperties: z77.union([z77.boolean(), serverLogicSchemaObjectSchema]).optional(),
86174
+ minimum: z77.number().optional(),
86175
+ maximum: z77.number().optional(),
86176
+ minLength: z77.number().optional(),
86177
+ maxLength: z77.number().optional(),
86178
+ pattern: z77.string().optional()
85905
86179
  })
85906
86180
  );
85907
- var serverLogicMediaTypeSchema = z76.object({
86181
+ var serverLogicMediaTypeSchema = z77.object({
85908
86182
  schema: serverLogicSchemaObjectSchema.optional(),
85909
- example: z76.unknown().optional()
86183
+ example: z77.unknown().optional()
85910
86184
  });
85911
- var serverLogicResponseSchema = z76.object({
85912
- description: z76.string().optional(),
85913
- content: z76.record(z76.string(), serverLogicMediaTypeSchema).optional()
86185
+ var serverLogicResponseSchema = z77.object({
86186
+ description: z77.string().optional(),
86187
+ content: z77.record(z77.string(), serverLogicMediaTypeSchema).optional()
85914
86188
  });
85915
86189
  var jsonBaseFields = {
85916
- description: z76.string(),
85917
- parameters: z76.array(parameterMetaSchema).optional(),
86190
+ description: z77.string(),
86191
+ parameters: z77.array(parameterMetaSchema).optional(),
85918
86192
  response: serverLogicResponseSchema.optional(),
85919
86193
  cache: serverLogicCacheConfigSchema.optional()
85920
86194
  };
85921
- var jsonSqlServerLogicSchema = z76.object({
86195
+ var jsonSqlServerLogicSchema = z77.object({
85922
86196
  ...jsonBaseFields,
85923
- type: z76.literal("sql").optional(),
85924
- query: z76.string(),
85925
- connectionId: z76.string()
86197
+ type: z77.literal("sql").optional(),
86198
+ query: z77.string(),
86199
+ connectionId: z77.string()
85926
86200
  });
85927
- var jsonTypeScriptServerLogicSchema = z76.object({
86201
+ var jsonTypeScriptServerLogicSchema = z77.object({
85928
86202
  ...jsonBaseFields,
85929
- type: z76.literal("typescript"),
85930
- handlerPath: z76.string()
86203
+ type: z77.literal("typescript"),
86204
+ handlerPath: z77.string()
85931
86205
  });
85932
- var anyJsonServerLogicSchema = z76.union([
86206
+ var anyJsonServerLogicSchema = z77.union([
85933
86207
  jsonTypeScriptServerLogicSchema,
85934
86208
  jsonSqlServerLogicSchema
85935
86209
  ]);