@rulebricks/sdk 1.0.0 → 1.1.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/README.md +2 -2
- package/api/errors/BadRequestError.js +24 -12
- package/api/errors/ForbiddenError.js +24 -12
- package/api/errors/InternalServerError.js +24 -12
- package/api/errors/NotFoundError.js +24 -12
- package/api/resources/assets/client/Client.d.ts +53 -18
- package/api/resources/assets/client/Client.js +147 -95
- package/api/resources/assets/index.js +0 -1
- package/api/resources/decisions/client/Client.d.ts +7 -2
- package/api/resources/decisions/client/Client.js +45 -23
- package/api/resources/decisions/index.js +0 -1
- package/api/resources/flows/client/Client.d.ts +8 -2
- package/api/resources/flows/client/Client.js +47 -24
- package/api/resources/index.d.ts +3 -3
- package/api/resources/index.js +27 -19
- package/api/resources/rules/client/Client.d.ts +23 -14
- package/api/resources/rules/client/Client.js +75 -51
- package/api/resources/tests/client/Client.d.ts +41 -12
- package/api/resources/tests/client/Client.js +110 -64
- package/api/resources/tests/client/index.js +0 -19
- package/api/resources/tests/index.js +0 -1
- package/api/resources/users/client/Client.d.ts +22 -24
- package/api/resources/users/client/Client.js +74 -59
- package/api/resources/users/types/UserInviteRequestRole.d.ts +7 -0
- package/api/resources/users/types/{InviteRequestRole.js → UserInviteRequestRole.js} +4 -2
- package/api/resources/users/types/index.js +1 -4
- package/api/resources/values/client/Client.d.ts +27 -6
- package/api/resources/values/client/Client.js +80 -42
- package/api/resources/values/types/index.js +1 -9
- package/{dist/api/resources/values/types/ListDynamicValuesResponseItemType.d.ts → api/types/SchemaFieldType.d.ts} +3 -2
- package/api/{resources/values/types/UpdateResponseItemType.js → types/SchemaFieldType.js} +4 -3
- package/api/types/index.js +47 -4
- package/core/fetcher/Fetcher.d.ts +1 -1
- package/core/fetcher/Fetcher.js +30 -81
- package/core/fetcher/createRequestUrl.d.ts +2 -0
- package/core/fetcher/createRequestUrl.js +12 -0
- package/core/fetcher/getFetchFn.d.ts +5 -0
- package/core/fetcher/getFetchFn.js +86 -0
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.d.ts +2 -0
- package/core/fetcher/getRequestBody.js +33 -0
- package/core/fetcher/getResponseBody.d.ts +2 -0
- package/core/fetcher/getResponseBody.js +64 -0
- package/core/fetcher/makeRequest.d.ts +2 -0
- package/core/fetcher/makeRequest.js +52 -0
- package/core/fetcher/requestWithRetries.d.ts +2 -0
- package/core/fetcher/requestWithRetries.js +50 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +36 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +40 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +257 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +23 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +143 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +40 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +239 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +2 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +77 -0
- package/core/index.js +24 -11
- package/core/json.d.ts +16 -0
- package/core/json.js +24 -0
- package/core/runtime/index.d.ts +3 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +14 -0
- package/core/runtime/runtime.js +103 -0
- package/core/schemas/Schema.d.ts +3 -0
- package/core/schemas/Schema.js +3 -0
- package/core/schemas/builders/bigint/bigint.d.ts +4 -0
- package/core/schemas/builders/bigint/bigint.js +53 -0
- package/core/schemas/builders/bigint/index.d.ts +3 -0
- package/core/schemas/builders/bigint/index.js +5 -0
- package/core/schemas/builders/date/date.js +1 -2
- package/core/schemas/builders/enum/enum.js +1 -2
- package/core/schemas/builders/index.js +1 -0
- package/core/schemas/builders/lazy/lazy.js +11 -33
- package/core/schemas/builders/lazy/lazyObject.js +2 -22
- package/core/schemas/builders/list/list.js +32 -56
- package/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/core/schemas/builders/object/object.d.ts +48 -7
- package/core/schemas/builders/object/object.js +132 -139
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/core/schemas/builders/object/property.js +2 -3
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +5 -25
- package/core/schemas/builders/record/record.d.ts +2 -5
- package/core/schemas/builders/record/record.js +49 -72
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +86 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +85 -35
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/core/schemas/builders/set/set.d.ts +2 -5
- package/core/schemas/builders/set/set.js +7 -27
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +22 -44
- package/core/schemas/builders/union/discriminant.js +1 -2
- package/core/schemas/builders/union/union.js +52 -74
- package/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/core/schemas/utils/entries.js +1 -2
- package/core/schemas/utils/filterObject.js +1 -2
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +5 -2
- package/core/schemas/utils/isPlainObject.js +1 -2
- package/core/schemas/utils/keys.js +1 -2
- package/core/schemas/utils/maybeSkipValidation.js +4 -24
- package/core/schemas/utils/partition.js +1 -2
- package/dist/api/errors/BadRequestError.js +24 -12
- package/dist/api/errors/ForbiddenError.js +24 -12
- package/dist/api/errors/InternalServerError.js +24 -12
- package/dist/api/errors/NotFoundError.js +24 -12
- package/dist/api/resources/assets/client/Client.d.ts +53 -18
- package/dist/api/resources/assets/client/Client.js +147 -95
- package/dist/api/resources/assets/index.js +0 -1
- package/dist/api/resources/decisions/client/Client.d.ts +7 -2
- package/dist/api/resources/decisions/client/Client.js +45 -23
- package/dist/api/resources/decisions/index.js +0 -1
- package/dist/api/resources/flows/client/Client.d.ts +8 -2
- package/dist/api/resources/flows/client/Client.js +47 -24
- package/dist/api/resources/index.d.ts +3 -3
- package/dist/api/resources/index.js +27 -19
- package/dist/api/resources/rules/client/Client.d.ts +23 -14
- package/dist/api/resources/rules/client/Client.js +75 -51
- package/dist/api/resources/tests/client/Client.d.ts +41 -12
- package/dist/api/resources/tests/client/Client.js +110 -64
- package/dist/api/resources/tests/client/index.js +0 -19
- package/dist/api/resources/tests/index.js +0 -1
- package/dist/api/resources/users/client/Client.d.ts +22 -24
- package/dist/api/resources/users/client/Client.js +74 -59
- package/dist/api/resources/users/types/UserInviteRequestRole.d.ts +7 -0
- package/dist/api/resources/users/types/{InviteRequestRole.js → UserInviteRequestRole.js} +4 -2
- package/dist/api/resources/users/types/index.js +1 -4
- package/dist/api/resources/values/client/Client.d.ts +27 -6
- package/dist/api/resources/values/client/Client.js +80 -42
- package/dist/api/resources/values/types/index.js +1 -9
- package/dist/api/types/DynamicValueBase.js +5 -0
- package/dist/api/types/DynamicValueListResponse.js +5 -0
- package/dist/api/types/Error_.js +5 -0
- package/dist/api/types/FlowBase.js +5 -0
- package/dist/api/types/FlowDetail.js +5 -0
- package/dist/api/types/FlowExecutionError.js +5 -0
- package/dist/api/types/FlowListResponse.js +5 -0
- package/dist/api/types/Folder.js +5 -0
- package/dist/api/types/FolderListResponse.js +5 -0
- package/dist/api/types/ListValue.js +5 -0
- package/dist/api/types/NumberValue.js +5 -0
- package/dist/api/types/ParallelSolveRequest.js +5 -0
- package/dist/api/types/ParallelSolveRequestValue.js +5 -0
- package/dist/api/types/ParallelSolveResponse.js +5 -0
- package/dist/api/types/RuleBase.js +5 -0
- package/dist/api/types/RuleDetail.js +5 -0
- package/dist/api/types/RuleExport.js +5 -0
- package/dist/api/types/RuleListResponse.js +5 -0
- package/dist/api/types/RuleUsage.js +5 -0
- package/dist/api/types/SchemaField.js +5 -0
- package/dist/api/types/SchemaFieldDefaultValue.d.ts +1 -0
- package/dist/api/types/SchemaFieldDefaultValue.js +5 -0
- package/{api/resources/values/types/ListDynamicValuesResponseItemType.d.ts → dist/api/types/SchemaFieldType.d.ts} +3 -2
- package/dist/api/{resources/values/types/UpdateResponseItemType.js → types/SchemaFieldType.js} +4 -3
- package/dist/api/types/StringValue.d.ts +1 -0
- package/dist/api/types/StringValue.js +5 -0
- package/dist/api/types/SuccessMessage.d.ts +1 -0
- package/dist/api/types/SuccessMessage.js +5 -0
- package/dist/api/types/Test.d.ts +1 -0
- package/dist/api/types/Test.js +5 -0
- package/dist/api/types/TestListResponse.d.ts +1 -0
- package/dist/api/types/TestListResponse.js +5 -0
- package/dist/api/types/TestTestState.d.ts +1 -0
- package/dist/api/types/TestTestState.js +5 -0
- package/dist/api/types/TestTestStateConditionsItemValue.d.ts +1 -0
- package/dist/api/types/TestTestStateConditionsItemValue.js +5 -0
- package/dist/api/types/TestTestStateEvaluationError.d.ts +1 -0
- package/dist/api/types/TestTestStateEvaluationError.js +5 -0
- package/dist/api/types/UsageStatistics.d.ts +1 -0
- package/dist/api/types/UsageStatistics.js +5 -0
- package/dist/api/types/UserGroup.d.ts +1 -0
- package/dist/api/types/UserGroup.js +5 -0
- package/dist/api/types/UserGroupListResponse.d.ts +1 -0
- package/dist/api/types/UserGroupListResponse.js +5 -0
- package/dist/api/types/UserInviteResponse.d.ts +1 -0
- package/dist/api/types/UserInviteResponse.js +5 -0
- package/dist/api/types/UserInviteResponseUser.d.ts +1 -0
- package/dist/api/types/UserInviteResponseUser.js +5 -0
- package/dist/api/types/ValueLimits.d.ts +1 -0
- package/dist/api/types/ValueLimits.js +5 -0
- package/dist/api/types/index.js +47 -4
- package/dist/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.js +30 -81
- package/dist/core/fetcher/createRequestUrl.d.ts +2 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/getFetchFn.d.ts +5 -0
- package/dist/core/fetcher/getFetchFn.js +86 -0
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.d.ts +2 -0
- package/dist/core/fetcher/getRequestBody.js +33 -0
- package/dist/core/fetcher/getResponseBody.d.ts +2 -0
- package/dist/core/fetcher/getResponseBody.js +64 -0
- package/dist/core/fetcher/makeRequest.d.ts +2 -0
- package/dist/core/fetcher/makeRequest.js +52 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +2 -0
- package/dist/core/fetcher/requestWithRetries.js +50 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +40 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +257 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +23 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +143 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +40 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +239 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +2 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +77 -0
- package/dist/core/index.js +24 -11
- package/dist/core/json.d.ts +16 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/index.d.ts +3 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +14 -0
- package/dist/core/runtime/runtime.js +103 -0
- package/dist/core/schemas/Schema.d.ts +3 -0
- package/dist/core/schemas/Schema.js +3 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +4 -0
- package/dist/core/schemas/builders/bigint/bigint.js +53 -0
- package/dist/core/schemas/builders/bigint/index.d.ts +3 -0
- package/dist/core/schemas/builders/bigint/index.js +5 -0
- package/dist/core/schemas/builders/date/date.js +1 -2
- package/dist/core/schemas/builders/enum/enum.js +1 -2
- package/dist/core/schemas/builders/index.js +1 -0
- package/dist/core/schemas/builders/lazy/lazy.js +11 -33
- package/dist/core/schemas/builders/lazy/lazyObject.js +2 -22
- package/dist/core/schemas/builders/list/list.js +32 -56
- package/dist/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/dist/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/dist/core/schemas/builders/object/object.d.ts +48 -7
- package/dist/core/schemas/builders/object/object.js +132 -139
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/dist/core/schemas/builders/object/property.js +2 -3
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +5 -25
- package/dist/core/schemas/builders/record/record.d.ts +2 -5
- package/dist/core/schemas/builders/record/record.js +49 -72
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +86 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +85 -35
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/dist/core/schemas/builders/set/set.d.ts +2 -5
- package/dist/core/schemas/builders/set/set.js +7 -27
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +22 -44
- package/dist/core/schemas/builders/union/discriminant.js +1 -2
- package/dist/core/schemas/builders/union/union.js +52 -74
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/dist/core/schemas/utils/entries.js +1 -2
- package/dist/core/schemas/utils/filterObject.js +1 -2
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +5 -2
- package/dist/core/schemas/utils/isPlainObject.js +1 -2
- package/dist/core/schemas/utils/keys.js +1 -2
- package/dist/core/schemas/utils/maybeSkipValidation.js +4 -24
- package/dist/core/schemas/utils/partition.js +1 -2
- package/dist/errors/RulebricksApiError.js +2 -1
- package/dist/errors/RulebricksApiTimeoutError.d.ts +1 -1
- package/dist/errors/RulebricksApiTimeoutError.js +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +32 -16
- package/dist/serialization/resources/assets/client/index.d.ts +0 -5
- package/dist/serialization/resources/assets/client/index.js +0 -22
- package/dist/serialization/resources/assets/client/requests/DeleteFolderRequest.js +23 -11
- package/dist/serialization/resources/assets/client/requests/DeleteRuleRequest.js +24 -12
- package/dist/serialization/resources/assets/client/requests/ImportRuleRequest.js +23 -11
- package/dist/serialization/resources/assets/client/requests/UpsertFolderRequest.js +23 -11
- package/dist/serialization/resources/assets/index.js +0 -1
- package/dist/serialization/resources/index.d.ts +1 -4
- package/dist/serialization/resources/index.js +26 -20
- package/dist/serialization/resources/rules/client/bulkSolve.js +27 -13
- package/dist/serialization/resources/rules/client/index.d.ts +0 -2
- package/dist/serialization/resources/rules/client/index.js +24 -14
- package/dist/serialization/resources/users/client/index.d.ts +0 -1
- package/dist/serialization/resources/users/client/index.js +0 -18
- package/dist/serialization/resources/users/client/requests/CreateUserGroupRequest.d.ts +2 -0
- package/{serialization/resources/users/client/requests/CreateGroupRequest.js → dist/serialization/resources/users/client/requests/CreateUserGroupRequest.js} +25 -13
- package/dist/serialization/resources/users/client/requests/UserInviteRequest.d.ts +2 -0
- package/dist/serialization/resources/users/client/requests/UserInviteRequest.js +54 -0
- package/dist/serialization/resources/users/client/requests/index.d.ts +4 -4
- package/dist/serialization/resources/users/client/requests/index.js +5 -5
- package/dist/serialization/resources/users/types/UserInviteRequestRole.d.ts +2 -0
- package/dist/serialization/resources/{assets/types/DeleteRuleResponse.js → users/types/UserInviteRequestRole.js} +25 -15
- package/dist/serialization/resources/users/types/index.js +1 -4
- package/dist/serialization/resources/values/client/index.d.ts +0 -2
- package/dist/serialization/resources/values/client/index.js +5 -18
- package/dist/serialization/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -0
- package/dist/serialization/resources/values/client/requests/UpdateValuesRequest.js +53 -0
- package/dist/serialization/resources/values/client/requests/index.d.ts +3 -0
- package/dist/serialization/resources/values/client/requests/index.js +5 -0
- package/dist/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +2 -0
- package/{serialization/resources/values/types/ListDynamicValuesResponseItemValue.js → dist/serialization/resources/values/types/UpdateValuesRequestValuesValue.js} +26 -14
- package/dist/serialization/resources/values/types/index.js +1 -9
- package/dist/serialization/types/BooleanValue.d.ts +2 -0
- package/dist/serialization/types/BooleanValue.js +54 -0
- package/dist/serialization/types/BulkRuleResponseItem.d.ts +2 -0
- package/dist/serialization/types/BulkRuleResponseItem.js +51 -0
- package/dist/serialization/types/BulkRuleResponseItemError.d.ts +2 -0
- package/dist/serialization/types/{ForbiddenErrorBody.js → BulkRuleResponseItemError.js} +25 -13
- package/dist/serialization/types/CreateTestRequest.d.ts +2 -0
- package/dist/serialization/{resources/tests/client/requests/CreateFlowTestRequest.js → types/CreateTestRequest.js} +26 -14
- package/dist/serialization/types/DecisionLog.d.ts +2 -0
- package/dist/serialization/types/DecisionLog.js +56 -0
- package/dist/serialization/types/DecisionLogDecision.d.ts +2 -0
- package/dist/serialization/types/DecisionLogDecision.js +55 -0
- package/dist/serialization/types/DecisionLogDecisionConditionsItemValue.d.ts +2 -0
- package/dist/serialization/types/DecisionLogDecisionConditionsItemValue.js +52 -0
- package/dist/serialization/types/DecisionLogRequest.d.ts +2 -0
- package/dist/serialization/types/DecisionLogRequest.js +58 -0
- package/dist/serialization/types/DecisionLogResponse.d.ts +2 -0
- package/dist/serialization/types/DecisionLogResponse.js +53 -0
- package/dist/serialization/types/DynamicRequestPayload.d.ts +2 -0
- package/dist/serialization/types/DynamicRequestPayload.js +49 -0
- package/dist/serialization/types/DynamicResponsePayload.d.ts +2 -0
- package/dist/serialization/types/DynamicResponsePayload.js +49 -0
- package/dist/serialization/types/DynamicValue.d.ts +2 -0
- package/dist/serialization/types/DynamicValue.js +63 -0
- package/dist/serialization/types/DynamicValueBase.d.ts +2 -0
- package/dist/serialization/types/DynamicValueBase.js +55 -0
- package/dist/serialization/types/DynamicValueListResponse.d.ts +2 -0
- package/dist/serialization/types/DynamicValueListResponse.js +50 -0
- package/dist/serialization/types/Error_.d.ts +2 -0
- package/dist/serialization/types/{NotFoundErrorBody.js → Error_.js} +25 -13
- package/dist/serialization/types/FlowBase.d.ts +2 -0
- package/{serialization/resources/assets/types/ListFlowsResponseItem.js → dist/serialization/types/FlowBase.js} +26 -16
- package/dist/serialization/types/FlowDetail.d.ts +2 -0
- package/dist/serialization/types/FlowDetail.js +55 -0
- package/dist/serialization/types/FlowExecutionError.d.ts +2 -0
- package/dist/serialization/types/FlowExecutionError.js +53 -0
- package/dist/serialization/types/FlowListResponse.d.ts +2 -0
- package/dist/serialization/types/FlowListResponse.js +50 -0
- package/dist/serialization/types/Folder.d.ts +2 -0
- package/dist/serialization/{resources/assets/types/DeleteFolderResponse.js → types/Folder.js} +26 -14
- package/dist/serialization/types/FolderListResponse.d.ts +2 -0
- package/dist/serialization/types/FolderListResponse.js +50 -0
- package/dist/serialization/types/ListValue.d.ts +2 -0
- package/dist/serialization/types/ListValue.js +54 -0
- package/dist/serialization/types/NumberValue.d.ts +2 -0
- package/dist/serialization/types/NumberValue.js +54 -0
- package/dist/serialization/types/ParallelSolveRequest.d.ts +2 -0
- package/dist/serialization/types/ParallelSolveRequest.js +50 -0
- package/dist/serialization/types/ParallelSolveRequestValue.d.ts +2 -0
- package/dist/serialization/types/ParallelSolveRequestValue.js +54 -0
- package/dist/serialization/types/ParallelSolveResponse.d.ts +2 -0
- package/dist/serialization/types/ParallelSolveResponse.js +50 -0
- package/dist/serialization/types/RuleBase.d.ts +2 -0
- package/{serialization/resources/values/types/ListDynamicValuesResponseItemUsagesItem.js → dist/serialization/types/RuleBase.js} +26 -16
- package/dist/serialization/types/RuleDetail.d.ts +2 -0
- package/dist/serialization/types/RuleDetail.js +59 -0
- package/dist/serialization/types/RuleExport.d.ts +2 -0
- package/dist/serialization/types/RuleExport.js +49 -0
- package/dist/serialization/types/RuleListResponse.d.ts +2 -0
- package/dist/serialization/types/RuleListResponse.js +50 -0
- package/dist/serialization/types/RuleUsage.d.ts +2 -0
- package/dist/serialization/{resources/values/types/ListDynamicValuesResponseItemUsagesItem.js → types/RuleUsage.js} +28 -16
- package/dist/serialization/types/SchemaField.d.ts +2 -0
- package/dist/serialization/types/SchemaField.js +60 -0
- package/dist/serialization/types/SchemaFieldDefaultValue.d.ts +2 -0
- package/{serialization/resources/values/types/UpdateResponseItemValue.js → dist/serialization/types/SchemaFieldDefaultValue.js} +27 -14
- package/dist/serialization/types/SchemaFieldType.d.ts +2 -0
- package/dist/serialization/types/SchemaFieldType.js +49 -0
- package/dist/serialization/types/StringValue.d.ts +2 -0
- package/dist/serialization/types/StringValue.js +54 -0
- package/dist/serialization/types/SuccessMessage.d.ts +2 -0
- package/{serialization/resources/values/types/DeleteDynamicValueResponse.js → dist/serialization/types/SuccessMessage.js} +26 -14
- package/dist/serialization/types/Test.d.ts +2 -0
- package/dist/serialization/{resources/tests/types/DeleteFlowTestResponse.js → types/Test.js} +28 -15
- package/dist/serialization/types/TestListResponse.d.ts +2 -0
- package/dist/serialization/types/TestListResponse.js +50 -0
- package/dist/serialization/types/TestTestState.d.ts +2 -0
- package/dist/serialization/types/TestTestState.js +60 -0
- package/dist/serialization/types/TestTestStateConditionsItemValue.d.ts +2 -0
- package/dist/serialization/types/TestTestStateConditionsItemValue.js +52 -0
- package/dist/serialization/types/TestTestStateEvaluationError.d.ts +2 -0
- package/dist/serialization/types/TestTestStateEvaluationError.js +49 -0
- package/dist/serialization/types/UsageStatistics.d.ts +2 -0
- package/dist/serialization/{resources/assets/types/UsageResponse.js → types/UsageStatistics.js} +26 -14
- package/dist/serialization/types/UserGroup.d.ts +2 -0
- package/dist/serialization/{resources/users/types/CreateGroupResponse.js → types/UserGroup.js} +26 -14
- package/dist/serialization/types/UserGroupListResponse.d.ts +2 -0
- package/dist/serialization/types/UserGroupListResponse.js +50 -0
- package/dist/serialization/types/UserInviteResponse.d.ts +2 -0
- package/dist/serialization/types/UserInviteResponse.js +53 -0
- package/dist/serialization/types/UserInviteResponseUser.d.ts +2 -0
- package/dist/serialization/types/UserInviteResponseUser.js +53 -0
- package/dist/serialization/types/ValueLimits.d.ts +2 -0
- package/dist/serialization/types/ValueLimits.js +54 -0
- package/dist/serialization/types/index.js +47 -4
- package/errors/RulebricksApiError.js +2 -1
- package/errors/RulebricksApiTimeoutError.d.ts +1 -1
- package/errors/RulebricksApiTimeoutError.js +2 -2
- package/index.d.ts +8 -8
- package/index.js +32 -16
- package/package.json +1 -1
- package/serialization/resources/assets/client/index.d.ts +0 -5
- package/serialization/resources/assets/client/index.js +0 -22
- package/serialization/resources/assets/client/requests/DeleteFolderRequest.js +23 -11
- package/serialization/resources/assets/client/requests/DeleteRuleRequest.js +24 -12
- package/serialization/resources/assets/client/requests/ImportRuleRequest.js +23 -11
- package/serialization/resources/assets/client/requests/UpsertFolderRequest.js +23 -11
- package/serialization/resources/assets/index.js +0 -1
- package/serialization/resources/index.d.ts +1 -4
- package/serialization/resources/index.js +26 -20
- package/serialization/resources/rules/client/bulkSolve.js +27 -13
- package/serialization/resources/rules/client/index.d.ts +0 -2
- package/serialization/resources/rules/client/index.js +24 -14
- package/serialization/resources/users/client/index.d.ts +0 -1
- package/serialization/resources/users/client/index.js +0 -18
- package/serialization/resources/users/client/requests/CreateUserGroupRequest.d.ts +2 -0
- package/{dist/serialization/resources/users/client/requests/CreateGroupRequest.js → serialization/resources/users/client/requests/CreateUserGroupRequest.js} +25 -13
- package/serialization/resources/users/client/requests/UserInviteRequest.d.ts +2 -0
- package/serialization/resources/users/client/requests/UserInviteRequest.js +54 -0
- package/serialization/resources/users/client/requests/index.d.ts +4 -4
- package/serialization/resources/users/client/requests/index.js +5 -5
- package/serialization/resources/users/types/UserInviteRequestRole.d.ts +2 -0
- package/{dist/serialization/resources/assets/client/importRule.js → serialization/resources/users/types/UserInviteRequestRole.js} +25 -13
- package/serialization/resources/users/types/index.js +1 -4
- package/serialization/resources/values/client/index.d.ts +0 -2
- package/serialization/resources/values/client/index.js +5 -18
- package/serialization/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -0
- package/serialization/resources/values/client/requests/UpdateValuesRequest.js +53 -0
- package/serialization/resources/values/client/requests/index.d.ts +3 -0
- package/serialization/resources/values/client/requests/index.js +5 -0
- package/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +2 -0
- package/{dist/serialization/resources/values/types/ListDynamicValuesResponseItemValue.js → serialization/resources/values/types/UpdateValuesRequestValuesValue.js} +26 -14
- package/serialization/resources/values/types/index.js +1 -9
- package/serialization/types/BooleanValue.d.ts +2 -0
- package/serialization/types/BooleanValue.js +54 -0
- package/serialization/types/BulkRuleResponseItem.d.ts +2 -0
- package/serialization/types/BulkRuleResponseItem.js +51 -0
- package/serialization/types/BulkRuleResponseItemError.d.ts +2 -0
- package/{dist/serialization/types/InternalServerErrorBody.js → serialization/types/BulkRuleResponseItemError.js} +25 -13
- package/serialization/types/CreateTestRequest.d.ts +2 -0
- package/{dist/serialization/resources/tests/client/requests/CreateRuleTestRequest.js → serialization/types/CreateTestRequest.js} +26 -14
- package/serialization/types/DecisionLog.d.ts +2 -0
- package/serialization/types/DecisionLog.js +56 -0
- package/serialization/types/DecisionLogDecision.d.ts +2 -0
- package/serialization/types/DecisionLogDecision.js +55 -0
- package/serialization/types/DecisionLogDecisionConditionsItemValue.d.ts +2 -0
- package/serialization/types/DecisionLogDecisionConditionsItemValue.js +52 -0
- package/serialization/types/DecisionLogRequest.d.ts +2 -0
- package/serialization/types/DecisionLogRequest.js +58 -0
- package/serialization/types/DecisionLogResponse.d.ts +2 -0
- package/serialization/types/DecisionLogResponse.js +53 -0
- package/serialization/types/DynamicRequestPayload.d.ts +2 -0
- package/serialization/types/DynamicRequestPayload.js +49 -0
- package/serialization/types/DynamicResponsePayload.d.ts +2 -0
- package/serialization/types/DynamicResponsePayload.js +49 -0
- package/serialization/types/DynamicValue.d.ts +2 -0
- package/serialization/types/DynamicValue.js +63 -0
- package/serialization/types/DynamicValueBase.d.ts +2 -0
- package/serialization/types/DynamicValueBase.js +55 -0
- package/serialization/types/DynamicValueListResponse.d.ts +2 -0
- package/serialization/types/DynamicValueListResponse.js +50 -0
- package/serialization/types/Error_.d.ts +2 -0
- package/{dist/serialization/types/BadRequestErrorBody.js → serialization/types/Error_.js} +25 -13
- package/serialization/types/FlowBase.d.ts +2 -0
- package/serialization/types/FlowBase.js +54 -0
- package/serialization/types/FlowDetail.d.ts +2 -0
- package/serialization/types/FlowDetail.js +55 -0
- package/serialization/types/FlowExecutionError.d.ts +2 -0
- package/serialization/types/FlowExecutionError.js +53 -0
- package/serialization/types/FlowListResponse.d.ts +2 -0
- package/serialization/types/FlowListResponse.js +50 -0
- package/serialization/types/Folder.d.ts +2 -0
- package/{dist/serialization/resources/assets/types/UpsertFolderResponse.js → serialization/types/Folder.js} +26 -14
- package/serialization/types/FolderListResponse.d.ts +2 -0
- package/serialization/types/FolderListResponse.js +50 -0
- package/serialization/types/ListValue.d.ts +2 -0
- package/serialization/types/ListValue.js +54 -0
- package/serialization/types/NumberValue.d.ts +2 -0
- package/serialization/types/NumberValue.js +54 -0
- package/serialization/types/ParallelSolveRequest.d.ts +2 -0
- package/serialization/types/ParallelSolveRequest.js +50 -0
- package/serialization/types/ParallelSolveRequestValue.d.ts +2 -0
- package/serialization/types/ParallelSolveRequestValue.js +54 -0
- package/serialization/types/ParallelSolveResponse.d.ts +2 -0
- package/serialization/types/ParallelSolveResponse.js +50 -0
- package/serialization/types/RuleBase.d.ts +2 -0
- package/serialization/types/RuleBase.js +54 -0
- package/serialization/types/RuleDetail.d.ts +2 -0
- package/serialization/types/RuleDetail.js +59 -0
- package/serialization/types/RuleExport.d.ts +2 -0
- package/serialization/types/RuleExport.js +49 -0
- package/serialization/types/RuleListResponse.d.ts +2 -0
- package/serialization/types/RuleListResponse.js +50 -0
- package/serialization/types/RuleUsage.d.ts +2 -0
- package/{dist/serialization/resources/assets/types/ListFlowsResponseItem.js → serialization/types/RuleUsage.js} +28 -16
- package/serialization/types/SchemaField.d.ts +2 -0
- package/serialization/types/SchemaField.js +60 -0
- package/serialization/types/SchemaFieldDefaultValue.d.ts +2 -0
- package/{dist/serialization/resources/values/types/UpdateResponseItemValue.js → serialization/types/SchemaFieldDefaultValue.js} +27 -14
- package/serialization/types/SchemaFieldType.d.ts +2 -0
- package/serialization/types/SchemaFieldType.js +49 -0
- package/serialization/types/StringValue.d.ts +2 -0
- package/serialization/types/StringValue.js +54 -0
- package/serialization/types/SuccessMessage.d.ts +2 -0
- package/{dist/serialization/resources/values/types/DeleteDynamicValueResponse.js → serialization/types/SuccessMessage.js} +26 -14
- package/serialization/types/Test.d.ts +2 -0
- package/{dist/serialization/resources/tests/types/DeleteRuleTestResponse.js → serialization/types/Test.js} +28 -15
- package/serialization/types/TestListResponse.d.ts +2 -0
- package/serialization/types/TestListResponse.js +50 -0
- package/serialization/types/TestTestState.d.ts +2 -0
- package/serialization/types/TestTestState.js +60 -0
- package/serialization/types/TestTestStateConditionsItemValue.d.ts +2 -0
- package/serialization/types/TestTestStateConditionsItemValue.js +52 -0
- package/serialization/types/TestTestStateEvaluationError.d.ts +2 -0
- package/serialization/types/TestTestStateEvaluationError.js +49 -0
- package/serialization/types/UsageStatistics.d.ts +2 -0
- package/serialization/{resources/assets/types/UsageResponse.js → types/UsageStatistics.js} +26 -14
- package/serialization/types/UserGroup.d.ts +2 -0
- package/{dist/serialization/resources/users/types/ListGroupsResponseItem.js → serialization/types/UserGroup.js} +26 -14
- package/serialization/types/UserGroupListResponse.d.ts +2 -0
- package/serialization/types/UserGroupListResponse.js +50 -0
- package/serialization/types/UserInviteResponse.d.ts +2 -0
- package/serialization/types/UserInviteResponse.js +53 -0
- package/serialization/types/UserInviteResponseUser.d.ts +2 -0
- package/serialization/types/UserInviteResponseUser.js +53 -0
- package/serialization/types/ValueLimits.d.ts +2 -0
- package/serialization/types/ValueLimits.js +54 -0
- package/serialization/types/index.js +47 -4
- package/api/resources/assets/types/index.js +0 -28
- package/api/resources/decisions/types/index.js +0 -21
- package/api/resources/tests/client/requests/index.js +0 -2
- package/api/resources/tests/types/index.js +0 -26
- package/api/resources/users/types/InviteRequestRole.d.ts +0 -5
- package/api/resources/values/types/ListDynamicValuesResponseItemType.js +0 -12
- package/api/resources/values/types/UpdateResponseItemType.d.ts +0 -7
- package/dist/api/resources/assets/types/index.js +0 -28
- package/dist/api/resources/decisions/types/index.js +0 -21
- package/dist/api/resources/tests/client/requests/index.js +0 -2
- package/dist/api/resources/tests/types/index.js +0 -26
- package/dist/api/resources/users/types/InviteRequestRole.d.ts +0 -5
- package/dist/api/resources/values/types/ListDynamicValuesResponseItemType.js +0 -12
- package/dist/api/resources/values/types/UpdateResponseItemType.d.ts +0 -7
- package/dist/forge/index.d.ts +0 -4
- package/dist/forge/index.js +0 -31
- package/dist/forge/operators.d.ts +0 -136
- package/dist/forge/operators.js +0 -938
- package/dist/forge/rule.d.ts +0 -129
- package/dist/forge/rule.js +0 -702
- package/dist/forge/types.d.ts +0 -53
- package/dist/forge/types.js +0 -34
- package/dist/forge/values.d.ts +0 -21
- package/dist/forge/values.js +0 -88
- package/dist/serialization/resources/assets/client/exportRule.d.ts +0 -2
- package/dist/serialization/resources/assets/client/exportRule.js +0 -37
- package/dist/serialization/resources/assets/client/importRule.d.ts +0 -2
- package/dist/serialization/resources/assets/client/listFlows.d.ts +0 -2
- package/dist/serialization/resources/assets/client/listFlows.js +0 -56
- package/dist/serialization/resources/assets/client/listFolders.d.ts +0 -2
- package/dist/serialization/resources/assets/client/listFolders.js +0 -56
- package/dist/serialization/resources/assets/client/listRules.d.ts +0 -2
- package/dist/serialization/resources/assets/client/listRules.js +0 -56
- package/dist/serialization/resources/assets/types/DeleteFolderResponse.d.ts +0 -2
- package/dist/serialization/resources/assets/types/DeleteRuleResponse.d.ts +0 -2
- package/dist/serialization/resources/assets/types/ListFlowsResponseItem.d.ts +0 -2
- package/dist/serialization/resources/assets/types/ListFoldersResponseItem.d.ts +0 -2
- package/dist/serialization/resources/assets/types/ListFoldersResponseItem.js +0 -42
- package/dist/serialization/resources/assets/types/ListRulesResponseItem.d.ts +0 -2
- package/dist/serialization/resources/assets/types/ListRulesResponseItem.js +0 -67
- package/dist/serialization/resources/assets/types/ListRulesResponseItemFolder.d.ts +0 -2
- package/dist/serialization/resources/assets/types/ListRulesResponseItemFolder.js +0 -42
- package/dist/serialization/resources/assets/types/UpsertFolderResponse.d.ts +0 -2
- package/dist/serialization/resources/assets/types/UsageResponse.d.ts +0 -2
- package/dist/serialization/resources/assets/types/index.js +0 -28
- package/dist/serialization/resources/decisions/index.js +0 -21
- package/dist/serialization/resources/decisions/types/QueryResponse.d.ts +0 -2
- package/dist/serialization/resources/decisions/types/QueryResponse.js +0 -42
- package/dist/serialization/resources/decisions/types/index.js +0 -21
- package/dist/serialization/resources/flows/client/execute.d.ts +0 -3
- package/dist/serialization/resources/flows/client/execute.js +0 -38
- package/dist/serialization/resources/flows/client/index.d.ts +0 -2
- package/dist/serialization/resources/flows/client/index.js +0 -33
- package/dist/serialization/resources/flows/index.js +0 -21
- package/dist/serialization/resources/rules/client/parallelSolve.d.ts +0 -3
- package/dist/serialization/resources/rules/client/parallelSolve.js +0 -38
- package/dist/serialization/resources/rules/client/solve.d.ts +0 -3
- package/dist/serialization/resources/rules/client/solve.js +0 -38
- package/dist/serialization/resources/tests/client/index.d.ts +0 -3
- package/dist/serialization/resources/tests/client/index.js +0 -40
- package/dist/serialization/resources/tests/client/listFlowTests.d.ts +0 -2
- package/dist/serialization/resources/tests/client/listFlowTests.js +0 -56
- package/dist/serialization/resources/tests/client/listRuleTests.d.ts +0 -2
- package/dist/serialization/resources/tests/client/listRuleTests.js +0 -56
- package/dist/serialization/resources/tests/client/requests/CreateFlowTestRequest.d.ts +0 -2
- package/dist/serialization/resources/tests/client/requests/CreateRuleTestRequest.d.ts +0 -2
- package/dist/serialization/resources/tests/client/requests/index.d.ts +0 -5
- package/dist/serialization/resources/tests/client/requests/index.js +0 -7
- package/dist/serialization/resources/tests/index.js +0 -22
- package/dist/serialization/resources/tests/types/CreateFlowTestResponse.d.ts +0 -2
- package/dist/serialization/resources/tests/types/CreateFlowTestResponse.js +0 -47
- package/dist/serialization/resources/tests/types/CreateRuleTestResponse.d.ts +0 -2
- package/dist/serialization/resources/tests/types/CreateRuleTestResponse.js +0 -47
- package/dist/serialization/resources/tests/types/DeleteFlowTestResponse.d.ts +0 -2
- package/dist/serialization/resources/tests/types/DeleteRuleTestResponse.d.ts +0 -2
- package/dist/serialization/resources/tests/types/ListFlowTestsResponseItem.d.ts +0 -2
- package/dist/serialization/resources/tests/types/ListFlowTestsResponseItem.js +0 -47
- package/dist/serialization/resources/tests/types/ListRuleTestsResponseItem.d.ts +0 -2
- package/dist/serialization/resources/tests/types/ListRuleTestsResponseItem.js +0 -47
- package/dist/serialization/resources/tests/types/index.js +0 -26
- package/dist/serialization/resources/users/client/listGroups.d.ts +0 -2
- package/dist/serialization/resources/users/client/listGroups.js +0 -56
- package/dist/serialization/resources/users/client/requests/CreateGroupRequest.d.ts +0 -2
- package/dist/serialization/resources/users/client/requests/InviteRequest.d.ts +0 -2
- package/dist/serialization/resources/users/client/requests/InviteRequest.js +0 -60
- package/dist/serialization/resources/users/types/CreateGroupResponse.d.ts +0 -2
- package/dist/serialization/resources/users/types/InviteRequestRole.d.ts +0 -2
- package/dist/serialization/resources/users/types/InviteRequestRole.js +0 -37
- package/dist/serialization/resources/users/types/InviteResponse.d.ts +0 -2
- package/dist/serialization/resources/users/types/InviteResponse.js +0 -39
- package/dist/serialization/resources/users/types/ListGroupsResponseItem.d.ts +0 -2
- package/dist/serialization/resources/values/client/listDynamicValues.d.ts +0 -2
- package/dist/serialization/resources/values/client/listDynamicValues.js +0 -56
- package/dist/serialization/resources/values/client/update.d.ts +0 -3
- package/dist/serialization/resources/values/client/update.js +0 -57
- package/dist/serialization/resources/values/types/DeleteDynamicValueResponse.d.ts +0 -2
- package/dist/serialization/resources/values/types/ListDynamicValuesResponseItem.d.ts +0 -2
- package/dist/serialization/resources/values/types/ListDynamicValuesResponseItem.js +0 -66
- package/dist/serialization/resources/values/types/ListDynamicValuesResponseItemType.d.ts +0 -2
- package/dist/serialization/resources/values/types/ListDynamicValuesResponseItemType.js +0 -37
- package/dist/serialization/resources/values/types/ListDynamicValuesResponseItemUsagesItem.d.ts +0 -2
- package/dist/serialization/resources/values/types/ListDynamicValuesResponseItemValue.d.ts +0 -2
- package/dist/serialization/resources/values/types/UpdateRequestValue.d.ts +0 -2
- package/dist/serialization/resources/values/types/UpdateRequestValue.js +0 -42
- package/dist/serialization/resources/values/types/UpdateResponseItem.d.ts +0 -2
- package/dist/serialization/resources/values/types/UpdateResponseItem.js +0 -61
- package/dist/serialization/resources/values/types/UpdateResponseItemType.d.ts +0 -2
- package/dist/serialization/resources/values/types/UpdateResponseItemType.js +0 -37
- package/dist/serialization/resources/values/types/UpdateResponseItemValue.d.ts +0 -2
- package/dist/serialization/types/BadRequestErrorBody.d.ts +0 -2
- package/dist/serialization/types/ForbiddenErrorBody.d.ts +0 -2
- package/dist/serialization/types/InternalServerErrorBody.d.ts +0 -2
- package/dist/serialization/types/NotFoundErrorBody.d.ts +0 -2
- package/forge/index.d.ts +0 -4
- package/forge/index.js +0 -31
- package/forge/operators.d.ts +0 -136
- package/forge/operators.js +0 -938
- package/forge/rule.d.ts +0 -129
- package/forge/rule.js +0 -702
- package/forge/types.d.ts +0 -53
- package/forge/types.js +0 -34
- package/forge/values.d.ts +0 -21
- package/forge/values.js +0 -88
- package/serialization/resources/assets/client/exportRule.d.ts +0 -2
- package/serialization/resources/assets/client/exportRule.js +0 -37
- package/serialization/resources/assets/client/importRule.d.ts +0 -2
- package/serialization/resources/assets/client/importRule.js +0 -37
- package/serialization/resources/assets/client/listFlows.d.ts +0 -2
- package/serialization/resources/assets/client/listFlows.js +0 -56
- package/serialization/resources/assets/client/listFolders.d.ts +0 -2
- package/serialization/resources/assets/client/listFolders.js +0 -56
- package/serialization/resources/assets/client/listRules.d.ts +0 -2
- package/serialization/resources/assets/client/listRules.js +0 -56
- package/serialization/resources/assets/types/DeleteFolderResponse.d.ts +0 -2
- package/serialization/resources/assets/types/DeleteFolderResponse.js +0 -42
- package/serialization/resources/assets/types/DeleteRuleResponse.d.ts +0 -2
- package/serialization/resources/assets/types/DeleteRuleResponse.js +0 -39
- package/serialization/resources/assets/types/ListFlowsResponseItem.d.ts +0 -2
- package/serialization/resources/assets/types/ListFoldersResponseItem.d.ts +0 -2
- package/serialization/resources/assets/types/ListFoldersResponseItem.js +0 -42
- package/serialization/resources/assets/types/ListRulesResponseItem.d.ts +0 -2
- package/serialization/resources/assets/types/ListRulesResponseItem.js +0 -67
- package/serialization/resources/assets/types/ListRulesResponseItemFolder.d.ts +0 -2
- package/serialization/resources/assets/types/ListRulesResponseItemFolder.js +0 -42
- package/serialization/resources/assets/types/UpsertFolderResponse.d.ts +0 -2
- package/serialization/resources/assets/types/UpsertFolderResponse.js +0 -42
- package/serialization/resources/assets/types/UsageResponse.d.ts +0 -2
- package/serialization/resources/assets/types/index.js +0 -28
- package/serialization/resources/decisions/index.js +0 -21
- package/serialization/resources/decisions/types/QueryResponse.d.ts +0 -2
- package/serialization/resources/decisions/types/QueryResponse.js +0 -42
- package/serialization/resources/decisions/types/index.js +0 -21
- package/serialization/resources/flows/client/execute.d.ts +0 -3
- package/serialization/resources/flows/client/execute.js +0 -38
- package/serialization/resources/flows/client/index.d.ts +0 -2
- package/serialization/resources/flows/client/index.js +0 -33
- package/serialization/resources/flows/index.js +0 -21
- package/serialization/resources/rules/client/parallelSolve.d.ts +0 -3
- package/serialization/resources/rules/client/parallelSolve.js +0 -38
- package/serialization/resources/rules/client/solve.d.ts +0 -3
- package/serialization/resources/rules/client/solve.js +0 -38
- package/serialization/resources/tests/client/index.d.ts +0 -3
- package/serialization/resources/tests/client/index.js +0 -40
- package/serialization/resources/tests/client/listFlowTests.d.ts +0 -2
- package/serialization/resources/tests/client/listFlowTests.js +0 -56
- package/serialization/resources/tests/client/listRuleTests.d.ts +0 -2
- package/serialization/resources/tests/client/listRuleTests.js +0 -56
- package/serialization/resources/tests/client/requests/CreateFlowTestRequest.d.ts +0 -2
- package/serialization/resources/tests/client/requests/CreateFlowTestRequest.js +0 -42
- package/serialization/resources/tests/client/requests/CreateRuleTestRequest.d.ts +0 -2
- package/serialization/resources/tests/client/requests/CreateRuleTestRequest.js +0 -42
- package/serialization/resources/tests/client/requests/index.d.ts +0 -5
- package/serialization/resources/tests/client/requests/index.js +0 -7
- package/serialization/resources/tests/index.js +0 -22
- package/serialization/resources/tests/types/CreateFlowTestResponse.d.ts +0 -2
- package/serialization/resources/tests/types/CreateFlowTestResponse.js +0 -47
- package/serialization/resources/tests/types/CreateRuleTestResponse.d.ts +0 -2
- package/serialization/resources/tests/types/CreateRuleTestResponse.js +0 -47
- package/serialization/resources/tests/types/DeleteFlowTestResponse.d.ts +0 -2
- package/serialization/resources/tests/types/DeleteFlowTestResponse.js +0 -47
- package/serialization/resources/tests/types/DeleteRuleTestResponse.d.ts +0 -2
- package/serialization/resources/tests/types/DeleteRuleTestResponse.js +0 -47
- package/serialization/resources/tests/types/ListFlowTestsResponseItem.d.ts +0 -2
- package/serialization/resources/tests/types/ListFlowTestsResponseItem.js +0 -47
- package/serialization/resources/tests/types/ListRuleTestsResponseItem.d.ts +0 -2
- package/serialization/resources/tests/types/ListRuleTestsResponseItem.js +0 -47
- package/serialization/resources/tests/types/index.js +0 -26
- package/serialization/resources/users/client/listGroups.d.ts +0 -2
- package/serialization/resources/users/client/listGroups.js +0 -56
- package/serialization/resources/users/client/requests/CreateGroupRequest.d.ts +0 -2
- package/serialization/resources/users/client/requests/InviteRequest.d.ts +0 -2
- package/serialization/resources/users/client/requests/InviteRequest.js +0 -60
- package/serialization/resources/users/types/CreateGroupResponse.d.ts +0 -2
- package/serialization/resources/users/types/CreateGroupResponse.js +0 -42
- package/serialization/resources/users/types/InviteRequestRole.d.ts +0 -2
- package/serialization/resources/users/types/InviteRequestRole.js +0 -37
- package/serialization/resources/users/types/InviteResponse.d.ts +0 -2
- package/serialization/resources/users/types/InviteResponse.js +0 -39
- package/serialization/resources/users/types/ListGroupsResponseItem.d.ts +0 -2
- package/serialization/resources/users/types/ListGroupsResponseItem.js +0 -42
- package/serialization/resources/values/client/listDynamicValues.d.ts +0 -2
- package/serialization/resources/values/client/listDynamicValues.js +0 -56
- package/serialization/resources/values/client/update.d.ts +0 -3
- package/serialization/resources/values/client/update.js +0 -57
- package/serialization/resources/values/types/DeleteDynamicValueResponse.d.ts +0 -2
- package/serialization/resources/values/types/ListDynamicValuesResponseItem.d.ts +0 -2
- package/serialization/resources/values/types/ListDynamicValuesResponseItem.js +0 -66
- package/serialization/resources/values/types/ListDynamicValuesResponseItemType.d.ts +0 -2
- package/serialization/resources/values/types/ListDynamicValuesResponseItemType.js +0 -37
- package/serialization/resources/values/types/ListDynamicValuesResponseItemUsagesItem.d.ts +0 -2
- package/serialization/resources/values/types/ListDynamicValuesResponseItemValue.d.ts +0 -2
- package/serialization/resources/values/types/UpdateRequestValue.d.ts +0 -2
- package/serialization/resources/values/types/UpdateRequestValue.js +0 -42
- package/serialization/resources/values/types/UpdateResponseItem.d.ts +0 -2
- package/serialization/resources/values/types/UpdateResponseItem.js +0 -61
- package/serialization/resources/values/types/UpdateResponseItemType.d.ts +0 -2
- package/serialization/resources/values/types/UpdateResponseItemType.js +0 -37
- package/serialization/resources/values/types/UpdateResponseItemValue.d.ts +0 -2
- package/serialization/types/BadRequestErrorBody.d.ts +0 -2
- package/serialization/types/BadRequestErrorBody.js +0 -39
- package/serialization/types/ForbiddenErrorBody.d.ts +0 -2
- package/serialization/types/ForbiddenErrorBody.js +0 -39
- package/serialization/types/InternalServerErrorBody.d.ts +0 -2
- package/serialization/types/InternalServerErrorBody.js +0 -39
- package/serialization/types/NotFoundErrorBody.d.ts +0 -2
- package/serialization/types/NotFoundErrorBody.js +0 -39
- /package/api/resources/{assets/types/DeleteFolderResponse.d.ts → decisions/client/requests/QueryDecisionsRequest.d.ts} +0 -0
- /package/api/resources/{assets/types/DeleteFolderResponse.js → decisions/client/requests/QueryDecisionsRequest.js} +0 -0
- /package/api/resources/{assets/types/DeleteRuleResponse.d.ts → users/client/requests/CreateUserGroupRequest.d.ts} +0 -0
- /package/api/resources/{assets/types/DeleteRuleResponse.js → users/client/requests/CreateUserGroupRequest.js} +0 -0
- /package/api/resources/{assets/types/ListFlowsResponseItem.d.ts → users/client/requests/UserInviteRequest.d.ts} +0 -0
- /package/api/resources/{assets/types/ListFlowsResponseItem.js → users/client/requests/UserInviteRequest.js} +0 -0
- /package/api/resources/{assets/types/ListFoldersResponseItem.d.ts → values/client/requests/UpdateValuesRequest.d.ts} +0 -0
- /package/api/resources/{assets/types/ListFoldersResponseItem.js → values/client/requests/UpdateValuesRequest.js} +0 -0
- /package/api/resources/{assets/types/ListRulesResponseItem.d.ts → values/types/UpdateValuesRequestValuesValue.d.ts} +0 -0
- /package/api/resources/{assets/types/ListRulesResponseItem.js → values/types/UpdateValuesRequestValuesValue.js} +0 -0
- /package/api/{resources/assets/types/ListRulesResponseItemFolder.d.ts → types/BooleanValue.d.ts} +0 -0
- /package/api/{resources/assets/types/ListRulesResponseItemFolder.js → types/BooleanValue.js} +0 -0
- /package/api/{resources/assets/types/UpsertFolderResponse.d.ts → types/BulkRuleResponseItem.d.ts} +0 -0
- /package/api/{resources/assets/types/UpsertFolderResponse.js → types/BulkRuleResponseItem.js} +0 -0
- /package/api/{resources/assets/types/UsageResponse.d.ts → types/BulkRuleResponseItemError.d.ts} +0 -0
- /package/api/{resources/assets/types/UsageResponse.js → types/BulkRuleResponseItemError.js} +0 -0
- /package/api/{resources/assets/types/index.d.ts → types/CreateTestRequest.d.ts} +0 -0
- /package/api/{resources/decisions/client/requests/QueryRequest.js → types/CreateTestRequest.js} +0 -0
- /package/api/{resources/decisions/client/requests/QueryRequest.d.ts → types/DecisionLog.d.ts} +0 -0
- /package/api/{resources/decisions/types/QueryResponse.js → types/DecisionLog.js} +0 -0
- /package/api/{resources/decisions/types/QueryResponse.d.ts → types/DecisionLogDecision.d.ts} +0 -0
- /package/api/{resources/tests/client/requests/CreateFlowTestRequest.js → types/DecisionLogDecision.js} +0 -0
- /package/api/{resources/decisions/types/index.d.ts → types/DecisionLogDecisionConditionsItemValue.d.ts} +0 -0
- /package/api/{resources/tests/client/requests/CreateRuleTestRequest.js → types/DecisionLogDecisionConditionsItemValue.js} +0 -0
- /package/api/{resources/tests/client/requests/CreateFlowTestRequest.d.ts → types/DecisionLogRequest.d.ts} +0 -0
- /package/api/{resources/tests/types/CreateFlowTestResponse.js → types/DecisionLogRequest.js} +0 -0
- /package/api/{resources/tests/client/requests/CreateRuleTestRequest.d.ts → types/DecisionLogResponse.d.ts} +0 -0
- /package/api/{resources/tests/types/CreateRuleTestResponse.js → types/DecisionLogResponse.js} +0 -0
- /package/api/{resources/tests/client/requests/index.d.ts → types/DynamicRequestPayload.d.ts} +0 -0
- /package/api/{resources/tests/types/DeleteFlowTestResponse.js → types/DynamicRequestPayload.js} +0 -0
- /package/api/{resources/tests/types/CreateFlowTestResponse.d.ts → types/DynamicResponsePayload.d.ts} +0 -0
- /package/api/{resources/tests/types/DeleteRuleTestResponse.js → types/DynamicResponsePayload.js} +0 -0
- /package/api/{resources/tests/types/CreateRuleTestResponse.d.ts → types/DynamicValue.d.ts} +0 -0
- /package/api/{resources/tests/types/ListFlowTestsResponseItem.js → types/DynamicValue.js} +0 -0
- /package/api/{resources/tests/types/DeleteFlowTestResponse.d.ts → types/DynamicValueBase.d.ts} +0 -0
- /package/api/{resources/tests/types/ListRuleTestsResponseItem.js → types/DynamicValueBase.js} +0 -0
- /package/api/{resources/tests/types/DeleteRuleTestResponse.d.ts → types/DynamicValueListResponse.d.ts} +0 -0
- /package/api/{resources/users/client/requests/CreateGroupRequest.js → types/DynamicValueListResponse.js} +0 -0
- /package/api/{resources/tests/types/ListFlowTestsResponseItem.d.ts → types/Error_.d.ts} +0 -0
- /package/api/{resources/users/client/requests/InviteRequest.js → types/Error_.js} +0 -0
- /package/api/{resources/tests/types/ListRuleTestsResponseItem.d.ts → types/FlowBase.d.ts} +0 -0
- /package/api/{resources/users/types/CreateGroupResponse.js → types/FlowBase.js} +0 -0
- /package/api/{resources/tests/types/index.d.ts → types/FlowDetail.d.ts} +0 -0
- /package/api/{resources/users/types/InviteResponse.js → types/FlowDetail.js} +0 -0
- /package/api/{resources/users/client/requests/CreateGroupRequest.d.ts → types/FlowExecutionError.d.ts} +0 -0
- /package/api/{resources/users/types/ListGroupsResponseItem.js → types/FlowExecutionError.js} +0 -0
- /package/api/{resources/users/client/requests/InviteRequest.d.ts → types/FlowListResponse.d.ts} +0 -0
- /package/api/{resources/values/types/DeleteDynamicValueResponse.js → types/FlowListResponse.js} +0 -0
- /package/api/{resources/users/types/CreateGroupResponse.d.ts → types/Folder.d.ts} +0 -0
- /package/api/{resources/values/types/ListDynamicValuesResponseItem.js → types/Folder.js} +0 -0
- /package/api/{resources/users/types/InviteResponse.d.ts → types/FolderListResponse.d.ts} +0 -0
- /package/api/{resources/values/types/ListDynamicValuesResponseItemUsagesItem.js → types/FolderListResponse.js} +0 -0
- /package/api/{resources/users/types/ListGroupsResponseItem.d.ts → types/ListValue.d.ts} +0 -0
- /package/api/{resources/values/types/ListDynamicValuesResponseItemValue.js → types/ListValue.js} +0 -0
- /package/api/{resources/values/types/DeleteDynamicValueResponse.d.ts → types/NumberValue.d.ts} +0 -0
- /package/api/{resources/values/types/UpdateRequestValue.js → types/NumberValue.js} +0 -0
- /package/api/{resources/values/types/ListDynamicValuesResponseItem.d.ts → types/ParallelSolveRequest.d.ts} +0 -0
- /package/api/{resources/values/types/UpdateResponseItem.js → types/ParallelSolveRequest.js} +0 -0
- /package/api/{resources/values/types/ListDynamicValuesResponseItemUsagesItem.d.ts → types/ParallelSolveRequestValue.d.ts} +0 -0
- /package/api/{resources/values/types/UpdateResponseItemValue.js → types/ParallelSolveRequestValue.js} +0 -0
- /package/api/{resources/values/types/ListDynamicValuesResponseItemValue.d.ts → types/ParallelSolveResponse.d.ts} +0 -0
- /package/api/types/{BadRequestErrorBody.js → ParallelSolveResponse.js} +0 -0
- /package/api/{resources/values/types/UpdateRequestValue.d.ts → types/RuleBase.d.ts} +0 -0
- /package/api/types/{ForbiddenErrorBody.js → RuleBase.js} +0 -0
- /package/api/{resources/values/types/UpdateResponseItem.d.ts → types/RuleDetail.d.ts} +0 -0
- /package/api/types/{InternalServerErrorBody.js → RuleDetail.js} +0 -0
- /package/api/{resources/values/types/UpdateResponseItemValue.d.ts → types/RuleExport.d.ts} +0 -0
- /package/api/types/{NotFoundErrorBody.js → RuleExport.js} +0 -0
- /package/api/types/{BadRequestErrorBody.d.ts → RuleListResponse.d.ts} +0 -0
- /package/{dist/api/resources/assets/types/DeleteFolderResponse.js → api/types/RuleListResponse.js} +0 -0
- /package/api/types/{ForbiddenErrorBody.d.ts → RuleUsage.d.ts} +0 -0
- /package/{dist/api/resources/assets/types/DeleteRuleResponse.js → api/types/RuleUsage.js} +0 -0
- /package/api/types/{InternalServerErrorBody.d.ts → SchemaField.d.ts} +0 -0
- /package/{dist/api/resources/assets/types/ListFlowsResponseItem.js → api/types/SchemaField.js} +0 -0
- /package/api/types/{NotFoundErrorBody.d.ts → SchemaFieldDefaultValue.d.ts} +0 -0
- /package/{dist/api/resources/assets/types/ListFoldersResponseItem.js → api/types/SchemaFieldDefaultValue.js} +0 -0
- /package/{dist/api/resources/assets/types/DeleteFolderResponse.d.ts → api/types/StringValue.d.ts} +0 -0
- /package/{dist/api/resources/assets/types/ListRulesResponseItem.js → api/types/StringValue.js} +0 -0
- /package/{dist/api/resources/assets/types/DeleteRuleResponse.d.ts → api/types/SuccessMessage.d.ts} +0 -0
- /package/{dist/api/resources/assets/types/ListRulesResponseItemFolder.js → api/types/SuccessMessage.js} +0 -0
- /package/{dist/api/resources/assets/types/ListFlowsResponseItem.d.ts → api/types/Test.d.ts} +0 -0
- /package/{dist/api/resources/assets/types/UpsertFolderResponse.js → api/types/Test.js} +0 -0
- /package/{dist/api/resources/assets/types/ListFoldersResponseItem.d.ts → api/types/TestListResponse.d.ts} +0 -0
- /package/{dist/api/resources/assets/types/UsageResponse.js → api/types/TestListResponse.js} +0 -0
- /package/{dist/api/resources/assets/types/ListRulesResponseItem.d.ts → api/types/TestTestState.d.ts} +0 -0
- /package/{dist/api/resources/decisions/client/requests/QueryRequest.js → api/types/TestTestState.js} +0 -0
- /package/{dist/api/resources/assets/types/ListRulesResponseItemFolder.d.ts → api/types/TestTestStateConditionsItemValue.d.ts} +0 -0
- /package/{dist/api/resources/decisions/types/QueryResponse.js → api/types/TestTestStateConditionsItemValue.js} +0 -0
- /package/{dist/api/resources/assets/types/UpsertFolderResponse.d.ts → api/types/TestTestStateEvaluationError.d.ts} +0 -0
- /package/{dist/api/resources/tests/client/requests/CreateFlowTestRequest.js → api/types/TestTestStateEvaluationError.js} +0 -0
- /package/{dist/api/resources/assets/types/UsageResponse.d.ts → api/types/UsageStatistics.d.ts} +0 -0
- /package/{dist/api/resources/tests/client/requests/CreateRuleTestRequest.js → api/types/UsageStatistics.js} +0 -0
- /package/{dist/api/resources/assets/types/index.d.ts → api/types/UserGroup.d.ts} +0 -0
- /package/{dist/api/resources/tests/types/CreateFlowTestResponse.js → api/types/UserGroup.js} +0 -0
- /package/{dist/api/resources/decisions/client/requests/QueryRequest.d.ts → api/types/UserGroupListResponse.d.ts} +0 -0
- /package/{dist/api/resources/tests/types/CreateRuleTestResponse.js → api/types/UserGroupListResponse.js} +0 -0
- /package/{dist/api/resources/decisions/types/QueryResponse.d.ts → api/types/UserInviteResponse.d.ts} +0 -0
- /package/{dist/api/resources/tests/types/DeleteFlowTestResponse.js → api/types/UserInviteResponse.js} +0 -0
- /package/{dist/api/resources/decisions/types/index.d.ts → api/types/UserInviteResponseUser.d.ts} +0 -0
- /package/{dist/api/resources/tests/types/DeleteRuleTestResponse.js → api/types/UserInviteResponseUser.js} +0 -0
- /package/{dist/api/resources/tests/client/requests/CreateFlowTestRequest.d.ts → api/types/ValueLimits.d.ts} +0 -0
- /package/{dist/api/resources/tests/types/ListFlowTestsResponseItem.js → api/types/ValueLimits.js} +0 -0
- /package/dist/api/resources/{tests/client/requests/CreateRuleTestRequest.d.ts → decisions/client/requests/QueryDecisionsRequest.d.ts} +0 -0
- /package/dist/api/resources/{tests/types/ListRuleTestsResponseItem.js → decisions/client/requests/QueryDecisionsRequest.js} +0 -0
- /package/dist/api/resources/{tests/client/requests/index.d.ts → users/client/requests/CreateUserGroupRequest.d.ts} +0 -0
- /package/dist/api/resources/users/client/requests/{CreateGroupRequest.js → CreateUserGroupRequest.js} +0 -0
- /package/dist/api/resources/{tests/types/CreateFlowTestResponse.d.ts → users/client/requests/UserInviteRequest.d.ts} +0 -0
- /package/dist/api/resources/users/client/requests/{InviteRequest.js → UserInviteRequest.js} +0 -0
- /package/dist/api/resources/{tests/types/CreateRuleTestResponse.d.ts → values/client/requests/UpdateValuesRequest.d.ts} +0 -0
- /package/dist/api/resources/{users/types/CreateGroupResponse.js → values/client/requests/UpdateValuesRequest.js} +0 -0
- /package/dist/api/resources/{tests/types/DeleteFlowTestResponse.d.ts → values/types/UpdateValuesRequestValuesValue.d.ts} +0 -0
- /package/dist/api/resources/{users/types/InviteResponse.js → values/types/UpdateValuesRequestValuesValue.js} +0 -0
- /package/dist/api/{resources/tests/types/DeleteRuleTestResponse.d.ts → types/BooleanValue.d.ts} +0 -0
- /package/dist/api/{resources/users/types/ListGroupsResponseItem.js → types/BooleanValue.js} +0 -0
- /package/dist/api/{resources/tests/types/ListFlowTestsResponseItem.d.ts → types/BulkRuleResponseItem.d.ts} +0 -0
- /package/dist/api/{resources/values/types/DeleteDynamicValueResponse.js → types/BulkRuleResponseItem.js} +0 -0
- /package/dist/api/{resources/tests/types/ListRuleTestsResponseItem.d.ts → types/BulkRuleResponseItemError.d.ts} +0 -0
- /package/dist/api/{resources/values/types/ListDynamicValuesResponseItem.js → types/BulkRuleResponseItemError.js} +0 -0
- /package/dist/api/{resources/tests/types/index.d.ts → types/CreateTestRequest.d.ts} +0 -0
- /package/dist/api/{resources/values/types/ListDynamicValuesResponseItemUsagesItem.js → types/CreateTestRequest.js} +0 -0
- /package/dist/api/{resources/users/client/requests/CreateGroupRequest.d.ts → types/DecisionLog.d.ts} +0 -0
- /package/dist/api/{resources/values/types/ListDynamicValuesResponseItemValue.js → types/DecisionLog.js} +0 -0
- /package/dist/api/{resources/users/client/requests/InviteRequest.d.ts → types/DecisionLogDecision.d.ts} +0 -0
- /package/dist/api/{resources/values/types/UpdateRequestValue.js → types/DecisionLogDecision.js} +0 -0
- /package/dist/api/{resources/users/types/CreateGroupResponse.d.ts → types/DecisionLogDecisionConditionsItemValue.d.ts} +0 -0
- /package/dist/api/{resources/values/types/UpdateResponseItem.js → types/DecisionLogDecisionConditionsItemValue.js} +0 -0
- /package/dist/api/{resources/users/types/InviteResponse.d.ts → types/DecisionLogRequest.d.ts} +0 -0
- /package/dist/api/{resources/values/types/UpdateResponseItemValue.js → types/DecisionLogRequest.js} +0 -0
- /package/dist/api/{resources/users/types/ListGroupsResponseItem.d.ts → types/DecisionLogResponse.d.ts} +0 -0
- /package/dist/api/types/{BadRequestErrorBody.js → DecisionLogResponse.js} +0 -0
- /package/dist/api/{resources/values/types/DeleteDynamicValueResponse.d.ts → types/DynamicRequestPayload.d.ts} +0 -0
- /package/dist/api/types/{ForbiddenErrorBody.js → DynamicRequestPayload.js} +0 -0
- /package/dist/api/{resources/values/types/ListDynamicValuesResponseItem.d.ts → types/DynamicResponsePayload.d.ts} +0 -0
- /package/dist/api/types/{InternalServerErrorBody.js → DynamicResponsePayload.js} +0 -0
- /package/dist/api/{resources/values/types/ListDynamicValuesResponseItemUsagesItem.d.ts → types/DynamicValue.d.ts} +0 -0
- /package/dist/api/types/{NotFoundErrorBody.js → DynamicValue.js} +0 -0
- /package/dist/api/{resources/values/types/ListDynamicValuesResponseItemValue.d.ts → types/DynamicValueBase.d.ts} +0 -0
- /package/dist/api/{resources/values/types/UpdateRequestValue.d.ts → types/DynamicValueListResponse.d.ts} +0 -0
- /package/dist/api/{resources/values/types/UpdateResponseItem.d.ts → types/Error_.d.ts} +0 -0
- /package/dist/api/{resources/values/types/UpdateResponseItemValue.d.ts → types/FlowBase.d.ts} +0 -0
- /package/dist/api/types/{BadRequestErrorBody.d.ts → FlowDetail.d.ts} +0 -0
- /package/dist/api/types/{ForbiddenErrorBody.d.ts → FlowExecutionError.d.ts} +0 -0
- /package/dist/api/types/{InternalServerErrorBody.d.ts → FlowListResponse.d.ts} +0 -0
- /package/dist/api/types/{NotFoundErrorBody.d.ts → Folder.d.ts} +0 -0
- /package/dist/{serialization/resources/assets/types/index.d.ts → api/types/FolderListResponse.d.ts} +0 -0
- /package/dist/{serialization/resources/decisions/index.d.ts → api/types/ListValue.d.ts} +0 -0
- /package/dist/{serialization/resources/decisions/types/index.d.ts → api/types/NumberValue.d.ts} +0 -0
- /package/dist/{serialization/resources/flows/index.d.ts → api/types/ParallelSolveRequest.d.ts} +0 -0
- /package/dist/{serialization/resources/tests/index.d.ts → api/types/ParallelSolveRequestValue.d.ts} +0 -0
- /package/dist/{serialization/resources/tests/types/index.d.ts → api/types/ParallelSolveResponse.d.ts} +0 -0
- /package/{serialization/resources/assets/types/index.d.ts → dist/api/types/RuleBase.d.ts} +0 -0
- /package/{serialization/resources/decisions/index.d.ts → dist/api/types/RuleDetail.d.ts} +0 -0
- /package/{serialization/resources/decisions/types/index.d.ts → dist/api/types/RuleExport.d.ts} +0 -0
- /package/{serialization/resources/flows/index.d.ts → dist/api/types/RuleListResponse.d.ts} +0 -0
- /package/{serialization/resources/tests/index.d.ts → dist/api/types/RuleUsage.d.ts} +0 -0
- /package/{serialization/resources/tests/types/index.d.ts → dist/api/types/SchemaField.d.ts} +0 -0
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
export var __esModule: boolean;
|
|
2
2
|
export function getSchemaUtils(schema: any): {
|
|
3
|
+
nullable: () => {
|
|
4
|
+
parse: (raw: any, opts: any) => any;
|
|
5
|
+
json: (parsed: any, opts: any) => any;
|
|
6
|
+
getType: () => "nullable";
|
|
7
|
+
} & any;
|
|
3
8
|
optional: () => {
|
|
4
9
|
parse: (raw: any, opts: any) => any;
|
|
5
10
|
json: (parsed: any, opts: any) => any;
|
|
6
11
|
getType: () => "optional";
|
|
7
12
|
} & any;
|
|
13
|
+
optionalNullable: () => {
|
|
14
|
+
parse: (raw: any, opts: any) => any;
|
|
15
|
+
json: (parsed: any, opts: any) => any;
|
|
16
|
+
getType: () => "optionalNullable";
|
|
17
|
+
} & any;
|
|
8
18
|
transform: (transformer: any) => {
|
|
9
19
|
parse: (raw: any, opts: any) => any;
|
|
10
20
|
json: (transformed: any, opts: any) => any;
|
|
@@ -16,16 +26,82 @@ export function getSchemaUtils(schema: any): {
|
|
|
16
26
|
/**
|
|
17
27
|
* schema utils are defined in one file to resolve issues with circular imports
|
|
18
28
|
*/
|
|
29
|
+
export function nullable(schema: any): {
|
|
30
|
+
parse: (raw: any, opts: any) => any;
|
|
31
|
+
json: (parsed: any, opts: any) => any;
|
|
32
|
+
getType: () => "nullable";
|
|
33
|
+
} & {
|
|
34
|
+
nullable: () => {
|
|
35
|
+
parse: (raw: any, opts: any) => any;
|
|
36
|
+
json: (parsed: any, opts: any) => any;
|
|
37
|
+
getType: () => "nullable";
|
|
38
|
+
} & any;
|
|
39
|
+
optional: () => {
|
|
40
|
+
parse: (raw: any, opts: any) => any;
|
|
41
|
+
json: (parsed: any, opts: any) => any;
|
|
42
|
+
getType: () => "optional";
|
|
43
|
+
} & any;
|
|
44
|
+
optionalNullable: () => {
|
|
45
|
+
parse: (raw: any, opts: any) => any;
|
|
46
|
+
json: (parsed: any, opts: any) => any;
|
|
47
|
+
getType: () => "optionalNullable";
|
|
48
|
+
} & any;
|
|
49
|
+
transform: (transformer: any) => {
|
|
50
|
+
parse: (raw: any, opts: any) => any;
|
|
51
|
+
json: (transformed: any, opts: any) => any;
|
|
52
|
+
getType: () => any;
|
|
53
|
+
} & any;
|
|
54
|
+
parseOrThrow: (raw: any, opts: any) => any;
|
|
55
|
+
jsonOrThrow: (parsed: any, opts: any) => any;
|
|
56
|
+
};
|
|
19
57
|
export function optional(schema: any): {
|
|
20
58
|
parse: (raw: any, opts: any) => any;
|
|
21
59
|
json: (parsed: any, opts: any) => any;
|
|
22
60
|
getType: () => "optional";
|
|
23
61
|
} & {
|
|
62
|
+
nullable: () => {
|
|
63
|
+
parse: (raw: any, opts: any) => any;
|
|
64
|
+
json: (parsed: any, opts: any) => any;
|
|
65
|
+
getType: () => "nullable";
|
|
66
|
+
} & any;
|
|
67
|
+
optional: () => {
|
|
68
|
+
parse: (raw: any, opts: any) => any;
|
|
69
|
+
json: (parsed: any, opts: any) => any;
|
|
70
|
+
getType: () => "optional";
|
|
71
|
+
} & any;
|
|
72
|
+
optionalNullable: () => {
|
|
73
|
+
parse: (raw: any, opts: any) => any;
|
|
74
|
+
json: (parsed: any, opts: any) => any;
|
|
75
|
+
getType: () => "optionalNullable";
|
|
76
|
+
} & any;
|
|
77
|
+
transform: (transformer: any) => {
|
|
78
|
+
parse: (raw: any, opts: any) => any;
|
|
79
|
+
json: (transformed: any, opts: any) => any;
|
|
80
|
+
getType: () => any;
|
|
81
|
+
} & any;
|
|
82
|
+
parseOrThrow: (raw: any, opts: any) => any;
|
|
83
|
+
jsonOrThrow: (parsed: any, opts: any) => any;
|
|
84
|
+
};
|
|
85
|
+
export function optionalNullable(schema: any): {
|
|
86
|
+
parse: (raw: any, opts: any) => any;
|
|
87
|
+
json: (parsed: any, opts: any) => any;
|
|
88
|
+
getType: () => "optionalNullable";
|
|
89
|
+
} & {
|
|
90
|
+
nullable: () => {
|
|
91
|
+
parse: (raw: any, opts: any) => any;
|
|
92
|
+
json: (parsed: any, opts: any) => any;
|
|
93
|
+
getType: () => "nullable";
|
|
94
|
+
} & any;
|
|
24
95
|
optional: () => {
|
|
25
96
|
parse: (raw: any, opts: any) => any;
|
|
26
97
|
json: (parsed: any, opts: any) => any;
|
|
27
98
|
getType: () => "optional";
|
|
28
99
|
} & any;
|
|
100
|
+
optionalNullable: () => {
|
|
101
|
+
parse: (raw: any, opts: any) => any;
|
|
102
|
+
json: (parsed: any, opts: any) => any;
|
|
103
|
+
getType: () => "optionalNullable";
|
|
104
|
+
} & any;
|
|
29
105
|
transform: (transformer: any) => {
|
|
30
106
|
parse: (raw: any, opts: any) => any;
|
|
31
107
|
json: (transformed: any, opts: any) => any;
|
|
@@ -39,11 +115,21 @@ export function transform(schema: any, transformer: any): {
|
|
|
39
115
|
json: (transformed: any, opts: any) => any;
|
|
40
116
|
getType: () => any;
|
|
41
117
|
} & {
|
|
118
|
+
nullable: () => {
|
|
119
|
+
parse: (raw: any, opts: any) => any;
|
|
120
|
+
json: (parsed: any, opts: any) => any;
|
|
121
|
+
getType: () => "nullable";
|
|
122
|
+
} & any;
|
|
42
123
|
optional: () => {
|
|
43
124
|
parse: (raw: any, opts: any) => any;
|
|
44
125
|
json: (parsed: any, opts: any) => any;
|
|
45
126
|
getType: () => "optional";
|
|
46
127
|
} & any;
|
|
128
|
+
optionalNullable: () => {
|
|
129
|
+
parse: (raw: any, opts: any) => any;
|
|
130
|
+
json: (parsed: any, opts: any) => any;
|
|
131
|
+
getType: () => "optionalNullable";
|
|
132
|
+
} & any;
|
|
47
133
|
transform: (transformer: any) => {
|
|
48
134
|
parse: (raw: any, opts: any) => any;
|
|
49
135
|
json: (transformed: any, opts: any) => any;
|
|
@@ -1,52 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try {
|
|
6
|
-
step(generator.next(value));
|
|
7
|
-
}
|
|
8
|
-
catch (e) {
|
|
9
|
-
reject(e);
|
|
10
|
-
} }
|
|
11
|
-
function rejected(value) { try {
|
|
12
|
-
step(generator["throw"](value));
|
|
13
|
-
}
|
|
14
|
-
catch (e) {
|
|
15
|
-
reject(e);
|
|
16
|
-
} }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
3
|
+
exports.getSchemaUtils = getSchemaUtils;
|
|
4
|
+
exports.nullable = nullable;
|
|
5
|
+
exports.optional = optional;
|
|
6
|
+
exports.optionalNullable = optionalNullable;
|
|
7
|
+
exports.transform = transform;
|
|
23
8
|
const Schema_1 = require("../../Schema");
|
|
24
9
|
const JsonError_1 = require("./JsonError");
|
|
25
10
|
const ParseError_1 = require("./ParseError");
|
|
26
11
|
function getSchemaUtils(schema) {
|
|
27
12
|
return {
|
|
13
|
+
nullable: () => nullable(schema),
|
|
28
14
|
optional: () => optional(schema),
|
|
15
|
+
optionalNullable: () => optionalNullable(schema),
|
|
29
16
|
transform: (transformer) => transform(schema, transformer),
|
|
30
|
-
parseOrThrow: (raw, opts) =>
|
|
31
|
-
const parsed =
|
|
17
|
+
parseOrThrow: (raw, opts) => {
|
|
18
|
+
const parsed = schema.parse(raw, opts);
|
|
32
19
|
if (parsed.ok) {
|
|
33
20
|
return parsed.value;
|
|
34
21
|
}
|
|
35
22
|
throw new ParseError_1.ParseError(parsed.errors);
|
|
36
|
-
}
|
|
37
|
-
jsonOrThrow: (parsed, opts) =>
|
|
38
|
-
const raw =
|
|
23
|
+
},
|
|
24
|
+
jsonOrThrow: (parsed, opts) => {
|
|
25
|
+
const raw = schema.json(parsed, opts);
|
|
39
26
|
if (raw.ok) {
|
|
40
27
|
return raw.value;
|
|
41
28
|
}
|
|
42
29
|
throw new JsonError_1.JsonError(raw.errors);
|
|
43
|
-
}
|
|
30
|
+
},
|
|
44
31
|
};
|
|
45
32
|
}
|
|
46
|
-
exports.getSchemaUtils = getSchemaUtils;
|
|
47
33
|
/**
|
|
48
34
|
* schema utils are defined in one file to resolve issues with circular imports
|
|
49
35
|
*/
|
|
36
|
+
function nullable(schema) {
|
|
37
|
+
const baseSchema = {
|
|
38
|
+
parse: (raw, opts) => {
|
|
39
|
+
if (raw == null) {
|
|
40
|
+
return {
|
|
41
|
+
ok: true,
|
|
42
|
+
value: null,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return schema.parse(raw, opts);
|
|
46
|
+
},
|
|
47
|
+
json: (parsed, opts) => {
|
|
48
|
+
if (parsed == null) {
|
|
49
|
+
return {
|
|
50
|
+
ok: true,
|
|
51
|
+
value: null,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return schema.json(parsed, opts);
|
|
55
|
+
},
|
|
56
|
+
getType: () => Schema_1.SchemaType.NULLABLE,
|
|
57
|
+
};
|
|
58
|
+
return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
|
|
59
|
+
}
|
|
50
60
|
function optional(schema) {
|
|
51
61
|
const baseSchema = {
|
|
52
62
|
parse: (raw, opts) => {
|
|
@@ -59,6 +69,12 @@ function optional(schema) {
|
|
|
59
69
|
return schema.parse(raw, opts);
|
|
60
70
|
},
|
|
61
71
|
json: (parsed, opts) => {
|
|
72
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.omitUndefined) && parsed === undefined) {
|
|
73
|
+
return {
|
|
74
|
+
ok: true,
|
|
75
|
+
value: undefined,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
62
78
|
if (parsed == null) {
|
|
63
79
|
return {
|
|
64
80
|
ok: true,
|
|
@@ -71,11 +87,46 @@ function optional(schema) {
|
|
|
71
87
|
};
|
|
72
88
|
return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
|
|
73
89
|
}
|
|
74
|
-
|
|
90
|
+
function optionalNullable(schema) {
|
|
91
|
+
const baseSchema = {
|
|
92
|
+
parse: (raw, opts) => {
|
|
93
|
+
if (raw === undefined) {
|
|
94
|
+
return {
|
|
95
|
+
ok: true,
|
|
96
|
+
value: undefined,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
if (raw === null) {
|
|
100
|
+
return {
|
|
101
|
+
ok: true,
|
|
102
|
+
value: null,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return schema.parse(raw, opts);
|
|
106
|
+
},
|
|
107
|
+
json: (parsed, opts) => {
|
|
108
|
+
if (parsed === undefined) {
|
|
109
|
+
return {
|
|
110
|
+
ok: true,
|
|
111
|
+
value: undefined,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (parsed === null) {
|
|
115
|
+
return {
|
|
116
|
+
ok: true,
|
|
117
|
+
value: null,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return schema.json(parsed, opts);
|
|
121
|
+
},
|
|
122
|
+
getType: () => Schema_1.SchemaType.OPTIONAL_NULLABLE,
|
|
123
|
+
};
|
|
124
|
+
return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
|
|
125
|
+
}
|
|
75
126
|
function transform(schema, transformer) {
|
|
76
127
|
const baseSchema = {
|
|
77
|
-
parse: (raw, opts) =>
|
|
78
|
-
const parsed =
|
|
128
|
+
parse: (raw, opts) => {
|
|
129
|
+
const parsed = schema.parse(raw, opts);
|
|
79
130
|
if (!parsed.ok) {
|
|
80
131
|
return parsed;
|
|
81
132
|
}
|
|
@@ -83,13 +134,12 @@ function transform(schema, transformer) {
|
|
|
83
134
|
ok: true,
|
|
84
135
|
value: transformer.transform(parsed.value),
|
|
85
136
|
};
|
|
86
|
-
}
|
|
87
|
-
json: (transformed, opts) =>
|
|
88
|
-
const parsed =
|
|
137
|
+
},
|
|
138
|
+
json: (transformed, opts) => {
|
|
139
|
+
const parsed = transformer.untransform(transformed);
|
|
89
140
|
return schema.json(parsed, opts);
|
|
90
|
-
}
|
|
141
|
+
},
|
|
91
142
|
getType: () => schema.getType(),
|
|
92
143
|
};
|
|
93
144
|
return Object.assign(Object.assign({}, baseSchema), getSchemaUtils(baseSchema));
|
|
94
145
|
}
|
|
95
|
-
exports.transform = transform;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringifyValidationError =
|
|
3
|
+
exports.stringifyValidationError = stringifyValidationError;
|
|
4
4
|
function stringifyValidationError(error) {
|
|
5
5
|
if (error.path.length === 0) {
|
|
6
6
|
return error.message;
|
|
7
7
|
}
|
|
8
8
|
return `${error.path.join(" -> ")}: ${error.message}`;
|
|
9
9
|
}
|
|
10
|
-
exports.stringifyValidationError = stringifyValidationError;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
export var __esModule: boolean;
|
|
2
|
-
export function set(schema: any):
|
|
3
|
-
|
|
4
|
-
json: (parsed: any, opts: any) => any;
|
|
5
|
-
getType: () => "set";
|
|
6
|
-
} & schema_utils_1.SchemaUtils<any, any>;
|
|
2
|
+
export function set(schema: any): Schema_1.BaseSchema<any, any> & schema_utils_1.SchemaUtils<any[], Set<any>>;
|
|
3
|
+
import Schema_1 = require("../../Schema");
|
|
7
4
|
import schema_utils_1 = require("../schema-utils");
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try {
|
|
6
|
-
step(generator.next(value));
|
|
7
|
-
}
|
|
8
|
-
catch (e) {
|
|
9
|
-
reject(e);
|
|
10
|
-
} }
|
|
11
|
-
function rejected(value) { try {
|
|
12
|
-
step(generator["throw"](value));
|
|
13
|
-
}
|
|
14
|
-
catch (e) {
|
|
15
|
-
reject(e);
|
|
16
|
-
} }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.set =
|
|
3
|
+
exports.set = set;
|
|
23
4
|
const Schema_1 = require("../../Schema");
|
|
24
5
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
25
6
|
const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
|
|
@@ -28,8 +9,8 @@ const schema_utils_1 = require("../schema-utils");
|
|
|
28
9
|
function set(schema) {
|
|
29
10
|
const listSchema = (0, list_1.list)(schema);
|
|
30
11
|
const baseSchema = {
|
|
31
|
-
parse: (raw, opts) =>
|
|
32
|
-
const parsedList =
|
|
12
|
+
parse: (raw, opts) => {
|
|
13
|
+
const parsedList = listSchema.parse(raw, opts);
|
|
33
14
|
if (parsedList.ok) {
|
|
34
15
|
return {
|
|
35
16
|
ok: true,
|
|
@@ -39,8 +20,8 @@ function set(schema) {
|
|
|
39
20
|
else {
|
|
40
21
|
return parsedList;
|
|
41
22
|
}
|
|
42
|
-
}
|
|
43
|
-
json: (parsed, opts) =>
|
|
23
|
+
},
|
|
24
|
+
json: (parsed, opts) => {
|
|
44
25
|
var _a;
|
|
45
26
|
if (!(parsed instanceof Set)) {
|
|
46
27
|
return {
|
|
@@ -53,11 +34,10 @@ function set(schema) {
|
|
|
53
34
|
],
|
|
54
35
|
};
|
|
55
36
|
}
|
|
56
|
-
const jsonList =
|
|
37
|
+
const jsonList = listSchema.json([...parsed], opts);
|
|
57
38
|
return jsonList;
|
|
58
|
-
}
|
|
39
|
+
},
|
|
59
40
|
getType: () => Schema_1.SchemaType.SET,
|
|
60
41
|
};
|
|
61
42
|
return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
|
62
43
|
}
|
|
63
|
-
exports.set = set;
|
|
@@ -1,61 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try {
|
|
6
|
-
step(generator.next(value));
|
|
7
|
-
}
|
|
8
|
-
catch (e) {
|
|
9
|
-
reject(e);
|
|
10
|
-
} }
|
|
11
|
-
function rejected(value) { try {
|
|
12
|
-
step(generator["throw"](value));
|
|
13
|
-
}
|
|
14
|
-
catch (e) {
|
|
15
|
-
reject(e);
|
|
16
|
-
} }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.undiscriminatedUnion =
|
|
3
|
+
exports.undiscriminatedUnion = undiscriminatedUnion;
|
|
23
4
|
const Schema_1 = require("../../Schema");
|
|
24
5
|
const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
|
|
25
6
|
const schema_utils_1 = require("../schema-utils");
|
|
26
7
|
function undiscriminatedUnion(schemas) {
|
|
27
8
|
const baseSchema = {
|
|
28
|
-
parse: (raw, opts) =>
|
|
9
|
+
parse: (raw, opts) => {
|
|
29
10
|
return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.parse(raw, opts), schemas, opts);
|
|
30
|
-
}
|
|
31
|
-
json: (parsed, opts) =>
|
|
11
|
+
},
|
|
12
|
+
json: (parsed, opts) => {
|
|
32
13
|
return validateAndTransformUndiscriminatedUnion((schema, opts) => schema.json(parsed, opts), schemas, opts);
|
|
33
|
-
}
|
|
14
|
+
},
|
|
34
15
|
getType: () => Schema_1.SchemaType.UNDISCRIMINATED_UNION,
|
|
35
16
|
};
|
|
36
17
|
return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
|
37
18
|
}
|
|
38
|
-
exports.undiscriminatedUnion = undiscriminatedUnion;
|
|
39
19
|
function validateAndTransformUndiscriminatedUnion(transform, schemas, opts) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
}
|
|
20
|
+
const errors = [];
|
|
21
|
+
for (const [index, schema] of schemas.entries()) {
|
|
22
|
+
const transformed = transform(schema, Object.assign(Object.assign({}, opts), { skipValidation: false }));
|
|
23
|
+
if (transformed.ok) {
|
|
24
|
+
return transformed;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
for (const error of transformed.errors) {
|
|
28
|
+
errors.push({
|
|
29
|
+
path: error.path,
|
|
30
|
+
message: `[Variant ${index}] ${error.message}`,
|
|
31
|
+
});
|
|
54
32
|
}
|
|
55
33
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
ok: false,
|
|
37
|
+
errors,
|
|
38
|
+
};
|
|
61
39
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.discriminant =
|
|
3
|
+
exports.discriminant = discriminant;
|
|
4
4
|
function discriminant(parsedDiscriminant, rawDiscriminant) {
|
|
5
5
|
return {
|
|
6
6
|
parsedDiscriminant,
|
|
7
7
|
rawDiscriminant,
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
exports.discriminant = discriminant;
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try {
|
|
6
|
-
step(generator.next(value));
|
|
7
|
-
}
|
|
8
|
-
catch (e) {
|
|
9
|
-
reject(e);
|
|
10
|
-
} }
|
|
11
|
-
function rejected(value) { try {
|
|
12
|
-
step(generator["throw"](value));
|
|
13
|
-
}
|
|
14
|
-
catch (e) {
|
|
15
|
-
reject(e);
|
|
16
|
-
} }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
3
|
var t = {};
|
|
23
4
|
for (var p in s)
|
|
@@ -31,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
31
12
|
return t;
|
|
32
13
|
};
|
|
33
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.union =
|
|
15
|
+
exports.union = union;
|
|
35
16
|
const Schema_1 = require("../../Schema");
|
|
36
17
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
37
18
|
const isPlainObject_1 = require("../../utils/isPlainObject");
|
|
@@ -47,7 +28,7 @@ function union(discriminant, union) {
|
|
|
47
28
|
: discriminant.parsedDiscriminant;
|
|
48
29
|
const discriminantValueSchema = (0, enum_1.enum_)((0, keys_1.keys)(union));
|
|
49
30
|
const baseSchema = {
|
|
50
|
-
parse: (raw, opts) =>
|
|
31
|
+
parse: (raw, opts) => {
|
|
51
32
|
return transformAndValidateUnion({
|
|
52
33
|
value: raw,
|
|
53
34
|
discriminant: rawDiscriminant,
|
|
@@ -64,8 +45,8 @@ function union(discriminant, union) {
|
|
|
64
45
|
transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.parse(additionalProperties, opts),
|
|
65
46
|
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
66
47
|
});
|
|
67
|
-
}
|
|
68
|
-
json: (parsed, opts) =>
|
|
48
|
+
},
|
|
49
|
+
json: (parsed, opts) => {
|
|
69
50
|
return transformAndValidateUnion({
|
|
70
51
|
value: parsed,
|
|
71
52
|
discriminant: parsedDiscriminant,
|
|
@@ -82,71 +63,68 @@ function union(discriminant, union) {
|
|
|
82
63
|
transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => additionalPropertiesSchema.json(additionalProperties, opts),
|
|
83
64
|
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
84
65
|
});
|
|
85
|
-
}
|
|
66
|
+
},
|
|
86
67
|
getType: () => Schema_1.SchemaType.UNION,
|
|
87
68
|
};
|
|
88
69
|
return Object.assign(Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema)), (0, object_like_1.getObjectLikeUtils)(baseSchema));
|
|
89
70
|
}
|
|
90
|
-
exports.union = union;
|
|
91
71
|
function transformAndValidateUnion({ value, discriminant, transformedDiscriminant, transformDiscriminantValue, getAdditionalPropertiesSchema, allowUnrecognizedUnionMembers = false, transformAdditionalProperties, breadcrumbsPrefix = [], }) {
|
|
92
|
-
|
|
93
|
-
|
|
72
|
+
if (!(0, isPlainObject_1.isPlainObject)(value)) {
|
|
73
|
+
return {
|
|
74
|
+
ok: false,
|
|
75
|
+
errors: [
|
|
76
|
+
{
|
|
77
|
+
path: breadcrumbsPrefix,
|
|
78
|
+
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "object"),
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const _a = value, _b = discriminant, discriminantValue = _a[_b], additionalProperties = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
84
|
+
if (discriminantValue == null) {
|
|
85
|
+
return {
|
|
86
|
+
ok: false,
|
|
87
|
+
errors: [
|
|
88
|
+
{
|
|
89
|
+
path: breadcrumbsPrefix,
|
|
90
|
+
message: `Missing discriminant ("${discriminant}")`,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const transformedDiscriminantValue = transformDiscriminantValue(discriminantValue);
|
|
96
|
+
if (!transformedDiscriminantValue.ok) {
|
|
97
|
+
return {
|
|
98
|
+
ok: false,
|
|
99
|
+
errors: transformedDiscriminantValue.errors,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value);
|
|
103
|
+
if (additionalPropertiesSchema == null) {
|
|
104
|
+
if (allowUnrecognizedUnionMembers) {
|
|
94
105
|
return {
|
|
95
|
-
ok:
|
|
96
|
-
|
|
97
|
-
{
|
|
98
|
-
path: breadcrumbsPrefix,
|
|
99
|
-
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "object"),
|
|
100
|
-
},
|
|
101
|
-
],
|
|
106
|
+
ok: true,
|
|
107
|
+
value: Object.assign({ [transformedDiscriminant]: transformedDiscriminantValue.value }, additionalProperties),
|
|
102
108
|
};
|
|
103
109
|
}
|
|
104
|
-
|
|
105
|
-
if (discriminantValue == null) {
|
|
110
|
+
else {
|
|
106
111
|
return {
|
|
107
112
|
ok: false,
|
|
108
113
|
errors: [
|
|
109
114
|
{
|
|
110
|
-
path: breadcrumbsPrefix,
|
|
111
|
-
message:
|
|
115
|
+
path: [...breadcrumbsPrefix, discriminant],
|
|
116
|
+
message: "Unexpected discriminant value",
|
|
112
117
|
},
|
|
113
118
|
],
|
|
114
119
|
};
|
|
115
120
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (allowUnrecognizedUnionMembers) {
|
|
126
|
-
return {
|
|
127
|
-
ok: true,
|
|
128
|
-
value: Object.assign({ [transformedDiscriminant]: transformedDiscriminantValue.value }, additionalProperties),
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
return {
|
|
133
|
-
ok: false,
|
|
134
|
-
errors: [
|
|
135
|
-
{
|
|
136
|
-
path: [...breadcrumbsPrefix, discriminant],
|
|
137
|
-
message: "Unexpected discriminant value",
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
const transformedAdditionalProperties = yield transformAdditionalProperties(additionalProperties, additionalPropertiesSchema);
|
|
144
|
-
if (!transformedAdditionalProperties.ok) {
|
|
145
|
-
return transformedAdditionalProperties;
|
|
146
|
-
}
|
|
147
|
-
return {
|
|
148
|
-
ok: true,
|
|
149
|
-
value: Object.assign({ [transformedDiscriminant]: discriminantValue }, transformedAdditionalProperties.value),
|
|
150
|
-
};
|
|
151
|
-
});
|
|
121
|
+
}
|
|
122
|
+
const transformedAdditionalProperties = transformAdditionalProperties(additionalProperties, additionalPropertiesSchema);
|
|
123
|
+
if (!transformedAdditionalProperties.ok) {
|
|
124
|
+
return transformedAdditionalProperties;
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
ok: true,
|
|
128
|
+
value: Object.assign({ [transformedDiscriminant]: discriminantValue }, transformedAdditionalProperties.value),
|
|
129
|
+
};
|
|
152
130
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createIdentitySchemaCreator =
|
|
3
|
+
exports.createIdentitySchemaCreator = createIdentitySchemaCreator;
|
|
4
4
|
const schema_utils_1 = require("../builders/schema-utils");
|
|
5
5
|
const maybeSkipValidation_1 = require("./maybeSkipValidation");
|
|
6
6
|
function createIdentitySchemaCreator(schemaType, validate) {
|
|
@@ -13,4 +13,3 @@ function createIdentitySchemaCreator(schemaType, validate) {
|
|
|
13
13
|
return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
exports.createIdentitySchemaCreator = createIdentitySchemaCreator;
|