@a2a-js/sdk 0.3.12 → 0.3.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.
@@ -1013,6 +1013,28 @@ var SendMessageRequest = {
1013
1013
  return obj;
1014
1014
  }
1015
1015
  };
1016
+ var CreateTaskPushNotificationConfigRequest = {
1017
+ fromJSON(object) {
1018
+ return {
1019
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
1020
+ configId: isSet(object.configId) ? globalThis.String(object.configId) : isSet(object.config_id) ? globalThis.String(object.config_id) : "",
1021
+ config: isSet(object.config) ? TaskPushNotificationConfig.fromJSON(object.config) : void 0
1022
+ };
1023
+ },
1024
+ toJSON(message) {
1025
+ const obj = {};
1026
+ if (message.parent !== "") {
1027
+ obj.parent = message.parent;
1028
+ }
1029
+ if (message.configId !== "") {
1030
+ obj.configId = message.configId;
1031
+ }
1032
+ if (message.config !== void 0) {
1033
+ obj.config = TaskPushNotificationConfig.toJSON(message.config);
1034
+ }
1035
+ return obj;
1036
+ }
1037
+ };
1016
1038
  var SendMessageResponse = {
1017
1039
  fromJSON(object) {
1018
1040
  return {
@@ -1978,6 +2000,7 @@ export {
1978
2000
  AgentCard,
1979
2001
  TaskPushNotificationConfig,
1980
2002
  SendMessageRequest,
2003
+ CreateTaskPushNotificationConfigRequest,
1981
2004
  SendMessageResponse,
1982
2005
  StreamResponse,
1983
2006
  ListTaskPushNotificationConfigResponse,
@@ -28,7 +28,7 @@ import {
28
28
  Task,
29
29
  TaskPushNotificationConfig,
30
30
  ToProto
31
- } from "../chunk-2TNRJNPO.js";
31
+ } from "../chunk-5ONEQMOQ.js";
32
32
  import "../chunk-UHZEIZLS.js";
33
33
 
34
34
  // src/client/transports/json_rpc_transport.ts
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  FromProto,
13
13
  ToProto
14
- } from "../../../chunk-2TNRJNPO.js";
14
+ } from "../../../chunk-5ONEQMOQ.js";
15
15
  import "../../../chunk-UHZEIZLS.js";
16
16
 
17
17
  // src/client/transports/grpc/grpc_transport.ts
@@ -1714,6 +1714,28 @@ var SendMessageRequest = {
1714
1714
  return obj;
1715
1715
  }
1716
1716
  };
1717
+ var CreateTaskPushNotificationConfigRequest = {
1718
+ fromJSON(object) {
1719
+ return {
1720
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
1721
+ configId: isSet(object.configId) ? globalThis.String(object.configId) : isSet(object.config_id) ? globalThis.String(object.config_id) : "",
1722
+ config: isSet(object.config) ? TaskPushNotificationConfig.fromJSON(object.config) : void 0
1723
+ };
1724
+ },
1725
+ toJSON(message) {
1726
+ const obj = {};
1727
+ if (message.parent !== "") {
1728
+ obj.parent = message.parent;
1729
+ }
1730
+ if (message.configId !== "") {
1731
+ obj.configId = message.configId;
1732
+ }
1733
+ if (message.config !== void 0) {
1734
+ obj.config = TaskPushNotificationConfig.toJSON(message.config);
1735
+ }
1736
+ return obj;
1737
+ }
1738
+ };
1717
1739
  var SendMessageResponse = {
1718
1740
  fromJSON(object) {
1719
1741
  return {
@@ -2842,12 +2864,9 @@ function restHandler(options) {
2842
2864
  "/v1/tasks/:taskId/pushNotificationConfigs",
2843
2865
  asyncHandler(async (req, res) => {
2844
2866
  const context = await buildContext(req);
2845
- const config = {
2846
- ...req.body,
2847
- taskId: req.params.taskId,
2848
- task_id: req.params.taskId
2849
- };
2850
- const result = await restTransportHandler.setTaskPushNotificationConfig(config, context);
2867
+ const protoReq = CreateTaskPushNotificationConfigRequest.fromJSON(req.body);
2868
+ const params = FromProto.createTaskPushNotificationConfig(protoReq);
2869
+ const result = await restTransportHandler.setTaskPushNotificationConfig(params, context);
2851
2870
  const protoResult = ToProto.taskPushNotificationConfig(result);
2852
2871
  sendResponse(
2853
2872
  res,
@@ -22,6 +22,7 @@ import {
22
22
  } from "../../chunk-EGOOH5HP.js";
23
23
  import {
24
24
  AgentCard,
25
+ CreateTaskPushNotificationConfigRequest,
25
26
  FromProto,
26
27
  ListTaskPushNotificationConfigResponse,
27
28
  SendMessageRequest,
@@ -30,7 +31,7 @@ import {
30
31
  Task,
31
32
  TaskPushNotificationConfig,
32
33
  ToProto
33
- } from "../../chunk-2TNRJNPO.js";
34
+ } from "../../chunk-5ONEQMOQ.js";
34
35
  import {
35
36
  A2AError
36
37
  } from "../../chunk-UHZEIZLS.js";
@@ -541,12 +542,9 @@ function restHandler(options) {
541
542
  "/v1/tasks/:taskId/pushNotificationConfigs",
542
543
  asyncHandler(async (req, res) => {
543
544
  const context = await buildContext(req);
544
- const config = {
545
- ...req.body,
546
- taskId: req.params.taskId,
547
- task_id: req.params.taskId
548
- };
549
- const result = await restTransportHandler.setTaskPushNotificationConfig(config, context);
545
+ const protoReq = CreateTaskPushNotificationConfigRequest.fromJSON(req.body);
546
+ const params = FromProto.createTaskPushNotificationConfig(protoReq);
547
+ const result = await restTransportHandler.setTaskPushNotificationConfig(params, context);
550
548
  const protoResult = ToProto.taskPushNotificationConfig(result);
551
549
  sendResponse(
552
550
  res,
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  FromProto,
16
16
  ToProto
17
- } from "../../chunk-2TNRJNPO.js";
17
+ } from "../../chunk-5ONEQMOQ.js";
18
18
  import {
19
19
  A2AError
20
20
  } from "../../chunk-UHZEIZLS.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a2a-js/sdk",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "Server & Client SDK for Agent2Agent protocol",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {