mavenagi 1.0.15 → 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 +14 -1
- 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/AppUserRequest.d.ts +2 -2
- package/api/resources/commons/types/AppUserResponse.d.ts +2 -2
- 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/UserMessageAttachment.d.ts +16 -0
- package/api/resources/commons/types/index.d.ts +1 -0
- package/api/resources/commons/types/index.js +1 -0
- package/api/resources/conversation/client/Client.d.ts +43 -58
- package/api/resources/conversation/client/Client.js +342 -281
- 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/ConversationMessageRequest.d.ts +2 -0
- package/api/resources/conversation/types/index.d.ts +0 -1
- package/api/resources/conversation/types/index.js +0 -1
- 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/AppUserRequest.d.ts +2 -2
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +2 -2
- 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/UserMessageAttachment.d.ts +16 -0
- package/dist/api/resources/commons/types/index.d.ts +1 -0
- package/dist/api/resources/commons/types/index.js +1 -0
- package/dist/api/resources/conversation/client/Client.d.ts +43 -58
- package/dist/api/resources/conversation/client/Client.js +342 -281
- 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/ConversationMessageRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/index.d.ts +0 -1
- package/dist/api/resources/conversation/types/index.js +0 -1
- 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/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/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 +1 -0
- package/dist/serialization/resources/commons/types/index.js +1 -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/ConversationMessageRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +0 -1
- package/dist/serialization/resources/conversation/types/index.js +0 -1
- 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 -98
- package/scripts/rename-to-esm-files.js +10 -2
- 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/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 +1 -0
- package/serialization/resources/commons/types/index.js +1 -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/ConversationMessageRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationMessageRequest.js +2 -0
- package/serialization/resources/conversation/types/index.d.ts +0 -1
- package/serialization/resources/conversation/types/index.js +0 -1
- 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/conversation/types/GenerateObjectRequest.d.ts +0 -8
- package/api/resources/conversation/types/GenerateObjectRequest.js +0 -5
- 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/AudioPublishEvent.js +0 -5
- package/api/resources/realtime/types/AudioSubscribeEvent.d.ts +0 -6
- package/api/resources/realtime/types/AudioSubscribeEvent.js +0 -5
- package/api/resources/realtime/types/ControlEvent.d.ts +0 -9
- package/api/resources/realtime/types/ControlEvent.js +0 -5
- package/api/resources/realtime/types/HangUpPublishEvent.d.ts +0 -6
- package/api/resources/realtime/types/HangUpPublishEvent.js +0 -5
- 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/conversation/types/GenerateObjectRequest.d.ts +0 -8
- package/dist/api/resources/conversation/types/GenerateObjectRequest.js +0 -5
- 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/conversation/types/GenerateObjectRequest.d.ts +0 -13
- package/dist/serialization/resources/conversation/types/GenerateObjectRequest.js +0 -46
- 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/AudioPublishEvent.d.ts +0 -12
- package/dist/serialization/resources/realtime/types/AudioPublishEvent.js +0 -43
- package/dist/serialization/resources/realtime/types/AudioSubscribeEvent.d.ts +0 -12
- package/dist/serialization/resources/realtime/types/AudioSubscribeEvent.js +0 -43
- 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/HangUpPublishEvent.d.ts +0 -12
- package/dist/serialization/resources/realtime/types/HangUpPublishEvent.js +0 -43
- package/dist/serialization/resources/realtime/types/MessageBase.d.ts +0 -12
- package/dist/serialization/resources/realtime/types/MessageBase.js +0 -43
- 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/conversation/types/GenerateObjectRequest.d.ts +0 -13
- package/serialization/resources/conversation/types/GenerateObjectRequest.js +0 -46
- 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/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/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
|
@@ -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.Agents = 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 Agents {
|
|
59
56
|
constructor(_options) {
|
|
@@ -77,12 +74,19 @@ class Agents {
|
|
|
77
74
|
* await client.agents.search({})
|
|
78
75
|
*/
|
|
79
76
|
search(request, requestOptions) {
|
|
77
|
+
return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions));
|
|
78
|
+
}
|
|
79
|
+
__search(request, requestOptions) {
|
|
80
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
var _a, _b, _c;
|
|
81
|
+
var _a, _b, _c, _d;
|
|
82
82
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
83
|
-
url:
|
|
83
|
+
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/agents"),
|
|
84
84
|
method: "POST",
|
|
85
|
-
headers:
|
|
85
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
86
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
87
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
88
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
89
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
86
90
|
contentType: "application/json",
|
|
87
91
|
requestType: "json",
|
|
88
92
|
body: serializers.AgentsSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -91,12 +95,15 @@ class Agents {
|
|
|
91
95
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
92
96
|
});
|
|
93
97
|
if (_response.ok) {
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
return {
|
|
99
|
+
data: serializers.AgentsSearchResponse.parseOrThrow(_response.body, {
|
|
100
|
+
unrecognizedObjectKeys: "passthrough",
|
|
101
|
+
allowUnrecognizedUnionMembers: true,
|
|
102
|
+
allowUnrecognizedEnumValues: true,
|
|
103
|
+
breadcrumbsPrefix: ["response"],
|
|
104
|
+
}),
|
|
105
|
+
rawResponse: _response.rawResponse,
|
|
106
|
+
};
|
|
100
107
|
}
|
|
101
108
|
if (_response.error.reason === "status-code") {
|
|
102
109
|
switch (_response.error.statusCode) {
|
|
@@ -106,25 +113,26 @@ class Agents {
|
|
|
106
113
|
allowUnrecognizedUnionMembers: true,
|
|
107
114
|
allowUnrecognizedEnumValues: true,
|
|
108
115
|
breadcrumbsPrefix: ["response"],
|
|
109
|
-
}));
|
|
116
|
+
}), _response.rawResponse);
|
|
110
117
|
case 400:
|
|
111
118
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
112
119
|
unrecognizedObjectKeys: "passthrough",
|
|
113
120
|
allowUnrecognizedUnionMembers: true,
|
|
114
121
|
allowUnrecognizedEnumValues: true,
|
|
115
122
|
breadcrumbsPrefix: ["response"],
|
|
116
|
-
}));
|
|
123
|
+
}), _response.rawResponse);
|
|
117
124
|
case 500:
|
|
118
125
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
119
126
|
unrecognizedObjectKeys: "passthrough",
|
|
120
127
|
allowUnrecognizedUnionMembers: true,
|
|
121
128
|
allowUnrecognizedEnumValues: true,
|
|
122
129
|
breadcrumbsPrefix: ["response"],
|
|
123
|
-
}));
|
|
130
|
+
}), _response.rawResponse);
|
|
124
131
|
default:
|
|
125
132
|
throw new errors.MavenAGIError({
|
|
126
133
|
statusCode: _response.error.statusCode,
|
|
127
134
|
body: _response.error.body,
|
|
135
|
+
rawResponse: _response.rawResponse,
|
|
128
136
|
});
|
|
129
137
|
}
|
|
130
138
|
}
|
|
@@ -133,12 +141,14 @@ class Agents {
|
|
|
133
141
|
throw new errors.MavenAGIError({
|
|
134
142
|
statusCode: _response.error.statusCode,
|
|
135
143
|
body: _response.error.rawBody,
|
|
144
|
+
rawResponse: _response.rawResponse,
|
|
136
145
|
});
|
|
137
146
|
case "timeout":
|
|
138
147
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/agents.");
|
|
139
148
|
case "unknown":
|
|
140
149
|
throw new errors.MavenAGIError({
|
|
141
150
|
message: _response.error.errorMessage,
|
|
151
|
+
rawResponse: _response.rawResponse,
|
|
142
152
|
});
|
|
143
153
|
}
|
|
144
154
|
});
|
|
@@ -157,25 +167,33 @@ class Agents {
|
|
|
157
167
|
* await client.agents.list("organizationReferenceId")
|
|
158
168
|
*/
|
|
159
169
|
list(organizationReferenceId, requestOptions) {
|
|
170
|
+
return core.HttpResponsePromise.fromPromise(this.__list(organizationReferenceId, requestOptions));
|
|
171
|
+
}
|
|
172
|
+
__list(organizationReferenceId, requestOptions) {
|
|
160
173
|
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
-
var _a, _b, _c;
|
|
174
|
+
var _a, _b, _c, _d;
|
|
162
175
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
163
|
-
url:
|
|
176
|
+
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/organizations/${encodeURIComponent(organizationReferenceId)}/agents`),
|
|
164
177
|
method: "GET",
|
|
165
|
-
headers:
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
179
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
180
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
181
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
182
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
168
183
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
169
184
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
170
185
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
171
186
|
});
|
|
172
187
|
if (_response.ok) {
|
|
173
|
-
return
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
188
|
+
return {
|
|
189
|
+
data: serializers.agents.list.Response.parseOrThrow(_response.body, {
|
|
190
|
+
unrecognizedObjectKeys: "passthrough",
|
|
191
|
+
allowUnrecognizedUnionMembers: true,
|
|
192
|
+
allowUnrecognizedEnumValues: true,
|
|
193
|
+
breadcrumbsPrefix: ["response"],
|
|
194
|
+
}),
|
|
195
|
+
rawResponse: _response.rawResponse,
|
|
196
|
+
};
|
|
179
197
|
}
|
|
180
198
|
if (_response.error.reason === "status-code") {
|
|
181
199
|
switch (_response.error.statusCode) {
|
|
@@ -185,25 +203,26 @@ class Agents {
|
|
|
185
203
|
allowUnrecognizedUnionMembers: true,
|
|
186
204
|
allowUnrecognizedEnumValues: true,
|
|
187
205
|
breadcrumbsPrefix: ["response"],
|
|
188
|
-
}));
|
|
206
|
+
}), _response.rawResponse);
|
|
189
207
|
case 400:
|
|
190
208
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
191
209
|
unrecognizedObjectKeys: "passthrough",
|
|
192
210
|
allowUnrecognizedUnionMembers: true,
|
|
193
211
|
allowUnrecognizedEnumValues: true,
|
|
194
212
|
breadcrumbsPrefix: ["response"],
|
|
195
|
-
}));
|
|
213
|
+
}), _response.rawResponse);
|
|
196
214
|
case 500:
|
|
197
215
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
198
216
|
unrecognizedObjectKeys: "passthrough",
|
|
199
217
|
allowUnrecognizedUnionMembers: true,
|
|
200
218
|
allowUnrecognizedEnumValues: true,
|
|
201
219
|
breadcrumbsPrefix: ["response"],
|
|
202
|
-
}));
|
|
220
|
+
}), _response.rawResponse);
|
|
203
221
|
default:
|
|
204
222
|
throw new errors.MavenAGIError({
|
|
205
223
|
statusCode: _response.error.statusCode,
|
|
206
224
|
body: _response.error.body,
|
|
225
|
+
rawResponse: _response.rawResponse,
|
|
207
226
|
});
|
|
208
227
|
}
|
|
209
228
|
}
|
|
@@ -212,12 +231,14 @@ class Agents {
|
|
|
212
231
|
throw new errors.MavenAGIError({
|
|
213
232
|
statusCode: _response.error.statusCode,
|
|
214
233
|
body: _response.error.rawBody,
|
|
234
|
+
rawResponse: _response.rawResponse,
|
|
215
235
|
});
|
|
216
236
|
case "timeout":
|
|
217
237
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling GET /v1/organizations/{organizationReferenceId}/agents.");
|
|
218
238
|
case "unknown":
|
|
219
239
|
throw new errors.MavenAGIError({
|
|
220
240
|
message: _response.error.errorMessage,
|
|
241
|
+
rawResponse: _response.rawResponse,
|
|
221
242
|
});
|
|
222
243
|
}
|
|
223
244
|
});
|
|
@@ -237,25 +258,33 @@ class Agents {
|
|
|
237
258
|
* await client.agents.get("organizationReferenceId", "agentReferenceId")
|
|
238
259
|
*/
|
|
239
260
|
get(organizationReferenceId, agentReferenceId, requestOptions) {
|
|
261
|
+
return core.HttpResponsePromise.fromPromise(this.__get(organizationReferenceId, agentReferenceId, requestOptions));
|
|
262
|
+
}
|
|
263
|
+
__get(organizationReferenceId, agentReferenceId, requestOptions) {
|
|
240
264
|
return __awaiter(this, void 0, void 0, function* () {
|
|
241
|
-
var _a, _b, _c;
|
|
265
|
+
var _a, _b, _c, _d;
|
|
242
266
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
243
|
-
url:
|
|
267
|
+
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/organizations/${encodeURIComponent(organizationReferenceId)}/agents/${encodeURIComponent(agentReferenceId)}`),
|
|
244
268
|
method: "GET",
|
|
245
|
-
headers:
|
|
246
|
-
|
|
247
|
-
|
|
269
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
270
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
271
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
272
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
273
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
248
274
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
249
275
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
250
276
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
251
277
|
});
|
|
252
278
|
if (_response.ok) {
|
|
253
|
-
return
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
279
|
+
return {
|
|
280
|
+
data: serializers.Agent.parseOrThrow(_response.body, {
|
|
281
|
+
unrecognizedObjectKeys: "passthrough",
|
|
282
|
+
allowUnrecognizedUnionMembers: true,
|
|
283
|
+
allowUnrecognizedEnumValues: true,
|
|
284
|
+
breadcrumbsPrefix: ["response"],
|
|
285
|
+
}),
|
|
286
|
+
rawResponse: _response.rawResponse,
|
|
287
|
+
};
|
|
259
288
|
}
|
|
260
289
|
if (_response.error.reason === "status-code") {
|
|
261
290
|
switch (_response.error.statusCode) {
|
|
@@ -265,25 +294,26 @@ class Agents {
|
|
|
265
294
|
allowUnrecognizedUnionMembers: true,
|
|
266
295
|
allowUnrecognizedEnumValues: true,
|
|
267
296
|
breadcrumbsPrefix: ["response"],
|
|
268
|
-
}));
|
|
297
|
+
}), _response.rawResponse);
|
|
269
298
|
case 400:
|
|
270
299
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
271
300
|
unrecognizedObjectKeys: "passthrough",
|
|
272
301
|
allowUnrecognizedUnionMembers: true,
|
|
273
302
|
allowUnrecognizedEnumValues: true,
|
|
274
303
|
breadcrumbsPrefix: ["response"],
|
|
275
|
-
}));
|
|
304
|
+
}), _response.rawResponse);
|
|
276
305
|
case 500:
|
|
277
306
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
278
307
|
unrecognizedObjectKeys: "passthrough",
|
|
279
308
|
allowUnrecognizedUnionMembers: true,
|
|
280
309
|
allowUnrecognizedEnumValues: true,
|
|
281
310
|
breadcrumbsPrefix: ["response"],
|
|
282
|
-
}));
|
|
311
|
+
}), _response.rawResponse);
|
|
283
312
|
default:
|
|
284
313
|
throw new errors.MavenAGIError({
|
|
285
314
|
statusCode: _response.error.statusCode,
|
|
286
315
|
body: _response.error.body,
|
|
316
|
+
rawResponse: _response.rawResponse,
|
|
287
317
|
});
|
|
288
318
|
}
|
|
289
319
|
}
|
|
@@ -292,12 +322,14 @@ class Agents {
|
|
|
292
322
|
throw new errors.MavenAGIError({
|
|
293
323
|
statusCode: _response.error.statusCode,
|
|
294
324
|
body: _response.error.rawBody,
|
|
325
|
+
rawResponse: _response.rawResponse,
|
|
295
326
|
});
|
|
296
327
|
case "timeout":
|
|
297
328
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling GET /v1/organizations/{organizationReferenceId}/agents/{agentReferenceId}.");
|
|
298
329
|
case "unknown":
|
|
299
330
|
throw new errors.MavenAGIError({
|
|
300
331
|
message: _response.error.errorMessage,
|
|
332
|
+
rawResponse: _response.rawResponse,
|
|
301
333
|
});
|
|
302
334
|
}
|
|
303
335
|
});
|
|
@@ -15,6 +15,8 @@ export declare namespace Analytics {
|
|
|
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 Analytics {
|
|
|
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 Analytics {
|
|
@@ -75,7 +77,8 @@ export declare class Analytics {
|
|
|
75
77
|
* }]
|
|
76
78
|
* })
|
|
77
79
|
*/
|
|
78
|
-
getConversationTable(request: MavenAGI.ConversationTableRequest, requestOptions?: Analytics.RequestOptions):
|
|
80
|
+
getConversationTable(request: MavenAGI.ConversationTableRequest, requestOptions?: Analytics.RequestOptions): core.HttpResponsePromise<MavenAGI.ConversationTableResponse>;
|
|
81
|
+
private __getConversationTable;
|
|
79
82
|
/**
|
|
80
83
|
* Fetches conversation data visualized in a chart format. Supported chart types include pie chart, date histogram, and stacked bar charts.
|
|
81
84
|
*
|
|
@@ -132,7 +135,8 @@ export declare class Analytics {
|
|
|
132
135
|
* }
|
|
133
136
|
* })
|
|
134
137
|
*/
|
|
135
|
-
getConversationChart(request: MavenAGI.ConversationChartRequest, requestOptions?: Analytics.RequestOptions):
|
|
138
|
+
getConversationChart(request: MavenAGI.ConversationChartRequest, requestOptions?: Analytics.RequestOptions): core.HttpResponsePromise<MavenAGI.ChartResponse>;
|
|
139
|
+
private __getConversationChart;
|
|
136
140
|
/**
|
|
137
141
|
* Retrieves structured feedback data formatted as a table, allowing users to group, filter, and define specific metrics to display as columns.
|
|
138
142
|
*
|
|
@@ -159,6 +163,7 @@ export declare class Analytics {
|
|
|
159
163
|
* }]
|
|
160
164
|
* })
|
|
161
165
|
*/
|
|
162
|
-
getFeedbackTable(request: MavenAGI.FeedbackTableRequest, requestOptions?: Analytics.RequestOptions):
|
|
166
|
+
getFeedbackTable(request: MavenAGI.FeedbackTableRequest, requestOptions?: Analytics.RequestOptions): core.HttpResponsePromise<MavenAGI.FeedbackTableResponse>;
|
|
167
|
+
private __getFeedbackTable;
|
|
163
168
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
164
169
|
}
|
|
@@ -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.Analytics = 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 Analytics {
|
|
59
56
|
constructor(_options) {
|
|
@@ -100,12 +97,19 @@ class Analytics {
|
|
|
100
97
|
* })
|
|
101
98
|
*/
|
|
102
99
|
getConversationTable(request, requestOptions) {
|
|
100
|
+
return core.HttpResponsePromise.fromPromise(this.__getConversationTable(request, requestOptions));
|
|
101
|
+
}
|
|
102
|
+
__getConversationTable(request, requestOptions) {
|
|
103
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
var _a, _b, _c;
|
|
104
|
+
var _a, _b, _c, _d;
|
|
105
105
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
106
|
-
url:
|
|
106
|
+
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/tables/conversations"),
|
|
107
107
|
method: "POST",
|
|
108
|
-
headers:
|
|
108
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
109
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
110
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
111
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
112
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
109
113
|
contentType: "application/json",
|
|
110
114
|
requestType: "json",
|
|
111
115
|
body: serializers.ConversationTableRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -114,12 +118,15 @@ class Analytics {
|
|
|
114
118
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
115
119
|
});
|
|
116
120
|
if (_response.ok) {
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
return {
|
|
122
|
+
data: serializers.ConversationTableResponse.parseOrThrow(_response.body, {
|
|
123
|
+
unrecognizedObjectKeys: "passthrough",
|
|
124
|
+
allowUnrecognizedUnionMembers: true,
|
|
125
|
+
allowUnrecognizedEnumValues: true,
|
|
126
|
+
breadcrumbsPrefix: ["response"],
|
|
127
|
+
}),
|
|
128
|
+
rawResponse: _response.rawResponse,
|
|
129
|
+
};
|
|
123
130
|
}
|
|
124
131
|
if (_response.error.reason === "status-code") {
|
|
125
132
|
switch (_response.error.statusCode) {
|
|
@@ -129,25 +136,26 @@ class Analytics {
|
|
|
129
136
|
allowUnrecognizedUnionMembers: true,
|
|
130
137
|
allowUnrecognizedEnumValues: true,
|
|
131
138
|
breadcrumbsPrefix: ["response"],
|
|
132
|
-
}));
|
|
139
|
+
}), _response.rawResponse);
|
|
133
140
|
case 400:
|
|
134
141
|
throw new MavenAGI.BadRequestError(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
|
case 500:
|
|
141
148
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
142
149
|
unrecognizedObjectKeys: "passthrough",
|
|
143
150
|
allowUnrecognizedUnionMembers: true,
|
|
144
151
|
allowUnrecognizedEnumValues: true,
|
|
145
152
|
breadcrumbsPrefix: ["response"],
|
|
146
|
-
}));
|
|
153
|
+
}), _response.rawResponse);
|
|
147
154
|
default:
|
|
148
155
|
throw new errors.MavenAGIError({
|
|
149
156
|
statusCode: _response.error.statusCode,
|
|
150
157
|
body: _response.error.body,
|
|
158
|
+
rawResponse: _response.rawResponse,
|
|
151
159
|
});
|
|
152
160
|
}
|
|
153
161
|
}
|
|
@@ -156,12 +164,14 @@ class Analytics {
|
|
|
156
164
|
throw new errors.MavenAGIError({
|
|
157
165
|
statusCode: _response.error.statusCode,
|
|
158
166
|
body: _response.error.rawBody,
|
|
167
|
+
rawResponse: _response.rawResponse,
|
|
159
168
|
});
|
|
160
169
|
case "timeout":
|
|
161
170
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/tables/conversations.");
|
|
162
171
|
case "unknown":
|
|
163
172
|
throw new errors.MavenAGIError({
|
|
164
173
|
message: _response.error.errorMessage,
|
|
174
|
+
rawResponse: _response.rawResponse,
|
|
165
175
|
});
|
|
166
176
|
}
|
|
167
177
|
});
|
|
@@ -223,12 +233,19 @@ class Analytics {
|
|
|
223
233
|
* })
|
|
224
234
|
*/
|
|
225
235
|
getConversationChart(request, requestOptions) {
|
|
236
|
+
return core.HttpResponsePromise.fromPromise(this.__getConversationChart(request, requestOptions));
|
|
237
|
+
}
|
|
238
|
+
__getConversationChart(request, requestOptions) {
|
|
226
239
|
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
-
var _a, _b, _c;
|
|
240
|
+
var _a, _b, _c, _d;
|
|
228
241
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
229
|
-
url:
|
|
242
|
+
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/charts/conversations"),
|
|
230
243
|
method: "POST",
|
|
231
|
-
headers:
|
|
244
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
245
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
246
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
247
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
248
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
232
249
|
contentType: "application/json",
|
|
233
250
|
requestType: "json",
|
|
234
251
|
body: serializers.ConversationChartRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -237,12 +254,15 @@ class Analytics {
|
|
|
237
254
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
238
255
|
});
|
|
239
256
|
if (_response.ok) {
|
|
240
|
-
return
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
257
|
+
return {
|
|
258
|
+
data: serializers.ChartResponse.parseOrThrow(_response.body, {
|
|
259
|
+
unrecognizedObjectKeys: "passthrough",
|
|
260
|
+
allowUnrecognizedUnionMembers: true,
|
|
261
|
+
allowUnrecognizedEnumValues: true,
|
|
262
|
+
breadcrumbsPrefix: ["response"],
|
|
263
|
+
}),
|
|
264
|
+
rawResponse: _response.rawResponse,
|
|
265
|
+
};
|
|
246
266
|
}
|
|
247
267
|
if (_response.error.reason === "status-code") {
|
|
248
268
|
switch (_response.error.statusCode) {
|
|
@@ -252,25 +272,26 @@ class Analytics {
|
|
|
252
272
|
allowUnrecognizedUnionMembers: true,
|
|
253
273
|
allowUnrecognizedEnumValues: true,
|
|
254
274
|
breadcrumbsPrefix: ["response"],
|
|
255
|
-
}));
|
|
275
|
+
}), _response.rawResponse);
|
|
256
276
|
case 400:
|
|
257
277
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
258
278
|
unrecognizedObjectKeys: "passthrough",
|
|
259
279
|
allowUnrecognizedUnionMembers: true,
|
|
260
280
|
allowUnrecognizedEnumValues: true,
|
|
261
281
|
breadcrumbsPrefix: ["response"],
|
|
262
|
-
}));
|
|
282
|
+
}), _response.rawResponse);
|
|
263
283
|
case 500:
|
|
264
284
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
265
285
|
unrecognizedObjectKeys: "passthrough",
|
|
266
286
|
allowUnrecognizedUnionMembers: true,
|
|
267
287
|
allowUnrecognizedEnumValues: true,
|
|
268
288
|
breadcrumbsPrefix: ["response"],
|
|
269
|
-
}));
|
|
289
|
+
}), _response.rawResponse);
|
|
270
290
|
default:
|
|
271
291
|
throw new errors.MavenAGIError({
|
|
272
292
|
statusCode: _response.error.statusCode,
|
|
273
293
|
body: _response.error.body,
|
|
294
|
+
rawResponse: _response.rawResponse,
|
|
274
295
|
});
|
|
275
296
|
}
|
|
276
297
|
}
|
|
@@ -279,12 +300,14 @@ class Analytics {
|
|
|
279
300
|
throw new errors.MavenAGIError({
|
|
280
301
|
statusCode: _response.error.statusCode,
|
|
281
302
|
body: _response.error.rawBody,
|
|
303
|
+
rawResponse: _response.rawResponse,
|
|
282
304
|
});
|
|
283
305
|
case "timeout":
|
|
284
306
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/charts/conversations.");
|
|
285
307
|
case "unknown":
|
|
286
308
|
throw new errors.MavenAGIError({
|
|
287
309
|
message: _response.error.errorMessage,
|
|
310
|
+
rawResponse: _response.rawResponse,
|
|
288
311
|
});
|
|
289
312
|
}
|
|
290
313
|
});
|
|
@@ -316,12 +339,19 @@ class Analytics {
|
|
|
316
339
|
* })
|
|
317
340
|
*/
|
|
318
341
|
getFeedbackTable(request, requestOptions) {
|
|
342
|
+
return core.HttpResponsePromise.fromPromise(this.__getFeedbackTable(request, requestOptions));
|
|
343
|
+
}
|
|
344
|
+
__getFeedbackTable(request, requestOptions) {
|
|
319
345
|
return __awaiter(this, void 0, void 0, function* () {
|
|
320
|
-
var _a, _b, _c;
|
|
346
|
+
var _a, _b, _c, _d;
|
|
321
347
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
322
|
-
url:
|
|
348
|
+
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/tables/feedback"),
|
|
323
349
|
method: "POST",
|
|
324
|
-
headers:
|
|
350
|
+
headers: (0, headers_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
351
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
352
|
+
"X-Organization-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
353
|
+
"X-Agent-Id": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId,
|
|
354
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
325
355
|
contentType: "application/json",
|
|
326
356
|
requestType: "json",
|
|
327
357
|
body: serializers.FeedbackTableRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -330,12 +360,15 @@ class Analytics {
|
|
|
330
360
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
331
361
|
});
|
|
332
362
|
if (_response.ok) {
|
|
333
|
-
return
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
363
|
+
return {
|
|
364
|
+
data: serializers.FeedbackTableResponse.parseOrThrow(_response.body, {
|
|
365
|
+
unrecognizedObjectKeys: "passthrough",
|
|
366
|
+
allowUnrecognizedUnionMembers: true,
|
|
367
|
+
allowUnrecognizedEnumValues: true,
|
|
368
|
+
breadcrumbsPrefix: ["response"],
|
|
369
|
+
}),
|
|
370
|
+
rawResponse: _response.rawResponse,
|
|
371
|
+
};
|
|
339
372
|
}
|
|
340
373
|
if (_response.error.reason === "status-code") {
|
|
341
374
|
switch (_response.error.statusCode) {
|
|
@@ -345,25 +378,26 @@ class Analytics {
|
|
|
345
378
|
allowUnrecognizedUnionMembers: true,
|
|
346
379
|
allowUnrecognizedEnumValues: true,
|
|
347
380
|
breadcrumbsPrefix: ["response"],
|
|
348
|
-
}));
|
|
381
|
+
}), _response.rawResponse);
|
|
349
382
|
case 400:
|
|
350
383
|
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
351
384
|
unrecognizedObjectKeys: "passthrough",
|
|
352
385
|
allowUnrecognizedUnionMembers: true,
|
|
353
386
|
allowUnrecognizedEnumValues: true,
|
|
354
387
|
breadcrumbsPrefix: ["response"],
|
|
355
|
-
}));
|
|
388
|
+
}), _response.rawResponse);
|
|
356
389
|
case 500:
|
|
357
390
|
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
358
391
|
unrecognizedObjectKeys: "passthrough",
|
|
359
392
|
allowUnrecognizedUnionMembers: true,
|
|
360
393
|
allowUnrecognizedEnumValues: true,
|
|
361
394
|
breadcrumbsPrefix: ["response"],
|
|
362
|
-
}));
|
|
395
|
+
}), _response.rawResponse);
|
|
363
396
|
default:
|
|
364
397
|
throw new errors.MavenAGIError({
|
|
365
398
|
statusCode: _response.error.statusCode,
|
|
366
399
|
body: _response.error.body,
|
|
400
|
+
rawResponse: _response.rawResponse,
|
|
367
401
|
});
|
|
368
402
|
}
|
|
369
403
|
}
|
|
@@ -372,12 +406,14 @@ class Analytics {
|
|
|
372
406
|
throw new errors.MavenAGIError({
|
|
373
407
|
statusCode: _response.error.statusCode,
|
|
374
408
|
body: _response.error.rawBody,
|
|
409
|
+
rawResponse: _response.rawResponse,
|
|
375
410
|
});
|
|
376
411
|
case "timeout":
|
|
377
412
|
throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/tables/feedback.");
|
|
378
413
|
case "unknown":
|
|
379
414
|
throw new errors.MavenAGIError({
|
|
380
415
|
message: _response.error.errorMessage,
|
|
416
|
+
rawResponse: _response.rawResponse,
|
|
381
417
|
});
|
|
382
418
|
}
|
|
383
419
|
});
|