@squadbase/vite-server 0.1.3-dev.6 → 0.1.3-dev.7
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 +457 -136
- package/dist/connectors/google-analytics.js +6 -12
- package/dist/connectors/google-calendar-oauth.js +1 -1
- package/dist/connectors/google-calendar.js +63 -12
- package/dist/connectors/google-sheets-oauth.js +66 -23
- package/dist/connectors/google-sheets.js +33 -7
- package/dist/connectors/grafana.d.ts +5 -0
- package/dist/connectors/grafana.js +565 -0
- package/dist/index.js +455 -134
- package/dist/main.js +455 -134
- package/dist/vite-plugin.js +455 -134
- package/package.json +5 -1
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
|
|
7220
|
-
for (const [name, value] of
|
|
7219
|
+
const parameters60 = new URLSearchParams(await this.text());
|
|
7220
|
+
for (const [name, value] of parameters60) {
|
|
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,
|
|
10168
|
+
var s7, z78, i7 = 1, j6 = a6.length, r7 = a6[0] + "";
|
|
10169
10169
|
for (; i7 < j6; ) {
|
|
10170
10170
|
s7 = a6[i7++] + "";
|
|
10171
|
-
|
|
10172
|
-
for (;
|
|
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,
|
|
10205
|
+
function toFixedPoint(str, e7, z78) {
|
|
10206
10206
|
var len, zs;
|
|
10207
10207
|
if (e7 < 0) {
|
|
10208
|
-
for (zs =
|
|
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 =
|
|
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);
|
|
@@ -18269,6 +18269,35 @@ var require_src5 = __commonJS({
|
|
|
18269
18269
|
}
|
|
18270
18270
|
});
|
|
18271
18271
|
|
|
18272
|
+
// ../connectors/src/connectors/google-sheets/utils.ts
|
|
18273
|
+
function extractSpreadsheetId(urlOrId) {
|
|
18274
|
+
const trimmed = urlOrId.trim();
|
|
18275
|
+
const match = trimmed.match(SPREADSHEET_URL_PATTERN);
|
|
18276
|
+
if (match) {
|
|
18277
|
+
return match[1];
|
|
18278
|
+
}
|
|
18279
|
+
return trimmed;
|
|
18280
|
+
}
|
|
18281
|
+
var SPREADSHEET_URL_PATTERN;
|
|
18282
|
+
var init_utils = __esm({
|
|
18283
|
+
"../connectors/src/connectors/google-sheets/utils.ts"() {
|
|
18284
|
+
"use strict";
|
|
18285
|
+
SPREADSHEET_URL_PATTERN = /docs\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9_-]+)/;
|
|
18286
|
+
}
|
|
18287
|
+
});
|
|
18288
|
+
|
|
18289
|
+
// ../connectors/src/connectors/google-sheets-oauth/utils.ts
|
|
18290
|
+
var utils_exports = {};
|
|
18291
|
+
__export(utils_exports, {
|
|
18292
|
+
extractSpreadsheetId: () => extractSpreadsheetId
|
|
18293
|
+
});
|
|
18294
|
+
var init_utils2 = __esm({
|
|
18295
|
+
"../connectors/src/connectors/google-sheets-oauth/utils.ts"() {
|
|
18296
|
+
"use strict";
|
|
18297
|
+
init_utils();
|
|
18298
|
+
}
|
|
18299
|
+
});
|
|
18300
|
+
|
|
18272
18301
|
// ../../node_modules/bson/lib/bson.cjs
|
|
18273
18302
|
var require_bson = __commonJS({
|
|
18274
18303
|
"../../node_modules/bson/lib/bson.cjs"(exports2) {
|
|
@@ -37094,14 +37123,14 @@ var init_NormalizedSchema = __esm({
|
|
|
37094
37123
|
throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
|
|
37095
37124
|
}
|
|
37096
37125
|
const struct = this.getSchema();
|
|
37097
|
-
const
|
|
37126
|
+
const z78 = struct[4].length;
|
|
37098
37127
|
let it = struct[anno.it];
|
|
37099
|
-
if (it &&
|
|
37128
|
+
if (it && z78 === it.length) {
|
|
37100
37129
|
yield* it;
|
|
37101
37130
|
return;
|
|
37102
37131
|
}
|
|
37103
|
-
it = Array(
|
|
37104
|
-
for (let i7 = 0; i7 <
|
|
37132
|
+
it = Array(z78);
|
|
37133
|
+
for (let i7 = 0; i7 < z78; ++i7) {
|
|
37105
37134
|
const k6 = struct[4][i7];
|
|
37106
37135
|
const v7 = member([struct[5][i7], 0], k6);
|
|
37107
37136
|
yield it[i7] = [k6, v7];
|
|
@@ -37777,12 +37806,12 @@ var init_split_header = __esm({
|
|
|
37777
37806
|
"../../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js"() {
|
|
37778
37807
|
"use strict";
|
|
37779
37808
|
splitHeader = (value) => {
|
|
37780
|
-
const
|
|
37809
|
+
const z78 = value.length;
|
|
37781
37810
|
const values = [];
|
|
37782
37811
|
let withinQuotes = false;
|
|
37783
37812
|
let prevChar = void 0;
|
|
37784
37813
|
let anchor = 0;
|
|
37785
|
-
for (let i7 = 0; i7 <
|
|
37814
|
+
for (let i7 = 0; i7 < z78; ++i7) {
|
|
37786
37815
|
const char = value[i7];
|
|
37787
37816
|
switch (char) {
|
|
37788
37817
|
case `"`:
|
|
@@ -37803,12 +37832,12 @@ var init_split_header = __esm({
|
|
|
37803
37832
|
values.push(value.slice(anchor));
|
|
37804
37833
|
return values.map((v7) => {
|
|
37805
37834
|
v7 = v7.trim();
|
|
37806
|
-
const
|
|
37807
|
-
if (
|
|
37835
|
+
const z79 = v7.length;
|
|
37836
|
+
if (z79 < 2) {
|
|
37808
37837
|
return v7;
|
|
37809
37838
|
}
|
|
37810
|
-
if (v7[0] === `"` && v7[
|
|
37811
|
-
v7 = v7.slice(1,
|
|
37839
|
+
if (v7[0] === `"` && v7[z79 - 1] === `"`) {
|
|
37840
|
+
v7 = v7.slice(1, z79 - 1);
|
|
37812
37841
|
}
|
|
37813
37842
|
return v7.replace(/\\"/g, '"');
|
|
37814
37843
|
});
|
|
@@ -39206,11 +39235,11 @@ var init_EndpointCache = __esm({
|
|
|
39206
39235
|
}
|
|
39207
39236
|
hash(endpointParams) {
|
|
39208
39237
|
let buffer = "";
|
|
39209
|
-
const { parameters:
|
|
39210
|
-
if (
|
|
39238
|
+
const { parameters: parameters60 } = this;
|
|
39239
|
+
if (parameters60.length === 0) {
|
|
39211
39240
|
return false;
|
|
39212
39241
|
}
|
|
39213
|
-
for (const param of
|
|
39242
|
+
for (const param of parameters60) {
|
|
39214
39243
|
const val = String(endpointParams[param] ?? "");
|
|
39215
39244
|
if (val.includes("|;")) {
|
|
39216
39245
|
return false;
|
|
@@ -39909,7 +39938,7 @@ var init_evaluateRules = __esm({
|
|
|
39909
39938
|
});
|
|
39910
39939
|
|
|
39911
39940
|
// ../../node_modules/@smithy/util-endpoints/dist-es/utils/index.js
|
|
39912
|
-
var
|
|
39941
|
+
var init_utils3 = __esm({
|
|
39913
39942
|
"../../node_modules/@smithy/util-endpoints/dist-es/utils/index.js"() {
|
|
39914
39943
|
"use strict";
|
|
39915
39944
|
init_customEndpointFunctions();
|
|
@@ -39924,18 +39953,18 @@ var init_resolveEndpoint = __esm({
|
|
|
39924
39953
|
"use strict";
|
|
39925
39954
|
init_debug();
|
|
39926
39955
|
init_types2();
|
|
39927
|
-
|
|
39956
|
+
init_utils3();
|
|
39928
39957
|
resolveEndpoint = (ruleSetObject, options) => {
|
|
39929
39958
|
const { endpointParams, logger: logger2 } = options;
|
|
39930
|
-
const { parameters:
|
|
39959
|
+
const { parameters: parameters60, rules } = ruleSetObject;
|
|
39931
39960
|
options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
|
|
39932
|
-
const paramsWithDefault = Object.entries(
|
|
39961
|
+
const paramsWithDefault = Object.entries(parameters60).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]);
|
|
39933
39962
|
if (paramsWithDefault.length > 0) {
|
|
39934
39963
|
for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
|
|
39935
39964
|
endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
|
|
39936
39965
|
}
|
|
39937
39966
|
}
|
|
39938
|
-
const requiredParams = Object.entries(
|
|
39967
|
+
const requiredParams = Object.entries(parameters60).filter(([, v7]) => v7.required).map(([k6]) => k6);
|
|
39939
39968
|
for (const requiredParam of requiredParams) {
|
|
39940
39969
|
if (endpointParams[requiredParam] == null) {
|
|
39941
39970
|
throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
|
|
@@ -43455,7 +43484,7 @@ var init_getUpdatedSystemClockOffset = __esm({
|
|
|
43455
43484
|
});
|
|
43456
43485
|
|
|
43457
43486
|
// ../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js
|
|
43458
|
-
var
|
|
43487
|
+
var init_utils4 = __esm({
|
|
43459
43488
|
"../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() {
|
|
43460
43489
|
"use strict";
|
|
43461
43490
|
init_getDateHeader();
|
|
@@ -43470,7 +43499,7 @@ var init_AwsSdkSigV4Signer = __esm({
|
|
|
43470
43499
|
"../../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() {
|
|
43471
43500
|
"use strict";
|
|
43472
43501
|
init_dist_es3();
|
|
43473
|
-
|
|
43502
|
+
init_utils4();
|
|
43474
43503
|
throwSigningPropertyError = (name, property) => {
|
|
43475
43504
|
if (!property) {
|
|
43476
43505
|
throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
|
|
@@ -45545,8 +45574,8 @@ var init_ProtocolLib = __esm({
|
|
|
45545
45574
|
constructor(queryCompat = false) {
|
|
45546
45575
|
this.queryCompat = queryCompat;
|
|
45547
45576
|
}
|
|
45548
|
-
resolveRestContentType(defaultContentType,
|
|
45549
|
-
const members =
|
|
45577
|
+
resolveRestContentType(defaultContentType, inputSchema75) {
|
|
45578
|
+
const members = inputSchema75.getMemberSchemas();
|
|
45550
45579
|
const httpPayloadMember = Object.values(members).find((m7) => {
|
|
45551
45580
|
return !!m7.getMergedTraits().httpPayload;
|
|
45552
45581
|
});
|
|
@@ -45561,7 +45590,7 @@ var init_ProtocolLib = __esm({
|
|
|
45561
45590
|
} else {
|
|
45562
45591
|
return defaultContentType;
|
|
45563
45592
|
}
|
|
45564
|
-
} else if (!
|
|
45593
|
+
} else if (!inputSchema75.isUnitSchema()) {
|
|
45565
45594
|
const hasBody = Object.values(members).find((m7) => {
|
|
45566
45595
|
const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m7.getMergedTraits();
|
|
45567
45596
|
const noPrefixHeaders = httpPrefixHeaders === void 0;
|
|
@@ -46404,9 +46433,9 @@ var init_AwsRestJsonProtocol = __esm({
|
|
|
46404
46433
|
}
|
|
46405
46434
|
async serializeRequest(operationSchema, input, context) {
|
|
46406
46435
|
const request2 = await super.serializeRequest(operationSchema, input, context);
|
|
46407
|
-
const
|
|
46436
|
+
const inputSchema75 = NormalizedSchema.of(operationSchema.input);
|
|
46408
46437
|
if (!request2.headers["content-type"]) {
|
|
46409
|
-
const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(),
|
|
46438
|
+
const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema75);
|
|
46410
46439
|
if (contentType) {
|
|
46411
46440
|
request2.headers["content-type"] = contentType;
|
|
46412
46441
|
}
|
|
@@ -46418,8 +46447,8 @@ var init_AwsRestJsonProtocol = __esm({
|
|
|
46418
46447
|
}
|
|
46419
46448
|
async deserializeResponse(operationSchema, context, response) {
|
|
46420
46449
|
const output = await super.deserializeResponse(operationSchema, context, response);
|
|
46421
|
-
const
|
|
46422
|
-
for (const [name, member2] of
|
|
46450
|
+
const outputSchema75 = NormalizedSchema.of(operationSchema.output);
|
|
46451
|
+
for (const [name, member2] of outputSchema75.structIterator()) {
|
|
46423
46452
|
if (member2.getMemberTraits().httpPayload && !(name in output)) {
|
|
46424
46453
|
output[name] = null;
|
|
46425
46454
|
}
|
|
@@ -50283,22 +50312,22 @@ var init_loadCognitoIdentity = __esm({
|
|
|
50283
50312
|
});
|
|
50284
50313
|
|
|
50285
50314
|
// ../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js
|
|
50286
|
-
function fromCognitoIdentity(
|
|
50315
|
+
function fromCognitoIdentity(parameters60) {
|
|
50287
50316
|
return async (awsIdentityProperties) => {
|
|
50288
|
-
|
|
50317
|
+
parameters60.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
|
|
50289
50318
|
const { GetCredentialsForIdentityCommand: GetCredentialsForIdentityCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
|
|
50290
|
-
const fromConfigs = (property) =>
|
|
50291
|
-
const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(
|
|
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 ?? {}, {
|
|
50292
50321
|
region: fromConfigs("region"),
|
|
50293
50322
|
profile: fromConfigs("profile"),
|
|
50294
50323
|
userAgentAppId: fromConfigs("userAgentAppId")
|
|
50295
50324
|
}))).send(new GetCredentialsForIdentityCommand2({
|
|
50296
|
-
CustomRoleArn:
|
|
50297
|
-
IdentityId:
|
|
50298
|
-
Logins:
|
|
50325
|
+
CustomRoleArn: parameters60.customRoleArn,
|
|
50326
|
+
IdentityId: parameters60.identityId,
|
|
50327
|
+
Logins: parameters60.logins ? await resolveLogins(parameters60.logins) : void 0
|
|
50299
50328
|
}));
|
|
50300
50329
|
return {
|
|
50301
|
-
identityId:
|
|
50330
|
+
identityId: parameters60.identityId,
|
|
50302
50331
|
accessKeyId: AccessKeyId,
|
|
50303
50332
|
secretAccessKey: SecretKey,
|
|
50304
50333
|
sessionToken: SessionToken,
|
|
@@ -86098,17 +86127,9 @@ var parameters13 = {
|
|
|
86098
86127
|
type: "base64EncodedJson",
|
|
86099
86128
|
secret: true,
|
|
86100
86129
|
required: true
|
|
86101
|
-
}),
|
|
86102
|
-
propertyId: new ParameterDefinition({
|
|
86103
|
-
slug: "property-id",
|
|
86104
|
-
name: "Google Analytics Property ID",
|
|
86105
|
-
description: "The Google Analytics 4 property ID (e.g., 123456789). Set during connection setup.",
|
|
86106
|
-
envVarBaseKey: "GA_PROPERTY_ID",
|
|
86107
|
-
type: "text",
|
|
86108
|
-
secret: false,
|
|
86109
|
-
required: false
|
|
86110
86130
|
})
|
|
86111
86131
|
};
|
|
86132
|
+
var PROPERTY_ID_SLUG = "property-id";
|
|
86112
86133
|
|
|
86113
86134
|
// ../connectors/src/connectors/google-analytics/tools/auth.ts
|
|
86114
86135
|
var SCOPES = [
|
|
@@ -86377,7 +86398,9 @@ Authentication is handled automatically using a service account.
|
|
|
86377
86398
|
try {
|
|
86378
86399
|
const { GoogleAuth } = await Promise.resolve().then(() => __toESM(require_src5(), 1));
|
|
86379
86400
|
const keyJsonBase64 = parameters13.serviceAccountKeyJsonBase64.getValue(connection);
|
|
86380
|
-
const propertyId =
|
|
86401
|
+
const propertyId = connection.parameters.find(
|
|
86402
|
+
(p6) => p6.parameterSlug === PROPERTY_ID_SLUG
|
|
86403
|
+
)?.value ?? void 0;
|
|
86381
86404
|
const credentials = JSON.parse(
|
|
86382
86405
|
Buffer.from(keyJsonBase64, "base64").toString("utf-8")
|
|
86383
86406
|
);
|
|
@@ -87177,6 +87200,34 @@ const realtime = await ga.runRealtimeReport({
|
|
|
87177
87200
|
|
|
87178
87201
|
// ../connectors/src/connectors/google-calendar/setup.ts
|
|
87179
87202
|
var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
87203
|
+
connectionSetupInstructions: {
|
|
87204
|
+
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Calendar\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
87205
|
+
|
|
87206
|
+
1. \u30E6\u30FC\u30B6\u30FC\u306B\u300C\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u30A2\u30AF\u30BB\u30B9\u3057\u305F\u3044Google Workspace\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u6559\u3048\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: user@example.com\uFF09\u300D\u3068\u4F1D\u3048\u308B
|
|
87207
|
+
2. \u30E6\u30FC\u30B6\u30FC\u304C\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u63D0\u4F9B\u3057\u305F\u3089\u3001\`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
87208
|
+
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
87209
|
+
- \`value\`: \u30E6\u30FC\u30B6\u30FC\u304C\u63D0\u4F9B\u3057\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9
|
|
87210
|
+
3. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306E\u60C5\u5831\u3092\u8A18\u9332\u3059\u308B:
|
|
87211
|
+
- \`user\`: \u8A2D\u5B9A\u3057\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9
|
|
87212
|
+
- \`note\`: \u300CDomain-wide Delegation\u3067 {email} \u306E\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u30A2\u30AF\u30BB\u30B9\u300D\u306A\u3069\u306E\u8AAC\u660E
|
|
87213
|
+
|
|
87214
|
+
#### \u5236\u7D04
|
|
87215
|
+
- **\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u8A2D\u5B9A\u304C\u5FC5\u8981\u3067\u3059**\u3002\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u30A8\u30E9\u30FC\u304C\u51FA\u308B\u5834\u5408\u3001Google Workspace\u7BA1\u7406\u8005\u306BDomain-wide Delegation\u306E\u8A2D\u5B9A\u78BA\u8A8D\u3092\u4FC3\u3057\u3066\u304F\u3060\u3055\u3044
|
|
87216
|
+
- \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u3002\u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
|
|
87217
|
+
en: `Follow these steps to set up the Google Calendar connection.
|
|
87218
|
+
|
|
87219
|
+
1. Ask the user for the Google Workspace email address whose calendar should be accessed (e.g., user@example.com)
|
|
87220
|
+
2. When the user provides an email, call \`updateConnectionParameters\`:
|
|
87221
|
+
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
87222
|
+
- \`value\`: The email provided by the user
|
|
87223
|
+
3. Call \`updateConnectionContext\` to record the target user:
|
|
87224
|
+
- \`user\`: The configured email address
|
|
87225
|
+
- \`note\`: A description such as "Accessing {email}'s calendar via Domain-wide Delegation"
|
|
87226
|
+
|
|
87227
|
+
#### Constraints
|
|
87228
|
+
- **Domain-wide Delegation must be configured on the service account**. If access errors occur, ask the user to verify the Domain-wide Delegation setup with their Google Workspace administrator
|
|
87229
|
+
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
87230
|
+
},
|
|
87180
87231
|
dataOverviewInstructions: {
|
|
87181
87232
|
en: `1. Call google-calendar_request with GET /calendars/{calendarId} to get the default calendar's metadata
|
|
87182
87233
|
2. Call google-calendar_request with GET /users/me/calendarList to list all accessible calendars
|
|
@@ -87198,6 +87249,15 @@ var parameters15 = {
|
|
|
87198
87249
|
secret: true,
|
|
87199
87250
|
required: true
|
|
87200
87251
|
}),
|
|
87252
|
+
impersonateEmail: new ParameterDefinition({
|
|
87253
|
+
slug: "impersonate-email",
|
|
87254
|
+
name: "User Email Address",
|
|
87255
|
+
description: "The email address of the Google Workspace user whose calendar will be accessed via Domain-wide Delegation (e.g., 'user@example.com'). The service account will act on behalf of this user.",
|
|
87256
|
+
envVarBaseKey: "GOOGLE_CALENDAR_IMPERSONATE_EMAIL",
|
|
87257
|
+
type: "text",
|
|
87258
|
+
secret: false,
|
|
87259
|
+
required: true
|
|
87260
|
+
}),
|
|
87201
87261
|
calendarId: new ParameterDefinition({
|
|
87202
87262
|
slug: "calendar-id",
|
|
87203
87263
|
name: "Default Calendar ID",
|
|
@@ -87225,7 +87285,7 @@ var inputSchema25 = z25.object({
|
|
|
87225
87285
|
queryParams: z25.record(z25.string(), z25.string()).optional().describe("Query parameters to append to the URL"),
|
|
87226
87286
|
body: z25.record(z25.string(), z25.unknown()).optional().describe("Request body (JSON) for POST/PUT/PATCH methods"),
|
|
87227
87287
|
subject: z25.string().optional().describe(
|
|
87228
|
-
"
|
|
87288
|
+
"Override the email address of the user to impersonate via Domain-wide Delegation. If omitted, the connection's configured user email is used."
|
|
87229
87289
|
)
|
|
87230
87290
|
});
|
|
87231
87291
|
var outputSchema25 = z25.discriminatedUnion("success", [
|
|
@@ -87260,7 +87320,15 @@ Authentication is handled automatically using a service account.
|
|
|
87260
87320
|
try {
|
|
87261
87321
|
const { GoogleAuth } = await Promise.resolve().then(() => __toESM(require_src5(), 1));
|
|
87262
87322
|
const keyJsonBase64 = parameters15.serviceAccountKeyJsonBase64.getValue(connection);
|
|
87323
|
+
const impersonateEmail = parameters15.impersonateEmail.tryGetValue(connection);
|
|
87263
87324
|
const calendarId = parameters15.calendarId.tryGetValue(connection) ?? "primary";
|
|
87325
|
+
const resolvedSubject = subject ?? impersonateEmail;
|
|
87326
|
+
if (!resolvedSubject) {
|
|
87327
|
+
return {
|
|
87328
|
+
success: false,
|
|
87329
|
+
error: `Missing required parameter: ${parameters15.impersonateEmail.slug}. Configure the user email for this connection.`
|
|
87330
|
+
};
|
|
87331
|
+
}
|
|
87264
87332
|
const credentials = JSON.parse(
|
|
87265
87333
|
Buffer.from(keyJsonBase64, "base64").toString("utf-8")
|
|
87266
87334
|
);
|
|
@@ -87270,7 +87338,7 @@ Authentication is handled automatically using a service account.
|
|
|
87270
87338
|
"https://www.googleapis.com/auth/calendar.readonly",
|
|
87271
87339
|
"https://www.googleapis.com/auth/calendar.events.readonly"
|
|
87272
87340
|
],
|
|
87273
|
-
|
|
87341
|
+
clientOptions: { subject: resolvedSubject }
|
|
87274
87342
|
});
|
|
87275
87343
|
const token = await auth.getAccessToken();
|
|
87276
87344
|
if (!token) {
|
|
@@ -87330,20 +87398,20 @@ var googleCalendarConnector = new ConnectorPlugin({
|
|
|
87330
87398
|
authType: AUTH_TYPES.SERVICE_ACCOUNT,
|
|
87331
87399
|
name: "Google Calendar",
|
|
87332
87400
|
description: "Connect to Google Calendar for calendar and event data access using a service account.",
|
|
87333
|
-
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/
|
|
87401
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2YsqoBEpdELmfDeFcyGHyE/4494c633b5ae15e562cb739cd85442c1/google-calendar.png",
|
|
87334
87402
|
parameters: parameters15,
|
|
87335
87403
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
87336
87404
|
onboarding: googleCalendarOnboarding,
|
|
87337
87405
|
systemPrompt: {
|
|
87338
87406
|
en: `### Tools
|
|
87339
87407
|
|
|
87340
|
-
- \`google-calendar_request\`: The only way to call the Google Calendar API. Use it to list calendars, get events, and manage calendar data. Authentication is handled automatically using a service account. The {calendarId} placeholder in paths is automatically replaced with the configured default calendar ID.
|
|
87408
|
+
- \`google-calendar_request\`: The only way to call the Google Calendar API. Use it to list calendars, get events, and manage calendar data. Authentication is handled automatically using a service account with Domain-wide Delegation \u2014 the service account impersonates the user configured on the connection (\`impersonate-email\` parameter). The {calendarId} placeholder in paths is automatically replaced with the configured default calendar ID. Pass an optional \`subject\` only if you need to override the configured user for a specific request.
|
|
87341
87409
|
|
|
87342
87410
|
### Business Logic
|
|
87343
87411
|
|
|
87344
87412
|
The business logic type for this connector is "typescript". Use the connector SDK in your handler. Do NOT read credentials from environment variables.
|
|
87345
87413
|
|
|
87346
|
-
SDK methods (client created via \`connection(connectionId)\`
|
|
87414
|
+
SDK methods (client created via \`connection(connectionId)\` \u2014 the connection's \`impersonate-email\` parameter is used automatically for Domain-wide Delegation):
|
|
87347
87415
|
- \`client.listCalendars()\` \u2014 list all accessible calendars
|
|
87348
87416
|
- \`client.listEvents(options?, calendarId?)\` \u2014 list events with optional filters
|
|
87349
87417
|
- \`client.getEvent(eventId, calendarId?)\` \u2014 get a single event by ID
|
|
@@ -87351,10 +87419,10 @@ SDK methods (client created via \`connection(connectionId)\` or \`connection(con
|
|
|
87351
87419
|
|
|
87352
87420
|
#### Domain-wide Delegation
|
|
87353
87421
|
|
|
87354
|
-
|
|
87422
|
+
The target user email is configured on the connection (\`impersonate-email\` parameter), so \`connection()\` automatically uses it. Pass \`subject\` only to override it:
|
|
87355
87423
|
|
|
87356
87424
|
\`\`\`ts
|
|
87357
|
-
const calendar = connection("<connectionId>", { subject: "user@example.com" });
|
|
87425
|
+
const calendar = connection("<connectionId>", { subject: "other-user@example.com" });
|
|
87358
87426
|
\`\`\`
|
|
87359
87427
|
|
|
87360
87428
|
\`\`\`ts
|
|
@@ -87408,13 +87476,13 @@ export default async function handler(c: Context) {
|
|
|
87408
87476
|
- The default calendar ID is "primary" if not configured`,
|
|
87409
87477
|
ja: `### \u30C4\u30FC\u30EB
|
|
87410
87478
|
|
|
87411
|
-
- \`google-calendar_request\`: Google Calendar API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u4E00\u89A7\u53D6\u5F97\u3001\u30A4\u30D9\u30F3\u30C8\u306E\u53D6\u5F97\u3001\u30AB\u30EC\u30F3\u30C0\u30FC\u30C7\u30FC\u30BF\u306E\u7BA1\u7406\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\
|
|
87479
|
+
- \`google-calendar_request\`: Google Calendar API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u4E00\u89A7\u53D6\u5F97\u3001\u30A4\u30D9\u30F3\u30C8\u306E\u53D6\u5F97\u3001\u30AB\u30EC\u30F3\u30C0\u30FC\u30C7\u30FC\u30BF\u306E\u7BA1\u7406\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\uFF0BDomain-wide Delegation\u3067\u8A8D\u8A3C\u304C\u81EA\u52D5\u7684\u306B\u51E6\u7406\u3055\u308C\u3001\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306B\u8A2D\u5B9A\u3055\u308C\u305F\u30E6\u30FC\u30B6\u30FC\uFF08\`impersonate-email\`\u30D1\u30E9\u30E1\u30FC\u30BF\uFF09\u3068\u3057\u3066\u52D5\u4F5C\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{calendarId}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u8A2D\u5B9A\u6E08\u307F\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30AB\u30EC\u30F3\u30C0\u30FCID\u3067\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002\u7279\u5B9A\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u8A2D\u5B9A\u30E6\u30FC\u30B6\u30FC\u3092\u4E0A\u66F8\u304D\u3057\u305F\u3044\u5834\u5408\u306E\u307F\u3001\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\`subject\`\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
87412
87480
|
|
|
87413
87481
|
### Business Logic
|
|
87414
87482
|
|
|
87415
87483
|
\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
|
|
87416
87484
|
|
|
87417
|
-
SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \
|
|
87485
|
+
SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8 \u2014 \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\`impersonate-email\`\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u81EA\u52D5\u7684\u306BDomain-wide Delegation\u306Esubject\u3068\u3057\u3066\u4F7F\u308F\u308C\u307E\u3059):
|
|
87418
87486
|
- \`client.listCalendars()\` \u2014 \u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u5168\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u4E00\u89A7\u53D6\u5F97
|
|
87419
87487
|
- \`client.listEvents(options?, calendarId?)\` \u2014 \u30D5\u30A3\u30EB\u30BF\u30FC\u4ED8\u304D\u30A4\u30D9\u30F3\u30C8\u4E00\u89A7\u53D6\u5F97
|
|
87420
87488
|
- \`client.getEvent(eventId, calendarId?)\` \u2014 ID\u306B\u3088\u308B\u5358\u4E00\u30A4\u30D9\u30F3\u30C8\u53D6\u5F97
|
|
@@ -87422,10 +87490,10 @@ SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u307E\u305F\u306F \`c
|
|
|
87422
87490
|
|
|
87423
87491
|
#### Domain-wide Delegation
|
|
87424
87492
|
|
|
87425
|
-
|
|
87493
|
+
\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\uFF08\`impersonate-email\`\u30D1\u30E9\u30E1\u30FC\u30BF\uFF09\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u3001\`connection()\`\u306F\u81EA\u52D5\u7684\u306B\u305D\u308C\u3092\u4F7F\u3044\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3057\u305F\u3044\u5834\u5408\u306E\u307F\`subject\`\u3092\u6E21\u3057\u307E\u3059\uFF1A
|
|
87426
87494
|
|
|
87427
87495
|
\`\`\`ts
|
|
87428
|
-
const calendar = connection("<connectionId>", { subject: "user@example.com" });
|
|
87496
|
+
const calendar = connection("<connectionId>", { subject: "other-user@example.com" });
|
|
87429
87497
|
\`\`\`
|
|
87430
87498
|
|
|
87431
87499
|
\`\`\`ts
|
|
@@ -87788,7 +87856,7 @@ var googleCalendarOauthConnector = new ConnectorPlugin({
|
|
|
87788
87856
|
authType: AUTH_TYPES.OAUTH,
|
|
87789
87857
|
name: "Google Calendar",
|
|
87790
87858
|
description: "Connect to Google Calendar for calendar and event data access using OAuth.",
|
|
87791
|
-
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/
|
|
87859
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2YsqoBEpdELmfDeFcyGHyE/4494c633b5ae15e562cb739cd85442c1/google-calendar.png",
|
|
87792
87860
|
parameters: parameters16,
|
|
87793
87861
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
87794
87862
|
onboarding: googleCalendarOauthOnboarding,
|
|
@@ -87961,11 +88029,11 @@ var parameters17 = {
|
|
|
87961
88029
|
secret: true,
|
|
87962
88030
|
required: true
|
|
87963
88031
|
}),
|
|
87964
|
-
|
|
87965
|
-
slug: "spreadsheet-
|
|
87966
|
-
name: "
|
|
87967
|
-
description: "The
|
|
87968
|
-
envVarBaseKey: "
|
|
88032
|
+
spreadsheetUrl: new ParameterDefinition({
|
|
88033
|
+
slug: "spreadsheet-url",
|
|
88034
|
+
name: "Google Spreadsheet URL",
|
|
88035
|
+
description: "The URL of the Google Spreadsheet (e.g., https://docs.google.com/spreadsheets/d/xxxxx/edit). The spreadsheet ID is automatically extracted from the URL.",
|
|
88036
|
+
envVarBaseKey: "GOOGLE_SHEETS_SPREADSHEET_URL",
|
|
87969
88037
|
type: "text",
|
|
87970
88038
|
secret: false,
|
|
87971
88039
|
required: false
|
|
@@ -87974,6 +88042,7 @@ var parameters17 = {
|
|
|
87974
88042
|
|
|
87975
88043
|
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
87976
88044
|
import { z as z28 } from "zod";
|
|
88045
|
+
init_utils();
|
|
87977
88046
|
var BASE_URL11 = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
87978
88047
|
var REQUEST_TIMEOUT_MS18 = 6e4;
|
|
87979
88048
|
var inputSchema28 = z28.object({
|
|
@@ -88019,7 +88088,8 @@ Authentication is handled automatically using a service account.
|
|
|
88019
88088
|
try {
|
|
88020
88089
|
const { GoogleAuth } = await Promise.resolve().then(() => __toESM(require_src5(), 1));
|
|
88021
88090
|
const keyJsonBase64 = parameters17.serviceAccountKeyJsonBase64.getValue(connection);
|
|
88022
|
-
const
|
|
88091
|
+
const spreadsheetUrl = parameters17.spreadsheetUrl.tryGetValue(connection);
|
|
88092
|
+
const spreadsheetId = spreadsheetUrl ? extractSpreadsheetId(spreadsheetUrl) : void 0;
|
|
88023
88093
|
const credentials = JSON.parse(
|
|
88024
88094
|
Buffer.from(keyJsonBase64, "base64").toString("utf-8")
|
|
88025
88095
|
);
|
|
@@ -88186,11 +88256,11 @@ import { z as z29 } from "zod";
|
|
|
88186
88256
|
|
|
88187
88257
|
// ../connectors/src/connectors/google-sheets-oauth/parameters.ts
|
|
88188
88258
|
var parameters18 = {
|
|
88189
|
-
|
|
88190
|
-
slug: "spreadsheet-
|
|
88191
|
-
name: "
|
|
88192
|
-
description: "The
|
|
88193
|
-
envVarBaseKey: "
|
|
88259
|
+
spreadsheetUrl: new ParameterDefinition({
|
|
88260
|
+
slug: "spreadsheet-url",
|
|
88261
|
+
name: "Google Spreadsheet URL",
|
|
88262
|
+
description: "The URL of the Google Spreadsheet (e.g., https://docs.google.com/spreadsheets/d/xxxxx/edit). The spreadsheet ID is automatically extracted from the URL.",
|
|
88263
|
+
envVarBaseKey: "GOOGLE_SHEETS_OAUTH_SPREADSHEET_URL",
|
|
88194
88264
|
type: "text",
|
|
88195
88265
|
secret: false,
|
|
88196
88266
|
required: false
|
|
@@ -88198,6 +88268,7 @@ var parameters18 = {
|
|
|
88198
88268
|
};
|
|
88199
88269
|
|
|
88200
88270
|
// ../connectors/src/connectors/google-sheets-oauth/tools/request.ts
|
|
88271
|
+
init_utils2();
|
|
88201
88272
|
var BASE_URL12 = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
88202
88273
|
var REQUEST_TIMEOUT_MS19 = 6e4;
|
|
88203
88274
|
var cachedToken11 = null;
|
|
@@ -88272,7 +88343,8 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
88272
88343
|
`[connector-request] google-sheets-oauth/${connection.name}: ${method} ${path5}`
|
|
88273
88344
|
);
|
|
88274
88345
|
try {
|
|
88275
|
-
const
|
|
88346
|
+
const spreadsheetUrl = parameters18.spreadsheetUrl.tryGetValue(connection);
|
|
88347
|
+
const spreadsheetId = spreadsheetUrl ? extractSpreadsheetId(spreadsheetUrl) : void 0;
|
|
88276
88348
|
const resolvedPath = spreadsheetId ? path5.replace(/\{spreadsheetId\}/g, spreadsheetId) : path5;
|
|
88277
88349
|
let url = `${BASE_URL12}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
|
|
88278
88350
|
if (queryParams) {
|
|
@@ -88319,15 +88391,14 @@ var googleSheetsOnboarding2 = new ConnectorOnboarding({
|
|
|
88319
88391
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Sheets\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
88320
88392
|
|
|
88321
88393
|
1. \u30E6\u30FC\u30B6\u30FC\u306B\u300C\u4F7F\u7528\u3059\u308BGoogle Sheets\u306EURL\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: https://docs.google.com/spreadsheets/d/xxxxx/edit\uFF09\u300D\u3068\u4F1D\u3048\u308B
|
|
88322
|
-
2. \u30E6\u30FC\u30B6\u30FC\u304CURL\
|
|
88323
|
-
|
|
88324
|
-
- \`
|
|
88325
|
-
|
|
88326
|
-
4. \`${requestToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3059\u308B:
|
|
88394
|
+
2. \u30E6\u30FC\u30B6\u30FC\u304CURL\u3092\u63D0\u4F9B\u3057\u305F\u3089\u3001\`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
88395
|
+
- \`parameterSlug\`: \`"spreadsheet-url"\`
|
|
88396
|
+
- \`value\`: \u30E6\u30FC\u30B6\u30FC\u304C\u63D0\u4F9B\u3057\u305FURL\uFF08\u305D\u306E\u307E\u307E\u4FDD\u5B58\u3002ID\u306E\u62BD\u51FA\u306F\u81EA\u52D5\u3067\u884C\u308F\u308C\u307E\u3059\uFF09
|
|
88397
|
+
3. \`${requestToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3059\u308B:
|
|
88327
88398
|
- \`method\`: \`"GET"\`
|
|
88328
88399
|
- \`path\`: \`"/{spreadsheetId}?fields=spreadsheetId,properties.title,sheets.properties.title"\`
|
|
88329
|
-
|
|
88330
|
-
|
|
88400
|
+
4. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u5171\u6709\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B
|
|
88401
|
+
5. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3059:
|
|
88331
88402
|
- \`spreadsheet\`: \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30BF\u30A4\u30C8\u30EB
|
|
88332
88403
|
- \`sheets\`: \u30B7\u30FC\u30C8\u540D\u4E00\u89A7\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
88333
88404
|
- \`note\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5185\u5BB9\u306E\u7C21\u5358\u306A\u8AAC\u660E
|
|
@@ -88338,15 +88409,14 @@ var googleSheetsOnboarding2 = new ConnectorOnboarding({
|
|
|
88338
88409
|
en: `Follow these steps to set up the Google Sheets connection.
|
|
88339
88410
|
|
|
88340
88411
|
1. Ask the user to paste the Google Sheets URL (e.g., https://docs.google.com/spreadsheets/d/xxxxx/edit)
|
|
88341
|
-
2. When the user provides a URL
|
|
88342
|
-
|
|
88343
|
-
- \`
|
|
88344
|
-
|
|
88345
|
-
4. Call \`${requestToolName}\` to fetch spreadsheet metadata:
|
|
88412
|
+
2. When the user provides a URL, call \`updateConnectionParameters\`:
|
|
88413
|
+
- \`parameterSlug\`: \`"spreadsheet-url"\`
|
|
88414
|
+
- \`value\`: The URL provided by the user (save as-is; the spreadsheet ID is extracted automatically)
|
|
88415
|
+
3. Call \`${requestToolName}\` to fetch spreadsheet metadata:
|
|
88346
88416
|
- \`method\`: \`"GET"\`
|
|
88347
88417
|
- \`path\`: \`"/{spreadsheetId}?fields=spreadsheetId,properties.title,sheets.properties.title"\`
|
|
88348
|
-
|
|
88349
|
-
|
|
88418
|
+
4. If an error is returned, ask the user to check the spreadsheet sharing settings
|
|
88419
|
+
5. Call \`updateConnectionContext\`:
|
|
88350
88420
|
- \`spreadsheet\`: The spreadsheet title
|
|
88351
88421
|
- \`sheets\`: Sheet names (comma-separated)
|
|
88352
88422
|
- \`note\`: Brief description of the setup
|
|
@@ -88483,10 +88553,12 @@ batch.valueRanges.forEach(vr => console.log(vr.range, vr.values));
|
|
|
88483
88553
|
tools: tools18,
|
|
88484
88554
|
async checkConnection(params, config) {
|
|
88485
88555
|
const { proxyFetch } = config;
|
|
88486
|
-
const
|
|
88487
|
-
if (!
|
|
88556
|
+
const spreadsheetUrl = params[parameters18.spreadsheetUrl.slug];
|
|
88557
|
+
if (!spreadsheetUrl) {
|
|
88488
88558
|
return { success: true };
|
|
88489
88559
|
}
|
|
88560
|
+
const { extractSpreadsheetId: extractSpreadsheetId2 } = await Promise.resolve().then(() => (init_utils2(), utils_exports));
|
|
88561
|
+
const spreadsheetId = extractSpreadsheetId2(spreadsheetUrl);
|
|
88490
88562
|
const url = `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}?fields=spreadsheetId,properties.title`;
|
|
88491
88563
|
try {
|
|
88492
88564
|
const res = await proxyFetch(url, { method: "GET" });
|
|
@@ -100723,6 +100795,254 @@ export default async function handler(c: Context) {
|
|
|
100723
100795
|
tools: tools58
|
|
100724
100796
|
});
|
|
100725
100797
|
|
|
100798
|
+
// ../connectors/src/connectors/grafana/setup.ts
|
|
100799
|
+
var grafanaOnboarding = new ConnectorOnboarding({
|
|
100800
|
+
dataOverviewInstructions: {
|
|
100801
|
+
en: `1. Call grafana_request with GET /api/datasources to list all configured datasources
|
|
100802
|
+
2. Call grafana_request with GET /api/search?type=dash-db&limit=10 to list dashboards
|
|
100803
|
+
3. For a specific datasource, call grafana_request with POST /api/ds/query to run a test query`,
|
|
100804
|
+
ja: `1. grafana_request \u3067 GET /api/datasources \u3092\u547C\u3073\u51FA\u3057\u3001\u8A2D\u5B9A\u6E08\u307F\u306E\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97
|
|
100805
|
+
2. grafana_request \u3067 GET /api/search?type=dash-db&limit=10 \u3092\u547C\u3073\u51FA\u3057\u3001\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97
|
|
100806
|
+
3. \u7279\u5B9A\u306E\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u306B\u5BFE\u3057\u3066 grafana_request \u3067 POST /api/ds/query \u3092\u547C\u3073\u51FA\u3057\u3001\u30C6\u30B9\u30C8\u30AF\u30A8\u30EA\u3092\u5B9F\u884C`
|
|
100807
|
+
}
|
|
100808
|
+
});
|
|
100809
|
+
|
|
100810
|
+
// ../connectors/src/connectors/grafana/parameters.ts
|
|
100811
|
+
var parameters59 = {
|
|
100812
|
+
url: new ParameterDefinition({
|
|
100813
|
+
slug: "url",
|
|
100814
|
+
name: "Grafana URL",
|
|
100815
|
+
description: "The base URL of the Grafana instance (e.g., https://your-org.grafana.net).",
|
|
100816
|
+
envVarBaseKey: "GRAFANA_URL",
|
|
100817
|
+
type: "text",
|
|
100818
|
+
secret: false,
|
|
100819
|
+
required: true
|
|
100820
|
+
}),
|
|
100821
|
+
apiKey: new ParameterDefinition({
|
|
100822
|
+
slug: "api-key",
|
|
100823
|
+
name: "Grafana API Key",
|
|
100824
|
+
description: "A Grafana API Key or Service Account Token. Create one in Grafana under Administration > Service Accounts.",
|
|
100825
|
+
envVarBaseKey: "GRAFANA_API_KEY",
|
|
100826
|
+
type: "text",
|
|
100827
|
+
secret: true,
|
|
100828
|
+
required: true
|
|
100829
|
+
})
|
|
100830
|
+
};
|
|
100831
|
+
|
|
100832
|
+
// ../connectors/src/connectors/grafana/tools/request.ts
|
|
100833
|
+
import { z as z76 } from "zod";
|
|
100834
|
+
var REQUEST_TIMEOUT_MS59 = 6e4;
|
|
100835
|
+
var inputSchema74 = z76.object({
|
|
100836
|
+
toolUseIntent: z76.string().optional().describe(
|
|
100837
|
+
"Brief description of what you intend to accomplish with this tool call"
|
|
100838
|
+
),
|
|
100839
|
+
connectionId: z76.string().describe("ID of the Grafana connection to use"),
|
|
100840
|
+
method: z76.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).describe(
|
|
100841
|
+
"HTTP method. GET for reading resources (datasources, dashboards, alerts). POST for queries and creating resources. PUT/PATCH for updates. DELETE for removal."
|
|
100842
|
+
),
|
|
100843
|
+
path: z76.string().describe(
|
|
100844
|
+
"API path relative to the Grafana base URL (e.g., '/api/datasources', '/api/search', '/api/ds/query'). Must start with '/'."
|
|
100845
|
+
),
|
|
100846
|
+
body: z76.record(z76.string(), z76.unknown()).optional().describe("Request body (JSON). Required for POST/PUT/PATCH requests.")
|
|
100847
|
+
});
|
|
100848
|
+
var outputSchema74 = z76.discriminatedUnion("success", [
|
|
100849
|
+
z76.object({
|
|
100850
|
+
success: z76.literal(true),
|
|
100851
|
+
status: z76.number(),
|
|
100852
|
+
data: z76.unknown()
|
|
100853
|
+
}),
|
|
100854
|
+
z76.object({
|
|
100855
|
+
success: z76.literal(false),
|
|
100856
|
+
error: z76.string()
|
|
100857
|
+
})
|
|
100858
|
+
]);
|
|
100859
|
+
var requestTool44 = new ConnectorTool({
|
|
100860
|
+
name: "request",
|
|
100861
|
+
description: `Send authenticated requests to the Grafana HTTP API.
|
|
100862
|
+
Authentication is handled automatically using the configured API Key or Service Account Token via Bearer token.
|
|
100863
|
+
Use this tool to interact with Grafana resources: datasources, dashboards, alerts, annotations, and to execute datasource queries via the unified query API (/api/ds/query).
|
|
100864
|
+
The path must start with '/' and is appended to the configured Grafana instance URL.`,
|
|
100865
|
+
inputSchema: inputSchema74,
|
|
100866
|
+
outputSchema: outputSchema74,
|
|
100867
|
+
async execute({ connectionId, method, path: path5, body }, connections) {
|
|
100868
|
+
const connection = connections.find((c6) => c6.id === connectionId);
|
|
100869
|
+
if (!connection) {
|
|
100870
|
+
return {
|
|
100871
|
+
success: false,
|
|
100872
|
+
error: `Connection ${connectionId} not found`
|
|
100873
|
+
};
|
|
100874
|
+
}
|
|
100875
|
+
console.log(
|
|
100876
|
+
`[connector-request] grafana/${connection.name}: ${method} ${path5}`
|
|
100877
|
+
);
|
|
100878
|
+
try {
|
|
100879
|
+
const baseUrl = parameters59.url.getValue(connection).replace(/\/+$/, "");
|
|
100880
|
+
const apiKey = parameters59.apiKey.getValue(connection);
|
|
100881
|
+
const url = `${baseUrl}${path5}`;
|
|
100882
|
+
const controller = new AbortController();
|
|
100883
|
+
const timeout = setTimeout(
|
|
100884
|
+
() => controller.abort(),
|
|
100885
|
+
REQUEST_TIMEOUT_MS59
|
|
100886
|
+
);
|
|
100887
|
+
try {
|
|
100888
|
+
const response = await fetch(url, {
|
|
100889
|
+
method,
|
|
100890
|
+
headers: {
|
|
100891
|
+
Authorization: `Bearer ${apiKey}`,
|
|
100892
|
+
"Content-Type": "application/json",
|
|
100893
|
+
Accept: "application/json"
|
|
100894
|
+
},
|
|
100895
|
+
body: body ? JSON.stringify(body) : void 0,
|
|
100896
|
+
signal: controller.signal
|
|
100897
|
+
});
|
|
100898
|
+
const data = await response.json();
|
|
100899
|
+
if (!response.ok) {
|
|
100900
|
+
const errorMessage = typeof data === "object" && data !== null && "message" in data ? String(data.message) : `HTTP ${response.status} ${response.statusText}`;
|
|
100901
|
+
return { success: false, error: errorMessage };
|
|
100902
|
+
}
|
|
100903
|
+
return { success: true, status: response.status, data };
|
|
100904
|
+
} finally {
|
|
100905
|
+
clearTimeout(timeout);
|
|
100906
|
+
}
|
|
100907
|
+
} catch (err) {
|
|
100908
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
100909
|
+
return { success: false, error: msg };
|
|
100910
|
+
}
|
|
100911
|
+
}
|
|
100912
|
+
});
|
|
100913
|
+
|
|
100914
|
+
// ../connectors/src/connectors/grafana/index.ts
|
|
100915
|
+
var tools59 = { request: requestTool44 };
|
|
100916
|
+
var grafanaConnector = new ConnectorPlugin({
|
|
100917
|
+
slug: "grafana",
|
|
100918
|
+
authType: AUTH_TYPES.API_KEY,
|
|
100919
|
+
name: "Grafana",
|
|
100920
|
+
description: "Connect to Grafana for monitoring dashboards, datasource queries, and alerting.",
|
|
100921
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/3nGaPhV94lXQsHcCtv4mXz/0559d42f83066e8ba79e78410806750c/grafana-icon.webp",
|
|
100922
|
+
parameters: parameters59,
|
|
100923
|
+
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
100924
|
+
onboarding: grafanaOnboarding,
|
|
100925
|
+
systemPrompt: {
|
|
100926
|
+
en: `### Tools
|
|
100927
|
+
|
|
100928
|
+
- \`grafana_request\`: The only way to call the Grafana HTTP API. Use it to list datasources, search dashboards, execute datasource queries, manage alerts, and read annotations. Authentication is handled automatically via Bearer token. The path must start with \`/\`.
|
|
100929
|
+
|
|
100930
|
+
### Business Logic
|
|
100931
|
+
|
|
100932
|
+
The business logic type for this connector is "typescript". Use the connector SDK in your handler. Do NOT read credentials from environment variables.
|
|
100933
|
+
|
|
100934
|
+
SDK methods (client created via \`connection(connectionId)\`):
|
|
100935
|
+
- \`client.request(path, init?)\` \u2014 low-level authenticated fetch
|
|
100936
|
+
- \`client.listDatasources()\` \u2014 list all datasources
|
|
100937
|
+
- \`client.getDatasource(uid)\` \u2014 get datasource by UID
|
|
100938
|
+
- \`client.queryDatasource({ queries, from?, to? })\` \u2014 execute queries via unified query API
|
|
100939
|
+
- \`client.searchDashboards({ query?, tag?, type?, limit? })\` \u2014 search dashboards
|
|
100940
|
+
- \`client.getDashboard(uid)\` \u2014 get dashboard by UID
|
|
100941
|
+
|
|
100942
|
+
\`\`\`ts
|
|
100943
|
+
import type { Context } from "hono";
|
|
100944
|
+
import { connection } from "@squadbase/vite-server/connectors/grafana";
|
|
100945
|
+
|
|
100946
|
+
const grafana = connection("<connectionId>");
|
|
100947
|
+
|
|
100948
|
+
export default async function handler(c: Context) {
|
|
100949
|
+
const datasources = await grafana.listDatasources();
|
|
100950
|
+
return c.json(
|
|
100951
|
+
datasources.map((ds) => ({
|
|
100952
|
+
uid: ds.uid,
|
|
100953
|
+
name: ds.name,
|
|
100954
|
+
type: ds.type,
|
|
100955
|
+
})),
|
|
100956
|
+
);
|
|
100957
|
+
}
|
|
100958
|
+
\`\`\`
|
|
100959
|
+
|
|
100960
|
+
### Grafana HTTP API Reference
|
|
100961
|
+
|
|
100962
|
+
#### Datasources
|
|
100963
|
+
- \`GET /api/datasources\` \u2014 List all datasources
|
|
100964
|
+
- \`GET /api/datasources/uid/{uid}\` \u2014 Get a datasource by UID
|
|
100965
|
+
|
|
100966
|
+
#### Unified Query API
|
|
100967
|
+
- \`POST /api/ds/query\` \u2014 Execute queries against datasources
|
|
100968
|
+
- Body: \`{ "queries": [{ "refId": "A", "datasource": { "type": "prometheus", "uid": "..." }, "expr": "up" }], "from": "now-1h", "to": "now" }\`
|
|
100969
|
+
|
|
100970
|
+
#### Dashboard Search
|
|
100971
|
+
- \`GET /api/search\` \u2014 Search dashboards and folders
|
|
100972
|
+
- Query params: \`?query=keyword&tag=tagname&type=dash-db&limit=10\`
|
|
100973
|
+
|
|
100974
|
+
#### Dashboards
|
|
100975
|
+
- \`GET /api/dashboards/uid/{uid}\` \u2014 Get dashboard by UID (includes panels and metadata)
|
|
100976
|
+
|
|
100977
|
+
#### Alerts
|
|
100978
|
+
- \`GET /api/v1/provisioning/alert-rules\` \u2014 List alert rules
|
|
100979
|
+
- \`GET /api/annotations\` \u2014 List annotations (filter with \`?from=timestamp&to=timestamp\`)
|
|
100980
|
+
|
|
100981
|
+
#### Organizations & Health
|
|
100982
|
+
- \`GET /api/org\` \u2014 Get current organization
|
|
100983
|
+
- \`GET /api/health\` \u2014 Health check`,
|
|
100984
|
+
ja: `### \u30C4\u30FC\u30EB
|
|
100985
|
+
|
|
100986
|
+
- \`grafana_request\`: Grafana HTTP API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u306E\u4E00\u89A7\u53D6\u5F97\u3001\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u691C\u7D22\u3001\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u30AF\u30A8\u30EA\u306E\u5B9F\u884C\u3001\u30A2\u30E9\u30FC\u30C8\u7BA1\u7406\u3001\u30A2\u30CE\u30C6\u30FC\u30B7\u30E7\u30F3\u306E\u8AAD\u307F\u53D6\u308A\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\u306FBearer\u30C8\u30FC\u30AF\u30F3\u3067\u81EA\u52D5\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\u30D1\u30B9\u306F \`/\` \u3067\u59CB\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
|
100987
|
+
|
|
100988
|
+
### Business Logic
|
|
100989
|
+
|
|
100990
|
+
\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
|
|
100991
|
+
|
|
100992
|
+
SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
|
|
100993
|
+
- \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304Dfetch
|
|
100994
|
+
- \`client.listDatasources()\` \u2014 \u5168\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u306E\u4E00\u89A7\u53D6\u5F97
|
|
100995
|
+
- \`client.getDatasource(uid)\` \u2014 UID\u3067\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u3092\u53D6\u5F97
|
|
100996
|
+
- \`client.queryDatasource({ queries, from?, to? })\` \u2014 \u7D71\u5408\u30AF\u30A8\u30EAAPI\u3067\u30AF\u30A8\u30EA\u5B9F\u884C
|
|
100997
|
+
- \`client.searchDashboards({ query?, tag?, type?, limit? })\` \u2014 \u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u691C\u7D22
|
|
100998
|
+
- \`client.getDashboard(uid)\` \u2014 UID\u3067\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u3092\u53D6\u5F97
|
|
100999
|
+
|
|
101000
|
+
\`\`\`ts
|
|
101001
|
+
import type { Context } from "hono";
|
|
101002
|
+
import { connection } from "@squadbase/vite-server/connectors/grafana";
|
|
101003
|
+
|
|
101004
|
+
const grafana = connection("<connectionId>");
|
|
101005
|
+
|
|
101006
|
+
export default async function handler(c: Context) {
|
|
101007
|
+
const datasources = await grafana.listDatasources();
|
|
101008
|
+
return c.json(
|
|
101009
|
+
datasources.map((ds) => ({
|
|
101010
|
+
uid: ds.uid,
|
|
101011
|
+
name: ds.name,
|
|
101012
|
+
type: ds.type,
|
|
101013
|
+
})),
|
|
101014
|
+
);
|
|
101015
|
+
}
|
|
101016
|
+
\`\`\`
|
|
101017
|
+
|
|
101018
|
+
### Grafana HTTP API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
101019
|
+
|
|
101020
|
+
#### \u30C7\u30FC\u30BF\u30BD\u30FC\u30B9
|
|
101021
|
+
- \`GET /api/datasources\` \u2014 \u5168\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u306E\u4E00\u89A7\u53D6\u5F97
|
|
101022
|
+
- \`GET /api/datasources/uid/{uid}\` \u2014 UID\u3067\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u3092\u53D6\u5F97
|
|
101023
|
+
|
|
101024
|
+
#### \u7D71\u5408\u30AF\u30A8\u30EAAPI
|
|
101025
|
+
- \`POST /api/ds/query\` \u2014 \u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u306B\u5BFE\u3057\u3066\u30AF\u30A8\u30EA\u3092\u5B9F\u884C
|
|
101026
|
+
- Body: \`{ "queries": [{ "refId": "A", "datasource": { "type": "prometheus", "uid": "..." }, "expr": "up" }], "from": "now-1h", "to": "now" }\`
|
|
101027
|
+
|
|
101028
|
+
#### \u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u691C\u7D22
|
|
101029
|
+
- \`GET /api/search\` \u2014 \u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u3068\u30D5\u30A9\u30EB\u30C0\u3092\u691C\u7D22
|
|
101030
|
+
- \u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF: \`?query=keyword&tag=tagname&type=dash-db&limit=10\`
|
|
101031
|
+
|
|
101032
|
+
#### \u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9
|
|
101033
|
+
- \`GET /api/dashboards/uid/{uid}\` \u2014 UID\u3067\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u3092\u53D6\u5F97\uFF08\u30D1\u30CD\u30EB\u3068\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u542B\u3080\uFF09
|
|
101034
|
+
|
|
101035
|
+
#### \u30A2\u30E9\u30FC\u30C8
|
|
101036
|
+
- \`GET /api/v1/provisioning/alert-rules\` \u2014 \u30A2\u30E9\u30FC\u30C8\u30EB\u30FC\u30EB\u4E00\u89A7
|
|
101037
|
+
- \`GET /api/annotations\` \u2014 \u30A2\u30CE\u30C6\u30FC\u30B7\u30E7\u30F3\u4E00\u89A7\uFF08\`?from=timestamp&to=timestamp\` \u3067\u30D5\u30A3\u30EB\u30BF\uFF09
|
|
101038
|
+
|
|
101039
|
+
#### \u7D44\u7E54 & \u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF
|
|
101040
|
+
- \`GET /api/org\` \u2014 \u73FE\u5728\u306E\u7D44\u7E54\u3092\u53D6\u5F97
|
|
101041
|
+
- \`GET /api/health\` \u2014 \u30D8\u30EB\u30B9\u30C1\u30A7\u30C3\u30AF`
|
|
101042
|
+
},
|
|
101043
|
+
tools: tools59
|
|
101044
|
+
});
|
|
101045
|
+
|
|
100726
101046
|
// ../connectors/src/connectors/registry.ts
|
|
100727
101047
|
var plugins = {
|
|
100728
101048
|
snowflake: snowflakeConnector,
|
|
@@ -100782,7 +101102,8 @@ var plugins = {
|
|
|
100782
101102
|
zendeskOauth: zendeskOauthConnector,
|
|
100783
101103
|
intercom: intercomConnector,
|
|
100784
101104
|
intercomOauth: intercomOauthConnector,
|
|
100785
|
-
mixpanel: mixpanelConnector
|
|
101105
|
+
mixpanel: mixpanelConnector,
|
|
101106
|
+
grafana: grafanaConnector
|
|
100786
101107
|
};
|
|
100787
101108
|
var connectors = {
|
|
100788
101109
|
...plugins,
|
|
@@ -100999,62 +101320,62 @@ import { watch as fsWatch2 } from "fs";
|
|
|
100999
101320
|
import path2 from "path";
|
|
101000
101321
|
|
|
101001
101322
|
// src/types/server-logic.ts
|
|
101002
|
-
import { z as
|
|
101003
|
-
var parameterMetaSchema =
|
|
101004
|
-
name:
|
|
101005
|
-
type:
|
|
101006
|
-
description:
|
|
101007
|
-
required:
|
|
101008
|
-
default:
|
|
101009
|
-
});
|
|
101010
|
-
var serverLogicCacheConfigSchema =
|
|
101011
|
-
ttl:
|
|
101012
|
-
staleWhileRevalidate:
|
|
101013
|
-
});
|
|
101014
|
-
var serverLogicSchemaObjectSchema =
|
|
101015
|
-
() =>
|
|
101016
|
-
type:
|
|
101017
|
-
format:
|
|
101018
|
-
description:
|
|
101019
|
-
nullable:
|
|
101020
|
-
enum:
|
|
101323
|
+
import { z as z77 } from "zod";
|
|
101324
|
+
var parameterMetaSchema = z77.object({
|
|
101325
|
+
name: z77.string(),
|
|
101326
|
+
type: z77.enum(["string", "number", "boolean"]),
|
|
101327
|
+
description: z77.string(),
|
|
101328
|
+
required: z77.boolean().optional(),
|
|
101329
|
+
default: z77.union([z77.string(), z77.number(), z77.boolean()]).optional()
|
|
101330
|
+
});
|
|
101331
|
+
var serverLogicCacheConfigSchema = z77.object({
|
|
101332
|
+
ttl: z77.number(),
|
|
101333
|
+
staleWhileRevalidate: z77.boolean().optional()
|
|
101334
|
+
});
|
|
101335
|
+
var serverLogicSchemaObjectSchema = z77.lazy(
|
|
101336
|
+
() => z77.object({
|
|
101337
|
+
type: z77.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
|
|
101338
|
+
format: z77.string().optional(),
|
|
101339
|
+
description: z77.string().optional(),
|
|
101340
|
+
nullable: z77.boolean().optional(),
|
|
101341
|
+
enum: z77.array(z77.union([z77.string(), z77.number(), z77.boolean(), z77.null()])).optional(),
|
|
101021
101342
|
items: serverLogicSchemaObjectSchema.optional(),
|
|
101022
|
-
properties:
|
|
101023
|
-
required:
|
|
101024
|
-
additionalProperties:
|
|
101025
|
-
minimum:
|
|
101026
|
-
maximum:
|
|
101027
|
-
minLength:
|
|
101028
|
-
maxLength:
|
|
101029
|
-
pattern:
|
|
101343
|
+
properties: z77.record(z77.string(), serverLogicSchemaObjectSchema).optional(),
|
|
101344
|
+
required: z77.array(z77.string()).optional(),
|
|
101345
|
+
additionalProperties: z77.union([z77.boolean(), serverLogicSchemaObjectSchema]).optional(),
|
|
101346
|
+
minimum: z77.number().optional(),
|
|
101347
|
+
maximum: z77.number().optional(),
|
|
101348
|
+
minLength: z77.number().optional(),
|
|
101349
|
+
maxLength: z77.number().optional(),
|
|
101350
|
+
pattern: z77.string().optional()
|
|
101030
101351
|
})
|
|
101031
101352
|
);
|
|
101032
|
-
var serverLogicMediaTypeSchema =
|
|
101353
|
+
var serverLogicMediaTypeSchema = z77.object({
|
|
101033
101354
|
schema: serverLogicSchemaObjectSchema.optional(),
|
|
101034
|
-
example:
|
|
101355
|
+
example: z77.unknown().optional()
|
|
101035
101356
|
});
|
|
101036
|
-
var serverLogicResponseSchema =
|
|
101037
|
-
description:
|
|
101038
|
-
content:
|
|
101357
|
+
var serverLogicResponseSchema = z77.object({
|
|
101358
|
+
description: z77.string().optional(),
|
|
101359
|
+
content: z77.record(z77.string(), serverLogicMediaTypeSchema).optional()
|
|
101039
101360
|
});
|
|
101040
101361
|
var jsonBaseFields = {
|
|
101041
|
-
description:
|
|
101042
|
-
parameters:
|
|
101362
|
+
description: z77.string(),
|
|
101363
|
+
parameters: z77.array(parameterMetaSchema).optional(),
|
|
101043
101364
|
response: serverLogicResponseSchema.optional(),
|
|
101044
101365
|
cache: serverLogicCacheConfigSchema.optional()
|
|
101045
101366
|
};
|
|
101046
|
-
var jsonSqlServerLogicSchema =
|
|
101367
|
+
var jsonSqlServerLogicSchema = z77.object({
|
|
101047
101368
|
...jsonBaseFields,
|
|
101048
|
-
type:
|
|
101049
|
-
query:
|
|
101050
|
-
connectionId:
|
|
101369
|
+
type: z77.literal("sql").optional(),
|
|
101370
|
+
query: z77.string(),
|
|
101371
|
+
connectionId: z77.string()
|
|
101051
101372
|
});
|
|
101052
|
-
var jsonTypeScriptServerLogicSchema =
|
|
101373
|
+
var jsonTypeScriptServerLogicSchema = z77.object({
|
|
101053
101374
|
...jsonBaseFields,
|
|
101054
|
-
type:
|
|
101055
|
-
handlerPath:
|
|
101375
|
+
type: z77.literal("typescript"),
|
|
101376
|
+
handlerPath: z77.string()
|
|
101056
101377
|
});
|
|
101057
|
-
var anyJsonServerLogicSchema =
|
|
101378
|
+
var anyJsonServerLogicSchema = z77.union([
|
|
101058
101379
|
jsonTypeScriptServerLogicSchema,
|
|
101059
101380
|
jsonSqlServerLogicSchema
|
|
101060
101381
|
]);
|