@squadbase/vite-server 0.1.3-dev.0 → 0.1.3-dev.2

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.
Files changed (39) hide show
  1. package/dist/cli/index.js +82143 -9661
  2. package/dist/connectors/asana.d.ts +5 -0
  3. package/dist/connectors/asana.js +661 -0
  4. package/dist/connectors/customerio.d.ts +5 -0
  5. package/dist/connectors/customerio.js +633 -0
  6. package/dist/connectors/gemini.js +1 -1
  7. package/dist/connectors/gmail-oauth.d.ts +5 -0
  8. package/dist/connectors/gmail-oauth.js +639 -0
  9. package/dist/connectors/google-ads.d.ts +5 -0
  10. package/dist/connectors/google-ads.js +784 -0
  11. package/dist/connectors/google-sheets.d.ts +5 -0
  12. package/dist/connectors/google-sheets.js +598 -0
  13. package/dist/connectors/hubspot.js +14 -5
  14. package/dist/connectors/intercom-oauth.d.ts +5 -0
  15. package/dist/connectors/intercom-oauth.js +510 -0
  16. package/dist/connectors/intercom.d.ts +5 -0
  17. package/dist/connectors/intercom.js +627 -0
  18. package/dist/connectors/jira-api-key.d.ts +5 -0
  19. package/dist/connectors/jira-api-key.js +524 -0
  20. package/dist/connectors/linkedin-ads-oauth.d.ts +5 -0
  21. package/dist/connectors/linkedin-ads-oauth.js +774 -0
  22. package/dist/connectors/linkedin-ads.d.ts +5 -0
  23. package/dist/connectors/linkedin-ads.js +782 -0
  24. package/dist/connectors/mailchimp-oauth.d.ts +5 -0
  25. package/dist/connectors/mailchimp-oauth.js +539 -0
  26. package/dist/connectors/mailchimp.d.ts +5 -0
  27. package/dist/connectors/mailchimp.js +646 -0
  28. package/dist/connectors/notion-oauth.d.ts +5 -0
  29. package/dist/connectors/notion-oauth.js +493 -0
  30. package/dist/connectors/notion.d.ts +5 -0
  31. package/dist/connectors/notion.js +580 -0
  32. package/dist/connectors/zendesk-oauth.d.ts +5 -0
  33. package/dist/connectors/zendesk-oauth.js +505 -0
  34. package/dist/connectors/zendesk.d.ts +5 -0
  35. package/dist/connectors/zendesk.js +631 -0
  36. package/dist/index.js +82350 -7194
  37. package/dist/main.js +82336 -7180
  38. package/dist/vite-plugin.js +82235 -7079
  39. package/package.json +66 -2
