cribl-control-plane 0.0.2 → 0.0.4
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/FUNCTIONS.md +6 -3
- package/README.md +22 -5
- package/bin/mcp-server.js +194 -38
- package/bin/mcp-server.js.map +14 -9
- package/dist/commonjs/__tests__/auth.test.d.ts +2 -0
- package/dist/commonjs/__tests__/auth.test.d.ts.map +1 -0
- package/dist/commonjs/__tests__/auth.test.js +24 -0
- package/dist/commonjs/__tests__/auth.test.js.map +1 -0
- package/dist/commonjs/funcs/authLogin.d.ts +17 -0
- package/dist/commonjs/funcs/authLogin.d.ts.map +1 -0
- package/dist/commonjs/funcs/authLogin.js +109 -0
- package/dist/commonjs/funcs/authLogin.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/authLogin.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/authLogin.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/authLogin.js +64 -0
- package/dist/commonjs/mcp-server/tools/authLogin.js.map +1 -0
- package/dist/commonjs/models/authtoken.d.ts +29 -0
- package/dist/commonjs/models/authtoken.d.ts.map +1 -0
- package/dist/commonjs/models/authtoken.js +69 -0
- package/dist/commonjs/models/authtoken.js.map +1 -0
- package/dist/commonjs/models/healthstatus.d.ts +11 -25
- package/dist/commonjs/models/healthstatus.d.ts.map +1 -1
- package/dist/commonjs/models/healthstatus.js +19 -4
- package/dist/commonjs/models/healthstatus.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +2 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/logininfo.d.ts +31 -0
- package/dist/commonjs/models/logininfo.d.ts.map +1 -0
- package/dist/commonjs/models/logininfo.js +71 -0
- package/dist/commonjs/models/logininfo.js.map +1 -0
- package/dist/commonjs/sdk/auth.d.ts +12 -0
- package/dist/commonjs/sdk/auth.d.ts.map +1 -0
- package/dist/commonjs/sdk/auth.js +22 -0
- package/dist/commonjs/sdk/auth.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/__tests__/auth.test.d.ts +2 -0
- package/dist/esm/__tests__/auth.test.d.ts.map +1 -0
- package/dist/esm/__tests__/auth.test.js +22 -0
- package/dist/esm/__tests__/auth.test.js.map +1 -0
- package/dist/esm/funcs/authLogin.d.ts +17 -0
- package/dist/esm/funcs/authLogin.d.ts.map +1 -0
- package/dist/esm/funcs/authLogin.js +73 -0
- package/dist/esm/funcs/authLogin.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/authLogin.d.ts +8 -0
- package/dist/esm/mcp-server/tools/authLogin.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/authLogin.js +28 -0
- package/dist/esm/mcp-server/tools/authLogin.js.map +1 -0
- package/dist/esm/models/authtoken.d.ts +29 -0
- package/dist/esm/models/authtoken.d.ts.map +1 -0
- package/dist/esm/models/authtoken.js +31 -0
- package/dist/esm/models/authtoken.js.map +1 -0
- package/dist/esm/models/healthstatus.d.ts +11 -25
- package/dist/esm/models/healthstatus.d.ts.map +1 -1
- package/dist/esm/models/healthstatus.js +19 -4
- package/dist/esm/models/healthstatus.js.map +1 -1
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/logininfo.d.ts +31 -0
- package/dist/esm/models/logininfo.d.ts.map +1 -0
- package/dist/esm/models/logininfo.js +33 -0
- package/dist/esm/models/logininfo.js.map +1 -0
- package/dist/esm/sdk/auth.d.ts +12 -0
- package/dist/esm/sdk/auth.d.ts.map +1 -0
- package/dist/esm/sdk/auth.js +18 -0
- package/dist/esm/sdk/auth.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/auth/README.md +84 -0
- package/examples/{diagGetHealthInfo.example.ts → authLogin.example.ts} +5 -2
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/auth.test.ts +25 -0
- package/src/funcs/authLogin.ts +154 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/authLogin.ts +37 -0
- package/src/models/authtoken.ts +62 -0
- package/src/models/healthstatus.ts +28 -12
- package/src/models/index.ts +2 -0
- package/src/models/logininfo.ts +66 -0
- package/src/sdk/auth.ts +27 -0
- package/src/sdk/sdk.ts +6 -0
package/FUNCTIONS.md
CHANGED
|
@@ -20,7 +20,7 @@ specific category of applications.
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
import { CriblControlPlaneCore } from "cribl-control-plane/core.js";
|
|
23
|
-
import {
|
|
23
|
+
import { authLogin } from "cribl-control-plane/funcs/authLogin.js";
|
|
24
24
|
|
|
25
25
|
// Use `CriblControlPlaneCore` for best tree-shaking performance.
|
|
26
26
|
// You can create one instance of it to use across an application.
|
|
@@ -29,12 +29,15 @@ const criblControlPlane = new CriblControlPlaneCore({
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
async function run() {
|
|
32
|
-
const res = await
|
|
32
|
+
const res = await authLogin(criblControlPlane, {
|
|
33
|
+
username: "Nikko.Connelly",
|
|
34
|
+
password: "Ljp4BunfMR9hNyM",
|
|
35
|
+
});
|
|
33
36
|
if (res.ok) {
|
|
34
37
|
const { value: result } = res;
|
|
35
38
|
console.log(result);
|
|
36
39
|
} else {
|
|
37
|
-
console.log("
|
|
40
|
+
console.log("authLogin failed:", res.error);
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
|
package/README.md
CHANGED
|
@@ -169,7 +169,10 @@ const criblControlPlane = new CriblControlPlane({
|
|
|
169
169
|
});
|
|
170
170
|
|
|
171
171
|
async function run() {
|
|
172
|
-
const result = await criblControlPlane.
|
|
172
|
+
const result = await criblControlPlane.auth.login({
|
|
173
|
+
username: "Nikko.Connelly",
|
|
174
|
+
password: "Ljp4BunfMR9hNyM",
|
|
175
|
+
});
|
|
173
176
|
|
|
174
177
|
console.log(result);
|
|
175
178
|
}
|
|
@@ -203,7 +206,10 @@ const criblControlPlane = new CriblControlPlane({
|
|
|
203
206
|
});
|
|
204
207
|
|
|
205
208
|
async function run() {
|
|
206
|
-
const result = await criblControlPlane.
|
|
209
|
+
const result = await criblControlPlane.auth.login({
|
|
210
|
+
username: "Nikko.Connelly",
|
|
211
|
+
password: "Ljp4BunfMR9hNyM",
|
|
212
|
+
});
|
|
207
213
|
|
|
208
214
|
console.log(result);
|
|
209
215
|
}
|
|
@@ -219,6 +225,10 @@ run();
|
|
|
219
225
|
<details open>
|
|
220
226
|
<summary>Available methods</summary>
|
|
221
227
|
|
|
228
|
+
### [auth](docs/sdks/auth/README.md)
|
|
229
|
+
|
|
230
|
+
* [login](docs/sdks/auth/README.md#login) - Log in and obtain Auth token
|
|
231
|
+
|
|
222
232
|
|
|
223
233
|
### [diag](docs/sdks/diag/README.md)
|
|
224
234
|
|
|
@@ -246,6 +256,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
246
256
|
|
|
247
257
|
<summary>Available standalone functions</summary>
|
|
248
258
|
|
|
259
|
+
- [`authLogin`](docs/sdks/auth/README.md#login) - Log in and obtain Auth token
|
|
249
260
|
- [`diagGetHealthInfo`](docs/sdks/diag/README.md#gethealthinfo) - Provides health info for REST server
|
|
250
261
|
- [`diagGetHealthInfo`](docs/sdks/health/README.md#gethealthinfo) - Provides health info for REST server
|
|
251
262
|
|
|
@@ -266,7 +277,10 @@ const criblControlPlane = new CriblControlPlane({
|
|
|
266
277
|
});
|
|
267
278
|
|
|
268
279
|
async function run() {
|
|
269
|
-
const result = await criblControlPlane.
|
|
280
|
+
const result = await criblControlPlane.auth.login({
|
|
281
|
+
username: "Nikko.Connelly",
|
|
282
|
+
password: "Ljp4BunfMR9hNyM",
|
|
283
|
+
}, {
|
|
270
284
|
retries: {
|
|
271
285
|
strategy: "backoff",
|
|
272
286
|
backoff: {
|
|
@@ -305,7 +319,10 @@ const criblControlPlane = new CriblControlPlane({
|
|
|
305
319
|
});
|
|
306
320
|
|
|
307
321
|
async function run() {
|
|
308
|
-
const result = await criblControlPlane.
|
|
322
|
+
const result = await criblControlPlane.auth.login({
|
|
323
|
+
username: "Nikko.Connelly",
|
|
324
|
+
password: "Ljp4BunfMR9hNyM",
|
|
325
|
+
});
|
|
309
326
|
|
|
310
327
|
console.log(result);
|
|
311
328
|
}
|
|
@@ -382,7 +399,7 @@ run();
|
|
|
382
399
|
|
|
383
400
|
|
|
384
401
|
**Inherit from [`CriblControlPlaneError`](./src/models/errors/criblcontrolplaneerror.ts)**:
|
|
385
|
-
* [`HealthStatusError`](./src/models/errors/healthstatuserror.ts): Healthy status. Status code `420`. Applicable to 1 of
|
|
402
|
+
* [`HealthStatusError`](./src/models/errors/healthstatuserror.ts): Healthy status. Status code `420`. Applicable to 1 of 3 methods.*
|
|
386
403
|
* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
387
404
|
|
|
388
405
|
</details>
|
package/bin/mcp-server.js
CHANGED
|
@@ -34406,11 +34406,39 @@ function parse(rawValue, fn, errorMessage) {
|
|
|
34406
34406
|
throw err;
|
|
34407
34407
|
}
|
|
34408
34408
|
}
|
|
34409
|
+
function safeParse(rawValue, fn, errorMessage) {
|
|
34410
|
+
try {
|
|
34411
|
+
return OK2(fn(rawValue));
|
|
34412
|
+
} catch (err) {
|
|
34413
|
+
return ERR(new SDKValidationError(errorMessage, err, rawValue));
|
|
34414
|
+
}
|
|
34415
|
+
}
|
|
34409
34416
|
var init_schemas = __esm(() => {
|
|
34410
34417
|
init_esm();
|
|
34411
34418
|
init_sdkvalidationerror();
|
|
34412
34419
|
});
|
|
34413
34420
|
|
|
34421
|
+
// src/models/authtoken.ts
|
|
34422
|
+
var AuthToken$inboundSchema, AuthToken$outboundSchema, AuthToken$;
|
|
34423
|
+
var init_authtoken = __esm(() => {
|
|
34424
|
+
init_esm();
|
|
34425
|
+
AuthToken$inboundSchema = objectType({
|
|
34426
|
+
token: stringType()
|
|
34427
|
+
});
|
|
34428
|
+
AuthToken$outboundSchema = objectType({
|
|
34429
|
+
token: stringType()
|
|
34430
|
+
});
|
|
34431
|
+
((AuthToken$) => {
|
|
34432
|
+
AuthToken$.inboundSchema = AuthToken$inboundSchema;
|
|
34433
|
+
AuthToken$.outboundSchema = AuthToken$outboundSchema;
|
|
34434
|
+
})(AuthToken$ ||= {});
|
|
34435
|
+
});
|
|
34436
|
+
|
|
34437
|
+
// src/types/enums.ts
|
|
34438
|
+
function catchUnrecognizedEnum(value) {
|
|
34439
|
+
return value;
|
|
34440
|
+
}
|
|
34441
|
+
|
|
34414
34442
|
// src/models/healthstatus.ts
|
|
34415
34443
|
var Role, Status, Role$inboundSchema, Role$outboundSchema, Role$, Status$inboundSchema, Status$outboundSchema, Status$, HealthStatus$inboundSchema, HealthStatus$outboundSchema, HealthStatus$;
|
|
34416
34444
|
var init_healthstatus = __esm(() => {
|
|
@@ -34424,14 +34452,26 @@ var init_healthstatus = __esm(() => {
|
|
|
34424
34452
|
ShuttingDown: "shutting down",
|
|
34425
34453
|
Standby: "standby"
|
|
34426
34454
|
};
|
|
34427
|
-
Role$inboundSchema =
|
|
34428
|
-
|
|
34455
|
+
Role$inboundSchema = unionType([
|
|
34456
|
+
nativeEnumType(Role),
|
|
34457
|
+
stringType().transform(catchUnrecognizedEnum)
|
|
34458
|
+
]);
|
|
34459
|
+
Role$outboundSchema = unionType([
|
|
34460
|
+
nativeEnumType(Role),
|
|
34461
|
+
stringType().and(custom())
|
|
34462
|
+
]);
|
|
34429
34463
|
((Role$) => {
|
|
34430
34464
|
Role$.inboundSchema = Role$inboundSchema;
|
|
34431
34465
|
Role$.outboundSchema = Role$outboundSchema;
|
|
34432
34466
|
})(Role$ ||= {});
|
|
34433
|
-
Status$inboundSchema =
|
|
34434
|
-
|
|
34467
|
+
Status$inboundSchema = unionType([
|
|
34468
|
+
nativeEnumType(Status),
|
|
34469
|
+
stringType().transform(catchUnrecognizedEnum)
|
|
34470
|
+
]);
|
|
34471
|
+
Status$outboundSchema = unionType([
|
|
34472
|
+
nativeEnumType(Status),
|
|
34473
|
+
stringType().and(custom())
|
|
34474
|
+
]);
|
|
34435
34475
|
((Status$) => {
|
|
34436
34476
|
Status$.inboundSchema = Status$inboundSchema;
|
|
34437
34477
|
Status$.outboundSchema = Status$outboundSchema;
|
|
@@ -34452,6 +34492,24 @@ var init_healthstatus = __esm(() => {
|
|
|
34452
34492
|
})(HealthStatus$ ||= {});
|
|
34453
34493
|
});
|
|
34454
34494
|
|
|
34495
|
+
// src/models/logininfo.ts
|
|
34496
|
+
var LoginInfo$inboundSchema, LoginInfo$outboundSchema, LoginInfo$;
|
|
34497
|
+
var init_logininfo = __esm(() => {
|
|
34498
|
+
init_esm();
|
|
34499
|
+
LoginInfo$inboundSchema = objectType({
|
|
34500
|
+
username: stringType(),
|
|
34501
|
+
password: stringType()
|
|
34502
|
+
});
|
|
34503
|
+
LoginInfo$outboundSchema = objectType({
|
|
34504
|
+
username: stringType(),
|
|
34505
|
+
password: stringType()
|
|
34506
|
+
});
|
|
34507
|
+
((LoginInfo$) => {
|
|
34508
|
+
LoginInfo$.inboundSchema = LoginInfo$inboundSchema;
|
|
34509
|
+
LoginInfo$.outboundSchema = LoginInfo$outboundSchema;
|
|
34510
|
+
})(LoginInfo$ ||= {});
|
|
34511
|
+
});
|
|
34512
|
+
|
|
34455
34513
|
// src/models/schemeclientoauth.ts
|
|
34456
34514
|
var SchemeClientOauth$inboundSchema, SchemeClientOauth$outboundSchema, SchemeClientOauth$;
|
|
34457
34515
|
var init_schemeclientoauth = __esm(() => {
|
|
@@ -34493,7 +34551,9 @@ var init_security = __esm(() => {
|
|
|
34493
34551
|
|
|
34494
34552
|
// src/models/index.ts
|
|
34495
34553
|
var init_models = __esm(() => {
|
|
34554
|
+
init_authtoken();
|
|
34496
34555
|
init_healthstatus();
|
|
34556
|
+
init_logininfo();
|
|
34497
34557
|
init_schemeclientoauth();
|
|
34498
34558
|
init_security();
|
|
34499
34559
|
});
|
|
@@ -34793,10 +34853,10 @@ var init_config = __esm(() => {
|
|
|
34793
34853
|
];
|
|
34794
34854
|
SDK_METADATA = {
|
|
34795
34855
|
language: "typescript",
|
|
34796
|
-
openapiDocVersion: "4.
|
|
34797
|
-
sdkVersion: "0.0.
|
|
34856
|
+
openapiDocVersion: "4.14.0-alpha.1752602215751-e622ff04",
|
|
34857
|
+
sdkVersion: "0.0.4",
|
|
34798
34858
|
genVersion: "2.656.5",
|
|
34799
|
-
userAgent: "speakeasy-sdk/typescript 0.0.
|
|
34859
|
+
userAgent: "speakeasy-sdk/typescript 0.0.4 2.656.5 4.14.0-alpha.1752602215751-e622ff04 cribl-control-plane"
|
|
34800
34860
|
};
|
|
34801
34861
|
});
|
|
34802
34862
|
|
|
@@ -35795,6 +35855,126 @@ function compactMap(values) {
|
|
|
35795
35855
|
}
|
|
35796
35856
|
var init_primitives = () => {};
|
|
35797
35857
|
|
|
35858
|
+
// src/types/async.ts
|
|
35859
|
+
var APIPromise;
|
|
35860
|
+
var init_async = __esm(() => {
|
|
35861
|
+
APIPromise = class APIPromise {
|
|
35862
|
+
#promise;
|
|
35863
|
+
#unwrapped;
|
|
35864
|
+
[Symbol.toStringTag] = "APIPromise";
|
|
35865
|
+
constructor(p) {
|
|
35866
|
+
this.#promise = p instanceof Promise ? p : Promise.resolve(p);
|
|
35867
|
+
this.#unwrapped = p instanceof Promise ? this.#promise.then(([value]) => value) : Promise.resolve(p[0]);
|
|
35868
|
+
}
|
|
35869
|
+
then(onfulfilled, onrejected) {
|
|
35870
|
+
return this.#promise.then(onfulfilled ? ([value]) => onfulfilled(value) : undefined, onrejected);
|
|
35871
|
+
}
|
|
35872
|
+
catch(onrejected) {
|
|
35873
|
+
return this.#unwrapped.catch(onrejected);
|
|
35874
|
+
}
|
|
35875
|
+
finally(onfinally) {
|
|
35876
|
+
return this.#unwrapped.finally(onfinally);
|
|
35877
|
+
}
|
|
35878
|
+
$inspect() {
|
|
35879
|
+
return this.#promise;
|
|
35880
|
+
}
|
|
35881
|
+
};
|
|
35882
|
+
});
|
|
35883
|
+
|
|
35884
|
+
// src/funcs/authLogin.ts
|
|
35885
|
+
function authLogin(client, request, options) {
|
|
35886
|
+
return new APIPromise($do(client, request, options));
|
|
35887
|
+
}
|
|
35888
|
+
async function $do(client, request, options) {
|
|
35889
|
+
const parsed = safeParse(request, (value) => LoginInfo$outboundSchema.parse(value), "Input validation failed");
|
|
35890
|
+
if (!parsed.ok) {
|
|
35891
|
+
return [parsed, { status: "invalid" }];
|
|
35892
|
+
}
|
|
35893
|
+
const payload = parsed.value;
|
|
35894
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
35895
|
+
const path = pathToFunc("/auth/login")();
|
|
35896
|
+
const headers = new Headers(compactMap({
|
|
35897
|
+
"Content-Type": "application/json",
|
|
35898
|
+
Accept: "application/json"
|
|
35899
|
+
}));
|
|
35900
|
+
const context = {
|
|
35901
|
+
options: client._options,
|
|
35902
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
35903
|
+
operationID: "login",
|
|
35904
|
+
oAuth2Scopes: [],
|
|
35905
|
+
resolvedSecurity: null,
|
|
35906
|
+
securitySource: null,
|
|
35907
|
+
retryConfig: options?.retries || client._options.retryConfig || { strategy: "none" },
|
|
35908
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"]
|
|
35909
|
+
};
|
|
35910
|
+
const requestRes = client._createRequest(context, {
|
|
35911
|
+
method: "POST",
|
|
35912
|
+
baseURL: options?.serverURL,
|
|
35913
|
+
path,
|
|
35914
|
+
headers,
|
|
35915
|
+
body,
|
|
35916
|
+
userAgent: client._options.userAgent,
|
|
35917
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
35918
|
+
}, options);
|
|
35919
|
+
if (!requestRes.ok) {
|
|
35920
|
+
return [requestRes, { status: "invalid" }];
|
|
35921
|
+
}
|
|
35922
|
+
const req = requestRes.value;
|
|
35923
|
+
const doResult = await client._do(req, {
|
|
35924
|
+
context,
|
|
35925
|
+
errorCodes: ["401", "403", "429", "4XX", "5XX"],
|
|
35926
|
+
retryConfig: context.retryConfig,
|
|
35927
|
+
retryCodes: context.retryCodes
|
|
35928
|
+
});
|
|
35929
|
+
if (!doResult.ok) {
|
|
35930
|
+
return [doResult, { status: "request-error", request: req }];
|
|
35931
|
+
}
|
|
35932
|
+
const response = doResult.value;
|
|
35933
|
+
const [result] = await match(json(200, AuthToken$inboundSchema), fail([401, 403, 429, "4XX"]), fail("5XX"))(response, req);
|
|
35934
|
+
if (!result.ok) {
|
|
35935
|
+
return [result, { status: "complete", request: req, response }];
|
|
35936
|
+
}
|
|
35937
|
+
return [result, { status: "complete", request: req, response }];
|
|
35938
|
+
}
|
|
35939
|
+
var init_authLogin = __esm(() => {
|
|
35940
|
+
init_encodings();
|
|
35941
|
+
init_matchers();
|
|
35942
|
+
init_primitives();
|
|
35943
|
+
init_schemas();
|
|
35944
|
+
init_url();
|
|
35945
|
+
init_models();
|
|
35946
|
+
init_async();
|
|
35947
|
+
});
|
|
35948
|
+
|
|
35949
|
+
// src/mcp-server/tools/authLogin.ts
|
|
35950
|
+
var args, tool$authLogin;
|
|
35951
|
+
var init_authLogin2 = __esm(() => {
|
|
35952
|
+
init_authLogin();
|
|
35953
|
+
init_models();
|
|
35954
|
+
init_tools();
|
|
35955
|
+
args = {
|
|
35956
|
+
request: LoginInfo$inboundSchema
|
|
35957
|
+
};
|
|
35958
|
+
tool$authLogin = {
|
|
35959
|
+
name: "auth-login",
|
|
35960
|
+
description: `Log in and obtain Auth token
|
|
35961
|
+
|
|
35962
|
+
This endpoint is unavailable on Cribl.Cloud. Instead, follow the instructions at https://docs.cribl.io/stream/api-tutorials/#criblcloud to get an Auth token for Cribl.Cloud.`,
|
|
35963
|
+
args,
|
|
35964
|
+
tool: async (client, args2, ctx) => {
|
|
35965
|
+
const [result, apiCall] = await authLogin(client, args2.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
35966
|
+
if (!result.ok) {
|
|
35967
|
+
return {
|
|
35968
|
+
content: [{ type: "text", text: result.error.message }],
|
|
35969
|
+
isError: true
|
|
35970
|
+
};
|
|
35971
|
+
}
|
|
35972
|
+
const value = result.value;
|
|
35973
|
+
return formatResult(value, apiCall);
|
|
35974
|
+
}
|
|
35975
|
+
};
|
|
35976
|
+
});
|
|
35977
|
+
|
|
35798
35978
|
// src/models/errors/healthstatuserror.ts
|
|
35799
35979
|
var HealthStatusError, HealthStatusError$inboundSchema, HealthStatusError$outboundSchema, HealthStatusError$;
|
|
35800
35980
|
var init_healthstatuserror = __esm(() => {
|
|
@@ -35851,37 +36031,11 @@ var init_errors2 = __esm(() => {
|
|
|
35851
36031
|
init_sdkvalidationerror();
|
|
35852
36032
|
});
|
|
35853
36033
|
|
|
35854
|
-
// src/types/async.ts
|
|
35855
|
-
var APIPromise;
|
|
35856
|
-
var init_async = __esm(() => {
|
|
35857
|
-
APIPromise = class APIPromise {
|
|
35858
|
-
#promise;
|
|
35859
|
-
#unwrapped;
|
|
35860
|
-
[Symbol.toStringTag] = "APIPromise";
|
|
35861
|
-
constructor(p) {
|
|
35862
|
-
this.#promise = p instanceof Promise ? p : Promise.resolve(p);
|
|
35863
|
-
this.#unwrapped = p instanceof Promise ? this.#promise.then(([value]) => value) : Promise.resolve(p[0]);
|
|
35864
|
-
}
|
|
35865
|
-
then(onfulfilled, onrejected) {
|
|
35866
|
-
return this.#promise.then(onfulfilled ? ([value]) => onfulfilled(value) : undefined, onrejected);
|
|
35867
|
-
}
|
|
35868
|
-
catch(onrejected) {
|
|
35869
|
-
return this.#unwrapped.catch(onrejected);
|
|
35870
|
-
}
|
|
35871
|
-
finally(onfinally) {
|
|
35872
|
-
return this.#unwrapped.finally(onfinally);
|
|
35873
|
-
}
|
|
35874
|
-
$inspect() {
|
|
35875
|
-
return this.#promise;
|
|
35876
|
-
}
|
|
35877
|
-
};
|
|
35878
|
-
});
|
|
35879
|
-
|
|
35880
36034
|
// src/funcs/diagGetHealthInfo.ts
|
|
35881
36035
|
function diagGetHealthInfo(client, options) {
|
|
35882
|
-
return new APIPromise($
|
|
36036
|
+
return new APIPromise($do2(client, options));
|
|
35883
36037
|
}
|
|
35884
|
-
async function $
|
|
36038
|
+
async function $do2(client, options) {
|
|
35885
36039
|
const path = pathToFunc("/health")();
|
|
35886
36040
|
const headers = new Headers(compactMap({
|
|
35887
36041
|
Accept: "application/json"
|
|
@@ -35962,7 +36116,7 @@ var init_diagGetHealthInfo2 = __esm(() => {
|
|
|
35962
36116
|
function createMCPServer(deps) {
|
|
35963
36117
|
const server = new McpServer({
|
|
35964
36118
|
name: "CriblControlPlane",
|
|
35965
|
-
version: "0.0.
|
|
36119
|
+
version: "0.0.4"
|
|
35966
36120
|
});
|
|
35967
36121
|
const client = new CriblControlPlaneCore({
|
|
35968
36122
|
security: deps.security,
|
|
@@ -35976,6 +36130,7 @@ function createMCPServer(deps) {
|
|
|
35976
36130
|
const resourceTemplate = createRegisterResourceTemplate(deps.logger, server, client, scopes);
|
|
35977
36131
|
const prompt = createRegisterPrompt(deps.logger, server, client, scopes);
|
|
35978
36132
|
const register = { tool, resource, resourceTemplate, prompt };
|
|
36133
|
+
tool(tool$authLogin);
|
|
35979
36134
|
tool(tool$diagGetHealthInfo);
|
|
35980
36135
|
return server;
|
|
35981
36136
|
}
|
|
@@ -35984,6 +36139,7 @@ var init_server2 = __esm(() => {
|
|
|
35984
36139
|
init_core();
|
|
35985
36140
|
init_resources();
|
|
35986
36141
|
init_tools();
|
|
36142
|
+
init_authLogin2();
|
|
35987
36143
|
init_diagGetHealthInfo2();
|
|
35988
36144
|
});
|
|
35989
36145
|
|
|
@@ -37198,7 +37354,7 @@ var routes = an({
|
|
|
37198
37354
|
var app = He(routes, {
|
|
37199
37355
|
name: "mcp",
|
|
37200
37356
|
versionInfo: {
|
|
37201
|
-
currentVersion: "0.0.
|
|
37357
|
+
currentVersion: "0.0.4"
|
|
37202
37358
|
}
|
|
37203
37359
|
});
|
|
37204
37360
|
zt(app, process3.argv.slice(2), buildContext(process3));
|
|
@@ -37206,5 +37362,5 @@ export {
|
|
|
37206
37362
|
app
|
|
37207
37363
|
};
|
|
37208
37364
|
|
|
37209
|
-
//# debugId=
|
|
37365
|
+
//# debugId=92C249F9C811A57B64756E2164756E21
|
|
37210
37366
|
//# sourceMappingURL=mcp-server.js.map
|