@meetkai/mka1 0.49.12 → 0.49.14
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 +230 -227
- package/bin/mcp-server.js +2667 -2434
- package/bin/mcp-server.js.map +16 -11
- package/dist/commonjs/funcs/agentConnectorsCreateAgentConnector.d.ts +1 -1
- package/dist/commonjs/funcs/agentConnectorsCreateAgentConnector.js +1 -1
- package/dist/commonjs/funcs/agentConnectorsSetupWhatsAppAppWebhook.d.ts +18 -0
- package/dist/commonjs/funcs/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
- package/dist/commonjs/funcs/agentConnectorsSetupWhatsAppAppWebhook.js +141 -0
- package/dist/commonjs/funcs/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- 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/agentConnectorsCreateAgentConnector.js +1 -1
- package/dist/commonjs/mcp-server/tools/agentConnectorsCreateAgentConnector.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.js +64 -0
- package/dist/commonjs/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
- package/dist/commonjs/models/components/createwhatsappagentconnectorrequest.d.ts +4 -1
- package/dist/commonjs/models/components/createwhatsappagentconnectorrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/createwhatsappagentconnectorrequest.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/whatsappwebhooksetup.d.ts +35 -0
- package/dist/commonjs/models/components/whatsappwebhooksetup.d.ts.map +1 -0
- package/dist/commonjs/models/components/whatsappwebhooksetup.js +84 -0
- package/dist/commonjs/models/components/whatsappwebhooksetup.js.map +1 -0
- package/dist/commonjs/models/components/whatsappwebhooksetuprequest.d.ts +17 -0
- package/dist/commonjs/models/components/whatsappwebhooksetuprequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/whatsappwebhooksetuprequest.js +67 -0
- package/dist/commonjs/models/components/whatsappwebhooksetuprequest.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/setupwhatsappappwebhook.d.ts +47 -0
- package/dist/commonjs/models/operations/setupwhatsappappwebhook.d.ts.map +1 -0
- package/dist/commonjs/models/operations/setupwhatsappappwebhook.js +102 -0
- package/dist/commonjs/models/operations/setupwhatsappappwebhook.js.map +1 -0
- package/dist/commonjs/react-query/agentConnectorsCreateAgentConnector.d.ts +1 -1
- package/dist/commonjs/react-query/agentConnectorsCreateAgentConnector.js +1 -1
- package/dist/commonjs/react-query/agentConnectorsSetupWhatsAppAppWebhook.d.ts +29 -0
- package/dist/commonjs/react-query/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
- package/dist/commonjs/react-query/agentConnectorsSetupWhatsAppAppWebhook.js +47 -0
- package/dist/commonjs/react-query/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/sdk/agentconnectors.d.ts +8 -1
- package/dist/commonjs/sdk/agentconnectors.d.ts.map +1 -1
- package/dist/commonjs/sdk/agentconnectors.js +11 -1
- package/dist/commonjs/sdk/agentconnectors.js.map +1 -1
- package/dist/esm/funcs/agentConnectorsCreateAgentConnector.d.ts +1 -1
- package/dist/esm/funcs/agentConnectorsCreateAgentConnector.js +1 -1
- package/dist/esm/funcs/agentConnectorsSetupWhatsAppAppWebhook.d.ts +18 -0
- package/dist/esm/funcs/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
- package/dist/esm/funcs/agentConnectorsSetupWhatsAppAppWebhook.js +105 -0
- package/dist/esm/funcs/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- 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/agentConnectorsCreateAgentConnector.js +1 -1
- package/dist/esm/mcp-server/tools/agentConnectorsCreateAgentConnector.js.map +1 -1
- package/dist/esm/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.d.ts +8 -0
- package/dist/esm/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.js +28 -0
- package/dist/esm/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
- package/dist/esm/models/components/createwhatsappagentconnectorrequest.d.ts +4 -1
- package/dist/esm/models/components/createwhatsappagentconnectorrequest.d.ts.map +1 -1
- package/dist/esm/models/components/createwhatsappagentconnectorrequest.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/whatsappwebhooksetup.d.ts +35 -0
- package/dist/esm/models/components/whatsappwebhooksetup.d.ts.map +1 -0
- package/dist/esm/models/components/whatsappwebhooksetup.js +46 -0
- package/dist/esm/models/components/whatsappwebhooksetup.js.map +1 -0
- package/dist/esm/models/components/whatsappwebhooksetuprequest.d.ts +17 -0
- package/dist/esm/models/components/whatsappwebhooksetuprequest.d.ts.map +1 -0
- package/dist/esm/models/components/whatsappwebhooksetuprequest.js +29 -0
- package/dist/esm/models/components/whatsappwebhooksetuprequest.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/setupwhatsappappwebhook.d.ts +47 -0
- package/dist/esm/models/operations/setupwhatsappappwebhook.d.ts.map +1 -0
- package/dist/esm/models/operations/setupwhatsappappwebhook.js +62 -0
- package/dist/esm/models/operations/setupwhatsappappwebhook.js.map +1 -0
- package/dist/esm/react-query/agentConnectorsCreateAgentConnector.d.ts +1 -1
- package/dist/esm/react-query/agentConnectorsCreateAgentConnector.js +1 -1
- package/dist/esm/react-query/agentConnectorsSetupWhatsAppAppWebhook.d.ts +29 -0
- package/dist/esm/react-query/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
- package/dist/esm/react-query/agentConnectorsSetupWhatsAppAppWebhook.js +42 -0
- package/dist/esm/react-query/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/sdk/agentconnectors.d.ts +8 -1
- package/dist/esm/sdk/agentconnectors.d.ts.map +1 -1
- package/dist/esm/sdk/agentconnectors.js +11 -1
- package/dist/esm/sdk/agentconnectors.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/agentConnectorsCreateAgentConnector.ts +1 -1
- package/src/funcs/agentConnectorsSetupWhatsAppAppWebhook.ts +201 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/agentConnectorsCreateAgentConnector.ts +1 -1
- package/src/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.ts +39 -0
- package/src/models/components/createwhatsappagentconnectorrequest.ts +4 -1
- package/src/models/components/index.ts +2 -0
- package/src/models/components/whatsappwebhooksetup.ts +96 -0
- package/src/models/components/whatsappwebhooksetuprequest.ts +62 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/setupwhatsappappwebhook.ts +140 -0
- package/src/react-query/agentConnectorsCreateAgentConnector.ts +1 -1
- package/src/react-query/agentConnectorsSetupWhatsAppAppWebhook.ts +111 -0
- package/src/react-query/index.ts +1 -0
- package/src/sdk/agentconnectors.ts +19 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const WhatsAppWebhookSetupObject = {
|
|
13
|
+
AgentConnectorWhatsappWebhookSetup: "agent.connector.whatsapp_webhook_setup",
|
|
14
|
+
} as const;
|
|
15
|
+
export type WhatsAppWebhookSetupObject = ClosedEnum<
|
|
16
|
+
typeof WhatsAppWebhookSetupObject
|
|
17
|
+
>;
|
|
18
|
+
|
|
19
|
+
export type WhatsAppWebhookSetup = {
|
|
20
|
+
object: WhatsAppWebhookSetupObject;
|
|
21
|
+
appId: string;
|
|
22
|
+
callbackUrl: string;
|
|
23
|
+
/**
|
|
24
|
+
* Stable verification value for Meta's app-level Webhooks form. This is not a Meta API access token.
|
|
25
|
+
*/
|
|
26
|
+
verifyToken: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const WhatsAppWebhookSetupObject$inboundSchema: z.ZodNativeEnum<
|
|
31
|
+
typeof WhatsAppWebhookSetupObject
|
|
32
|
+
> = z.nativeEnum(WhatsAppWebhookSetupObject);
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const WhatsAppWebhookSetupObject$outboundSchema: z.ZodNativeEnum<
|
|
35
|
+
typeof WhatsAppWebhookSetupObject
|
|
36
|
+
> = WhatsAppWebhookSetupObject$inboundSchema;
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const WhatsAppWebhookSetup$inboundSchema: z.ZodType<
|
|
40
|
+
WhatsAppWebhookSetup,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
unknown
|
|
43
|
+
> = z.object({
|
|
44
|
+
object: WhatsAppWebhookSetupObject$inboundSchema,
|
|
45
|
+
app_id: z.string(),
|
|
46
|
+
callback_url: z.string(),
|
|
47
|
+
verify_token: z.string(),
|
|
48
|
+
}).transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
"app_id": "appId",
|
|
51
|
+
"callback_url": "callbackUrl",
|
|
52
|
+
"verify_token": "verifyToken",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
/** @internal */
|
|
56
|
+
export type WhatsAppWebhookSetup$Outbound = {
|
|
57
|
+
object: string;
|
|
58
|
+
app_id: string;
|
|
59
|
+
callback_url: string;
|
|
60
|
+
verify_token: string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const WhatsAppWebhookSetup$outboundSchema: z.ZodType<
|
|
65
|
+
WhatsAppWebhookSetup$Outbound,
|
|
66
|
+
z.ZodTypeDef,
|
|
67
|
+
WhatsAppWebhookSetup
|
|
68
|
+
> = z.object({
|
|
69
|
+
object: WhatsAppWebhookSetupObject$outboundSchema,
|
|
70
|
+
appId: z.string(),
|
|
71
|
+
callbackUrl: z.string(),
|
|
72
|
+
verifyToken: z.string(),
|
|
73
|
+
}).transform((v) => {
|
|
74
|
+
return remap$(v, {
|
|
75
|
+
appId: "app_id",
|
|
76
|
+
callbackUrl: "callback_url",
|
|
77
|
+
verifyToken: "verify_token",
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export function whatsAppWebhookSetupToJSON(
|
|
82
|
+
whatsAppWebhookSetup: WhatsAppWebhookSetup,
|
|
83
|
+
): string {
|
|
84
|
+
return JSON.stringify(
|
|
85
|
+
WhatsAppWebhookSetup$outboundSchema.parse(whatsAppWebhookSetup),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
export function whatsAppWebhookSetupFromJSON(
|
|
89
|
+
jsonString: string,
|
|
90
|
+
): SafeParseResult<WhatsAppWebhookSetup, SDKValidationError> {
|
|
91
|
+
return safeParse(
|
|
92
|
+
jsonString,
|
|
93
|
+
(x) => WhatsAppWebhookSetup$inboundSchema.parse(JSON.parse(x)),
|
|
94
|
+
`Failed to parse 'WhatsAppWebhookSetup' from JSON`,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type WhatsAppWebhookSetupRequest = {
|
|
12
|
+
appId: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const WhatsAppWebhookSetupRequest$inboundSchema: z.ZodType<
|
|
17
|
+
WhatsAppWebhookSetupRequest,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
app_id: z.string(),
|
|
22
|
+
}).transform((v) => {
|
|
23
|
+
return remap$(v, {
|
|
24
|
+
"app_id": "appId",
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type WhatsAppWebhookSetupRequest$Outbound = {
|
|
29
|
+
app_id: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const WhatsAppWebhookSetupRequest$outboundSchema: z.ZodType<
|
|
34
|
+
WhatsAppWebhookSetupRequest$Outbound,
|
|
35
|
+
z.ZodTypeDef,
|
|
36
|
+
WhatsAppWebhookSetupRequest
|
|
37
|
+
> = z.object({
|
|
38
|
+
appId: z.string(),
|
|
39
|
+
}).transform((v) => {
|
|
40
|
+
return remap$(v, {
|
|
41
|
+
appId: "app_id",
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export function whatsAppWebhookSetupRequestToJSON(
|
|
46
|
+
whatsAppWebhookSetupRequest: WhatsAppWebhookSetupRequest,
|
|
47
|
+
): string {
|
|
48
|
+
return JSON.stringify(
|
|
49
|
+
WhatsAppWebhookSetupRequest$outboundSchema.parse(
|
|
50
|
+
whatsAppWebhookSetupRequest,
|
|
51
|
+
),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export function whatsAppWebhookSetupRequestFromJSON(
|
|
55
|
+
jsonString: string,
|
|
56
|
+
): SafeParseResult<WhatsAppWebhookSetupRequest, SDKValidationError> {
|
|
57
|
+
return safeParse(
|
|
58
|
+
jsonString,
|
|
59
|
+
(x) => WhatsAppWebhookSetupRequest$inboundSchema.parse(JSON.parse(x)),
|
|
60
|
+
`Failed to parse 'WhatsAppWebhookSetupRequest' from JSON`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -273,6 +273,7 @@ export * from "./setapikeybudget.js";
|
|
|
273
273
|
export * from "./setcurrency.js";
|
|
274
274
|
export * from "./setorgbudget.js";
|
|
275
275
|
export * from "./setorgprice.js";
|
|
276
|
+
export * from "./setupwhatsappappwebhook.js";
|
|
276
277
|
export * from "./startexportfeedback.js";
|
|
277
278
|
export * from "./streamagentrunevents.js";
|
|
278
279
|
export * from "./suspendclusterorg.js";
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as components from "../components/index.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type SetupWhatsAppAppWebhookRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* The agent ID.
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional external end-user identifier forwarded by the API gateway.
|
|
19
|
+
*/
|
|
20
|
+
xOnBehalfOf?: string | undefined;
|
|
21
|
+
whatsAppWebhookSetupRequest: components.WhatsAppWebhookSetupRequest;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type SetupWhatsAppAppWebhookResponse = {
|
|
25
|
+
headers: { [k: string]: Array<string> };
|
|
26
|
+
result: components.WhatsAppWebhookSetup;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const SetupWhatsAppAppWebhookRequest$inboundSchema: z.ZodType<
|
|
31
|
+
SetupWhatsAppAppWebhookRequest,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
unknown
|
|
34
|
+
> = z.object({
|
|
35
|
+
id: z.string(),
|
|
36
|
+
"X-On-Behalf-Of": z.string().optional(),
|
|
37
|
+
WhatsAppWebhookSetupRequest:
|
|
38
|
+
components.WhatsAppWebhookSetupRequest$inboundSchema,
|
|
39
|
+
}).transform((v) => {
|
|
40
|
+
return remap$(v, {
|
|
41
|
+
"X-On-Behalf-Of": "xOnBehalfOf",
|
|
42
|
+
"WhatsAppWebhookSetupRequest": "whatsAppWebhookSetupRequest",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
/** @internal */
|
|
46
|
+
export type SetupWhatsAppAppWebhookRequest$Outbound = {
|
|
47
|
+
id: string;
|
|
48
|
+
"X-On-Behalf-Of"?: string | undefined;
|
|
49
|
+
WhatsAppWebhookSetupRequest: components.WhatsAppWebhookSetupRequest$Outbound;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const SetupWhatsAppAppWebhookRequest$outboundSchema: z.ZodType<
|
|
54
|
+
SetupWhatsAppAppWebhookRequest$Outbound,
|
|
55
|
+
z.ZodTypeDef,
|
|
56
|
+
SetupWhatsAppAppWebhookRequest
|
|
57
|
+
> = z.object({
|
|
58
|
+
id: z.string(),
|
|
59
|
+
xOnBehalfOf: z.string().optional(),
|
|
60
|
+
whatsAppWebhookSetupRequest:
|
|
61
|
+
components.WhatsAppWebhookSetupRequest$outboundSchema,
|
|
62
|
+
}).transform((v) => {
|
|
63
|
+
return remap$(v, {
|
|
64
|
+
xOnBehalfOf: "X-On-Behalf-Of",
|
|
65
|
+
whatsAppWebhookSetupRequest: "WhatsAppWebhookSetupRequest",
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export function setupWhatsAppAppWebhookRequestToJSON(
|
|
70
|
+
setupWhatsAppAppWebhookRequest: SetupWhatsAppAppWebhookRequest,
|
|
71
|
+
): string {
|
|
72
|
+
return JSON.stringify(
|
|
73
|
+
SetupWhatsAppAppWebhookRequest$outboundSchema.parse(
|
|
74
|
+
setupWhatsAppAppWebhookRequest,
|
|
75
|
+
),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
export function setupWhatsAppAppWebhookRequestFromJSON(
|
|
79
|
+
jsonString: string,
|
|
80
|
+
): SafeParseResult<SetupWhatsAppAppWebhookRequest, SDKValidationError> {
|
|
81
|
+
return safeParse(
|
|
82
|
+
jsonString,
|
|
83
|
+
(x) => SetupWhatsAppAppWebhookRequest$inboundSchema.parse(JSON.parse(x)),
|
|
84
|
+
`Failed to parse 'SetupWhatsAppAppWebhookRequest' from JSON`,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const SetupWhatsAppAppWebhookResponse$inboundSchema: z.ZodType<
|
|
90
|
+
SetupWhatsAppAppWebhookResponse,
|
|
91
|
+
z.ZodTypeDef,
|
|
92
|
+
unknown
|
|
93
|
+
> = z.object({
|
|
94
|
+
Headers: z.record(z.array(z.string())).default({}),
|
|
95
|
+
Result: components.WhatsAppWebhookSetup$inboundSchema,
|
|
96
|
+
}).transform((v) => {
|
|
97
|
+
return remap$(v, {
|
|
98
|
+
"Headers": "headers",
|
|
99
|
+
"Result": "result",
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
/** @internal */
|
|
103
|
+
export type SetupWhatsAppAppWebhookResponse$Outbound = {
|
|
104
|
+
Headers: { [k: string]: Array<string> };
|
|
105
|
+
Result: components.WhatsAppWebhookSetup$Outbound;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export const SetupWhatsAppAppWebhookResponse$outboundSchema: z.ZodType<
|
|
110
|
+
SetupWhatsAppAppWebhookResponse$Outbound,
|
|
111
|
+
z.ZodTypeDef,
|
|
112
|
+
SetupWhatsAppAppWebhookResponse
|
|
113
|
+
> = z.object({
|
|
114
|
+
headers: z.record(z.array(z.string())),
|
|
115
|
+
result: components.WhatsAppWebhookSetup$outboundSchema,
|
|
116
|
+
}).transform((v) => {
|
|
117
|
+
return remap$(v, {
|
|
118
|
+
headers: "Headers",
|
|
119
|
+
result: "Result",
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export function setupWhatsAppAppWebhookResponseToJSON(
|
|
124
|
+
setupWhatsAppAppWebhookResponse: SetupWhatsAppAppWebhookResponse,
|
|
125
|
+
): string {
|
|
126
|
+
return JSON.stringify(
|
|
127
|
+
SetupWhatsAppAppWebhookResponse$outboundSchema.parse(
|
|
128
|
+
setupWhatsAppAppWebhookResponse,
|
|
129
|
+
),
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
export function setupWhatsAppAppWebhookResponseFromJSON(
|
|
133
|
+
jsonString: string,
|
|
134
|
+
): SafeParseResult<SetupWhatsAppAppWebhookResponse, SDKValidationError> {
|
|
135
|
+
return safeParse(
|
|
136
|
+
jsonString,
|
|
137
|
+
(x) => SetupWhatsAppAppWebhookResponse$inboundSchema.parse(JSON.parse(x)),
|
|
138
|
+
`Failed to parse 'SetupWhatsAppAppWebhookResponse' from JSON`,
|
|
139
|
+
);
|
|
140
|
+
}
|
|
@@ -51,7 +51,7 @@ export type AgentConnectorsCreateAgentConnectorMutationError =
|
|
|
51
51
|
* Create a connector
|
|
52
52
|
*
|
|
53
53
|
* @remarks
|
|
54
|
-
* Connects the agent to a Telegram bot or WhatsApp Business phone number, validates the provider credentials, and registers the agent's webhook. Text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which provider users or chats may invoke the agent.
|
|
54
|
+
* Connects the agent to a Telegram bot or WhatsApp Business phone number, validates the provider credentials, and registers the agent's webhook. WhatsApp connector support is beta. Text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which provider users or chats may invoke the agent.
|
|
55
55
|
*/
|
|
56
56
|
export function useAgentConnectorsCreateAgentConnectorMutation(
|
|
57
57
|
options?: MutationHookOptions<
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { SDKCore } from "../core.js";
|
|
11
|
+
import { agentConnectorsSetupWhatsAppAppWebhook } from "../funcs/agentConnectorsSetupWhatsAppAppWebhook.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
27
|
+
import { useSDKContext } from "./_context.js";
|
|
28
|
+
import { MutationHookOptions } from "./_types.js";
|
|
29
|
+
|
|
30
|
+
export type AgentConnectorsSetupWhatsAppAppWebhookMutationVariables = {
|
|
31
|
+
request: operations.SetupWhatsAppAppWebhookRequest;
|
|
32
|
+
options?: RequestOptions;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type AgentConnectorsSetupWhatsAppAppWebhookMutationData =
|
|
36
|
+
operations.SetupWhatsAppAppWebhookResponse;
|
|
37
|
+
|
|
38
|
+
export type AgentConnectorsSetupWhatsAppAppWebhookMutationError =
|
|
39
|
+
| errors.ErrorEnvelope
|
|
40
|
+
| SDKError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Set up a WhatsApp app webhook (Beta)
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Beta. Returns the app-level callback URL and verification token that must be saved in Meta before the first WhatsApp phone connector is created. The caller must be allowed to manage the agent. The stable verification token is returned only in this no-store response and is not a Meta access token.
|
|
54
|
+
*/
|
|
55
|
+
export function useAgentConnectorsSetupWhatsAppAppWebhookMutation(
|
|
56
|
+
options?: MutationHookOptions<
|
|
57
|
+
AgentConnectorsSetupWhatsAppAppWebhookMutationData,
|
|
58
|
+
AgentConnectorsSetupWhatsAppAppWebhookMutationError,
|
|
59
|
+
AgentConnectorsSetupWhatsAppAppWebhookMutationVariables
|
|
60
|
+
>,
|
|
61
|
+
): UseMutationResult<
|
|
62
|
+
AgentConnectorsSetupWhatsAppAppWebhookMutationData,
|
|
63
|
+
AgentConnectorsSetupWhatsAppAppWebhookMutationError,
|
|
64
|
+
AgentConnectorsSetupWhatsAppAppWebhookMutationVariables
|
|
65
|
+
> {
|
|
66
|
+
const client = useSDKContext();
|
|
67
|
+
return useMutation({
|
|
68
|
+
...buildAgentConnectorsSetupWhatsAppAppWebhookMutation(client, options),
|
|
69
|
+
...options,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function mutationKeyAgentConnectorsSetupWhatsAppAppWebhook(): MutationKey {
|
|
74
|
+
return ["@meetkai/mka1", "Agent Connectors", "setupWhatsAppAppWebhook"];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function buildAgentConnectorsSetupWhatsAppAppWebhookMutation(
|
|
78
|
+
client$: SDKCore,
|
|
79
|
+
hookOptions?: RequestOptions,
|
|
80
|
+
): {
|
|
81
|
+
mutationKey: MutationKey;
|
|
82
|
+
mutationFn: (
|
|
83
|
+
variables: AgentConnectorsSetupWhatsAppAppWebhookMutationVariables,
|
|
84
|
+
) => Promise<AgentConnectorsSetupWhatsAppAppWebhookMutationData>;
|
|
85
|
+
} {
|
|
86
|
+
return {
|
|
87
|
+
mutationKey: mutationKeyAgentConnectorsSetupWhatsAppAppWebhook(),
|
|
88
|
+
mutationFn: function agentConnectorsSetupWhatsAppAppWebhookMutationFn({
|
|
89
|
+
request,
|
|
90
|
+
options,
|
|
91
|
+
}): Promise<AgentConnectorsSetupWhatsAppAppWebhookMutationData> {
|
|
92
|
+
const mergedOptions = {
|
|
93
|
+
...hookOptions,
|
|
94
|
+
...options,
|
|
95
|
+
fetchOptions: {
|
|
96
|
+
...hookOptions?.fetchOptions,
|
|
97
|
+
...options?.fetchOptions,
|
|
98
|
+
signal: combineSignals(
|
|
99
|
+
hookOptions?.fetchOptions?.signal,
|
|
100
|
+
options?.fetchOptions?.signal,
|
|
101
|
+
),
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
return unwrapAsync(agentConnectorsSetupWhatsAppAppWebhook(
|
|
105
|
+
client$,
|
|
106
|
+
request,
|
|
107
|
+
mergedOptions,
|
|
108
|
+
));
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
package/src/react-query/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./agentConnectorsCreateAgentConnector.js";
|
|
|
10
10
|
export * from "./agentConnectorsDeleteAgentConnector.js";
|
|
11
11
|
export * from "./agentConnectorsGetAgentConnector.js";
|
|
12
12
|
export * from "./agentConnectorsListAgentConnectors.js";
|
|
13
|
+
export * from "./agentConnectorsSetupWhatsAppAppWebhook.js";
|
|
13
14
|
export * from "./agentRunsCreateAgentRun.js";
|
|
14
15
|
export * from "./agentRunsGetAgentRun.js";
|
|
15
16
|
export * from "./agentRunsListAgentRuns.js";
|
|
@@ -7,6 +7,7 @@ import { agentConnectorsCreateAgentConnector } from "../funcs/agentConnectorsCre
|
|
|
7
7
|
import { agentConnectorsDeleteAgentConnector } from "../funcs/agentConnectorsDeleteAgentConnector.js";
|
|
8
8
|
import { agentConnectorsGetAgentConnector } from "../funcs/agentConnectorsGetAgentConnector.js";
|
|
9
9
|
import { agentConnectorsListAgentConnectors } from "../funcs/agentConnectorsListAgentConnectors.js";
|
|
10
|
+
import { agentConnectorsSetupWhatsAppAppWebhook } from "../funcs/agentConnectorsSetupWhatsAppAppWebhook.js";
|
|
10
11
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
11
12
|
import * as components from "../models/components/index.js";
|
|
12
13
|
import * as operations from "../models/operations/index.js";
|
|
@@ -34,7 +35,7 @@ export class AgentConnectors extends ClientSDK {
|
|
|
34
35
|
* Create a connector
|
|
35
36
|
*
|
|
36
37
|
* @remarks
|
|
37
|
-
* Connects the agent to a Telegram bot or WhatsApp Business phone number, validates the provider credentials, and registers the agent's webhook. Text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which provider users or chats may invoke the agent.
|
|
38
|
+
* Connects the agent to a Telegram bot or WhatsApp Business phone number, validates the provider credentials, and registers the agent's webhook. WhatsApp connector support is beta. Text, photos, and gateway-supported documents can invoke the agent; inbound media additionally requires write:files. Managed outbound files require read:files, and generated images require both file scopes so their transient provider URLs can be materialized before delivery. The optional write:feedback scope enables native thumbs reaction synchronization to gateway response feedback. These conditional scopes are deliberately not part of x-required-scopes because text-only connectors do not need them. An API key with every listed scope is required; its identity tuple and current scopes are stored as a non-widening ceiling, then revalidated with mk-authentication before every connector run; session and delegated end-user contexts are rejected. The required access policy controls which provider users or chats may invoke the agent.
|
|
38
39
|
*/
|
|
39
40
|
async createAgentConnector(
|
|
40
41
|
request: operations.CreateAgentConnectorRequest,
|
|
@@ -47,6 +48,23 @@ export class AgentConnectors extends ClientSDK {
|
|
|
47
48
|
));
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Set up a WhatsApp app webhook (Beta)
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* Beta. Returns the app-level callback URL and verification token that must be saved in Meta before the first WhatsApp phone connector is created. The caller must be allowed to manage the agent. The stable verification token is returned only in this no-store response and is not a Meta access token.
|
|
56
|
+
*/
|
|
57
|
+
async setupWhatsAppAppWebhook(
|
|
58
|
+
request: operations.SetupWhatsAppAppWebhookRequest,
|
|
59
|
+
options?: RequestOptions,
|
|
60
|
+
): Promise<operations.SetupWhatsAppAppWebhookResponse> {
|
|
61
|
+
return unwrapAsync(agentConnectorsSetupWhatsAppAppWebhook(
|
|
62
|
+
this,
|
|
63
|
+
request,
|
|
64
|
+
options,
|
|
65
|
+
));
|
|
66
|
+
}
|
|
67
|
+
|
|
50
68
|
/**
|
|
51
69
|
* Retrieve a connector
|
|
52
70
|
*
|