@meetkai/mka1 0.49.12 → 0.49.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +230 -227
  2. package/bin/mcp-server.js +2666 -2433
  3. package/bin/mcp-server.js.map +13 -8
  4. package/dist/commonjs/funcs/agentConnectorsSetupWhatsAppAppWebhook.d.ts +18 -0
  5. package/dist/commonjs/funcs/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/agentConnectorsSetupWhatsAppAppWebhook.js +141 -0
  7. package/dist/commonjs/funcs/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
  8. package/dist/commonjs/lib/config.d.ts +2 -2
  9. package/dist/commonjs/lib/config.js +2 -2
  10. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  11. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  12. package/dist/commonjs/mcp-server/server.js +3 -1
  13. package/dist/commonjs/mcp-server/server.js.map +1 -1
  14. package/dist/commonjs/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.d.ts +8 -0
  15. package/dist/commonjs/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
  16. package/dist/commonjs/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.js +64 -0
  17. package/dist/commonjs/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
  18. package/dist/commonjs/models/components/index.d.ts +2 -0
  19. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/index.js +2 -0
  21. package/dist/commonjs/models/components/index.js.map +1 -1
  22. package/dist/commonjs/models/components/whatsappwebhooksetup.d.ts +35 -0
  23. package/dist/commonjs/models/components/whatsappwebhooksetup.d.ts.map +1 -0
  24. package/dist/commonjs/models/components/whatsappwebhooksetup.js +84 -0
  25. package/dist/commonjs/models/components/whatsappwebhooksetup.js.map +1 -0
  26. package/dist/commonjs/models/components/whatsappwebhooksetuprequest.d.ts +17 -0
  27. package/dist/commonjs/models/components/whatsappwebhooksetuprequest.d.ts.map +1 -0
  28. package/dist/commonjs/models/components/whatsappwebhooksetuprequest.js +67 -0
  29. package/dist/commonjs/models/components/whatsappwebhooksetuprequest.js.map +1 -0
  30. package/dist/commonjs/models/operations/index.d.ts +1 -0
  31. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  32. package/dist/commonjs/models/operations/index.js +1 -0
  33. package/dist/commonjs/models/operations/index.js.map +1 -1
  34. package/dist/commonjs/models/operations/setupwhatsappappwebhook.d.ts +47 -0
  35. package/dist/commonjs/models/operations/setupwhatsappappwebhook.d.ts.map +1 -0
  36. package/dist/commonjs/models/operations/setupwhatsappappwebhook.js +102 -0
  37. package/dist/commonjs/models/operations/setupwhatsappappwebhook.js.map +1 -0
  38. package/dist/commonjs/react-query/agentConnectorsSetupWhatsAppAppWebhook.d.ts +29 -0
  39. package/dist/commonjs/react-query/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
  40. package/dist/commonjs/react-query/agentConnectorsSetupWhatsAppAppWebhook.js +47 -0
  41. package/dist/commonjs/react-query/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
  42. package/dist/commonjs/react-query/index.d.ts +1 -0
  43. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  44. package/dist/commonjs/react-query/index.js +1 -0
  45. package/dist/commonjs/react-query/index.js.map +1 -1
  46. package/dist/commonjs/sdk/agentconnectors.d.ts +7 -0
  47. package/dist/commonjs/sdk/agentconnectors.d.ts.map +1 -1
  48. package/dist/commonjs/sdk/agentconnectors.js +10 -0
  49. package/dist/commonjs/sdk/agentconnectors.js.map +1 -1
  50. package/dist/esm/funcs/agentConnectorsSetupWhatsAppAppWebhook.d.ts +18 -0
  51. package/dist/esm/funcs/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
  52. package/dist/esm/funcs/agentConnectorsSetupWhatsAppAppWebhook.js +105 -0
  53. package/dist/esm/funcs/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
  54. package/dist/esm/lib/config.d.ts +2 -2
  55. package/dist/esm/lib/config.js +2 -2
  56. package/dist/esm/mcp-server/mcp-server.js +1 -1
  57. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  58. package/dist/esm/mcp-server/server.js +3 -1
  59. package/dist/esm/mcp-server/server.js.map +1 -1
  60. package/dist/esm/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.d.ts +8 -0
  61. package/dist/esm/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
  62. package/dist/esm/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.js +28 -0
  63. package/dist/esm/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
  64. package/dist/esm/models/components/index.d.ts +2 -0
  65. package/dist/esm/models/components/index.d.ts.map +1 -1
  66. package/dist/esm/models/components/index.js +2 -0
  67. package/dist/esm/models/components/index.js.map +1 -1
  68. package/dist/esm/models/components/whatsappwebhooksetup.d.ts +35 -0
  69. package/dist/esm/models/components/whatsappwebhooksetup.d.ts.map +1 -0
  70. package/dist/esm/models/components/whatsappwebhooksetup.js +46 -0
  71. package/dist/esm/models/components/whatsappwebhooksetup.js.map +1 -0
  72. package/dist/esm/models/components/whatsappwebhooksetuprequest.d.ts +17 -0
  73. package/dist/esm/models/components/whatsappwebhooksetuprequest.d.ts.map +1 -0
  74. package/dist/esm/models/components/whatsappwebhooksetuprequest.js +29 -0
  75. package/dist/esm/models/components/whatsappwebhooksetuprequest.js.map +1 -0
  76. package/dist/esm/models/operations/index.d.ts +1 -0
  77. package/dist/esm/models/operations/index.d.ts.map +1 -1
  78. package/dist/esm/models/operations/index.js +1 -0
  79. package/dist/esm/models/operations/index.js.map +1 -1
  80. package/dist/esm/models/operations/setupwhatsappappwebhook.d.ts +47 -0
  81. package/dist/esm/models/operations/setupwhatsappappwebhook.d.ts.map +1 -0
  82. package/dist/esm/models/operations/setupwhatsappappwebhook.js +62 -0
  83. package/dist/esm/models/operations/setupwhatsappappwebhook.js.map +1 -0
  84. package/dist/esm/react-query/agentConnectorsSetupWhatsAppAppWebhook.d.ts +29 -0
  85. package/dist/esm/react-query/agentConnectorsSetupWhatsAppAppWebhook.d.ts.map +1 -0
  86. package/dist/esm/react-query/agentConnectorsSetupWhatsAppAppWebhook.js +42 -0
  87. package/dist/esm/react-query/agentConnectorsSetupWhatsAppAppWebhook.js.map +1 -0
  88. package/dist/esm/react-query/index.d.ts +1 -0
  89. package/dist/esm/react-query/index.d.ts.map +1 -1
  90. package/dist/esm/react-query/index.js +1 -0
  91. package/dist/esm/react-query/index.js.map +1 -1
  92. package/dist/esm/sdk/agentconnectors.d.ts +7 -0
  93. package/dist/esm/sdk/agentconnectors.d.ts.map +1 -1
  94. package/dist/esm/sdk/agentconnectors.js +10 -0
  95. package/dist/esm/sdk/agentconnectors.js.map +1 -1
  96. package/jsr.json +1 -1
  97. package/package.json +1 -1
  98. package/src/funcs/agentConnectorsSetupWhatsAppAppWebhook.ts +201 -0
  99. package/src/lib/config.ts +2 -2
  100. package/src/mcp-server/mcp-server.ts +1 -1
  101. package/src/mcp-server/server.ts +3 -1
  102. package/src/mcp-server/tools/agentConnectorsSetupWhatsAppAppWebhook.ts +39 -0
  103. package/src/models/components/index.ts +2 -0
  104. package/src/models/components/whatsappwebhooksetup.ts +96 -0
  105. package/src/models/components/whatsappwebhooksetuprequest.ts +62 -0
  106. package/src/models/operations/index.ts +1 -0
  107. package/src/models/operations/setupwhatsappappwebhook.ts +140 -0
  108. package/src/react-query/agentConnectorsSetupWhatsAppAppWebhook.ts +111 -0
  109. package/src/react-query/index.ts +1 -0
  110. package/src/sdk/agentconnectors.ts +18 -0
