@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/cli/index.js CHANGED
@@ -7216,8 +7216,8 @@ var init_body = __esm({
7216
7216
  const ct = this.headers.get("content-type");
7217
7217
  if (ct.startsWith("application/x-www-form-urlencoded")) {
7218
7218
  const formData = new FormData2();
7219
- const parameters60 = new URLSearchParams(await this.text());
7220
- for (const [name, value] of parameters60) {
7219
+ const parameters61 = new URLSearchParams(await this.text());
7220
+ for (const [name, value] of parameters61) {
7221
7221
  formData.append(name, value);
7222
7222
  }
7223
7223
  return formData;
@@ -10165,11 +10165,11 @@ var require_bignumber = __commonJS({
10165
10165
  return n6 > 0 || n6 === i7 ? i7 : i7 - 1;
10166
10166
  }
10167
10167
  function coeffToString(a6) {
10168
- var s7, z77, i7 = 1, j6 = a6.length, r7 = a6[0] + "";
10168
+ var s7, z78, i7 = 1, j6 = a6.length, r7 = a6[0] + "";
10169
10169
  for (; i7 < j6; ) {
10170
10170
  s7 = a6[i7++] + "";
10171
- z77 = LOG_BASE - s7.length;
10172
- for (; z77--; s7 = "0" + s7) ;
10171
+ z78 = LOG_BASE - s7.length;
10172
+ for (; z78--; s7 = "0" + s7) ;
10173
10173
  r7 += s7;
10174
10174
  }
10175
10175
  for (j6 = r7.length; r7.charCodeAt(--j6) === 48; ) ;
@@ -10202,15 +10202,15 @@ var require_bignumber = __commonJS({
10202
10202
  function toExponential(str, e7) {
10203
10203
  return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e7 < 0 ? "e" : "e+") + e7;
10204
10204
  }
10205
- function toFixedPoint(str, e7, z77) {
10205
+ function toFixedPoint(str, e7, z78) {
10206
10206
  var len, zs;
10207
10207
  if (e7 < 0) {
10208
- for (zs = z77 + "."; ++e7; zs += z77) ;
10208
+ for (zs = z78 + "."; ++e7; zs += z78) ;
10209
10209
  str = zs + str;
10210
10210
  } else {
10211
10211
  len = str.length;
10212
10212
  if (++e7 > len) {
10213
- for (zs = z77, e7 -= len; --e7; zs += z77) ;
10213
+ for (zs = z78, e7 -= len; --e7; zs += z78) ;
10214
10214
  str += zs;
10215
10215
  } else if (e7 < len) {
10216
10216
  str = str.slice(0, e7) + "." + str.slice(e7);
@@ -37123,14 +37123,14 @@ var init_NormalizedSchema = __esm({
37123
37123
  throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
37124
37124
  }
37125
37125
  const struct = this.getSchema();
37126
- const z77 = struct[4].length;
37126
+ const z78 = struct[4].length;
37127
37127
  let it = struct[anno.it];
37128
- if (it && z77 === it.length) {
37128
+ if (it && z78 === it.length) {
37129
37129
  yield* it;
37130
37130
  return;
37131
37131
  }
37132
- it = Array(z77);
37133
- for (let i7 = 0; i7 < z77; ++i7) {
37132
+ it = Array(z78);
37133
+ for (let i7 = 0; i7 < z78; ++i7) {
37134
37134
  const k6 = struct[4][i7];
37135
37135
  const v7 = member([struct[5][i7], 0], k6);
37136
37136
  yield it[i7] = [k6, v7];
@@ -37806,12 +37806,12 @@ var init_split_header = __esm({
37806
37806
  "../../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js"() {
37807
37807
  "use strict";
37808
37808
  splitHeader = (value) => {
37809
- const z77 = value.length;
37809
+ const z78 = value.length;
37810
37810
  const values = [];
37811
37811
  let withinQuotes = false;
37812
37812
  let prevChar = void 0;
37813
37813
  let anchor = 0;
37814
- for (let i7 = 0; i7 < z77; ++i7) {
37814
+ for (let i7 = 0; i7 < z78; ++i7) {
37815
37815
  const char = value[i7];
37816
37816
  switch (char) {
37817
37817
  case `"`:
@@ -37832,12 +37832,12 @@ var init_split_header = __esm({
37832
37832
  values.push(value.slice(anchor));
37833
37833
  return values.map((v7) => {
37834
37834
  v7 = v7.trim();
37835
- const z78 = v7.length;
37836
- if (z78 < 2) {
37835
+ const z79 = v7.length;
37836
+ if (z79 < 2) {
37837
37837
  return v7;
37838
37838
  }
37839
- if (v7[0] === `"` && v7[z78 - 1] === `"`) {
37840
- v7 = v7.slice(1, z78 - 1);
37839
+ if (v7[0] === `"` && v7[z79 - 1] === `"`) {
37840
+ v7 = v7.slice(1, z79 - 1);
37841
37841
  }
37842
37842
  return v7.replace(/\\"/g, '"');
37843
37843
  });
@@ -39235,11 +39235,11 @@ var init_EndpointCache = __esm({
39235
39235
  }
39236
39236
  hash(endpointParams) {
39237
39237
  let buffer = "";
39238
- const { parameters: parameters60 } = this;
39239
- if (parameters60.length === 0) {
39238
+ const { parameters: parameters61 } = this;
39239
+ if (parameters61.length === 0) {
39240
39240
  return false;
39241
39241
  }
39242
- for (const param of parameters60) {
39242
+ for (const param of parameters61) {
39243
39243
  const val = String(endpointParams[param] ?? "");
39244
39244
  if (val.includes("|;")) {
39245
39245
  return false;
@@ -39956,15 +39956,15 @@ var init_resolveEndpoint = __esm({
39956
39956
  init_utils3();
39957
39957
  resolveEndpoint = (ruleSetObject, options) => {
39958
39958
  const { endpointParams, logger: logger2 } = options;
39959
- const { parameters: parameters60, rules } = ruleSetObject;
39959
+ const { parameters: parameters61, rules } = ruleSetObject;
39960
39960
  options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
39961
- const paramsWithDefault = Object.entries(parameters60).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]);
39961
+ const paramsWithDefault = Object.entries(parameters61).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]);
39962
39962
  if (paramsWithDefault.length > 0) {
39963
39963
  for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
39964
39964
  endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
39965
39965
  }
39966
39966
  }
39967
- const requiredParams = Object.entries(parameters60).filter(([, v7]) => v7.required).map(([k6]) => k6);
39967
+ const requiredParams = Object.entries(parameters61).filter(([, v7]) => v7.required).map(([k6]) => k6);
39968
39968
  for (const requiredParam of requiredParams) {
39969
39969
  if (endpointParams[requiredParam] == null) {
39970
39970
  throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
@@ -45574,8 +45574,8 @@ var init_ProtocolLib = __esm({
45574
45574
  constructor(queryCompat = false) {
45575
45575
  this.queryCompat = queryCompat;
45576
45576
  }
45577
- resolveRestContentType(defaultContentType, inputSchema74) {
45578
- const members = inputSchema74.getMemberSchemas();
45577
+ resolveRestContentType(defaultContentType, inputSchema75) {
45578
+ const members = inputSchema75.getMemberSchemas();
45579
45579
  const httpPayloadMember = Object.values(members).find((m7) => {
45580
45580
  return !!m7.getMergedTraits().httpPayload;
45581
45581
  });
@@ -45590,7 +45590,7 @@ var init_ProtocolLib = __esm({
45590
45590
  } else {
45591
45591
  return defaultContentType;
45592
45592
  }
45593
- } else if (!inputSchema74.isUnitSchema()) {
45593
+ } else if (!inputSchema75.isUnitSchema()) {
45594
45594
  const hasBody = Object.values(members).find((m7) => {
45595
45595
  const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m7.getMergedTraits();
45596
45596
  const noPrefixHeaders = httpPrefixHeaders === void 0;
@@ -46433,9 +46433,9 @@ var init_AwsRestJsonProtocol = __esm({
46433
46433
  }
46434
46434
  async serializeRequest(operationSchema, input, context) {
46435
46435
  const request2 = await super.serializeRequest(operationSchema, input, context);
46436
- const inputSchema74 = NormalizedSchema.of(operationSchema.input);
46436
+ const inputSchema75 = NormalizedSchema.of(operationSchema.input);
46437
46437
  if (!request2.headers["content-type"]) {
46438
- const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema74);
46438
+ const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema75);
46439
46439
  if (contentType) {
46440
46440
  request2.headers["content-type"] = contentType;
46441
46441
  }
@@ -46447,8 +46447,8 @@ var init_AwsRestJsonProtocol = __esm({
46447
46447
  }
46448
46448
  async deserializeResponse(operationSchema, context, response) {
46449
46449
  const output = await super.deserializeResponse(operationSchema, context, response);
46450
- const outputSchema74 = NormalizedSchema.of(operationSchema.output);
46451
- for (const [name, member2] of outputSchema74.structIterator()) {
46450
+ const outputSchema75 = NormalizedSchema.of(operationSchema.output);
46451
+ for (const [name, member2] of outputSchema75.structIterator()) {
46452
46452
  if (member2.getMemberTraits().httpPayload && !(name in output)) {
46453
46453
  output[name] = null;
46454
46454
  }
@@ -50312,22 +50312,22 @@ var init_loadCognitoIdentity = __esm({
50312
50312
  });
50313
50313
 
50314
50314
  // ../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js
50315
- function fromCognitoIdentity(parameters60) {
50315
+ function fromCognitoIdentity(parameters61) {
50316
50316
  return async (awsIdentityProperties) => {
50317
- parameters60.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
50317
+ parameters61.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
50318
50318
  const { GetCredentialsForIdentityCommand: GetCredentialsForIdentityCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
50319
- const fromConfigs = (property) => parameters60.clientConfig?.[property] ?? parameters60.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
50320
- const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters60.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters60.logger), SessionToken } = throwOnMissingCredentials(parameters60.logger) } = await (parameters60.client ?? new CognitoIdentityClient2(Object.assign({}, parameters60.clientConfig ?? {}, {
50319
+ const fromConfigs = (property) => parameters61.clientConfig?.[property] ?? parameters61.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
50320
+ const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters61.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters61.logger), SessionToken } = throwOnMissingCredentials(parameters61.logger) } = await (parameters61.client ?? new CognitoIdentityClient2(Object.assign({}, parameters61.clientConfig ?? {}, {
50321
50321
  region: fromConfigs("region"),
50322
50322
  profile: fromConfigs("profile"),
50323
50323
  userAgentAppId: fromConfigs("userAgentAppId")
50324
50324
  }))).send(new GetCredentialsForIdentityCommand2({
50325
- CustomRoleArn: parameters60.customRoleArn,
50326
- IdentityId: parameters60.identityId,
50327
- Logins: parameters60.logins ? await resolveLogins(parameters60.logins) : void 0
50325
+ CustomRoleArn: parameters61.customRoleArn,
50326
+ IdentityId: parameters61.identityId,
50327
+ Logins: parameters61.logins ? await resolveLogins(parameters61.logins) : void 0
50328
50328
  }));
50329
50329
  return {
50330
- identityId: parameters60.identityId,
50330
+ identityId: parameters61.identityId,
50331
50331
  accessKeyId: AccessKeyId,
50332
50332
  secretAccessKey: SecretKey,
50333
50333
  sessionToken: SessionToken,
@@ -101011,6 +101011,279 @@ export default async function handler(c: Context) {
101011
101011
  tools: tools59
101012
101012
  });
101013
101013
 
101014
+ // ../connectors/src/connectors/backlog/setup.ts
101015
+ var backlogOnboarding = new ConnectorOnboarding({
101016
+ dataOverviewInstructions: {
101017
+ en: `1. Call backlog-api-key_request with GET space to verify the connection and get space information
101018
+ 2. Call backlog-api-key_request with GET projects to list all accessible projects
101019
+ 3. For key projects, call backlog-api-key_request with GET issues?projectId[]={projectId}&count=5&order=desc to retrieve recent issues
101020
+ 4. Call backlog-api-key_request with GET projects/{projectIdOrKey}/statuses to understand the workflow statuses`,
101021
+ 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
101022
+ 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
101023
+ 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
101024
+ 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`
101025
+ }
101026
+ });
101027
+
101028
+ // ../connectors/src/connectors/backlog/parameters.ts
101029
+ var parameters60 = {
101030
+ spaceUrl: new ParameterDefinition({
101031
+ slug: "space-url",
101032
+ name: "Backlog Space URL",
101033
+ 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",
101034
+ envVarBaseKey: "BACKLOG_SPACE_URL",
101035
+ type: "text",
101036
+ secret: false,
101037
+ required: true
101038
+ }),
101039
+ apiKey: new ParameterDefinition({
101040
+ slug: "api-key",
101041
+ name: "API Key",
101042
+ description: "Your Backlog API key. You can generate one at: Your Space > Personal Settings > API (https://your-space.backlog.com/EditApiSettings.action).",
101043
+ envVarBaseKey: "BACKLOG_API_KEY",
101044
+ type: "text",
101045
+ secret: true,
101046
+ required: true
101047
+ })
101048
+ };
101049
+
101050
+ // ../connectors/src/connectors/backlog/tools/request.ts
101051
+ import { z as z76 } from "zod";
101052
+ var REQUEST_TIMEOUT_MS59 = 6e4;
101053
+ var inputSchema74 = z76.object({
101054
+ toolUseIntent: z76.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
101055
+ connectionId: z76.string().describe("ID of the Backlog connection to use"),
101056
+ 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."),
101057
+ 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."),
101058
+ 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).")
101059
+ });
101060
+ var outputSchema74 = z76.discriminatedUnion("success", [
101061
+ z76.object({
101062
+ success: z76.literal(true),
101063
+ status: z76.number(),
101064
+ data: z76.union([z76.record(z76.string(), z76.unknown()), z76.array(z76.unknown())])
101065
+ }),
101066
+ z76.object({
101067
+ success: z76.literal(false),
101068
+ error: z76.string()
101069
+ })
101070
+ ]);
101071
+ var requestTool45 = new ConnectorTool({
101072
+ name: "request",
101073
+ description: `Send authenticated requests to the Backlog REST API (v2).
101074
+ Authentication is handled automatically by appending the apiKey query parameter to every request.
101075
+ Use this tool for all Backlog operations: listing projects, searching and creating issues, managing wikis, retrieving users, and more.
101076
+ The base URL and API key are configured per connection \u2014 only specify the API path relative to /api/v2/.
101077
+ Do NOT include the apiKey parameter yourself; it is injected automatically.`,
101078
+ inputSchema: inputSchema74,
101079
+ outputSchema: outputSchema74,
101080
+ async execute({ connectionId, method, path: path5, body }, connections) {
101081
+ const connection = connections.find((c6) => c6.id === connectionId);
101082
+ if (!connection) {
101083
+ return { success: false, error: `Connection ${connectionId} not found` };
101084
+ }
101085
+ console.log(`[connector-request] backlog-api-key/${connection.name}: ${method} ${path5}`);
101086
+ try {
101087
+ const spaceUrl = parameters60.spaceUrl.getValue(connection);
101088
+ const apiKey = parameters60.apiKey.getValue(connection);
101089
+ const separator = path5.includes("?") ? "&" : "?";
101090
+ const url = `${spaceUrl.replace(/\/+$/, "")}/api/v2/${path5}${separator}apiKey=${apiKey}`;
101091
+ const controller = new AbortController();
101092
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS59);
101093
+ try {
101094
+ const headers = {
101095
+ Accept: "application/json"
101096
+ };
101097
+ if (body) {
101098
+ headers["Content-Type"] = "application/json";
101099
+ }
101100
+ const response = await fetch(url, {
101101
+ method,
101102
+ headers,
101103
+ body: body ? JSON.stringify(body) : void 0,
101104
+ signal: controller.signal
101105
+ });
101106
+ if (response.status === 204) {
101107
+ return { success: true, status: 204, data: {} };
101108
+ }
101109
+ const data = await response.json();
101110
+ if (!response.ok) {
101111
+ const errData = data;
101112
+ const errors2 = errData?.errors;
101113
+ const errorMessage = Array.isArray(errors2) ? errors2.map((e7) => e7.message).join("; ") : errData?.message ?? `HTTP ${response.status} ${response.statusText}`;
101114
+ return { success: false, error: errorMessage };
101115
+ }
101116
+ return { success: true, status: response.status, data };
101117
+ } finally {
101118
+ clearTimeout(timeout);
101119
+ }
101120
+ } catch (err) {
101121
+ const msg = err instanceof Error ? err.message : String(err);
101122
+ return { success: false, error: msg };
101123
+ }
101124
+ }
101125
+ });
101126
+
101127
+ // ../connectors/src/connectors/backlog/index.ts
101128
+ var tools60 = { request: requestTool45 };
101129
+ var backlogConnector = new ConnectorPlugin({
101130
+ slug: "backlog",
101131
+ authType: AUTH_TYPES.API_KEY,
101132
+ name: "Backlog",
101133
+ description: "Connect to Nulab Backlog for project management, issue tracking, and wiki data retrieval using API key authentication.",
101134
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6KcVBGf3mUHnuCOQgQMvtT/e8558c7990e40e3be46948e9476190fb/backlog-favicon.svg",
101135
+ parameters: parameters60,
101136
+ releaseFlag: { dev1: true, dev2: true, prod: false },
101137
+ onboarding: backlogOnboarding,
101138
+ systemPrompt: {
101139
+ en: `### Tools
101140
+
101141
+ - \`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.
101142
+
101143
+ ### Business Logic
101144
+
101145
+ 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.
101146
+
101147
+ #### Example
101148
+
101149
+ \`\`\`ts
101150
+ import { connection } from "@squadbase/vite-server/connectors/backlog-api-key";
101151
+
101152
+ const backlog = connection("<connectionId>");
101153
+
101154
+ // List projects
101155
+ const res = await backlog.request("/api/v2/projects");
101156
+ const projects = await res.json();
101157
+
101158
+ // Get issues for a project
101159
+ const issuesRes = await backlog.request("/api/v2/issues?projectId[]=12345&count=20&sort=updated&order=desc");
101160
+ const issues = await issuesRes.json();
101161
+
101162
+ // Create an issue
101163
+ await backlog.request("/api/v2/issues", {
101164
+ method: "POST",
101165
+ body: JSON.stringify({
101166
+ projectId: 12345,
101167
+ summary: "New issue title",
101168
+ issueTypeId: 67890,
101169
+ priorityId: 3,
101170
+ }),
101171
+ });
101172
+ \`\`\`
101173
+
101174
+ ### Backlog REST API v2 Reference
101175
+
101176
+ #### Space
101177
+ - GET space \u2014 Get space information
101178
+ - GET space/activities \u2014 Get recent activities in the space
101179
+
101180
+ #### Projects
101181
+ - GET projects \u2014 List all projects (query params: archived, all)
101182
+ - GET projects/{projectIdOrKey} \u2014 Get project details
101183
+ - GET projects/{projectIdOrKey}/statuses \u2014 List issue statuses
101184
+ - GET projects/{projectIdOrKey}/issueTypes \u2014 List issue types
101185
+ - GET projects/{projectIdOrKey}/categories \u2014 List issue categories
101186
+
101187
+ #### Issues
101188
+ - GET issues \u2014 Search issues (query params: projectId[], statusId[], assigneeId[], sort, order, count, offset, keyword)
101189
+ - GET issues/{issueIdOrKey} \u2014 Get issue details
101190
+ - GET issues/count \u2014 Get issue count
101191
+ - POST issues \u2014 Create an issue (body: projectId, summary, issueTypeId, priorityId, and optional fields)
101192
+ - PATCH issues/{issueIdOrKey} \u2014 Update an issue
101193
+ - DELETE issues/{issueIdOrKey} \u2014 Delete an issue
101194
+ - GET issues/{issueIdOrKey}/comments \u2014 List comments
101195
+ - POST issues/{issueIdOrKey}/comments \u2014 Add a comment (body: { content: "comment text" })
101196
+
101197
+ #### Wiki
101198
+ - GET wikis \u2014 List wiki pages (query params: projectIdOrKey, keyword)
101199
+ - GET wikis/{wikiId} \u2014 Get wiki page details
101200
+ - POST wikis \u2014 Create a wiki page (body: projectId, name, content)
101201
+ - PATCH wikis/{wikiId} \u2014 Update a wiki page
101202
+
101203
+ #### Users
101204
+ - GET users \u2014 List users in the space
101205
+ - GET users/myself \u2014 Get authenticated user info
101206
+
101207
+ #### Pagination
101208
+ - Use count (max 100, default 20) and offset parameters for pagination
101209
+ - sort: "created", "updated", "issueType", "category", "priority", etc.
101210
+ - order: "asc" or "desc"`,
101211
+ ja: `### \u30C4\u30FC\u30EB
101212
+
101213
+ - \`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
101214
+
101215
+ ### Business Logic
101216
+
101217
+ \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
101218
+
101219
+ #### Example
101220
+
101221
+ \`\`\`ts
101222
+ import { connection } from "@squadbase/vite-server/connectors/backlog-api-key";
101223
+
101224
+ const backlog = connection("<connectionId>");
101225
+
101226
+ // \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
101227
+ const res = await backlog.request("/api/v2/projects");
101228
+ const projects = await res.json();
101229
+
101230
+ // \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u8AB2\u984C\u3092\u53D6\u5F97
101231
+ const issuesRes = await backlog.request("/api/v2/issues?projectId[]=12345&count=20&sort=updated&order=desc");
101232
+ const issues = await issuesRes.json();
101233
+
101234
+ // \u8AB2\u984C\u3092\u4F5C\u6210
101235
+ await backlog.request("/api/v2/issues", {
101236
+ method: "POST",
101237
+ body: JSON.stringify({
101238
+ projectId: 12345,
101239
+ summary: "\u65B0\u3057\u3044\u8AB2\u984C",
101240
+ issueTypeId: 67890,
101241
+ priorityId: 3,
101242
+ }),
101243
+ });
101244
+ \`\`\`
101245
+
101246
+ ### Backlog REST API v2 \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
101247
+
101248
+ #### \u30B9\u30DA\u30FC\u30B9
101249
+ - GET space \u2014 \u30B9\u30DA\u30FC\u30B9\u60C5\u5831\u306E\u53D6\u5F97
101250
+ - GET space/activities \u2014 \u30B9\u30DA\u30FC\u30B9\u306E\u6700\u8FD1\u306E\u6D3B\u52D5\u3092\u53D6\u5F97
101251
+
101252
+ #### \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8
101253
+ - 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
101254
+ - GET projects/{projectIdOrKey} \u2014 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8A73\u7D30\u306E\u53D6\u5F97
101255
+ - GET projects/{projectIdOrKey}/statuses \u2014 \u8AB2\u984C\u30B9\u30C6\u30FC\u30BF\u30B9\u4E00\u89A7
101256
+ - GET projects/{projectIdOrKey}/issueTypes \u2014 \u8AB2\u984C\u7A2E\u5225\u4E00\u89A7
101257
+ - GET projects/{projectIdOrKey}/categories \u2014 \u8AB2\u984C\u30AB\u30C6\u30B4\u30EA\u4E00\u89A7
101258
+
101259
+ #### \u8AB2\u984C
101260
+ - 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
101261
+ - GET issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u8A73\u7D30\u306E\u53D6\u5F97
101262
+ - GET issues/count \u2014 \u8AB2\u984C\u6570\u306E\u53D6\u5F97
101263
+ - 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
101264
+ - PATCH issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u306E\u66F4\u65B0
101265
+ - DELETE issues/{issueIdOrKey} \u2014 \u8AB2\u984C\u306E\u524A\u9664
101266
+ - GET issues/{issueIdOrKey}/comments \u2014 \u30B3\u30E1\u30F3\u30C8\u4E00\u89A7
101267
+ - POST issues/{issueIdOrKey}/comments \u2014 \u30B3\u30E1\u30F3\u30C8\u306E\u8FFD\u52A0\uFF08body: { content: "\u30B3\u30E1\u30F3\u30C8\u5185\u5BB9" }\uFF09
101268
+
101269
+ #### Wiki
101270
+ - GET wikis \u2014 Wiki\u30DA\u30FC\u30B8\u4E00\u89A7\u306E\u53D6\u5F97\uFF08\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF: projectIdOrKey, keyword\uFF09
101271
+ - GET wikis/{wikiId} \u2014 Wiki\u30DA\u30FC\u30B8\u8A73\u7D30\u306E\u53D6\u5F97
101272
+ - POST wikis \u2014 Wiki\u30DA\u30FC\u30B8\u306E\u4F5C\u6210\uFF08body: projectId, name, content\uFF09
101273
+ - PATCH wikis/{wikiId} \u2014 Wiki\u30DA\u30FC\u30B8\u306E\u66F4\u65B0
101274
+
101275
+ #### \u30E6\u30FC\u30B6\u30FC
101276
+ - GET users \u2014 \u30B9\u30DA\u30FC\u30B9\u5185\u306E\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7
101277
+ - GET users/myself \u2014 \u8A8D\u8A3C\u6E08\u307F\u30E6\u30FC\u30B6\u30FC\u60C5\u5831\u306E\u53D6\u5F97
101278
+
101279
+ #### \u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3
101280
+ - 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
101281
+ - sort: "created", "updated", "issueType", "category", "priority" \u7B49
101282
+ - order: "asc" \u307E\u305F\u306F "desc"`
101283
+ },
101284
+ tools: tools60
101285
+ });
101286
+
101014
101287
  // ../connectors/src/connectors/registry.ts
101015
101288
  var plugins = {
101016
101289
  snowflake: snowflakeConnector,
@@ -101071,7 +101344,8 @@ var plugins = {
101071
101344
  intercom: intercomConnector,
101072
101345
  intercomOauth: intercomOauthConnector,
101073
101346
  mixpanel: mixpanelConnector,
101074
- grafana: grafanaConnector
101347
+ grafana: grafanaConnector,
101348
+ backlog: backlogConnector
101075
101349
  };
101076
101350
  var connectors = {
101077
101351
  ...plugins,
@@ -101288,62 +101562,62 @@ import { watch as fsWatch2 } from "fs";
101288
101562
  import path2 from "path";
101289
101563
 
101290
101564
  // src/types/server-logic.ts
101291
- import { z as z76 } from "zod";
101292
- var parameterMetaSchema = z76.object({
101293
- name: z76.string(),
101294
- type: z76.enum(["string", "number", "boolean"]),
101295
- description: z76.string(),
101296
- required: z76.boolean().optional(),
101297
- default: z76.union([z76.string(), z76.number(), z76.boolean()]).optional()
101298
- });
101299
- var serverLogicCacheConfigSchema = z76.object({
101300
- ttl: z76.number(),
101301
- staleWhileRevalidate: z76.boolean().optional()
101302
- });
101303
- var serverLogicSchemaObjectSchema = z76.lazy(
101304
- () => z76.object({
101305
- type: z76.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
101306
- format: z76.string().optional(),
101307
- description: z76.string().optional(),
101308
- nullable: z76.boolean().optional(),
101309
- enum: z76.array(z76.union([z76.string(), z76.number(), z76.boolean(), z76.null()])).optional(),
101565
+ import { z as z77 } from "zod";
101566
+ var parameterMetaSchema = z77.object({
101567
+ name: z77.string(),
101568
+ type: z77.enum(["string", "number", "boolean"]),
101569
+ description: z77.string(),
101570
+ required: z77.boolean().optional(),
101571
+ default: z77.union([z77.string(), z77.number(), z77.boolean()]).optional()
101572
+ });
101573
+ var serverLogicCacheConfigSchema = z77.object({
101574
+ ttl: z77.number(),
101575
+ staleWhileRevalidate: z77.boolean().optional()
101576
+ });
101577
+ var serverLogicSchemaObjectSchema = z77.lazy(
101578
+ () => z77.object({
101579
+ type: z77.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
101580
+ format: z77.string().optional(),
101581
+ description: z77.string().optional(),
101582
+ nullable: z77.boolean().optional(),
101583
+ enum: z77.array(z77.union([z77.string(), z77.number(), z77.boolean(), z77.null()])).optional(),
101310
101584
  items: serverLogicSchemaObjectSchema.optional(),
101311
- properties: z76.record(z76.string(), serverLogicSchemaObjectSchema).optional(),
101312
- required: z76.array(z76.string()).optional(),
101313
- additionalProperties: z76.union([z76.boolean(), serverLogicSchemaObjectSchema]).optional(),
101314
- minimum: z76.number().optional(),
101315
- maximum: z76.number().optional(),
101316
- minLength: z76.number().optional(),
101317
- maxLength: z76.number().optional(),
101318
- pattern: z76.string().optional()
101585
+ properties: z77.record(z77.string(), serverLogicSchemaObjectSchema).optional(),
101586
+ required: z77.array(z77.string()).optional(),
101587
+ additionalProperties: z77.union([z77.boolean(), serverLogicSchemaObjectSchema]).optional(),
101588
+ minimum: z77.number().optional(),
101589
+ maximum: z77.number().optional(),
101590
+ minLength: z77.number().optional(),
101591
+ maxLength: z77.number().optional(),
101592
+ pattern: z77.string().optional()
101319
101593
  })
101320
101594
  );
101321
- var serverLogicMediaTypeSchema = z76.object({
101595
+ var serverLogicMediaTypeSchema = z77.object({
101322
101596
  schema: serverLogicSchemaObjectSchema.optional(),
101323
- example: z76.unknown().optional()
101597
+ example: z77.unknown().optional()
101324
101598
  });
101325
- var serverLogicResponseSchema = z76.object({
101326
- description: z76.string().optional(),
101327
- content: z76.record(z76.string(), serverLogicMediaTypeSchema).optional()
101599
+ var serverLogicResponseSchema = z77.object({
101600
+ description: z77.string().optional(),
101601
+ content: z77.record(z77.string(), serverLogicMediaTypeSchema).optional()
101328
101602
  });
101329
101603
  var jsonBaseFields = {
101330
- description: z76.string(),
101331
- parameters: z76.array(parameterMetaSchema).optional(),
101604
+ description: z77.string(),
101605
+ parameters: z77.array(parameterMetaSchema).optional(),
101332
101606
  response: serverLogicResponseSchema.optional(),
101333
101607
  cache: serverLogicCacheConfigSchema.optional()
101334
101608
  };
101335
- var jsonSqlServerLogicSchema = z76.object({
101609
+ var jsonSqlServerLogicSchema = z77.object({
101336
101610
  ...jsonBaseFields,
101337
- type: z76.literal("sql").optional(),
101338
- query: z76.string(),
101339
- connectionId: z76.string()
101611
+ type: z77.literal("sql").optional(),
101612
+ query: z77.string(),
101613
+ connectionId: z77.string()
101340
101614
  });
101341
- var jsonTypeScriptServerLogicSchema = z76.object({
101615
+ var jsonTypeScriptServerLogicSchema = z77.object({
101342
101616
  ...jsonBaseFields,
101343
- type: z76.literal("typescript"),
101344
- handlerPath: z76.string()
101617
+ type: z77.literal("typescript"),
101618
+ handlerPath: z77.string()
101345
101619
  });
101346
- var anyJsonServerLogicSchema = z76.union([
101620
+ var anyJsonServerLogicSchema = z77.union([
101347
101621
  jsonTypeScriptServerLogicSchema,
101348
101622
  jsonSqlServerLogicSchema
101349
101623
  ]);
@@ -0,0 +1,5 @@
1
+ import * as _squadbase_connectors_sdk from '@squadbase/connectors/sdk';
2
+
3
+ declare const connection: (connectionId: string) => _squadbase_connectors_sdk.BacklogConnectorSdk;
4
+
5
+ export { connection };