@rulebricks/sdk 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +12 -11
- package/Client.js +15 -15
- package/api/errors/BadRequestError.d.ts +1 -1
- package/api/errors/BadRequestError.js +1 -1
- package/api/errors/ForbiddenError.d.ts +3 -3
- package/api/errors/ForbiddenError.js +1 -1
- package/api/errors/InternalServerError.d.ts +1 -1
- package/api/errors/InternalServerError.js +1 -1
- package/api/errors/NotFoundError.d.ts +1 -1
- package/api/errors/NotFoundError.js +1 -1
- package/api/resources/assets/client/Client.d.ts +13 -120
- package/api/resources/assets/client/Client.js +17 -526
- package/api/resources/assets/client/index.d.ts +1 -1
- package/api/resources/assets/client/index.js +0 -15
- package/api/resources/assets/index.d.ts +1 -0
- package/api/resources/assets/index.js +1 -0
- package/api/resources/assets/resources/flows/client/Client.d.ts +42 -0
- package/api/resources/assets/resources/flows/client/Client.js +116 -0
- package/api/resources/assets/resources/flows/client/index.d.ts +1 -0
- package/api/resources/assets/resources/flows/index.d.ts +1 -0
- package/api/resources/assets/resources/flows/index.js +17 -0
- package/api/resources/assets/resources/folders/client/Client.d.ts +74 -0
- package/api/resources/assets/resources/folders/client/Client.js +248 -0
- package/api/resources/assets/resources/folders/client/requests/index.d.ts +2 -0
- package/api/resources/assets/resources/folders/index.d.ts +1 -0
- package/api/resources/assets/resources/folders/index.js +17 -0
- package/api/resources/assets/resources/index.d.ts +5 -0
- package/api/resources/assets/resources/index.js +34 -0
- package/api/resources/assets/resources/rules/client/Client.d.ts +94 -0
- package/api/resources/assets/resources/rules/client/Client.js +337 -0
- package/{dist/api/resources/assets/client/requests/ListRulesRequest.d.ts → api/resources/assets/resources/rules/client/requests/RulesListRequest.d.ts} +1 -1
- package/{dist/api/resources/assets/client/requests/ExportRuleRequest.d.ts → api/resources/assets/resources/rules/client/requests/RulesPullRequest.d.ts} +1 -1
- package/api/resources/assets/resources/rules/client/requests/index.d.ts +4 -0
- package/api/resources/assets/resources/rules/client/requests/index.js +2 -0
- package/api/resources/assets/resources/rules/index.d.ts +1 -0
- package/api/resources/assets/resources/rules/index.js +17 -0
- package/api/resources/decisions/client/Client.d.ts +8 -7
- package/api/resources/decisions/client/Client.js +15 -14
- package/{dist/api/resources/decisions/client/requests/QueryDecisionsRequest.d.ts → api/resources/decisions/client/requests/DecisionsQueryRequest.d.ts} +1 -1
- package/api/resources/decisions/client/requests/index.d.ts +1 -1
- package/api/resources/flows/client/Client.d.ts +8 -7
- package/api/resources/flows/client/Client.js +15 -14
- package/api/resources/index.d.ts +0 -1
- package/api/resources/index.js +0 -1
- package/api/resources/rules/client/Client.d.ts +15 -14
- package/api/resources/rules/client/Client.js +35 -34
- package/api/resources/tests/client/Client.d.ts +8 -120
- package/api/resources/tests/client/Client.js +6 -441
- package/api/resources/tests/index.d.ts +1 -0
- package/api/resources/tests/index.js +1 -0
- package/api/resources/tests/resources/flows/client/Client.d.ts +82 -0
- package/api/resources/tests/resources/flows/client/Client.js +257 -0
- package/api/resources/tests/resources/flows/client/index.d.ts +1 -0
- package/api/resources/tests/resources/flows/client/index.js +2 -0
- package/api/resources/tests/resources/flows/index.d.ts +1 -0
- package/api/resources/tests/resources/flows/index.js +17 -0
- package/api/resources/tests/resources/index.d.ts +2 -0
- package/api/resources/tests/resources/index.js +28 -0
- package/api/resources/tests/resources/rules/client/Client.d.ts +82 -0
- package/api/resources/tests/resources/rules/client/Client.js +257 -0
- package/api/resources/tests/resources/rules/client/index.d.ts +1 -0
- package/api/resources/tests/resources/rules/client/index.js +2 -0
- package/api/resources/tests/resources/rules/index.d.ts +1 -0
- package/api/resources/tests/resources/rules/index.js +17 -0
- package/api/resources/users/client/Client.d.ts +12 -35
- package/api/resources/users/client/Client.js +21 -137
- package/api/resources/users/client/requests/UserInviteRequest.d.ts +2 -2
- package/api/resources/users/client/requests/index.d.ts +0 -1
- package/api/resources/users/index.d.ts +1 -0
- package/api/resources/users/index.js +1 -0
- package/api/resources/users/resources/groups/client/Client.d.ts +58 -0
- package/api/resources/users/resources/groups/client/Client.js +181 -0
- package/api/resources/users/resources/groups/client/index.d.ts +1 -0
- package/api/resources/users/resources/groups/client/index.js +17 -0
- package/api/resources/users/resources/groups/client/requests/index.d.ts +1 -0
- package/api/resources/users/resources/groups/client/requests/index.js +2 -0
- package/api/resources/users/resources/groups/index.d.ts +1 -0
- package/api/resources/users/resources/groups/index.js +17 -0
- package/api/resources/users/resources/index.d.ts +2 -0
- package/api/resources/users/resources/index.js +31 -0
- package/api/resources/values/client/Client.d.ts +18 -17
- package/api/resources/values/client/Client.js +41 -40
- package/api/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -2
- package/{dist/api/resources/values/client/requests/DeleteDynamicValueRequest.d.ts → api/resources/values/client/requests/ValuesDeleteRequest.d.ts} +1 -1
- package/{dist/api/resources/values/client/requests/ListDynamicValuesRequest.d.ts → api/resources/values/client/requests/ValuesListRequest.d.ts} +2 -2
- package/api/resources/values/client/requests/index.d.ts +2 -2
- package/api/types/BooleanValue.d.ts +2 -2
- package/api/types/BulkRuleResponseItem.d.ts +2 -2
- package/api/types/DecisionLog.d.ts +4 -4
- package/api/types/DecisionLogDecision.d.ts +2 -2
- package/api/types/DecisionLogResponse.d.ts +2 -2
- package/api/types/DynamicValue.d.ts +6 -6
- package/api/types/DynamicValueBase.d.ts +2 -2
- package/api/types/DynamicValueListResponse.d.ts +2 -2
- package/api/types/FlowDetail.d.ts +2 -2
- package/api/types/FlowListResponse.d.ts +2 -2
- package/api/types/FolderListResponse.d.ts +2 -2
- package/api/types/ListValue.d.ts +3 -3
- package/api/types/ListValueValueItem.d.ts +4 -0
- package/api/types/NumberValue.d.ts +2 -2
- package/api/types/ParallelSolveRequest.d.ts +2 -2
- package/api/types/ParallelSolveResponse.d.ts +2 -2
- package/api/types/RuleDetail.d.ts +5 -5
- package/api/types/RuleListResponse.d.ts +2 -2
- package/api/types/SchemaField.d.ts +3 -3
- package/api/types/StringValue.d.ts +2 -2
- package/api/types/Test.d.ts +2 -2
- package/api/types/TestListResponse.d.ts +2 -2
- package/api/types/TestTestState.d.ts +3 -3
- package/api/types/UserGroupListResponse.d.ts +2 -2
- package/api/types/UserInviteResponse.d.ts +2 -2
- package/api/types/index.d.ts +1 -0
- package/api/types/index.js +1 -0
- package/dist/Client.d.ts +12 -11
- package/dist/Client.js +15 -15
- package/dist/api/errors/BadRequestError.d.ts +1 -1
- package/dist/api/errors/BadRequestError.js +1 -1
- package/dist/api/errors/ForbiddenError.d.ts +3 -3
- package/dist/api/errors/ForbiddenError.js +1 -1
- package/dist/api/errors/InternalServerError.d.ts +1 -1
- package/dist/api/errors/InternalServerError.js +1 -1
- package/dist/api/errors/NotFoundError.d.ts +1 -1
- package/dist/api/errors/NotFoundError.js +1 -1
- package/dist/api/resources/assets/client/Client.d.ts +13 -120
- package/dist/api/resources/assets/client/Client.js +17 -526
- package/dist/api/resources/assets/client/index.d.ts +1 -1
- package/dist/api/resources/assets/client/index.js +0 -15
- package/dist/api/resources/assets/index.d.ts +1 -0
- package/dist/api/resources/assets/index.js +1 -0
- package/dist/api/resources/assets/resources/flows/client/Client.d.ts +42 -0
- package/dist/api/resources/assets/resources/flows/client/Client.js +116 -0
- package/dist/api/resources/assets/resources/flows/client/index.d.ts +1 -0
- package/dist/api/resources/assets/resources/flows/client/index.js +2 -0
- package/dist/api/resources/assets/resources/flows/index.d.ts +1 -0
- package/dist/api/resources/assets/resources/flows/index.js +17 -0
- package/dist/api/resources/assets/resources/folders/client/Client.d.ts +74 -0
- package/dist/api/resources/assets/resources/folders/client/Client.js +248 -0
- package/dist/api/resources/assets/resources/folders/client/index.d.ts +1 -0
- package/dist/api/resources/assets/resources/folders/client/index.js +17 -0
- package/dist/api/resources/assets/resources/folders/client/requests/index.d.ts +2 -0
- package/dist/api/resources/assets/resources/folders/client/requests/index.js +2 -0
- package/dist/api/resources/assets/resources/folders/index.d.ts +1 -0
- package/dist/api/resources/assets/resources/folders/index.js +17 -0
- package/dist/api/resources/assets/resources/index.d.ts +5 -0
- package/dist/api/resources/assets/resources/index.js +34 -0
- package/dist/api/resources/assets/resources/rules/client/Client.d.ts +94 -0
- package/dist/api/resources/assets/resources/rules/client/Client.js +337 -0
- package/dist/api/resources/assets/resources/rules/client/index.d.ts +1 -0
- package/dist/api/resources/assets/resources/rules/client/index.js +17 -0
- package/{api/resources/assets/client/requests/ListRulesRequest.d.ts → dist/api/resources/assets/resources/rules/client/requests/RulesListRequest.d.ts} +1 -1
- package/{api/resources/assets/client/requests/ExportRuleRequest.d.ts → dist/api/resources/assets/resources/rules/client/requests/RulesPullRequest.d.ts} +1 -1
- package/dist/api/resources/assets/resources/rules/client/requests/index.d.ts +4 -0
- package/dist/api/resources/assets/resources/rules/client/requests/index.js +2 -0
- package/dist/api/resources/assets/resources/rules/index.d.ts +1 -0
- package/dist/api/resources/assets/resources/rules/index.js +17 -0
- package/dist/api/resources/decisions/client/Client.d.ts +8 -7
- package/dist/api/resources/decisions/client/Client.js +15 -14
- package/{api/resources/decisions/client/requests/QueryDecisionsRequest.d.ts → dist/api/resources/decisions/client/requests/DecisionsQueryRequest.d.ts} +1 -1
- package/dist/api/resources/decisions/client/requests/index.d.ts +1 -1
- package/dist/api/resources/flows/client/Client.d.ts +8 -7
- package/dist/api/resources/flows/client/Client.js +15 -14
- package/dist/api/resources/index.d.ts +0 -1
- package/dist/api/resources/index.js +0 -1
- package/dist/api/resources/rules/client/Client.d.ts +15 -14
- package/dist/api/resources/rules/client/Client.js +35 -34
- package/dist/api/resources/tests/client/Client.d.ts +8 -120
- package/dist/api/resources/tests/client/Client.js +6 -441
- package/dist/api/resources/tests/index.d.ts +1 -0
- package/dist/api/resources/tests/index.js +1 -0
- package/dist/api/resources/tests/resources/flows/client/Client.d.ts +82 -0
- package/dist/api/resources/tests/resources/flows/client/Client.js +257 -0
- package/dist/api/resources/tests/resources/flows/client/index.d.ts +1 -0
- package/dist/api/resources/tests/resources/flows/client/index.js +2 -0
- package/dist/api/resources/tests/resources/flows/index.d.ts +1 -0
- package/dist/api/resources/tests/resources/flows/index.js +17 -0
- package/dist/api/resources/tests/resources/index.d.ts +2 -0
- package/dist/api/resources/tests/resources/index.js +28 -0
- package/dist/api/resources/tests/resources/rules/client/Client.d.ts +82 -0
- package/dist/api/resources/tests/resources/rules/client/Client.js +257 -0
- package/dist/api/resources/tests/resources/rules/client/index.d.ts +1 -0
- package/dist/api/resources/tests/resources/rules/client/index.js +2 -0
- package/dist/api/resources/tests/resources/rules/index.d.ts +1 -0
- package/dist/api/resources/tests/resources/rules/index.js +17 -0
- package/dist/api/resources/users/client/Client.d.ts +12 -35
- package/dist/api/resources/users/client/Client.js +21 -137
- package/dist/api/resources/users/client/requests/UserInviteRequest.d.ts +2 -2
- package/dist/api/resources/users/client/requests/index.d.ts +0 -1
- package/dist/api/resources/users/index.d.ts +1 -0
- package/dist/api/resources/users/index.js +1 -0
- package/dist/api/resources/users/resources/groups/client/Client.d.ts +58 -0
- package/dist/api/resources/users/resources/groups/client/Client.js +181 -0
- package/dist/api/resources/users/resources/groups/client/index.d.ts +1 -0
- package/dist/api/resources/users/resources/groups/client/index.js +17 -0
- package/dist/api/resources/users/resources/groups/client/requests/index.d.ts +1 -0
- package/dist/api/resources/users/resources/groups/client/requests/index.js +2 -0
- package/dist/api/resources/users/resources/groups/index.d.ts +1 -0
- package/dist/api/resources/users/resources/groups/index.js +17 -0
- package/dist/api/resources/users/resources/index.d.ts +2 -0
- package/dist/api/resources/users/resources/index.js +31 -0
- package/dist/api/resources/values/client/Client.d.ts +18 -17
- package/dist/api/resources/values/client/Client.js +41 -40
- package/dist/api/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -2
- package/{api/resources/values/client/requests/DeleteDynamicValueRequest.d.ts → dist/api/resources/values/client/requests/ValuesDeleteRequest.d.ts} +1 -1
- package/{api/resources/values/client/requests/ListDynamicValuesRequest.d.ts → dist/api/resources/values/client/requests/ValuesListRequest.d.ts} +2 -2
- package/dist/api/resources/values/client/requests/ValuesListRequest.js +5 -0
- package/dist/api/resources/values/client/requests/index.d.ts +2 -2
- package/dist/api/types/BooleanValue.d.ts +2 -2
- package/dist/api/types/BulkRuleResponseItem.d.ts +2 -2
- package/dist/api/types/DecisionLog.d.ts +4 -4
- package/dist/api/types/DecisionLogDecision.d.ts +2 -2
- package/dist/api/types/DecisionLogResponse.d.ts +2 -2
- package/dist/api/types/DynamicValue.d.ts +6 -6
- package/dist/api/types/DynamicValueBase.d.ts +2 -2
- package/dist/api/types/DynamicValueListResponse.d.ts +2 -2
- package/dist/api/types/FlowDetail.d.ts +2 -2
- package/dist/api/types/FlowListResponse.d.ts +2 -2
- package/dist/api/types/FolderListResponse.d.ts +2 -2
- package/dist/api/types/ListValue.d.ts +3 -3
- package/dist/api/types/ListValueValueItem.d.ts +4 -0
- package/dist/api/types/ListValueValueItem.js +5 -0
- package/dist/api/types/NumberValue.d.ts +2 -2
- package/dist/api/types/ParallelSolveRequest.d.ts +2 -2
- package/dist/api/types/ParallelSolveResponse.d.ts +2 -2
- package/dist/api/types/RuleDetail.d.ts +5 -5
- package/dist/api/types/RuleListResponse.d.ts +2 -2
- package/dist/api/types/SchemaField.d.ts +3 -3
- package/dist/api/types/StringValue.d.ts +2 -2
- package/dist/api/types/Test.d.ts +2 -2
- package/dist/api/types/TestListResponse.d.ts +2 -2
- package/dist/api/types/TestTestState.d.ts +3 -3
- package/dist/api/types/UserGroupListResponse.d.ts +2 -2
- package/dist/api/types/UserInviteResponse.d.ts +2 -2
- package/dist/api/types/index.d.ts +1 -0
- package/dist/api/types/index.js +1 -0
- package/dist/environments.d.ts +7 -0
- package/dist/environments.js +9 -0
- package/dist/errors/{RulebricksApiError.d.ts → RulebricksError.d.ts} +1 -1
- package/dist/errors/{RulebricksApiError.js → RulebricksError.js} +4 -4
- package/dist/errors/{RulebricksApiTimeoutError.d.ts → RulebricksTimeoutError.d.ts} +1 -1
- package/dist/errors/RulebricksTimeoutError.js +13 -0
- package/dist/errors/index.d.ts +2 -2
- package/dist/errors/index.js +5 -5
- package/dist/forge/rule.d.ts +2 -2
- package/dist/forge/rule.js +8 -8
- package/dist/forge/values.d.ts +2 -2
- package/dist/forge/values.js +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +7 -5
- package/dist/serialization/resources/assets/index.d.ts +1 -1
- package/dist/serialization/resources/assets/index.js +1 -1
- package/dist/serialization/resources/assets/resources/folders/client/index.d.ts +1 -0
- package/dist/serialization/resources/assets/resources/folders/client/index.js +17 -0
- package/dist/serialization/resources/assets/resources/folders/client/requests/DeleteFolderRequest.d.ts +12 -0
- package/dist/serialization/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.js +1 -1
- package/{serialization/resources/assets → dist/serialization/resources/assets/resources/folders}/client/requests/UpsertFolderRequest.d.ts +4 -4
- package/{serialization/resources/assets → dist/serialization/resources/assets/resources/folders}/client/requests/UpsertFolderRequest.js +1 -1
- package/{serialization/resources/assets → dist/serialization/resources/assets/resources/folders}/client/requests/index.d.ts +0 -2
- package/dist/serialization/resources/assets/resources/folders/client/requests/index.js +7 -0
- package/dist/serialization/resources/assets/resources/folders/index.d.ts +1 -0
- package/dist/serialization/resources/assets/resources/folders/index.js +17 -0
- package/dist/serialization/resources/assets/resources/index.d.ts +4 -0
- package/dist/serialization/resources/assets/resources/index.js +33 -0
- package/dist/serialization/resources/assets/resources/rules/client/index.d.ts +1 -0
- package/dist/serialization/resources/assets/resources/rules/client/index.js +17 -0
- package/dist/serialization/resources/assets/resources/rules/client/requests/DeleteRuleRequest.d.ts +12 -0
- package/{serialization/resources/assets → dist/serialization/resources/assets/resources/rules}/client/requests/DeleteRuleRequest.js +1 -1
- package/dist/serialization/resources/assets/resources/rules/client/requests/ImportRuleRequest.d.ts +12 -0
- package/{serialization/resources/assets → dist/serialization/resources/assets/resources/rules}/client/requests/ImportRuleRequest.js +1 -1
- package/dist/serialization/resources/assets/resources/rules/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/assets/resources/rules/client/requests/index.js +7 -0
- package/dist/serialization/resources/assets/resources/rules/index.d.ts +1 -0
- package/dist/serialization/resources/assets/resources/rules/index.js +17 -0
- package/dist/serialization/resources/index.d.ts +1 -2
- package/dist/serialization/resources/index.js +1 -2
- package/dist/serialization/resources/rules/client/bulkSolve.d.ts +3 -3
- package/dist/serialization/resources/users/client/requests/UserInviteRequest.d.ts +2 -2
- package/dist/serialization/resources/users/client/requests/index.d.ts +0 -1
- package/dist/serialization/resources/users/client/requests/index.js +1 -3
- package/dist/serialization/resources/users/index.d.ts +1 -0
- package/dist/serialization/resources/users/index.js +1 -0
- package/dist/serialization/resources/users/resources/groups/client/index.d.ts +1 -0
- package/dist/serialization/resources/users/resources/groups/client/index.js +17 -0
- package/dist/serialization/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.d.ts +4 -4
- package/dist/serialization/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.js +1 -1
- package/dist/serialization/resources/users/resources/groups/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/users/resources/groups/client/requests/index.js +5 -0
- package/dist/serialization/resources/users/resources/groups/index.d.ts +1 -0
- package/dist/serialization/resources/users/resources/groups/index.js +17 -0
- package/dist/serialization/resources/users/resources/index.d.ts +2 -0
- package/dist/serialization/resources/users/resources/index.js +31 -0
- package/dist/serialization/resources/users/types/UserInviteRequestRole.d.ts +2 -2
- package/dist/serialization/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -2
- package/dist/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +2 -2
- package/dist/serialization/types/BooleanValue.d.ts +2 -2
- package/dist/serialization/types/BulkRuleResponseItem.d.ts +2 -2
- package/dist/serialization/types/BulkRuleResponseItemError.d.ts +2 -2
- package/dist/serialization/types/CreateTestRequest.d.ts +2 -2
- package/dist/serialization/types/DecisionLog.d.ts +2 -2
- package/dist/serialization/types/DecisionLogDecision.d.ts +2 -2
- package/dist/serialization/types/DecisionLogDecisionConditionsItemValue.d.ts +2 -2
- package/dist/serialization/types/DecisionLogRequest.d.ts +2 -2
- package/dist/serialization/types/DecisionLogResponse.d.ts +2 -2
- package/dist/serialization/types/DynamicRequestPayload.d.ts +2 -2
- package/dist/serialization/types/DynamicResponsePayload.d.ts +2 -2
- package/dist/serialization/types/DynamicValue.d.ts +2 -2
- package/dist/serialization/types/DynamicValueBase.d.ts +2 -2
- package/dist/serialization/types/DynamicValueListResponse.d.ts +2 -2
- package/dist/serialization/types/Error_.d.ts +2 -2
- package/dist/serialization/types/FlowBase.d.ts +2 -2
- package/dist/serialization/types/FlowDetail.d.ts +2 -2
- package/dist/serialization/types/FlowExecutionError.d.ts +2 -2
- package/dist/serialization/types/FlowListResponse.d.ts +2 -2
- package/dist/serialization/types/Folder.d.ts +2 -2
- package/dist/serialization/types/FolderListResponse.d.ts +2 -2
- package/dist/serialization/types/ListValue.d.ts +4 -3
- package/dist/serialization/types/ListValue.js +2 -1
- package/dist/serialization/types/ListValueValueItem.d.ts +10 -0
- package/dist/serialization/types/ListValueValueItem.js +37 -0
- package/dist/serialization/types/NumberValue.d.ts +2 -2
- package/dist/serialization/types/ParallelSolveRequest.d.ts +2 -2
- package/dist/serialization/types/ParallelSolveRequestValue.d.ts +2 -2
- package/dist/serialization/types/ParallelSolveResponse.d.ts +2 -2
- package/dist/serialization/types/RuleBase.d.ts +2 -2
- package/dist/serialization/types/RuleDetail.d.ts +2 -2
- package/dist/serialization/types/RuleExport.d.ts +2 -2
- package/dist/serialization/types/RuleListResponse.d.ts +2 -2
- package/dist/serialization/types/RuleUsage.d.ts +2 -2
- package/dist/serialization/types/SchemaField.d.ts +2 -2
- package/dist/serialization/types/SchemaFieldDefaultValue.d.ts +2 -2
- package/dist/serialization/types/SchemaFieldType.d.ts +2 -2
- package/dist/serialization/types/StringValue.d.ts +2 -2
- package/dist/serialization/types/SuccessMessage.d.ts +2 -2
- package/dist/serialization/types/Test.d.ts +2 -2
- package/dist/serialization/types/TestListResponse.d.ts +2 -2
- package/dist/serialization/types/TestTestState.d.ts +2 -2
- package/dist/serialization/types/TestTestStateConditionsItemValue.d.ts +2 -2
- package/dist/serialization/types/TestTestStateEvaluationError.d.ts +2 -2
- package/dist/serialization/types/UsageStatistics.d.ts +2 -2
- package/dist/serialization/types/UserGroup.d.ts +2 -2
- package/dist/serialization/types/UserGroupListResponse.d.ts +2 -2
- package/dist/serialization/types/UserInviteResponse.d.ts +2 -2
- package/dist/serialization/types/UserInviteResponseUser.d.ts +2 -2
- package/dist/serialization/types/ValueLimits.d.ts +2 -2
- package/dist/serialization/types/index.d.ts +1 -0
- package/dist/serialization/types/index.js +1 -0
- package/environments.d.ts +7 -0
- package/environments.js +9 -0
- package/errors/{RulebricksApiError.d.ts → RulebricksError.d.ts} +1 -1
- package/errors/{RulebricksApiError.js → RulebricksError.js} +4 -4
- package/errors/{RulebricksApiTimeoutError.d.ts → RulebricksTimeoutError.d.ts} +1 -1
- package/errors/RulebricksTimeoutError.js +13 -0
- package/errors/index.d.ts +2 -2
- package/errors/index.js +5 -5
- package/forge/rule.d.ts +2 -2
- package/forge/rule.js +8 -8
- package/forge/values.d.ts +2 -2
- package/forge/values.js +2 -2
- package/index.d.ts +4 -3
- package/index.js +7 -5
- package/package.json +2 -1
- package/serialization/resources/assets/index.d.ts +1 -1
- package/serialization/resources/assets/index.js +1 -1
- package/serialization/resources/assets/resources/folders/client/index.d.ts +1 -0
- package/serialization/resources/assets/resources/folders/client/index.js +17 -0
- package/serialization/resources/assets/resources/folders/client/requests/DeleteFolderRequest.d.ts +12 -0
- package/serialization/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.js +1 -1
- package/{dist/serialization/resources/assets → serialization/resources/assets/resources/folders}/client/requests/UpsertFolderRequest.d.ts +4 -4
- package/{dist/serialization/resources/assets → serialization/resources/assets/resources/folders}/client/requests/UpsertFolderRequest.js +1 -1
- package/{dist/serialization/resources/assets → serialization/resources/assets/resources/folders}/client/requests/index.d.ts +0 -2
- package/serialization/resources/assets/resources/folders/client/requests/index.js +7 -0
- package/serialization/resources/assets/resources/folders/index.d.ts +1 -0
- package/serialization/resources/assets/resources/folders/index.js +17 -0
- package/serialization/resources/assets/resources/index.d.ts +4 -0
- package/serialization/resources/assets/resources/index.js +33 -0
- package/serialization/resources/assets/resources/rules/client/index.d.ts +1 -0
- package/serialization/resources/assets/resources/rules/client/index.js +17 -0
- package/serialization/resources/assets/resources/rules/client/requests/DeleteRuleRequest.d.ts +12 -0
- package/{dist/serialization/resources/assets → serialization/resources/assets/resources/rules}/client/requests/DeleteRuleRequest.js +1 -1
- package/serialization/resources/assets/resources/rules/client/requests/ImportRuleRequest.d.ts +12 -0
- package/{dist/serialization/resources/assets → serialization/resources/assets/resources/rules}/client/requests/ImportRuleRequest.js +1 -1
- package/serialization/resources/assets/resources/rules/client/requests/index.d.ts +2 -0
- package/serialization/resources/assets/resources/rules/client/requests/index.js +7 -0
- package/serialization/resources/assets/resources/rules/index.d.ts +1 -0
- package/serialization/resources/assets/resources/rules/index.js +17 -0
- package/serialization/resources/index.d.ts +1 -2
- package/serialization/resources/index.js +1 -2
- package/serialization/resources/rules/client/bulkSolve.d.ts +3 -3
- package/serialization/resources/users/client/requests/UserInviteRequest.d.ts +2 -2
- package/serialization/resources/users/client/requests/index.d.ts +0 -1
- package/serialization/resources/users/client/requests/index.js +1 -3
- package/serialization/resources/users/index.d.ts +1 -0
- package/serialization/resources/users/index.js +1 -0
- package/serialization/resources/users/resources/groups/client/index.d.ts +1 -0
- package/serialization/resources/users/resources/groups/client/index.js +17 -0
- package/serialization/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.d.ts +4 -4
- package/serialization/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.js +1 -1
- package/serialization/resources/users/resources/groups/client/requests/index.d.ts +1 -0
- package/serialization/resources/users/resources/groups/client/requests/index.js +5 -0
- package/serialization/resources/users/resources/groups/index.d.ts +1 -0
- package/serialization/resources/users/resources/groups/index.js +17 -0
- package/serialization/resources/users/resources/index.d.ts +2 -0
- package/serialization/resources/users/resources/index.js +31 -0
- package/serialization/resources/users/types/UserInviteRequestRole.d.ts +2 -2
- package/serialization/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -2
- package/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +2 -2
- package/serialization/types/BooleanValue.d.ts +2 -2
- package/serialization/types/BulkRuleResponseItem.d.ts +2 -2
- package/serialization/types/BulkRuleResponseItemError.d.ts +2 -2
- package/serialization/types/CreateTestRequest.d.ts +2 -2
- package/serialization/types/DecisionLog.d.ts +2 -2
- package/serialization/types/DecisionLogDecision.d.ts +2 -2
- package/serialization/types/DecisionLogDecisionConditionsItemValue.d.ts +2 -2
- package/serialization/types/DecisionLogRequest.d.ts +2 -2
- package/serialization/types/DecisionLogResponse.d.ts +2 -2
- package/serialization/types/DynamicRequestPayload.d.ts +2 -2
- package/serialization/types/DynamicResponsePayload.d.ts +2 -2
- package/serialization/types/DynamicValue.d.ts +2 -2
- package/serialization/types/DynamicValueBase.d.ts +2 -2
- package/serialization/types/DynamicValueListResponse.d.ts +2 -2
- package/serialization/types/Error_.d.ts +2 -2
- package/serialization/types/FlowBase.d.ts +2 -2
- package/serialization/types/FlowDetail.d.ts +2 -2
- package/serialization/types/FlowExecutionError.d.ts +2 -2
- package/serialization/types/FlowListResponse.d.ts +2 -2
- package/serialization/types/Folder.d.ts +2 -2
- package/serialization/types/FolderListResponse.d.ts +2 -2
- package/serialization/types/ListValue.d.ts +4 -3
- package/serialization/types/ListValue.js +2 -1
- package/serialization/types/ListValueValueItem.d.ts +10 -0
- package/serialization/types/ListValueValueItem.js +37 -0
- package/serialization/types/NumberValue.d.ts +2 -2
- package/serialization/types/ParallelSolveRequest.d.ts +2 -2
- package/serialization/types/ParallelSolveRequestValue.d.ts +2 -2
- package/serialization/types/ParallelSolveResponse.d.ts +2 -2
- package/serialization/types/RuleBase.d.ts +2 -2
- package/serialization/types/RuleDetail.d.ts +2 -2
- package/serialization/types/RuleExport.d.ts +2 -2
- package/serialization/types/RuleListResponse.d.ts +2 -2
- package/serialization/types/RuleUsage.d.ts +2 -2
- package/serialization/types/SchemaField.d.ts +2 -2
- package/serialization/types/SchemaFieldDefaultValue.d.ts +2 -2
- package/serialization/types/SchemaFieldType.d.ts +2 -2
- package/serialization/types/StringValue.d.ts +2 -2
- package/serialization/types/SuccessMessage.d.ts +2 -2
- package/serialization/types/Test.d.ts +2 -2
- package/serialization/types/TestListResponse.d.ts +2 -2
- package/serialization/types/TestTestState.d.ts +2 -2
- package/serialization/types/TestTestStateConditionsItemValue.d.ts +2 -2
- package/serialization/types/TestTestStateEvaluationError.d.ts +2 -2
- package/serialization/types/UsageStatistics.d.ts +2 -2
- package/serialization/types/UserGroup.d.ts +2 -2
- package/serialization/types/UserGroupListResponse.d.ts +2 -2
- package/serialization/types/UserInviteResponse.d.ts +2 -2
- package/serialization/types/UserInviteResponseUser.d.ts +2 -2
- package/serialization/types/ValueLimits.d.ts +2 -2
- package/serialization/types/index.d.ts +1 -0
- package/serialization/types/index.js +1 -0
- package/api/resources/assets/client/requests/index.d.ts +0 -6
- package/dist/api/resources/assets/client/requests/index.d.ts +0 -6
- package/dist/errors/RulebricksApiTimeoutError.js +0 -13
- package/dist/serialization/resources/assets/client/requests/DeleteFolderRequest.d.ts +0 -12
- package/dist/serialization/resources/assets/client/requests/DeleteRuleRequest.d.ts +0 -12
- package/dist/serialization/resources/assets/client/requests/ImportRuleRequest.d.ts +0 -12
- package/dist/serialization/resources/assets/client/requests/index.js +0 -11
- package/errors/RulebricksApiTimeoutError.js +0 -13
- package/serialization/resources/assets/client/requests/DeleteFolderRequest.d.ts +0 -12
- package/serialization/resources/assets/client/requests/DeleteRuleRequest.d.ts +0 -12
- package/serialization/resources/assets/client/requests/ImportRuleRequest.d.ts +0 -12
- package/serialization/resources/assets/client/requests/index.js +0 -11
- /package/api/resources/assets/{client/requests → resources/flows/client}/index.js +0 -0
- /package/{dist/serialization/resources/assets → api/resources/assets/resources/folders}/client/index.d.ts +0 -0
- /package/{dist/serialization/resources/assets → api/resources/assets/resources/folders}/client/index.js +0 -0
- /package/api/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.d.ts +0 -0
- /package/api/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.js +0 -0
- /package/api/resources/assets/{client → resources/folders/client}/requests/UpsertFolderRequest.d.ts +0 -0
- /package/api/resources/assets/{client → resources/folders/client}/requests/UpsertFolderRequest.js +0 -0
- /package/{dist/api/resources/assets → api/resources/assets/resources/folders}/client/requests/index.js +0 -0
- /package/{serialization/resources/assets → api/resources/assets/resources/rules}/client/index.d.ts +0 -0
- /package/{serialization/resources/assets → api/resources/assets/resources/rules}/client/index.js +0 -0
- /package/api/resources/assets/{client → resources/rules/client}/requests/DeleteRuleRequest.d.ts +0 -0
- /package/api/resources/assets/{client → resources/rules/client}/requests/DeleteRuleRequest.js +0 -0
- /package/api/resources/assets/{client → resources/rules/client}/requests/ImportRuleRequest.d.ts +0 -0
- /package/api/resources/assets/{client → resources/rules/client}/requests/ImportRuleRequest.js +0 -0
- /package/api/resources/assets/{client/requests/ExportRuleRequest.js → resources/rules/client/requests/RulesListRequest.js} +0 -0
- /package/api/resources/assets/{client/requests/ListRulesRequest.js → resources/rules/client/requests/RulesPullRequest.js} +0 -0
- /package/api/resources/decisions/client/requests/{QueryDecisionsRequest.js → DecisionsQueryRequest.js} +0 -0
- /package/api/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.d.ts +0 -0
- /package/api/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.js +0 -0
- /package/api/resources/values/client/requests/{DeleteDynamicValueRequest.js → ValuesDeleteRequest.js} +0 -0
- /package/api/resources/values/client/requests/{ListDynamicValuesRequest.js → ValuesListRequest.js} +0 -0
- /package/{dist/api/resources/assets/client/requests/DeleteFolderRequest.js → api/types/ListValueValueItem.js} +0 -0
- /package/dist/api/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.d.ts +0 -0
- /package/dist/api/resources/assets/{client/requests/DeleteRuleRequest.js → resources/folders/client/requests/DeleteFolderRequest.js} +0 -0
- /package/dist/api/resources/assets/{client → resources/folders/client}/requests/UpsertFolderRequest.d.ts +0 -0
- /package/dist/api/resources/assets/{client → resources/folders/client}/requests/UpsertFolderRequest.js +0 -0
- /package/dist/api/resources/assets/{client → resources/rules/client}/requests/DeleteRuleRequest.d.ts +0 -0
- /package/dist/api/resources/assets/{client/requests/ExportRuleRequest.js → resources/rules/client/requests/DeleteRuleRequest.js} +0 -0
- /package/dist/api/resources/assets/{client → resources/rules/client}/requests/ImportRuleRequest.d.ts +0 -0
- /package/dist/api/resources/assets/{client → resources/rules/client}/requests/ImportRuleRequest.js +0 -0
- /package/dist/api/resources/assets/{client/requests/ListRulesRequest.js → resources/rules/client/requests/RulesListRequest.js} +0 -0
- /package/dist/api/resources/{decisions/client/requests/QueryDecisionsRequest.js → assets/resources/rules/client/requests/RulesPullRequest.js} +0 -0
- /package/dist/api/resources/{users/client/requests/CreateUserGroupRequest.js → decisions/client/requests/DecisionsQueryRequest.js} +0 -0
- /package/dist/api/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.d.ts +0 -0
- /package/dist/api/resources/{values/client/requests/DeleteDynamicValueRequest.js → users/resources/groups/client/requests/CreateUserGroupRequest.js} +0 -0
- /package/dist/api/resources/values/client/requests/{ListDynamicValuesRequest.js → ValuesDeleteRequest.js} +0 -0
|
@@ -39,8 +39,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.Flows = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
42
43
|
const core = __importStar(require("../../../../core"));
|
|
43
|
-
const
|
|
44
|
+
const Rulebricks = __importStar(require("../../../index"));
|
|
44
45
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
45
46
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
47
|
const errors = __importStar(require("../../../../errors/index"));
|
|
@@ -55,24 +56,24 @@ class Flows {
|
|
|
55
56
|
* Execute a flow by its slug.
|
|
56
57
|
*
|
|
57
58
|
* @param {string} slug - The unique identifier for the resource.
|
|
58
|
-
* @param {
|
|
59
|
+
* @param {Rulebricks.DynamicRequestPayload} request
|
|
59
60
|
* @param {Flows.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
61
|
*
|
|
61
|
-
* @throws {@link
|
|
62
|
-
* @throws {@link
|
|
62
|
+
* @throws {@link Rulebricks.BadRequestError}
|
|
63
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
63
64
|
*
|
|
64
65
|
* @example
|
|
65
|
-
* await client.flows.
|
|
66
|
+
* await client.flows.execute("slug", {
|
|
66
67
|
* "name": "John Doe",
|
|
67
68
|
* "age": 30,
|
|
68
69
|
* "email": "jdoe@acme.co"
|
|
69
70
|
* })
|
|
70
71
|
*/
|
|
71
|
-
|
|
72
|
-
var _a;
|
|
72
|
+
execute(slug, request, requestOptions) {
|
|
73
|
+
var _a, _b;
|
|
73
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
75
|
const _response = yield core.fetcher({
|
|
75
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)), `
|
|
76
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.RulebricksEnvironment.Default, `flows/${encodeURIComponent(slug)}`),
|
|
76
77
|
method: "POST",
|
|
77
78
|
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
78
79
|
contentType: "application/json",
|
|
@@ -93,11 +94,11 @@ class Flows {
|
|
|
93
94
|
if (_response.error.reason === "status-code") {
|
|
94
95
|
switch (_response.error.statusCode) {
|
|
95
96
|
case 400:
|
|
96
|
-
throw new
|
|
97
|
+
throw new Rulebricks.BadRequestError(_response.error.body);
|
|
97
98
|
case 500:
|
|
98
|
-
throw new
|
|
99
|
+
throw new Rulebricks.InternalServerError(_response.error.body);
|
|
99
100
|
default:
|
|
100
|
-
throw new errors.
|
|
101
|
+
throw new errors.RulebricksError({
|
|
101
102
|
statusCode: _response.error.statusCode,
|
|
102
103
|
body: _response.error.body,
|
|
103
104
|
});
|
|
@@ -105,14 +106,14 @@ class Flows {
|
|
|
105
106
|
}
|
|
106
107
|
switch (_response.error.reason) {
|
|
107
108
|
case "non-json":
|
|
108
|
-
throw new errors.
|
|
109
|
+
throw new errors.RulebricksError({
|
|
109
110
|
statusCode: _response.error.statusCode,
|
|
110
111
|
body: _response.error.rawBody,
|
|
111
112
|
});
|
|
112
113
|
case "timeout":
|
|
113
|
-
throw new errors.
|
|
114
|
+
throw new errors.RulebricksTimeoutError("Timeout exceeded when calling POST /flows/{slug}.");
|
|
114
115
|
case "unknown":
|
|
115
|
-
throw new errors.
|
|
116
|
+
throw new errors.RulebricksError({
|
|
116
117
|
message: _response.error.errorMessage,
|
|
117
118
|
});
|
|
118
119
|
}
|
|
@@ -8,6 +8,5 @@ export * as decisions from "./decisions";
|
|
|
8
8
|
export * as assets from "./assets";
|
|
9
9
|
export * as tests from "./tests";
|
|
10
10
|
export * from "./decisions/client/requests";
|
|
11
|
-
export * from "./assets/client/requests";
|
|
12
11
|
export * from "./users/client/requests";
|
|
13
12
|
export * from "./values/client/requests";
|
|
@@ -37,6 +37,5 @@ exports.decisions = __importStar(require("./decisions"));
|
|
|
37
37
|
exports.assets = __importStar(require("./assets"));
|
|
38
38
|
exports.tests = __importStar(require("./tests"));
|
|
39
39
|
__exportStar(require("./decisions/client/requests"), exports);
|
|
40
|
-
__exportStar(require("./assets/client/requests"), exports);
|
|
41
40
|
__exportStar(require("./users/client/requests"), exports);
|
|
42
41
|
__exportStar(require("./values/client/requests"), exports);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
4
5
|
import * as core from "../../../../core";
|
|
5
|
-
import * as
|
|
6
|
+
import * as Rulebricks from "../../../index";
|
|
6
7
|
export declare namespace Rules {
|
|
7
8
|
interface Options {
|
|
8
|
-
environment
|
|
9
|
+
environment?: core.Supplier<environments.RulebricksEnvironment | string>;
|
|
9
10
|
/** Specify a custom URL to connect the client to. */
|
|
10
11
|
baseUrl?: core.Supplier<string>;
|
|
11
12
|
apiKey: core.Supplier<string>;
|
|
@@ -31,11 +32,11 @@ export declare class Rules {
|
|
|
31
32
|
* Executes a single rule identified by a unique slug. The request and response formats are dynamic, dependent on the rule configuration.
|
|
32
33
|
*
|
|
33
34
|
* @param {string} slug - The unique identifier for the resource.
|
|
34
|
-
* @param {
|
|
35
|
+
* @param {Rulebricks.DynamicRequestPayload} request
|
|
35
36
|
* @param {Rules.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
37
|
*
|
|
37
|
-
* @throws {@link
|
|
38
|
-
* @throws {@link
|
|
38
|
+
* @throws {@link Rulebricks.BadRequestError}
|
|
39
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
39
40
|
*
|
|
40
41
|
* @example
|
|
41
42
|
* await client.rules.solve("slug", {
|
|
@@ -44,16 +45,16 @@ export declare class Rules {
|
|
|
44
45
|
* "email": "jdoe@acme.co"
|
|
45
46
|
* })
|
|
46
47
|
*/
|
|
47
|
-
solve(slug: string, request:
|
|
48
|
+
solve(slug: string, request: Rulebricks.DynamicRequestPayload, requestOptions?: Rules.RequestOptions): Promise<Rulebricks.DynamicResponsePayload>;
|
|
48
49
|
/**
|
|
49
50
|
* Executes a particular rule against multiple request data payloads provided in a list.
|
|
50
51
|
*
|
|
51
52
|
* @param {string} slug - The unique identifier for the resource.
|
|
52
|
-
* @param {
|
|
53
|
+
* @param {Rulebricks.DynamicRequestPayload[]} request
|
|
53
54
|
* @param {Rules.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
55
|
*
|
|
55
|
-
* @throws {@link
|
|
56
|
-
* @throws {@link
|
|
56
|
+
* @throws {@link Rulebricks.BadRequestError}
|
|
57
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
57
58
|
*
|
|
58
59
|
* @example
|
|
59
60
|
* await client.rules.bulkSolve("slug", [{
|
|
@@ -66,15 +67,15 @@ export declare class Rules {
|
|
|
66
67
|
* "email": "jane@example.com"
|
|
67
68
|
* }])
|
|
68
69
|
*/
|
|
69
|
-
bulkSolve(slug: string, request:
|
|
70
|
+
bulkSolve(slug: string, request: Rulebricks.DynamicRequestPayload[], requestOptions?: Rules.RequestOptions): Promise<Rulebricks.BulkRuleResponseItem[]>;
|
|
70
71
|
/**
|
|
71
72
|
* Executes multiple rules or flows in parallel based on a provided mapping of rule/flow slugs to payloads.
|
|
72
73
|
*
|
|
73
|
-
* @param {
|
|
74
|
+
* @param {Rulebricks.ParallelSolveRequest} request
|
|
74
75
|
* @param {Rules.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
76
|
*
|
|
76
|
-
* @throws {@link
|
|
77
|
-
* @throws {@link
|
|
77
|
+
* @throws {@link Rulebricks.BadRequestError}
|
|
78
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
78
79
|
*
|
|
79
80
|
* @example
|
|
80
81
|
* await client.rules.parallelSolve({
|
|
@@ -86,7 +87,7 @@ export declare class Rules {
|
|
|
86
87
|
* }
|
|
87
88
|
* })
|
|
88
89
|
*/
|
|
89
|
-
parallelSolve(request:
|
|
90
|
+
parallelSolve(request: Rulebricks.ParallelSolveRequest, requestOptions?: Rules.RequestOptions): Promise<Rulebricks.ParallelSolveResponse>;
|
|
90
91
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
91
92
|
"x-api-key": string;
|
|
92
93
|
}>;
|
|
@@ -39,8 +39,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.Rules = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
42
43
|
const core = __importStar(require("../../../../core"));
|
|
43
|
-
const
|
|
44
|
+
const Rulebricks = __importStar(require("../../../index"));
|
|
44
45
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
45
46
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
47
|
const errors = __importStar(require("../../../../errors/index"));
|
|
@@ -55,11 +56,11 @@ class Rules {
|
|
|
55
56
|
* Executes a single rule identified by a unique slug. The request and response formats are dynamic, dependent on the rule configuration.
|
|
56
57
|
*
|
|
57
58
|
* @param {string} slug - The unique identifier for the resource.
|
|
58
|
-
* @param {
|
|
59
|
+
* @param {Rulebricks.DynamicRequestPayload} request
|
|
59
60
|
* @param {Rules.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
61
|
*
|
|
61
|
-
* @throws {@link
|
|
62
|
-
* @throws {@link
|
|
62
|
+
* @throws {@link Rulebricks.BadRequestError}
|
|
63
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
63
64
|
*
|
|
64
65
|
* @example
|
|
65
66
|
* await client.rules.solve("slug", {
|
|
@@ -69,10 +70,10 @@ class Rules {
|
|
|
69
70
|
* })
|
|
70
71
|
*/
|
|
71
72
|
solve(slug, request, requestOptions) {
|
|
72
|
-
var _a;
|
|
73
|
+
var _a, _b;
|
|
73
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
75
|
const _response = yield core.fetcher({
|
|
75
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)), `
|
|
76
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.RulebricksEnvironment.Default, `solve/${encodeURIComponent(slug)}`),
|
|
76
77
|
method: "POST",
|
|
77
78
|
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
78
79
|
contentType: "application/json",
|
|
@@ -93,11 +94,11 @@ class Rules {
|
|
|
93
94
|
if (_response.error.reason === "status-code") {
|
|
94
95
|
switch (_response.error.statusCode) {
|
|
95
96
|
case 400:
|
|
96
|
-
throw new
|
|
97
|
+
throw new Rulebricks.BadRequestError(_response.error.body);
|
|
97
98
|
case 500:
|
|
98
|
-
throw new
|
|
99
|
+
throw new Rulebricks.InternalServerError(_response.error.body);
|
|
99
100
|
default:
|
|
100
|
-
throw new errors.
|
|
101
|
+
throw new errors.RulebricksError({
|
|
101
102
|
statusCode: _response.error.statusCode,
|
|
102
103
|
body: _response.error.body,
|
|
103
104
|
});
|
|
@@ -105,14 +106,14 @@ class Rules {
|
|
|
105
106
|
}
|
|
106
107
|
switch (_response.error.reason) {
|
|
107
108
|
case "non-json":
|
|
108
|
-
throw new errors.
|
|
109
|
+
throw new errors.RulebricksError({
|
|
109
110
|
statusCode: _response.error.statusCode,
|
|
110
111
|
body: _response.error.rawBody,
|
|
111
112
|
});
|
|
112
113
|
case "timeout":
|
|
113
|
-
throw new errors.
|
|
114
|
+
throw new errors.RulebricksTimeoutError("Timeout exceeded when calling POST /solve/{slug}.");
|
|
114
115
|
case "unknown":
|
|
115
|
-
throw new errors.
|
|
116
|
+
throw new errors.RulebricksError({
|
|
116
117
|
message: _response.error.errorMessage,
|
|
117
118
|
});
|
|
118
119
|
}
|
|
@@ -122,11 +123,11 @@ class Rules {
|
|
|
122
123
|
* Executes a particular rule against multiple request data payloads provided in a list.
|
|
123
124
|
*
|
|
124
125
|
* @param {string} slug - The unique identifier for the resource.
|
|
125
|
-
* @param {
|
|
126
|
+
* @param {Rulebricks.DynamicRequestPayload[]} request
|
|
126
127
|
* @param {Rules.RequestOptions} requestOptions - Request-specific configuration.
|
|
127
128
|
*
|
|
128
|
-
* @throws {@link
|
|
129
|
-
* @throws {@link
|
|
129
|
+
* @throws {@link Rulebricks.BadRequestError}
|
|
130
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
130
131
|
*
|
|
131
132
|
* @example
|
|
132
133
|
* await client.rules.bulkSolve("slug", [{
|
|
@@ -140,10 +141,10 @@ class Rules {
|
|
|
140
141
|
* }])
|
|
141
142
|
*/
|
|
142
143
|
bulkSolve(slug, request, requestOptions) {
|
|
143
|
-
var _a;
|
|
144
|
+
var _a, _b;
|
|
144
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
146
|
const _response = yield core.fetcher({
|
|
146
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)), `
|
|
147
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.RulebricksEnvironment.Default, `bulk-solve/${encodeURIComponent(slug)}`),
|
|
147
148
|
method: "POST",
|
|
148
149
|
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
149
150
|
contentType: "application/json",
|
|
@@ -164,11 +165,11 @@ class Rules {
|
|
|
164
165
|
if (_response.error.reason === "status-code") {
|
|
165
166
|
switch (_response.error.statusCode) {
|
|
166
167
|
case 400:
|
|
167
|
-
throw new
|
|
168
|
+
throw new Rulebricks.BadRequestError(_response.error.body);
|
|
168
169
|
case 500:
|
|
169
|
-
throw new
|
|
170
|
+
throw new Rulebricks.InternalServerError(_response.error.body);
|
|
170
171
|
default:
|
|
171
|
-
throw new errors.
|
|
172
|
+
throw new errors.RulebricksError({
|
|
172
173
|
statusCode: _response.error.statusCode,
|
|
173
174
|
body: _response.error.body,
|
|
174
175
|
});
|
|
@@ -176,14 +177,14 @@ class Rules {
|
|
|
176
177
|
}
|
|
177
178
|
switch (_response.error.reason) {
|
|
178
179
|
case "non-json":
|
|
179
|
-
throw new errors.
|
|
180
|
+
throw new errors.RulebricksError({
|
|
180
181
|
statusCode: _response.error.statusCode,
|
|
181
182
|
body: _response.error.rawBody,
|
|
182
183
|
});
|
|
183
184
|
case "timeout":
|
|
184
|
-
throw new errors.
|
|
185
|
+
throw new errors.RulebricksTimeoutError("Timeout exceeded when calling POST /bulk-solve/{slug}.");
|
|
185
186
|
case "unknown":
|
|
186
|
-
throw new errors.
|
|
187
|
+
throw new errors.RulebricksError({
|
|
187
188
|
message: _response.error.errorMessage,
|
|
188
189
|
});
|
|
189
190
|
}
|
|
@@ -192,11 +193,11 @@ class Rules {
|
|
|
192
193
|
/**
|
|
193
194
|
* Executes multiple rules or flows in parallel based on a provided mapping of rule/flow slugs to payloads.
|
|
194
195
|
*
|
|
195
|
-
* @param {
|
|
196
|
+
* @param {Rulebricks.ParallelSolveRequest} request
|
|
196
197
|
* @param {Rules.RequestOptions} requestOptions - Request-specific configuration.
|
|
197
198
|
*
|
|
198
|
-
* @throws {@link
|
|
199
|
-
* @throws {@link
|
|
199
|
+
* @throws {@link Rulebricks.BadRequestError}
|
|
200
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
200
201
|
*
|
|
201
202
|
* @example
|
|
202
203
|
* await client.rules.parallelSolve({
|
|
@@ -209,10 +210,10 @@ class Rules {
|
|
|
209
210
|
* })
|
|
210
211
|
*/
|
|
211
212
|
parallelSolve(request, requestOptions) {
|
|
212
|
-
var _a;
|
|
213
|
+
var _a, _b;
|
|
213
214
|
return __awaiter(this, void 0, void 0, function* () {
|
|
214
215
|
const _response = yield core.fetcher({
|
|
215
|
-
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment)), "
|
|
216
|
+
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.RulebricksEnvironment.Default, "parallel-solve"),
|
|
216
217
|
method: "POST",
|
|
217
218
|
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
218
219
|
contentType: "application/json",
|
|
@@ -233,11 +234,11 @@ class Rules {
|
|
|
233
234
|
if (_response.error.reason === "status-code") {
|
|
234
235
|
switch (_response.error.statusCode) {
|
|
235
236
|
case 400:
|
|
236
|
-
throw new
|
|
237
|
+
throw new Rulebricks.BadRequestError(_response.error.body);
|
|
237
238
|
case 500:
|
|
238
|
-
throw new
|
|
239
|
+
throw new Rulebricks.InternalServerError(_response.error.body);
|
|
239
240
|
default:
|
|
240
|
-
throw new errors.
|
|
241
|
+
throw new errors.RulebricksError({
|
|
241
242
|
statusCode: _response.error.statusCode,
|
|
242
243
|
body: _response.error.body,
|
|
243
244
|
});
|
|
@@ -245,14 +246,14 @@ class Rules {
|
|
|
245
246
|
}
|
|
246
247
|
switch (_response.error.reason) {
|
|
247
248
|
case "non-json":
|
|
248
|
-
throw new errors.
|
|
249
|
+
throw new errors.RulebricksError({
|
|
249
250
|
statusCode: _response.error.statusCode,
|
|
250
251
|
body: _response.error.rawBody,
|
|
251
252
|
});
|
|
252
253
|
case "timeout":
|
|
253
|
-
throw new errors.
|
|
254
|
+
throw new errors.RulebricksTimeoutError("Timeout exceeded when calling POST /parallel-solve.");
|
|
254
255
|
case "unknown":
|
|
255
|
-
throw new errors.
|
|
256
|
+
throw new errors.RulebricksError({
|
|
256
257
|
message: _response.error.errorMessage,
|
|
257
258
|
});
|
|
258
259
|
}
|
|
@@ -1,135 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
4
5
|
import * as core from "../../../../core";
|
|
5
|
-
import
|
|
6
|
+
import { Rules } from "../resources/rules/client/Client";
|
|
7
|
+
import { Flows } from "../resources/flows/client/Client";
|
|
6
8
|
export declare namespace Tests {
|
|
7
9
|
interface Options {
|
|
8
|
-
environment
|
|
10
|
+
environment?: core.Supplier<environments.RulebricksEnvironment | string>;
|
|
9
11
|
/** Specify a custom URL to connect the client to. */
|
|
10
12
|
baseUrl?: core.Supplier<string>;
|
|
11
13
|
apiKey: core.Supplier<string>;
|
|
12
14
|
}
|
|
13
|
-
interface RequestOptions {
|
|
14
|
-
/** The maximum time to wait for a response in seconds. */
|
|
15
|
-
timeoutInSeconds?: number;
|
|
16
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
17
|
-
maxRetries?: number;
|
|
18
|
-
/** A hook to abort the request. */
|
|
19
|
-
abortSignal?: AbortSignal;
|
|
20
|
-
/** Additional headers to include in the request. */
|
|
21
|
-
headers?: Record<string, string>;
|
|
22
|
-
}
|
|
23
15
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Administrative operations for programmatically managing test suites for rules and flows
|
|
26
|
-
*/
|
|
27
16
|
export declare class Tests {
|
|
28
17
|
protected readonly _options: Tests.Options;
|
|
18
|
+
protected _rules: Rules | undefined;
|
|
19
|
+
protected _flows: Flows | undefined;
|
|
29
20
|
constructor(_options: Tests.Options);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
* @param {string} slug - The unique identifier for the resource.
|
|
34
|
-
* @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
-
*
|
|
36
|
-
* @throws {@link RulebricksApi.NotFoundError}
|
|
37
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* await client.tests.listRuleTests("slug")
|
|
41
|
-
*/
|
|
42
|
-
listRuleTests(slug: string, requestOptions?: Tests.RequestOptions): Promise<RulebricksApi.TestListResponse>;
|
|
43
|
-
/**
|
|
44
|
-
* Adds a new test to the test suite of a rule identified by the slug.
|
|
45
|
-
*
|
|
46
|
-
* @param {string} slug - The unique identifier for the resource.
|
|
47
|
-
* @param {RulebricksApi.CreateTestRequest} request
|
|
48
|
-
* @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
|
|
49
|
-
*
|
|
50
|
-
* @throws {@link RulebricksApi.BadRequestError}
|
|
51
|
-
* @throws {@link RulebricksApi.NotFoundError}
|
|
52
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* await client.tests.createRuleTest("slug", {
|
|
56
|
-
* name: "Test 3",
|
|
57
|
-
* request: {
|
|
58
|
-
* "param1": "value1"
|
|
59
|
-
* },
|
|
60
|
-
* response: {
|
|
61
|
-
* "status": "success"
|
|
62
|
-
* },
|
|
63
|
-
* critical: true
|
|
64
|
-
* })
|
|
65
|
-
*/
|
|
66
|
-
createRuleTest(slug: string, request: RulebricksApi.CreateTestRequest, requestOptions?: Tests.RequestOptions): Promise<RulebricksApi.Test>;
|
|
67
|
-
/**
|
|
68
|
-
* Deletes a test from the test suite of a rule identified by the slug.
|
|
69
|
-
*
|
|
70
|
-
* @param {string} slug - The unique identifier for the resource.
|
|
71
|
-
* @param {string} testId - The ID of the test.
|
|
72
|
-
* @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
|
-
*
|
|
74
|
-
* @throws {@link RulebricksApi.NotFoundError}
|
|
75
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* await client.tests.deleteRuleTest("slug", "testId")
|
|
79
|
-
*/
|
|
80
|
-
deleteRuleTest(slug: string, testId: string, requestOptions?: Tests.RequestOptions): Promise<RulebricksApi.Test>;
|
|
81
|
-
/**
|
|
82
|
-
* Retrieves a list of tests associated with the flow identified by the slug.
|
|
83
|
-
*
|
|
84
|
-
* @param {string} slug - The unique identifier for the resource.
|
|
85
|
-
* @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
|
-
*
|
|
87
|
-
* @throws {@link RulebricksApi.NotFoundError}
|
|
88
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* await client.tests.listFlowTests("slug")
|
|
92
|
-
*/
|
|
93
|
-
listFlowTests(slug: string, requestOptions?: Tests.RequestOptions): Promise<RulebricksApi.TestListResponse>;
|
|
94
|
-
/**
|
|
95
|
-
* Adds a new test to the test suite of a flow identified by the slug.
|
|
96
|
-
*
|
|
97
|
-
* @param {string} slug - The unique identifier for the resource.
|
|
98
|
-
* @param {RulebricksApi.CreateTestRequest} request
|
|
99
|
-
* @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
|
|
100
|
-
*
|
|
101
|
-
* @throws {@link RulebricksApi.BadRequestError}
|
|
102
|
-
* @throws {@link RulebricksApi.NotFoundError}
|
|
103
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* await client.tests.createFlowTest("slug", {
|
|
107
|
-
* name: "Test 3",
|
|
108
|
-
* request: {
|
|
109
|
-
* "param1": "value1"
|
|
110
|
-
* },
|
|
111
|
-
* response: {
|
|
112
|
-
* "status": "success"
|
|
113
|
-
* },
|
|
114
|
-
* critical: true
|
|
115
|
-
* })
|
|
116
|
-
*/
|
|
117
|
-
createFlowTest(slug: string, request: RulebricksApi.CreateTestRequest, requestOptions?: Tests.RequestOptions): Promise<RulebricksApi.Test>;
|
|
118
|
-
/**
|
|
119
|
-
* Deletes a test from the test suite of a flow identified by the slug.
|
|
120
|
-
*
|
|
121
|
-
* @param {string} slug - The unique identifier for the resource.
|
|
122
|
-
* @param {string} testId - The ID of the test.
|
|
123
|
-
* @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
|
|
124
|
-
*
|
|
125
|
-
* @throws {@link RulebricksApi.NotFoundError}
|
|
126
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* await client.tests.deleteFlowTest("slug", "testId")
|
|
130
|
-
*/
|
|
131
|
-
deleteFlowTest(slug: string, testId: string, requestOptions?: Tests.RequestOptions): Promise<RulebricksApi.Test>;
|
|
132
|
-
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
133
|
-
"x-api-key": string;
|
|
134
|
-
}>;
|
|
21
|
+
get rules(): Rules;
|
|
22
|
+
get flows(): Flows;
|
|
135
23
|
}
|