@@ -0,0 +1,201 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SDKCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.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 { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Set up a WhatsApp app webhook
31
+ *
32
+ * @remarks
33
+ * 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.
34
+ */
35
+ export function agentConnectorsSetupWhatsAppAppWebhook(
36
+ client: SDKCore,
37
+ request: operations.SetupWhatsAppAppWebhookRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.SetupWhatsAppAppWebhookResponse,
42
+ | errors.ErrorEnvelope
43
+ | SDKError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: SDKCore,
62
+ request: operations.SetupWhatsAppAppWebhookRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ operations.SetupWhatsAppAppWebhookResponse,
68
+ | errors.ErrorEnvelope
69
+ | SDKError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const parsed = safeParse(
82
+ request,
83
+ (value) =>
84
+ operations.SetupWhatsAppAppWebhookRequest$outboundSchema.parse(value),
85
+ "Input validation failed",
86
+ );
87
+ if (!parsed.ok) {
88
+ return [parsed, { status: "invalid" }];
89
+ }
90
+ const payload = parsed.value;
91
+ const body = encodeJSON("body", payload.WhatsAppWebhookSetupRequest, {
92
+ explode: true,
93
+ });
94
+
95
+ const pathParams = {
96
+ id: encodeSimple("id", payload.id, {
97
+ explode: false,
98
+ charEncoding: "percent",
99
+ }),
100
+ };
101
+ const path = pathToFunc("/api/v1/agents/{id}/connectors/whatsapp/setup")(
102
+ pathParams,
103
+ );
104
+
105
+ const headers = new Headers(compactMap({
106
+ "Content-Type": "application/json",
107
+ Accept: "application/json",
108
+ "X-On-Behalf-Of": encodeSimple(
109
+ "X-On-Behalf-Of",
110
+ payload["X-On-Behalf-Of"],
111
+ { explode: false, charEncoding: "none" },
112
+ ),
113
+ }));
114
+
115
+ const secConfig = await extractSecurity(client._options.bearerAuth);
116
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
117
+ const requestSecurity = resolveGlobalSecurity(securityInput);
118
+
119
+ const context = {
120
+ options: client._options,
121
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
122
+ operationID: "setupWhatsAppAppWebhook",
123
+ oAuth2Scopes: null,
124
+
125
+ resolvedSecurity: requestSecurity,
126
+
127
+ securitySource: client._options.bearerAuth,
128
+ retryConfig: options?.retries
129
+ || client._options.retryConfig
130
+ || {
131
+ strategy: "backoff",
132
+ backoff: {
133
+ initialInterval: 500,
134
+ maxInterval: 5000,
135
+ exponent: 1.5,
136
+ maxElapsedTime: 15000,
137
+ },
138
+ retryConnectionErrors: true,
139
+ }
140
+ || { strategy: "none" },
141
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
142
+ };
143
+
144
+ const requestRes = client._createRequest(context, {
145
+ security: requestSecurity,
146
+ method: "POST",
147
+ baseURL: options?.serverURL,
148
+ path: path,
149
+ headers: headers,
150
+ body: body,
151
+ userAgent: client._options.userAgent,
152
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
153
+ }, options);
154
+ if (!requestRes.ok) {
155
+ return [requestRes, { status: "invalid" }];
156
+ }
157
+ const req = requestRes.value;
158
+
159
+ const doResult = await client._do(req, {
160
+ context,
161
+ isErrorStatusCode: (statusCode: number) =>
162
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
163
+ retryConfig: context.retryConfig,
164
+ retryCodes: context.retryCodes,
165
+ });
166
+ if (!doResult.ok) {
167
+ return [doResult, { status: "request-error", request: req }];
168
+ }
169
+ const response = doResult.value;
170
+
171
+ const responseFields = {
172
+ HttpMeta: { Response: response, Request: req },
173
+ };
174
+
175
+ const [result] = await M.match<
176
+ operations.SetupWhatsAppAppWebhookResponse,
177
+ | errors.ErrorEnvelope
178
+ | SDKError
179
+ | ResponseValidationError
180
+ | ConnectionError
181
+ | RequestAbortedError
182
+ | RequestTimeoutError
183
+ | InvalidRequestError
184
+ | UnexpectedClientError
185
+ | SDKValidationError
186
+ >(
187
+ M.json(200, operations.SetupWhatsAppAppWebhookResponse$inboundSchema, {
188
+ hdrs: true,
189
+ key: "Result",
190
+ }),
191
+ M.jsonErr([400, 401, 403, 404], errors.ErrorEnvelope$inboundSchema),
192
+ M.jsonErr(503, errors.ErrorEnvelope$inboundSchema),
193
+ M.fail("4XX"),
194
+ M.fail("5XX"),
195
+ )(response, req, { extraFields: responseFields });
196
+ if (!result.ok) {
197
+ return [result, { status: "complete", request: req, response }];
198
+ }
199
+
200
+ return [result, { status: "complete", request: req, response }];
201
+ }
package/src/lib/config.ts CHANGED
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "1.1.0",
68
- sdkVersion: "0.49.12",
68
+ sdkVersion: "0.49.13",
69
69
  genVersion: "2.918.3",
70
- userAgent: "speakeasy-sdk/typescript 0.49.12 2.918.3 1.1.0 @meetkai/mka1",
70
+ userAgent: "speakeasy-sdk/typescript 0.49.13 2.918.3 1.1.0 @meetkai/mka1",
71
71
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.49.12",
22
+ currentVersion: "0.49.13",
23
23
  },
