mavenagi 0.0.0-alpha.9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +15 -0
- package/Client.js +10 -0
- package/README.md +78 -22
- package/api/resources/actions/client/Client.d.ts +21 -4
- package/api/resources/actions/client/Client.js +33 -19
- package/api/resources/actions/types/ActionBase.d.ts +2 -2
- package/api/resources/actions/types/ActionRequest.d.ts +12 -4
- package/api/resources/actions/types/ActionResponse.d.ts +12 -4
- package/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
- package/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
- package/api/resources/actions/types/MetadataPrecondition.d.ts +10 -0
- package/api/resources/actions/types/Precondition.d.ts +31 -0
- package/api/resources/actions/types/PreconditionBase.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
- package/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
- package/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
- package/api/resources/actions/types/PreconditionOperator.js +6 -0
- package/api/resources/actions/types/TagsPrecondition.d.ts +8 -0
- package/api/resources/actions/types/index.d.ts +9 -1
- package/api/resources/actions/types/index.js +9 -1
- package/api/resources/appSettings/client/Client.d.ts +47 -0
- package/api/resources/appSettings/client/Client.js +125 -0
- package/api/resources/appSettings/client/index.d.ts +1 -0
- package/api/resources/appSettings/client/index.js +1 -0
- package/api/resources/appSettings/index.d.ts +1 -0
- package/api/resources/appSettings/index.js +1 -0
- package/api/resources/commons/types/AppUser.d.ts +3 -4
- package/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/api/resources/commons/types/AppUserRequest.d.ts +22 -1
- package/api/resources/commons/types/AppUserResponse.d.ts +38 -1
- package/api/resources/commons/types/EntityType.d.ts +3 -1
- package/api/resources/commons/types/EntityType.js +2 -0
- package/api/resources/commons/types/Feedback.d.ts +32 -8
- package/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/api/resources/commons/types/UserData.d.ts +10 -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 +6 -2
- package/api/resources/commons/types/index.js +6 -2
- package/api/resources/conversation/client/Client.d.ts +79 -36
- package/api/resources/conversation/client/Client.js +227 -91
- package/api/resources/conversation/client/index.d.ts +1 -1
- package/api/resources/conversation/client/index.js +1 -1
- package/api/resources/conversation/client/requests/ConversationGetRequest.d.ts +15 -0
- package/api/resources/conversation/client/requests/index.d.ts +1 -0
- package/api/resources/conversation/client/requests/index.js +1 -0
- package/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/api/resources/conversation/types/AskRequest.d.ts +21 -5
- package/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
- package/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
- package/api/resources/conversation/types/Attachment.d.ts +9 -0
- package/api/resources/conversation/types/BotChartResponse.d.ts +11 -0
- package/api/resources/conversation/types/BotChartResponse.js +4 -0
- package/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/api/resources/conversation/types/BotResponse.d.ts +4 -1
- package/api/resources/conversation/types/BotResponseMetadata.d.ts +2 -0
- package/api/resources/conversation/types/Capability.d.ts +15 -1
- package/api/resources/conversation/types/Capability.js +2 -0
- package/api/resources/conversation/types/CategorizationResponse.d.ts +6 -0
- package/api/resources/conversation/types/CategorizationResponse.js +4 -0
- package/api/resources/conversation/types/ChartSpecSchema.d.ts +7 -0
- package/api/resources/conversation/types/ChartSpecSchema.js +6 -0
- package/api/resources/conversation/types/ConversationAnalysis.d.ts +16 -0
- package/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/api/resources/conversation/types/ConversationBase.d.ts +12 -2
- package/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
- package/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
- package/api/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/api/resources/conversation/types/ConversationResponse.d.ts +51 -2
- package/api/resources/conversation/types/FeedbackRequest.d.ts +24 -1
- package/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/api/resources/conversation/types/ResponseConfig.d.ts +4 -4
- package/api/resources/conversation/types/Sentiment.d.ts +14 -0
- package/api/resources/conversation/types/Sentiment.js +10 -0
- package/api/resources/conversation/types/StreamResponse.d.ts +4 -1
- package/api/resources/conversation/types/SubmitActionFormRequest.d.ts +1 -3
- package/api/resources/conversation/types/UserMessage.d.ts +5 -4
- package/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
- package/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/api/resources/conversation/types/index.d.ts +8 -2
- package/api/resources/conversation/types/index.js +8 -2
- package/api/resources/index.d.ts +4 -0
- package/api/resources/index.js +4 -0
- package/api/resources/knowledge/client/Client.d.ts +13 -4
- package/api/resources/knowledge/client/Client.js +55 -41
- package/api/resources/translations/client/Client.d.ts +52 -0
- package/api/resources/translations/client/Client.js +130 -0
- package/api/resources/translations/client/index.d.ts +1 -0
- package/api/resources/translations/client/index.js +1 -0
- package/api/resources/translations/index.d.ts +2 -0
- package/api/resources/translations/index.js +2 -0
- package/api/resources/translations/types/TranslationRequest.d.ts +16 -0
- package/api/resources/translations/types/TranslationRequest.js +4 -0
- package/api/resources/translations/types/TranslationResponse.d.ts +13 -0
- package/api/resources/translations/types/TranslationResponse.js +4 -0
- package/api/resources/translations/types/index.d.ts +2 -0
- package/api/resources/translations/types/index.js +2 -0
- package/api/resources/triggers/client/Client.d.ts +10 -1
- package/api/resources/triggers/client/Client.js +22 -16
- package/api/resources/triggers/types/index.d.ts +0 -3
- package/api/resources/triggers/types/index.js +0 -3
- package/api/resources/users/client/Client.d.ts +27 -12
- package/api/resources/users/client/Client.js +33 -23
- package/core/fetcher/Fetcher.d.ts +4 -1
- package/core/fetcher/Fetcher.js +18 -159
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +6 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +32 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +19 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +48 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +38 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +28 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +32 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +243 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/core/runtime/runtime.d.ts +1 -0
- package/core/runtime/runtime.js +1 -0
- package/core/schemas/Schema.d.ts +8 -4
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/core/schemas/builders/bigint/bigint.js +46 -0
- package/core/schemas/builders/bigint/index.d.ts +1 -0
- package/core/schemas/builders/bigint/index.js +1 -0
- package/core/schemas/builders/index.d.ts +1 -0
- package/core/schemas/builders/index.js +1 -0
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +15 -0
- package/dist/Client.js +10 -0
- package/dist/api/resources/actions/client/Client.d.ts +21 -4
- package/dist/api/resources/actions/client/Client.js +33 -19
- package/dist/api/resources/actions/types/ActionBase.d.ts +2 -2
- package/dist/api/resources/actions/types/ActionRequest.d.ts +12 -4
- package/dist/api/resources/actions/types/ActionResponse.d.ts +12 -4
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +10 -0
- package/dist/api/resources/actions/types/ConversationExecutedActionPrecondition.js +4 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.d.ts +16 -0
- package/dist/api/resources/actions/types/ConversationPrecondition.js +4 -0
- package/dist/api/resources/actions/types/MetadataPrecondition.d.ts +10 -0
- package/dist/api/resources/actions/types/MetadataPrecondition.js +4 -0
- package/dist/api/resources/actions/types/Precondition.d.ts +31 -0
- package/dist/api/resources/actions/types/Precondition.js +4 -0
- package/dist/api/resources/actions/types/PreconditionBase.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionBase.js +4 -0
- package/dist/api/resources/actions/types/PreconditionGroup.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionGroup.js +4 -0
- package/dist/api/resources/actions/types/PreconditionGroupOperator.d.ts +8 -0
- package/dist/api/resources/actions/types/PreconditionGroupOperator.js +7 -0
- package/dist/api/resources/actions/types/PreconditionOperator.d.ts +7 -0
- package/dist/api/resources/actions/types/PreconditionOperator.js +6 -0
- package/dist/api/resources/actions/types/TagsPrecondition.d.ts +8 -0
- package/dist/api/resources/actions/types/TagsPrecondition.js +4 -0
- package/dist/api/resources/actions/types/index.d.ts +9 -1
- package/dist/api/resources/actions/types/index.js +9 -1
- package/dist/api/resources/appSettings/client/Client.d.ts +47 -0
- package/dist/api/resources/appSettings/client/Client.js +125 -0
- package/dist/api/resources/appSettings/client/index.d.ts +1 -0
- package/dist/api/resources/appSettings/client/index.js +1 -0
- package/dist/api/resources/appSettings/index.d.ts +1 -0
- package/dist/api/resources/appSettings/index.js +1 -0
- package/dist/api/resources/commons/types/AppUser.d.ts +3 -4
- package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/dist/api/resources/commons/types/AppUserRequest.d.ts +22 -1
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +38 -1
- package/dist/api/resources/commons/types/EntityType.d.ts +3 -1
- package/dist/api/resources/commons/types/EntityType.js +2 -0
- package/dist/api/resources/commons/types/EventTriggerBase.js +4 -0
- package/dist/api/resources/commons/types/EventTriggerResponse.js +4 -0
- package/dist/api/resources/commons/types/Feedback.d.ts +32 -8
- package/dist/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/dist/api/resources/commons/types/FeedbackBase.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 +6 -2
- package/dist/api/resources/commons/types/index.js +6 -2
- package/dist/api/resources/conversation/client/Client.d.ts +79 -36
- package/dist/api/resources/conversation/client/Client.js +227 -91
- package/dist/api/resources/conversation/client/index.d.ts +1 -1
- package/dist/api/resources/conversation/client/index.js +1 -1
- package/dist/api/resources/conversation/client/requests/ConversationGetRequest.d.ts +15 -0
- package/dist/api/resources/conversation/client/requests/ConversationGetRequest.js +4 -0
- package/dist/api/resources/conversation/client/requests/index.d.ts +1 -0
- package/dist/api/resources/conversation/client/requests/index.js +1 -0
- package/dist/api/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/dist/api/resources/conversation/types/AskRequest.d.ts +21 -5
- package/dist/api/resources/conversation/types/AskStreamActionEvent.d.ts +6 -0
- package/dist/api/resources/conversation/types/AskStreamActionEvent.js +4 -0
- package/dist/api/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/dist/api/resources/conversation/types/AskStreamTextEvent.d.ts +1 -0
- package/dist/api/resources/conversation/types/Attachment.d.ts +9 -0
- package/dist/api/resources/conversation/types/Attachment.js +4 -0
- package/dist/api/resources/conversation/types/BotChartResponse.d.ts +11 -0
- package/dist/api/resources/conversation/types/BotChartResponse.js +4 -0
- package/dist/api/resources/conversation/types/BotMessage.d.ts +2 -0
- package/dist/api/resources/conversation/types/BotResponse.d.ts +4 -1
- package/dist/api/resources/conversation/types/BotResponseMetadata.d.ts +2 -0
- package/dist/api/resources/conversation/types/Capability.d.ts +15 -1
- package/dist/api/resources/conversation/types/Capability.js +2 -0
- package/dist/api/resources/conversation/types/CategorizationResponse.d.ts +6 -0
- package/dist/api/resources/conversation/types/CategorizationResponse.js +4 -0
- package/dist/api/resources/conversation/types/ChartSpecSchema.d.ts +7 -0
- package/dist/api/resources/conversation/types/ChartSpecSchema.js +6 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.d.ts +16 -0
- package/dist/api/resources/conversation/types/ConversationAnalysis.js +4 -0
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +12 -2
- package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -5
- package/dist/api/resources/conversation/types/ConversationMessageRequest.d.ts +3 -1
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +51 -2
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +24 -1
- package/dist/api/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/dist/api/resources/conversation/types/ResponseConfig.d.ts +4 -4
- package/dist/api/resources/conversation/types/Sentiment.d.ts +14 -0
- package/dist/api/resources/conversation/types/Sentiment.js +10 -0
- package/dist/api/resources/conversation/types/StreamResponse.d.ts +4 -1
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.d.ts +1 -3
- package/dist/api/resources/conversation/types/UserMessage.d.ts +5 -4
- package/dist/api/resources/conversation/types/UserMessageBase.d.ts +11 -0
- package/dist/api/resources/conversation/types/UserMessageBase.js +4 -0
- package/dist/api/resources/conversation/types/index.d.ts +8 -2
- package/dist/api/resources/conversation/types/index.js +8 -2
- package/dist/api/resources/index.d.ts +4 -0
- package/dist/api/resources/index.js +4 -0
- package/dist/api/resources/knowledge/client/Client.d.ts +13 -4
- package/dist/api/resources/knowledge/client/Client.js +55 -41
- package/dist/api/resources/translations/client/Client.d.ts +52 -0
- package/dist/api/resources/translations/client/Client.js +130 -0
- package/dist/api/resources/translations/client/index.d.ts +1 -0
- package/dist/api/resources/translations/client/index.js +1 -0
- package/dist/api/resources/translations/index.d.ts +2 -0
- package/dist/api/resources/translations/index.js +2 -0
- package/dist/api/resources/translations/types/TranslationRequest.d.ts +16 -0
- package/dist/api/resources/translations/types/TranslationRequest.js +4 -0
- package/dist/api/resources/translations/types/TranslationResponse.d.ts +13 -0
- package/dist/api/resources/translations/types/TranslationResponse.js +4 -0
- package/dist/api/resources/translations/types/index.d.ts +2 -0
- package/dist/api/resources/translations/types/index.js +2 -0
- package/dist/api/resources/triggers/client/Client.d.ts +10 -1
- package/dist/api/resources/triggers/client/Client.js +22 -16
- package/dist/api/resources/triggers/types/index.d.ts +0 -3
- package/dist/api/resources/triggers/types/index.js +0 -3
- package/dist/api/resources/users/client/Client.d.ts +27 -12
- package/dist/api/resources/users/client/Client.js +33 -23
- package/dist/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/core/fetcher/Fetcher.js +18 -159
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +6 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +32 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +19 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +48 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +38 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +28 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +32 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +243 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +120 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +225 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/dist/core/runtime/runtime.d.ts +1 -0
- package/dist/core/runtime/runtime.js +1 -0
- package/dist/core/schemas/Schema.d.ts +8 -4
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/dist/core/schemas/builders/bigint/bigint.js +46 -0
- package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
- package/dist/core/schemas/builders/bigint/index.js +1 -0
- package/dist/core/schemas/builders/index.d.ts +1 -0
- package/dist/core/schemas/builders/index.js +1 -0
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/actions/types/ActionBase.d.ts +1 -2
- package/dist/serialization/resources/actions/types/ActionBase.js +2 -2
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/dist/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
- package/dist/serialization/resources/actions/types/MetadataPrecondition.js +11 -0
- package/dist/serialization/resources/actions/types/Precondition.d.ts +22 -0
- package/dist/serialization/resources/actions/types/Precondition.js +19 -0
- package/dist/serialization/resources/actions/types/PreconditionBase.d.ts +13 -0
- package/dist/serialization/resources/actions/types/PreconditionBase.js +8 -0
- package/dist/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
- package/dist/serialization/resources/actions/types/PreconditionGroup.js +10 -0
- package/dist/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
- package/dist/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
- package/dist/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
- package/dist/serialization/resources/actions/types/PreconditionOperator.js +5 -0
- package/dist/serialization/resources/actions/types/TagsPrecondition.d.ts +13 -0
- package/dist/serialization/resources/actions/types/TagsPrecondition.js +10 -0
- package/dist/serialization/resources/actions/types/index.d.ts +9 -1
- package/dist/serialization/resources/actions/types/index.js +9 -1
- package/dist/serialization/resources/appSettings/client/get.d.ts +9 -0
- package/dist/serialization/resources/appSettings/client/get.js +5 -0
- package/dist/serialization/resources/appSettings/client/index.d.ts +1 -0
- package/dist/serialization/resources/appSettings/client/index.js +1 -0
- package/dist/serialization/resources/appSettings/index.d.ts +1 -0
- package/dist/serialization/resources/appSettings/index.js +1 -0
- package/dist/serialization/resources/commons/types/AppUser.d.ts +4 -4
- package/dist/serialization/resources/commons/types/AppUser.js +4 -4
- package/dist/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/dist/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
- package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +4 -1
- package/dist/serialization/resources/commons/types/AppUserRequest.js +7 -1
- package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +6 -1
- package/dist/serialization/resources/commons/types/AppUserResponse.js +9 -1
- package/dist/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/dist/serialization/resources/commons/types/EntityType.js +2 -0
- package/dist/serialization/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +1 -1
- package/dist/serialization/resources/{triggers → commons}/types/EventTriggerResponse.js +1 -1
- package/dist/serialization/resources/commons/types/Feedback.d.ts +6 -7
- package/dist/serialization/resources/commons/types/Feedback.js +9 -8
- package/dist/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.js +9 -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 +6 -2
- package/dist/serialization/resources/commons/types/index.js +6 -2
- package/dist/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/ActionFormField.js +1 -0
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +5 -5
- package/dist/serialization/resources/conversation/types/AskRequest.js +5 -5
- package/dist/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/dist/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
- package/dist/serialization/resources/{actions/types/Preconditions.d.ts → conversation/types/Attachment.d.ts} +4 -3
- package/dist/serialization/resources/conversation/types/Attachment.js +8 -0
- package/dist/serialization/resources/conversation/types/BotChartResponse.d.ts +15 -0
- package/dist/serialization/resources/conversation/types/BotChartResponse.js +10 -0
- package/dist/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/BotMessage.js +2 -0
- package/dist/serialization/resources/conversation/types/BotResponse.d.ts +5 -1
- package/dist/serialization/resources/conversation/types/BotResponse.js +2 -0
- package/dist/serialization/resources/conversation/types/BotResponseMetadata.d.ts +1 -0
- package/dist/serialization/resources/conversation/types/BotResponseMetadata.js +1 -0
- package/dist/serialization/resources/conversation/types/Capability.d.ts +1 -1
- package/dist/serialization/resources/conversation/types/Capability.js +1 -1
- package/dist/serialization/resources/conversation/types/CategorizationResponse.d.ts +12 -0
- package/dist/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/dist/serialization/resources/conversation/types/ChartSpecSchema.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/ChartSpecSchema.js +5 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.d.ts +17 -0
- package/dist/serialization/resources/conversation/types/ConversationAnalysis.js +12 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +6 -1
- package/dist/serialization/resources/conversation/types/ConversationBase.js +6 -1
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
- package/dist/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +0 -2
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -2
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +2 -2
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/dist/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
- package/dist/serialization/resources/conversation/types/ResponseConfig.d.ts +3 -3
- package/dist/serialization/resources/conversation/types/ResponseConfig.js +3 -3
- package/dist/serialization/resources/conversation/types/Sentiment.d.ts +10 -0
- package/dist/serialization/resources/conversation/types/Sentiment.js +5 -0
- package/dist/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
- package/dist/serialization/resources/conversation/types/StreamResponse.js +2 -0
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
- package/dist/serialization/resources/conversation/types/UserMessage.d.ts +5 -5
- package/dist/serialization/resources/conversation/types/UserMessage.js +5 -5
- package/dist/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
- package/dist/serialization/resources/conversation/types/UserMessageBase.js +14 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +8 -2
- package/dist/serialization/resources/conversation/types/index.js +8 -2
- package/dist/serialization/resources/index.d.ts +3 -0
- package/dist/serialization/resources/index.js +3 -0
- package/dist/serialization/resources/translations/index.d.ts +1 -0
- package/dist/serialization/resources/translations/index.js +1 -0
- package/dist/serialization/resources/translations/types/TranslationRequest.d.ts +13 -0
- package/dist/serialization/resources/translations/types/TranslationRequest.js +8 -0
- package/dist/serialization/resources/translations/types/TranslationResponse.d.ts +12 -0
- package/dist/serialization/resources/translations/types/TranslationResponse.js +7 -0
- package/dist/serialization/resources/translations/types/index.d.ts +2 -0
- package/dist/serialization/resources/translations/types/index.js +2 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
- package/dist/serialization/resources/triggers/types/index.d.ts +0 -3
- package/dist/serialization/resources/triggers/types/index.js +0 -3
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +12 -2
- package/reference.md +1953 -0
- package/serialization/resources/actions/types/ActionBase.d.ts +1 -2
- package/serialization/resources/actions/types/ActionBase.js +2 -2
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.d.ts +14 -0
- package/serialization/resources/actions/types/ConversationExecutedActionPrecondition.js +11 -0
- package/serialization/resources/actions/types/ConversationPrecondition.d.ts +22 -0
- package/serialization/resources/actions/types/ConversationPrecondition.js +17 -0
- package/serialization/resources/actions/types/MetadataPrecondition.d.ts +14 -0
- package/serialization/resources/actions/types/MetadataPrecondition.js +11 -0
- package/serialization/resources/actions/types/Precondition.d.ts +22 -0
- package/serialization/resources/actions/types/Precondition.js +19 -0
- package/serialization/resources/actions/types/PreconditionBase.d.ts +13 -0
- package/serialization/resources/actions/types/PreconditionBase.js +8 -0
- package/serialization/resources/actions/types/PreconditionGroup.d.ts +14 -0
- package/serialization/resources/actions/types/PreconditionGroup.js +10 -0
- package/serialization/resources/actions/types/PreconditionGroupOperator.d.ts +10 -0
- package/serialization/resources/actions/types/PreconditionGroupOperator.js +5 -0
- package/serialization/resources/actions/types/PreconditionOperator.d.ts +10 -0
- package/serialization/resources/actions/types/PreconditionOperator.js +5 -0
- package/serialization/resources/actions/types/TagsPrecondition.d.ts +13 -0
- package/serialization/resources/actions/types/TagsPrecondition.js +10 -0
- package/serialization/resources/actions/types/index.d.ts +9 -1
- package/serialization/resources/actions/types/index.js +9 -1
- package/serialization/resources/appSettings/client/get.d.ts +9 -0
- package/serialization/resources/appSettings/client/get.js +5 -0
- package/serialization/resources/appSettings/client/index.d.ts +1 -0
- package/serialization/resources/appSettings/client/index.js +1 -0
- package/serialization/resources/appSettings/index.d.ts +1 -0
- package/serialization/resources/appSettings/index.js +1 -0
- package/serialization/resources/commons/types/AppUser.d.ts +4 -4
- package/serialization/resources/commons/types/AppUser.js +4 -4
- package/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
- package/serialization/resources/commons/types/AppUserRequest.d.ts +4 -1
- package/serialization/resources/commons/types/AppUserRequest.js +7 -1
- package/serialization/resources/commons/types/AppUserResponse.d.ts +6 -1
- package/serialization/resources/commons/types/AppUserResponse.js +9 -1
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +2 -0
- package/serialization/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +1 -1
- package/serialization/resources/{triggers → commons}/types/EventTriggerResponse.js +1 -1
- package/serialization/resources/commons/types/Feedback.d.ts +6 -7
- package/serialization/resources/commons/types/Feedback.js +9 -8
- package/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/serialization/resources/commons/types/FeedbackBase.js +9 -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 +6 -2
- package/serialization/resources/commons/types/index.js +6 -2
- package/serialization/resources/conversation/types/ActionFormField.d.ts +1 -0
- package/serialization/resources/conversation/types/ActionFormField.js +1 -0
- package/serialization/resources/conversation/types/AskRequest.d.ts +5 -5
- package/serialization/resources/conversation/types/AskRequest.js +5 -5
- package/serialization/resources/conversation/types/AskStreamActionEvent.d.ts +12 -0
- package/serialization/resources/conversation/types/AskStreamActionEvent.js +6 -0
- package/serialization/resources/conversation/types/AskStreamStartEvent.d.ts +2 -1
- package/serialization/resources/conversation/types/AskStreamStartEvent.js +2 -1
- package/serialization/resources/{actions/types/Preconditions.d.ts → conversation/types/Attachment.d.ts} +4 -3
- package/serialization/resources/conversation/types/Attachment.js +8 -0
- package/serialization/resources/conversation/types/BotChartResponse.d.ts +15 -0
- package/serialization/resources/conversation/types/BotChartResponse.js +10 -0
- package/serialization/resources/conversation/types/BotMessage.d.ts +2 -0
- package/serialization/resources/conversation/types/BotMessage.js +2 -0
- package/serialization/resources/conversation/types/BotResponse.d.ts +5 -1
- package/serialization/resources/conversation/types/BotResponse.js +2 -0
- package/serialization/resources/conversation/types/BotResponseMetadata.d.ts +1 -0
- package/serialization/resources/conversation/types/BotResponseMetadata.js +1 -0
- package/serialization/resources/conversation/types/Capability.d.ts +1 -1
- package/serialization/resources/conversation/types/Capability.js +1 -1
- package/serialization/resources/conversation/types/CategorizationResponse.d.ts +12 -0
- package/serialization/resources/conversation/types/CategorizationResponse.js +7 -0
- package/serialization/resources/conversation/types/ChartSpecSchema.d.ts +10 -0
- package/serialization/resources/conversation/types/ChartSpecSchema.js +5 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.d.ts +17 -0
- package/serialization/resources/conversation/types/ConversationAnalysis.js +12 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +6 -1
- package/serialization/resources/conversation/types/ConversationBase.js +6 -1
- package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -3
- package/serialization/resources/conversation/types/ConversationMessageBase.js +2 -3
- package/serialization/resources/conversation/types/ConversationMessageRequest.d.ts +4 -2
- package/serialization/resources/conversation/types/ConversationMessageRequest.js +7 -2
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/serialization/resources/conversation/types/ConversationRequest.js +0 -2
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -2
- package/serialization/resources/conversation/types/ConversationResponse.js +2 -2
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.d.ts +2 -1
- package/serialization/resources/conversation/types/GenerateMavenSuggestionsRequest.js +2 -1
- package/serialization/resources/conversation/types/ResponseConfig.d.ts +3 -3
- package/serialization/resources/conversation/types/ResponseConfig.js +3 -3
- package/serialization/resources/conversation/types/Sentiment.d.ts +10 -0
- package/serialization/resources/conversation/types/Sentiment.js +5 -0
- package/serialization/resources/conversation/types/StreamResponse.d.ts +5 -1
- package/serialization/resources/conversation/types/StreamResponse.js +2 -0
- package/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +0 -2
- package/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
- package/serialization/resources/conversation/types/UserMessage.d.ts +5 -5
- package/serialization/resources/conversation/types/UserMessage.js +5 -5
- package/serialization/resources/conversation/types/UserMessageBase.d.ts +17 -0
- package/serialization/resources/conversation/types/UserMessageBase.js +14 -0
- package/serialization/resources/conversation/types/index.d.ts +8 -2
- package/serialization/resources/conversation/types/index.js +8 -2
- package/serialization/resources/index.d.ts +3 -0
- package/serialization/resources/index.js +3 -0
- package/serialization/resources/translations/index.d.ts +1 -0
- package/serialization/resources/translations/index.js +1 -0
- package/serialization/resources/translations/types/TranslationRequest.d.ts +13 -0
- package/serialization/resources/translations/types/TranslationRequest.js +8 -0
- package/serialization/resources/translations/types/TranslationResponse.d.ts +12 -0
- package/serialization/resources/translations/types/TranslationResponse.js +7 -0
- package/serialization/resources/translations/types/index.d.ts +2 -0
- package/serialization/resources/translations/types/index.js +2 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
- package/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
- package/serialization/resources/triggers/types/index.d.ts +0 -3
- package/serialization/resources/triggers/types/index.js +0 -3
- package/version.d.ts +1 -0
- package/version.js +1 -0
- package/api/resources/actions/types/Preconditions.d.ts +0 -7
- package/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
- package/api/resources/commons/types/User.d.ts +0 -10
- package/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/dist/api/resources/actions/types/Preconditions.d.ts +0 -7
- package/dist/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
- package/dist/api/resources/commons/types/User.d.ts +0 -10
- package/dist/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/dist/serialization/resources/actions/types/Preconditions.js +0 -7
- package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
- package/dist/serialization/resources/commons/types/AppUserIdentification.js +0 -8
- package/dist/serialization/resources/commons/types/User.d.ts +0 -15
- package/dist/serialization/resources/commons/types/User.js +0 -10
- package/dist/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- package/serialization/resources/actions/types/Preconditions.js +0 -7
- package/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
- package/serialization/resources/commons/types/AppUserIdentification.js +0 -8
- package/serialization/resources/commons/types/User.d.ts +0 -15
- package/serialization/resources/commons/types/User.js +0 -10
- package/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- /package/api/resources/actions/types/{Preconditions.js → ConversationExecutedActionPrecondition.js} +0 -0
- /package/api/resources/{commons/types/AppUserIdentification.js → actions/types/ConversationPrecondition.js} +0 -0
- /package/api/resources/{commons/types/User.js → actions/types/MetadataPrecondition.js} +0 -0
- /package/api/resources/{conversation/types/ConversationContext.js → actions/types/Precondition.js} +0 -0
- /package/api/resources/{conversation/types/ConversationMessageContext.js → actions/types/PreconditionBase.js} +0 -0
- /package/api/resources/{triggers/types/EventTriggerBase.js → actions/types/PreconditionGroup.js} +0 -0
- /package/api/resources/{triggers/types/EventTriggerResponse.js → actions/types/TagsPrecondition.js} +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/{dist/api/resources/triggers → api/resources/commons}/types/EventTriggerBase.js +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
- /package/{dist/api/resources/triggers → api/resources/commons}/types/EventTriggerResponse.js +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/{dist/api/resources/actions/types/Preconditions.js → api/resources/commons/types/FeedbackBase.js} +0 -0
- /package/{dist/api/resources/commons/types/AppUserIdentification.js → api/resources/commons/types/UserData.js} +0 -0
- /package/{dist/api/resources/commons/types/User.js → api/resources/conversation/client/requests/ConversationGetRequest.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationContext.js → api/resources/conversation/types/AskStreamActionEvent.js} +0 -0
- /package/{dist/api/resources/conversation/types/ConversationMessageContext.js → api/resources/conversation/types/Attachment.js} +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
|
@@ -1,12 +1,3 @@
|
|
|
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
1
|
import { SchemaType } from "../../Schema";
|
|
11
2
|
import { entries } from "../../utils/entries";
|
|
12
3
|
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
@@ -15,10 +6,10 @@ import { maybeSkipValidation } from "../../utils/maybeSkipValidation";
|
|
|
15
6
|
import { getSchemaUtils } from "../schema-utils";
|
|
16
7
|
export function record(keySchema, valueSchema) {
|
|
17
8
|
const baseSchema = {
|
|
18
|
-
parse: (raw, opts) =>
|
|
9
|
+
parse: (raw, opts) => {
|
|
19
10
|
return validateAndTransformRecord({
|
|
20
11
|
value: raw,
|
|
21
|
-
isKeyNumeric:
|
|
12
|
+
isKeyNumeric: keySchema.getType() === SchemaType.NUMBER,
|
|
22
13
|
transformKey: (key) => {
|
|
23
14
|
var _a;
|
|
24
15
|
return keySchema.parse(key, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key} (key)`] }));
|
|
@@ -29,11 +20,11 @@ export function record(keySchema, valueSchema) {
|
|
|
29
20
|
},
|
|
30
21
|
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
31
22
|
});
|
|
32
|
-
}
|
|
33
|
-
json: (parsed, opts) =>
|
|
23
|
+
},
|
|
24
|
+
json: (parsed, opts) => {
|
|
34
25
|
return validateAndTransformRecord({
|
|
35
26
|
value: parsed,
|
|
36
|
-
isKeyNumeric:
|
|
27
|
+
isKeyNumeric: keySchema.getType() === SchemaType.NUMBER,
|
|
37
28
|
transformKey: (key) => {
|
|
38
29
|
var _a;
|
|
39
30
|
return keySchema.json(key, Object.assign(Object.assign({}, opts), { breadcrumbsPrefix: [...((_a = opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix) !== null && _a !== void 0 ? _a : []), `${key} (key)`] }));
|
|
@@ -44,59 +35,57 @@ export function record(keySchema, valueSchema) {
|
|
|
44
35
|
},
|
|
45
36
|
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
46
37
|
});
|
|
47
|
-
}
|
|
38
|
+
},
|
|
48
39
|
getType: () => SchemaType.RECORD,
|
|
49
40
|
};
|
|
50
41
|
return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
|
|
51
42
|
}
|
|
52
43
|
function validateAndTransformRecord({ value, isKeyNumeric, transformKey, transformValue, breadcrumbsPrefix = [], }) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
if (!isPlainObject(value)) {
|
|
45
|
+
return {
|
|
46
|
+
ok: false,
|
|
47
|
+
errors: [
|
|
48
|
+
{
|
|
49
|
+
path: breadcrumbsPrefix,
|
|
50
|
+
message: getErrorMessageForIncorrectType(value, "object"),
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return entries(value).reduce((accPromise, [stringKey, value]) => {
|
|
56
|
+
// skip nullish keys
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return accPromise;
|
|
64
59
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
let key = stringKey;
|
|
72
|
-
if (isKeyNumeric) {
|
|
73
|
-
const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN;
|
|
74
|
-
if (!isNaN(numberKey)) {
|
|
75
|
-
key = numberKey;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const transformedKey = yield transformKey(key);
|
|
79
|
-
const transformedValue = yield transformValue(value, key);
|
|
80
|
-
if (acc.ok && transformedKey.ok && transformedValue.ok) {
|
|
81
|
-
return {
|
|
82
|
-
ok: true,
|
|
83
|
-
value: Object.assign(Object.assign({}, acc.value), { [transformedKey.value]: transformedValue.value }),
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
const errors = [];
|
|
87
|
-
if (!acc.ok) {
|
|
88
|
-
errors.push(...acc.errors);
|
|
89
|
-
}
|
|
90
|
-
if (!transformedKey.ok) {
|
|
91
|
-
errors.push(...transformedKey.errors);
|
|
92
|
-
}
|
|
93
|
-
if (!transformedValue.ok) {
|
|
94
|
-
errors.push(...transformedValue.errors);
|
|
60
|
+
const acc = accPromise;
|
|
61
|
+
let key = stringKey;
|
|
62
|
+
if (isKeyNumeric) {
|
|
63
|
+
const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN;
|
|
64
|
+
if (!isNaN(numberKey)) {
|
|
65
|
+
key = numberKey;
|
|
95
66
|
}
|
|
67
|
+
}
|
|
68
|
+
const transformedKey = transformKey(key);
|
|
69
|
+
const transformedValue = transformValue(value, key);
|
|
70
|
+
if (acc.ok && transformedKey.ok && transformedValue.ok) {
|
|
96
71
|
return {
|
|
97
|
-
ok:
|
|
98
|
-
|
|
72
|
+
ok: true,
|
|
73
|
+
value: Object.assign(Object.assign({}, acc.value), { [transformedKey.value]: transformedValue.value }),
|
|
99
74
|
};
|
|
100
|
-
}
|
|
101
|
-
|
|
75
|
+
}
|
|
76
|
+
const errors = [];
|
|
77
|
+
if (!acc.ok) {
|
|
78
|
+
errors.push(...acc.errors);
|
|
79
|
+
}
|
|
80
|
+
if (!transformedKey.ok) {
|
|
81
|
+
errors.push(...transformedKey.errors);
|
|
82
|
+
}
|
|
83
|
+
if (!transformedValue.ok) {
|
|
84
|
+
errors.push(...transformedValue.errors);
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
ok: false,
|
|
88
|
+
errors,
|
|
89
|
+
};
|
|
90
|
+
}, { ok: true, value: {} });
|
|
102
91
|
}
|
|
@@ -2,8 +2,8 @@ import { BaseSchema, Schema, SchemaOptions } from "../../Schema";
|
|
|
2
2
|
export interface SchemaUtils<Raw, Parsed> {
|
|
3
3
|
optional: () => Schema<Raw | null | undefined, Parsed | undefined>;
|
|
4
4
|
transform: <Transformed>(transformer: SchemaTransformer<Parsed, Transformed>) => Schema<Raw, Transformed>;
|
|
5
|
-
parseOrThrow: (raw: unknown, opts?: SchemaOptions) =>
|
|
6
|
-
jsonOrThrow: (raw: unknown, opts?: SchemaOptions) =>
|
|
5
|
+
parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Parsed;
|
|
6
|
+
jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Raw;
|
|
7
7
|
}
|
|
8
8
|
export interface SchemaTransformer<Parsed, Transformed> {
|
|
9
9
|
transform: (parsed: Parsed) => Transformed;
|
|
@@ -1,12 +1,3 @@
|
|
|
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
1
|
import { SchemaType } from "../../Schema";
|
|
11
2
|
import { JsonError } from "./JsonError";
|
|
12
3
|
import { ParseError } from "./ParseError";
|
|
@@ -14,20 +5,20 @@ export function getSchemaUtils(schema) {
|
|
|
14
5
|
return {
|
|
15
6
|
optional: () => optional(schema),
|
|
16
7
|
transform: (transformer) => transform(schema, transformer),
|
|
17
|
-
parseOrThrow: (raw, opts) =>
|
|
18
|
-
const parsed =
|
|
8
|
+
parseOrThrow: (raw, opts) => {
|
|
9
|
+
const parsed = schema.parse(raw, opts);
|
|
19
10
|
if (parsed.ok) {
|
|
20
11
|
return parsed.value;
|
|
21
12
|
}
|
|
22
13
|
throw new ParseError(parsed.errors);
|
|
23
|
-
}
|
|
24
|
-
jsonOrThrow: (parsed, opts) =>
|
|
25
|
-
const raw =
|
|
14
|
+
},
|
|
15
|
+
jsonOrThrow: (parsed, opts) => {
|
|
16
|
+
const raw = schema.json(parsed, opts);
|
|
26
17
|
if (raw.ok) {
|
|
27
18
|
return raw.value;
|
|
28
19
|
}
|
|
29
20
|
throw new JsonError(raw.errors);
|
|
30
|
-
}
|
|
21
|
+
},
|
|
31
22
|
};
|
|
32
23
|
}
|
|
33
24
|
/**
|
|
@@ -45,6 +36,12 @@ export function optional(schema) {
|
|
|
45
36
|
return schema.parse(raw, opts);
|
|
46
37
|
},
|
|
47
38
|
json: (parsed, opts) => {
|
|
39
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.omitUndefined) && parsed === undefined) {
|
|
40
|
+
return {
|
|
41
|
+
ok: true,
|
|
42
|
+
value: undefined,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
48
45
|
if (parsed == null) {
|
|
49
46
|
return {
|
|
50
47
|
ok: true,
|
|
@@ -59,8 +56,8 @@ export function optional(schema) {
|
|
|
59
56
|
}
|
|
60
57
|
export function transform(schema, transformer) {
|
|
61
58
|
const baseSchema = {
|
|
62
|
-
parse: (raw, opts) =>
|
|
63
|
-
const parsed =
|
|
59
|
+
parse: (raw, opts) => {
|
|
60
|
+
const parsed = schema.parse(raw, opts);
|
|
64
61
|
if (!parsed.ok) {
|
|
65
62
|
return parsed;
|
|
66
63
|
}
|
|
@@ -68,11 +65,11 @@ export function transform(schema, transformer) {
|
|
|
68
65
|
ok: true,
|
|
69
66
|
value: transformer.transform(parsed.value),
|
|
70
67
|
};
|
|
71
|
-
}
|
|
72
|
-
json: (transformed, opts) =>
|
|
73
|
-
const parsed =
|
|
68
|
+
},
|
|
69
|
+
json: (transformed, opts) => {
|
|
70
|
+
const parsed = transformer.untransform(transformed);
|
|
74
71
|
return schema.json(parsed, opts);
|
|
75
|
-
}
|
|
72
|
+
},
|
|
76
73
|
getType: () => schema.getType(),
|
|
77
74
|
};
|
|
78
75
|
return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
|
|
@@ -1,12 +1,3 @@
|
|
|
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
1
|
import { SchemaType } from "../../Schema";
|
|
11
2
|
import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType";
|
|
12
3
|
import { maybeSkipValidation } from "../../utils/maybeSkipValidation";
|
|
@@ -15,8 +6,8 @@ import { getSchemaUtils } from "../schema-utils";
|
|
|
15
6
|
export function set(schema) {
|
|
16
7
|
const listSchema = list(schema);
|
|
17
8
|
const baseSchema = {
|
|
18
|
-
parse: (raw, opts) =>
|
|
19
|
-
const parsedList =
|
|
9
|
+
parse: (raw, opts) => {
|
|
10
|
+
const parsedList = listSchema.parse(raw, opts);
|
|
20
11
|
if (parsedList.ok) {
|
|
21
12
|
return {
|
|
22
13
|
ok: true,
|
|
@@ -26,8 +17,8 @@ export function set(schema) {
|
|
|
26
17
|
else {
|
|
27
18
|
return parsedList;
|
|
28
19
|
}
|
|
29
|
-
}
|
|
30
|
-
json: (parsed, opts) =>
|
|
20
|
+
},
|
|
21
|
+
json: (parsed, opts) => {
|
|
31
22
|
var _a;
|
|
32
23
|
if (!(parsed instanceof Set)) {
|
|
33
24
|
return {
|
|
@@ -40,9 +31,9 @@ export function set(schema) {
|
|
|
40
31
|
],
|
|
41
32
|
};
|
|
42
33
|
}
|
|
43
|
-
const jsonList =
|
|
34
|
+
const jsonList = listSchema.json([...parsed], opts);
|
|
44
35
|
return jsonList;
|
|
45
|
-
}
|
|
36
|
+
},
|
|
46
37
|
getType: () => SchemaType.SET,
|
|
47
38
|
};
|
|
48
39
|
return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
|
|
@@ -1,47 +1,36 @@
|
|
|
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
1
|
import { SchemaType } from "../../Schema";
|
|
11
2
|
import { maybeSkipValidation } from "../../utils/maybeSkipValidation";
|
|
12
3
|
import { getSchemaUtils } from "../schema-utils";
|
|
13
4
|
export function undiscriminatedUnion(schemas) {
|
|
14
5
|
const baseSchema = {
|
|
15
|
-
parse: (raw, opts) =>
|
|
6
|
+
parse: (raw, opts) => {
|
|
16
7
|
return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.parse(raw, opts), schemas, opts);
|
|
17
|
-
}
|
|
18
|
-
json: (parsed, opts) =>
|
|
8
|
+
},
|
|
9
|
+
json: (parsed, opts) => {
|
|
19
10
|
return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.json(parsed, opts), schemas, opts);
|
|
20
|
-
}
|
|
11
|
+
},
|
|
21
12
|
getType: () => SchemaType.UNDISCRIMINATED_UNION,
|
|
22
13
|
};
|
|
23
14
|
return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
|
|
24
15
|
}
|
|
25
16
|
function validateAndTransformUndiscriminatedUnion(transform, schemas, opts) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
}
|
|
17
|
+
const errors = [];
|
|
18
|
+
for (const [index, schema] of schemas.entries()) {
|
|
19
|
+
const transformed = transform(schema, Object.assign(Object.assign({}, opts), { skipValidation: false }));
|
|
20
|
+
if (transformed.ok) {
|
|
21
|
+
return transformed;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
for (const error of transformed.errors) {
|
|
25
|
+
errors.push({
|
|
26
|
+
path: error.path,
|
|
27
|
+
message: `[Variant ${index}] ${error.message}`,
|
|
28
|
+
});
|
|
40
29
|
}
|
|
41
30
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
ok: false,
|
|
34
|
+
errors,
|
|
35
|
+
};
|
|
47
36
|
}
|
|
@@ -1,12 +1,3 @@
|
|
|
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
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
2
|
var t = {};
|
|
12
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -33,7 +24,7 @@ export function union(discriminant, union) {
|
|
|
33
24
|
: discriminant.parsedDiscriminant;
|
|
34
25
|
const discriminantValueSchema = enum_(keys(union));
|
|
35
26
|
const baseSchema = {
|
|
36
|
-
parse: (raw, opts) =>
|
|
27
|
+
parse: (raw, opts) => {
|
|
37
28
|
return transformAndValidateUnion({
|
|
38
29
|
value: raw,
|
|
39
30
|
discriminant: rawDiscriminant,
|
|
@@ -50,8 +41,8 @@ export function union(discriminant, union) {
|
|
|
50
41
|
transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.parse(additionalProperties, opts),
|
|
51
42
|
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
52
43
|
});
|
|
53
|
-
}
|
|
54
|
-
json: (parsed, opts) =>
|
|
44
|
+
},
|
|
45
|
+
json: (parsed, opts) => {
|
|
55
46
|
return transformAndValidateUnion({
|
|
56
47
|
value: parsed,
|
|
57
48
|
discriminant: parsedDiscriminant,
|
|
@@ -68,70 +59,68 @@ export function union(discriminant, union) {
|
|
|
68
59
|
transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.json(additionalProperties, opts),
|
|
69
60
|
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
70
61
|
});
|
|
71
|
-
}
|
|
62
|
+
},
|
|
72
63
|
getType: () => SchemaType.UNION,
|
|
73
64
|
};
|
|
74
65
|
return Object.assign(Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema)), getObjectLikeUtils(baseSchema));
|
|
75
66
|
}
|
|
76
67
|
function transformAndValidateUnion({ value, discriminant, transformedDiscriminant, transformDiscriminantValue, getAdditionalPropertiesSchema, allowUnrecognizedUnionMembers = false, transformAdditionalProperties, breadcrumbsPrefix = [], }) {
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
if (!isPlainObject(value)) {
|
|
69
|
+
return {
|
|
70
|
+
ok: false,
|
|
71
|
+
errors: [
|
|
72
|
+
{
|
|
73
|
+
path: breadcrumbsPrefix,
|
|
74
|
+
message: getErrorMessageForIncorrectType(value, "object"),
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const _a = value, _b = discriminant, discriminantValue = _a[_b], additionalProperties = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
80
|
+
if (discriminantValue == null) {
|
|
81
|
+
return {
|
|
82
|
+
ok: false,
|
|
83
|
+
errors: [
|
|
84
|
+
{
|
|
85
|
+
path: breadcrumbsPrefix,
|
|
86
|
+
message: `Missing discriminant ("${discriminant}")`,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const transformedDiscriminantValue = transformDiscriminantValue(discriminantValue);
|
|
92
|
+
if (!transformedDiscriminantValue.ok) {
|
|
93
|
+
return {
|
|
94
|
+
ok: false,
|
|
95
|
+
errors: transformedDiscriminantValue.errors,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value);
|
|
99
|
+
if (additionalPropertiesSchema == null) {
|
|
100
|
+
if (allowUnrecognizedUnionMembers) {
|
|
79
101
|
return {
|
|
80
|
-
ok:
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
path: breadcrumbsPrefix,
|
|
84
|
-
message: getErrorMessageForIncorrectType(value, "object"),
|
|
85
|
-
},
|
|
86
|
-
],
|
|
102
|
+
ok: true,
|
|
103
|
+
value: Object.assign({ [transformedDiscriminant]: transformedDiscriminantValue.value }, additionalProperties),
|
|
87
104
|
};
|
|
88
105
|
}
|
|
89
|
-
|
|
90
|
-
if (discriminantValue == null) {
|
|
106
|
+
else {
|
|
91
107
|
return {
|
|
92
108
|
ok: false,
|
|
93
109
|
errors: [
|
|
94
110
|
{
|
|
95
|
-
path: breadcrumbsPrefix,
|
|
96
|
-
message:
|
|
111
|
+
path: [...breadcrumbsPrefix, discriminant],
|
|
112
|
+
message: "Unexpected discriminant value",
|
|
97
113
|
},
|
|
98
114
|
],
|
|
99
115
|
};
|
|
100
116
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (allowUnrecognizedUnionMembers) {
|
|
111
|
-
return {
|
|
112
|
-
ok: true,
|
|
113
|
-
value: Object.assign({ [transformedDiscriminant]: transformedDiscriminantValue.value }, additionalProperties),
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
return {
|
|
118
|
-
ok: false,
|
|
119
|
-
errors: [
|
|
120
|
-
{
|
|
121
|
-
path: [...breadcrumbsPrefix, discriminant],
|
|
122
|
-
message: "Unexpected discriminant value",
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
const transformedAdditionalProperties = yield transformAdditionalProperties(additionalProperties, additionalPropertiesSchema);
|
|
129
|
-
if (!transformedAdditionalProperties.ok) {
|
|
130
|
-
return transformedAdditionalProperties;
|
|
131
|
-
}
|
|
132
|
-
return {
|
|
133
|
-
ok: true,
|
|
134
|
-
value: Object.assign({ [transformedDiscriminant]: discriminantValue }, transformedAdditionalProperties.value),
|
|
135
|
-
};
|
|
136
|
-
});
|
|
117
|
+
}
|
|
118
|
+
const transformedAdditionalProperties = transformAdditionalProperties(additionalProperties, additionalPropertiesSchema);
|
|
119
|
+
if (!transformedAdditionalProperties.ok) {
|
|
120
|
+
return transformedAdditionalProperties;
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
ok: true,
|
|
124
|
+
value: Object.assign({ [transformedDiscriminant]: discriminantValue }, transformedAdditionalProperties.value),
|
|
125
|
+
};
|
|
137
126
|
}
|
|
@@ -8,9 +8,13 @@ function getTypeAsString(value) {
|
|
|
8
8
|
if (value === null) {
|
|
9
9
|
return "null";
|
|
10
10
|
}
|
|
11
|
+
if (value instanceof BigInt) {
|
|
12
|
+
return "BigInt";
|
|
13
|
+
}
|
|
11
14
|
switch (typeof value) {
|
|
12
15
|
case "string":
|
|
13
16
|
return `"${value}"`;
|
|
17
|
+
case "bigint":
|
|
14
18
|
case "number":
|
|
15
19
|
case "boolean":
|
|
16
20
|
case "undefined":
|
|
@@ -1,18 +1,9 @@
|
|
|
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
1
|
export function maybeSkipValidation(schema) {
|
|
11
2
|
return Object.assign(Object.assign({}, schema), { json: transformAndMaybeSkipValidation(schema.json), parse: transformAndMaybeSkipValidation(schema.parse) });
|
|
12
3
|
}
|
|
13
4
|
function transformAndMaybeSkipValidation(transform) {
|
|
14
|
-
return (value, opts) =>
|
|
15
|
-
const transformed =
|
|
5
|
+
return (value, opts) => {
|
|
6
|
+
const transformed = transform(value, opts);
|
|
16
7
|
const { skipValidation = false } = opts !== null && opts !== void 0 ? opts : {};
|
|
17
8
|
if (!transformed.ok && skipValidation) {
|
|
18
9
|
// eslint-disable-next-line no-console
|
|
@@ -29,5 +20,5 @@ function transformAndMaybeSkipValidation(transform) {
|
|
|
29
20
|
else {
|
|
30
21
|
return transformed;
|
|
31
22
|
}
|
|
32
|
-
}
|
|
23
|
+
};
|
|
33
24
|
}
|
package/dist/Client.d.ts
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
6
|
import { Actions } from "./api/resources/actions/client/Client";
|
|
7
|
+
import { AppSettings } from "./api/resources/appSettings/client/Client";
|
|
7
8
|
import { Conversation } from "./api/resources/conversation/client/Client";
|
|
8
9
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
10
|
+
import { Translations } from "./api/resources/translations/client/Client";
|
|
9
11
|
import { Triggers } from "./api/resources/triggers/client/Client";
|
|
10
12
|
import { Users } from "./api/resources/users/client/Client";
|
|
11
13
|
export declare namespace MavenAGIClient {
|
|
@@ -13,14 +15,23 @@ export declare namespace MavenAGIClient {
|
|
|
13
15
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
14
16
|
appId?: core.Supplier<string | undefined>;
|
|
15
17
|
appSecret?: core.Supplier<string | undefined>;
|
|
18
|
+
/** Override the X-Organization-Id header */
|
|
16
19
|
organizationId: core.Supplier<string>;
|
|
20
|
+
/** Override the X-Agent-Id header */
|
|
17
21
|
agentId: core.Supplier<string>;
|
|
18
22
|
fetcher?: core.FetchFunction;
|
|
19
23
|
}
|
|
20
24
|
interface RequestOptions {
|
|
25
|
+
/** The maximum time to wait for a response in seconds. */
|
|
21
26
|
timeoutInSeconds?: number;
|
|
27
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
22
28
|
maxRetries?: number;
|
|
29
|
+
/** A hook to abort the request. */
|
|
23
30
|
abortSignal?: AbortSignal;
|
|
31
|
+
/** Override the X-Organization-Id header */
|
|
32
|
+
organizationId?: string;
|
|
33
|
+
/** Override the X-Agent-Id header */
|
|
34
|
+
agentId?: string;
|
|
24
35
|
}
|
|
25
36
|
}
|
|
26
37
|
export declare class MavenAGIClient {
|
|
@@ -28,10 +39,14 @@ export declare class MavenAGIClient {
|
|
|
28
39
|
constructor(_options: MavenAGIClient.Options);
|
|
29
40
|
protected _actions: Actions | undefined;
|
|
30
41
|
get actions(): Actions;
|
|
42
|
+
protected _appSettings: AppSettings | undefined;
|
|
43
|
+
get appSettings(): AppSettings;
|
|
31
44
|
protected _conversation: Conversation | undefined;
|
|
32
45
|
get conversation(): Conversation;
|
|
33
46
|
protected _knowledge: Knowledge | undefined;
|
|
34
47
|
get knowledge(): Knowledge;
|
|
48
|
+
protected _translations: Translations | undefined;
|
|
49
|
+
get translations(): Translations;
|
|
35
50
|
protected _triggers: Triggers | undefined;
|
|
36
51
|
get triggers(): Triggers;
|
|
37
52
|
protected _users: Users | undefined;
|
package/dist/Client.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import { Actions } from "./api/resources/actions/client/Client";
|
|
5
|
+
import { AppSettings } from "./api/resources/appSettings/client/Client";
|
|
5
6
|
import { Conversation } from "./api/resources/conversation/client/Client";
|
|
6
7
|
import { Knowledge } from "./api/resources/knowledge/client/Client";
|
|
8
|
+
import { Translations } from "./api/resources/translations/client/Client";
|
|
7
9
|
import { Triggers } from "./api/resources/triggers/client/Client";
|
|
8
10
|
import { Users } from "./api/resources/users/client/Client";
|
|
9
11
|
export class MavenAGIClient {
|
|
@@ -14,6 +16,10 @@ export class MavenAGIClient {
|
|
|
14
16
|
var _a;
|
|
15
17
|
return ((_a = this._actions) !== null && _a !== void 0 ? _a : (this._actions = new Actions(this._options)));
|
|
16
18
|
}
|
|
19
|
+
get appSettings() {
|
|
20
|
+
var _a;
|
|
21
|
+
return ((_a = this._appSettings) !== null && _a !== void 0 ? _a : (this._appSettings = new AppSettings(this._options)));
|
|
22
|
+
}
|
|
17
23
|
get conversation() {
|
|
18
24
|
var _a;
|
|
19
25
|
return ((_a = this._conversation) !== null && _a !== void 0 ? _a : (this._conversation = new Conversation(this._options)));
|
|
@@ -22,6 +28,10 @@ export class MavenAGIClient {
|
|
|
22
28
|
var _a;
|
|
23
29
|
return ((_a = this._knowledge) !== null && _a !== void 0 ? _a : (this._knowledge = new Knowledge(this._options)));
|
|
24
30
|
}
|
|
31
|
+
get translations() {
|
|
32
|
+
var _a;
|
|
33
|
+
return ((_a = this._translations) !== null && _a !== void 0 ? _a : (this._translations = new Translations(this._options)));
|
|
34
|
+
}
|
|
25
35
|
get triggers() {
|
|
26
36
|
var _a;
|
|
27
37
|
return ((_a = this._triggers) !== null && _a !== void 0 ? _a : (this._triggers = new Triggers(this._options)));
|