mavenagi 0.0.0-alpha.2
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 +30 -0
- package/Client.js +18 -0
- package/README.md +129 -0
- package/api/index.d.ts +1 -0
- package/api/index.js +1 -0
- package/api/resources/commons/errors/AgentNotFoundError.d.ts +8 -0
- package/api/resources/commons/errors/AgentNotFoundError.js +14 -0
- package/api/resources/commons/errors/index.d.ts +1 -0
- package/api/resources/commons/errors/index.js +1 -0
- package/api/resources/commons/index.d.ts +2 -0
- package/api/resources/commons/index.js +2 -0
- package/api/resources/commons/types/ErrorMessage.d.ts +6 -0
- package/api/resources/commons/types/ErrorMessage.js +4 -0
- package/api/resources/commons/types/User.d.ts +9 -0
- package/api/resources/commons/types/User.js +4 -0
- package/api/resources/commons/types/index.d.ts +2 -0
- package/api/resources/commons/types/index.js +2 -0
- package/api/resources/conversation/client/Client.d.ts +138 -0
- package/api/resources/conversation/client/Client.js +676 -0
- package/api/resources/conversation/client/index.d.ts +1 -0
- package/api/resources/conversation/client/index.js +1 -0
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +8 -0
- package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +14 -0
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +8 -0
- package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +14 -0
- package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +8 -0
- package/api/resources/conversation/errors/ConversationNotFoundError.js +14 -0
- package/api/resources/conversation/errors/EmptyConversationError.d.ts +8 -0
- package/api/resources/conversation/errors/EmptyConversationError.js +14 -0
- package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +8 -0
- package/api/resources/conversation/errors/InvalidConversationIdError.js +14 -0
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +8 -0
- package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +14 -0
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +8 -0
- package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +14 -0
- package/api/resources/conversation/errors/index.d.ts +7 -0
- package/api/resources/conversation/errors/index.js +7 -0
- package/api/resources/conversation/index.d.ts +3 -0
- package/api/resources/conversation/index.js +3 -0
- package/api/resources/conversation/types/ActionFormField.d.ts +9 -0
- package/api/resources/conversation/types/ActionFormField.js +4 -0
- package/api/resources/conversation/types/AskRequest.d.ts +12 -0
- package/api/resources/conversation/types/AskRequest.js +4 -0
- package/api/resources/conversation/types/AskStreamEndEvent.d.ts +7 -0
- package/api/resources/conversation/types/AskStreamEndEvent.js +4 -0
- package/api/resources/conversation/types/AskStreamMetadataEvent.d.ts +6 -0
- package/api/resources/conversation/types/AskStreamMetadataEvent.js +4 -0
- package/api/resources/conversation/types/AskStreamStartEvent.d.ts +6 -0
- package/api/resources/conversation/types/AskStreamStartEvent.js +4 -0
- package/api/resources/conversation/types/AskStreamTextEvent.d.ts +6 -0
- package/api/resources/conversation/types/AskStreamTextEvent.js +4 -0
- package/api/resources/conversation/types/BotActionFormResponse.d.ts +9 -0
- package/api/resources/conversation/types/BotActionFormResponse.js +4 -0
- package/api/resources/conversation/types/BotConversationMessageType.d.ts +9 -0
- package/api/resources/conversation/types/BotConversationMessageType.js +8 -0
- package/api/resources/conversation/types/BotMessage.d.ts +9 -0
- package/api/resources/conversation/types/BotMessage.js +4 -0
- package/api/resources/conversation/types/BotResponse.d.ts +13 -0
- package/api/resources/conversation/types/BotResponse.js +4 -0
- package/api/resources/conversation/types/BotResponseMetadata.d.ts +8 -0
- package/api/resources/conversation/types/BotResponseMetadata.js +4 -0
- package/api/resources/conversation/types/BotTextResponse.d.ts +6 -0
- package/api/resources/conversation/types/BotTextResponse.js +4 -0
- package/api/resources/conversation/types/ConversationBase.d.ts +10 -0
- package/api/resources/conversation/types/ConversationBase.js +4 -0
- package/api/resources/conversation/types/ConversationContext.d.ts +20 -0
- package/api/resources/conversation/types/ConversationContext.js +4 -0
- package/api/resources/conversation/types/ConversationMessageBase.d.ts +10 -0
- package/api/resources/conversation/types/ConversationMessageBase.js +4 -0
- package/api/resources/conversation/types/ConversationMessageContext.d.ts +12 -0
- package/api/resources/conversation/types/ConversationMessageContext.js +4 -0
- package/api/resources/conversation/types/ConversationMessageRequest.d.ts +6 -0
- package/api/resources/conversation/types/ConversationMessageRequest.js +4 -0
- package/api/resources/conversation/types/ConversationMessageResponse.d.ts +13 -0
- package/api/resources/conversation/types/ConversationMessageResponse.js +4 -0
- package/api/resources/conversation/types/ConversationRequest.d.ts +8 -0
- package/api/resources/conversation/types/ConversationRequest.js +4 -0
- package/api/resources/conversation/types/ConversationResponse.d.ts +8 -0
- package/api/resources/conversation/types/ConversationResponse.js +4 -0
- package/api/resources/conversation/types/FeedbackRequest.d.ts +12 -0
- package/api/resources/conversation/types/FeedbackRequest.js +4 -0
- package/api/resources/conversation/types/FeedbackType.d.ts +11 -0
- package/api/resources/conversation/types/FeedbackType.js +7 -0
- package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +7 -0
- package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.js +4 -0
- package/api/resources/conversation/types/Source.d.ts +7 -0
- package/api/resources/conversation/types/Source.js +4 -0
- package/api/resources/conversation/types/StreamResponse.d.ts +19 -0
- package/api/resources/conversation/types/StreamResponse.js +4 -0
- package/api/resources/conversation/types/UserConversationMessageType.d.ts +12 -0
- package/api/resources/conversation/types/UserConversationMessageType.js +8 -0
- package/api/resources/conversation/types/UserMessage.d.ts +8 -0
- package/api/resources/conversation/types/UserMessage.js +4 -0
- package/api/resources/conversation/types/index.d.ts +27 -0
- package/api/resources/conversation/types/index.js +27 -0
- package/api/resources/index.d.ts +9 -0
- package/api/resources/index.js +9 -0
- package/api/resources/knowledge/client/Client.d.ts +147 -0
- package/api/resources/knowledge/client/Client.js +615 -0
- package/api/resources/knowledge/client/index.d.ts +1 -0
- package/api/resources/knowledge/client/index.js +1 -0
- package/api/resources/knowledge/errors/DocumentCreationError.d.ts +7 -0
- package/api/resources/knowledge/errors/DocumentCreationError.js +13 -0
- package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +8 -0
- package/api/resources/knowledge/errors/DocumentNotFoundError.js +14 -0
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +8 -0
- package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +14 -0
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +8 -0
- package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +14 -0
- package/api/resources/knowledge/errors/VersionInProgressError.d.ts +8 -0
- package/api/resources/knowledge/errors/VersionInProgressError.js +14 -0
- package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +8 -0
- package/api/resources/knowledge/errors/VersionNotInProgressError.js +14 -0
- package/api/resources/knowledge/errors/index.d.ts +6 -0
- package/api/resources/knowledge/errors/index.js +6 -0
- package/api/resources/knowledge/index.d.ts +3 -0
- package/api/resources/knowledge/index.js +3 -0
- package/api/resources/knowledge/types/IdBody.d.ts +6 -0
- package/api/resources/knowledge/types/IdBody.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBase.d.ts +12 -0
- package/api/resources/knowledge/types/KnowledgeBase.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseId.d.ts +7 -0
- package/api/resources/knowledge/types/KnowledgeBaseId.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +12 -0
- package/api/resources/knowledge/types/KnowledgeBaseType.js +8 -0
- package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +10 -0
- package/api/resources/knowledge/types/KnowledgeBaseVersion.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseVersionType.d.ts +11 -0
- package/api/resources/knowledge/types/KnowledgeBaseVersionType.js +7 -0
- package/api/resources/knowledge/types/KnowledgeDocument.d.ts +20 -0
- package/api/resources/knowledge/types/KnowledgeDocument.js +4 -0
- package/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +9 -0
- package/api/resources/knowledge/types/KnowledgeDocumentId.js +4 -0
- package/api/resources/knowledge/types/index.d.ts +8 -0
- package/api/resources/knowledge/types/index.js +8 -0
- package/core/auth/BasicAuth.d.ts +8 -0
- package/core/auth/BasicAuth.js +23 -0
- package/core/auth/BearerToken.d.ts +5 -0
- package/core/auth/BearerToken.js +12 -0
- package/core/auth/index.d.ts +2 -0
- package/core/auth/index.js +2 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/APIResponse.js +1 -0
- package/core/fetcher/Fetcher.d.ts +36 -0
- package/core/fetcher/Fetcher.js +236 -0
- package/core/fetcher/Supplier.d.ts +4 -0
- package/core/fetcher/Supplier.js +19 -0
- package/core/fetcher/getHeader.d.ts +1 -0
- package/core/fetcher/getHeader.js +8 -0
- package/core/fetcher/index.d.ts +5 -0
- package/core/fetcher/index.js +3 -0
- package/core/index.d.ts +5 -0
- package/core/index.js +5 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +1 -0
- package/core/runtime/runtime.d.ts +8 -0
- package/core/runtime/runtime.js +89 -0
- package/core/schemas/Schema.d.ts +81 -0
- package/core/schemas/Schema.js +18 -0
- package/core/schemas/builders/date/date.d.ts +2 -0
- package/core/schemas/builders/date/date.js +59 -0
- package/core/schemas/builders/date/index.d.ts +1 -0
- package/core/schemas/builders/date/index.js +1 -0
- package/core/schemas/builders/enum/enum.d.ts +2 -0
- package/core/schemas/builders/enum/enum.js +35 -0
- package/core/schemas/builders/enum/index.d.ts +1 -0
- package/core/schemas/builders/enum/index.js +1 -0
- package/core/schemas/builders/index.d.ts +13 -0
- package/core/schemas/builders/index.js +13 -0
- package/core/schemas/builders/lazy/index.d.ts +3 -0
- package/core/schemas/builders/lazy/index.js +2 -0
- package/core/schemas/builders/lazy/lazy.d.ts +5 -0
- package/core/schemas/builders/lazy/lazy.js +30 -0
- package/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
- package/core/schemas/builders/lazy/lazyObject.js +17 -0
- package/core/schemas/builders/list/index.d.ts +1 -0
- package/core/schemas/builders/list/index.js +1 -0
- package/core/schemas/builders/list/list.d.ts +2 -0
- package/core/schemas/builders/list/list.js +64 -0
- package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/core/schemas/builders/literals/booleanLiteral.js +25 -0
- package/core/schemas/builders/literals/index.d.ts +2 -0
- package/core/schemas/builders/literals/index.js +2 -0
- package/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
- package/core/schemas/builders/literals/stringLiteral.js +25 -0
- package/core/schemas/builders/object/index.d.ts +6 -0
- package/core/schemas/builders/object/index.js +3 -0
- package/core/schemas/builders/object/object.d.ts +3 -0
- package/core/schemas/builders/object/object.js +249 -0
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +4 -0
- package/core/schemas/builders/object/property.d.ts +8 -0
- package/core/schemas/builders/object/property.js +11 -0
- package/core/schemas/builders/object/types.d.ts +26 -0
- package/core/schemas/builders/object/types.js +1 -0
- package/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +58 -0
- package/core/schemas/builders/object-like/index.d.ts +2 -0
- package/core/schemas/builders/object-like/index.js +1 -0
- package/core/schemas/builders/object-like/types.d.ts +7 -0
- package/core/schemas/builders/object-like/types.js +1 -0
- package/core/schemas/builders/primitives/any.d.ts +1 -0
- package/core/schemas/builders/primitives/any.js +3 -0
- package/core/schemas/builders/primitives/boolean.d.ts +1 -0
- package/core/schemas/builders/primitives/boolean.js +22 -0
- package/core/schemas/builders/primitives/index.d.ts +5 -0
- package/core/schemas/builders/primitives/index.js +5 -0
- package/core/schemas/builders/primitives/number.d.ts +1 -0
- package/core/schemas/builders/primitives/number.js +22 -0
- package/core/schemas/builders/primitives/string.d.ts +1 -0
- package/core/schemas/builders/primitives/string.js +22 -0
- package/core/schemas/builders/primitives/unknown.d.ts +1 -0
- package/core/schemas/builders/primitives/unknown.js +3 -0
- package/core/schemas/builders/record/index.d.ts +2 -0
- package/core/schemas/builders/record/index.js +1 -0
- package/core/schemas/builders/record/record.d.ts +3 -0
- package/core/schemas/builders/record/record.js +102 -0
- package/core/schemas/builders/record/types.d.ts +4 -0
- package/core/schemas/builders/record/types.js +1 -0
- package/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
- package/core/schemas/builders/schema-utils/JsonError.js +8 -0
- package/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
- package/core/schemas/builders/schema-utils/ParseError.js +8 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +79 -0
- package/core/schemas/builders/schema-utils/index.d.ts +4 -0
- package/core/schemas/builders/schema-utils/index.js +3 -0
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +6 -0
- package/core/schemas/builders/set/index.d.ts +1 -0
- package/core/schemas/builders/set/index.js +1 -0
- package/core/schemas/builders/set/set.d.ts +2 -0
- package/core/schemas/builders/set/set.js +49 -0
- package/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
- package/core/schemas/builders/undiscriminated-union/index.js +1 -0
- package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
- package/core/schemas/builders/undiscriminated-union/types.js +1 -0
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +47 -0
- package/core/schemas/builders/union/discriminant.d.ts +5 -0
- package/core/schemas/builders/union/discriminant.js +6 -0
- package/core/schemas/builders/union/index.d.ts +4 -0
- package/core/schemas/builders/union/index.js +2 -0
- package/core/schemas/builders/union/types.d.ts +13 -0
- package/core/schemas/builders/union/types.js +1 -0
- package/core/schemas/builders/union/union.d.ts +4 -0
- package/core/schemas/builders/union/union.js +137 -0
- package/core/schemas/index.d.ts +2 -0
- package/core/schemas/index.js +1 -0
- package/core/schemas/utils/MaybePromise.d.ts +1 -0
- package/core/schemas/utils/MaybePromise.js +1 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.js +1 -0
- package/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
- package/core/schemas/utils/createIdentitySchemaCreator.js +12 -0
- package/core/schemas/utils/entries.d.ts +1 -0
- package/core/schemas/utils/entries.js +3 -0
- package/core/schemas/utils/filterObject.d.ts +1 -0
- package/core/schemas/utils/filterObject.js +10 -0
- package/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +20 -0
- package/core/schemas/utils/isPlainObject.d.ts +1 -0
- package/core/schemas/utils/isPlainObject.js +14 -0
- package/core/schemas/utils/keys.d.ts +1 -0
- package/core/schemas/utils/keys.js +3 -0
- package/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
- package/core/schemas/utils/maybeSkipValidation.js +33 -0
- package/core/schemas/utils/partition.d.ts +1 -0
- package/core/schemas/utils/partition.js +12 -0
- package/core/streaming-fetcher/Stream.d.ts +48 -0
- package/core/streaming-fetcher/Stream.js +165 -0
- package/core/streaming-fetcher/index.d.ts +1 -0
- package/core/streaming-fetcher/index.js +1 -0
- package/dist/Client.d.ts +30 -0
- package/dist/Client.js +18 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/resources/commons/errors/AgentNotFoundError.d.ts +8 -0
- package/dist/api/resources/commons/errors/AgentNotFoundError.js +14 -0
- package/dist/api/resources/commons/errors/index.d.ts +1 -0
- package/dist/api/resources/commons/errors/index.js +1 -0
- package/dist/api/resources/commons/index.d.ts +2 -0
- package/dist/api/resources/commons/index.js +2 -0
- package/dist/api/resources/commons/types/ErrorMessage.d.ts +6 -0
- package/dist/api/resources/commons/types/ErrorMessage.js +4 -0
- package/dist/api/resources/commons/types/User.d.ts +9 -0
- package/dist/api/resources/commons/types/User.js +4 -0
- package/dist/api/resources/commons/types/index.d.ts +2 -0
- package/dist/api/resources/commons/types/index.js +2 -0
- package/dist/api/resources/conversation/client/Client.d.ts +138 -0
- package/dist/api/resources/conversation/client/Client.js +676 -0
- package/dist/api/resources/conversation/client/index.d.ts +1 -0
- package/dist/api/resources/conversation/client/index.js +1 -0
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +8 -0
- package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +14 -0
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +8 -0
- package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +14 -0
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +8 -0
- package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +14 -0
- package/dist/api/resources/conversation/errors/EmptyConversationError.d.ts +8 -0
- package/dist/api/resources/conversation/errors/EmptyConversationError.js +14 -0
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +8 -0
- package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +14 -0
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +8 -0
- package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +14 -0
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +8 -0
- package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +14 -0
- package/dist/api/resources/conversation/errors/index.d.ts +7 -0
- package/dist/api/resources/conversation/errors/index.js +7 -0
- package/dist/api/resources/conversation/index.d.ts +3 -0
- package/dist/api/resources/conversation/index.js +3 -0
- package/dist/api/resources/conversation/types/ActionFormField.d.ts +9 -0
- package/dist/api/resources/conversation/types/ActionFormField.js +4 -0
- package/dist/api/resources/conversation/types/AskRequest.d.ts +12 -0
- package/dist/api/resources/conversation/types/AskRequest.js +4 -0
- package/dist/api/resources/conversation/types/AskStreamEndEvent.d.ts +7 -0
- package/dist/api/resources/conversation/types/AskStreamEndEvent.js +4 -0
- package/dist/api/resources/conversation/types/AskStreamMetadataEvent.d.ts +6 -0
- package/dist/api/resources/conversation/types/AskStreamMetadataEvent.js +4 -0
- package/dist/api/resources/conversation/types/AskStreamStartEvent.d.ts +6 -0
- package/dist/api/resources/conversation/types/AskStreamStartEvent.js +4 -0
- package/dist/api/resources/conversation/types/AskStreamTextEvent.d.ts +6 -0
- package/dist/api/resources/conversation/types/AskStreamTextEvent.js +4 -0
- package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +9 -0
- package/dist/api/resources/conversation/types/BotActionFormResponse.js +4 -0
- package/dist/api/resources/conversation/types/BotConversationMessageType.d.ts +9 -0
- package/dist/api/resources/conversation/types/BotConversationMessageType.js +8 -0
- package/dist/api/resources/conversation/types/BotMessage.d.ts +9 -0
- package/dist/api/resources/conversation/types/BotMessage.js +4 -0
- package/dist/api/resources/conversation/types/BotResponse.d.ts +13 -0
- package/dist/api/resources/conversation/types/BotResponse.js +4 -0
- package/dist/api/resources/conversation/types/BotResponseMetadata.d.ts +8 -0
- package/dist/api/resources/conversation/types/BotResponseMetadata.js +4 -0
- package/dist/api/resources/conversation/types/BotTextResponse.d.ts +6 -0
- package/dist/api/resources/conversation/types/BotTextResponse.js +4 -0
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +10 -0
- package/dist/api/resources/conversation/types/ConversationBase.js +4 -0
- package/dist/api/resources/conversation/types/ConversationContext.d.ts +20 -0
- package/dist/api/resources/conversation/types/ConversationContext.js +4 -0
- package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +10 -0
- package/dist/api/resources/conversation/types/ConversationMessageBase.js +4 -0
- package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +12 -0
- package/dist/api/resources/conversation/types/ConversationMessageContext.js +4 -0
- package/dist/api/resources/conversation/types/ConversationMessageRequest.d.ts +6 -0
- package/dist/api/resources/conversation/types/ConversationMessageRequest.js +4 -0
- package/dist/api/resources/conversation/types/ConversationMessageResponse.d.ts +13 -0
- package/dist/api/resources/conversation/types/ConversationMessageResponse.js +4 -0
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +8 -0
- package/dist/api/resources/conversation/types/ConversationRequest.js +4 -0
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +8 -0
- package/dist/api/resources/conversation/types/ConversationResponse.js +4 -0
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +12 -0
- package/dist/api/resources/conversation/types/FeedbackRequest.js +4 -0
- package/dist/api/resources/conversation/types/FeedbackType.d.ts +11 -0
- package/dist/api/resources/conversation/types/FeedbackType.js +7 -0
- package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +7 -0
- package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.js +4 -0
- package/dist/api/resources/conversation/types/Source.d.ts +7 -0
- package/dist/api/resources/conversation/types/Source.js +4 -0
- package/dist/api/resources/conversation/types/StreamResponse.d.ts +19 -0
- package/dist/api/resources/conversation/types/StreamResponse.js +4 -0
- package/dist/api/resources/conversation/types/UserConversationMessageType.d.ts +12 -0
- package/dist/api/resources/conversation/types/UserConversationMessageType.js +8 -0
- package/dist/api/resources/conversation/types/UserMessage.d.ts +8 -0
- package/dist/api/resources/conversation/types/UserMessage.js +4 -0
- package/dist/api/resources/conversation/types/index.d.ts +27 -0
- package/dist/api/resources/conversation/types/index.js +27 -0
- package/dist/api/resources/index.d.ts +9 -0
- package/dist/api/resources/index.js +9 -0
- package/dist/api/resources/knowledge/client/Client.d.ts +147 -0
- package/dist/api/resources/knowledge/client/Client.js +615 -0
- package/dist/api/resources/knowledge/client/index.d.ts +1 -0
- package/dist/api/resources/knowledge/client/index.js +1 -0
- package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +7 -0
- package/dist/api/resources/knowledge/errors/DocumentCreationError.js +13 -0
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +8 -0
- package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +14 -0
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +8 -0
- package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +14 -0
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +8 -0
- package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +14 -0
- package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +8 -0
- package/dist/api/resources/knowledge/errors/VersionInProgressError.js +14 -0
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +8 -0
- package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +14 -0
- package/dist/api/resources/knowledge/errors/index.d.ts +6 -0
- package/dist/api/resources/knowledge/errors/index.js +6 -0
- package/dist/api/resources/knowledge/index.d.ts +3 -0
- package/dist/api/resources/knowledge/index.js +3 -0
- package/dist/api/resources/knowledge/types/IdBody.d.ts +6 -0
- package/dist/api/resources/knowledge/types/IdBody.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBase.d.ts +12 -0
- package/dist/api/resources/knowledge/types/KnowledgeBase.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseId.d.ts +7 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseId.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +12 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseType.js +8 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +10 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersionType.d.ts +11 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseVersionType.js +7 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocument.d.ts +20 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocument.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentId.d.ts +9 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentId.js +4 -0
- package/dist/api/resources/knowledge/types/index.d.ts +8 -0
- package/dist/api/resources/knowledge/types/index.js +8 -0
- package/dist/core/auth/BasicAuth.d.ts +8 -0
- package/dist/core/auth/BasicAuth.js +23 -0
- package/dist/core/auth/BearerToken.d.ts +5 -0
- package/dist/core/auth/BearerToken.js +12 -0
- package/dist/core/auth/index.d.ts +2 -0
- package/dist/core/auth/index.js +2 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/APIResponse.js +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +36 -0
- package/dist/core/fetcher/Fetcher.js +236 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +19 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +8 -0
- package/dist/core/fetcher/index.d.ts +5 -0
- package/dist/core/fetcher/index.js +3 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +5 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +1 -0
- package/dist/core/runtime/runtime.d.ts +8 -0
- package/dist/core/runtime/runtime.js +89 -0
- package/dist/core/schemas/Schema.d.ts +81 -0
- package/dist/core/schemas/Schema.js +18 -0
- package/dist/core/schemas/builders/date/date.d.ts +2 -0
- package/dist/core/schemas/builders/date/date.js +59 -0
- package/dist/core/schemas/builders/date/index.d.ts +1 -0
- package/dist/core/schemas/builders/date/index.js +1 -0
- package/dist/core/schemas/builders/enum/enum.d.ts +2 -0
- package/dist/core/schemas/builders/enum/enum.js +35 -0
- package/dist/core/schemas/builders/enum/index.d.ts +1 -0
- package/dist/core/schemas/builders/enum/index.js +1 -0
- package/dist/core/schemas/builders/index.d.ts +13 -0
- package/dist/core/schemas/builders/index.js +13 -0
- package/dist/core/schemas/builders/lazy/index.d.ts +3 -0
- package/dist/core/schemas/builders/lazy/index.js +2 -0
- package/dist/core/schemas/builders/lazy/lazy.d.ts +5 -0
- package/dist/core/schemas/builders/lazy/lazy.js +30 -0
- package/dist/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
- package/dist/core/schemas/builders/lazy/lazyObject.js +17 -0
- package/dist/core/schemas/builders/list/index.d.ts +1 -0
- package/dist/core/schemas/builders/list/index.js +1 -0
- package/dist/core/schemas/builders/list/list.d.ts +2 -0
- package/dist/core/schemas/builders/list/list.js +64 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.js +25 -0
- package/dist/core/schemas/builders/literals/index.d.ts +2 -0
- package/dist/core/schemas/builders/literals/index.js +2 -0
- package/dist/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/stringLiteral.js +25 -0
- package/dist/core/schemas/builders/object/index.d.ts +6 -0
- package/dist/core/schemas/builders/object/index.js +3 -0
- package/dist/core/schemas/builders/object/object.d.ts +3 -0
- package/dist/core/schemas/builders/object/object.js +249 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +4 -0
- package/dist/core/schemas/builders/object/property.d.ts +8 -0
- package/dist/core/schemas/builders/object/property.js +11 -0
- package/dist/core/schemas/builders/object/types.d.ts +26 -0
- package/dist/core/schemas/builders/object/types.js +1 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +58 -0
- package/dist/core/schemas/builders/object-like/index.d.ts +2 -0
- package/dist/core/schemas/builders/object-like/index.js +1 -0
- package/dist/core/schemas/builders/object-like/types.d.ts +7 -0
- package/dist/core/schemas/builders/object-like/types.js +1 -0
- package/dist/core/schemas/builders/primitives/any.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/any.js +3 -0
- package/dist/core/schemas/builders/primitives/boolean.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/boolean.js +22 -0
- package/dist/core/schemas/builders/primitives/index.d.ts +5 -0
- package/dist/core/schemas/builders/primitives/index.js +5 -0
- package/dist/core/schemas/builders/primitives/number.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/number.js +22 -0
- package/dist/core/schemas/builders/primitives/string.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/string.js +22 -0
- package/dist/core/schemas/builders/primitives/unknown.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/unknown.js +3 -0
- package/dist/core/schemas/builders/record/index.d.ts +2 -0
- package/dist/core/schemas/builders/record/index.js +1 -0
- package/dist/core/schemas/builders/record/record.d.ts +3 -0
- package/dist/core/schemas/builders/record/record.js +102 -0
- package/dist/core/schemas/builders/record/types.d.ts +4 -0
- package/dist/core/schemas/builders/record/types.js +1 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.js +8 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.js +8 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +79 -0
- package/dist/core/schemas/builders/schema-utils/index.d.ts +4 -0
- package/dist/core/schemas/builders/schema-utils/index.js +3 -0
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +6 -0
- package/dist/core/schemas/builders/set/index.d.ts +1 -0
- package/dist/core/schemas/builders/set/index.js +1 -0
- package/dist/core/schemas/builders/set/set.d.ts +2 -0
- package/dist/core/schemas/builders/set/set.js +49 -0
- package/dist/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
- package/dist/core/schemas/builders/undiscriminated-union/index.js +1 -0
- package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
- package/dist/core/schemas/builders/undiscriminated-union/types.js +1 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +47 -0
- package/dist/core/schemas/builders/union/discriminant.d.ts +5 -0
- package/dist/core/schemas/builders/union/discriminant.js +6 -0
- package/dist/core/schemas/builders/union/index.d.ts +4 -0
- package/dist/core/schemas/builders/union/index.js +2 -0
- package/dist/core/schemas/builders/union/types.d.ts +13 -0
- package/dist/core/schemas/builders/union/types.js +1 -0
- package/dist/core/schemas/builders/union/union.d.ts +4 -0
- package/dist/core/schemas/builders/union/union.js +137 -0
- package/dist/core/schemas/index.d.ts +2 -0
- package/dist/core/schemas/index.js +1 -0
- package/dist/core/schemas/utils/MaybePromise.d.ts +1 -0
- package/dist/core/schemas/utils/MaybePromise.js +1 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.js +1 -0
- package/dist/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +12 -0
- package/dist/core/schemas/utils/entries.d.ts +1 -0
- package/dist/core/schemas/utils/entries.js +3 -0
- package/dist/core/schemas/utils/filterObject.d.ts +1 -0
- package/dist/core/schemas/utils/filterObject.js +10 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +20 -0
- package/dist/core/schemas/utils/isPlainObject.d.ts +1 -0
- package/dist/core/schemas/utils/isPlainObject.js +14 -0
- package/dist/core/schemas/utils/keys.d.ts +1 -0
- package/dist/core/schemas/utils/keys.js +3 -0
- package/dist/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +33 -0
- package/dist/core/schemas/utils/partition.d.ts +1 -0
- package/dist/core/schemas/utils/partition.js +12 -0
- package/dist/core/streaming-fetcher/Stream.d.ts +48 -0
- package/dist/core/streaming-fetcher/Stream.js +165 -0
- package/dist/core/streaming-fetcher/index.d.ts +1 -0
- package/dist/core/streaming-fetcher/index.js +1 -0
- package/dist/environments.d.ts +8 -0
- package/dist/environments.js +7 -0
- package/dist/errors/MavenAGIError.d.ts +12 -0
- package/dist/errors/MavenAGIError.js +28 -0
- package/dist/errors/MavenAGITimeoutError.d.ts +6 -0
- package/dist/errors/MavenAGITimeoutError.js +9 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/serialization/index.d.ts +1 -0
- package/dist/serialization/index.js +1 -0
- package/dist/serialization/resources/commons/index.d.ts +1 -0
- package/dist/serialization/resources/commons/index.js +1 -0
- package/dist/serialization/resources/commons/types/ErrorMessage.d.ts +12 -0
- package/dist/serialization/resources/commons/types/ErrorMessage.js +7 -0
- package/dist/serialization/resources/commons/types/User.d.ts +14 -0
- package/dist/serialization/resources/commons/types/User.js +9 -0
- package/dist/serialization/resources/commons/types/index.d.ts +2 -0
- package/dist/serialization/resources/commons/types/index.js +2 -0
- package/dist/serialization/resources/conversation/client/appendNewMessages.d.ts +11 -0
- package/dist/serialization/resources/conversation/client/appendNewMessages.js +6 -0
- package/dist/serialization/resources/conversation/client/index.d.ts +1 -0
- package/dist/serialization/resources/conversation/client/index.js +1 -0
- package/dist/serialization/resources/conversation/index.d.ts +2 -0
- package/dist/serialization/resources/conversation/index.js +2 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.js +10 -0
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/AskRequest.js +10 -0
- package/dist/serialization/resources/conversation/types/AskStreamEndEvent.d.ts +13 -0
- package/dist/serialization/resources/conversation/types/AskStreamEndEvent.js +8 -0
- package/dist/serialization/resources/conversation/types/AskStreamMetadataEvent.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/AskStreamMetadataEvent.js +6 -0
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.js +7 -0
- package/dist/serialization/resources/conversation/types/AskStreamTextEvent.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/AskStreamTextEvent.js +7 -0
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +10 -0
- package/dist/serialization/resources/conversation/types/BotConversationMessageType.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/BotConversationMessageType.js +5 -0
- package/dist/serialization/resources/conversation/types/BotMessage.d.ts +18 -0
- package/dist/serialization/resources/conversation/types/BotMessage.js +15 -0
- package/dist/serialization/resources/conversation/types/BotResponse.d.ts +18 -0
- package/dist/serialization/resources/conversation/types/BotResponse.js +15 -0
- package/dist/serialization/resources/conversation/types/BotResponseMetadata.d.ts +14 -0
- package/dist/serialization/resources/conversation/types/BotResponseMetadata.js +9 -0
- package/dist/serialization/resources/conversation/types/BotTextResponse.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/BotTextResponse.js +7 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +14 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.js +9 -0
- package/dist/serialization/resources/conversation/types/ConversationContext.d.ts +20 -0
- package/dist/serialization/resources/conversation/types/ConversationContext.js +15 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +14 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +9 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.d.ts +16 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.js +11 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +6 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageResponse.d.ts +18 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageResponse.js +15 -0
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +14 -0
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +11 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +14 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +11 -0
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +10 -0
- package/dist/serialization/resources/conversation/types/FeedbackType.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/FeedbackType.js +5 -0
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +7 -0
- package/dist/serialization/resources/conversation/types/Source.d.ts +13 -0
- package/dist/serialization/resources/conversation/types/Source.js +8 -0
- package/dist/serialization/resources/conversation/types/StreamResponse.d.ts +26 -0
- package/dist/serialization/resources/conversation/types/StreamResponse.js +19 -0
- package/dist/serialization/resources/conversation/types/UserConversationMessageType.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/UserConversationMessageType.js +5 -0
- package/dist/serialization/resources/conversation/types/UserMessage.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/UserMessage.js +12 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +27 -0
- package/dist/serialization/resources/conversation/types/index.js +27 -0
- package/dist/serialization/resources/index.d.ts +6 -0
- package/dist/serialization/resources/index.js +6 -0
- package/dist/serialization/resources/knowledge/index.d.ts +1 -0
- package/dist/serialization/resources/knowledge/index.js +1 -0
- package/dist/serialization/resources/knowledge/types/IdBody.d.ts +12 -0
- package/dist/serialization/resources/knowledge/types/IdBody.js +7 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBase.d.ts +16 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBase.js +13 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +12 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseId.js +7 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.js +5 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +9 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersionType.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersionType.js +5 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocument.d.ts +19 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocument.js +16 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +13 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentId.js +8 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +8 -0
- package/dist/serialization/resources/knowledge/types/index.js +8 -0
- package/environments.d.ts +8 -0
- package/environments.js +7 -0
- package/errors/MavenAGIError.d.ts +12 -0
- package/errors/MavenAGIError.js +28 -0
- package/errors/MavenAGITimeoutError.d.ts +6 -0
- package/errors/MavenAGITimeoutError.js +9 -0
- package/errors/index.d.ts +2 -0
- package/errors/index.js +2 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/jest.config.js +5 -0
- package/package.json +34 -0
- package/serialization/index.d.ts +1 -0
- package/serialization/index.js +1 -0
- package/serialization/resources/commons/index.d.ts +1 -0
- package/serialization/resources/commons/index.js +1 -0
- package/serialization/resources/commons/types/ErrorMessage.d.ts +12 -0
- package/serialization/resources/commons/types/ErrorMessage.js +7 -0
- package/serialization/resources/commons/types/User.d.ts +14 -0
- package/serialization/resources/commons/types/User.js +9 -0
- package/serialization/resources/commons/types/index.d.ts +2 -0
- package/serialization/resources/commons/types/index.js +2 -0
- package/serialization/resources/conversation/client/appendNewMessages.d.ts +11 -0
- package/serialization/resources/conversation/client/appendNewMessages.js +6 -0
- package/serialization/resources/conversation/client/index.d.ts +1 -0
- package/serialization/resources/conversation/client/index.js +1 -0
- package/serialization/resources/conversation/index.d.ts +2 -0
- package/serialization/resources/conversation/index.js +2 -0
- package/serialization/resources/conversation/types/ActionFormField.d.ts +15 -0
- package/serialization/resources/conversation/types/ActionFormField.js +10 -0
- package/serialization/resources/conversation/types/AskRequest.d.ts +15 -0
- package/serialization/resources/conversation/types/AskRequest.js +10 -0
- package/serialization/resources/conversation/types/AskStreamEndEvent.d.ts +13 -0
- package/serialization/resources/conversation/types/AskStreamEndEvent.js +8 -0
- package/serialization/resources/conversation/types/AskStreamMetadataEvent.d.ts +12 -0
- package/serialization/resources/conversation/types/AskStreamMetadataEvent.js +6 -0
- package/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +12 -0
- package/serialization/resources/conversation/types/AskStreamStartEvent.js +7 -0
- package/serialization/resources/conversation/types/AskStreamTextEvent.d.ts +12 -0
- package/serialization/resources/conversation/types/AskStreamTextEvent.js +7 -0
- package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +15 -0
- package/serialization/resources/conversation/types/BotActionFormResponse.js +10 -0
- package/serialization/resources/conversation/types/BotConversationMessageType.d.ts +10 -0
- package/serialization/resources/conversation/types/BotConversationMessageType.js +5 -0
- package/serialization/resources/conversation/types/BotMessage.d.ts +18 -0
- package/serialization/resources/conversation/types/BotMessage.js +15 -0
- package/serialization/resources/conversation/types/BotResponse.d.ts +18 -0
- package/serialization/resources/conversation/types/BotResponse.js +15 -0
- package/serialization/resources/conversation/types/BotResponseMetadata.d.ts +14 -0
- package/serialization/resources/conversation/types/BotResponseMetadata.js +9 -0
- package/serialization/resources/conversation/types/BotTextResponse.d.ts +12 -0
- package/serialization/resources/conversation/types/BotTextResponse.js +7 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +14 -0
- package/serialization/resources/conversation/types/ConversationBase.js +9 -0
- package/serialization/resources/conversation/types/ConversationContext.d.ts +20 -0
- package/serialization/resources/conversation/types/ConversationContext.js +15 -0
- package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +14 -0
- package/serialization/resources/conversation/types/ConversationMessageBase.js +9 -0
- package/serialization/resources/conversation/types/ConversationMessageContext.d.ts +16 -0
- package/serialization/resources/conversation/types/ConversationMessageContext.js +11 -0
- package/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +12 -0
- package/serialization/resources/conversation/types/ConversationMessageRequest.js +6 -0
- package/serialization/resources/conversation/types/ConversationMessageResponse.d.ts +18 -0
- package/serialization/resources/conversation/types/ConversationMessageResponse.js +15 -0
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +14 -0
- package/serialization/resources/conversation/types/ConversationRequest.js +11 -0
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +14 -0
- package/serialization/resources/conversation/types/ConversationResponse.js +11 -0
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +15 -0
- package/serialization/resources/conversation/types/FeedbackRequest.js +10 -0
- package/serialization/resources/conversation/types/FeedbackType.d.ts +10 -0
- package/serialization/resources/conversation/types/FeedbackType.js +5 -0
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +12 -0
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +7 -0
- package/serialization/resources/conversation/types/Source.d.ts +13 -0
- package/serialization/resources/conversation/types/Source.js +8 -0
- package/serialization/resources/conversation/types/StreamResponse.d.ts +26 -0
- package/serialization/resources/conversation/types/StreamResponse.js +19 -0
- package/serialization/resources/conversation/types/UserConversationMessageType.d.ts +10 -0
- package/serialization/resources/conversation/types/UserConversationMessageType.js +5 -0
- package/serialization/resources/conversation/types/UserMessage.d.ts +15 -0
- package/serialization/resources/conversation/types/UserMessage.js +12 -0
- package/serialization/resources/conversation/types/index.d.ts +27 -0
- package/serialization/resources/conversation/types/index.js +27 -0
- package/serialization/resources/index.d.ts +6 -0
- package/serialization/resources/index.js +6 -0
- package/serialization/resources/knowledge/index.d.ts +1 -0
- package/serialization/resources/knowledge/index.js +1 -0
- package/serialization/resources/knowledge/types/IdBody.d.ts +12 -0
- package/serialization/resources/knowledge/types/IdBody.js +7 -0
- package/serialization/resources/knowledge/types/KnowledgeBase.d.ts +16 -0
- package/serialization/resources/knowledge/types/KnowledgeBase.js +13 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseId.d.ts +12 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseId.js +7 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseType.js +5 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +9 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseVersionType.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseVersionType.js +5 -0
- package/serialization/resources/knowledge/types/KnowledgeDocument.d.ts +19 -0
- package/serialization/resources/knowledge/types/KnowledgeDocument.js +16 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentId.d.ts +13 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentId.js +8 -0
- package/serialization/resources/knowledge/types/index.d.ts +8 -0
- package/serialization/resources/knowledge/types/index.js +8 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export const Supplier = {
|
|
11
|
+
get: (supplier) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
+
if (typeof supplier === "function") {
|
|
13
|
+
return supplier();
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return supplier;
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getHeader(headers: Record<string, any>, header: string): string | undefined;
|
package/core/index.d.ts
ADDED
package/core/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RUNTIME } from "./runtime";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RUNTIME } from "./runtime";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A constant that indicates which environment and version the SDK is running in.
|
|
3
|
+
*/
|
|
4
|
+
export declare const RUNTIME: Runtime;
|
|
5
|
+
export interface Runtime {
|
|
6
|
+
type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd";
|
|
7
|
+
version?: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var _a, _b, _c, _d, _e;
|
|
2
|
+
/**
|
|
3
|
+
* A constant that indicates whether the environment the code is running is a Web Browser.
|
|
4
|
+
*/
|
|
5
|
+
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
6
|
+
/**
|
|
7
|
+
* A constant that indicates whether the environment the code is running is a Web Worker.
|
|
8
|
+
*/
|
|
9
|
+
const isWebWorker = typeof self === "object" &&
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
|
|
12
|
+
(((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" ||
|
|
13
|
+
((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" ||
|
|
14
|
+
((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope");
|
|
15
|
+
/**
|
|
16
|
+
* A constant that indicates whether the environment the code is running is Deno.
|
|
17
|
+
*/
|
|
18
|
+
const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
|
|
19
|
+
/**
|
|
20
|
+
* A constant that indicates whether the environment the code is running is Bun.sh.
|
|
21
|
+
*/
|
|
22
|
+
const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
|
|
23
|
+
/**
|
|
24
|
+
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
25
|
+
*/
|
|
26
|
+
const isNode = typeof process !== "undefined" &&
|
|
27
|
+
Boolean(process.version) &&
|
|
28
|
+
Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) &&
|
|
29
|
+
// Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
|
|
30
|
+
!isDeno &&
|
|
31
|
+
!isBun;
|
|
32
|
+
/**
|
|
33
|
+
* A constant that indicates whether the environment the code is running is in React-Native.
|
|
34
|
+
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
|
35
|
+
*/
|
|
36
|
+
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
|
37
|
+
/**
|
|
38
|
+
* A constant that indicates whether the environment the code is running is Cloudflare.
|
|
39
|
+
* https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
|
|
40
|
+
*/
|
|
41
|
+
const isCloudflare = typeof globalThis !== "undefined" && ((_e = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _e === void 0 ? void 0 : _e.userAgent) === "Cloudflare-Workers";
|
|
42
|
+
/**
|
|
43
|
+
* A constant that indicates which environment and version the SDK is running in.
|
|
44
|
+
*/
|
|
45
|
+
export const RUNTIME = evaluateRuntime();
|
|
46
|
+
function evaluateRuntime() {
|
|
47
|
+
if (isBrowser) {
|
|
48
|
+
return {
|
|
49
|
+
type: "browser",
|
|
50
|
+
version: window.navigator.userAgent,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (isCloudflare) {
|
|
54
|
+
return {
|
|
55
|
+
type: "workerd",
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (isWebWorker) {
|
|
59
|
+
return {
|
|
60
|
+
type: "web-worker",
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (isDeno) {
|
|
64
|
+
return {
|
|
65
|
+
type: "deno",
|
|
66
|
+
version: Deno.version.deno,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (isBun) {
|
|
70
|
+
return {
|
|
71
|
+
type: "bun",
|
|
72
|
+
version: Bun.version,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (isNode) {
|
|
76
|
+
return {
|
|
77
|
+
type: "node",
|
|
78
|
+
version: process.versions.node,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (isReactNative) {
|
|
82
|
+
return {
|
|
83
|
+
type: "react-native",
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
type: "unknown",
|
|
88
|
+
};
|
|
89
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { SchemaUtils } from "./builders";
|
|
2
|
+
import { MaybePromise } from "./utils/MaybePromise";
|
|
3
|
+
export declare type Schema<Raw = unknown, Parsed = unknown> = BaseSchema<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
|
|
4
|
+
export declare type inferRaw<S extends Schema> = S extends Schema<infer Raw, any> ? Raw : never;
|
|
5
|
+
export declare type inferParsed<S extends Schema> = S extends Schema<any, infer Parsed> ? Parsed : never;
|
|
6
|
+
export interface BaseSchema<Raw, Parsed> {
|
|
7
|
+
parse: (raw: unknown, opts?: SchemaOptions) => MaybePromise<MaybeValid<Parsed>>;
|
|
8
|
+
json: (parsed: unknown, opts?: SchemaOptions) => MaybePromise<MaybeValid<Raw>>;
|
|
9
|
+
getType: () => SchemaType | Promise<SchemaType>;
|
|
10
|
+
}
|
|
11
|
+
export declare const SchemaType: {
|
|
12
|
+
readonly DATE: "date";
|
|
13
|
+
readonly ENUM: "enum";
|
|
14
|
+
readonly LIST: "list";
|
|
15
|
+
readonly STRING_LITERAL: "stringLiteral";
|
|
16
|
+
readonly BOOLEAN_LITERAL: "booleanLiteral";
|
|
17
|
+
readonly OBJECT: "object";
|
|
18
|
+
readonly ANY: "any";
|
|
19
|
+
readonly BOOLEAN: "boolean";
|
|
20
|
+
readonly NUMBER: "number";
|
|
21
|
+
readonly STRING: "string";
|
|
22
|
+
readonly UNKNOWN: "unknown";
|
|
23
|
+
readonly RECORD: "record";
|
|
24
|
+
readonly SET: "set";
|
|
25
|
+
readonly UNION: "union";
|
|
26
|
+
readonly UNDISCRIMINATED_UNION: "undiscriminatedUnion";
|
|
27
|
+
readonly OPTIONAL: "optional";
|
|
28
|
+
};
|
|
29
|
+
export declare type SchemaType = typeof SchemaType[keyof typeof SchemaType];
|
|
30
|
+
export declare type MaybeValid<T> = Valid<T> | Invalid;
|
|
31
|
+
export interface Valid<T> {
|
|
32
|
+
ok: true;
|
|
33
|
+
value: T;
|
|
34
|
+
}
|
|
35
|
+
export interface Invalid {
|
|
36
|
+
ok: false;
|
|
37
|
+
errors: ValidationError[];
|
|
38
|
+
}
|
|
39
|
+
export interface ValidationError {
|
|
40
|
+
path: string[];
|
|
41
|
+
message: string;
|
|
42
|
+
}
|
|
43
|
+
export interface SchemaOptions {
|
|
44
|
+
/**
|
|
45
|
+
* how to handle unrecognized keys in objects
|
|
46
|
+
*
|
|
47
|
+
* @default "fail"
|
|
48
|
+
*/
|
|
49
|
+
unrecognizedObjectKeys?: "fail" | "passthrough" | "strip";
|
|
50
|
+
/**
|
|
51
|
+
* whether to fail when an unrecognized discriminant value is
|
|
52
|
+
* encountered in a union
|
|
53
|
+
*
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
allowUnrecognizedUnionMembers?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* whether to fail when an unrecognized enum value is encountered
|
|
59
|
+
*
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
allowUnrecognizedEnumValues?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* whether to allow data that doesn't conform to the schema.
|
|
65
|
+
* invalid data is passed through without transformation.
|
|
66
|
+
*
|
|
67
|
+
* when this is enabled, .parse() and .json() will always
|
|
68
|
+
* return `ok: true`. `.parseOrThrow()` and `.jsonOrThrow()`
|
|
69
|
+
* will never fail.
|
|
70
|
+
*
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
skipValidation?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* each validation failure contains a "path" property, which is
|
|
76
|
+
* the breadcrumbs to the offending node in the JSON. you can supply
|
|
77
|
+
* a prefix that is prepended to all the errors' paths. this can be
|
|
78
|
+
* helpful for zurg's internal debug logging.
|
|
79
|
+
*/
|
|
80
|
+
breadcrumbsPrefix?: string[];
|
|
81
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const SchemaType = {
|
|
2
|
+
DATE: "date",
|
|
3
|
+
ENUM: "enum",
|
|
4
|
+
LIST: "list",
|
|
5
|
+
STRING_LITERAL: "stringLiteral",
|
|
6
|
+
BOOLEAN_LITERAL: "booleanLiteral",
|
|
7
|
+
OBJECT: "object",
|
|
8
|
+
ANY: "any",
|
|
9
|
+
BOOLEAN: "boolean",
|
|
10
|
+
NUMBER: "number",
|
|
11
|
+
STRING: "string",
|
|
12
|
+
UNKNOWN: "unknown",
|
|
13
|
+
RECORD: "record",
|
|
14
|
+
SET: "set",
|
|
15
|
+
UNION: "union",
|
|
16
|
+
UNDISCRIMINATED_UNION: "undiscriminatedUnion",
|
|
17
|
+
OPTIONAL: "optional",
|
|
18
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SchemaType } from "../../Schema";
|
|
2
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
3
|
+
import { maybeSkipValidation } from "../../utils/maybeSkipValidation";
|
|
4
|
+
import { getSchemaUtils } from "../schema-utils";
|
|
5
|
+
// https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime
|
|
6
|
+
const ISO_8601_REGEX = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
|
|
7
|
+
export function date() {
|
|
8
|
+
const baseSchema = {
|
|
9
|
+
parse: (raw, { breadcrumbsPrefix = [] } = {}) => {
|
|
10
|
+
if (typeof raw !== "string") {
|
|
11
|
+
return {
|
|
12
|
+
ok: false,
|
|
13
|
+
errors: [
|
|
14
|
+
{
|
|
15
|
+
path: breadcrumbsPrefix,
|
|
16
|
+
message: getErrorMessageForIncorrectType(raw, "string"),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (!ISO_8601_REGEX.test(raw)) {
|
|
22
|
+
return {
|
|
23
|
+
ok: false,
|
|
24
|
+
errors: [
|
|
25
|
+
{
|
|
26
|
+
path: breadcrumbsPrefix,
|
|
27
|
+
message: getErrorMessageForIncorrectType(raw, "ISO 8601 date string"),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
ok: true,
|
|
34
|
+
value: new Date(raw),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
json: (date, { breadcrumbsPrefix = [] } = {}) => {
|
|
38
|
+
if (date instanceof Date) {
|
|
39
|
+
return {
|
|
40
|
+
ok: true,
|
|
41
|
+
value: date.toISOString(),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return {
|
|
46
|
+
ok: false,
|
|
47
|
+
errors: [
|
|
48
|
+
{
|
|
49
|
+
path: breadcrumbsPrefix,
|
|
50
|
+
message: getErrorMessageForIncorrectType(date, "Date object"),
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
getType: () => SchemaType.DATE,
|
|
57
|
+
};
|
|
58
|
+
return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { date } from "./date";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { date } from "./date";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SchemaType } from "../../Schema";
|
|
2
|
+
import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator";
|
|
3
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
4
|
+
export function enum_(values) {
|
|
5
|
+
const validValues = new Set(values);
|
|
6
|
+
const schemaCreator = createIdentitySchemaCreator(SchemaType.ENUM, (value, { allowUnrecognizedEnumValues, breadcrumbsPrefix = [] } = {}) => {
|
|
7
|
+
if (typeof value !== "string") {
|
|
8
|
+
return {
|
|
9
|
+
ok: false,
|
|
10
|
+
errors: [
|
|
11
|
+
{
|
|
12
|
+
path: breadcrumbsPrefix,
|
|
13
|
+
message: getErrorMessageForIncorrectType(value, "string"),
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
if (!validValues.has(value) && !allowUnrecognizedEnumValues) {
|
|
19
|
+
return {
|
|
20
|
+
ok: false,
|
|
21
|
+
errors: [
|
|
22
|
+
{
|
|
23
|
+
path: breadcrumbsPrefix,
|
|
24
|
+
message: getErrorMessageForIncorrectType(value, "enum"),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
ok: true,
|
|
31
|
+
value: value,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
return schemaCreator();
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { enum_ } from "./enum";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { enum_ } from "./enum";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./date";
|
|
2
|
+
export * from "./enum";
|
|
3
|
+
export * from "./lazy";
|
|
4
|
+
export * from "./list";
|
|
5
|
+
export * from "./literals";
|
|
6
|
+
export * from "./object";
|
|
7
|
+
export * from "./object-like";
|
|
8
|
+
export * from "./primitives";
|
|
9
|
+
export * from "./record";
|
|
10
|
+
export * from "./schema-utils";
|
|
11
|
+
export * from "./set";
|
|
12
|
+
export * from "./undiscriminated-union";
|
|
13
|
+
export * from "./union";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./date";
|
|
2
|
+
export * from "./enum";
|
|
3
|
+
export * from "./lazy";
|
|
4
|
+
export * from "./list";
|
|
5
|
+
export * from "./literals";
|
|
6
|
+
export * from "./object";
|
|
7
|
+
export * from "./object-like";
|
|
8
|
+
export * from "./primitives";
|
|
9
|
+
export * from "./record";
|
|
10
|
+
export * from "./schema-utils";
|
|
11
|
+
export * from "./set";
|
|
12
|
+
export * from "./undiscriminated-union";
|
|
13
|
+
export * from "./union";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseSchema, Schema } from "../../Schema";
|
|
2
|
+
export declare type SchemaGetter<SchemaType extends Schema<any, any>> = () => SchemaType | Promise<SchemaType>;
|
|
3
|
+
export declare function lazy<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): Schema<Raw, Parsed>;
|
|
4
|
+
export declare function constructLazyBaseSchema<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): BaseSchema<Raw, Parsed>;
|
|
5
|
+
export declare function getMemoizedSchema<SchemaType extends Schema<any, any>>(getter: SchemaGetter<SchemaType>): Promise<SchemaType>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getSchemaUtils } from "../schema-utils";
|
|
11
|
+
export function lazy(getter) {
|
|
12
|
+
const baseSchema = constructLazyBaseSchema(getter);
|
|
13
|
+
return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
|
|
14
|
+
}
|
|
15
|
+
export function constructLazyBaseSchema(getter) {
|
|
16
|
+
return {
|
|
17
|
+
parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter)).parse(raw, opts); }),
|
|
18
|
+
json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter)).json(parsed, opts); }),
|
|
19
|
+
getType: () => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter)).getType(); }),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function getMemoizedSchema(getter) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const castedGetter = getter;
|
|
25
|
+
if (castedGetter.__zurg_memoized == null) {
|
|
26
|
+
castedGetter.__zurg_memoized = yield getter();
|
|
27
|
+
}
|
|
28
|
+
return castedGetter.__zurg_memoized;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getObjectUtils } from "../object";
|
|
11
|
+
import { getObjectLikeUtils } from "../object-like";
|
|
12
|
+
import { getSchemaUtils } from "../schema-utils";
|
|
13
|
+
import { constructLazyBaseSchema, getMemoizedSchema } from "./lazy";
|
|
14
|
+
export function lazyObject(getter) {
|
|
15
|
+
const baseSchema = Object.assign(Object.assign({}, constructLazyBaseSchema(getter)), { _getRawProperties: () => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter))._getRawProperties(); }), _getParsedProperties: () => __awaiter(this, void 0, void 0, function* () { return (yield getMemoizedSchema(getter))._getParsedProperties(); }) });
|
|
16
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema)), getObjectLikeUtils(baseSchema)), getObjectUtils(baseSchema));
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { list } from "./list";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { list } from "./list";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { SchemaType } from "../../Schema";
|
|
11
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
12
|
+
import { maybeSkipValidation } from "../../utils/maybeSkipValidation";
|
|
13
|
+
import { getSchemaUtils } from "../schema-utils";
|
|
14
|
+
export function list(schema) {
|
|
15
|
+
const baseSchema = {
|
|
16
|
+
parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
return validateAndTransformArray(raw, (item, index) => {
|
|
18
|
+
var _a;
|
|
19
|
+
return schema.parse(item, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `[${index}]`] }));
|
|
20
|
+
});
|
|
21
|
+
}),
|
|
22
|
+
json: (parsed, opts) => validateAndTransformArray(parsed, (item, index) => {
|
|
23
|
+
var _a;
|
|
24
|
+
return schema.json(item, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `[${index}]`] }));
|
|
25
|
+
}),
|
|
26
|
+
getType: () => SchemaType.LIST,
|
|
27
|
+
};
|
|
28
|
+
return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
|
|
29
|
+
}
|
|
30
|
+
function validateAndTransformArray(value, transformItem) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
if (!Array.isArray(value)) {
|
|
33
|
+
return {
|
|
34
|
+
ok: false,
|
|
35
|
+
errors: [
|
|
36
|
+
{
|
|
37
|
+
message: getErrorMessageForIncorrectType(value, "list"),
|
|
38
|
+
path: [],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const maybeValidItems = yield Promise.all(value.map((item, index) => transformItem(item, index)));
|
|
44
|
+
return maybeValidItems.reduce((acc, item) => {
|
|
45
|
+
if (acc.ok && item.ok) {
|
|
46
|
+
return {
|
|
47
|
+
ok: true,
|
|
48
|
+
value: [...acc.value, item.value],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const errors = [];
|
|
52
|
+
if (!acc.ok) {
|
|
53
|
+
errors.push(...acc.errors);
|
|
54
|
+
}
|
|
55
|
+
if (!item.ok) {
|
|
56
|
+
errors.push(...item.errors);
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
ok: false,
|
|
60
|
+
errors,
|
|
61
|
+
};
|
|
62
|
+
}, { ok: true, value: [] });
|
|
63
|
+
});
|
|
64
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SchemaType } from "../../Schema";
|
|
2
|
+
import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator";
|
|
3
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
4
|
+
export function booleanLiteral(literal) {
|
|
5
|
+
const schemaCreator = createIdentitySchemaCreator(SchemaType.BOOLEAN_LITERAL, (value, { breadcrumbsPrefix = [] } = {}) => {
|
|
6
|
+
if (value === literal) {
|
|
7
|
+
return {
|
|
8
|
+
ok: true,
|
|
9
|
+
value: literal,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return {
|
|
14
|
+
ok: false,
|
|
15
|
+
errors: [
|
|
16
|
+
{
|
|
17
|
+
path: breadcrumbsPrefix,
|
|
18
|
+
message: getErrorMessageForIncorrectType(value, `${literal.toString()}`),
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return schemaCreator();
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SchemaType } from "../../Schema";
|
|
2
|
+
import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator";
|
|
3
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
4
|
+
export function stringLiteral(literal) {
|
|
5
|
+
const schemaCreator = createIdentitySchemaCreator(SchemaType.STRING_LITERAL, (value, { breadcrumbsPrefix = [] } = {}) => {
|
|
6
|
+
if (value === literal) {
|
|
7
|
+
return {
|
|
8
|
+
ok: true,
|
|
9
|
+
value: literal,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return {
|
|
14
|
+
ok: false,
|
|
15
|
+
errors: [
|
|
16
|
+
{
|
|
17
|
+
path: breadcrumbsPrefix,
|
|
18
|
+
message: getErrorMessageForIncorrectType(value, `"${literal}"`),
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return schemaCreator();
|
|
25
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getObjectUtils, object } from "./object";
|
|
2
|
+
export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties";
|
|
3
|
+
export type { inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, } from "./objectWithoutOptionalProperties";
|
|
4
|
+
export { isProperty, property } from "./property";
|
|
5
|
+
export type { Property } from "./property";
|
|
6
|
+
export type { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, inferParsedObject, inferParsedObjectFromPropertySchemas, inferParsedPropertySchema, inferRawKey, inferRawObject, inferRawObjectFromPropertySchemas, inferRawPropertySchema, ObjectSchema, ObjectUtils, PropertySchemas, } from "./types";
|