24
24
  });
25
25
 
@@ -18,6 +18,7 @@ import { tool$agentConnectorsCreateAgentConnector } from "./tools/agentConnector
18
18
  import { tool$agentConnectorsDeleteAgentConnector } from "./tools/agentConnectorsDeleteAgentConnector.js";
19
19
  import { tool$agentConnectorsGetAgentConnector } from "./tools/agentConnectorsGetAgentConnector.js";
20
20
  import { tool$agentConnectorsListAgentConnectors } from "./tools/agentConnectorsListAgentConnectors.js";
21
+ import { tool$agentConnectorsSetupWhatsAppAppWebhook } from "./tools/agentConnectorsSetupWhatsAppAppWebhook.js";
21
22
  import { tool$agentRunsCreateAgentRun } from "./tools/agentRunsCreateAgentRun.js";
22
23
  import { tool$agentRunsGetAgentRun } from "./tools/agentRunsGetAgentRun.js";
23
24
  import { tool$agentRunsListAgentRuns } from "./tools/agentRunsListAgentRuns.js";
@@ -345,7 +346,7 @@ export function createMCPServer(deps: {
345
346
  }) {
346
347
  const server = new McpServer({
347
348
  name: "SDK",
348
- version: "0.49.12",
349
+ version: "0.49.13",
349
350
  });
350
351
 
351
352
  const client = new SDKCore({
@@ -404,6 +405,7 @@ export function createMCPServer(deps: {
404
405
  tool(tool$agentsDeleteAgent);
405
406
  tool(tool$agentConnectorsListAgentConnectors);
406
407
  tool(tool$agentConnectorsCreateAgentConnector);
408
+ tool(tool$agentConnectorsSetupWhatsAppAppWebhook);
407
409
  tool(tool$agentConnectorsGetAgentConnector);
408
410
  tool(tool$agentConnectorsDeleteAgentConnector);
409
411
  tool(tool$agentConnectorsActivateAgentConnector);
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { agentConnectorsSetupWhatsAppAppWebhook } from "../../funcs/agentConnectorsSetupWhatsAppAppWebhook.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.SetupWhatsAppAppWebhookRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$agentConnectorsSetupWhatsAppAppWebhook: ToolDefinition<
14
+ typeof args
15
+ > = {
16
+ name: "agent-connectors-setup-whats-app-app-webhook",
17
+ description: `Set up a WhatsApp app webhook
18
+
19
+ 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.`,
20
+ args,
21
+ tool: async (client, args, ctx) => {
22
+ const [result, apiCall] = await agentConnectorsSetupWhatsAppAppWebhook(
23
+ client,
24
+ args.request,
25
+ { fetchOptions: { signal: ctx.signal } },
26
+ ).$inspect();
27
+
28
+ if (!result.ok) {
29
+ return {
30
+ content: [{ type: "text", text: result.error.message }],
31
+ isError: true,
32
+ };
33
+ }
34
+
35
+ const value = result.value.result;
36
+
37
+ return formatResult(value, apiCall);
38
+ },
39
+ };
@@ -550,6 +550,8 @@ export * from "./websearchpreviewtooldefinition.js";
550
550
  export * from "./websearchtoolcall.js";
551
551
  export * from "./websearchtoolcallwithid.js";
552
552
  export * from "./websearchtooldefinition.js";
553
+ export * from "./whatsappwebhooksetup.js";
554
+ export * from "./whatsappwebhooksetuprequest.js";
553
555
  export * from "./workspacearchiverequest.js";
554
556
  export * from "./workspacefile.js";
555
557
  export * from "./workspacemanifest.js";
@@ -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
+ }