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,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";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, ObjectUtils, PropertySchemas } from "./types";
|
|
2
|
+
export declare function object<ParsedKeys extends string, T extends PropertySchemas<ParsedKeys>>(schemas: T): inferObjectSchemaFromPropertySchemas<T>;
|
|
3
|
+
export declare function getObjectUtils<Raw, Parsed>(schema: BaseObjectSchema<Raw, Parsed>): ObjectUtils<Raw, Parsed>;
|
|
@@ -0,0 +1,249 @@
|
|
|
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 { filterObject } from "../../utils/filterObject";
|
|
13
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
14
|
+
import { isPlainObject } from "../../utils/isPlainObject";
|
|
15
|
+
import { keys } from "../../utils/keys";
|
|
16
|
+
import { maybeSkipValidation } from "../../utils/maybeSkipValidation";
|
|
17
|
+
import { partition } from "../../utils/partition";
|
|
18
|
+
import { getObjectLikeUtils } from "../object-like";
|
|
19
|
+
import { getSchemaUtils } from "../schema-utils";
|
|
20
|
+
import { isProperty } from "./property";
|
|
21
|
+
export function object(schemas) {
|
|
22
|
+
const baseSchema = {
|
|
23
|
+
_getRawProperties: () => Promise.resolve(Object.entries(schemas).map(([parsedKey, propertySchema]) => isProperty(propertySchema) ? propertySchema.rawKey : parsedKey)),
|
|
24
|
+
_getParsedProperties: () => Promise.resolve(keys(schemas)),
|
|
25
|
+
parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const rawKeyToProperty = {};
|
|
27
|
+
const requiredKeys = [];
|
|
28
|
+
for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) {
|
|
29
|
+
const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey;
|
|
30
|
+
const valueSchema = isProperty(schemaOrObjectProperty)
|
|
31
|
+
? schemaOrObjectProperty.valueSchema
|
|
32
|
+
: schemaOrObjectProperty;
|
|
33
|
+
const property = {
|
|
34
|
+
rawKey,
|
|
35
|
+
parsedKey: parsedKey,
|
|
36
|
+
valueSchema,
|
|
37
|
+
};
|
|
38
|
+
rawKeyToProperty[rawKey] = property;
|
|
39
|
+
if (isSchemaRequired(valueSchema)) {
|
|
40
|
+
requiredKeys.push(rawKey);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return validateAndTransformObject({
|
|
44
|
+
value: raw,
|
|
45
|
+
requiredKeys,
|
|
46
|
+
getProperty: (rawKey) => {
|
|
47
|
+
const property = rawKeyToProperty[rawKey];
|
|
48
|
+
if (property == null) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
transformedKey: property.parsedKey,
|
|
53
|
+
transform: (propertyValue) => {
|
|
54
|
+
var _a;
|
|
55
|
+
return property.valueSchema.parse(propertyValue, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), rawKey] }));
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
unrecognizedObjectKeys: opts === null || opts === void 0 ? void 0 : opts.unrecognizedObjectKeys,
|
|
60
|
+
skipValidation: opts === null || opts === void 0 ? void 0 : opts.skipValidation,
|
|
61
|
+
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
62
|
+
});
|
|
63
|
+
}),
|
|
64
|
+
json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const requiredKeys = [];
|
|
66
|
+
for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) {
|
|
67
|
+
const valueSchema = isProperty(schemaOrObjectProperty)
|
|
68
|
+
? schemaOrObjectProperty.valueSchema
|
|
69
|
+
: schemaOrObjectProperty;
|
|
70
|
+
if (isSchemaRequired(valueSchema)) {
|
|
71
|
+
requiredKeys.push(parsedKey);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return validateAndTransformObject({
|
|
75
|
+
value: parsed,
|
|
76
|
+
requiredKeys,
|
|
77
|
+
getProperty: (parsedKey) => {
|
|
78
|
+
const property = schemas[parsedKey];
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
80
|
+
if (property == null) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
if (isProperty(property)) {
|
|
84
|
+
return {
|
|
85
|
+
transformedKey: property.rawKey,
|
|
86
|
+
transform: (propertyValue) => {
|
|
87
|
+
var _a;
|
|
88
|
+
return property.valueSchema.json(propertyValue, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), parsedKey] }));
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
return {
|
|
94
|
+
transformedKey: parsedKey,
|
|
95
|
+
transform: (propertyValue) => {
|
|
96
|
+
var _a;
|
|
97
|
+
return property.json(propertyValue, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), parsedKey] }));
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
unrecognizedObjectKeys: opts === null || opts === void 0 ? void 0 : opts.unrecognizedObjectKeys,
|
|
103
|
+
skipValidation: opts === null || opts === void 0 ? void 0 : opts.skipValidation,
|
|
104
|
+
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
105
|
+
});
|
|
106
|
+
}),
|
|
107
|
+
getType: () => SchemaType.OBJECT,
|
|
108
|
+
};
|
|
109
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema)), getObjectLikeUtils(baseSchema)), getObjectUtils(baseSchema));
|
|
110
|
+
}
|
|
111
|
+
function validateAndTransformObject({ value, requiredKeys, getProperty, unrecognizedObjectKeys = "fail", skipValidation = false, breadcrumbsPrefix = [], }) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
if (!isPlainObject(value)) {
|
|
114
|
+
return {
|
|
115
|
+
ok: false,
|
|
116
|
+
errors: [
|
|
117
|
+
{
|
|
118
|
+
path: breadcrumbsPrefix,
|
|
119
|
+
message: getErrorMessageForIncorrectType(value, "object"),
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const missingRequiredKeys = new Set(requiredKeys);
|
|
125
|
+
const errors = [];
|
|
126
|
+
const transformed = {};
|
|
127
|
+
for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) {
|
|
128
|
+
const property = getProperty(preTransformedKey);
|
|
129
|
+
if (property != null) {
|
|
130
|
+
missingRequiredKeys.delete(preTransformedKey);
|
|
131
|
+
const value = yield property.transform(preTransformedItemValue);
|
|
132
|
+
if (value.ok) {
|
|
133
|
+
transformed[property.transformedKey] = value.value;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
transformed[preTransformedKey] = preTransformedItemValue;
|
|
137
|
+
errors.push(...value.errors);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
switch (unrecognizedObjectKeys) {
|
|
142
|
+
case "fail":
|
|
143
|
+
errors.push({
|
|
144
|
+
path: [...breadcrumbsPrefix, preTransformedKey],
|
|
145
|
+
message: `Unexpected key "${preTransformedKey}"`,
|
|
146
|
+
});
|
|
147
|
+
break;
|
|
148
|
+
case "strip":
|
|
149
|
+
break;
|
|
150
|
+
case "passthrough":
|
|
151
|
+
transformed[preTransformedKey] = preTransformedItemValue;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
errors.push(...requiredKeys
|
|
157
|
+
.filter((key) => missingRequiredKeys.has(key))
|
|
158
|
+
.map((key) => ({
|
|
159
|
+
path: breadcrumbsPrefix,
|
|
160
|
+
message: `Missing required key "${key}"`,
|
|
161
|
+
})));
|
|
162
|
+
if (errors.length === 0 || skipValidation) {
|
|
163
|
+
return {
|
|
164
|
+
ok: true,
|
|
165
|
+
value: transformed,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
return {
|
|
170
|
+
ok: false,
|
|
171
|
+
errors,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
export function getObjectUtils(schema) {
|
|
177
|
+
return {
|
|
178
|
+
extend: (extension) => {
|
|
179
|
+
const baseSchema = {
|
|
180
|
+
_getParsedProperties: () => __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
return [
|
|
182
|
+
...(yield schema._getParsedProperties()),
|
|
183
|
+
...(yield extension._getParsedProperties()),
|
|
184
|
+
];
|
|
185
|
+
}),
|
|
186
|
+
_getRawProperties: () => __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
return [
|
|
188
|
+
...(yield schema._getRawProperties()),
|
|
189
|
+
...(yield extension._getRawProperties()),
|
|
190
|
+
];
|
|
191
|
+
}),
|
|
192
|
+
parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
return validateAndTransformExtendedObject({
|
|
194
|
+
extensionKeys: yield extension._getRawProperties(),
|
|
195
|
+
value: raw,
|
|
196
|
+
transformBase: (rawBase) => schema.parse(rawBase, opts),
|
|
197
|
+
transformExtension: (rawExtension) => extension.parse(rawExtension, opts),
|
|
198
|
+
});
|
|
199
|
+
}),
|
|
200
|
+
json: (parsed, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
return validateAndTransformExtendedObject({
|
|
202
|
+
extensionKeys: yield extension._getParsedProperties(),
|
|
203
|
+
value: parsed,
|
|
204
|
+
transformBase: (parsedBase) => schema.json(parsedBase, opts),
|
|
205
|
+
transformExtension: (parsedExtension) => extension.json(parsedExtension, opts),
|
|
206
|
+
});
|
|
207
|
+
}),
|
|
208
|
+
getType: () => SchemaType.OBJECT,
|
|
209
|
+
};
|
|
210
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema)), getObjectLikeUtils(baseSchema)), getObjectUtils(baseSchema));
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function validateAndTransformExtendedObject({ extensionKeys, value, transformBase, transformExtension, }) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
const extensionPropertiesSet = new Set(extensionKeys);
|
|
217
|
+
const [extensionProperties, baseProperties] = partition(keys(value), (key) => extensionPropertiesSet.has(key));
|
|
218
|
+
const transformedBase = yield transformBase(filterObject(value, baseProperties));
|
|
219
|
+
const transformedExtension = yield transformExtension(filterObject(value, extensionProperties));
|
|
220
|
+
if (transformedBase.ok && transformedExtension.ok) {
|
|
221
|
+
return {
|
|
222
|
+
ok: true,
|
|
223
|
+
value: Object.assign(Object.assign({}, transformedBase.value), transformedExtension.value),
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
return {
|
|
228
|
+
ok: false,
|
|
229
|
+
errors: [
|
|
230
|
+
...(transformedBase.ok ? [] : transformedBase.errors),
|
|
231
|
+
...(transformedExtension.ok ? [] : transformedExtension.errors),
|
|
232
|
+
],
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
function isSchemaRequired(schema) {
|
|
238
|
+
return !isSchemaOptional(schema);
|
|
239
|
+
}
|
|
240
|
+
function isSchemaOptional(schema) {
|
|
241
|
+
switch (schema.getType()) {
|
|
242
|
+
case SchemaType.ANY:
|
|
243
|
+
case SchemaType.UNKNOWN:
|
|
244
|
+
case SchemaType.OPTIONAL:
|
|
245
|
+
return true;
|
|
246
|
+
default:
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { inferParsedPropertySchema, inferRawObjectFromPropertySchemas, ObjectSchema, PropertySchemas } from "./types";
|
|
2
|
+
export declare function objectWithoutOptionalProperties<ParsedKeys extends string, T extends PropertySchemas<ParsedKeys>>(schemas: T): inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas<T>;
|
|
3
|
+
export declare type inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas<T extends PropertySchemas<keyof T>> = ObjectSchema<inferRawObjectFromPropertySchemas<T>, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas<T>>;
|
|
4
|
+
export declare type inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas<T extends PropertySchemas<keyof T>> = {
|
|
5
|
+
[K in keyof T]: inferParsedPropertySchema<T[K]>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Schema } from "../../Schema";
|
|
2
|
+
export declare function property<RawKey extends string, RawValue, ParsedValue>(rawKey: RawKey, valueSchema: Schema<RawValue, ParsedValue>): Property<RawKey, RawValue, ParsedValue>;
|
|
3
|
+
export interface Property<RawKey extends string, RawValue, ParsedValue> {
|
|
4
|
+
rawKey: RawKey;
|
|
5
|
+
valueSchema: Schema<RawValue, ParsedValue>;
|
|
6
|
+
isProperty: true;
|
|
7
|
+
}
|
|
8
|
+
export declare function isProperty<O extends Property<any, any, any>>(maybeProperty: unknown): maybeProperty is O;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function property(rawKey, valueSchema) {
|
|
2
|
+
return {
|
|
3
|
+
rawKey,
|
|
4
|
+
valueSchema,
|
|
5
|
+
isProperty: true,
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export function isProperty(maybeProperty) {
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
10
|
+
return maybeProperty.isProperty;
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema";
|
|
2
|
+
import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties";
|
|
3
|
+
import { ObjectLikeUtils } from "../object-like";
|
|
4
|
+
import { SchemaUtils } from "../schema-utils";
|
|
5
|
+
import { Property } from "./property";
|
|
6
|
+
export declare type ObjectSchema<Raw, Parsed> = BaseObjectSchema<Raw, Parsed> & ObjectLikeUtils<Raw, Parsed> & ObjectUtils<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
|
|
7
|
+
export interface BaseObjectSchema<Raw, Parsed> extends BaseSchema<Raw, Parsed> {
|
|
8
|
+
_getRawProperties: () => Promise<(keyof Raw)[]>;
|
|
9
|
+
_getParsedProperties: () => Promise<(keyof Parsed)[]>;
|
|
10
|
+
}
|
|
11
|
+
export interface ObjectUtils<Raw, Parsed> {
|
|
12
|
+
extend: <RawExtension, ParsedExtension>(schemas: ObjectSchema<RawExtension, ParsedExtension>) => ObjectSchema<Raw & RawExtension, Parsed & ParsedExtension>;
|
|
13
|
+
}
|
|
14
|
+
export declare type inferRawObject<O extends ObjectSchema<any, any>> = O extends ObjectSchema<infer Raw, any> ? Raw : never;
|
|
15
|
+
export declare type inferParsedObject<O extends ObjectSchema<any, any>> = O extends ObjectSchema<any, infer Parsed> ? Parsed : never;
|
|
16
|
+
export declare type inferObjectSchemaFromPropertySchemas<T extends PropertySchemas<keyof T>> = ObjectSchema<inferRawObjectFromPropertySchemas<T>, inferParsedObjectFromPropertySchemas<T>>;
|
|
17
|
+
export declare type inferRawObjectFromPropertySchemas<T extends PropertySchemas<keyof T>> = addQuestionMarksToNullableProperties<{
|
|
18
|
+
[ParsedKey in keyof T as inferRawKey<ParsedKey, T[ParsedKey]>]: inferRawPropertySchema<T[ParsedKey]>;
|
|
19
|
+
}>;
|
|
20
|
+
export declare type inferParsedObjectFromPropertySchemas<T extends PropertySchemas<keyof T>> = addQuestionMarksToNullableProperties<{
|
|
21
|
+
[K in keyof T]: inferParsedPropertySchema<T[K]>;
|
|
22
|
+
}>;
|
|
23
|
+
export declare type PropertySchemas<ParsedKeys extends string | number | symbol> = Record<ParsedKeys, Property<any, any, any> | Schema<any, any>>;
|
|
24
|
+
export declare type inferRawPropertySchema<P extends Property<any, any, any> | Schema<any, any>> = P extends Property<any, infer Raw, any> ? Raw : P extends Schema<any, any> ? inferRaw<P> : never;
|
|
25
|
+
export declare type inferParsedPropertySchema<P extends Property<any, any, any> | Schema<any, any>> = P extends Property<any, any, infer Parsed> ? Parsed : P extends Schema<any, any> ? inferParsed<P> : never;
|
|
26
|
+
export declare type inferRawKey<ParsedKey extends string | number | symbol, P extends Property<any, any, any> | Schema<any, any>> = P extends Property<infer Raw, any, any> ? Raw : ParsedKey;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseSchema } from "../../Schema";
|
|
2
|
+
import { ObjectLikeSchema, ObjectLikeUtils } from "./types";
|
|
3
|
+
export declare function getObjectLikeUtils<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): ObjectLikeUtils<Raw, Parsed>;
|
|
4
|
+
/**
|
|
5
|
+
* object-like utils are defined in one file to resolve issues with circular imports
|
|
6
|
+
*/
|
|
7
|
+
export declare function withParsedProperties<RawObjectShape, ParsedObjectShape, Properties>(objectLike: BaseSchema<RawObjectShape, ParsedObjectShape>, properties: {
|
|
8
|
+
[K in keyof Properties]: Properties[K] | ((parsed: ParsedObjectShape) => Properties[K]);
|
|
9
|
+
}): ObjectLikeSchema<RawObjectShape, ParsedObjectShape & Properties>;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { filterObject } from "../../utils/filterObject";
|
|
11
|
+
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
12
|
+
import { isPlainObject } from "../../utils/isPlainObject";
|
|
13
|
+
import { getSchemaUtils } from "../schema-utils";
|
|
14
|
+
export function getObjectLikeUtils(schema) {
|
|
15
|
+
return {
|
|
16
|
+
withParsedProperties: (properties) => withParsedProperties(schema, properties),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* object-like utils are defined in one file to resolve issues with circular imports
|
|
21
|
+
*/
|
|
22
|
+
export function withParsedProperties(objectLike, properties) {
|
|
23
|
+
const objectSchema = {
|
|
24
|
+
parse: (raw, opts) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const parsedObject = yield objectLike.parse(raw, opts);
|
|
26
|
+
if (!parsedObject.ok) {
|
|
27
|
+
return parsedObject;
|
|
28
|
+
}
|
|
29
|
+
const additionalProperties = Object.entries(properties).reduce((processed, [key, value]) => {
|
|
30
|
+
return Object.assign(Object.assign({}, processed), { [key]: typeof value === "function" ? value(parsedObject.value) : value });
|
|
31
|
+
}, {});
|
|
32
|
+
return {
|
|
33
|
+
ok: true,
|
|
34
|
+
value: Object.assign(Object.assign({}, parsedObject.value), additionalProperties),
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
json: (parsed, opts) => {
|
|
38
|
+
var _a;
|
|
39
|
+
if (!isPlainObject(parsed)) {
|
|
40
|
+
return {
|
|
41
|
+
ok: false,
|
|
42
|
+
errors: [
|
|
43
|
+
{
|
|
44
|
+
path: (_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : [],
|
|
45
|
+
message: getErrorMessageForIncorrectType(parsed, "object"),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// strip out added properties
|
|
51
|
+
const addedPropertyKeys = new Set(Object.keys(properties));
|
|
52
|
+
const parsedWithoutAddedProperties = filterObject(parsed, Object.keys(parsed).filter((key) => !addedPropertyKeys.has(key)));
|
|
53
|
+
return objectLike.json(parsedWithoutAddedProperties, opts);
|
|
54
|
+
},
|
|
55
|
+
getType: () => objectLike.getType(),
|
|
56
|
+
};
|
|
57
|
+
return Object.assign(Object.assign(Object.assign({}, objectSchema), getSchemaUtils(objectSchema)), getObjectLikeUtils(objectSchema));
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getObjectLikeUtils, withParsedProperties } from "./getObjectLikeUtils";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseSchema, Schema } from "../../Schema";
|
|
2
|
+
export declare type ObjectLikeSchema<Raw, Parsed> = Schema<Raw, Parsed> & BaseSchema<Raw, Parsed> & ObjectLikeUtils<Raw, Parsed>;
|
|
3
|
+
export interface ObjectLikeUtils<Raw, Parsed> {
|
|
4
|
+
withParsedProperties: <T extends Record<string, any>>(properties: {
|
|
5
|
+
[K in keyof T]: T[K] | ((parsed: Parsed) => T[K]);
|
|
6
|
+
}) => ObjectLikeSchema<Raw, Parsed & T>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const any: () => import("../../Schema").Schema<any, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const boolean: () => import("../../Schema").Schema<boolean, boolean>;
|