mavenagi 0.0.0-alpha.11
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 +39 -0
- package/Client.js +33 -0
- package/README.md +139 -0
- package/api/index.d.ts +1 -0
- package/api/index.js +1 -0
- package/api/resources/actions/client/Client.d.ts +79 -0
- package/api/resources/actions/client/Client.js +305 -0
- package/api/resources/actions/client/index.d.ts +1 -0
- package/api/resources/actions/client/index.js +1 -0
- package/api/resources/actions/index.d.ts +2 -0
- package/api/resources/actions/index.js +2 -0
- package/api/resources/actions/types/ActionBase.d.ts +18 -0
- package/api/resources/actions/types/ActionBase.js +4 -0
- package/api/resources/actions/types/ActionParameter.d.ts +9 -0
- package/api/resources/actions/types/ActionParameter.js +4 -0
- package/api/resources/actions/types/ActionRequest.d.ts +23 -0
- package/api/resources/actions/types/ActionRequest.js +4 -0
- package/api/resources/actions/types/ActionResponse.d.ts +27 -0
- package/api/resources/actions/types/ActionResponse.js +4 -0
- package/api/resources/actions/types/Preconditions.d.ts +7 -0
- package/api/resources/actions/types/Preconditions.js +4 -0
- package/api/resources/actions/types/index.d.ts +5 -0
- package/api/resources/actions/types/index.js +5 -0
- package/api/resources/commons/errors/BadRequestError.d.ts +8 -0
- package/api/resources/commons/errors/BadRequestError.js +14 -0
- package/api/resources/commons/errors/NotFoundError.d.ts +8 -0
- package/api/resources/commons/errors/NotFoundError.js +14 -0
- package/api/resources/commons/errors/ServerError.d.ts +8 -0
- package/api/resources/commons/errors/ServerError.js +14 -0
- package/api/resources/commons/errors/index.d.ts +3 -0
- package/api/resources/commons/errors/index.js +3 -0
- package/api/resources/commons/index.d.ts +2 -0
- package/api/resources/commons/index.js +2 -0
- package/api/resources/commons/types/AppUser.d.ts +8 -0
- package/api/resources/commons/types/AppUser.js +4 -0
- package/api/resources/commons/types/AppUserIdentification.d.ts +8 -0
- package/api/resources/commons/types/AppUserIdentification.js +4 -0
- package/api/resources/commons/types/AppUserIdentifier.d.ts +9 -0
- package/api/resources/commons/types/AppUserIdentifier.js +4 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/api/resources/commons/types/AppUserRequest.d.ts +8 -0
- package/api/resources/commons/types/AppUserRequest.js +4 -0
- package/api/resources/commons/types/AppUserResponse.d.ts +8 -0
- package/api/resources/commons/types/AppUserResponse.js +4 -0
- package/api/resources/commons/types/EntityId.d.ts +14 -0
- package/api/resources/commons/types/EntityId.js +4 -0
- package/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/api/resources/commons/types/EntityIdBase.js +4 -0
- package/api/resources/commons/types/EntityType.d.ts +15 -0
- package/api/resources/commons/types/EntityType.js +14 -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/Feedback.d.ts +16 -0
- package/api/resources/commons/types/Feedback.js +4 -0
- package/api/resources/commons/types/FeedbackType.d.ts +13 -0
- package/api/resources/commons/types/FeedbackType.js +9 -0
- package/api/resources/commons/types/User.d.ts +10 -0
- package/api/resources/commons/types/User.js +4 -0
- package/api/resources/commons/types/UserData.d.ts +10 -0
- package/api/resources/commons/types/UserData.js +4 -0
- package/api/resources/commons/types/VisibilityType.d.ts +9 -0
- package/api/resources/commons/types/VisibilityType.js +8 -0
- package/api/resources/commons/types/index.d.ts +15 -0
- package/api/resources/commons/types/index.js +15 -0
- package/api/resources/conversation/client/Client.d.ts +201 -0
- package/api/resources/conversation/client/Client.js +889 -0
- package/api/resources/conversation/client/index.d.ts +1 -0
- package/api/resources/conversation/client/index.js +1 -0
- package/api/resources/conversation/index.d.ts +2 -0
- package/api/resources/conversation/index.js +2 -0
- package/api/resources/conversation/types/ActionFormField.d.ts +10 -0
- package/api/resources/conversation/types/ActionFormField.js +4 -0
- package/api/resources/conversation/types/AskRequest.d.ts +14 -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 +7 -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 +10 -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 +11 -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/Capability.d.ts +8 -0
- package/api/resources/conversation/types/Capability.js +7 -0
- package/api/resources/conversation/types/ConversationBase.d.ts +8 -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 +8 -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 +8 -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 +12 -0
- package/api/resources/conversation/types/ConversationRequest.js +4 -0
- package/api/resources/conversation/types/ConversationResponse.d.ts +12 -0
- package/api/resources/conversation/types/ConversationResponse.js +4 -0
- package/api/resources/conversation/types/FeedbackRequest.d.ts +5 -0
- package/api/resources/conversation/types/FeedbackRequest.js +4 -0
- package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +8 -0
- package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.js +4 -0
- package/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/api/resources/conversation/types/ResponseConfig.js +4 -0
- package/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/api/resources/conversation/types/ResponseLength.js +8 -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/SubmitActionFormRequest.d.ts +10 -0
- package/api/resources/conversation/types/SubmitActionFormRequest.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/UserMessageBase.d.ts +9 -0
- package/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/api/resources/conversation/types/index.d.ts +31 -0
- package/api/resources/conversation/types/index.js +31 -0
- package/api/resources/index.d.ts +12 -0
- package/api/resources/index.js +12 -0
- package/api/resources/knowledge/client/Client.d.ts +150 -0
- package/api/resources/knowledge/client/Client.js +666 -0
- package/api/resources/knowledge/client/index.d.ts +1 -0
- package/api/resources/knowledge/client/index.js +1 -0
- package/api/resources/knowledge/index.d.ts +2 -0
- package/api/resources/knowledge/index.js +2 -0
- package/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +17 -0
- package/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseProperties.d.ts +12 -0
- package/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
- package/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
- package/api/resources/knowledge/types/KnowledgeBaseResponse.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 +14 -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/KnowledgeDocumentContentType.d.ts +11 -0
- package/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +22 -0
- package/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/api/resources/knowledge/types/index.d.ts +10 -0
- package/api/resources/knowledge/types/index.js +10 -0
- package/api/resources/triggers/client/Client.d.ts +74 -0
- package/api/resources/triggers/client/Client.js +300 -0
- package/api/resources/triggers/client/index.d.ts +1 -0
- package/api/resources/triggers/client/index.js +1 -0
- package/api/resources/triggers/index.d.ts +2 -0
- package/api/resources/triggers/index.js +2 -0
- package/api/resources/triggers/types/EventTriggerBase.d.ts +10 -0
- package/api/resources/triggers/types/EventTriggerBase.js +4 -0
- package/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/api/resources/triggers/types/EventTriggerResponse.d.ts +22 -0
- package/api/resources/triggers/types/EventTriggerResponse.js +4 -0
- package/api/resources/triggers/types/EventTriggerType.d.ts +8 -0
- package/api/resources/triggers/types/EventTriggerType.js +7 -0
- package/api/resources/triggers/types/index.d.ts +4 -0
- package/api/resources/triggers/types/index.js +4 -0
- package/api/resources/users/client/Client.d.ts +64 -0
- package/api/resources/users/client/Client.js +222 -0
- package/api/resources/users/client/index.d.ts +1 -0
- package/api/resources/users/client/index.js +1 -0
- package/api/resources/users/index.d.ts +1 -0
- package/api/resources/users/index.js +1 -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 +39 -0
- package/dist/Client.js +33 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/resources/actions/client/Client.d.ts +79 -0
- package/dist/api/resources/actions/client/Client.js +305 -0
- package/dist/api/resources/actions/client/index.d.ts +1 -0
- package/dist/api/resources/actions/client/index.js +1 -0
- package/dist/api/resources/actions/index.d.ts +2 -0
- package/dist/api/resources/actions/index.js +2 -0
- package/dist/api/resources/actions/types/ActionBase.d.ts +18 -0
- package/dist/api/resources/actions/types/ActionBase.js +4 -0
- package/dist/api/resources/actions/types/ActionParameter.d.ts +9 -0
- package/dist/api/resources/actions/types/ActionParameter.js +4 -0
- package/dist/api/resources/actions/types/ActionRequest.d.ts +23 -0
- package/dist/api/resources/actions/types/ActionRequest.js +4 -0
- package/dist/api/resources/actions/types/ActionResponse.d.ts +27 -0
- package/dist/api/resources/actions/types/ActionResponse.js +4 -0
- package/dist/api/resources/actions/types/Preconditions.d.ts +7 -0
- package/dist/api/resources/actions/types/Preconditions.js +4 -0
- package/dist/api/resources/actions/types/index.d.ts +5 -0
- package/dist/api/resources/actions/types/index.js +5 -0
- package/dist/api/resources/commons/errors/BadRequestError.d.ts +8 -0
- package/dist/api/resources/commons/errors/BadRequestError.js +14 -0
- package/dist/api/resources/commons/errors/NotFoundError.d.ts +8 -0
- package/dist/api/resources/commons/errors/NotFoundError.js +14 -0
- package/dist/api/resources/commons/errors/ServerError.d.ts +8 -0
- package/dist/api/resources/commons/errors/ServerError.js +14 -0
- package/dist/api/resources/commons/errors/index.d.ts +3 -0
- package/dist/api/resources/commons/errors/index.js +3 -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/AppUser.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUser.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentification.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserIdentification.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +9 -0
- package/dist/api/resources/commons/types/AppUserIdentifier.js +4 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserIdentifyingPropertyType.js +7 -0
- package/dist/api/resources/commons/types/AppUserRequest.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserRequest.js +4 -0
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +8 -0
- package/dist/api/resources/commons/types/AppUserResponse.js +4 -0
- package/dist/api/resources/commons/types/EntityId.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityId.js +4 -0
- package/dist/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EntityIdBase.js +4 -0
- package/dist/api/resources/commons/types/EntityType.d.ts +15 -0
- package/dist/api/resources/commons/types/EntityType.js +14 -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/Feedback.d.ts +16 -0
- package/dist/api/resources/commons/types/Feedback.js +4 -0
- package/dist/api/resources/commons/types/FeedbackType.d.ts +13 -0
- package/dist/api/resources/commons/types/FeedbackType.js +9 -0
- package/dist/api/resources/commons/types/User.d.ts +10 -0
- package/dist/api/resources/commons/types/User.js +4 -0
- package/dist/api/resources/commons/types/UserData.d.ts +10 -0
- package/dist/api/resources/commons/types/UserData.js +4 -0
- package/dist/api/resources/commons/types/VisibilityType.d.ts +9 -0
- package/dist/api/resources/commons/types/VisibilityType.js +8 -0
- package/dist/api/resources/commons/types/index.d.ts +15 -0
- package/dist/api/resources/commons/types/index.js +15 -0
- package/dist/api/resources/conversation/client/Client.d.ts +201 -0
- package/dist/api/resources/conversation/client/Client.js +889 -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/index.d.ts +2 -0
- package/dist/api/resources/conversation/index.js +2 -0
- package/dist/api/resources/conversation/types/ActionFormField.d.ts +10 -0
- package/dist/api/resources/conversation/types/ActionFormField.js +4 -0
- package/dist/api/resources/conversation/types/AskRequest.d.ts +14 -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 +7 -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 +10 -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 +11 -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/Capability.d.ts +8 -0
- package/dist/api/resources/conversation/types/Capability.js +7 -0
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +8 -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 +8 -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 +8 -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 +12 -0
- package/dist/api/resources/conversation/types/ConversationRequest.js +4 -0
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +12 -0
- package/dist/api/resources/conversation/types/ConversationResponse.js +4 -0
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +5 -0
- package/dist/api/resources/conversation/types/FeedbackRequest.js +4 -0
- package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +8 -0
- package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.js +4 -0
- package/dist/api/resources/conversation/types/ResponseConfig.d.ts +12 -0
- package/dist/api/resources/conversation/types/ResponseConfig.js +4 -0
- package/dist/api/resources/conversation/types/ResponseLength.d.ts +9 -0
- package/dist/api/resources/conversation/types/ResponseLength.js +8 -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/SubmitActionFormRequest.d.ts +10 -0
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.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/UserMessageBase.d.ts +9 -0
- package/dist/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/dist/api/resources/conversation/types/index.d.ts +31 -0
- package/dist/api/resources/conversation/types/index.js +31 -0
- package/dist/api/resources/index.d.ts +12 -0
- package/dist/api/resources/index.js +12 -0
- package/dist/api/resources/knowledge/client/Client.d.ts +150 -0
- package/dist/api/resources/knowledge/client/Client.js +666 -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/index.d.ts +2 -0
- package/dist/api/resources/knowledge/index.js +2 -0
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +17 -0
- package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseProperties.d.ts +12 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseProperties.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.d.ts +18 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +22 -0
- package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.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 +14 -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/KnowledgeDocumentContentType.d.ts +11 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentContentType.js +7 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +22 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.js +4 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +24 -0
- package/dist/api/resources/knowledge/types/KnowledgeDocumentResponse.js +4 -0
- package/dist/api/resources/knowledge/types/index.d.ts +10 -0
- package/dist/api/resources/knowledge/types/index.js +10 -0
- package/dist/api/resources/triggers/client/Client.d.ts +74 -0
- package/dist/api/resources/triggers/client/Client.js +300 -0
- package/dist/api/resources/triggers/client/index.d.ts +1 -0
- package/dist/api/resources/triggers/client/index.js +1 -0
- package/dist/api/resources/triggers/index.d.ts +2 -0
- package/dist/api/resources/triggers/index.js +2 -0
- package/dist/api/resources/triggers/types/EventTriggerBase.d.ts +10 -0
- package/dist/api/resources/triggers/types/EventTriggerBase.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerResponse.d.ts +22 -0
- package/dist/api/resources/triggers/types/EventTriggerResponse.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerType.d.ts +8 -0
- package/dist/api/resources/triggers/types/EventTriggerType.js +7 -0
- package/dist/api/resources/triggers/types/index.d.ts +4 -0
- package/dist/api/resources/triggers/types/index.js +4 -0
- package/dist/api/resources/users/client/Client.d.ts +64 -0
- package/dist/api/resources/users/client/Client.js +222 -0
- package/dist/api/resources/users/client/index.d.ts +1 -0
- package/dist/api/resources/users/client/index.js +1 -0
- package/dist/api/resources/users/index.d.ts +1 -0
- package/dist/api/resources/users/index.js +1 -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/actions/index.d.ts +1 -0
- package/dist/serialization/resources/actions/index.js +1 -0
- package/dist/serialization/resources/actions/types/ActionBase.d.ts +19 -0
- package/dist/serialization/resources/actions/types/ActionBase.js +14 -0
- package/dist/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
- package/dist/serialization/resources/actions/types/ActionParameter.js +10 -0
- package/dist/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/dist/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/dist/serialization/resources/actions/types/Preconditions.d.ts +12 -0
- package/dist/serialization/resources/actions/types/Preconditions.js +7 -0
- package/dist/serialization/resources/actions/types/index.d.ts +5 -0
- package/dist/serialization/resources/actions/types/index.js +5 -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/AppUser.d.ts +15 -0
- package/dist/serialization/resources/commons/types/AppUser.js +10 -0
- package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +13 -0
- package/dist/serialization/resources/commons/types/AppUserIdentification.js +8 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifier.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifier.js +9 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
- package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserRequest.js +11 -0
- package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +14 -0
- package/dist/serialization/resources/commons/types/AppUserResponse.js +11 -0
- package/dist/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/dist/serialization/resources/commons/types/EntityId.js +14 -0
- package/dist/serialization/resources/commons/types/EntityIdBase.d.ts +12 -0
- package/dist/serialization/resources/commons/types/EntityIdBase.js +7 -0
- package/dist/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EntityType.js +15 -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/Feedback.d.ts +17 -0
- package/dist/serialization/resources/commons/types/Feedback.js +12 -0
- package/dist/serialization/resources/commons/types/FeedbackType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/FeedbackType.js +5 -0
- package/dist/serialization/resources/commons/types/User.d.ts +15 -0
- package/dist/serialization/resources/commons/types/User.js +10 -0
- package/dist/serialization/resources/commons/types/UserData.d.ts +14 -0
- package/dist/serialization/resources/commons/types/UserData.js +9 -0
- package/dist/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/VisibilityType.js +5 -0
- package/dist/serialization/resources/commons/types/index.d.ts +15 -0
- package/dist/serialization/resources/commons/types/index.js +15 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.js +6 -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 +2 -0
- package/dist/serialization/resources/conversation/client/index.js +2 -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 +16 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.js +11 -0
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +18 -0
- package/dist/serialization/resources/conversation/types/AskRequest.js +13 -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 +13 -0
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.js +8 -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 +16 -0
- package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +11 -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 +20 -0
- package/dist/serialization/resources/conversation/types/BotMessage.js +17 -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/Capability.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/Capability.js +5 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +13 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.js +8 -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 +13 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +8 -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 +14 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +11 -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 +18 -0
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +15 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +18 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +15 -0
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +11 -0
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +5 -0
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +13 -0
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +8 -0
- package/dist/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/dist/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/ResponseLength.js +5 -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/SubmitActionFormRequest.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +10 -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 +14 -0
- package/dist/serialization/resources/conversation/types/UserMessage.js +11 -0
- package/dist/serialization/resources/conversation/types/UserMessageBase.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/UserMessageBase.js +12 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +31 -0
- package/dist/serialization/resources/conversation/types/index.js +31 -0
- package/dist/serialization/resources/index.d.ts +10 -0
- package/dist/serialization/resources/index.js +10 -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/BaseKnowledgeDocument.d.ts +17 -0
- package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +12 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseProperties.js +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -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 +13 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +8 -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/KnowledgeDocumentContentType.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +17 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
- package/dist/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
- package/dist/serialization/resources/knowledge/types/index.d.ts +10 -0
- package/dist/serialization/resources/knowledge/types/index.js +10 -0
- package/dist/serialization/resources/triggers/index.d.ts +1 -0
- package/dist/serialization/resources/triggers/index.js +1 -0
- package/dist/serialization/resources/triggers/types/EventTriggerBase.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerBase.js +9 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/dist/serialization/resources/triggers/types/EventTriggerResponse.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerResponse.js +11 -0
- package/dist/serialization/resources/triggers/types/EventTriggerType.d.ts +10 -0
- package/dist/serialization/resources/triggers/types/EventTriggerType.js +5 -0
- package/dist/serialization/resources/triggers/types/index.d.ts +4 -0
- package/dist/serialization/resources/triggers/types/index.js +4 -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/actions/index.d.ts +1 -0
- package/serialization/resources/actions/index.js +1 -0
- package/serialization/resources/actions/types/ActionBase.d.ts +19 -0
- package/serialization/resources/actions/types/ActionBase.js +14 -0
- package/serialization/resources/actions/types/ActionParameter.d.ts +15 -0
- package/serialization/resources/actions/types/ActionParameter.js +10 -0
- package/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/serialization/resources/actions/types/Preconditions.d.ts +12 -0
- package/serialization/resources/actions/types/Preconditions.js +7 -0
- package/serialization/resources/actions/types/index.d.ts +5 -0
- package/serialization/resources/actions/types/index.js +5 -0
- package/serialization/resources/commons/index.d.ts +1 -0
- package/serialization/resources/commons/index.js +1 -0
- package/serialization/resources/commons/types/AppUser.d.ts +15 -0
- package/serialization/resources/commons/types/AppUser.js +10 -0
- package/serialization/resources/commons/types/AppUserIdentification.d.ts +13 -0
- package/serialization/resources/commons/types/AppUserIdentification.js +8 -0
- package/serialization/resources/commons/types/AppUserIdentifier.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserIdentifier.js +9 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.d.ts +10 -0
- package/serialization/resources/commons/types/AppUserIdentifyingPropertyType.js +5 -0
- package/serialization/resources/commons/types/AppUserRequest.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserRequest.js +11 -0
- package/serialization/resources/commons/types/AppUserResponse.d.ts +14 -0
- package/serialization/resources/commons/types/AppUserResponse.js +11 -0
- package/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/serialization/resources/commons/types/EntityId.js +14 -0
- package/serialization/resources/commons/types/EntityIdBase.d.ts +12 -0
- package/serialization/resources/commons/types/EntityIdBase.js +7 -0
- package/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/serialization/resources/commons/types/EntityType.js +15 -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/Feedback.d.ts +17 -0
- package/serialization/resources/commons/types/Feedback.js +12 -0
- package/serialization/resources/commons/types/FeedbackType.d.ts +10 -0
- package/serialization/resources/commons/types/FeedbackType.js +5 -0
- package/serialization/resources/commons/types/User.d.ts +15 -0
- package/serialization/resources/commons/types/User.js +10 -0
- package/serialization/resources/commons/types/UserData.d.ts +14 -0
- package/serialization/resources/commons/types/UserData.js +9 -0
- package/serialization/resources/commons/types/VisibilityType.d.ts +10 -0
- package/serialization/resources/commons/types/VisibilityType.js +5 -0
- package/serialization/resources/commons/types/index.d.ts +15 -0
- package/serialization/resources/commons/types/index.js +15 -0
- package/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/serialization/resources/conversation/client/addConversationMetadata.js +6 -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 +2 -0
- package/serialization/resources/conversation/client/index.js +2 -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 +16 -0
- package/serialization/resources/conversation/types/ActionFormField.js +11 -0
- package/serialization/resources/conversation/types/AskRequest.d.ts +18 -0
- package/serialization/resources/conversation/types/AskRequest.js +13 -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 +13 -0
- package/serialization/resources/conversation/types/AskStreamStartEvent.js +8 -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 +16 -0
- package/serialization/resources/conversation/types/BotActionFormResponse.js +11 -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 +20 -0
- package/serialization/resources/conversation/types/BotMessage.js +17 -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/Capability.d.ts +10 -0
- package/serialization/resources/conversation/types/Capability.js +5 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +13 -0
- package/serialization/resources/conversation/types/ConversationBase.js +8 -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 +13 -0
- package/serialization/resources/conversation/types/ConversationMessageBase.js +8 -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 +14 -0
- package/serialization/resources/conversation/types/ConversationMessageRequest.js +11 -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 +18 -0
- package/serialization/resources/conversation/types/ConversationRequest.js +15 -0
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +18 -0
- package/serialization/resources/conversation/types/ConversationResponse.js +15 -0
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +11 -0
- package/serialization/resources/conversation/types/FeedbackRequest.js +5 -0
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +13 -0
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +8 -0
- package/serialization/resources/conversation/types/ResponseConfig.d.ts +16 -0
- package/serialization/resources/conversation/types/ResponseConfig.js +11 -0
- package/serialization/resources/conversation/types/ResponseLength.d.ts +10 -0
- package/serialization/resources/conversation/types/ResponseLength.js +5 -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/SubmitActionFormRequest.d.ts +15 -0
- package/serialization/resources/conversation/types/SubmitActionFormRequest.js +10 -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 +14 -0
- package/serialization/resources/conversation/types/UserMessage.js +11 -0
- package/serialization/resources/conversation/types/UserMessageBase.d.ts +15 -0
- package/serialization/resources/conversation/types/UserMessageBase.js +12 -0
- package/serialization/resources/conversation/types/index.d.ts +31 -0
- package/serialization/resources/conversation/types/index.js +31 -0
- package/serialization/resources/index.d.ts +10 -0
- package/serialization/resources/index.js +10 -0
- package/serialization/resources/knowledge/index.d.ts +1 -0
- package/serialization/resources/knowledge/index.js +1 -0
- package/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +17 -0
- package/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +12 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseProperties.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseProperties.js +10 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseRequest.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseRequest.js +11 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +14 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +11 -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 +13 -0
- package/serialization/resources/knowledge/types/KnowledgeBaseVersion.js +8 -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/KnowledgeDocumentContentType.d.ts +10 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentContentType.js +5 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +17 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +14 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +15 -0
- package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +12 -0
- package/serialization/resources/knowledge/types/index.d.ts +10 -0
- package/serialization/resources/knowledge/types/index.js +10 -0
- package/serialization/resources/triggers/index.d.ts +1 -0
- package/serialization/resources/triggers/index.js +1 -0
- package/serialization/resources/triggers/types/EventTriggerBase.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerBase.js +9 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.js +11 -0
- package/serialization/resources/triggers/types/EventTriggerType.d.ts +10 -0
- package/serialization/resources/triggers/types/EventTriggerType.js +5 -0
- package/serialization/resources/triggers/types/index.d.ts +4 -0
- package/serialization/resources/triggers/types/index.js +4 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SchemaType } from "../../Schema";
|
|
2
|
+
import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator";
|
|
3
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
4
|
+
export const boolean = createIdentitySchemaCreator(SchemaType.BOOLEAN, (value, { breadcrumbsPrefix = [] } = {}) => {
|
|
5
|
+
if (typeof value === "boolean") {
|
|
6
|
+
return {
|
|
7
|
+
ok: true,
|
|
8
|
+
value,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return {
|
|
13
|
+
ok: false,
|
|
14
|
+
errors: [
|
|
15
|
+
{
|
|
16
|
+
path: breadcrumbsPrefix,
|
|
17
|
+
message: getErrorMessageForIncorrectType(value, "boolean"),
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const number: () => import("../../Schema").Schema<number, number>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SchemaType } from "../../Schema";
|
|
2
|
+
import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator";
|
|
3
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
4
|
+
export const number = createIdentitySchemaCreator(SchemaType.NUMBER, (value, { breadcrumbsPrefix = [] } = {}) => {
|
|
5
|
+
if (typeof value === "number") {
|
|
6
|
+
return {
|
|
7
|
+
ok: true,
|
|
8
|
+
value,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return {
|
|
13
|
+
ok: false,
|
|
14
|
+
errors: [
|
|
15
|
+
{
|
|
16
|
+
path: breadcrumbsPrefix,
|
|
17
|
+
message: getErrorMessageForIncorrectType(value, "number"),
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const string: () => import("../../Schema").Schema<string, string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SchemaType } from "../../Schema";
|
|
2
|
+
import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator";
|
|
3
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
4
|
+
export const string = createIdentitySchemaCreator(SchemaType.STRING, (value, { breadcrumbsPrefix = [] } = {}) => {
|
|
5
|
+
if (typeof value === "string") {
|
|
6
|
+
return {
|
|
7
|
+
ok: true,
|
|
8
|
+
value,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return {
|
|
13
|
+
ok: false,
|
|
14
|
+
errors: [
|
|
15
|
+
{
|
|
16
|
+
path: breadcrumbsPrefix,
|
|
17
|
+
message: getErrorMessageForIncorrectType(value, "string"),
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const unknown: () => import("../../Schema").Schema<unknown, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { record } from "./record";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Schema } from "../../Schema";
|
|
2
|
+
import { RecordSchema } from "./types";
|
|
3
|
+
export declare function record<RawKey extends string | number, RawValue, ParsedValue, ParsedKey extends string | number>(keySchema: Schema<RawKey, ParsedKey>, valueSchema: Schema<RawValue, ParsedValue>): RecordSchema<RawKey, RawValue, ParsedKey, ParsedValue>;
|
|
@@ -0,0 +1,102 @@
|
|
|
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 { entries } from "../../utils/entries";
|
|
12
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
13
|
+
import { isPlainObject } from "../../utils/isPlainObject";
|
|
14
|
+
import { maybeSkipValidation } from "../../utils/maybeSkipValidation";
|
|
15
|
+
import { getSchemaUtils } from "../schema-utils";
|
|
16
|
+
export function record(keySchema, valueSchema) {
|
|
17
|
+
const baseSchema = {
|
|
18
|
+
parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
return validateAndTransformRecord({
|
|
20
|
+
value: raw,
|
|
21
|
+
isKeyNumeric: (yield keySchema.getType()) === SchemaType.NUMBER,
|
|
22
|
+
transformKey: (key) => {
|
|
23
|
+
var _a;
|
|
24
|
+
return keySchema.parse(key, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key} (key)`] }));
|
|
25
|
+
},
|
|
26
|
+
transformValue: (value, key) => {
|
|
27
|
+
var _a;
|
|
28
|
+
return valueSchema.parse(value, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key}`] }));
|
|
29
|
+
},
|
|
30
|
+
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
31
|
+
});
|
|
32
|
+
}),
|
|
33
|
+
json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
return validateAndTransformRecord({
|
|
35
|
+
value: parsed,
|
|
36
|
+
isKeyNumeric: (yield keySchema.getType()) === SchemaType.NUMBER,
|
|
37
|
+
transformKey: (key) => {
|
|
38
|
+
var _a;
|
|
39
|
+
return keySchema.json(key, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key} (key)`] }));
|
|
40
|
+
},
|
|
41
|
+
transformValue: (value, key) => {
|
|
42
|
+
var _a;
|
|
43
|
+
return valueSchema.json(value, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key}`] }));
|
|
44
|
+
},
|
|
45
|
+
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
46
|
+
});
|
|
47
|
+
}),
|
|
48
|
+
getType: () => SchemaType.RECORD,
|
|
49
|
+
};
|
|
50
|
+
return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
|
|
51
|
+
}
|
|
52
|
+
function validateAndTransformRecord({ value, isKeyNumeric, transformKey, transformValue, breadcrumbsPrefix = [], }) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
if (!isPlainObject(value)) {
|
|
55
|
+
return {
|
|
56
|
+
ok: false,
|
|
57
|
+
errors: [
|
|
58
|
+
{
|
|
59
|
+
path: breadcrumbsPrefix,
|
|
60
|
+
message: getErrorMessageForIncorrectType(value, "object"),
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return entries(value).reduce((accPromise, [stringKey, value]) => __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
// skip nullish keys
|
|
67
|
+
if (value == null) {
|
|
68
|
+
return accPromise;
|
|
69
|
+
}
|
|
70
|
+
const acc = yield accPromise;
|
|
71
|
+
let key = stringKey;
|
|
72
|
+
if (isKeyNumeric) {
|
|
73
|
+
const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN;
|
|
74
|
+
if (!isNaN(numberKey)) {
|
|
75
|
+
key = numberKey;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const transformedKey = yield transformKey(key);
|
|
79
|
+
const transformedValue = yield transformValue(value, key);
|
|
80
|
+
if (acc.ok && transformedKey.ok && transformedValue.ok) {
|
|
81
|
+
return {
|
|
82
|
+
ok: true,
|
|
83
|
+
value: Object.assign(Object.assign({}, acc.value), { [transformedKey.value]: transformedValue.value }),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const errors = [];
|
|
87
|
+
if (!acc.ok) {
|
|
88
|
+
errors.push(...acc.errors);
|
|
89
|
+
}
|
|
90
|
+
if (!transformedKey.ok) {
|
|
91
|
+
errors.push(...transformedKey.errors);
|
|
92
|
+
}
|
|
93
|
+
if (!transformedValue.ok) {
|
|
94
|
+
errors.push(...transformedValue.errors);
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
ok: false,
|
|
98
|
+
errors,
|
|
99
|
+
};
|
|
100
|
+
}), Promise.resolve({ ok: true, value: {} }));
|
|
101
|
+
});
|
|
102
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BaseSchema } from "../../Schema";
|
|
2
|
+
import { SchemaUtils } from "../schema-utils";
|
|
3
|
+
export declare type RecordSchema<RawKey extends string | number, RawValue, ParsedKey extends string | number, ParsedValue> = BaseRecordSchema<RawKey, RawValue, ParsedKey, ParsedValue> & SchemaUtils<Record<RawKey, RawValue>, Record<ParsedKey, ParsedValue>>;
|
|
4
|
+
export declare type BaseRecordSchema<RawKey extends string | number, RawValue, ParsedKey extends string | number, ParsedValue> = BaseSchema<Record<RawKey, RawValue>, Record<ParsedKey, ParsedValue>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { stringifyValidationError } from "./stringifyValidationErrors";
|
|
2
|
+
export class JsonError extends Error {
|
|
3
|
+
constructor(errors) {
|
|
4
|
+
super(errors.map(stringifyValidationError).join("; "));
|
|
5
|
+
this.errors = errors;
|
|
6
|
+
Object.setPrototypeOf(this, JsonError.prototype);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { stringifyValidationError } from "./stringifyValidationErrors";
|
|
2
|
+
export class ParseError extends Error {
|
|
3
|
+
constructor(errors) {
|
|
4
|
+
super(errors.map(stringifyValidationError).join("; "));
|
|
5
|
+
this.errors = errors;
|
|
6
|
+
Object.setPrototypeOf(this, ParseError.prototype);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseSchema, Schema, SchemaOptions } from "../../Schema";
|
|
2
|
+
export interface SchemaUtils<Raw, Parsed> {
|
|
3
|
+
optional: () => Schema<Raw | null | undefined, Parsed | undefined>;
|
|
4
|
+
transform: <Transformed>(transformer: SchemaTransformer<Parsed, Transformed>) => Schema<Raw, Transformed>;
|
|
5
|
+
parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Promise<Parsed>;
|
|
6
|
+
jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Promise<Raw>;
|
|
7
|
+
}
|
|
8
|
+
export interface SchemaTransformer<Parsed, Transformed> {
|
|
9
|
+
transform: (parsed: Parsed) => Transformed;
|
|
10
|
+
untransform: (transformed: any) => Parsed;
|
|
11
|
+
}
|
|
12
|
+
export declare function getSchemaUtils<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): SchemaUtils<Raw, Parsed>;
|
|
13
|
+
/**
|
|
14
|
+
* schema utils are defined in one file to resolve issues with circular imports
|
|
15
|
+
*/
|
|
16
|
+
export declare function optional<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): Schema<Raw | null | undefined, Parsed | undefined>;
|
|
17
|
+
export declare function transform<Raw, Parsed, Transformed>(schema: BaseSchema<Raw, Parsed>, transformer: SchemaTransformer<Parsed, Transformed>): Schema<Raw, Transformed>;
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { JsonError } from "./JsonError";
|
|
12
|
+
import { ParseError } from "./ParseError";
|
|
13
|
+
export function getSchemaUtils(schema) {
|
|
14
|
+
return {
|
|
15
|
+
optional: () => optional(schema),
|
|
16
|
+
transform: (transformer) => transform(schema, transformer),
|
|
17
|
+
parseOrThrow: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const parsed = yield schema.parse(raw, opts);
|
|
19
|
+
if (parsed.ok) {
|
|
20
|
+
return parsed.value;
|
|
21
|
+
}
|
|
22
|
+
throw new ParseError(parsed.errors);
|
|
23
|
+
}),
|
|
24
|
+
jsonOrThrow: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const raw = yield schema.json(parsed, opts);
|
|
26
|
+
if (raw.ok) {
|
|
27
|
+
return raw.value;
|
|
28
|
+
}
|
|
29
|
+
throw new JsonError(raw.errors);
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* schema utils are defined in one file to resolve issues with circular imports
|
|
35
|
+
*/
|
|
36
|
+
export function optional(schema) {
|
|
37
|
+
const baseSchema = {
|
|
38
|
+
parse: (raw, opts) => {
|
|
39
|
+
if (raw == null) {
|
|
40
|
+
return {
|
|
41
|
+
ok: true,
|
|
42
|
+
value: undefined,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return schema.parse(raw, opts);
|
|
46
|
+
},
|
|
47
|
+
json: (parsed, opts) => {
|
|
48
|
+
if (parsed == null) {
|
|
49
|
+
return {
|
|
50
|
+
ok: true,
|
|
51
|
+
value: null,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return schema.json(parsed, opts);
|
|
55
|
+
},
|
|
56
|
+
getType: () => SchemaType.OPTIONAL,
|
|
57
|
+
};
|
|
58
|
+
return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
|
|
59
|
+
}
|
|
60
|
+
export function transform(schema, transformer) {
|
|
61
|
+
const baseSchema = {
|
|
62
|
+
parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const parsed = yield schema.parse(raw, opts);
|
|
64
|
+
if (!parsed.ok) {
|
|
65
|
+
return parsed;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
ok: true,
|
|
69
|
+
value: transformer.transform(parsed.value),
|
|
70
|
+
};
|
|
71
|
+
}),
|
|
72
|
+
json: (transformed, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const parsed = yield transformer.untransform(transformed);
|
|
74
|
+
return schema.json(parsed, opts);
|
|
75
|
+
}),
|
|
76
|
+
getType: () => schema.getType(),
|
|
77
|
+
};
|
|
78
|
+
return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { set } from "./set";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { set } from "./set";
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { list } from "../list";
|
|
14
|
+
import { getSchemaUtils } from "../schema-utils";
|
|
15
|
+
export function set(schema) {
|
|
16
|
+
const listSchema = list(schema);
|
|
17
|
+
const baseSchema = {
|
|
18
|
+
parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const parsedList = yield listSchema.parse(raw, opts);
|
|
20
|
+
if (parsedList.ok) {
|
|
21
|
+
return {
|
|
22
|
+
ok: true,
|
|
23
|
+
value: new Set(parsedList.value),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return parsedList;
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
var _a;
|
|
32
|
+
if (!(parsed instanceof Set)) {
|
|
33
|
+
return {
|
|
34
|
+
ok: false,
|
|
35
|
+
errors: [
|
|
36
|
+
{
|
|
37
|
+
path: (_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : [],
|
|
38
|
+
message: getErrorMessageForIncorrectType(parsed, "Set"),
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const jsonList = yield listSchema.json([...parsed], opts);
|
|
44
|
+
return jsonList;
|
|
45
|
+
}),
|
|
46
|
+
getType: () => SchemaType.SET,
|
|
47
|
+
};
|
|
48
|
+
return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { undiscriminatedUnion } from "./undiscriminatedUnion";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { inferParsed, inferRaw, Schema } from "../../Schema";
|
|
2
|
+
export declare type UndiscriminatedUnionSchema<Schemas extends [...Schema[]]> = Schema<inferRawUnidiscriminatedUnionSchema<Schemas>, inferParsedUnidiscriminatedUnionSchema<Schemas>>;
|
|
3
|
+
export declare type inferRawUnidiscriminatedUnionSchema<Schemas extends [...Schema[]]> = inferRaw<Schemas[number]>;
|
|
4
|
+
export declare type inferParsedUnidiscriminatedUnionSchema<Schemas extends [...Schema[]]> = inferParsed<Schemas[number]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Schema } from "../../Schema";
|
|
2
|
+
import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types";
|
|
3
|
+
export declare function undiscriminatedUnion<Schemas extends [Schema<any, any>, ...Schema<any, any>[]]>(schemas: Schemas): Schema<inferRawUnidiscriminatedUnionSchema<Schemas>, inferParsedUnidiscriminatedUnionSchema<Schemas>>;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { maybeSkipValidation } from "../../utils/maybeSkipValidation";
|
|
12
|
+
import { getSchemaUtils } from "../schema-utils";
|
|
13
|
+
export function undiscriminatedUnion(schemas) {
|
|
14
|
+
const baseSchema = {
|
|
15
|
+
parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.parse(raw, opts), schemas, opts);
|
|
17
|
+
}),
|
|
18
|
+
json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.json(parsed, opts), schemas, opts);
|
|
20
|
+
}),
|
|
21
|
+
getType: () => SchemaType.UNDISCRIMINATED_UNION,
|
|
22
|
+
};
|
|
23
|
+
return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
|
|
24
|
+
}
|
|
25
|
+
function validateAndTransformUndiscriminatedUnion(transform, schemas, opts) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const errors = [];
|
|
28
|
+
for (const [index, schema] of schemas.entries()) {
|
|
29
|
+
const transformed = yield transform(schema, Object.assign(Object.assign({}, opts), { skipValidation: false }));
|
|
30
|
+
if (transformed.ok) {
|
|
31
|
+
return transformed;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
for (const error of transformed.errors) {
|
|
35
|
+
errors.push({
|
|
36
|
+
path: error.path,
|
|
37
|
+
message: `[Variant ${index}] ${error.message}`,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
ok: false,
|
|
44
|
+
errors,
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function discriminant<RawDiscriminant extends string, ParsedDiscriminant extends string>(parsedDiscriminant: ParsedDiscriminant, rawDiscriminant: RawDiscriminant): Discriminant<RawDiscriminant, ParsedDiscriminant>;
|
|
2
|
+
export interface Discriminant<RawDiscriminant extends string, ParsedDiscriminant extends string> {
|
|
3
|
+
parsedDiscriminant: ParsedDiscriminant;
|
|
4
|
+
rawDiscriminant: RawDiscriminant;
|
|
5
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { inferParsedObject, inferRawObject, ObjectSchema } from "../object";
|
|
2
|
+
import { Discriminant } from "./discriminant";
|
|
3
|
+
export declare type UnionSubtypes<DiscriminantValues extends string | number | symbol> = {
|
|
4
|
+
[K in DiscriminantValues]: ObjectSchema<any, any>;
|
|
5
|
+
};
|
|
6
|
+
export declare type inferRawUnion<D extends string | Discriminant<any, any>, U extends UnionSubtypes<keyof U>> = {
|
|
7
|
+
[K in keyof U]: Record<inferRawDiscriminant<D>, K> & inferRawObject<U[K]>;
|
|
8
|
+
}[keyof U];
|
|
9
|
+
export declare type inferParsedUnion<D extends string | Discriminant<any, any>, U extends UnionSubtypes<keyof U>> = {
|
|
10
|
+
[K in keyof U]: Record<inferParsedDiscriminant<D>, K> & inferParsedObject<U[K]>;
|
|
11
|
+
}[keyof U];
|
|
12
|
+
export declare type inferRawDiscriminant<D extends string | Discriminant<any, any>> = D extends string ? D : D extends Discriminant<infer Raw, any> ? Raw : never;
|
|
13
|
+
export declare type inferParsedDiscriminant<D extends string | Discriminant<any, any>> = D extends string ? D : D extends Discriminant<any, infer Parsed> ? Parsed : never;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ObjectLikeSchema } from "../object-like";
|
|
2
|
+
import { Discriminant } from "./discriminant";
|
|
3
|
+
import { inferParsedUnion, inferRawUnion, UnionSubtypes } from "./types";
|
|
4
|
+
export declare function union<D extends string | Discriminant<any, any>, U extends UnionSubtypes<any>>(discriminant: D, union: U): ObjectLikeSchema<inferRawUnion<D, U>, inferParsedUnion<D, U>>;
|