mavenagi 1.0.12 → 1.1.0
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/Client.d.ts +3 -4
- package/Client.js +51 -12
- package/README.md +15 -2
- package/api/resources/actions/client/Client.d.ts +9 -4
- package/api/resources/actions/client/Client.js +68 -39
- package/api/resources/agents/client/Client.d.ts +9 -4
- package/api/resources/agents/client/Client.js +76 -44
- package/api/resources/analytics/client/Client.d.ts +9 -4
- package/api/resources/analytics/client/Client.js +76 -40
- package/api/resources/analytics/types/ConversationTableResponse.d.ts +3 -3
- package/api/resources/appSettings/client/Client.d.ts +9 -4
- package/api/resources/appSettings/client/Client.js +76 -44
- package/api/resources/appSettings/client/index.d.ts +1 -0
- package/api/resources/commons/errors/BadRequestError.d.ts +2 -1
- package/api/resources/commons/errors/BadRequestError.js +2 -1
- package/api/resources/commons/errors/NotFoundError.d.ts +2 -1
- package/api/resources/commons/errors/NotFoundError.js +2 -1
- package/api/resources/commons/errors/ServerError.d.ts +2 -1
- package/api/resources/commons/errors/ServerError.js +2 -1
- package/api/resources/commons/types/ActionParameter.d.ts +1 -1
- package/api/resources/commons/types/ActionParameterType.d.ts +13 -1
- package/api/resources/commons/types/AppUserRequest.d.ts +2 -2
- package/api/resources/commons/types/AppUserResponse.d.ts +2 -2
- package/api/resources/commons/types/BotObjectResponse.d.ts +12 -0
- package/api/resources/commons/types/BotResponse.d.ts +4 -1
- package/api/resources/commons/types/ConversationResponse.d.ts +2 -1
- package/api/resources/commons/types/InboxItemFixType.d.ts +14 -0
- package/{dist/api/resources/realtime/types/AudioFormat.js → api/resources/commons/types/InboxItemFixType.js} +4 -4
- package/api/resources/commons/types/NumberRange.d.ts +12 -0
- package/api/resources/commons/types/UserMessageAttachment.d.ts +16 -0
- package/api/resources/commons/types/index.d.ts +3 -0
- package/api/resources/commons/types/index.js +3 -0
- package/api/resources/conversation/client/Client.d.ts +43 -28
- package/api/resources/conversation/client/Client.js +342 -185
- package/api/resources/conversation/client/index.d.ts +1 -0
- package/api/resources/conversation/types/Attachment.d.ts +18 -1
- package/api/resources/conversation/types/ConversationField.d.ts +2 -1
- package/api/resources/conversation/types/ConversationField.js +1 -0
- package/api/resources/conversation/types/ConversationFilter.d.ts +21 -0
- package/api/resources/conversation/types/ConversationMessageRequest.d.ts +2 -0
- package/api/resources/conversation/types/FeedbackField.d.ts +2 -1
- package/api/resources/conversation/types/FeedbackField.js +1 -0
- package/api/resources/conversation/types/FeedbackFilter.d.ts +2 -0
- package/api/resources/events/client/Client.d.ts +5 -2
- package/api/resources/events/client/Client.js +26 -16
- package/api/resources/inbox/client/Client.d.ts +21 -10
- package/api/resources/inbox/client/Client.js +126 -67
- package/api/resources/inbox/client/index.d.ts +1 -0
- package/api/resources/inbox/client/requests/InboxItemFixRequest.d.ts +7 -1
- package/api/resources/inbox/client/requests/InboxItemIgnoreRequest.d.ts +7 -1
- package/api/resources/inbox/client/requests/InboxItemRequest.d.ts +7 -1
- package/api/resources/inbox/types/ApplyInboxItemFixRequest.d.ts +2 -0
- package/api/resources/inbox/types/InboxSearchRequest.d.ts +4 -0
- package/api/resources/index.d.ts +0 -2
- package/api/resources/index.js +1 -3
- package/api/resources/knowledge/client/Client.d.ts +17 -8
- package/api/resources/knowledge/client/Client.js +168 -87
- package/api/resources/organizations/client/Client.d.ts +7 -3
- package/api/resources/organizations/client/Client.js +51 -28
- package/api/resources/translations/client/Client.d.ts +5 -2
- package/api/resources/translations/client/Client.js +26 -16
- package/api/resources/triggers/client/Client.d.ts +13 -6
- package/api/resources/triggers/client/Client.js +118 -63
- package/api/resources/triggers/client/index.d.ts +1 -0
- package/api/resources/users/client/Client.d.ts +11 -6
- package/api/resources/users/client/Client.js +72 -43
- package/api/resources/users/client/index.d.ts +1 -0
- package/core/auth/BasicAuth.js +3 -3
- package/core/base64.d.ts +2 -0
- package/core/base64.js +26 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/BinaryResponse.d.ts +20 -0
- package/core/fetcher/BinaryResponse.js +17 -0
- package/core/fetcher/Fetcher.d.ts +3 -2
- package/core/fetcher/Fetcher.js +32 -12
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/core/fetcher/ResponseWithBody.js +6 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/createRequestUrl.js +3 -7
- package/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/core/fetcher/getErrorResponseBody.js +44 -0
- package/core/fetcher/getFetchFn.d.ts +1 -4
- package/core/fetcher/getFetchFn.js +1 -52
- package/core/fetcher/getResponseBody.js +34 -33
- package/core/fetcher/index.d.ts +4 -0
- package/core/fetcher/index.js +7 -1
- package/core/headers.d.ts +3 -0
- package/core/headers.js +29 -0
- package/core/index.d.ts +3 -2
- package/core/index.js +4 -3
- package/core/runtime/runtime.js +0 -1
- package/core/{streaming-fetcher → stream}/Stream.d.ts +1 -2
- package/core/url/index.d.ts +2 -0
- package/core/url/index.js +7 -0
- package/core/url/join.d.ts +1 -0
- package/core/url/join.js +49 -0
- package/core/url/qs.d.ts +6 -0
- package/core/url/qs.js +64 -0
- package/dist/Client.d.ts +3 -4
- package/dist/Client.js +51 -12
- package/dist/api/resources/actions/client/Client.d.ts +9 -4
- package/dist/api/resources/actions/client/Client.js +68 -39
- package/dist/api/resources/agents/client/Client.d.ts +9 -4
- package/dist/api/resources/agents/client/Client.js +76 -44
- package/dist/api/resources/analytics/client/Client.d.ts +9 -4
- package/dist/api/resources/analytics/client/Client.js +76 -40
- package/dist/api/resources/analytics/types/ConversationTableResponse.d.ts +3 -3
- package/dist/api/resources/appSettings/client/Client.d.ts +9 -4
- package/dist/api/resources/appSettings/client/Client.js +76 -44
- package/dist/api/resources/appSettings/client/index.d.ts +1 -0
- package/dist/api/resources/commons/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/commons/errors/BadRequestError.js +2 -1
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +2 -1
- package/dist/api/resources/commons/errors/NotFoundError.js +2 -1
- package/dist/api/resources/commons/errors/ServerError.d.ts +2 -1
- package/dist/api/resources/commons/errors/ServerError.js +2 -1
- package/dist/api/resources/commons/types/ActionParameter.d.ts +1 -1
- package/dist/api/resources/commons/types/ActionParameterType.d.ts +13 -1
- package/dist/api/resources/commons/types/AppUserRequest.d.ts +2 -2
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +2 -2
- package/dist/api/resources/commons/types/BotObjectResponse.d.ts +12 -0
- package/dist/api/resources/commons/types/BotResponse.d.ts +4 -1
- package/dist/api/resources/commons/types/ConversationResponse.d.ts +2 -1
- package/dist/api/resources/commons/types/InboxItemFixType.d.ts +14 -0
- package/{api/resources/realtime/types/AudioFormat.js → dist/api/resources/commons/types/InboxItemFixType.js} +4 -4
- package/dist/api/resources/commons/types/NumberRange.d.ts +12 -0
- package/dist/api/resources/commons/types/UserMessageAttachment.d.ts +16 -0
- package/dist/api/resources/commons/types/index.d.ts +3 -0
- package/dist/api/resources/commons/types/index.js +3 -0
- package/dist/api/resources/conversation/client/Client.d.ts +43 -28
- package/dist/api/resources/conversation/client/Client.js +342 -185
- package/dist/api/resources/conversation/client/index.d.ts +1 -0
- package/dist/api/resources/conversation/types/Attachment.d.ts +18 -1
- package/dist/api/resources/conversation/types/ConversationField.d.ts +2 -1
- package/dist/api/resources/conversation/types/ConversationField.js +1 -0
- package/dist/api/resources/conversation/types/ConversationFilter.d.ts +21 -0
- package/dist/api/resources/conversation/types/ConversationMessageRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/FeedbackField.d.ts +2 -1
- package/dist/api/resources/conversation/types/FeedbackField.js +1 -0
- package/dist/api/resources/conversation/types/FeedbackFilter.d.ts +2 -0
- package/dist/api/resources/events/client/Client.d.ts +5 -2
- package/dist/api/resources/events/client/Client.js +26 -16
- package/dist/api/resources/inbox/client/Client.d.ts +21 -10
- package/dist/api/resources/inbox/client/Client.js +126 -67
- package/dist/api/resources/inbox/client/index.d.ts +1 -0
- package/dist/api/resources/inbox/client/requests/InboxItemFixRequest.d.ts +7 -1
- package/dist/api/resources/inbox/client/requests/InboxItemIgnoreRequest.d.ts +7 -1
- package/dist/api/resources/inbox/client/requests/InboxItemRequest.d.ts +7 -1
- package/dist/api/resources/inbox/types/ApplyInboxItemFixRequest.d.ts +2 -0
- package/dist/api/resources/inbox/types/InboxSearchRequest.d.ts +4 -0
- package/dist/api/resources/index.d.ts +0 -2
- package/dist/api/resources/index.js +1 -3
- package/dist/api/resources/knowledge/client/Client.d.ts +17 -8
- package/dist/api/resources/knowledge/client/Client.js +168 -87
- package/dist/api/resources/organizations/client/Client.d.ts +7 -3
- package/dist/api/resources/organizations/client/Client.js +51 -28
- package/dist/api/resources/translations/client/Client.d.ts +5 -2
- package/dist/api/resources/translations/client/Client.js +26 -16
- package/dist/api/resources/triggers/client/Client.d.ts +13 -6
- package/dist/api/resources/triggers/client/Client.js +118 -63
- package/dist/api/resources/triggers/client/index.d.ts +1 -0
- package/dist/api/resources/users/client/Client.d.ts +11 -6
- package/dist/api/resources/users/client/Client.js +72 -43
- package/dist/api/resources/users/client/index.d.ts +1 -0
- package/dist/core/auth/BasicAuth.js +3 -3
- package/dist/core/base64.d.ts +2 -0
- package/dist/core/base64.js +26 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/BinaryResponse.d.ts +20 -0
- package/dist/core/fetcher/BinaryResponse.js +17 -0
- package/dist/core/fetcher/Fetcher.d.ts +3 -2
- package/dist/core/fetcher/Fetcher.js +32 -12
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/dist/core/fetcher/ResponseWithBody.js +6 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.js +3 -7
- package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getErrorResponseBody.js +44 -0
- package/dist/core/fetcher/getFetchFn.d.ts +1 -4
- package/dist/core/fetcher/getFetchFn.js +1 -52
- package/dist/core/fetcher/getResponseBody.js +34 -33
- package/dist/core/fetcher/index.d.ts +4 -0
- package/dist/core/fetcher/index.js +7 -1
- package/dist/core/headers.d.ts +3 -0
- package/dist/core/headers.js +29 -0
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.js +4 -3
- package/dist/core/runtime/runtime.js +0 -1
- package/dist/core/{streaming-fetcher → stream}/Stream.d.ts +1 -2
- package/dist/core/url/index.d.ts +2 -0
- package/dist/core/url/index.js +7 -0
- package/dist/core/url/join.d.ts +1 -0
- package/dist/core/url/join.js +49 -0
- package/dist/core/url/qs.d.ts +6 -0
- package/dist/core/url/qs.js +64 -0
- package/dist/errors/MavenAGIError.d.ts +4 -1
- package/dist/errors/MavenAGIError.js +4 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/serialization/resources/{realtime/types/AudioPublishEvent.d.ts → commons/types/BotObjectResponse.d.ts} +4 -3
- package/dist/serialization/resources/{realtime/types/AudioSubscribeEvent.js → commons/types/BotObjectResponse.js} +4 -3
- package/dist/serialization/resources/commons/types/BotResponse.d.ts +5 -1
- package/dist/serialization/resources/commons/types/BotResponse.js +2 -0
- package/dist/serialization/resources/commons/types/InboxItemFixType.d.ts +10 -0
- package/{serialization/resources/realtime/types/AudioFormat.js → dist/serialization/resources/commons/types/InboxItemFixType.js} +2 -2
- package/dist/serialization/resources/{realtime/types/MessageBase.d.ts → commons/types/NumberRange.d.ts} +4 -3
- package/dist/serialization/resources/{realtime/types/HangUpPublishEvent.js → commons/types/NumberRange.js} +4 -3
- package/dist/serialization/resources/commons/types/UserMessageAttachment.d.ts +2 -0
- package/dist/serialization/resources/commons/types/UserMessageAttachment.js +2 -0
- package/dist/serialization/resources/commons/types/index.d.ts +3 -0
- package/dist/serialization/resources/commons/types/index.js +3 -0
- package/dist/serialization/resources/conversation/types/Attachment.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/Attachment.js +1 -0
- package/dist/serialization/resources/conversation/types/ConversationField.d.ts +1 -1
- package/dist/serialization/resources/conversation/types/ConversationField.js +1 -0
- package/dist/serialization/resources/conversation/types/ConversationFilter.d.ts +3 -0
- package/dist/serialization/resources/conversation/types/ConversationFilter.js +3 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/FeedbackField.d.ts +1 -1
- package/dist/serialization/resources/conversation/types/FeedbackField.js +1 -1
- package/dist/serialization/resources/conversation/types/FeedbackFilter.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/FeedbackFilter.js +2 -0
- package/dist/serialization/resources/inbox/types/ApplyInboxItemFixRequest.d.ts +2 -0
- package/dist/serialization/resources/inbox/types/ApplyInboxItemFixRequest.js +2 -0
- package/dist/serialization/resources/inbox/types/InboxSearchRequest.d.ts +2 -0
- package/dist/serialization/resources/inbox/types/InboxSearchRequest.js +2 -0
- package/dist/serialization/resources/index.d.ts +0 -2
- package/dist/serialization/resources/index.js +1 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/errors/MavenAGIError.d.ts +4 -1
- package/errors/MavenAGIError.js +4 -7
- package/index.d.ts +2 -2
- package/index.js +5 -5
- package/jest.config.mjs +6 -1
- package/package.json +13 -21
- package/reference.md +16 -12
- package/scripts/rename-to-esm-files.js +10 -2
- package/{dist/serialization/resources/realtime/types/HangUpPublishEvent.d.ts → serialization/resources/commons/types/BotObjectResponse.d.ts} +4 -3
- package/{dist/serialization/resources/realtime/types/MessageBase.js → serialization/resources/commons/types/BotObjectResponse.js} +4 -3
- package/serialization/resources/commons/types/BotResponse.d.ts +5 -1
- package/serialization/resources/commons/types/BotResponse.js +2 -0
- package/serialization/resources/commons/types/InboxItemFixType.d.ts +10 -0
- package/{dist/serialization/resources/realtime/types/AudioFormat.js → serialization/resources/commons/types/InboxItemFixType.js} +2 -2
- package/{dist/serialization/resources/realtime/types/AudioSubscribeEvent.d.ts → serialization/resources/commons/types/NumberRange.d.ts} +4 -3
- package/{dist/serialization/resources/realtime/types/AudioPublishEvent.js → serialization/resources/commons/types/NumberRange.js} +4 -3
- package/serialization/resources/commons/types/UserMessageAttachment.d.ts +2 -0
- package/serialization/resources/commons/types/UserMessageAttachment.js +2 -0
- package/serialization/resources/commons/types/index.d.ts +3 -0
- package/serialization/resources/commons/types/index.js +3 -0
- package/serialization/resources/conversation/types/Attachment.d.ts +1 -0
- package/serialization/resources/conversation/types/Attachment.js +1 -0
- package/serialization/resources/conversation/types/ConversationField.d.ts +1 -1
- package/serialization/resources/conversation/types/ConversationField.js +1 -0
- package/serialization/resources/conversation/types/ConversationFilter.d.ts +3 -0
- package/serialization/resources/conversation/types/ConversationFilter.js +3 -0
- package/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationMessageRequest.js +2 -0
- package/serialization/resources/conversation/types/FeedbackField.d.ts +1 -1
- package/serialization/resources/conversation/types/FeedbackField.js +1 -1
- package/serialization/resources/conversation/types/FeedbackFilter.d.ts +2 -0
- package/serialization/resources/conversation/types/FeedbackFilter.js +2 -0
- package/serialization/resources/inbox/types/ApplyInboxItemFixRequest.d.ts +2 -0
- package/serialization/resources/inbox/types/ApplyInboxItemFixRequest.js +2 -0
- package/serialization/resources/inbox/types/InboxSearchRequest.d.ts +2 -0
- package/serialization/resources/inbox/types/InboxSearchRequest.js +2 -0
- package/serialization/resources/index.d.ts +0 -2
- package/serialization/resources/index.js +1 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/realtime/client/Client.d.ts +0 -36
- package/api/resources/realtime/client/Client.js +0 -90
- package/api/resources/realtime/client/Socket.d.ts +0 -41
- package/api/resources/realtime/client/Socket.js +0 -155
- package/api/resources/realtime/client/index.d.ts +0 -1
- package/api/resources/realtime/client/index.js +0 -2
- package/api/resources/realtime/index.d.ts +0 -2
- package/api/resources/realtime/index.js +0 -18
- package/api/resources/realtime/types/AudioFormat.d.ts +0 -8
- package/api/resources/realtime/types/AudioPublishEvent.d.ts +0 -6
- package/api/resources/realtime/types/AudioSubscribeEvent.d.ts +0 -6
- package/api/resources/realtime/types/ControlEvent.d.ts +0 -9
- package/api/resources/realtime/types/HangUpPublishEvent.d.ts +0 -6
- package/api/resources/realtime/types/MessageBase.d.ts +0 -6
- package/api/resources/realtime/types/MessageBase.js +0 -5
- package/api/resources/realtime/types/PublishEvent.d.ts +0 -16
- package/api/resources/realtime/types/PublishEvent.js +0 -5
- package/api/resources/realtime/types/SubscribeEvent.d.ts +0 -25
- package/api/resources/realtime/types/SubscribeEvent.js +0 -5
- package/api/resources/realtime/types/index.d.ts +0 -8
- package/api/resources/realtime/types/index.js +0 -24
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -247
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -126
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -229
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -59
- package/core/websocket/events.d.ts +0 -36
- package/core/websocket/events.js +0 -27
- package/core/websocket/index.d.ts +0 -1
- package/core/websocket/index.js +0 -17
- package/core/websocket/ws.d.ts +0 -137
- package/core/websocket/ws.js +0 -452
- package/dist/api/resources/realtime/client/Client.d.ts +0 -36
- package/dist/api/resources/realtime/client/Client.js +0 -90
- package/dist/api/resources/realtime/client/Socket.d.ts +0 -41
- package/dist/api/resources/realtime/client/Socket.js +0 -155
- package/dist/api/resources/realtime/client/index.d.ts +0 -1
- package/dist/api/resources/realtime/client/index.js +0 -2
- package/dist/api/resources/realtime/index.d.ts +0 -2
- package/dist/api/resources/realtime/index.js +0 -18
- package/dist/api/resources/realtime/types/AudioFormat.d.ts +0 -8
- package/dist/api/resources/realtime/types/AudioPublishEvent.d.ts +0 -6
- package/dist/api/resources/realtime/types/AudioPublishEvent.js +0 -5
- package/dist/api/resources/realtime/types/AudioSubscribeEvent.d.ts +0 -6
- package/dist/api/resources/realtime/types/AudioSubscribeEvent.js +0 -5
- package/dist/api/resources/realtime/types/ControlEvent.d.ts +0 -9
- package/dist/api/resources/realtime/types/ControlEvent.js +0 -5
- package/dist/api/resources/realtime/types/HangUpPublishEvent.d.ts +0 -6
- package/dist/api/resources/realtime/types/HangUpPublishEvent.js +0 -5
- package/dist/api/resources/realtime/types/MessageBase.d.ts +0 -6
- package/dist/api/resources/realtime/types/MessageBase.js +0 -5
- package/dist/api/resources/realtime/types/PublishEvent.d.ts +0 -16
- package/dist/api/resources/realtime/types/PublishEvent.js +0 -5
- package/dist/api/resources/realtime/types/SubscribeEvent.d.ts +0 -25
- package/dist/api/resources/realtime/types/SubscribeEvent.js +0 -5
- package/dist/api/resources/realtime/types/index.d.ts +0 -8
- package/dist/api/resources/realtime/types/index.js +0 -24
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -247
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -126
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -229
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -59
- package/dist/core/websocket/events.d.ts +0 -36
- package/dist/core/websocket/events.js +0 -27
- package/dist/core/websocket/index.d.ts +0 -1
- package/dist/core/websocket/index.js +0 -17
- package/dist/core/websocket/ws.d.ts +0 -137
- package/dist/core/websocket/ws.js +0 -452
- package/dist/serialization/resources/realtime/index.d.ts +0 -1
- package/dist/serialization/resources/realtime/index.js +0 -17
- package/dist/serialization/resources/realtime/types/AudioFormat.d.ts +0 -10
- package/dist/serialization/resources/realtime/types/ControlEvent.d.ts +0 -15
- package/dist/serialization/resources/realtime/types/ControlEvent.js +0 -48
- package/dist/serialization/resources/realtime/types/PublishEvent.d.ts +0 -18
- package/dist/serialization/resources/realtime/types/PublishEvent.js +0 -51
- package/dist/serialization/resources/realtime/types/SubscribeEvent.d.ts +0 -27
- package/dist/serialization/resources/realtime/types/SubscribeEvent.js +0 -54
- package/dist/serialization/resources/realtime/types/index.d.ts +0 -8
- package/dist/serialization/resources/realtime/types/index.js +0 -24
- package/serialization/resources/realtime/index.d.ts +0 -1
- package/serialization/resources/realtime/index.js +0 -17
- package/serialization/resources/realtime/types/AudioFormat.d.ts +0 -10
- package/serialization/resources/realtime/types/AudioPublishEvent.d.ts +0 -12
- package/serialization/resources/realtime/types/AudioPublishEvent.js +0 -43
- package/serialization/resources/realtime/types/AudioSubscribeEvent.d.ts +0 -12
- package/serialization/resources/realtime/types/AudioSubscribeEvent.js +0 -43
- package/serialization/resources/realtime/types/ControlEvent.d.ts +0 -15
- package/serialization/resources/realtime/types/ControlEvent.js +0 -48
- package/serialization/resources/realtime/types/HangUpPublishEvent.d.ts +0 -12
- package/serialization/resources/realtime/types/HangUpPublishEvent.js +0 -43
- package/serialization/resources/realtime/types/MessageBase.d.ts +0 -12
- package/serialization/resources/realtime/types/MessageBase.js +0 -43
- package/serialization/resources/realtime/types/PublishEvent.d.ts +0 -18
- package/serialization/resources/realtime/types/PublishEvent.js +0 -51
- package/serialization/resources/realtime/types/SubscribeEvent.d.ts +0 -27
- package/serialization/resources/realtime/types/SubscribeEvent.js +0 -54
- package/serialization/resources/realtime/types/index.d.ts +0 -8
- package/serialization/resources/realtime/types/index.js +0 -24
- /package/api/resources/{realtime/types/AudioPublishEvent.js → commons/types/BotObjectResponse.js} +0 -0
- /package/api/resources/{realtime/types/AudioSubscribeEvent.js → commons/types/NumberRange.js} +0 -0
- /package/core/{streaming-fetcher → stream}/Stream.js +0 -0
- /package/core/{streaming-fetcher → stream}/index.d.ts +0 -0
- /package/core/{streaming-fetcher → stream}/index.js +0 -0
- /package/{api/resources/realtime/types/ControlEvent.js → dist/api/resources/commons/types/BotObjectResponse.js} +0 -0
- /package/{api/resources/realtime/types/HangUpPublishEvent.js → dist/api/resources/commons/types/NumberRange.js} +0 -0
- /package/dist/core/{streaming-fetcher → stream}/Stream.js +0 -0
- /package/dist/core/{streaming-fetcher → stream}/index.d.ts +0 -0
- /package/dist/core/{streaming-fetcher → stream}/index.js +0 -0
package/core/url/qs.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toQueryString = toQueryString;
|
|
4
|
+
const defaultQsOptions = {
|
|
5
|
+
arrayFormat: "indices",
|
|
6
|
+
encode: true,
|
|
7
|
+
};
|
|
8
|
+
function encodeValue(value, shouldEncode) {
|
|
9
|
+
if (value === undefined) {
|
|
10
|
+
return "";
|
|
11
|
+
}
|
|
12
|
+
if (value === null) {
|
|
13
|
+
return "";
|
|
14
|
+
}
|
|
15
|
+
const stringValue = String(value);
|
|
16
|
+
return shouldEncode ? encodeURIComponent(stringValue) : stringValue;
|
|
17
|
+
}
|
|
18
|
+
function stringifyObject(obj, prefix = "", options) {
|
|
19
|
+
const parts = [];
|
|
20
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
21
|
+
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
22
|
+
if (value === undefined) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
if (value.length === 0) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
for (let i = 0; i < value.length; i++) {
|
|
30
|
+
const item = value[i];
|
|
31
|
+
if (item === undefined) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
35
|
+
const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
36
|
+
parts.push(...stringifyObject(item, arrayKey, options));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
40
|
+
const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
|
|
41
|
+
parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (typeof value === "object" && value !== null) {
|
|
46
|
+
if (Object.keys(value).length === 0) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
parts.push(...stringifyObject(value, fullKey, options));
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
|
|
53
|
+
parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return parts;
|
|
57
|
+
}
|
|
58
|
+
function toQueryString(obj, options) {
|
|
59
|
+
if (obj == null || typeof obj !== "object") {
|
|
60
|
+
return "";
|
|
61
|
+
}
|
|
62
|
+
const parts = stringifyObject(obj, "", Object.assign(Object.assign({}, defaultQsOptions), options));
|
|
63
|
+
return parts.join("&");
|
|
64
|
+
}
|
package/dist/Client.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ import { Events } from "./api/resources/events/client/Client";
|
|
|
12
12
|
import { Inbox } from "./api/resources/inbox/client/Client";
|
|
13
13
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
14
14
|
import { Organizations } from "./api/resources/organizations/client/Client";
|
|
15
|
-
import { Realtime } from "./api/resources/realtime/client/Client";
|
|
16
15
|
import { Translations } from "./api/resources/translations/client/Client";
|
|
17
16
|
import { Triggers } from "./api/resources/triggers/client/Client";
|
|
18
17
|
import { Users } from "./api/resources/users/client/Client";
|
|
@@ -27,6 +26,8 @@ export declare namespace MavenAGIClient {
|
|
|
27
26
|
organizationId: core.Supplier<string>;
|
|
28
27
|
/** Override the X-Agent-Id header */
|
|
29
28
|
agentId: core.Supplier<string>;
|
|
29
|
+
/** Additional headers to include in requests. */
|
|
30
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
30
31
|
fetcher?: core.FetchFunction;
|
|
31
32
|
}
|
|
32
33
|
interface RequestOptions {
|
|
@@ -41,7 +42,7 @@ export declare namespace MavenAGIClient {
|
|
|
41
42
|
/** Override the X-Agent-Id header */
|
|
42
43
|
agentId?: string;
|
|
43
44
|
/** Additional headers to include in the request. */
|
|
44
|
-
headers?: Record<string, string>;
|
|
45
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
export declare class MavenAGIClient {
|
|
@@ -55,7 +56,6 @@ export declare class MavenAGIClient {
|
|
|
55
56
|
protected _inbox: Inbox | undefined;
|
|
56
57
|
protected _knowledge: Knowledge | undefined;
|
|
57
58
|
protected _organizations: Organizations | undefined;
|
|
58
|
-
protected _realtime: Realtime | undefined;
|
|
59
59
|
protected _translations: Translations | undefined;
|
|
60
60
|
protected _triggers: Triggers | undefined;
|
|
61
61
|
protected _users: Users | undefined;
|
|
@@ -69,7 +69,6 @@ export declare class MavenAGIClient {
|
|
|
69
69
|
get inbox(): Inbox;
|
|
70
70
|
get knowledge(): Knowledge;
|
|
71
71
|
get organizations(): Organizations;
|
|
72
|
-
get realtime(): Realtime;
|
|
73
72
|
get translations(): Translations;
|
|
74
73
|
get triggers(): Triggers;
|
|
75
74
|
get users(): Users;
|
package/dist/Client.js
CHANGED
|
@@ -2,8 +2,43 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.MavenAGIClient = void 0;
|
|
40
|
+
const core = __importStar(require("./core"));
|
|
41
|
+
const headers_1 = require("./core/headers");
|
|
7
42
|
const Client_1 = require("./api/resources/actions/client/Client");
|
|
8
43
|
const Client_2 = require("./api/resources/agents/client/Client");
|
|
9
44
|
const Client_3 = require("./api/resources/analytics/client/Client");
|
|
@@ -13,13 +48,21 @@ const Client_6 = require("./api/resources/events/client/Client");
|
|
|
13
48
|
const Client_7 = require("./api/resources/inbox/client/Client");
|
|
14
49
|
const Client_8 = require("./api/resources/knowledge/client/Client");
|
|
15
50
|
const Client_9 = require("./api/resources/organizations/client/Client");
|
|
16
|
-
const Client_10 = require("./api/resources/
|
|
17
|
-
const Client_11 = require("./api/resources/
|
|
18
|
-
const Client_12 = require("./api/resources/
|
|
19
|
-
const Client_13 = require("./api/resources/users/client/Client");
|
|
51
|
+
const Client_10 = require("./api/resources/translations/client/Client");
|
|
52
|
+
const Client_11 = require("./api/resources/triggers/client/Client");
|
|
53
|
+
const Client_12 = require("./api/resources/users/client/Client");
|
|
20
54
|
class MavenAGIClient {
|
|
21
55
|
constructor(_options) {
|
|
22
|
-
this._options = _options
|
|
56
|
+
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_1.mergeHeaders)({
|
|
57
|
+
"X-Organization-Id": _options === null || _options === void 0 ? void 0 : _options.organizationId,
|
|
58
|
+
"X-Agent-Id": _options === null || _options === void 0 ? void 0 : _options.agentId,
|
|
59
|
+
"X-Fern-Language": "JavaScript",
|
|
60
|
+
"X-Fern-SDK-Name": "mavenagi",
|
|
61
|
+
"X-Fern-SDK-Version": "1.1.0",
|
|
62
|
+
"User-Agent": "mavenagi/1.1.0",
|
|
63
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
64
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
65
|
+
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
23
66
|
}
|
|
24
67
|
get actions() {
|
|
25
68
|
var _a;
|
|
@@ -57,21 +100,17 @@ class MavenAGIClient {
|
|
|
57
100
|
var _a;
|
|
58
101
|
return ((_a = this._organizations) !== null && _a !== void 0 ? _a : (this._organizations = new Client_9.Organizations(this._options)));
|
|
59
102
|
}
|
|
60
|
-
get realtime() {
|
|
61
|
-
var _a;
|
|
62
|
-
return ((_a = this._realtime) !== null && _a !== void 0 ? _a : (this._realtime = new Client_10.Realtime(this._options)));
|
|
63
|
-
}
|
|
64
103
|
get translations() {
|
|
65
104
|
var _a;
|
|
66
|
-
return ((_a = this._translations) !== null && _a !== void 0 ? _a : (this._translations = new
|
|
105
|
+
return ((_a = this._translations) !== null && _a !== void 0 ? _a : (this._translations = new Client_10.Translations(this._options)));
|
|
67
106
|
}
|
|
68
107
|
get triggers() {
|
|
69
108
|
var _a;
|
|
70
|
-
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new
|
|
109
|
+
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Client_11.Triggers(this._options)));
|
|
71
110
|
}
|
|
72
111
|
get users() {
|
|
73
112
|
var _a;
|
|
74
|
-
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new
|
|
113
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_12.Users(this._options)));
|
|
75
114
|
}
|
|
76
115
|
}
|
|
77
116
|
exports.MavenAGIClient = MavenAGIClient;
|
|
@@ -15,6 +15,8 @@ export declare namespace Actions {
|
|
|
15
15
|
organizationId: core.Supplier<string>;
|
|
16
16
|
/** Override the X-Agent-Id header */
|
|
17
17
|
agentId: core.Supplier<string>;
|
|
18
|
+
/** Additional headers to include in requests. */
|
|
19
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
18
20
|
fetcher?: core.FetchFunction;
|
|
19
21
|
}
|
|
20
22
|
interface RequestOptions {
|
|
@@ -29,7 +31,7 @@ export declare namespace Actions {
|
|
|
29
31
|
/** Override the X-Agent-Id header */
|
|
30
32
|
agentId?: string;
|
|
31
33
|
/** Additional headers to include in the request. */
|
|
32
|
-
headers?: Record<string, string>;
|
|
34
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
export declare class Actions {
|
|
@@ -68,7 +70,8 @@ export declare class Actions {
|
|
|
68
70
|
* language: "en"
|
|
69
71
|
* })
|
|
70
72
|
*/
|
|
71
|
-
createOrUpdate(request: MavenAGI.ActionRequest, requestOptions?: Actions.RequestOptions):
|
|
73
|
+
createOrUpdate(request: MavenAGI.ActionRequest, requestOptions?: Actions.RequestOptions): core.HttpResponsePromise<MavenAGI.ActionResponse>;
|
|
74
|
+
private __createOrUpdate;
|
|
72
75
|
/**
|
|
73
76
|
* Get an action by its supplied ID
|
|
74
77
|
*
|
|
@@ -82,7 +85,8 @@ export declare class Actions {
|
|
|
82
85
|
* @example
|
|
83
86
|
* await client.actions.get("get-balance")
|
|
84
87
|
*/
|
|
85
|
-
get(actionReferenceId: string, requestOptions?: Actions.RequestOptions):
|
|
88
|
+
get(actionReferenceId: string, requestOptions?: Actions.RequestOptions): core.HttpResponsePromise<MavenAGI.ActionResponse>;
|
|
89
|
+
private __get;
|
|
86
90
|
/**
|
|
87
91
|
* Delete an action
|
|
88
92
|
*
|
|
@@ -96,6 +100,7 @@ export declare class Actions {
|
|
|
96
100
|
* @example
|
|
97
101
|
* await client.actions.delete("get-balance")
|
|
98
102
|
*/
|
|
99
|
-
delete(actionReferenceId: string, requestOptions?: Actions.RequestOptions):
|
|
103
|
+
delete(actionReferenceId: string, requestOptions?: Actions.RequestOptions): core.HttpResponsePromise<void>;
|
|
104
|
+
private __delete;
|
|
100
105
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
101
106
|
}
|
|
@@ -44,16 +44,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
-
};
|
|
50
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
48
|
exports.Actions = void 0;
|
|
52
49
|
const environments = __importStar(require("../../../../environments"));
|
|
53
50
|
const core = __importStar(require("../../../../core"));
|
|
54
51
|
const MavenAGI = __importStar(require("../../../index"));
|
|
52
|
+
const headers_1 = require("../../../../core/headers");
|
|
55
53
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
56
|
-
const url_join_1 = __importDefault(require("url-join"));
|
|
57
54
|
const errors = __importStar(require("../../../../errors/index"));
|
|
58
55
|
class Actions {
|
|
59
56
|
constructor(_options) {
|
|
@@ -93,12 +90,19 @@ class Actions {
|
|
|
93
90
|
* })
|
|
94
91
|
*/
|
|
95
92
|
createOrUpdate(request, requestOptions) {
|
|
93
|
+
return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions));
|
|
94
|
+
}
|
|
95
|
+
__createOrUpdate(request, requestOptions) {
|
|
96
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
-
var _a, _b, _c;
|
|
97
|
+
var _a, _b, _c, _d;
|
|
98
98
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
99
|
-
url:
|
|
99
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, "/v1/actions"),
|
|
100
100
|
method: "PUT",
|
|
101
|
-
headers:
|
|
101
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
102
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
103
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
104
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
105
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
102
106
|
contentType: "application/json",
|
|
103
107
|
requestType: "json",
|
|
104
108
|
body: serializers.ActionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -107,12 +111,15 @@ class Actions {
|
|
|
107
111
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
108
112
|
});
|
|
109
113
|
if (_response.ok) {
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
return {
|
|
115
|
+
data: serializers.ActionResponse.parseOrThrow(_response.body, {
|
|
116
|
+
unrecognizedObjectKeys: "passthrough",
|
|
117
|
+
allowUnrecognizedUnionMembers: true,
|
|
118
|
+
allowUnrecognizedEnumValues: true,
|
|
119
|
+
breadcrumbsPrefix: ["response"],
|
|
120
|
+
}),
|
|
121
|
+
rawResponse: _response.rawResponse,
|
|
122
|
+
};
|
|
116
123
|
}
|
|
117
124
|
if (_response.error.reason === "status-code") {
|
|
118
125
|
switch (_response.error.statusCode) {
|
|
@@ -122,25 +129,26 @@ class Actions {
|
|
|
122
129
|
allowUnrecognizedUnionMembers: true,
|
|
123
130
|
allowUnrecognizedEnumValues: true,
|
|
124
131
|
breadcrumbsPrefix: ["response"],
|
|
125
|
-
}));
|
|
132
|
+
}), _response.rawResponse);
|
|
126
133
|
case 400:
|
|
127
134
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
128
135
|
unrecognizedObjectKeys: "passthrough",
|
|
129
136
|
allowUnrecognizedUnionMembers: true,
|
|
130
137
|
allowUnrecognizedEnumValues: true,
|
|
131
138
|
breadcrumbsPrefix: ["response"],
|
|
132
|
-
}));
|
|
139
|
+
}), _response.rawResponse);
|
|
133
140
|
case 500:
|
|
134
141
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
135
142
|
unrecognizedObjectKeys: "passthrough",
|
|
136
143
|
allowUnrecognizedUnionMembers: true,
|
|
137
144
|
allowUnrecognizedEnumValues: true,
|
|
138
145
|
breadcrumbsPrefix: ["response"],
|
|
139
|
-
}));
|
|
146
|
+
}), _response.rawResponse);
|
|
140
147
|
default:
|
|
141
148
|
throw new errors.MavenAGIError({
|
|
142
149
|
statusCode: _response.error.statusCode,
|
|
143
150
|
body: _response.error.body,
|
|
151
|
+
rawResponse: _response.rawResponse,
|
|
144
152
|
});
|
|
145
153
|
}
|
|
146
154
|
}
|
|
@@ -149,12 +157,14 @@ class Actions {
|
|
|
149
157
|
throw new errors.MavenAGIError({
|
|
150
158
|
statusCode: _response.error.statusCode,
|
|
151
159
|
body: _response.error.rawBody,
|
|
160
|
+
rawResponse: _response.rawResponse,
|
|
152
161
|
});
|
|
153
162
|
case "timeout":
|
|
154
163
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling PUT /v1/actions.");
|
|
155
164
|
case "unknown":
|
|
156
165
|
throw new errors.MavenAGIError({
|
|
157
166
|
message: _response.error.errorMessage,
|
|
167
|
+
rawResponse: _response.rawResponse,
|
|
158
168
|
});
|
|
159
169
|
}
|
|
160
170
|
});
|
|
@@ -173,25 +183,33 @@ class Actions {
|
|
|
173
183
|
* await client.actions.get("get-balance")
|
|
174
184
|
*/
|
|
175
185
|
get(actionReferenceId, requestOptions) {
|
|
186
|
+
return core.HttpResponsePromise.fromPromise(this.__get(actionReferenceId, requestOptions));
|
|
187
|
+
}
|
|
188
|
+
__get(actionReferenceId, requestOptions) {
|
|
176
189
|
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
-
var _a, _b, _c;
|
|
190
|
+
var _a, _b, _c, _d;
|
|
178
191
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
179
|
-
url:
|
|
192
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(actionReferenceId)}`),
|
|
180
193
|
method: "GET",
|
|
181
|
-
headers:
|
|
182
|
-
|
|
183
|
-
|
|
194
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
195
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
196
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
197
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
198
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
184
199
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
185
200
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
186
201
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
187
202
|
});
|
|
188
203
|
if (_response.ok) {
|
|
189
|
-
return
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
204
|
+
return {
|
|
205
|
+
data: serializers.ActionResponse.parseOrThrow(_response.body, {
|
|
206
|
+
unrecognizedObjectKeys: "passthrough",
|
|
207
|
+
allowUnrecognizedUnionMembers: true,
|
|
208
|
+
allowUnrecognizedEnumValues: true,
|
|
209
|
+
breadcrumbsPrefix: ["response"],
|
|
210
|
+
}),
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
212
|
+
};
|
|
195
213
|
}
|
|
196
214
|
if (_response.error.reason === "status-code") {
|
|
197
215
|
switch (_response.error.statusCode) {
|
|
@@ -201,25 +219,26 @@ class Actions {
|
|
|
201
219
|
allowUnrecognizedUnionMembers: true,
|
|
202
220
|
allowUnrecognizedEnumValues: true,
|
|
203
221
|
breadcrumbsPrefix: ["response"],
|
|
204
|
-
}));
|
|
222
|
+
}), _response.rawResponse);
|
|
205
223
|
case 400:
|
|
206
224
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
207
225
|
unrecognizedObjectKeys: "passthrough",
|
|
208
226
|
allowUnrecognizedUnionMembers: true,
|
|
209
227
|
allowUnrecognizedEnumValues: true,
|
|
210
228
|
breadcrumbsPrefix: ["response"],
|
|
211
|
-
}));
|
|
229
|
+
}), _response.rawResponse);
|
|
212
230
|
case 500:
|
|
213
231
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
214
232
|
unrecognizedObjectKeys: "passthrough",
|
|
215
233
|
allowUnrecognizedUnionMembers: true,
|
|
216
234
|
allowUnrecognizedEnumValues: true,
|
|
217
235
|
breadcrumbsPrefix: ["response"],
|
|
218
|
-
}));
|
|
236
|
+
}), _response.rawResponse);
|
|
219
237
|
default:
|
|
220
238
|
throw new errors.MavenAGIError({
|
|
221
239
|
statusCode: _response.error.statusCode,
|
|
222
240
|
body: _response.error.body,
|
|
241
|
+
rawResponse: _response.rawResponse,
|
|
223
242
|
});
|
|
224
243
|
}
|
|
225
244
|
}
|
|
@@ -228,12 +247,14 @@ class Actions {
|
|
|
228
247
|
throw new errors.MavenAGIError({
|
|
229
248
|
statusCode: _response.error.statusCode,
|
|
230
249
|
body: _response.error.rawBody,
|
|
250
|
+
rawResponse: _response.rawResponse,
|
|
231
251
|
});
|
|
232
252
|
case "timeout":
|
|
233
253
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling GET /v1/actions/{actionReferenceId}.");
|
|
234
254
|
case "unknown":
|
|
235
255
|
throw new errors.MavenAGIError({
|
|
236
256
|
message: _response.error.errorMessage,
|
|
257
|
+
rawResponse: _response.rawResponse,
|
|
237
258
|
});
|
|
238
259
|
}
|
|
239
260
|
});
|
|
@@ -252,20 +273,25 @@ class Actions {
|
|
|
252
273
|
* await client.actions.delete("get-balance")
|
|
253
274
|
*/
|
|
254
275
|
delete(actionReferenceId, requestOptions) {
|
|
276
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(actionReferenceId, requestOptions));
|
|
277
|
+
}
|
|
278
|
+
__delete(actionReferenceId, requestOptions) {
|
|
255
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
-
var _a, _b, _c;
|
|
280
|
+
var _a, _b, _c, _d;
|
|
257
281
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
258
|
-
url:
|
|
282
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(actionReferenceId)}`),
|
|
259
283
|
method: "DELETE",
|
|
260
|
-
headers:
|
|
261
|
-
|
|
262
|
-
|
|
284
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
285
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
286
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
287
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
288
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
263
289
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
264
290
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
265
291
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
266
292
|
});
|
|
267
293
|
if (_response.ok) {
|
|
268
|
-
return;
|
|
294
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
269
295
|
}
|
|
270
296
|
if (_response.error.reason === "status-code") {
|
|
271
297
|
switch (_response.error.statusCode) {
|
|
@@ -275,25 +301,26 @@ class Actions {
|
|
|
275
301
|
allowUnrecognizedUnionMembers: true,
|
|
276
302
|
allowUnrecognizedEnumValues: true,
|
|
277
303
|
breadcrumbsPrefix: ["response"],
|
|
278
|
-
}));
|
|
304
|
+
}), _response.rawResponse);
|
|
279
305
|
case 400:
|
|
280
306
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
281
307
|
unrecognizedObjectKeys: "passthrough",
|
|
282
308
|
allowUnrecognizedUnionMembers: true,
|
|
283
309
|
allowUnrecognizedEnumValues: true,
|
|
284
310
|
breadcrumbsPrefix: ["response"],
|
|
285
|
-
}));
|
|
311
|
+
}), _response.rawResponse);
|
|
286
312
|
case 500:
|
|
287
313
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
288
314
|
unrecognizedObjectKeys: "passthrough",
|
|
289
315
|
allowUnrecognizedUnionMembers: true,
|
|
290
316
|
allowUnrecognizedEnumValues: true,
|
|
291
317
|
breadcrumbsPrefix: ["response"],
|
|
292
|
-
}));
|
|
318
|
+
}), _response.rawResponse);
|
|
293
319
|
default:
|
|
294
320
|
throw new errors.MavenAGIError({
|
|
295
321
|
statusCode: _response.error.statusCode,
|
|
296
322
|
body: _response.error.body,
|
|
323
|
+
rawResponse: _response.rawResponse,
|
|
297
324
|
});
|
|
298
325
|
}
|
|
299
326
|
}
|
|
@@ -302,12 +329,14 @@ class Actions {
|
|
|
302
329
|
throw new errors.MavenAGIError({
|
|
303
330
|
statusCode: _response.error.statusCode,
|
|
304
331
|
body: _response.error.rawBody,
|
|
332
|
+
rawResponse: _response.rawResponse,
|
|
305
333
|
});
|
|
306
334
|
case "timeout":
|
|
307
335
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling DELETE /v1/actions/{actionReferenceId}.");
|
|
308
336
|
case "unknown":
|
|
309
337
|
throw new errors.MavenAGIError({
|
|
310
338
|
message: _response.error.errorMessage,
|
|
339
|
+
rawResponse: _response.rawResponse,
|
|
311
340
|
});
|
|
312
341
|
}
|
|
313
342
|
});
|
|
@@ -15,6 +15,8 @@ export declare namespace Agents {
|
|
|
15
15
|
organizationId: core.Supplier<string>;
|
|
16
16
|
/** Override the X-Agent-Id header */
|
|
17
17
|
agentId: core.Supplier<string>;
|
|
18
|
+
/** Additional headers to include in requests. */
|
|
19
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
18
20
|
fetcher?: core.FetchFunction;
|
|
19
21
|
}
|
|
20
22
|
interface RequestOptions {
|
|
@@ -29,7 +31,7 @@ export declare namespace Agents {
|
|
|
29
31
|
/** Override the X-Agent-Id header */
|
|
30
32
|
agentId?: string;
|
|
31
33
|
/** Additional headers to include in the request. */
|
|
32
|
-
headers?: Record<string, string>;
|
|
34
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
export declare class Agents {
|
|
@@ -52,7 +54,8 @@ export declare class Agents {
|
|
|
52
54
|
* @example
|
|
53
55
|
* await client.agents.search({})
|
|
54
56
|
*/
|
|
55
|
-
search(request: MavenAGI.AgentsSearchRequest, requestOptions?: Agents.RequestOptions):
|
|
57
|
+
search(request: MavenAGI.AgentsSearchRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<MavenAGI.AgentsSearchResponse>;
|
|
58
|
+
private __search;
|
|
56
59
|
/**
|
|
57
60
|
* Lists all agents for an organization
|
|
58
61
|
*
|
|
@@ -66,7 +69,8 @@ export declare class Agents {
|
|
|
66
69
|
* @example
|
|
67
70
|
* await client.agents.list("organizationReferenceId")
|
|
68
71
|
*/
|
|
69
|
-
list(organizationReferenceId: string, requestOptions?: Agents.RequestOptions):
|
|
72
|
+
list(organizationReferenceId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<MavenAGI.Agent[]>;
|
|
73
|
+
private __list;
|
|
70
74
|
/**
|
|
71
75
|
* Get an agent
|
|
72
76
|
*
|
|
@@ -81,6 +85,7 @@ export declare class Agents {
|
|
|
81
85
|
* @example
|
|
82
86
|
* await client.agents.get("organizationReferenceId", "agentReferenceId")
|
|
83
87
|
*/
|
|
84
|
-
get(organizationReferenceId: string, agentReferenceId: string, requestOptions?: Agents.RequestOptions):
|
|
88
|
+
get(organizationReferenceId: string, agentReferenceId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<MavenAGI.Agent>;
|
|
89
|
+
private __get;
|
|
85
90
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
86
91
|
}
|