@@ -0,0 +1,524 @@
1
+ // ../connectors/src/parameter-definition.ts
2
+ var ParameterDefinition = class {
3
+ slug;
4
+ name;
5
+ description;
6
+ envVarBaseKey;
7
+ type;
8
+ secret;
9
+ required;
10
+ constructor(config) {
11
+ this.slug = config.slug;
12
+ this.name = config.name;
13
+ this.description = config.description;
14
+ this.envVarBaseKey = config.envVarBaseKey;
15
+ this.type = config.type;
16
+ this.secret = config.secret;
17
+ this.required = config.required;
18
+ }
19
+ /**
20
+ * Get the parameter value from a ConnectorConnectionObject.
21
+ */
22
+ getValue(connection2) {
23
+ const param = connection2.parameters.find(
24
+ (p) => p.parameterSlug === this.slug
25
+ );
26
+ if (!param || param.value == null) {
27
+ throw new Error(
28
+ `Parameter "${this.slug}" not found or has no value in connection "${connection2.id}"`
29
+ );
30
+ }
31
+ return param.value;
32
+ }
33
+ /**
34
+ * Try to get the parameter value. Returns undefined if not found (for optional params).
35
+ */
36
+ tryGetValue(connection2) {
37
+ const param = connection2.parameters.find(
38
+ (p) => p.parameterSlug === this.slug
39
+ );
40
+ if (!param || param.value == null) return void 0;
41
+ return param.value;
42
+ }
43
+ };
44
+
45
+ // ../connectors/src/connectors/jira/parameters.ts
46
+ var parameters = {
47
+ instanceUrl: new ParameterDefinition({
48
+ slug: "instance-url",
49
+ name: "Jira Instance URL",
50
+ description: "Your Jira Cloud site URL \u2014 just the base address, without any trailing path. For example: https://your-domain.atlassian.net",
51
+ envVarBaseKey: "JIRA_INSTANCE_URL",
52
+ type: "text",
53
+ secret: false,
54
+ required: true
55
+ }),
56
+ email: new ParameterDefinition({
57
+ slug: "email",
58
+ name: "Email Address",
59
+ description: "The email address associated with your Atlassian account used for API authentication.",
60
+ envVarBaseKey: "JIRA_EMAIL",
61
+ type: "text",
62
+ secret: false,
63
+ required: true
64
+ }),
65
+ apiToken: new ParameterDefinition({
66
+ slug: "api-token",
67
+ name: "Atlassian API Token",
68
+ description: "Your Atlassian account API token (used for Jira authentication). You can create one at: Atlassian Account Settings > Security > API tokens (https://id.atlassian.com/manage/api-tokens).",
69
+ envVarBaseKey: "JIRA_API_TOKEN",
70
+ type: "text",
71
+ secret: true,
72
+ required: true
73
+ })
74
+ };
75
+
76
+ // ../connectors/src/connectors/jira/sdk/index.ts
77
+ function createClient(params) {
78
+ const instanceUrl = params[parameters.instanceUrl.slug];
79
+ const email = params[parameters.email.slug];
80
+ const apiToken = params[parameters.apiToken.slug];
81
+ if (!instanceUrl || !email || !apiToken) {
82
+ const required = [
83
+ parameters.instanceUrl.slug,
84
+ parameters.email.slug,
85
+ parameters.apiToken.slug
86
+ ];
87
+ const missing = required.filter((s) => !params[s]);
88
+ throw new Error(
89
+ `jira: missing required parameters: ${missing.join(", ")}`
90
+ );
91
+ }
92
+ const credentials = Buffer.from(`${email}:${apiToken}`).toString("base64");
93
+ return {
94
+ request(path2, init) {
95
+ const url = `${instanceUrl.replace(/\/+$/, "")}${path2}`;
96
+ const headers = new Headers(init?.headers);
97
+ headers.set("Authorization", `Basic ${credentials}`);
98
+ headers.set("Accept", "application/json");
99
+ if (init?.body) {
100
+ headers.set("Content-Type", "application/json");
101
+ }
102
+ return fetch(url, { ...init, headers });
103
+ }
104
+ };
105
+ }
106
+
107
+ // ../connectors/src/connector-onboarding.ts
108
+ var ConnectorOnboarding = class {
109
+ /** Phase 1: Connection setup instructions (optional — some connectors don't need this) */
110
+ connectionSetupInstructions;
111
+ /** Phase 2: Data overview instructions */
112
+ dataOverviewInstructions;
113
+ constructor(config) {
114
+ this.connectionSetupInstructions = config.connectionSetupInstructions;
115
+ this.dataOverviewInstructions = config.dataOverviewInstructions;
116
+ }
117
+ getConnectionSetupPrompt(language) {
118
+ return this.connectionSetupInstructions?.[language] ?? null;
119
+ }
120
+ getDataOverviewInstructions(language) {
121
+ return this.dataOverviewInstructions[language];
122
+ }
123
+ };
124
+
125
+ // ../connectors/src/connector-tool.ts
126
+ var ConnectorTool = class {
127
+ name;
128
+ description;
129
+ inputSchema;
130
+ outputSchema;
131
+ _execute;
132
+ constructor(config) {
133
+ this.name = config.name;
134
+ this.description = config.description;
135
+ this.inputSchema = config.inputSchema;
136
+ this.outputSchema = config.outputSchema;
137
+ this._execute = config.execute;
138
+ }
139
+ createTool(connections, config) {
140
+ return {
141
+ description: this.description,
142
+ inputSchema: this.inputSchema,
143
+ outputSchema: this.outputSchema,
144
+ execute: (input) => this._execute(input, connections, config)
145
+ };
146
+ }
147
+ };
148
+
149
+ // ../connectors/src/connector-plugin.ts
150
+ var ConnectorPlugin = class _ConnectorPlugin {
151
+ slug;
152
+ authType;
153
+ name;
154
+ description;
155
+ iconUrl;
156
+ parameters;
157
+ releaseFlag;
158
+ proxyPolicy;
159
+ experimentalAttributes;
160
+ onboarding;
161
+ systemPrompt;
162
+ tools;
163
+ query;
164
+ checkConnection;
165
+ constructor(config) {
166
+ this.slug = config.slug;
167
+ this.authType = config.authType;
168
+ this.name = config.name;
169
+ this.description = config.description;
170
+ this.iconUrl = config.iconUrl;
171
+ this.parameters = config.parameters;
172
+ this.releaseFlag = config.releaseFlag;
173
+ this.proxyPolicy = config.proxyPolicy;
174
+ this.experimentalAttributes = config.experimentalAttributes;
175
+ this.onboarding = config.onboarding;
176
+ this.systemPrompt = config.systemPrompt;
177
+ this.tools = config.tools;
178
+ this.query = config.query;
179
+ this.checkConnection = config.checkConnection;
180
+ }
181
+ get connectorKey() {
182
+ return _ConnectorPlugin.deriveKey(this.slug, this.authType);
183
+ }
184
+ /**
185
+ * Create tools for connections that belong to this connector.
186
+ * Filters connections by connectorKey internally.
187
+ * Returns tools keyed as `${connectorKey}_${toolName}`.
188
+ */
189
+ createTools(connections, config) {
190
+ const myConnections = connections.filter(
191
+ (c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
192
+ );
193
+ const result = {};
194
+ for (const t of Object.values(this.tools)) {
195
+ result[`${this.connectorKey}_${t.name}`] = t.createTool(
196
+ myConnections,
197
+ config
198
+ );
199
+ }
200
+ return result;
201
+ }
202
+ static deriveKey(slug, authType) {
203
+ return authType ? `${slug}-${authType}` : slug;
204
+ }
205
+ };
206
+
207
+ // ../connectors/src/auth-types.ts
208
+ var AUTH_TYPES = {
209
+ OAUTH: "oauth",
210
+ API_KEY: "api-key",
211
+ JWT: "jwt",
212
+ SERVICE_ACCOUNT: "service-account",
213
+ PAT: "pat"
214
+ };
215
+
216
+ // ../connectors/src/connectors/jira/setup.ts
217
+ var jiraOnboarding = new ConnectorOnboarding({
218
+ dataOverviewInstructions: {
219
+ en: `1. Call jira-api-key_request with GET project to list all accessible projects
220
+ 2. For key projects, call jira-api-key_request with POST search to search issues using JQL (e.g., body: { "jql": "project = PROJ order by created DESC", "maxResults": 5, "fields": ["summary", "status", "assignee", "priority", "created"] })
221
+ 3. Call jira-api-key_request with GET issue/{issueKey} to inspect a sample issue's full details`,
222
+ ja: `1. jira-api-key_request \u3067 GET project \u3092\u547C\u3073\u51FA\u3057\u3001\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
223
+ 2. \u4E3B\u8981\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u3064\u3044\u3066 jira-api-key_request \u3067 POST search \u3092\u4F7F\u7528\u3057\u3066JQL\u3067\u30A4\u30B7\u30E5\u30FC\u3092\u691C\u7D22\uFF08\u4F8B: body: { "jql": "project = PROJ order by created DESC", "maxResults": 5, "fields": ["summary", "status", "assignee", "priority", "created"] }\uFF09
224
+ 3. jira-api-key_request \u3067 GET issue/{issueKey} \u3092\u547C\u3073\u51FA\u3057\u3001\u30B5\u30F3\u30D7\u30EB\u30A4\u30B7\u30E5\u30FC\u306E\u8A73\u7D30\u3092\u78BA\u8A8D`
225
+ }
226
+ });
227
+
228
+ // ../connectors/src/connectors/jira/tools/request.ts
229
+ import { z } from "zod";
230
+ var REQUEST_TIMEOUT_MS = 6e4;
231
+ var inputSchema = z.object({
232
+ toolUseIntent: z.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
233
+ connectionId: z.string().describe("ID of the Jira connection to use"),
234
+ method: z.enum(["GET", "POST", "PUT", "DELETE"]).describe("HTTP method. Use GET to read resources, POST to create or search, PUT to update, DELETE to remove."),
235
+ path: z.string().describe("API path relative to /rest/api/3/ (e.g., 'project', 'search', 'issue/PROJ-123'). Query parameters can be appended (e.g., 'project?maxResults=50')."),
236
+ body: z.record(z.string(), z.unknown()).optional().describe("Request body as JSON object. Required for POST and PUT requests (e.g., issue creation, JQL search).")
237
+ });
238
+ var outputSchema = z.discriminatedUnion("success", [
239
+ z.object({
240
+ success: z.literal(true),
241
+ status: z.number(),
242
+ data: z.union([z.record(z.string(), z.unknown()), z.array(z.unknown())])
243
+ }),
244
+ z.object({
245
+ success: z.literal(false),
246
+ error: z.string()
247
+ })
248
+ ]);
249
+ var requestTool = new ConnectorTool({
250
+ name: "request",
251
+ description: `Send authenticated requests to the Jira Cloud REST API (v3).
252
+ Authentication is handled automatically using Basic Auth (email + API token).
253
+ Use this tool for all Jira operations: listing projects, searching issues with JQL, creating/updating issues, managing transitions, and adding comments.
254
+ The base URL and authentication credentials are configured per connection \u2014 only specify the API path relative to /rest/api/3/.`,
255
+ inputSchema,
256
+ outputSchema,
257
+ async execute({ connectionId, method, path: path2, body }, connections) {
258
+ const connection2 = connections.find((c) => c.id === connectionId);
259
+ if (!connection2) {
260
+ return { success: false, error: `Connection ${connectionId} not found` };
261
+ }
262
+ console.log(`[connector-request] jira-api-key/${connection2.name}: ${method} ${path2}`);
263
+ try {
264
+ const instanceUrl = parameters.instanceUrl.getValue(connection2);
265
+ const email = parameters.email.getValue(connection2);
266
+ const apiToken = parameters.apiToken.getValue(connection2);
267
+ const baseUrl = `${instanceUrl.replace(/\/+$/, "")}/rest/api/3/${path2}`;
268
+ const credentials = Buffer.from(`${email}:${apiToken}`).toString("base64");
269
+ const controller = new AbortController();
270
+ const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
271
+ try {
272
+ const headers = {
273
+ Authorization: `Basic ${credentials}`,
274
+ Accept: "application/json"
275
+ };
276
+ if (body) {
277
+ headers["Content-Type"] = "application/json";
278
+ }
279
+ const response = await fetch(baseUrl, {
280
+ method,
281
+ headers,
282
+ body: body ? JSON.stringify(body) : void 0,
283
+ signal: controller.signal
284
+ });
285
+ if (response.status === 204) {
286
+ return { success: true, status: 204, data: {} };
287
+ }
288
+ const data = await response.json();
289
+ if (!response.ok) {
290
+ const errData = data;
291
+ const errorMessages = Array.isArray(errData?.errorMessages) ? errData.errorMessages.join("; ") : errData?.message ?? `HTTP ${response.status} ${response.statusText}`;
292
+ return { success: false, error: errorMessages };
293
+ }
294
+ return { success: true, status: response.status, data };
295
+ } finally {
296
+ clearTimeout(timeout);
297
+ }
298
+ } catch (err) {
299
+ const msg = err instanceof Error ? err.message : String(err);
300
+ return { success: false, error: msg };
301
+ }
302
+ }
303
+ });
304
+
305
+ // ../connectors/src/connectors/jira/index.ts
306
+ var tools = { request: requestTool };
307
+ var jiraConnector = new ConnectorPlugin({
308
+ slug: "jira",
309
+ authType: AUTH_TYPES.API_KEY,
310
+ name: "Jira (API Key)",
311
+ description: "Connect to Jira Cloud for issue tracking, project management, and workflow data retrieval using API token authentication.",
312
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5zt4yjb36szSPPkCECYlPL/bc3e7223dc84fb16a1cce53a80f5afcc/jira.png",
313
+ parameters,
314
+ releaseFlag: { dev1: true, dev2: false, prod: false },
315
+ onboarding: jiraOnboarding,
316
+ systemPrompt: {
317
+ en: `### Tools
318
+
319
+ - \`jira-api-key_request\`: The only way to call the Jira Cloud REST API (v3). Use it to list projects, search issues with JQL, get issue details, create/update issues, manage transitions, and add comments. Authentication (Basic Auth with email + API token) and instance URL are configured automatically.
320
+
321
+ ### Business Logic
322
+
323
+ 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.
324
+
325
+ #### Example
326
+
327
+ \`\`\`ts
328
+ import { connection } from "@squadbase/vite-server/connectors/jira-api-key";
329
+
330
+ const jira = connection("<connectionId>");
331
+
332
+ // Search issues with JQL
333
+ const res = await jira.request("/rest/api/3/search?jql=project=PROJ&maxResults=10");
334
+ const data = await res.json();
335
+
336
+ // Create an issue
337
+ await jira.request("/rest/api/3/issue", {
338
+ method: "POST",
339
+ body: JSON.stringify({
340
+ fields: {
341
+ project: { key: "PROJ" },
342
+ summary: "New issue title",
343
+ issuetype: { name: "Task" },
344
+ },
345
+ }),
346
+ });
347
+ \`\`\`
348
+
349
+ ### Jira Cloud REST API v3 Reference
350
+
351
+ #### List Projects
352
+ - GET project
353
+ - Query params: maxResults, startAt, expand
354
+
355
+ #### Search Issues (JQL)
356
+ - POST search
357
+ - Body: { "jql": "project = PROJ AND status = 'In Progress'", "maxResults": 50, "startAt": 0, "fields": ["summary", "status", "assignee", "priority"] }
358
+ - Supports pagination via startAt and maxResults
359
+
360
+ #### Get Issue
361
+ - GET issue/{issueIdOrKey}
362
+ - Query params: fields, expand
363
+
364
+ #### Create Issue
365
+ - POST issue
366
+ - Body: { "fields": { "project": { "key": "PROJ" }, "summary": "Title", "description": { "type": "doc", "version": 1, "content": [...] }, "issuetype": { "name": "Task" } } }
367
+ - Description uses Atlassian Document Format (ADF)
368
+
369
+ #### Update Issue
370
+ - PUT issue/{issueIdOrKey}
371
+ - Body: { "fields": { "summary": "Updated title" } }
372
+
373
+ #### Transition Issue
374
+ - POST issue/{issueIdOrKey}/transitions (list available transitions with GET)
375
+ - Body: { "transition": { "id": "31" } }
376
+
377
+ #### Add Comment
378
+ - POST issue/{issueIdOrKey}/comment
379
+ - Body: { "body": { "type": "doc", "version": 1, "content": [{ "type": "paragraph", "content": [{ "type": "text", "text": "Comment text" }] }] } }
380
+
381
+ #### JQL Syntax
382
+ - Comparison: project = "PROJ", status = "Done", assignee = "user@example.com"
383
+ - Operators: AND, OR, NOT, IN, IS, IS NOT
384
+ - Order: ORDER BY created DESC
385
+ - Functions: currentUser(), startOfDay(), endOfWeek()
386
+ - Text search: summary ~ "keyword"`,
387
+ ja: `### \u30C4\u30FC\u30EB
388
+
389
+ - \`jira-api-key_request\`: Jira Cloud REST API\uFF08v3\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\u3001JQL\u306B\u3088\u308B\u30A4\u30B7\u30E5\u30FC\u691C\u7D22\u3001\u30A4\u30B7\u30E5\u30FC\u8A73\u7D30\u306E\u53D6\u5F97\u3001\u30A4\u30B7\u30E5\u30FC\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u3001\u30C8\u30E9\u30F3\u30B8\u30B7\u30E7\u30F3\u7BA1\u7406\u3001\u30B3\u30E1\u30F3\u30C8\u8FFD\u52A0\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Basic Auth: \u30E1\u30FC\u30EB + API\u30C8\u30FC\u30AF\u30F3\uFF09\u3068\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9URL\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
390
+
391
+ ### Business Logic
392
+
393
+ \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
394
+
395
+ #### Example
396
+
397
+ \`\`\`ts
398
+ import { connection } from "@squadbase/vite-server/connectors/jira-api-key";
399
+
400
+ const jira = connection("<connectionId>");
401
+
402
+ // JQL\u3067\u30A4\u30B7\u30E5\u30FC\u3092\u691C\u7D22
403
+ const res = await jira.request("/rest/api/3/search?jql=project=PROJ&maxResults=10");
404
+ const data = await res.json();
405
+
406
+ // \u30A4\u30B7\u30E5\u30FC\u3092\u4F5C\u6210
407
+ await jira.request("/rest/api/3/issue", {
408
+ method: "POST",
409
+ body: JSON.stringify({
410
+ fields: {
411
+ project: { key: "PROJ" },
412
+ summary: "\u65B0\u3057\u3044\u30A4\u30B7\u30E5\u30FC",
413
+ issuetype: { name: "Task" },
414
+ },
415
+ }),
416
+ });
417
+ \`\`\`
418
+
419
+ ### Jira Cloud REST API v3 \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
420
+
421
+ #### \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u306E\u53D6\u5F97
422
+ - GET project
423
+ - \u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF: maxResults, startAt, expand
424
+
425
+ #### \u30A4\u30B7\u30E5\u30FC\u691C\u7D22\uFF08JQL\uFF09
426
+ - POST search
427
+ - Body: { "jql": "project = PROJ AND status = 'In Progress'", "maxResults": 50, "startAt": 0, "fields": ["summary", "status", "assignee", "priority"] }
428
+ - startAt \u3068 maxResults \u3067\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u53EF\u80FD
429
+
430
+ #### \u30A4\u30B7\u30E5\u30FC\u306E\u53D6\u5F97
431
+ - GET issue/{issueIdOrKey}
432
+ - \u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF: fields, expand
433
+
434
+ #### \u30A4\u30B7\u30E5\u30FC\u306E\u4F5C\u6210
435
+ - POST issue
436
+ - Body: { "fields": { "project": { "key": "PROJ" }, "summary": "\u30BF\u30A4\u30C8\u30EB", "description": { "type": "doc", "version": 1, "content": [...] }, "issuetype": { "name": "Task" } } }
437
+ - description \u306F Atlassian Document Format (ADF) \u3092\u4F7F\u7528
438
+
439
+ #### \u30A4\u30B7\u30E5\u30FC\u306E\u66F4\u65B0
440
+ - PUT issue/{issueIdOrKey}
441
+ - Body: { "fields": { "summary": "\u66F4\u65B0\u3055\u308C\u305F\u30BF\u30A4\u30C8\u30EB" } }
442
+
443
+ #### \u30C8\u30E9\u30F3\u30B8\u30B7\u30E7\u30F3\u306E\u5B9F\u884C
444
+ - POST issue/{issueIdOrKey}/transitions\uFF08\u5229\u7528\u53EF\u80FD\u306A\u30C8\u30E9\u30F3\u30B8\u30B7\u30E7\u30F3\u306FGET\u3067\u53D6\u5F97\uFF09
445
+ - Body: { "transition": { "id": "31" } }
446
+
447
+ #### \u30B3\u30E1\u30F3\u30C8\u306E\u8FFD\u52A0
448
+ - POST issue/{issueIdOrKey}/comment
449
+ - Body: { "body": { "type": "doc", "version": 1, "content": [{ "type": "paragraph", "content": [{ "type": "text", "text": "\u30B3\u30E1\u30F3\u30C8\u5185\u5BB9" }] }] } }
450
+
451
+ #### JQL \u69CB\u6587
452
+ - \u6BD4\u8F03: project = "PROJ", status = "Done", assignee = "user@example.com"
453
+ - \u6F14\u7B97\u5B50: AND, OR, NOT, IN, IS, IS NOT
454
+ - \u30BD\u30FC\u30C8: ORDER BY created DESC
455
+ - \u95A2\u6570: currentUser(), startOfDay(), endOfWeek()
456
+ - \u30C6\u30AD\u30B9\u30C8\u691C\u7D22: summary ~ "\u30AD\u30FC\u30EF\u30FC\u30C9"`
457
+ },
458
+ tools
459
+ });
460
+
461
+ // src/connectors/create-connector-sdk.ts
462
+ import { readFileSync } from "fs";
463
+ import path from "path";
464
+
465
+ // src/connector-client/env.ts
466
+ function resolveEnvVar(entry, key, connectionId) {
467
+ const envVarName = entry.envVars[key];
468
+ if (!envVarName) {
469
+ throw new Error(`Connection "${connectionId}" is missing envVars mapping for key "${key}"`);
470
+ }
471
+ const value = process.env[envVarName];
472
+ if (!value) {
473
+ throw new Error(`Environment variable "${envVarName}" (for connection "${connectionId}", key "${key}") is not set`);
474
+ }
475
+ return value;
476
+ }
477
+ function resolveEnvVarOptional(entry, key) {
478
+ const envVarName = entry.envVars[key];
479
+ if (!envVarName) return void 0;
480
+ return process.env[envVarName] || void 0;
481
+ }
482
+
483
+ // src/connectors/create-connector-sdk.ts
484
+ function loadConnectionsSync() {
485
+ const filePath = process.env.CONNECTIONS_PATH ?? path.join(process.cwd(), ".squadbase/connections.json");
486
+ try {
487
+ const raw = readFileSync(filePath, "utf-8");
488
+ return JSON.parse(raw);
489
+ } catch {
490
+ return {};
491
+ }
492
+ }
493
+ function createConnectorSdk(plugin, createClient2) {
494
+ return (connectionId) => {
495
+ const connections = loadConnectionsSync();
496
+ const entry = connections[connectionId];
497
+ if (!entry) {
498
+ throw new Error(
499
+ `Connection "${connectionId}" not found in .squadbase/connections.json`
500
+ );
501
+ }
502
+ if (entry.connector.slug !== plugin.slug) {
503
+ throw new Error(
504
+ `Connection "${connectionId}" is not a ${plugin.slug} connection (got "${entry.connector.slug}")`
505
+ );
506
+ }
507
+ const params = {};
508
+ for (const param of Object.values(plugin.parameters)) {
509
+ if (param.required) {
510
+ params[param.slug] = resolveEnvVar(entry, param.slug, connectionId);
511
+ } else {
512
+ const val = resolveEnvVarOptional(entry, param.slug);
513
+ if (val !== void 0) params[param.slug] = val;
514
+ }
515
+ }
516
+ return createClient2(params);
517
+ };
518
+ }
519
+
520
+ // src/connectors/entries/jira-api-key.ts
521
+ var connection = createConnectorSdk(jiraConnector, createClient);
522
+ export {
523
+ connection
524
+ };
@@ -0,0 +1,5 @@
1
+ import * as _squadbase_connectors_sdk from '@squadbase/connectors/sdk';
2
+
3
+ declare const connection: (connectionId: string) => _squadbase_connectors_sdk.LinkedInAdsOauthConnectorSdk;
4
+
5
+ export { connection };