mavenagi 1.2.60 → 1.2.62
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/BaseClient.d.ts +12 -0
- package/BaseClient.js +5 -3
- package/Client.d.ts +9 -0
- package/Client.js +43 -28
- package/api/resources/actions/client/Client.d.ts +26 -0
- package/api/resources/actions/client/Client.js +30 -3
- package/api/resources/agents/client/Client.d.ts +12 -0
- package/api/resources/agents/client/Client.js +16 -3
- package/api/resources/agents/client/requests/AgentPatchRequest.d.ts +3 -3
- package/api/resources/agents/types/AgentPrompting.d.ts +3 -3
- package/api/resources/analytics/client/Client.d.ts +14 -0
- package/api/resources/analytics/client/Client.js +22 -7
- package/api/resources/analytics/types/ConversationMedian.d.ts +4 -0
- package/api/resources/analytics/types/ConversationPercentile.d.ts +4 -0
- package/api/resources/analytics/types/RowBase.d.ts +5 -1
- package/api/resources/analytics/types/Series.d.ts +4 -1
- package/api/resources/analytics/types/TimeSeries.d.ts +5 -1
- package/api/resources/appDirectory/client/Client.d.ts +12 -0
- package/api/resources/appDirectory/client/Client.js +16 -3
- package/api/resources/appSettings/client/Client.d.ts +6 -0
- package/api/resources/appSettings/client/Client.js +8 -1
- package/api/resources/assets/client/Client.d.ts +4 -0
- package/api/resources/assets/client/Client.js +7 -2
- package/api/resources/capabilities/client/Client.d.ts +118 -0
- package/api/resources/capabilities/client/Client.js +521 -0
- package/api/resources/capabilities/client/index.d.ts +1 -0
- package/api/resources/capabilities/client/index.js +17 -0
- package/api/resources/capabilities/client/requests/CapabilitiesSearchRequest.d.ts +36 -0
- package/api/resources/capabilities/client/requests/CapabilitiesSearchRequest.js +3 -0
- package/api/resources/capabilities/client/requests/DeleteCapabilityByTypeRequest.d.ts +18 -0
- package/api/resources/capabilities/client/requests/DeleteCapabilityByTypeRequest.js +3 -0
- package/api/resources/capabilities/client/requests/GetCapabilityByTypeRequest.d.ts +22 -0
- package/api/resources/capabilities/client/requests/GetCapabilityByTypeRequest.js +3 -0
- package/api/resources/capabilities/client/requests/PatchCapabilityByTypeRequest.d.ts +24 -0
- package/api/resources/capabilities/client/requests/PatchCapabilityByTypeRequest.js +3 -0
- package/api/resources/capabilities/client/requests/index.d.ts +4 -0
- package/api/resources/capabilities/client/requests/index.js +2 -0
- package/api/resources/capabilities/exports.d.ts +2 -0
- package/api/resources/capabilities/exports.js +21 -0
- package/api/resources/capabilities/index.d.ts +2 -0
- package/api/resources/capabilities/index.js +18 -0
- package/api/resources/capabilities/types/CapabilitiesSearchResponse.d.ts +43 -0
- package/api/resources/capabilities/types/CapabilitiesSearchResponse.js +3 -0
- package/api/resources/capabilities/types/CapabilityResponse.d.ts +23 -0
- package/api/resources/capabilities/types/CapabilityResponse.js +3 -0
- package/api/resources/capabilities/types/CapabilitySortField.d.ts +7 -0
- package/api/resources/capabilities/types/CapabilitySortField.js +10 -0
- package/api/resources/capabilities/types/CapabilitySummary.d.ts +28 -0
- package/api/resources/capabilities/types/CapabilitySummary.js +3 -0
- package/api/resources/capabilities/types/index.d.ts +4 -0
- package/api/resources/capabilities/types/index.js +20 -0
- package/api/resources/charters/client/Client.d.ts +245 -0
- package/api/resources/charters/client/Client.js +884 -0
- package/api/resources/charters/client/index.d.ts +1 -0
- package/api/resources/charters/client/index.js +17 -0
- package/api/resources/charters/client/requests/CharterDeleteRequest.d.ts +20 -0
- package/api/resources/charters/client/requests/CharterDeleteRequest.js +3 -0
- package/api/resources/charters/client/requests/CharterGetAncestorsRequest.d.ts +8 -0
- package/api/resources/charters/client/requests/CharterGetAncestorsRequest.js +3 -0
- package/api/resources/charters/client/requests/CharterGetRequest.d.ts +8 -0
- package/api/resources/charters/client/requests/CharterGetRequest.js +3 -0
- package/api/resources/charters/client/requests/CharterPatchRequest.d.ts +67 -0
- package/api/resources/charters/client/requests/CharterPatchRequest.js +3 -0
- package/api/resources/charters/client/requests/index.d.ts +4 -0
- package/api/resources/charters/client/requests/index.js +2 -0
- package/api/resources/charters/exports.d.ts +2 -0
- package/api/resources/charters/exports.js +21 -0
- package/api/resources/charters/index.d.ts +1 -0
- package/api/resources/charters/index.js +1 -0
- package/api/resources/charters/types/CharterAncestorsResponse.d.ts +8 -0
- package/api/resources/charters/types/CharterAncestorsResponse.js +3 -0
- package/api/resources/charters/types/CharterBase.d.ts +14 -0
- package/api/resources/charters/types/CharterBase.js +3 -0
- package/api/resources/charters/types/CharterChildrenExclusionPolicy.d.ts +1 -1
- package/api/resources/charters/types/CharterChildrenExclusionPolicy.js +1 -1
- package/api/resources/charters/types/CharterChildrenGroup.d.ts +18 -0
- package/api/resources/charters/types/CharterChildrenGroup.js +3 -0
- package/api/resources/charters/types/CharterContent.d.ts +60 -0
- package/api/resources/charters/types/CharterContent.js +3 -0
- package/api/resources/charters/types/CharterKnowledgeBaseReference.d.ts +16 -0
- package/api/resources/charters/types/CharterKnowledgeBaseReference.js +3 -0
- package/api/resources/charters/types/CharterListChildrenRequest.d.ts +18 -0
- package/api/resources/charters/types/CharterListChildrenRequest.js +3 -0
- package/api/resources/charters/types/CharterListChildrenResponse.d.ts +55 -0
- package/api/resources/charters/types/CharterListChildrenResponse.js +3 -0
- package/api/resources/charters/types/CharterPatchReferences.d.ts +22 -0
- package/api/resources/charters/types/CharterPatchReferences.js +3 -0
- package/api/resources/charters/types/CharterReferences.d.ts +21 -0
- package/api/resources/charters/types/CharterReferences.js +3 -0
- package/api/resources/charters/types/CharterRequest.d.ts +36 -0
- package/api/resources/charters/types/CharterRequest.js +3 -0
- package/api/resources/charters/types/CharterResponse.d.ts +66 -0
- package/api/resources/charters/types/CharterResponse.js +3 -0
- package/api/resources/charters/types/CharterSearchField.d.ts +5 -0
- package/api/resources/charters/types/CharterSearchField.js +8 -0
- package/api/resources/charters/types/CharterSearchFilter.d.ts +18 -0
- package/api/resources/charters/types/CharterSearchFilter.js +3 -0
- package/api/resources/charters/types/CharterSearchRequest.d.ts +5 -0
- package/api/resources/charters/types/CharterSearchRequest.js +3 -0
- package/api/resources/charters/types/CharterSearchResponse.d.ts +36 -0
- package/api/resources/charters/types/CharterSearchResponse.js +3 -0
- package/api/resources/charters/types/CharterStatus.d.ts +2 -2
- package/api/resources/charters/types/CharterStatus.js +2 -2
- package/api/resources/charters/types/CharterSummary.d.ts +1 -9
- package/api/resources/charters/types/CharterType.d.ts +4 -4
- package/api/resources/charters/types/CharterType.js +4 -4
- package/api/resources/charters/types/index.d.ts +15 -0
- package/api/resources/charters/types/index.js +15 -0
- package/api/resources/commons/errors/BadRequestError.d.ts +1 -0
- package/api/resources/commons/errors/BadRequestError.js +1 -1
- package/api/resources/commons/errors/NotFoundError.d.ts +1 -0
- package/api/resources/commons/errors/NotFoundError.js +1 -1
- package/api/resources/commons/errors/PayloadTooLargeError.d.ts +1 -0
- package/api/resources/commons/errors/PayloadTooLargeError.js +1 -1
- package/api/resources/commons/errors/ServerError.d.ts +1 -0
- package/api/resources/commons/errors/ServerError.js +1 -1
- package/api/resources/commons/errors/TooManyRequestsError.d.ts +1 -0
- package/api/resources/commons/errors/TooManyRequestsError.js +1 -1
- package/api/resources/commons/types/ActionResponse.d.ts +11 -2
- package/api/resources/commons/types/AskType.d.ts +2 -2
- package/api/resources/commons/types/AskType.js +2 -2
- package/api/resources/commons/types/BaseConversationResponse.d.ts +6 -0
- package/api/resources/commons/types/BotObjectResponse.d.ts +1 -1
- package/api/resources/commons/types/CapabilityBase.d.ts +23 -0
- package/api/resources/commons/types/CapabilityBase.js +3 -0
- package/api/resources/commons/types/CapabilityStatus.d.ts +17 -0
- package/api/resources/commons/types/CapabilityStatus.js +20 -0
- package/api/resources/commons/types/CapabilityType.d.ts +8 -0
- package/api/resources/commons/types/CapabilityType.js +11 -0
- package/api/resources/commons/types/ConversationRound.d.ts +1 -1
- package/api/resources/commons/types/ConversationRound.js +1 -1
- package/api/resources/commons/types/EntityType.d.ts +5 -1
- package/api/resources/commons/types/EntityType.js +5 -1
- package/api/resources/commons/types/ErrorMessage.d.ts +3 -0
- package/api/resources/commons/types/ErrorReason.d.ts +31 -0
- package/api/resources/commons/types/ErrorReason.js +34 -0
- package/api/resources/commons/types/IntelligentFieldPrecondition.d.ts +0 -4
- package/api/resources/commons/types/LlmPersona.d.ts +1 -1
- package/api/resources/commons/types/LlmPersona.js +1 -1
- package/api/resources/commons/types/MetadataComparisonCondition.d.ts +10 -0
- package/api/resources/commons/types/MetadataComparisonCondition.js +3 -0
- package/api/resources/commons/types/MetadataComparisonOperator.d.ts +22 -0
- package/api/resources/commons/types/MetadataComparisonOperator.js +25 -0
- package/api/resources/commons/types/MetadataCondition.d.ts +21 -0
- package/api/resources/commons/types/MetadataCondition.js +3 -0
- package/api/resources/commons/types/MetadataEntryCondition.d.ts +10 -0
- package/api/resources/commons/types/MetadataEntryCondition.js +3 -0
- package/api/resources/commons/types/MetadataFilter.d.ts +41 -0
- package/api/resources/commons/types/MetadataFilter.js +3 -0
- package/api/resources/commons/types/MetadataFilterGroup.d.ts +14 -0
- package/api/resources/commons/types/MetadataFilterGroup.js +3 -0
- package/api/resources/commons/types/SimulationContext.d.ts +2 -2
- package/api/resources/commons/types/SystemEventName.d.ts +3 -0
- package/api/resources/commons/types/SystemEventName.js +3 -0
- package/api/resources/commons/types/index.d.ts +10 -0
- package/api/resources/commons/types/index.js +10 -0
- package/api/resources/conversation/client/Client.d.ts +33 -0
- package/api/resources/conversation/client/Client.js +49 -17
- package/api/resources/conversation/types/AskRequest.d.ts +10 -10
- package/api/resources/conversation/types/ConversationFilter.d.ts +6 -1
- package/api/resources/conversationKickoffs/client/Client.d.ts +45 -0
- package/api/resources/conversationKickoffs/client/Client.js +175 -0
- package/api/resources/conversationKickoffs/client/index.d.ts +1 -0
- package/api/resources/conversationKickoffs/client/index.js +17 -0
- package/api/resources/conversationKickoffs/client/requests/CreateConversationKickoffRequest.d.ts +22 -0
- package/api/resources/conversationKickoffs/client/requests/CreateConversationKickoffRequest.js +3 -0
- package/api/resources/conversationKickoffs/client/requests/index.d.ts +1 -0
- package/api/resources/conversationKickoffs/client/requests/index.js +2 -0
- package/api/resources/conversationKickoffs/exports.d.ts +2 -0
- package/api/resources/conversationKickoffs/exports.js +21 -0
- package/api/resources/conversationKickoffs/index.d.ts +2 -0
- package/api/resources/conversationKickoffs/index.js +18 -0
- package/api/resources/conversationKickoffs/types/ConversationKickoff.d.ts +27 -0
- package/api/resources/conversationKickoffs/types/ConversationKickoff.js +3 -0
- package/api/resources/conversationKickoffs/types/index.d.ts +1 -0
- package/api/resources/conversationKickoffs/types/index.js +17 -0
- package/api/resources/customers/client/Client.d.ts +8 -0
- package/api/resources/customers/client/Client.js +12 -3
- package/api/resources/events/client/Client.d.ts +8 -0
- package/api/resources/events/client/Client.js +12 -3
- package/api/resources/inbox/client/Client.d.ts +16 -0
- package/api/resources/inbox/client/Client.js +22 -5
- package/api/resources/index.d.ts +7 -0
- package/api/resources/index.js +8 -1
- package/api/resources/integrations/client/Client.d.ts +2 -0
- package/api/resources/integrations/client/Client.js +4 -1
- package/api/resources/intelligentFields/client/Client.d.ts +41 -4
- package/api/resources/intelligentFields/client/Client.js +49 -9
- package/api/resources/intelligentFields/client/requests/IntelligentFieldDeleteRequest.d.ts +1 -1
- package/api/resources/intelligentFields/client/requests/IntelligentFieldGetRequest.d.ts +4 -0
- package/api/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.d.ts +14 -5
- package/api/resources/intelligentFields/types/EnumOption.d.ts +8 -1
- package/api/resources/intelligentFields/types/IntelligentFieldBase.d.ts +1 -1
- package/api/resources/intelligentFields/types/IntelligentFieldCore.d.ts +12 -15
- package/api/resources/intelligentFields/types/IntelligentFieldDetailResponse.d.ts +5 -2
- package/api/resources/intelligentFields/types/IntelligentFieldRequest.d.ts +10 -2
- package/api/resources/intelligentFields/types/IntelligentFieldResponse.d.ts +2 -8
- package/api/resources/intelligentFields/types/IntelligentFieldType.d.ts +10 -0
- package/api/resources/intelligentFields/types/IntelligentFieldType.js +10 -0
- package/api/resources/intelligentFields/types/index.d.ts +0 -1
- package/api/resources/intelligentFields/types/index.js +0 -1
- package/api/resources/knowledge/client/Client.d.ts +35 -0
- package/api/resources/knowledge/client/Client.js +50 -16
- package/api/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +13 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +4 -2
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +33 -9
- package/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +7 -1
- package/api/resources/organizations/client/Client.d.ts +12 -0
- package/api/resources/organizations/client/Client.js +17 -4
- package/api/resources/segments/client/Client.d.ts +10 -0
- package/api/resources/segments/client/Client.js +14 -3
- package/api/resources/translations/client/Client.d.ts +2 -0
- package/api/resources/translations/client/Client.js +4 -1
- package/api/resources/triggers/client/Client.d.ts +31 -0
- package/api/resources/triggers/client/Client.js +35 -3
- package/api/resources/triggers/types/EventTriggerBase.d.ts +0 -4
- package/api/resources/triggers/types/EventTriggerRequest.d.ts +4 -0
- package/api/resources/triggers/types/EventTriggerResponse.d.ts +11 -3
- package/api/resources/users/client/Client.d.ts +10 -0
- package/api/resources/users/client/Client.js +13 -2
- package/api/resources/voice/client/Client.d.ts +2 -0
- package/api/resources/voice/client/Client.js +4 -1
- package/api/resources/voiceConversations/client/Client.d.ts +4 -1
- package/api/resources/voiceConversations/client/Client.js +2 -1
- package/api/resources/voiceConversations/client/Socket.d.ts +11 -0
- package/api/resources/voiceConversations/client/Socket.js +15 -0
- package/core/fetcher/Fetcher.js +9 -92
- package/core/fetcher/getResponseBody.js +11 -0
- package/core/fetcher/makePassthroughRequest.js +26 -4
- package/core/fetcher/redactUrl.d.ts +2 -0
- package/core/fetcher/redactUrl.js +88 -0
- package/core/fetcher/signals.js +9 -1
- package/core/file/file.js +3 -0
- package/core/form-data-utils/FormDataWrapper.js +3 -0
- package/core/requestBody.d.ts +12 -0
- package/core/requestBody.js +26 -0
- package/core/runtime/index.d.ts +1 -1
- package/core/runtime/index.js +2 -1
- package/core/runtime/runtime.d.ts +19 -0
- package/core/runtime/runtime.js +74 -2
- package/core/schemas/builders/schema-utils/JsonError.js +2 -2
- package/core/schemas/builders/schema-utils/ParseError.js +2 -2
- package/core/stream/Stream.d.ts +45 -1
- package/core/stream/Stream.js +323 -84
- package/core/stream/index.d.ts +1 -0
- package/core/url/qs.js +2 -2
- package/core/websocket/ws.d.ts +6 -0
- package/core/websocket/ws.js +14 -1
- package/errors/MavenAGIError.d.ts +1 -0
- package/errors/MavenAGIError.js +5 -1
- package/errors/MavenAGITimeoutError.d.ts +2 -2
- package/errors/MavenAGITimeoutError.js +40 -6
- package/package.json +2 -2
- package/reference.md +1170 -126
- package/serialization/resources/capabilities/client/index.d.ts +1 -0
- package/serialization/resources/capabilities/client/index.js +17 -0
- package/serialization/resources/capabilities/client/requests/CapabilitiesSearchRequest.d.ts +21 -0
- package/serialization/resources/capabilities/client/requests/CapabilitiesSearchRequest.js +55 -0
- package/serialization/resources/capabilities/client/requests/PatchCapabilityByTypeRequest.d.ts +10 -0
- package/serialization/resources/capabilities/client/requests/PatchCapabilityByTypeRequest.js +42 -0
- package/serialization/resources/capabilities/client/requests/index.d.ts +2 -0
- package/serialization/resources/capabilities/client/requests/index.js +7 -0
- package/serialization/resources/capabilities/index.d.ts +2 -0
- package/serialization/resources/capabilities/index.js +18 -0
- package/serialization/resources/capabilities/types/CapabilitiesSearchResponse.d.ts +11 -0
- package/serialization/resources/capabilities/types/CapabilitiesSearchResponse.js +45 -0
- package/serialization/resources/capabilities/types/CapabilityResponse.d.ts +23 -0
- package/serialization/resources/capabilities/types/CapabilityResponse.js +53 -0
- package/serialization/resources/capabilities/types/CapabilitySortField.d.ts +7 -0
- package/serialization/resources/{intelligentFields/types/IntelligentFieldStatus.js → capabilities/types/CapabilitySortField.js} +2 -2
- package/serialization/resources/capabilities/types/CapabilitySummary.d.ts +13 -0
- package/serialization/resources/capabilities/types/CapabilitySummary.js +47 -0
- package/serialization/resources/capabilities/types/index.d.ts +4 -0
- package/serialization/resources/capabilities/types/index.js +20 -0
- package/serialization/resources/charters/client/index.d.ts +1 -0
- package/serialization/resources/charters/client/index.js +17 -0
- package/serialization/resources/charters/client/requests/CharterPatchRequest.d.ts +24 -0
- package/serialization/resources/charters/client/requests/CharterPatchRequest.js +57 -0
- package/serialization/resources/charters/client/requests/index.d.ts +1 -0
- package/serialization/resources/charters/client/requests/index.js +5 -0
- package/serialization/resources/charters/index.d.ts +1 -0
- package/serialization/resources/charters/index.js +1 -0
- package/serialization/resources/charters/types/CharterAncestorsResponse.d.ts +10 -0
- package/serialization/resources/charters/types/CharterAncestorsResponse.js +42 -0
- package/serialization/resources/charters/types/CharterBase.d.ts +11 -0
- package/serialization/resources/charters/types/CharterBase.js +43 -0
- package/serialization/resources/charters/types/CharterChildrenGroup.d.ts +13 -0
- package/serialization/resources/charters/types/CharterChildrenGroup.js +45 -0
- package/serialization/resources/charters/types/CharterContent.d.ts +19 -0
- package/serialization/resources/charters/types/CharterContent.js +54 -0
- package/serialization/resources/charters/types/CharterKnowledgeBaseReference.d.ts +11 -0
- package/serialization/resources/charters/types/CharterKnowledgeBaseReference.js +44 -0
- package/serialization/resources/charters/types/CharterListChildrenRequest.d.ts +11 -0
- package/serialization/resources/charters/types/CharterListChildrenRequest.js +45 -0
- package/serialization/resources/charters/types/CharterListChildrenResponse.d.ts +11 -0
- package/serialization/resources/charters/types/CharterListChildrenResponse.js +45 -0
- package/serialization/resources/charters/types/CharterPatchReferences.d.ts +12 -0
- package/serialization/resources/charters/types/CharterPatchReferences.js +44 -0
- package/serialization/resources/charters/types/CharterReferences.d.ts +12 -0
- package/serialization/resources/charters/types/CharterReferences.js +44 -0
- package/serialization/resources/charters/types/CharterRequest.d.ts +13 -0
- package/serialization/resources/charters/types/CharterRequest.js +47 -0
- package/serialization/resources/charters/types/CharterResponse.d.ts +25 -0
- package/serialization/resources/charters/types/CharterResponse.js +60 -0
- package/serialization/resources/charters/types/CharterSearchField.d.ts +7 -0
- package/serialization/resources/charters/types/CharterSearchField.js +39 -0
- package/serialization/resources/charters/types/CharterSearchFilter.d.ts +12 -0
- package/serialization/resources/charters/types/CharterSearchFilter.js +44 -0
- package/serialization/resources/charters/types/CharterSearchRequest.d.ts +13 -0
- package/serialization/resources/charters/types/CharterSearchRequest.js +47 -0
- package/serialization/resources/charters/types/CharterSearchResponse.d.ts +11 -0
- package/serialization/resources/charters/types/CharterSearchResponse.js +45 -0
- package/serialization/resources/charters/types/CharterSummary.d.ts +0 -2
- package/serialization/resources/charters/types/CharterSummary.js +0 -2
- package/serialization/resources/charters/types/index.d.ts +15 -0
- package/serialization/resources/charters/types/index.js +15 -0
- package/serialization/resources/commons/types/ActionResponse.d.ts +3 -2
- package/serialization/resources/commons/types/ActionResponse.js +4 -2
- package/serialization/resources/commons/types/BaseConversationResponse.d.ts +1 -0
- package/serialization/resources/commons/types/BaseConversationResponse.js +1 -0
- package/serialization/resources/commons/types/CapabilityBase.d.ts +14 -0
- package/serialization/resources/commons/types/CapabilityBase.js +46 -0
- package/serialization/resources/{intelligentFields/types/IntelligentFieldStatus.d.ts → commons/types/CapabilityStatus.d.ts} +2 -2
- package/serialization/resources/commons/types/CapabilityStatus.js +39 -0
- package/serialization/resources/commons/types/CapabilityType.d.ts +7 -0
- package/serialization/resources/commons/types/CapabilityType.js +39 -0
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +1 -1
- package/serialization/resources/commons/types/ErrorMessage.d.ts +2 -0
- package/serialization/resources/commons/types/ErrorMessage.js +2 -0
- package/serialization/resources/commons/types/ErrorReason.d.ts +7 -0
- package/serialization/resources/commons/types/ErrorReason.js +49 -0
- package/serialization/resources/commons/types/MetadataComparisonCondition.d.ts +11 -0
- package/serialization/resources/commons/types/MetadataComparisonCondition.js +43 -0
- package/serialization/resources/commons/types/MetadataComparisonOperator.d.ts +7 -0
- package/serialization/resources/commons/types/MetadataComparisonOperator.js +39 -0
- package/serialization/resources/commons/types/MetadataCondition.d.ts +19 -0
- package/serialization/resources/commons/types/MetadataCondition.js +51 -0
- package/serialization/resources/commons/types/MetadataEntryCondition.d.ts +11 -0
- package/serialization/resources/commons/types/MetadataEntryCondition.js +43 -0
- package/serialization/resources/commons/types/MetadataFilter.d.ts +14 -0
- package/serialization/resources/commons/types/MetadataFilter.js +49 -0
- package/serialization/resources/commons/types/MetadataFilterGroup.d.ts +11 -0
- package/serialization/resources/commons/types/MetadataFilterGroup.js +44 -0
- package/serialization/resources/commons/types/SystemEventName.d.ts +1 -1
- package/serialization/resources/commons/types/SystemEventName.js +1 -0
- package/serialization/resources/commons/types/index.d.ts +10 -0
- package/serialization/resources/commons/types/index.js +10 -0
- package/serialization/resources/conversationKickoffs/client/index.d.ts +1 -0
- package/serialization/resources/conversationKickoffs/client/index.js +17 -0
- package/serialization/resources/conversationKickoffs/client/requests/CreateConversationKickoffRequest.d.ts +12 -0
- package/serialization/resources/conversationKickoffs/client/requests/CreateConversationKickoffRequest.js +44 -0
- package/serialization/resources/conversationKickoffs/client/requests/index.d.ts +1 -0
- package/serialization/resources/conversationKickoffs/client/requests/index.js +5 -0
- package/serialization/resources/conversationKickoffs/index.d.ts +2 -0
- package/serialization/resources/conversationKickoffs/index.js +18 -0
- package/serialization/resources/conversationKickoffs/types/ConversationKickoff.d.ts +11 -0
- package/serialization/resources/conversationKickoffs/types/ConversationKickoff.js +45 -0
- package/serialization/resources/conversationKickoffs/types/index.d.ts +1 -0
- package/serialization/resources/conversationKickoffs/types/index.js +17 -0
- package/serialization/resources/index.d.ts +7 -0
- package/serialization/resources/index.js +8 -1
- package/serialization/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.d.ts +3 -2
- package/serialization/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.js +3 -2
- package/serialization/resources/intelligentFields/types/EnumOption.d.ts +1 -0
- package/serialization/resources/intelligentFields/types/EnumOption.js +1 -0
- package/serialization/resources/intelligentFields/types/IntelligentFieldCore.d.ts +0 -2
- package/serialization/resources/intelligentFields/types/IntelligentFieldCore.js +0 -2
- package/serialization/resources/intelligentFields/types/IntelligentFieldRequest.d.ts +2 -0
- package/serialization/resources/intelligentFields/types/IntelligentFieldRequest.js +2 -0
- package/serialization/resources/intelligentFields/types/IntelligentFieldResponse.d.ts +2 -5
- package/serialization/resources/intelligentFields/types/IntelligentFieldResponse.js +3 -5
- package/serialization/resources/intelligentFields/types/index.d.ts +0 -1
- package/serialization/resources/intelligentFields/types/index.js +0 -1
- package/serialization/resources/knowledge/types/KnowledgeDocumentFilter.d.ts +2 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentFilter.js +2 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +0 -2
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +0 -2
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +2 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +2 -0
- package/serialization/resources/triggers/types/EventTriggerBase.d.ts +0 -2
- package/serialization/resources/triggers/types/EventTriggerBase.js +0 -2
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +2 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.js +2 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.d.ts +2 -1
- package/serialization/resources/triggers/types/EventTriggerResponse.js +3 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/intelligentFields/types/IntelligentFieldStatus.d.ts +0 -7
- package/api/resources/intelligentFields/types/IntelligentFieldStatus.js +0 -10
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient";
|
|
3
|
+
import * as core from "../../../../core";
|
|
4
|
+
import * as MavenAGI from "../../../index";
|
|
5
|
+
export declare namespace CapabilitiesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class CapabilitiesClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<CapabilitiesClient.Options>;
|
|
12
|
+
constructor(options: CapabilitiesClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Fetch one of an agent's capabilities by its type and reference ID.
|
|
15
|
+
*
|
|
16
|
+
* The response carries the same fields the capability's own API returns, so an Action read
|
|
17
|
+
* here and an Action read from the Actions API are the same object. Intelligent Fields are the
|
|
18
|
+
* one exception: their own API also returns the charters referencing the field, which this
|
|
19
|
+
* endpoint leaves out.
|
|
20
|
+
*
|
|
21
|
+
* @param {MavenAGI.CapabilityType} capabilityType - Which kind of capability to fetch.
|
|
22
|
+
* @param {string} referenceId - The capability's reference ID, unique within its type and app.
|
|
23
|
+
* @param {MavenAGI.GetCapabilityByTypeRequest} request
|
|
24
|
+
* @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
27
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
28
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
29
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
30
|
+
* @throws {@link MavenAGI.ServerError}
|
|
31
|
+
* @throws {@link errors.MavenAGIError}
|
|
32
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await client.capabilities.getCapability("ACTION", "referenceId")
|
|
36
|
+
*/
|
|
37
|
+
getCapability(capabilityType: MavenAGI.CapabilityType, referenceId: string, request?: MavenAGI.GetCapabilityByTypeRequest, requestOptions?: CapabilitiesClient.RequestOptions): core.HttpResponsePromise<MavenAGI.CapabilityResponse>;
|
|
38
|
+
private __getCapability;
|
|
39
|
+
/**
|
|
40
|
+
* Set whether the agent uses a capability, whatever kind it is. This is the publish and
|
|
41
|
+
* unpublish operation, and it works the same way for every capability type.
|
|
42
|
+
*
|
|
43
|
+
* Everything else about a capability -- its name, its description, and any settings
|
|
44
|
+
* particular to its kind -- is changed through that capability's own API.
|
|
45
|
+
*
|
|
46
|
+
* @param {MavenAGI.CapabilityType} capabilityType - Which kind of capability to update.
|
|
47
|
+
* @param {string} referenceId - The capability's reference ID, unique within its type and app.
|
|
48
|
+
* @param {MavenAGI.PatchCapabilityByTypeRequest} request
|
|
49
|
+
* @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
+
*
|
|
51
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
52
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
53
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
54
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
55
|
+
* @throws {@link MavenAGI.ServerError}
|
|
56
|
+
* @throws {@link errors.MavenAGIError}
|
|
57
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await client.capabilities.patchCapability("ACTION", "referenceId")
|
|
61
|
+
*/
|
|
62
|
+
patchCapability(capabilityType: MavenAGI.CapabilityType, referenceId: string, request?: MavenAGI.PatchCapabilityByTypeRequest, requestOptions?: CapabilitiesClient.RequestOptions): core.HttpResponsePromise<MavenAGI.CapabilityResponse>;
|
|
63
|
+
private __patchCapability;
|
|
64
|
+
/**
|
|
65
|
+
* Delete one of an agent's capabilities. The agent stops using it, and it stops being
|
|
66
|
+
* addressable: a later get, patch or delete of the same capability is a 404, and it no longer
|
|
67
|
+
* appears in search.
|
|
68
|
+
*
|
|
69
|
+
* With `variantReferenceId`, an intelligent field's delete is staged in that variant instead,
|
|
70
|
+
* and takes effect when the variant is committed. Until then the agent keeps using the field,
|
|
71
|
+
* and only a later patch or delete through the same variant is a 404.
|
|
72
|
+
*
|
|
73
|
+
* @param {MavenAGI.CapabilityType} capabilityType - Which kind of capability to delete.
|
|
74
|
+
* @param {string} referenceId - The capability's reference ID, unique within its type and app.
|
|
75
|
+
* @param {MavenAGI.DeleteCapabilityByTypeRequest} request
|
|
76
|
+
* @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
|
+
*
|
|
78
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
79
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
80
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
81
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
82
|
+
* @throws {@link MavenAGI.ServerError}
|
|
83
|
+
* @throws {@link errors.MavenAGIError}
|
|
84
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* await client.capabilities.deleteCapability("ACTION", "referenceId")
|
|
88
|
+
*/
|
|
89
|
+
deleteCapability(capabilityType: MavenAGI.CapabilityType, referenceId: string, request?: MavenAGI.DeleteCapabilityByTypeRequest, requestOptions?: CapabilitiesClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
90
|
+
private __deleteCapability;
|
|
91
|
+
/**
|
|
92
|
+
* Search an agent's capabilities of every kind at once, newest first by default.
|
|
93
|
+
*
|
|
94
|
+
* Returns the fields every capability shares. Fetch one by its type and reference ID for the
|
|
95
|
+
* settings particular to its kind.
|
|
96
|
+
*
|
|
97
|
+
* Sorting by `NAME` or `TYPE` instead orders ascending unless `sortDesc` says otherwise;
|
|
98
|
+
* `sortDesc` overrides the default either way.
|
|
99
|
+
*
|
|
100
|
+
* Deleted capabilities are never returned.
|
|
101
|
+
*
|
|
102
|
+
* @param {MavenAGI.CapabilitiesSearchRequest} request
|
|
103
|
+
* @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
|
+
*
|
|
105
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
106
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
107
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
108
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
109
|
+
* @throws {@link MavenAGI.ServerError}
|
|
110
|
+
* @throws {@link errors.MavenAGIError}
|
|
111
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.capabilities.searchCapabilities()
|
|
115
|
+
*/
|
|
116
|
+
searchCapabilities(request?: MavenAGI.CapabilitiesSearchRequest, requestOptions?: CapabilitiesClient.RequestOptions): core.HttpResponsePromise<MavenAGI.CapabilitiesSearchResponse>;
|
|
117
|
+
private __searchCapabilities;
|
|
118
|
+
}
|
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.CapabilitiesClient = void 0;
|
|
58
|
+
const BaseClient_1 = require("../../../../BaseClient");
|
|
59
|
+
const core = __importStar(require("../../../../core"));
|
|
60
|
+
const headers_1 = require("../../../../core/headers");
|
|
61
|
+
const requestBody_1 = require("../../../../core/requestBody");
|
|
62
|
+
const environments = __importStar(require("../../../../environments"));
|
|
63
|
+
const handleNonStatusCodeError_1 = require("../../../../errors/handleNonStatusCodeError");
|
|
64
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
65
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
66
|
+
const MavenAGI = __importStar(require("../../../index"));
|
|
67
|
+
class CapabilitiesClient {
|
|
68
|
+
constructor(options) {
|
|
69
|
+
this._options = (0, BaseClient_1.normalizeClientOptionsWithAuth)(options);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Fetch one of an agent's capabilities by its type and reference ID.
|
|
73
|
+
*
|
|
74
|
+
* The response carries the same fields the capability's own API returns, so an Action read
|
|
75
|
+
* here and an Action read from the Actions API are the same object. Intelligent Fields are the
|
|
76
|
+
* one exception: their own API also returns the charters referencing the field, which this
|
|
77
|
+
* endpoint leaves out.
|
|
78
|
+
*
|
|
79
|
+
* @param {MavenAGI.CapabilityType} capabilityType - Which kind of capability to fetch.
|
|
80
|
+
* @param {string} referenceId - The capability's reference ID, unique within its type and app.
|
|
81
|
+
* @param {MavenAGI.GetCapabilityByTypeRequest} request
|
|
82
|
+
* @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
83
|
+
*
|
|
84
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
85
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
86
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
87
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
88
|
+
* @throws {@link MavenAGI.ServerError}
|
|
89
|
+
* @throws {@link errors.MavenAGIError}
|
|
90
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* await client.capabilities.getCapability("ACTION", "referenceId")
|
|
94
|
+
*/
|
|
95
|
+
getCapability(capabilityType, referenceId, request = {}, requestOptions) {
|
|
96
|
+
return core.HttpResponsePromise.fromPromise(this.__getCapability(capabilityType, referenceId, request, requestOptions));
|
|
97
|
+
}
|
|
98
|
+
__getCapability(capabilityType_1, referenceId_1) {
|
|
99
|
+
return __awaiter(this, arguments, void 0, function* (capabilityType, referenceId, request = {}, requestOptions) {
|
|
100
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
101
|
+
const { appId, variantReferenceId, variantAppId } = request;
|
|
102
|
+
const _queryParams = {
|
|
103
|
+
appId,
|
|
104
|
+
variantReferenceId,
|
|
105
|
+
variantAppId,
|
|
106
|
+
};
|
|
107
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
108
|
+
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
109
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
110
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
111
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
112
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
113
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/capabilities/${core.url.encodePathParam(serializers.CapabilityType.jsonOrThrow(capabilityType))}/${core.url.encodePathParam(referenceId)}`),
|
|
114
|
+
method: "GET",
|
|
115
|
+
headers: _headers,
|
|
116
|
+
queryString: core.url
|
|
117
|
+
.queryBuilder()
|
|
118
|
+
.addMany(_queryParams)
|
|
119
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
120
|
+
.build(),
|
|
121
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
122
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
123
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
124
|
+
fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
|
|
125
|
+
logging: this._options.logging,
|
|
126
|
+
});
|
|
127
|
+
if (_response.ok) {
|
|
128
|
+
return {
|
|
129
|
+
data: serializers.CapabilityResponse.parseOrThrow(_response.body, {
|
|
130
|
+
unrecognizedObjectKeys: "passthrough",
|
|
131
|
+
allowUnrecognizedUnionMembers: true,
|
|
132
|
+
allowUnrecognizedEnumValues: true,
|
|
133
|
+
breadcrumbsPrefix: ["response"],
|
|
134
|
+
}),
|
|
135
|
+
rawResponse: _response.rawResponse,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (_response.error.reason === "status-code") {
|
|
139
|
+
switch (_response.error.statusCode) {
|
|
140
|
+
case 404:
|
|
141
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
142
|
+
unrecognizedObjectKeys: "passthrough",
|
|
143
|
+
allowUnrecognizedUnionMembers: true,
|
|
144
|
+
allowUnrecognizedEnumValues: true,
|
|
145
|
+
breadcrumbsPrefix: ["response"],
|
|
146
|
+
}), _response.rawResponse);
|
|
147
|
+
case 400:
|
|
148
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
149
|
+
unrecognizedObjectKeys: "passthrough",
|
|
150
|
+
allowUnrecognizedUnionMembers: true,
|
|
151
|
+
allowUnrecognizedEnumValues: true,
|
|
152
|
+
breadcrumbsPrefix: ["response"],
|
|
153
|
+
}), _response.rawResponse);
|
|
154
|
+
case 413:
|
|
155
|
+
throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
156
|
+
unrecognizedObjectKeys: "passthrough",
|
|
157
|
+
allowUnrecognizedUnionMembers: true,
|
|
158
|
+
allowUnrecognizedEnumValues: true,
|
|
159
|
+
breadcrumbsPrefix: ["response"],
|
|
160
|
+
}), _response.rawResponse);
|
|
161
|
+
case 429:
|
|
162
|
+
throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
163
|
+
unrecognizedObjectKeys: "passthrough",
|
|
164
|
+
allowUnrecognizedUnionMembers: true,
|
|
165
|
+
allowUnrecognizedEnumValues: true,
|
|
166
|
+
breadcrumbsPrefix: ["response"],
|
|
167
|
+
}), _response.rawResponse);
|
|
168
|
+
case 500:
|
|
169
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
170
|
+
unrecognizedObjectKeys: "passthrough",
|
|
171
|
+
allowUnrecognizedUnionMembers: true,
|
|
172
|
+
allowUnrecognizedEnumValues: true,
|
|
173
|
+
breadcrumbsPrefix: ["response"],
|
|
174
|
+
}), _response.rawResponse);
|
|
175
|
+
default:
|
|
176
|
+
throw new errors.MavenAGIError({
|
|
177
|
+
statusCode: _response.error.statusCode,
|
|
178
|
+
body: _response.error.body,
|
|
179
|
+
rawResponse: _response.rawResponse,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/capabilities/{capabilityType}/{referenceId}");
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Set whether the agent uses a capability, whatever kind it is. This is the publish and
|
|
188
|
+
* unpublish operation, and it works the same way for every capability type.
|
|
189
|
+
*
|
|
190
|
+
* Everything else about a capability -- its name, its description, and any settings
|
|
191
|
+
* particular to its kind -- is changed through that capability's own API.
|
|
192
|
+
*
|
|
193
|
+
* @param {MavenAGI.CapabilityType} capabilityType - Which kind of capability to update.
|
|
194
|
+
* @param {string} referenceId - The capability's reference ID, unique within its type and app.
|
|
195
|
+
* @param {MavenAGI.PatchCapabilityByTypeRequest} request
|
|
196
|
+
* @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
197
|
+
*
|
|
198
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
199
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
200
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
201
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
202
|
+
* @throws {@link MavenAGI.ServerError}
|
|
203
|
+
* @throws {@link errors.MavenAGIError}
|
|
204
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* await client.capabilities.patchCapability("ACTION", "referenceId")
|
|
208
|
+
*/
|
|
209
|
+
patchCapability(capabilityType, referenceId, request = {}, requestOptions) {
|
|
210
|
+
return core.HttpResponsePromise.fromPromise(this.__patchCapability(capabilityType, referenceId, request, requestOptions));
|
|
211
|
+
}
|
|
212
|
+
__patchCapability(capabilityType_1, referenceId_1) {
|
|
213
|
+
return __awaiter(this, arguments, void 0, function* (capabilityType, referenceId, request = {}, requestOptions) {
|
|
214
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
215
|
+
const { appId, variantReferenceId, variantAppId } = request, _body = __rest(request, ["appId", "variantReferenceId", "variantAppId"]);
|
|
216
|
+
const _queryParams = {
|
|
217
|
+
appId,
|
|
218
|
+
variantReferenceId,
|
|
219
|
+
variantAppId,
|
|
220
|
+
};
|
|
221
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
222
|
+
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
223
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
224
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
225
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
226
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
227
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/capabilities/${core.url.encodePathParam(serializers.CapabilityType.jsonOrThrow(capabilityType))}/${core.url.encodePathParam(referenceId)}`),
|
|
228
|
+
method: "PATCH",
|
|
229
|
+
headers: _headers,
|
|
230
|
+
contentType: "application/merge-patch+json",
|
|
231
|
+
queryString: core.url
|
|
232
|
+
.queryBuilder()
|
|
233
|
+
.addMany(_queryParams)
|
|
234
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
235
|
+
.build(),
|
|
236
|
+
requestType: "json",
|
|
237
|
+
body: (0, requestBody_1.mergeAdditionalBodyParameters)(serializers.PatchCapabilityByTypeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
238
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
239
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
240
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
241
|
+
fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
|
|
242
|
+
logging: this._options.logging,
|
|
243
|
+
});
|
|
244
|
+
if (_response.ok) {
|
|
245
|
+
return {
|
|
246
|
+
data: serializers.CapabilityResponse.parseOrThrow(_response.body, {
|
|
247
|
+
unrecognizedObjectKeys: "passthrough",
|
|
248
|
+
allowUnrecognizedUnionMembers: true,
|
|
249
|
+
allowUnrecognizedEnumValues: true,
|
|
250
|
+
breadcrumbsPrefix: ["response"],
|
|
251
|
+
}),
|
|
252
|
+
rawResponse: _response.rawResponse,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
if (_response.error.reason === "status-code") {
|
|
256
|
+
switch (_response.error.statusCode) {
|
|
257
|
+
case 404:
|
|
258
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
259
|
+
unrecognizedObjectKeys: "passthrough",
|
|
260
|
+
allowUnrecognizedUnionMembers: true,
|
|
261
|
+
allowUnrecognizedEnumValues: true,
|
|
262
|
+
breadcrumbsPrefix: ["response"],
|
|
263
|
+
}), _response.rawResponse);
|
|
264
|
+
case 400:
|
|
265
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
266
|
+
unrecognizedObjectKeys: "passthrough",
|
|
267
|
+
allowUnrecognizedUnionMembers: true,
|
|
268
|
+
allowUnrecognizedEnumValues: true,
|
|
269
|
+
breadcrumbsPrefix: ["response"],
|
|
270
|
+
}), _response.rawResponse);
|
|
271
|
+
case 413:
|
|
272
|
+
throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
273
|
+
unrecognizedObjectKeys: "passthrough",
|
|
274
|
+
allowUnrecognizedUnionMembers: true,
|
|
275
|
+
allowUnrecognizedEnumValues: true,
|
|
276
|
+
breadcrumbsPrefix: ["response"],
|
|
277
|
+
}), _response.rawResponse);
|
|
278
|
+
case 429:
|
|
279
|
+
throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
280
|
+
unrecognizedObjectKeys: "passthrough",
|
|
281
|
+
allowUnrecognizedUnionMembers: true,
|
|
282
|
+
allowUnrecognizedEnumValues: true,
|
|
283
|
+
breadcrumbsPrefix: ["response"],
|
|
284
|
+
}), _response.rawResponse);
|
|
285
|
+
case 500:
|
|
286
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
287
|
+
unrecognizedObjectKeys: "passthrough",
|
|
288
|
+
allowUnrecognizedUnionMembers: true,
|
|
289
|
+
allowUnrecognizedEnumValues: true,
|
|
290
|
+
breadcrumbsPrefix: ["response"],
|
|
291
|
+
}), _response.rawResponse);
|
|
292
|
+
default:
|
|
293
|
+
throw new errors.MavenAGIError({
|
|
294
|
+
statusCode: _response.error.statusCode,
|
|
295
|
+
body: _response.error.body,
|
|
296
|
+
rawResponse: _response.rawResponse,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v1/capabilities/{capabilityType}/{referenceId}");
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Delete one of an agent's capabilities. The agent stops using it, and it stops being
|
|
305
|
+
* addressable: a later get, patch or delete of the same capability is a 404, and it no longer
|
|
306
|
+
* appears in search.
|
|
307
|
+
*
|
|
308
|
+
* With `variantReferenceId`, an intelligent field's delete is staged in that variant instead,
|
|
309
|
+
* and takes effect when the variant is committed. Until then the agent keeps using the field,
|
|
310
|
+
* and only a later patch or delete through the same variant is a 404.
|
|
311
|
+
*
|
|
312
|
+
* @param {MavenAGI.CapabilityType} capabilityType - Which kind of capability to delete.
|
|
313
|
+
* @param {string} referenceId - The capability's reference ID, unique within its type and app.
|
|
314
|
+
* @param {MavenAGI.DeleteCapabilityByTypeRequest} request
|
|
315
|
+
* @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
316
|
+
*
|
|
317
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
318
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
319
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
320
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
321
|
+
* @throws {@link MavenAGI.ServerError}
|
|
322
|
+
* @throws {@link errors.MavenAGIError}
|
|
323
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* await client.capabilities.deleteCapability("ACTION", "referenceId")
|
|
327
|
+
*/
|
|
328
|
+
deleteCapability(capabilityType, referenceId, request = {}, requestOptions) {
|
|
329
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCapability(capabilityType, referenceId, request, requestOptions));
|
|
330
|
+
}
|
|
331
|
+
__deleteCapability(capabilityType_1, referenceId_1) {
|
|
332
|
+
return __awaiter(this, arguments, void 0, function* (capabilityType, referenceId, request = {}, requestOptions) {
|
|
333
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
334
|
+
const { appId, variantReferenceId, variantAppId } = request;
|
|
335
|
+
const _queryParams = {
|
|
336
|
+
appId,
|
|
337
|
+
variantReferenceId,
|
|
338
|
+
variantAppId,
|
|
339
|
+
};
|
|
340
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
341
|
+
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
342
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
343
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
344
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
345
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
346
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/capabilities/${core.url.encodePathParam(serializers.CapabilityType.jsonOrThrow(capabilityType))}/${core.url.encodePathParam(referenceId)}`),
|
|
347
|
+
method: "DELETE",
|
|
348
|
+
headers: _headers,
|
|
349
|
+
queryString: core.url
|
|
350
|
+
.queryBuilder()
|
|
351
|
+
.addMany(_queryParams)
|
|
352
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
353
|
+
.build(),
|
|
354
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
355
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
356
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
357
|
+
fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
|
|
358
|
+
logging: this._options.logging,
|
|
359
|
+
});
|
|
360
|
+
if (_response.ok) {
|
|
361
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
362
|
+
}
|
|
363
|
+
if (_response.error.reason === "status-code") {
|
|
364
|
+
switch (_response.error.statusCode) {
|
|
365
|
+
case 404:
|
|
366
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
367
|
+
unrecognizedObjectKeys: "passthrough",
|
|
368
|
+
allowUnrecognizedUnionMembers: true,
|
|
369
|
+
allowUnrecognizedEnumValues: true,
|
|
370
|
+
breadcrumbsPrefix: ["response"],
|
|
371
|
+
}), _response.rawResponse);
|
|
372
|
+
case 400:
|
|
373
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
374
|
+
unrecognizedObjectKeys: "passthrough",
|
|
375
|
+
allowUnrecognizedUnionMembers: true,
|
|
376
|
+
allowUnrecognizedEnumValues: true,
|
|
377
|
+
breadcrumbsPrefix: ["response"],
|
|
378
|
+
}), _response.rawResponse);
|
|
379
|
+
case 413:
|
|
380
|
+
throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
381
|
+
unrecognizedObjectKeys: "passthrough",
|
|
382
|
+
allowUnrecognizedUnionMembers: true,
|
|
383
|
+
allowUnrecognizedEnumValues: true,
|
|
384
|
+
breadcrumbsPrefix: ["response"],
|
|
385
|
+
}), _response.rawResponse);
|
|
386
|
+
case 429:
|
|
387
|
+
throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
388
|
+
unrecognizedObjectKeys: "passthrough",
|
|
389
|
+
allowUnrecognizedUnionMembers: true,
|
|
390
|
+
allowUnrecognizedEnumValues: true,
|
|
391
|
+
breadcrumbsPrefix: ["response"],
|
|
392
|
+
}), _response.rawResponse);
|
|
393
|
+
case 500:
|
|
394
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
395
|
+
unrecognizedObjectKeys: "passthrough",
|
|
396
|
+
allowUnrecognizedUnionMembers: true,
|
|
397
|
+
allowUnrecognizedEnumValues: true,
|
|
398
|
+
breadcrumbsPrefix: ["response"],
|
|
399
|
+
}), _response.rawResponse);
|
|
400
|
+
default:
|
|
401
|
+
throw new errors.MavenAGIError({
|
|
402
|
+
statusCode: _response.error.statusCode,
|
|
403
|
+
body: _response.error.body,
|
|
404
|
+
rawResponse: _response.rawResponse,
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/capabilities/{capabilityType}/{referenceId}");
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Search an agent's capabilities of every kind at once, newest first by default.
|
|
413
|
+
*
|
|
414
|
+
* Returns the fields every capability shares. Fetch one by its type and reference ID for the
|
|
415
|
+
* settings particular to its kind.
|
|
416
|
+
*
|
|
417
|
+
* Sorting by `NAME` or `TYPE` instead orders ascending unless `sortDesc` says otherwise;
|
|
418
|
+
* `sortDesc` overrides the default either way.
|
|
419
|
+
*
|
|
420
|
+
* Deleted capabilities are never returned.
|
|
421
|
+
*
|
|
422
|
+
* @param {MavenAGI.CapabilitiesSearchRequest} request
|
|
423
|
+
* @param {CapabilitiesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
424
|
+
*
|
|
425
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
426
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
427
|
+
* @throws {@link MavenAGI.PayloadTooLargeError}
|
|
428
|
+
* @throws {@link MavenAGI.TooManyRequestsError}
|
|
429
|
+
* @throws {@link MavenAGI.ServerError}
|
|
430
|
+
* @throws {@link errors.MavenAGIError}
|
|
431
|
+
* @throws {@link errors.MavenAGITimeoutError}
|
|
432
|
+
*
|
|
433
|
+
* @example
|
|
434
|
+
* await client.capabilities.searchCapabilities()
|
|
435
|
+
*/
|
|
436
|
+
searchCapabilities(request = {}, requestOptions) {
|
|
437
|
+
return core.HttpResponsePromise.fromPromise(this.__searchCapabilities(request, requestOptions));
|
|
438
|
+
}
|
|
439
|
+
__searchCapabilities() {
|
|
440
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
441
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
442
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
443
|
+
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
444
|
+
"X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
|
|
445
|
+
"X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
|
|
446
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
447
|
+
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
448
|
+
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, "/v1/capabilities/search"),
|
|
449
|
+
method: "POST",
|
|
450
|
+
headers: _headers,
|
|
451
|
+
contentType: "application/json",
|
|
452
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
453
|
+
requestType: "json",
|
|
454
|
+
body: (0, requestBody_1.mergeAdditionalBodyParameters)(serializers.CapabilitiesSearchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
455
|
+
timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
|
|
456
|
+
maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
|
|
457
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
458
|
+
fetchFn: (_p = this._options) === null || _p === void 0 ? void 0 : _p.fetch,
|
|
459
|
+
logging: this._options.logging,
|
|
460
|
+
});
|
|
461
|
+
if (_response.ok) {
|
|
462
|
+
return {
|
|
463
|
+
data: serializers.CapabilitiesSearchResponse.parseOrThrow(_response.body, {
|
|
464
|
+
unrecognizedObjectKeys: "passthrough",
|
|
465
|
+
allowUnrecognizedUnionMembers: true,
|
|
466
|
+
allowUnrecognizedEnumValues: true,
|
|
467
|
+
breadcrumbsPrefix: ["response"],
|
|
468
|
+
}),
|
|
469
|
+
rawResponse: _response.rawResponse,
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
if (_response.error.reason === "status-code") {
|
|
473
|
+
switch (_response.error.statusCode) {
|
|
474
|
+
case 404:
|
|
475
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
476
|
+
unrecognizedObjectKeys: "passthrough",
|
|
477
|
+
allowUnrecognizedUnionMembers: true,
|
|
478
|
+
allowUnrecognizedEnumValues: true,
|
|
479
|
+
breadcrumbsPrefix: ["response"],
|
|
480
|
+
}), _response.rawResponse);
|
|
481
|
+
case 400:
|
|
482
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
483
|
+
unrecognizedObjectKeys: "passthrough",
|
|
484
|
+
allowUnrecognizedUnionMembers: true,
|
|
485
|
+
allowUnrecognizedEnumValues: true,
|
|
486
|
+
breadcrumbsPrefix: ["response"],
|
|
487
|
+
}), _response.rawResponse);
|
|
488
|
+
case 413:
|
|
489
|
+
throw new MavenAGI.PayloadTooLargeError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
490
|
+
unrecognizedObjectKeys: "passthrough",
|
|
491
|
+
allowUnrecognizedUnionMembers: true,
|
|
492
|
+
allowUnrecognizedEnumValues: true,
|
|
493
|
+
breadcrumbsPrefix: ["response"],
|
|
494
|
+
}), _response.rawResponse);
|
|
495
|
+
case 429:
|
|
496
|
+
throw new MavenAGI.TooManyRequestsError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
497
|
+
unrecognizedObjectKeys: "passthrough",
|
|
498
|
+
allowUnrecognizedUnionMembers: true,
|
|
499
|
+
allowUnrecognizedEnumValues: true,
|
|
500
|
+
breadcrumbsPrefix: ["response"],
|
|
501
|
+
}), _response.rawResponse);
|
|
502
|
+
case 500:
|
|
503
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
504
|
+
unrecognizedObjectKeys: "passthrough",
|
|
505
|
+
allowUnrecognizedUnionMembers: true,
|
|
506
|
+
allowUnrecognizedEnumValues: true,
|
|
507
|
+
breadcrumbsPrefix: ["response"],
|
|
508
|
+
}), _response.rawResponse);
|
|
509
|
+
default:
|
|
510
|
+
throw new errors.MavenAGIError({
|
|
511
|
+
statusCode: _response.error.statusCode,
|
|
512
|
+
body: _response.error.body,
|
|
513
|
+
rawResponse: _response.rawResponse,
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/capabilities/search");
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
exports.CapabilitiesClient = CapabilitiesClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|