@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
package/forge/rule.js
DELETED
|
@@ -1,702 +0,0 @@
|
|
|
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 { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Rule = exports.Condition = exports.RuleTest = void 0;
|
|
13
|
-
const types_js_1 = require("./types.js");
|
|
14
|
-
const operators_js_1 = require("./operators.js");
|
|
15
|
-
class RuleTest {
|
|
16
|
-
constructor() {
|
|
17
|
-
this.id = this.generateId();
|
|
18
|
-
this.name = "Untitled Test";
|
|
19
|
-
this.request = {};
|
|
20
|
-
this.response = {};
|
|
21
|
-
this.critical = false;
|
|
22
|
-
this.lastExecuted = null;
|
|
23
|
-
this.testState = null;
|
|
24
|
-
this.error = null;
|
|
25
|
-
this.success = null;
|
|
26
|
-
}
|
|
27
|
-
generateId() {
|
|
28
|
-
return Array.from({ length: 21 }, () => "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[Math.floor(Math.random() * 62)]).join("");
|
|
29
|
-
}
|
|
30
|
-
setName(name) {
|
|
31
|
-
this.name = name;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
expect(request, response) {
|
|
35
|
-
this.request = request;
|
|
36
|
-
this.response = response;
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
isCritical(critical = true) {
|
|
40
|
-
this.critical = critical;
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
toDict() {
|
|
44
|
-
return {
|
|
45
|
-
id: this.id,
|
|
46
|
-
name: this.name,
|
|
47
|
-
request: this.request,
|
|
48
|
-
response: this.response,
|
|
49
|
-
critical: this.critical,
|
|
50
|
-
lastExecuted: this.lastExecuted,
|
|
51
|
-
testState: this.testState,
|
|
52
|
-
error: this.error,
|
|
53
|
-
success: this.success,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
static fromJSON(data) {
|
|
57
|
-
const jsonData = typeof data === "string" ? JSON.parse(data) : data;
|
|
58
|
-
if (typeof jsonData !== "object") {
|
|
59
|
-
throw new Error("Input must be a dictionary or JSON object");
|
|
60
|
-
}
|
|
61
|
-
const test = new RuleTest();
|
|
62
|
-
test.id = jsonData.id || test.generateId();
|
|
63
|
-
test.name = jsonData.name || "Untitled Test";
|
|
64
|
-
test.request = jsonData.request || {};
|
|
65
|
-
test.response = jsonData.response || {};
|
|
66
|
-
test.critical = jsonData.critical || false;
|
|
67
|
-
test.lastExecuted = jsonData.lastExecuted || null;
|
|
68
|
-
test.testState = jsonData.testState || null;
|
|
69
|
-
test.error = jsonData.error || null;
|
|
70
|
-
test.success = jsonData.success || null;
|
|
71
|
-
return test;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.RuleTest = RuleTest;
|
|
75
|
-
class Condition {
|
|
76
|
-
constructor(rule, conditions = {}, index = null, settings = {}) {
|
|
77
|
-
this.rule = rule;
|
|
78
|
-
this.request = {};
|
|
79
|
-
this.response = {};
|
|
80
|
-
this.index = index;
|
|
81
|
-
this.conditions = conditions;
|
|
82
|
-
this.settings = Object.assign({ enabled: true, groupId: null, priority: 0, schedule: [], or: false }, settings);
|
|
83
|
-
}
|
|
84
|
-
// Helper to process dynamic values
|
|
85
|
-
processDynamicValues(arg) {
|
|
86
|
-
if (arg && typeof arg === "object" && arg.$rb) {
|
|
87
|
-
return arg;
|
|
88
|
-
}
|
|
89
|
-
else if (Array.isArray(arg)) {
|
|
90
|
-
return arg.map((item) => this.processDynamicValues(item));
|
|
91
|
-
}
|
|
92
|
-
else if (arg && typeof arg === "object") {
|
|
93
|
-
return Object.entries(arg).reduce((acc, [key, value]) => {
|
|
94
|
-
acc[key] = this.processDynamicValues(value);
|
|
95
|
-
return acc;
|
|
96
|
-
}, {});
|
|
97
|
-
}
|
|
98
|
-
return arg;
|
|
99
|
-
}
|
|
100
|
-
when(conditions) {
|
|
101
|
-
for (const [fieldName, [operator, args]] of Object.entries(conditions)) {
|
|
102
|
-
if (!(fieldName in this.rule.fields)) {
|
|
103
|
-
throw new Error(`Field '${fieldName}' is not defined in request schema`);
|
|
104
|
-
}
|
|
105
|
-
if (this.index !== null) {
|
|
106
|
-
// Editing existing condition
|
|
107
|
-
this.rule.conditions[this.index].request[fieldName] = {
|
|
108
|
-
op: operator,
|
|
109
|
-
args: args.map((arg) => this.processDynamicValues(arg)),
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
// Creating new condition
|
|
114
|
-
this.conditions[fieldName] = [operator, args];
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return this;
|
|
118
|
-
}
|
|
119
|
-
then(responses) {
|
|
120
|
-
for (const [fieldName, value] of Object.entries(responses)) {
|
|
121
|
-
if (!(fieldName in this.rule.responseFields)) {
|
|
122
|
-
throw new Error(`Field '${fieldName}' is not defined in response schema`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (this.index !== null) {
|
|
126
|
-
// Editing existing condition
|
|
127
|
-
for (const [fieldName, value] of Object.entries(responses)) {
|
|
128
|
-
this.rule.conditions[this.index].response[fieldName] = {
|
|
129
|
-
value: this.processDynamicValues(value),
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
return this;
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
// Creating new condition
|
|
136
|
-
this.response = responses;
|
|
137
|
-
const condition = {
|
|
138
|
-
request: {},
|
|
139
|
-
response: {},
|
|
140
|
-
settings: this.settings,
|
|
141
|
-
};
|
|
142
|
-
// Process conditions
|
|
143
|
-
for (const [fieldName, [operator, args]] of Object.entries(this.conditions)) {
|
|
144
|
-
condition.request[fieldName] = {
|
|
145
|
-
op: operator,
|
|
146
|
-
args: args.map((arg) => this.processDynamicValues(arg)),
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
// Process responses
|
|
150
|
-
for (const [fieldName, value] of Object.entries(this.response)) {
|
|
151
|
-
condition.response[fieldName] = {
|
|
152
|
-
value: this.processDynamicValues(value),
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
this.rule.conditions.push(condition);
|
|
156
|
-
return this.rule;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
setPriority(priority) {
|
|
160
|
-
this.settings.priority = priority;
|
|
161
|
-
if (this.index !== null) {
|
|
162
|
-
this.rule.conditions[this.index].settings.priority = priority;
|
|
163
|
-
}
|
|
164
|
-
return this;
|
|
165
|
-
}
|
|
166
|
-
enable() {
|
|
167
|
-
this.settings.enabled = true;
|
|
168
|
-
if (this.index !== null) {
|
|
169
|
-
this.rule.conditions[this.index].settings.enabled = true;
|
|
170
|
-
}
|
|
171
|
-
return this;
|
|
172
|
-
}
|
|
173
|
-
disable() {
|
|
174
|
-
this.settings.enabled = false;
|
|
175
|
-
if (this.index !== null) {
|
|
176
|
-
this.rule.conditions[this.index].settings.enabled = false;
|
|
177
|
-
}
|
|
178
|
-
return this;
|
|
179
|
-
}
|
|
180
|
-
delete() {
|
|
181
|
-
if (this.index !== null) {
|
|
182
|
-
this.rule.conditions.splice(this.index, 1);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
toString() {
|
|
186
|
-
return this.index !== null ? `<Condition: Row ${this.index}>` : "<Condition: New>";
|
|
187
|
-
}
|
|
188
|
-
[Symbol.toStringTag]() {
|
|
189
|
-
return this.toString();
|
|
190
|
-
}
|
|
191
|
-
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
192
|
-
return this.toString();
|
|
193
|
-
}
|
|
194
|
-
toJSON() {
|
|
195
|
-
return {
|
|
196
|
-
request: this.request,
|
|
197
|
-
response: this.response,
|
|
198
|
-
settings: this.settings,
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
exports.Condition = Condition;
|
|
203
|
-
class Rule {
|
|
204
|
-
constructor() {
|
|
205
|
-
this.id = this.generateUUID();
|
|
206
|
-
this.name = "Untitled Rule";
|
|
207
|
-
this.description = "";
|
|
208
|
-
this.folderId = null;
|
|
209
|
-
this.slug = this.generateSlug();
|
|
210
|
-
this.createdAt = new Date().toISOString();
|
|
211
|
-
this.updatedAt = this.createdAt;
|
|
212
|
-
this.updatedBy = "Rulebricks Forge SDK";
|
|
213
|
-
this.published = false;
|
|
214
|
-
this.sampleRequest = {};
|
|
215
|
-
this.sampleResponse = {};
|
|
216
|
-
this.testRequest = {};
|
|
217
|
-
this.testSuite = [];
|
|
218
|
-
this.fields = {};
|
|
219
|
-
this.responseFields = {};
|
|
220
|
-
this.conditions = [];
|
|
221
|
-
this.groups = {};
|
|
222
|
-
this.publishedRequestSchema = null;
|
|
223
|
-
this.publishedResponseSchema = null;
|
|
224
|
-
this.publishedConditions = null;
|
|
225
|
-
this.publishedGroups = {};
|
|
226
|
-
this.history = [];
|
|
227
|
-
this.form = null;
|
|
228
|
-
this.accessGroups = [];
|
|
229
|
-
this.settings = {
|
|
230
|
-
testing: false,
|
|
231
|
-
schemaValidation: false,
|
|
232
|
-
allProperties: false,
|
|
233
|
-
lockSchema: false,
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
generateUUID() {
|
|
237
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
238
|
-
const r = (Math.random() * 16) | 0;
|
|
239
|
-
const v = c === "x" ? r : (r & 0x3) | 0x8;
|
|
240
|
-
return v.toString(16);
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
generateSlug(length = 10) {
|
|
244
|
-
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
245
|
-
return Array.from({ length }, () => chars[Math.floor(Math.random() * chars.length)]).join("");
|
|
246
|
-
}
|
|
247
|
-
getFieldType(field) {
|
|
248
|
-
if (field instanceof operators_js_1.BooleanField)
|
|
249
|
-
return types_js_1.RuleType.BOOLEAN;
|
|
250
|
-
if (field instanceof operators_js_1.NumberField)
|
|
251
|
-
return types_js_1.RuleType.NUMBER;
|
|
252
|
-
if (field instanceof operators_js_1.StringField)
|
|
253
|
-
return types_js_1.RuleType.STRING;
|
|
254
|
-
if (field instanceof operators_js_1.DateField)
|
|
255
|
-
return types_js_1.RuleType.DATE;
|
|
256
|
-
if (field instanceof operators_js_1.ListField)
|
|
257
|
-
return types_js_1.RuleType.LIST;
|
|
258
|
-
return types_js_1.RuleType.STRING; // Default fallback
|
|
259
|
-
}
|
|
260
|
-
setWorkspace(client) {
|
|
261
|
-
this.workspace = client;
|
|
262
|
-
return this;
|
|
263
|
-
}
|
|
264
|
-
setName(name) {
|
|
265
|
-
this.name = name;
|
|
266
|
-
this.slug = this.generateSlug();
|
|
267
|
-
return this;
|
|
268
|
-
}
|
|
269
|
-
setDescription(description) {
|
|
270
|
-
this.description = description;
|
|
271
|
-
return this;
|
|
272
|
-
}
|
|
273
|
-
setFolder(folderName, createIfMissing = false) {
|
|
274
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
275
|
-
if (!this.workspace) {
|
|
276
|
-
throw new Error("A Rulebricks client is required to set a folder by name");
|
|
277
|
-
}
|
|
278
|
-
const folders = yield this.workspace.assets.listFolders();
|
|
279
|
-
let folder = folders.find((f) => f.name === folderName);
|
|
280
|
-
if (!folder && createIfMissing) {
|
|
281
|
-
if (folders.some((f) => f.name === folderName)) {
|
|
282
|
-
throw new Error("Folder name conflicts with an existing folder");
|
|
283
|
-
}
|
|
284
|
-
folder = yield this.workspace.assets.upsertFolder({ name: folderName });
|
|
285
|
-
}
|
|
286
|
-
if (!folder) {
|
|
287
|
-
throw new Error(`Folder '${folderName}' not found and createIfMissing is false`);
|
|
288
|
-
}
|
|
289
|
-
this.folderId = folder.id || null;
|
|
290
|
-
return this;
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
setFolderById(folderId) {
|
|
294
|
-
this.folderId = folderId;
|
|
295
|
-
return this;
|
|
296
|
-
}
|
|
297
|
-
setAlias(alias) {
|
|
298
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
299
|
-
if (!this.workspace) {
|
|
300
|
-
throw new Error("A Rulebricks client is required to set an alias");
|
|
301
|
-
}
|
|
302
|
-
if (alias.length < 3) {
|
|
303
|
-
throw new Error("Alias must be at least 3 characters long");
|
|
304
|
-
}
|
|
305
|
-
if (alias.includes("/") || alias.includes("\\") || alias.includes(" ")) {
|
|
306
|
-
throw new Error("Alias cannot contain slashes or spaces");
|
|
307
|
-
}
|
|
308
|
-
const validChars = /^[a-zA-Z0-9\-_]+$/;
|
|
309
|
-
if (!validChars.test(alias)) {
|
|
310
|
-
throw new Error("Alias cannot contain special characters");
|
|
311
|
-
}
|
|
312
|
-
const rules = yield this.workspace.assets.listRules();
|
|
313
|
-
if (rules.some((r) => r.slug === alias)) {
|
|
314
|
-
throw new Error("Alias conflicts with an existing rule");
|
|
315
|
-
}
|
|
316
|
-
this.slug = alias;
|
|
317
|
-
return this;
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
addBooleanField(name, description = "", defaultValue = false) {
|
|
321
|
-
const field = new operators_js_1.BooleanField(name, description, defaultValue);
|
|
322
|
-
this.fields[name] = field;
|
|
323
|
-
return field;
|
|
324
|
-
}
|
|
325
|
-
addNumberField(name, description = "", defaultValue = 0) {
|
|
326
|
-
const field = new operators_js_1.NumberField(name, description, defaultValue);
|
|
327
|
-
this.fields[name] = field;
|
|
328
|
-
return field;
|
|
329
|
-
}
|
|
330
|
-
addStringField(name, description = "", defaultValue = "") {
|
|
331
|
-
const field = new operators_js_1.StringField(name, description, defaultValue);
|
|
332
|
-
this.fields[name] = field;
|
|
333
|
-
return field;
|
|
334
|
-
}
|
|
335
|
-
addDateField(name, description = "", defaultValue) {
|
|
336
|
-
const field = new operators_js_1.DateField(name, description, defaultValue);
|
|
337
|
-
this.fields[name] = field;
|
|
338
|
-
return field;
|
|
339
|
-
}
|
|
340
|
-
addListField(name, description = "", defaultValue = []) {
|
|
341
|
-
const field = new operators_js_1.ListField(name, description, defaultValue);
|
|
342
|
-
this.fields[name] = field;
|
|
343
|
-
return field;
|
|
344
|
-
}
|
|
345
|
-
enableContinuousTesting(enabled = true) {
|
|
346
|
-
this.settings.testing = enabled;
|
|
347
|
-
return this;
|
|
348
|
-
}
|
|
349
|
-
enableSchemaValidation(enabled = true) {
|
|
350
|
-
this.settings.schemaValidation = enabled;
|
|
351
|
-
return this;
|
|
352
|
-
}
|
|
353
|
-
requireAllProperties(enabled = true) {
|
|
354
|
-
this.settings.allProperties = enabled;
|
|
355
|
-
return this;
|
|
356
|
-
}
|
|
357
|
-
lockSchema(enabled = true) {
|
|
358
|
-
this.settings.lockSchema = enabled;
|
|
359
|
-
return this;
|
|
360
|
-
}
|
|
361
|
-
addAccessGroup(groupName, createIfMissing = false) {
|
|
362
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
363
|
-
if (!this.workspace) {
|
|
364
|
-
throw new Error("A Rulebricks client is required to manage access groups");
|
|
365
|
-
}
|
|
366
|
-
const existingGroups = yield this.workspace.users.listGroups();
|
|
367
|
-
let group = existingGroups.find((g) => g.name === groupName);
|
|
368
|
-
if (!group && !createIfMissing) {
|
|
369
|
-
throw new Error(`User group '${groupName}' not found and createIfMissing is False`);
|
|
370
|
-
}
|
|
371
|
-
if (!group && createIfMissing) {
|
|
372
|
-
group = yield this.workspace.users.createGroup({ name: groupName });
|
|
373
|
-
}
|
|
374
|
-
if (!this.accessGroups.includes(groupName)) {
|
|
375
|
-
this.accessGroups.push(groupName);
|
|
376
|
-
}
|
|
377
|
-
return this;
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
removeAccessGroup(groupName) {
|
|
381
|
-
const index = this.accessGroups.indexOf(groupName);
|
|
382
|
-
if (index !== -1) {
|
|
383
|
-
this.accessGroups.splice(index, 1);
|
|
384
|
-
}
|
|
385
|
-
return this;
|
|
386
|
-
}
|
|
387
|
-
addBooleanResponse(name, description = "", defaultValue = false) {
|
|
388
|
-
const field = new operators_js_1.BooleanField(name, description, defaultValue);
|
|
389
|
-
this.responseFields[name] = field;
|
|
390
|
-
return field;
|
|
391
|
-
}
|
|
392
|
-
addNumberResponse(name, description = "", defaultValue = 0) {
|
|
393
|
-
const field = new operators_js_1.NumberField(name, description, defaultValue);
|
|
394
|
-
this.responseFields[name] = field;
|
|
395
|
-
return field;
|
|
396
|
-
}
|
|
397
|
-
addStringResponse(name, description = "", defaultValue = "") {
|
|
398
|
-
const field = new operators_js_1.StringField(name, description, defaultValue);
|
|
399
|
-
this.responseFields[name] = field;
|
|
400
|
-
return field;
|
|
401
|
-
}
|
|
402
|
-
addDateResponse(name, description = "", defaultValue) {
|
|
403
|
-
const field = new operators_js_1.DateField(name, description, defaultValue);
|
|
404
|
-
this.responseFields[name] = field;
|
|
405
|
-
return field;
|
|
406
|
-
}
|
|
407
|
-
addListResponse(name, description = "", defaultValue = []) {
|
|
408
|
-
const field = new operators_js_1.ListField(name, description, defaultValue);
|
|
409
|
-
this.responseFields[name] = field;
|
|
410
|
-
return field;
|
|
411
|
-
}
|
|
412
|
-
findConditions(conditions) {
|
|
413
|
-
return this.conditions
|
|
414
|
-
.map((condition, index) => {
|
|
415
|
-
let matchesAll = Object.entries(conditions).every(([field, [operator, args]]) => {
|
|
416
|
-
const request = condition.request[field];
|
|
417
|
-
if (!request)
|
|
418
|
-
return false;
|
|
419
|
-
if (request.op !== operator)
|
|
420
|
-
return false;
|
|
421
|
-
// Handle dynamic values
|
|
422
|
-
const requestArgs = request.args.map((arg) => typeof arg === "object" && arg.$rb ? arg.name.toUpperCase() : String(arg));
|
|
423
|
-
const searchArgs = args.map((arg) => typeof arg === "object" && arg.$rb ? arg.name.toUpperCase() : String(arg));
|
|
424
|
-
return JSON.stringify(requestArgs) === JSON.stringify(searchArgs);
|
|
425
|
-
});
|
|
426
|
-
if (matchesAll) {
|
|
427
|
-
const convertedRequest = {};
|
|
428
|
-
for (const [field, value] of Object.entries(condition.request)) {
|
|
429
|
-
convertedRequest[field] = [value.op, value.args];
|
|
430
|
-
}
|
|
431
|
-
return new Condition(this, convertedRequest, index, condition.settings);
|
|
432
|
-
}
|
|
433
|
-
return null;
|
|
434
|
-
})
|
|
435
|
-
.filter((condition) => condition !== null);
|
|
436
|
-
}
|
|
437
|
-
// Helper method to get proper field instances
|
|
438
|
-
getField(name, type) {
|
|
439
|
-
const field = this.fields[name];
|
|
440
|
-
if (!field) {
|
|
441
|
-
throw new Error(`Field '${name}' not found in request schema`);
|
|
442
|
-
}
|
|
443
|
-
const expectedType = this.getFieldType(field);
|
|
444
|
-
if (expectedType !== type) {
|
|
445
|
-
throw new Error(`Field '${name}' is not a ${type.toLowerCase()} field`);
|
|
446
|
-
}
|
|
447
|
-
return field;
|
|
448
|
-
}
|
|
449
|
-
getBooleanField(name) {
|
|
450
|
-
return this.getField(name, types_js_1.RuleType.BOOLEAN);
|
|
451
|
-
}
|
|
452
|
-
getNumberField(name) {
|
|
453
|
-
return this.getField(name, types_js_1.RuleType.NUMBER);
|
|
454
|
-
}
|
|
455
|
-
getStringField(name) {
|
|
456
|
-
return this.getField(name, types_js_1.RuleType.STRING);
|
|
457
|
-
}
|
|
458
|
-
getDateField(name) {
|
|
459
|
-
return this.getField(name, types_js_1.RuleType.DATE);
|
|
460
|
-
}
|
|
461
|
-
getListField(name) {
|
|
462
|
-
return this.getField(name, types_js_1.RuleType.LIST);
|
|
463
|
-
}
|
|
464
|
-
when(conditions = {}) {
|
|
465
|
-
const condition = new Condition(this, conditions);
|
|
466
|
-
return condition;
|
|
467
|
-
}
|
|
468
|
-
any(conditions) {
|
|
469
|
-
const condition = new Condition(this, conditions, null, { or: true });
|
|
470
|
-
return condition;
|
|
471
|
-
}
|
|
472
|
-
getConditions() {
|
|
473
|
-
return this.conditions;
|
|
474
|
-
}
|
|
475
|
-
getConditionCount() {
|
|
476
|
-
return this.conditions.length;
|
|
477
|
-
}
|
|
478
|
-
addTest(test) {
|
|
479
|
-
const existingTest = this.findTestById(test.id);
|
|
480
|
-
if (existingTest) {
|
|
481
|
-
Object.assign(existingTest, {
|
|
482
|
-
name: test.name,
|
|
483
|
-
request: test.request,
|
|
484
|
-
response: test.response,
|
|
485
|
-
critical: test.critical,
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
else {
|
|
489
|
-
this.testSuite.push(test);
|
|
490
|
-
}
|
|
491
|
-
return this;
|
|
492
|
-
}
|
|
493
|
-
removeTest(testId) {
|
|
494
|
-
this.testSuite = this.testSuite.filter((t) => t.id !== testId);
|
|
495
|
-
return this;
|
|
496
|
-
}
|
|
497
|
-
findTestById(testId) {
|
|
498
|
-
return this.testSuite.find((t) => t.id === testId);
|
|
499
|
-
}
|
|
500
|
-
findTestByName(name) {
|
|
501
|
-
return this.testSuite.find((t) => t.name === name);
|
|
502
|
-
}
|
|
503
|
-
update() {
|
|
504
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
505
|
-
if (!this.workspace) {
|
|
506
|
-
throw new Error("Workspace not set. Call setWorkspace() before updating the rule.");
|
|
507
|
-
}
|
|
508
|
-
const ruleData = this.toDict();
|
|
509
|
-
yield this.workspace.assets.importRule({ rule: ruleData });
|
|
510
|
-
return this;
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
publish() {
|
|
514
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
515
|
-
if (!this.workspace) {
|
|
516
|
-
throw new Error("A Rulebricks client is required to publish a rule");
|
|
517
|
-
}
|
|
518
|
-
const ruleData = this.toDict();
|
|
519
|
-
ruleData._publish = true;
|
|
520
|
-
yield this.workspace.assets.importRule({ rule: ruleData });
|
|
521
|
-
return this;
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
fromWorkspace(ruleId) {
|
|
525
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
526
|
-
if (!this.workspace) {
|
|
527
|
-
throw new Error("A Rulebricks client is required to load a rule from the workspace");
|
|
528
|
-
}
|
|
529
|
-
const ruleData = yield this.workspace.assets.exportRule({ id: ruleId });
|
|
530
|
-
const rule = Rule.fromJSON(ruleData);
|
|
531
|
-
Object.assign(this, rule);
|
|
532
|
-
return this;
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
|
-
toDict() {
|
|
536
|
-
let sampleRequest = this.sampleRequest || {};
|
|
537
|
-
let sampleResponse = this.sampleResponse || {};
|
|
538
|
-
for (const [name, field] of Object.entries(this.fields)) {
|
|
539
|
-
const parts = name.split(".");
|
|
540
|
-
let current = sampleRequest;
|
|
541
|
-
for (const part of parts.slice(0, -1)) {
|
|
542
|
-
current = current[part] = current[part] || {};
|
|
543
|
-
}
|
|
544
|
-
current[parts[parts.length - 1]] = field.defaultValue;
|
|
545
|
-
}
|
|
546
|
-
for (const [name, field] of Object.entries(this.responseFields)) {
|
|
547
|
-
const parts = name.split(".");
|
|
548
|
-
let current = sampleResponse;
|
|
549
|
-
for (const part of parts.slice(0, -1)) {
|
|
550
|
-
current = current[part] = current[part] || {};
|
|
551
|
-
}
|
|
552
|
-
current[parts[parts.length - 1]] = field.defaultValue;
|
|
553
|
-
}
|
|
554
|
-
const caseAndSpace = (str) => {
|
|
555
|
-
let titleCase = str.replace(/\w\S*/g, (text) => text.charAt(0).toUpperCase() + text.substring(1).toLowerCase());
|
|
556
|
-
// Replace underscores and any special characters with spaces
|
|
557
|
-
return titleCase.replace(/_/g, " ").replace(/[^a-zA-Z0-9 ]/g, "");
|
|
558
|
-
};
|
|
559
|
-
const fields = Object.entries(this.fields).map(([name, field]) => ({
|
|
560
|
-
name: caseAndSpace(name),
|
|
561
|
-
key: field.key || name,
|
|
562
|
-
type: field.type,
|
|
563
|
-
description: field.description,
|
|
564
|
-
defaultValue: field.defaultValue,
|
|
565
|
-
show: true,
|
|
566
|
-
}));
|
|
567
|
-
const responseFields = Object.entries(this.responseFields).map(([name, field]) => ({
|
|
568
|
-
name: caseAndSpace(name),
|
|
569
|
-
key: field.key || name,
|
|
570
|
-
type: field.type,
|
|
571
|
-
description: field.description,
|
|
572
|
-
defaultValue: field.defaultValue,
|
|
573
|
-
show: true,
|
|
574
|
-
}));
|
|
575
|
-
return {
|
|
576
|
-
id: this.id,
|
|
577
|
-
name: this.name,
|
|
578
|
-
description: this.description,
|
|
579
|
-
tag: this.folderId,
|
|
580
|
-
slug: this.slug,
|
|
581
|
-
createdAt: this.createdAt,
|
|
582
|
-
updatedAt: this.updatedAt,
|
|
583
|
-
updatedBy: this.updatedBy,
|
|
584
|
-
settings: this.settings,
|
|
585
|
-
accessGroups: this.accessGroups,
|
|
586
|
-
requestSchema: fields,
|
|
587
|
-
responseSchema: responseFields,
|
|
588
|
-
conditions: this.conditions,
|
|
589
|
-
testSuite: this.testSuite.map((test) => test.toDict()),
|
|
590
|
-
published_requestSchema: this.publishedRequestSchema,
|
|
591
|
-
published_responseSchema: this.publishedResponseSchema,
|
|
592
|
-
published_conditions: this.publishedConditions,
|
|
593
|
-
published_groups: this.publishedGroups,
|
|
594
|
-
form: this.form,
|
|
595
|
-
history: this.history,
|
|
596
|
-
published: this.published,
|
|
597
|
-
sampleRequest: sampleRequest,
|
|
598
|
-
sampleResponse: sampleResponse,
|
|
599
|
-
testRequest: this.testRequest,
|
|
600
|
-
groups: this.groups,
|
|
601
|
-
no_conditions: this.conditions.length,
|
|
602
|
-
};
|
|
603
|
-
}
|
|
604
|
-
toJSON() {
|
|
605
|
-
return JSON.stringify(this.toDict(), (_, value) => {
|
|
606
|
-
if (value instanceof Date) {
|
|
607
|
-
return value.toISOString();
|
|
608
|
-
}
|
|
609
|
-
return value;
|
|
610
|
-
}, 2);
|
|
611
|
-
}
|
|
612
|
-
static fromJSON(data) {
|
|
613
|
-
const jsonData = typeof data === "string" ? JSON.parse(data) : data;
|
|
614
|
-
const rule = new Rule();
|
|
615
|
-
rule.id = jsonData.id;
|
|
616
|
-
rule.name = jsonData.name;
|
|
617
|
-
rule.description = jsonData.description;
|
|
618
|
-
rule.folderId = jsonData.tag;
|
|
619
|
-
rule.slug = jsonData.slug;
|
|
620
|
-
rule.createdAt = jsonData.createdAt;
|
|
621
|
-
rule.updatedAt = jsonData.updatedAt;
|
|
622
|
-
rule.updatedBy = jsonData.updatedBy;
|
|
623
|
-
rule.settings = jsonData.settings;
|
|
624
|
-
rule.accessGroups = jsonData.accessGroups;
|
|
625
|
-
rule.conditions = jsonData.conditions;
|
|
626
|
-
rule.publishedRequestSchema = jsonData.publishedRequestSchema || null;
|
|
627
|
-
rule.publishedResponseSchema = jsonData.publishedResponseSchema || null;
|
|
628
|
-
rule.publishedConditions = jsonData.publishedConditions || null;
|
|
629
|
-
rule.publishedGroups = jsonData.publishedGroups || {};
|
|
630
|
-
rule.form = jsonData.form || null;
|
|
631
|
-
rule.history = jsonData.history || [];
|
|
632
|
-
rule.published = jsonData.published;
|
|
633
|
-
rule.testRequest = jsonData.testRequest || {};
|
|
634
|
-
rule.groups = jsonData.groups || {};
|
|
635
|
-
const caseAndSpace = (str) => {
|
|
636
|
-
let titleCase = str.replace(/\w\S*/g, (text) => text.charAt(0).toUpperCase() + text.substring(1).toLowerCase());
|
|
637
|
-
// Replace underscores and any special characters with spaces
|
|
638
|
-
return titleCase.replace(/_/g, " ").replace(/[^a-zA-Z0-9 ]/g, "");
|
|
639
|
-
};
|
|
640
|
-
// Convert request schema to fields
|
|
641
|
-
jsonData.requestSchema.forEach((fieldData) => {
|
|
642
|
-
const field = {
|
|
643
|
-
key: fieldData.key,
|
|
644
|
-
// start case and replace underscores and any special characters with spaces
|
|
645
|
-
name: fieldData.name || caseAndSpace(fieldData.key),
|
|
646
|
-
type: fieldData.type,
|
|
647
|
-
description: fieldData.description,
|
|
648
|
-
defaultValue: fieldData.defaultValue,
|
|
649
|
-
operators: {},
|
|
650
|
-
};
|
|
651
|
-
rule.fields[fieldData.name] = field;
|
|
652
|
-
});
|
|
653
|
-
// Convert response schema to fields
|
|
654
|
-
jsonData.responseSchema.forEach((fieldData) => {
|
|
655
|
-
const field = {
|
|
656
|
-
key: fieldData.key,
|
|
657
|
-
name: fieldData.name || caseAndSpace(fieldData.key),
|
|
658
|
-
type: fieldData.type,
|
|
659
|
-
description: fieldData.description,
|
|
660
|
-
defaultValue: fieldData.defaultValue,
|
|
661
|
-
operators: {},
|
|
662
|
-
};
|
|
663
|
-
rule.responseFields[fieldData.name] = field;
|
|
664
|
-
});
|
|
665
|
-
// Convert test suite
|
|
666
|
-
rule.testSuite = (jsonData.testSuite || []).map((testData) => RuleTest.fromJSON(testData));
|
|
667
|
-
return rule;
|
|
668
|
-
}
|
|
669
|
-
getEditorUrl() {
|
|
670
|
-
if (!this.workspace) {
|
|
671
|
-
throw new Error("Workspace not configured. Call setWorkspace() first.");
|
|
672
|
-
}
|
|
673
|
-
return `https://rulebricks.com/dashboard/${this.id}`;
|
|
674
|
-
}
|
|
675
|
-
toTable() {
|
|
676
|
-
const header = ["Condition", ...Object.keys(this.fields), "Response"];
|
|
677
|
-
const rows = [];
|
|
678
|
-
this.conditions.forEach((condition, index) => {
|
|
679
|
-
const row = [`#${index + 1}`];
|
|
680
|
-
// Add request conditions
|
|
681
|
-
Object.keys(this.fields).forEach((fieldName) => {
|
|
682
|
-
const cond = condition.request[fieldName];
|
|
683
|
-
row.push(cond ? `${cond.op} ${cond.args.join(", ")}` : "-");
|
|
684
|
-
});
|
|
685
|
-
// Add response
|
|
686
|
-
const responseStr = Object.entries(condition.response)
|
|
687
|
-
.map(([key, value]) => `${key}: ${value.value}`)
|
|
688
|
-
.join(", ");
|
|
689
|
-
row.push(responseStr || "-");
|
|
690
|
-
rows.push(row);
|
|
691
|
-
});
|
|
692
|
-
// Format as ASCII table
|
|
693
|
-
const maxLengths = header.map((_, colIndex) => Math.max(header[colIndex].length, ...rows.map((row) => row[colIndex].length)));
|
|
694
|
-
const separator = maxLengths.map((len) => "-".repeat(len)).join("-+-");
|
|
695
|
-
const formatRow = (row) => row.map((cell, i) => cell.padEnd(maxLengths[i])).join(" | ");
|
|
696
|
-
return [formatRow(header), separator, ...rows.map(formatRow)].join("\n");
|
|
697
|
-
}
|
|
698
|
-
toString() {
|
|
699
|
-
return `Rule(name="${this.name}", id="${this.id}", conditions=${this.conditions.length})`;
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
exports.Rule = Rule;
|