botshield-sdk 2.0.0 → 2.0.1
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/README.md +8 -11
- package/bin/mcp-server.js +45 -55
- package/bin/mcp-server.js.map +17 -17
- package/dist/commonjs/funcs/census-create-session.d.ts +1 -1
- package/dist/commonjs/funcs/census-create-session.js +1 -1
- package/dist/commonjs/funcs/census-create-verification-link.js +1 -1
- package/dist/commonjs/funcs/census-create-verification-link.js.map +1 -1
- package/dist/commonjs/funcs/census-get-partner-config.js +0 -6
- package/dist/commonjs/funcs/census-get-partner-config.js.map +1 -1
- package/dist/commonjs/funcs/census-logout.d.ts +1 -1
- package/dist/commonjs/funcs/census-logout.js +1 -1
- package/dist/commonjs/funcs/census-verify-token.js +0 -6
- package/dist/commonjs/funcs/census-verify-token.js.map +1 -1
- package/dist/commonjs/funcs/verification-get-status.js +0 -6
- package/dist/commonjs/funcs/verification-get-status.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/encodings.d.ts +10 -9
- package/dist/commonjs/lib/encodings.d.ts.map +1 -1
- package/dist/commonjs/lib/encodings.js +29 -13
- package/dist/commonjs/lib/encodings.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +0 -7
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/command.js +0 -8
- package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts +0 -1
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.js +0 -2
- package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/tools/actions-cancel-action.js +1 -1
- package/dist/commonjs/mcp-server/tools/actions-cancel-action.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/actions-check-action-status.js +1 -1
- package/dist/commonjs/mcp-server/tools/actions-check-action-status.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/actions-propose-action.js +1 -1
- package/dist/commonjs/mcp-server/tools/actions-propose-action.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +13 -3
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.js +4 -4
- package/dist/commonjs/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts +0 -2
- package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-get-partner-config.js +0 -2
- package/dist/commonjs/models/operations/sdk-get-partner-config.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts +0 -2
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.js +0 -2
- package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -1
- package/dist/commonjs/models/operations/verification-get-status.d.ts +10 -2
- package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/verification-get-status.js +4 -2
- package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
- package/dist/commonjs/models/security.d.ts +0 -2
- package/dist/commonjs/models/security.d.ts.map +1 -1
- package/dist/commonjs/models/security.js +0 -2
- package/dist/commonjs/models/security.js.map +1 -1
- package/dist/commonjs/sdk/census.d.ts +2 -2
- package/dist/commonjs/sdk/census.js +2 -2
- package/dist/esm/funcs/census-create-session.d.ts +1 -1
- package/dist/esm/funcs/census-create-session.js +1 -1
- package/dist/esm/funcs/census-create-verification-link.js +1 -1
- package/dist/esm/funcs/census-create-verification-link.js.map +1 -1
- package/dist/esm/funcs/census-get-partner-config.js +0 -6
- package/dist/esm/funcs/census-get-partner-config.js.map +1 -1
- package/dist/esm/funcs/census-logout.d.ts +1 -1
- package/dist/esm/funcs/census-logout.js +1 -1
- package/dist/esm/funcs/census-verify-token.js +0 -6
- package/dist/esm/funcs/census-verify-token.js.map +1 -1
- package/dist/esm/funcs/verification-get-status.js +0 -6
- package/dist/esm/funcs/verification-get-status.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/encodings.d.ts +10 -9
- package/dist/esm/lib/encodings.d.ts.map +1 -1
- package/dist/esm/lib/encodings.js +29 -13
- package/dist/esm/lib/encodings.js.map +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +0 -7
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -1
- package/dist/esm/mcp-server/cli/start/command.js +0 -8
- package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.d.ts +0 -1
- package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.js +0 -2
- package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/tools/actions-cancel-action.js +1 -1
- package/dist/esm/mcp-server/tools/actions-cancel-action.js.map +1 -1
- package/dist/esm/mcp-server/tools/actions-check-action-status.js +1 -1
- package/dist/esm/mcp-server/tools/actions-check-action-status.js.map +1 -1
- package/dist/esm/mcp-server/tools/actions-propose-action.js +1 -1
- package/dist/esm/mcp-server/tools/actions-propose-action.js.map +1 -1
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts +13 -3
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-create-verification-link.js +4 -4
- package/dist/esm/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/esm/models/operations/sdk-get-partner-config.d.ts +0 -2
- package/dist/esm/models/operations/sdk-get-partner-config.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-get-partner-config.js +0 -2
- package/dist/esm/models/operations/sdk-get-partner-config.js.map +1 -1
- package/dist/esm/models/operations/sdk-verify-token.d.ts +0 -2
- package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-verify-token.js +0 -2
- package/dist/esm/models/operations/sdk-verify-token.js.map +1 -1
- package/dist/esm/models/operations/verification-get-status.d.ts +10 -2
- package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/esm/models/operations/verification-get-status.js +4 -2
- package/dist/esm/models/operations/verification-get-status.js.map +1 -1
- package/dist/esm/models/security.d.ts +0 -2
- package/dist/esm/models/security.d.ts.map +1 -1
- package/dist/esm/models/security.js +0 -2
- package/dist/esm/models/security.js.map +1 -1
- package/dist/esm/sdk/census.d.ts +2 -2
- package/dist/esm/sdk/census.js +2 -2
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/census-create-session.ts +1 -1
- package/src/funcs/census-create-verification-link.ts +1 -1
- package/src/funcs/census-get-partner-config.ts +0 -7
- package/src/funcs/census-logout.ts +1 -1
- package/src/funcs/census-verify-token.ts +0 -7
- package/src/funcs/verification-get-status.ts +0 -7
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +58 -23
- package/src/lib/security.ts +0 -7
- package/src/mcp-server/cli/start/command.ts +0 -8
- package/src/mcp-server/cli/start/impl.ts +0 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/actions-cancel-action.ts +1 -1
- package/src/mcp-server/tools/actions-check-action-status.ts +1 -1
- package/src/mcp-server/tools/actions-propose-action.ts +1 -1
- package/src/models/operations/sdk-create-verification-link.ts +17 -7
- package/src/models/operations/sdk-get-partner-config.ts +0 -4
- package/src/models/operations/sdk-verify-token.ts +0 -4
- package/src/models/operations/verification-get-status.ts +10 -4
- package/src/models/security.ts +0 -4
- package/src/sdk/census.ts +2 -2
|
@@ -4,7 +4,6 @@ import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
|
4
4
|
export type Security = {
|
|
5
5
|
agentKeyAuth?: string | undefined;
|
|
6
6
|
agentKeyAuth1?: string | undefined;
|
|
7
|
-
agentKeyAuth2?: string | undefined;
|
|
8
7
|
};
|
|
9
8
|
/** @internal */
|
|
10
9
|
export declare const Security$inboundSchema: z.ZodType<Security, z.ZodTypeDef, unknown>;
|
|
@@ -12,7 +11,6 @@ export declare const Security$inboundSchema: z.ZodType<Security, z.ZodTypeDef, u
|
|
|
12
11
|
export type Security$Outbound = {
|
|
13
12
|
agentKeyAuth?: string | undefined;
|
|
14
13
|
agentKeyAuth1?: string | undefined;
|
|
15
|
-
agentKeyAuth2?: string | undefined;
|
|
16
14
|
};
|
|
17
15
|
/** @internal */
|
|
18
16
|
export declare const Security$outboundSchema: z.ZodType<Security$Outbound, z.ZodTypeDef, Security>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/models/security.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/models/security.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,MAAM,MAAM,QAAQ,GAAG;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAC5C,QAAQ,EACR,CAAC,CAAC,UAAU,EACZ,OAAO,CAIP,CAAC;AACH,gBAAgB;AAChB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAC7C,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,QAAQ,CAIR,CAAC;AAEH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEzD;AACD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAM/C"}
|
|
@@ -8,13 +8,11 @@ import * as types from "../types/primitives.js";
|
|
|
8
8
|
export const Security$inboundSchema = z.object({
|
|
9
9
|
agentKeyAuth: types.optional(types.string()),
|
|
10
10
|
agentKeyAuth1: types.optional(types.string()),
|
|
11
|
-
agentKeyAuth2: types.optional(types.string()),
|
|
12
11
|
});
|
|
13
12
|
/** @internal */
|
|
14
13
|
export const Security$outboundSchema = z.object({
|
|
15
14
|
agentKeyAuth: z.string().optional(),
|
|
16
15
|
agentKeyAuth1: z.string().optional(),
|
|
17
|
-
agentKeyAuth2: z.string().optional(),
|
|
18
16
|
});
|
|
19
17
|
export function securityToJSON(security) {
|
|
20
18
|
return JSON.stringify(Security$outboundSchema.parse(security));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../../src/models/security.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,KAAK,KAAK,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../../src/models/security.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,KAAK,KAAK,MAAM,wBAAwB,CAAC;AAQhD,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAI/B,CAAC,CAAC,MAAM,CAAC;IACX,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IAC5C,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;CAC9C,CAAC,CAAC;AAOH,gBAAgB;AAChB,MAAM,CAAC,MAAM,uBAAuB,GAIhC,CAAC,CAAC,MAAM,CAAC;IACX,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAAC,QAAkB,EAAU;IACzD,OAAO,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AAAA,CAChE;AACD,MAAM,UAAU,gBAAgB,CAC9B,UAAkB,EAC6B;IAC/C,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAClD,sCAAsC,CACvC,CAAC;AAAA,CACH"}
|
package/dist/esm/sdk/census.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
|
2
2
|
import * as operations from "../models/operations/index.js";
|
|
3
3
|
export declare class Census extends ClientSDK {
|
|
4
4
|
/**
|
|
5
|
-
* Create
|
|
5
|
+
* Create a grant token
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* Creates a short-lived anchor grant token (5 minutes) from an API token or site key. Use this to get a token before creating verification links.
|
|
@@ -51,7 +51,7 @@ export declare class Census extends ClientSDK {
|
|
|
51
51
|
*/
|
|
52
52
|
revokeVerification(security: operations.SDKRevokeVerificationSecurity, request: operations.SDKRevokeVerificationRequest, options?: RequestOptions): Promise<operations.SDKRevokeVerificationResponse>;
|
|
53
53
|
/**
|
|
54
|
-
* Revoke
|
|
54
|
+
* Revoke a grant token
|
|
55
55
|
*/
|
|
56
56
|
logout(security: operations.SDKLogoutSecurity, request: operations.SDKLogoutRequest, options?: RequestOptions): Promise<operations.SDKLogoutResponse>;
|
|
57
57
|
}
|
package/dist/esm/sdk/census.js
CHANGED
|
@@ -13,7 +13,7 @@ import { ClientSDK } from "../lib/sdks.js";
|
|
|
13
13
|
import { unwrapAsync } from "../types/fp.js";
|
|
14
14
|
export class Census extends ClientSDK {
|
|
15
15
|
/**
|
|
16
|
-
* Create
|
|
16
|
+
* Create a grant token
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
19
|
* Creates a short-lived anchor grant token (5 minutes) from an API token or site key. Use this to get a token before creating verification links.
|
|
@@ -76,7 +76,7 @@ export class Census extends ClientSDK {
|
|
|
76
76
|
return unwrapAsync(censusRevokeVerification(this, security, request, options));
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
|
-
* Revoke
|
|
79
|
+
* Revoke a grant token
|
|
80
80
|
*/
|
|
81
81
|
async logout(security, request, options) {
|
|
82
82
|
return unwrapAsync(censusLogout(this, security, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "botshield-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"author": "BotShield",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"url": "https://github.com/Bot-Shield/botshield-sdk-typescript.git"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"lint": "oxlint --max-warnings=0 --deny-warnings
|
|
31
|
+
"lint": "oxlint --max-warnings=0 --deny-warnings --no-error-on-unmatched-pattern src",
|
|
32
32
|
"build:mcp": "bun src/mcp-server/build.mts",
|
|
33
33
|
"build": "npm run build:mcp && tshy",
|
|
34
34
|
"prepublishOnly": "npm run build"
|
|
@@ -27,7 +27,7 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Create
|
|
30
|
+
* Create a grant token
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
33
|
* Creates a short-lived anchor grant token (5 minutes) from an API token or site key. Use this to get a token before creating verification links.
|
package/src/lib/config.ts
CHANGED
|
@@ -69,7 +69,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
69
69
|
export const SDK_METADATA = {
|
|
70
70
|
language: "typescript",
|
|
71
71
|
openapiDocVersion: "2.0.0",
|
|
72
|
-
sdkVersion: "2.0.
|
|
73
|
-
genVersion: "2.
|
|
74
|
-
userAgent: "speakeasy-sdk/typescript 2.0.
|
|
72
|
+
sdkVersion: "2.0.1",
|
|
73
|
+
genVersion: "2.934.1",
|
|
74
|
+
userAgent: "speakeasy-sdk/typescript 2.0.1 2.934.1 2.0.0 botshield-sdk",
|
|
75
75
|
} as const;
|
package/src/lib/encodings.ts
CHANGED
|
@@ -12,10 +12,41 @@ export class EncodingError extends Error {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
export type CharEncoding = "percent" | "percentExceptReserved" | "none";
|
|
16
|
+
|
|
17
|
+
const reservedEscapes = /%(2[346bcf]|3[abdf]|40|5[bd])/gi;
|
|
18
|
+
|
|
19
|
+
function encodeKeyChars(
|
|
20
|
+
v: string,
|
|
21
|
+
charEncoding: CharEncoding | undefined,
|
|
22
|
+
): string {
|
|
23
|
+
return encodeChars(
|
|
24
|
+
v,
|
|
25
|
+
charEncoding === "percentExceptReserved" ? "percent" : charEncoding,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function encodeChars(
|
|
30
|
+
v: string,
|
|
31
|
+
charEncoding: CharEncoding | undefined,
|
|
32
|
+
): string {
|
|
33
|
+
switch (charEncoding) {
|
|
34
|
+
case "percent":
|
|
35
|
+
return encodeURIComponent(v);
|
|
36
|
+
case "percentExceptReserved":
|
|
37
|
+
return encodeURIComponent(v).replace(
|
|
38
|
+
reservedEscapes,
|
|
39
|
+
(m) => decodeURIComponent(m),
|
|
40
|
+
);
|
|
41
|
+
default:
|
|
42
|
+
return v;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
15
46
|
export function encodeMatrix(
|
|
16
47
|
key: string,
|
|
17
48
|
value: unknown,
|
|
18
|
-
options?: { explode?: boolean; charEncoding?:
|
|
49
|
+
options?: { explode?: boolean; charEncoding?: CharEncoding },
|
|
19
50
|
): string | undefined {
|
|
20
51
|
let out = "";
|
|
21
52
|
const pairs: [string, unknown][] = options?.explode
|
|
@@ -27,7 +58,7 @@ export function encodeMatrix(
|
|
|
27
58
|
}
|
|
28
59
|
|
|
29
60
|
const encodeString = (v: string) => {
|
|
30
|
-
return options?.charEncoding
|
|
61
|
+
return encodeChars(v, options?.charEncoding);
|
|
31
62
|
};
|
|
32
63
|
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
|
|
33
64
|
|
|
@@ -52,7 +83,7 @@ export function encodeMatrix(
|
|
|
52
83
|
return;
|
|
53
84
|
}
|
|
54
85
|
|
|
55
|
-
const keyPrefix =
|
|
86
|
+
const keyPrefix = encodeKeyChars(pk, options?.charEncoding);
|
|
56
87
|
tmp = `${keyPrefix}=${encValue}`;
|
|
57
88
|
// trim trailing '=' if value was empty
|
|
58
89
|
if (tmp === `${keyPrefix}=`) {
|
|
@@ -73,7 +104,7 @@ export function encodeMatrix(
|
|
|
73
104
|
export function encodeLabel(
|
|
74
105
|
key: string,
|
|
75
106
|
value: unknown,
|
|
76
|
-
options?: { explode?: boolean; charEncoding?:
|
|
107
|
+
options?: { explode?: boolean; charEncoding?: CharEncoding },
|
|
77
108
|
): string | undefined {
|
|
78
109
|
let out = "";
|
|
79
110
|
const pairs: [string, unknown][] = options?.explode
|
|
@@ -85,7 +116,7 @@ export function encodeLabel(
|
|
|
85
116
|
}
|
|
86
117
|
|
|
87
118
|
const encodeString = (v: string) => {
|
|
88
|
-
return options?.charEncoding
|
|
119
|
+
return encodeChars(v, options?.charEncoding);
|
|
89
120
|
};
|
|
90
121
|
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
|
|
91
122
|
|
|
@@ -103,7 +134,7 @@ export function encodeLabel(
|
|
|
103
134
|
encValue = mapped?.join("").slice(1);
|
|
104
135
|
} else {
|
|
105
136
|
const k = options?.explode && isPlainObject(value)
|
|
106
|
-
? `${
|
|
137
|
+
? `${encodeKeyChars(pk, options?.charEncoding)}=`
|
|
107
138
|
: "";
|
|
108
139
|
encValue = `${k}${encodeValue(pv)}`;
|
|
109
140
|
}
|
|
@@ -117,14 +148,14 @@ export function encodeLabel(
|
|
|
117
148
|
type FormEncoder = (
|
|
118
149
|
key: string,
|
|
119
150
|
value: unknown,
|
|
120
|
-
options?: { explode?: boolean; charEncoding?:
|
|
151
|
+
options?: { explode?: boolean; charEncoding?: CharEncoding },
|
|
121
152
|
) => string | undefined;
|
|
122
153
|
|
|
123
154
|
function formEncoder(sep: string): FormEncoder {
|
|
124
155
|
return (
|
|
125
156
|
key: string,
|
|
126
157
|
value: unknown,
|
|
127
|
-
options?: { explode?: boolean; charEncoding?:
|
|
158
|
+
options?: { explode?: boolean; charEncoding?: CharEncoding },
|
|
128
159
|
) => {
|
|
129
160
|
let out = "";
|
|
130
161
|
const pairs: [string, unknown][] = options?.explode
|
|
@@ -136,7 +167,7 @@ function formEncoder(sep: string): FormEncoder {
|
|
|
136
167
|
}
|
|
137
168
|
|
|
138
169
|
const encodeString = (v: string) => {
|
|
139
|
-
return options?.charEncoding
|
|
170
|
+
return encodeChars(v, options?.charEncoding);
|
|
140
171
|
};
|
|
141
172
|
|
|
142
173
|
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
|
|
@@ -163,7 +194,7 @@ function formEncoder(sep: string): FormEncoder {
|
|
|
163
194
|
return;
|
|
164
195
|
}
|
|
165
196
|
|
|
166
|
-
tmp = `${
|
|
197
|
+
tmp = `${encodeKeyChars(pk, options?.charEncoding)}=${encValue}`;
|
|
167
198
|
|
|
168
199
|
// If we end up with the nothing then skip forward
|
|
169
200
|
if (!tmp || tmp === "=") {
|
|
@@ -184,7 +215,7 @@ export const encodePipeDelimited = formEncoder("|");
|
|
|
184
215
|
export function encodeBodyForm(
|
|
185
216
|
key: string,
|
|
186
217
|
value: unknown,
|
|
187
|
-
options?: { explode?: boolean; charEncoding?:
|
|
218
|
+
options?: { explode?: boolean; charEncoding?: CharEncoding },
|
|
188
219
|
): string {
|
|
189
220
|
let out = "";
|
|
190
221
|
const pairs: [string, unknown][] = options?.explode
|
|
@@ -192,7 +223,7 @@ export function encodeBodyForm(
|
|
|
192
223
|
: [[key, value]];
|
|
193
224
|
|
|
194
225
|
const encodeString = (v: string) => {
|
|
195
|
-
return options?.charEncoding
|
|
226
|
+
return encodeChars(v, options?.charEncoding);
|
|
196
227
|
};
|
|
197
228
|
|
|
198
229
|
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
|
|
@@ -211,7 +242,7 @@ export function encodeBodyForm(
|
|
|
211
242
|
encValue = `${encodeValue(pv)}`;
|
|
212
243
|
}
|
|
213
244
|
|
|
214
|
-
tmp = `${
|
|
245
|
+
tmp = `${encodeKeyChars(pk, options?.charEncoding)}=${encValue}`;
|
|
215
246
|
|
|
216
247
|
// If we end up with the nothing then skip forward
|
|
217
248
|
if (!tmp || tmp === "=") {
|
|
@@ -227,7 +258,7 @@ export function encodeBodyForm(
|
|
|
227
258
|
export function encodeDeepObject(
|
|
228
259
|
key: string,
|
|
229
260
|
value: unknown,
|
|
230
|
-
options?: { charEncoding?:
|
|
261
|
+
options?: { charEncoding?: CharEncoding },
|
|
231
262
|
): string | undefined {
|
|
232
263
|
if (value == null) {
|
|
233
264
|
return;
|
|
@@ -245,7 +276,7 @@ export function encodeDeepObject(
|
|
|
245
276
|
export function encodeDeepObjectObject(
|
|
246
277
|
key: string,
|
|
247
278
|
value: unknown,
|
|
248
|
-
options?: { charEncoding?:
|
|
279
|
+
options?: { charEncoding?: CharEncoding },
|
|
249
280
|
): string | undefined {
|
|
250
281
|
if (value == null) {
|
|
251
282
|
return;
|
|
@@ -254,7 +285,7 @@ export function encodeDeepObjectObject(
|
|
|
254
285
|
let out = "";
|
|
255
286
|
|
|
256
287
|
const encodeString = (v: string) => {
|
|
257
|
-
return options?.charEncoding
|
|
288
|
+
return encodeChars(v, options?.charEncoding);
|
|
258
289
|
};
|
|
259
290
|
|
|
260
291
|
if (!isPlainObject(value)) {
|
|
@@ -278,7 +309,9 @@ export function encodeDeepObjectObject(
|
|
|
278
309
|
|
|
279
310
|
const pairs: unknown[] = Array.isArray(cv) ? cv : [cv];
|
|
280
311
|
const encoded = mapDefined(pairs, (v) => {
|
|
281
|
-
return `${
|
|
312
|
+
return `${encodeKeyChars(pk, options?.charEncoding)}=${
|
|
313
|
+
encodeString(serializeValue(v))
|
|
314
|
+
}`;
|
|
282
315
|
})?.join("&");
|
|
283
316
|
|
|
284
317
|
out += encoded == null ? "" : `&${encoded}`;
|
|
@@ -290,25 +323,27 @@ export function encodeDeepObjectObject(
|
|
|
290
323
|
export function encodeJSON(
|
|
291
324
|
key: string,
|
|
292
325
|
value: unknown,
|
|
293
|
-
options?: { explode?: boolean; charEncoding?:
|
|
326
|
+
options?: { explode?: boolean; charEncoding?: CharEncoding },
|
|
294
327
|
): string | undefined {
|
|
295
328
|
if (typeof value === "undefined") {
|
|
296
329
|
return;
|
|
297
330
|
}
|
|
298
331
|
|
|
299
332
|
const encodeString = (v: string) => {
|
|
300
|
-
return options?.charEncoding
|
|
333
|
+
return encodeChars(v, options?.charEncoding);
|
|
301
334
|
};
|
|
302
335
|
|
|
303
336
|
const encVal = encodeString(JSON.stringify(value, jsonReplacer));
|
|
304
337
|
|
|
305
|
-
return options?.explode
|
|
338
|
+
return options?.explode
|
|
339
|
+
? encVal
|
|
340
|
+
: `${encodeKeyChars(key, options?.charEncoding)}=${encVal}`;
|
|
306
341
|
}
|
|
307
342
|
|
|
308
343
|
export const encodeSimple = (
|
|
309
344
|
key: string,
|
|
310
345
|
value: unknown,
|
|
311
|
-
options?: { explode?: boolean; charEncoding?:
|
|
346
|
+
options?: { explode?: boolean; charEncoding?: CharEncoding },
|
|
312
347
|
): string | undefined => {
|
|
313
348
|
let out = "";
|
|
314
349
|
const pairs: [string, unknown][] = options?.explode
|
|
@@ -320,7 +355,7 @@ export const encodeSimple = (
|
|
|
320
355
|
}
|
|
321
356
|
|
|
322
357
|
const encodeString = (v: string) => {
|
|
323
|
-
return options?.charEncoding
|
|
358
|
+
return encodeChars(v, options?.charEncoding);
|
|
324
359
|
};
|
|
325
360
|
const encodeValue = (v: unknown) => encodeString(serializeValue(v));
|
|
326
361
|
|
|
@@ -426,7 +461,7 @@ export function queryJoin(...args: (string | undefined)[]): string {
|
|
|
426
461
|
|
|
427
462
|
type QueryEncoderOptions = {
|
|
428
463
|
explode?: boolean;
|
|
429
|
-
charEncoding?:
|
|
464
|
+
charEncoding?: CharEncoding;
|
|
430
465
|
allowEmptyValue?: string[];
|
|
431
466
|
};
|
|
432
467
|
|
package/src/lib/security.ts
CHANGED
|
@@ -261,13 +261,6 @@ export function resolveGlobalSecurity(
|
|
|
261
261
|
value: security?.agentKeyAuth1,
|
|
262
262
|
},
|
|
263
263
|
],
|
|
264
|
-
[
|
|
265
|
-
{
|
|
266
|
-
fieldName: "Authorization",
|
|
267
|
-
type: "apiKey:header",
|
|
268
|
-
value: security?.agentKeyAuth2,
|
|
269
|
-
},
|
|
270
|
-
],
|
|
271
264
|
];
|
|
272
265
|
|
|
273
266
|
if (allowedFields) {
|
|
@@ -59,14 +59,6 @@ export const startCommand = buildCommand({
|
|
|
59
59
|
return z.string().parse(value);
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
|
-
"agent-key-auth2": {
|
|
63
|
-
kind: "parsed",
|
|
64
|
-
brief: "Sets the agentKeyAuth2 auth field for the API",
|
|
65
|
-
optional: true,
|
|
66
|
-
parse: (value) => {
|
|
67
|
-
return z.string().parse(value);
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
62
|
"server-url": {
|
|
71
63
|
kind: "parsed",
|
|
72
64
|
brief: "Overrides the default server URL used by the SDK",
|
|
@@ -21,7 +21,6 @@ interface StartCommandFlags {
|
|
|
21
21
|
readonly scope?: MCPScope[];
|
|
22
22
|
readonly "agent-key-auth"?: string | undefined;
|
|
23
23
|
readonly "agent-key-auth1"?: string | undefined;
|
|
24
|
-
readonly "agent-key-auth2"?: string | undefined;
|
|
25
24
|
readonly "server-url"?: string;
|
|
26
25
|
readonly "server-index"?: SDKOptions["serverIdx"];
|
|
27
26
|
readonly "log-level": ConsoleLoggerLevel;
|
|
@@ -55,7 +54,6 @@ async function startStdio(flags: StartCommandFlags) {
|
|
|
55
54
|
security: {
|
|
56
55
|
agentKeyAuth: flags["agent-key-auth"] ?? "",
|
|
57
56
|
agentKeyAuth1: flags["agent-key-auth1"] ?? "",
|
|
58
|
-
agentKeyAuth2: flags["agent-key-auth2"] ?? "",
|
|
59
57
|
},
|
|
60
58
|
serverURL: flags["server-url"],
|
|
61
59
|
serverIdx: flags["server-index"],
|
|
@@ -80,7 +78,6 @@ async function startSSE(flags: StartCommandFlags) {
|
|
|
80
78
|
security: {
|
|
81
79
|
agentKeyAuth: flags["agent-key-auth"] ?? "",
|
|
82
80
|
agentKeyAuth1: flags["agent-key-auth1"] ?? "",
|
|
83
|
-
agentKeyAuth2: flags["agent-key-auth2"] ?? "",
|
|
84
81
|
},
|
|
85
82
|
serverURL: flags["server-url"],
|
|
86
83
|
serverIdx: flags["server-index"],
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const tool$actionsCancelAction: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "cancel_resolution",
|
|
15
15
|
description:
|
|
16
16
|
`Stand down a queued resolution before the user responds. No-op once terminal; TTL expiry produces no Resolution.`,
|
|
17
|
-
scopes: ["queue", "queue"
|
|
17
|
+
scopes: ["queue", "queue"],
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await actionsCancelAction(
|
|
@@ -14,7 +14,7 @@ export const tool$actionsCheckActionStatus: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "check_resolution_status",
|
|
15
15
|
description:
|
|
16
16
|
`Poll a proposed resolution (pass wait_seconds up to 25 to long-poll). Terminal states (approved/denied) carry the signed Proof of Resolution JWT — verify against BotShield's JWKS; the request_id is the JWT jti.`,
|
|
17
|
-
scopes: ["queue", "queue"
|
|
17
|
+
scopes: ["queue", "queue"],
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await actionsCheckActionStatus(
|
|
@@ -14,7 +14,7 @@ export const tool$actionsProposeAction: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "propose_resolution",
|
|
15
15
|
description:
|
|
16
16
|
`Propose a human-presence-gated action to a BotShield user (Agents Ask). Returns a card_id immediately; the signed Proof of Resolution arrives async via the agent's registered callback, or poll check_resolution_status.`,
|
|
17
|
-
scopes: ["queue", "queue"
|
|
17
|
+
scopes: ["queue", "queue"],
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await actionsProposeAction(
|
|
@@ -13,7 +13,7 @@ import { SDKValidationError } from "../errors/sdk-validation-error.js";
|
|
|
13
13
|
import * as models from "../index.js";
|
|
14
14
|
|
|
15
15
|
export type SDKCreateVerificationLinkSecurity = {
|
|
16
|
-
|
|
16
|
+
grantTokenAuth: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const SDKTypeRequest = {
|
|
@@ -50,9 +50,14 @@ export type SDKCreateVerificationLinkRequest = {
|
|
|
50
50
|
* Where the web flow returns after verification.
|
|
51
51
|
*/
|
|
52
52
|
returnUrl?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Deprecated. Accepted and never used — webhooks are delivered to the endpoints configured in the Console.
|
|
55
|
+
*
|
|
56
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
57
|
+
*/
|
|
53
58
|
webhookUrl?: string | undefined;
|
|
54
59
|
/**
|
|
55
|
-
* The gate this request runs (the gate's action name, as listed in the Console under BotShield
|
|
60
|
+
* The gate this request runs (the gate's action name, as listed in the Console under BotShield Gate).
|
|
56
61
|
*/
|
|
57
62
|
scope?: string | undefined;
|
|
58
63
|
sdkType?: SDKTypeRequest | undefined;
|
|
@@ -101,6 +106,11 @@ export type SDKCreateVerificationLinkDataData = {
|
|
|
101
106
|
requestId: string;
|
|
102
107
|
deepLink: string;
|
|
103
108
|
webUrl: string;
|
|
109
|
+
/**
|
|
110
|
+
* Deprecated. Does not resolve to an image — render your own QR code from web_url.
|
|
111
|
+
*
|
|
112
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
113
|
+
*/
|
|
104
114
|
qrCodeUrl: string;
|
|
105
115
|
expiresAt: Date;
|
|
106
116
|
sdkType?: SDKCreateVerificationLinkSDKTypeResponse | undefined;
|
|
@@ -134,15 +144,15 @@ export const SDKCreateVerificationLinkSecurity$inboundSchema: z.ZodType<
|
|
|
134
144
|
z.ZodTypeDef,
|
|
135
145
|
unknown
|
|
136
146
|
> = z.object({
|
|
137
|
-
|
|
147
|
+
GrantTokenAuth: types.string(),
|
|
138
148
|
}).transform((v) => {
|
|
139
149
|
return remap$(v, {
|
|
140
|
-
"
|
|
150
|
+
"GrantTokenAuth": "grantTokenAuth",
|
|
141
151
|
});
|
|
142
152
|
});
|
|
143
153
|
/** @internal */
|
|
144
154
|
export type SDKCreateVerificationLinkSecurity$Outbound = {
|
|
145
|
-
|
|
155
|
+
GrantTokenAuth: string;
|
|
146
156
|
};
|
|
147
157
|
|
|
148
158
|
/** @internal */
|
|
@@ -151,10 +161,10 @@ export const SDKCreateVerificationLinkSecurity$outboundSchema: z.ZodType<
|
|
|
151
161
|
z.ZodTypeDef,
|
|
152
162
|
SDKCreateVerificationLinkSecurity
|
|
153
163
|
> = z.object({
|
|
154
|
-
|
|
164
|
+
grantTokenAuth: z.string(),
|
|
155
165
|
}).transform((v) => {
|
|
156
166
|
return remap$(v, {
|
|
157
|
-
|
|
167
|
+
grantTokenAuth: "GrantTokenAuth",
|
|
158
168
|
});
|
|
159
169
|
});
|
|
160
170
|
|
|
@@ -15,7 +15,6 @@ import * as models from "../index.js";
|
|
|
15
15
|
export type SDKGetPartnerConfigSecurity = {
|
|
16
16
|
apiKeyAuth?: string | undefined;
|
|
17
17
|
apiKeyAuth1?: string | undefined;
|
|
18
|
-
apiKeyAuth2?: string | undefined;
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
export type SDKGetPartnerConfigRequest = {
|
|
@@ -73,13 +72,11 @@ export const SDKGetPartnerConfigSecurity$inboundSchema: z.ZodType<
|
|
|
73
72
|
> = z.object({
|
|
74
73
|
apiKeyAuth: types.optional(types.string()),
|
|
75
74
|
apiKeyAuth1: types.optional(types.string()),
|
|
76
|
-
apiKeyAuth2: types.optional(types.string()),
|
|
77
75
|
});
|
|
78
76
|
/** @internal */
|
|
79
77
|
export type SDKGetPartnerConfigSecurity$Outbound = {
|
|
80
78
|
apiKeyAuth?: string | undefined;
|
|
81
79
|
apiKeyAuth1?: string | undefined;
|
|
82
|
-
apiKeyAuth2?: string | undefined;
|
|
83
80
|
};
|
|
84
81
|
|
|
85
82
|
/** @internal */
|
|
@@ -90,7 +87,6 @@ export const SDKGetPartnerConfigSecurity$outboundSchema: z.ZodType<
|
|
|
90
87
|
> = z.object({
|
|
91
88
|
apiKeyAuth: z.string().optional(),
|
|
92
89
|
apiKeyAuth1: z.string().optional(),
|
|
93
|
-
apiKeyAuth2: z.string().optional(),
|
|
94
90
|
});
|
|
95
91
|
|
|
96
92
|
export function sdkGetPartnerConfigSecurityToJSON(
|
|
@@ -13,7 +13,6 @@ import * as models from "../index.js";
|
|
|
13
13
|
export type SDKVerifyTokenSecurity = {
|
|
14
14
|
apiKeyAuth?: string | undefined;
|
|
15
15
|
apiKeyAuth1?: string | undefined;
|
|
16
|
-
apiKeyAuth2?: string | undefined;
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
export type SDKVerifyTokenRequest = {
|
|
@@ -69,13 +68,11 @@ export const SDKVerifyTokenSecurity$inboundSchema: z.ZodType<
|
|
|
69
68
|
> = z.object({
|
|
70
69
|
apiKeyAuth: types.optional(types.string()),
|
|
71
70
|
apiKeyAuth1: types.optional(types.string()),
|
|
72
|
-
apiKeyAuth2: types.optional(types.string()),
|
|
73
71
|
});
|
|
74
72
|
/** @internal */
|
|
75
73
|
export type SDKVerifyTokenSecurity$Outbound = {
|
|
76
74
|
apiKeyAuth?: string | undefined;
|
|
77
75
|
apiKeyAuth1?: string | undefined;
|
|
78
|
-
apiKeyAuth2?: string | undefined;
|
|
79
76
|
};
|
|
80
77
|
|
|
81
78
|
/** @internal */
|
|
@@ -86,7 +83,6 @@ export const SDKVerifyTokenSecurity$outboundSchema: z.ZodType<
|
|
|
86
83
|
> = z.object({
|
|
87
84
|
apiKeyAuth: z.string().optional(),
|
|
88
85
|
apiKeyAuth1: z.string().optional(),
|
|
89
|
-
apiKeyAuth2: z.string().optional(),
|
|
90
86
|
});
|
|
91
87
|
|
|
92
88
|
export function sdkVerifyTokenSecurityToJSON(
|