@rulebricks/sdk 1.2.1 → 1.4.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/README.md +3 -3
- package/api/errors/BadRequestError.d.ts +1 -1
- package/api/errors/BadRequestError.js +1 -1
- package/api/errors/ForbiddenError.d.ts +2 -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/{dist/serialization/resources/values/types → api/resources/assets/resources/flows}/index.js +1 -1
- 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/{dist/api/resources/values/types → api/resources/assets/resources/folders}/index.js +1 -1
- 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 +332 -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 +7 -6
- package/api/resources/decisions/client/Client.js +13 -12
- package/{dist/api/resources/decisions/client/requests/QueryRequest.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 +7 -6
- package/api/resources/flows/client/Client.js +13 -12
- package/api/resources/index.d.ts +1 -3
- package/api/resources/index.js +2 -4
- 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 +73 -18
- package/api/resources/values/client/Client.js +101 -39
- package/api/resources/values/client/requests/UpdateValuesRequest.d.ts +81 -4
- package/{dist/api/resources/values/client/requests/DeleteRequest.d.ts → api/resources/values/client/requests/ValuesDeleteRequest.d.ts} +1 -1
- package/api/resources/values/client/requests/ValuesListRequest.d.ts +24 -0
- package/api/resources/values/client/requests/index.d.ts +2 -2
- package/api/resources/values/index.d.ts +0 -1
- package/api/resources/values/index.js +0 -1
- 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 +13 -15
- 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/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/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 +0 -6
- package/api/types/index.js +0 -6
- 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 +2 -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 +332 -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 +7 -6
- package/dist/api/resources/decisions/client/Client.js +13 -12
- package/{api/resources/decisions/client/requests/QueryRequest.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 +7 -6
- package/dist/api/resources/flows/client/Client.js +13 -12
- package/dist/api/resources/index.d.ts +1 -3
- package/dist/api/resources/index.js +2 -4
- 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 +73 -18
- package/dist/api/resources/values/client/Client.js +101 -39
- package/dist/api/resources/values/client/requests/UpdateValuesRequest.d.ts +81 -4
- package/{api/resources/values/client/requests/DeleteRequest.d.ts → dist/api/resources/values/client/requests/ValuesDeleteRequest.d.ts} +1 -1
- package/dist/api/resources/values/client/requests/ValuesListRequest.d.ts +24 -0
- package/dist/api/resources/values/client/requests/index.d.ts +2 -2
- package/dist/api/resources/values/index.d.ts +0 -1
- package/dist/api/resources/values/index.js +0 -1
- 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 +13 -15
- 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/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/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 +0 -6
- package/dist/api/types/index.js +0 -6
- 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/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/dist/serialization/resources/assets/{client → 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/dist/serialization/resources/assets/{client → 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/dist/serialization/resources/assets/{client → 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 +2 -4
- package/dist/serialization/resources/index.js +3 -5
- 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 +3 -4
- package/dist/serialization/resources/values/client/requests/UpdateValuesRequest.js +1 -2
- package/dist/serialization/resources/values/index.d.ts +0 -1
- package/dist/serialization/resources/values/index.js +0 -1
- 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 +10 -18
- package/dist/serialization/types/DynamicValue.js +8 -14
- 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/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/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 +0 -6
- package/dist/serialization/types/index.js +0 -6
- 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/index.d.ts +4 -3
- package/index.js +7 -5
- package/package.json +1 -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/serialization/resources/assets/{client → 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/serialization/resources/assets/{client → 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/serialization/resources/assets/{client → 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 +2 -4
- package/serialization/resources/index.js +3 -5
- 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 +3 -4
- package/serialization/resources/values/client/requests/UpdateValuesRequest.js +1 -2
- package/serialization/resources/values/index.d.ts +0 -1
- package/serialization/resources/values/index.js +0 -1
- 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 +10 -18
- package/serialization/types/DynamicValue.js +8 -14
- 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/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/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 +0 -6
- package/serialization/types/index.js +0 -6
- package/api/resources/assets/client/requests/index.d.ts +0 -6
- package/api/resources/values/client/requests/ListRequest.d.ts +0 -13
- package/api/resources/values/types/UpdateValuesRequestValuesValue.d.ts +0 -4
- package/api/resources/values/types/index.d.ts +0 -1
- package/api/resources/values/types/index.js +0 -17
- package/api/types/BooleanValue.d.ts +0 -8
- package/api/types/DynamicValueBase.d.ts +0 -14
- package/api/types/ListValue.d.ts +0 -8
- package/api/types/ListValueValueItem.d.ts +0 -4
- package/api/types/NumberValue.d.ts +0 -8
- package/api/types/NumberValue.js +0 -5
- package/api/types/StringValue.d.ts +0 -8
- package/api/types/StringValue.js +0 -5
- package/dist/api/resources/assets/client/requests/ExportRuleRequest.js +0 -5
- package/dist/api/resources/assets/client/requests/ListRulesRequest.js +0 -5
- package/dist/api/resources/assets/client/requests/index.d.ts +0 -6
- package/dist/api/resources/decisions/client/requests/QueryRequest.js +0 -5
- package/dist/api/resources/values/client/requests/DeleteRequest.js +0 -5
- package/dist/api/resources/values/client/requests/ListRequest.d.ts +0 -13
- package/dist/api/resources/values/client/requests/ListRequest.js +0 -5
- package/dist/api/resources/values/types/UpdateValuesRequestValuesValue.d.ts +0 -4
- package/dist/api/resources/values/types/UpdateValuesRequestValuesValue.js +0 -5
- package/dist/api/resources/values/types/index.d.ts +0 -1
- package/dist/api/types/BooleanValue.d.ts +0 -8
- package/dist/api/types/BooleanValue.js +0 -5
- package/dist/api/types/DynamicValueBase.d.ts +0 -14
- package/dist/api/types/DynamicValueBase.js +0 -5
- package/dist/api/types/ListValue.d.ts +0 -8
- package/dist/api/types/ListValue.js +0 -5
- package/dist/api/types/ListValueValueItem.d.ts +0 -4
- package/dist/api/types/ListValueValueItem.js +0 -5
- package/dist/api/types/NumberValue.d.ts +0 -8
- package/dist/api/types/NumberValue.js +0 -5
- package/dist/api/types/StringValue.d.ts +0 -8
- package/dist/api/types/StringValue.js +0 -5
- 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/dist/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +0 -10
- package/dist/serialization/resources/values/types/UpdateValuesRequestValuesValue.js +0 -36
- package/dist/serialization/resources/values/types/index.d.ts +0 -1
- package/dist/serialization/types/BooleanValue.d.ts +0 -13
- package/dist/serialization/types/BooleanValue.js +0 -36
- package/dist/serialization/types/DynamicValueBase.d.ts +0 -16
- package/dist/serialization/types/DynamicValueBase.js +0 -37
- package/dist/serialization/types/ListValue.d.ts +0 -14
- package/dist/serialization/types/ListValue.js +0 -37
- package/dist/serialization/types/ListValueValueItem.d.ts +0 -10
- package/dist/serialization/types/ListValueValueItem.js +0 -37
- package/dist/serialization/types/NumberValue.d.ts +0 -13
- package/dist/serialization/types/NumberValue.js +0 -36
- package/dist/serialization/types/StringValue.d.ts +0 -13
- package/dist/serialization/types/StringValue.js +0 -36
- 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/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +0 -10
- package/serialization/resources/values/types/UpdateValuesRequestValuesValue.js +0 -36
- package/serialization/resources/values/types/index.d.ts +0 -1
- package/serialization/resources/values/types/index.js +0 -17
- package/serialization/types/BooleanValue.d.ts +0 -13
- package/serialization/types/BooleanValue.js +0 -36
- package/serialization/types/DynamicValueBase.d.ts +0 -16
- package/serialization/types/DynamicValueBase.js +0 -37
- package/serialization/types/ListValue.d.ts +0 -14
- package/serialization/types/ListValue.js +0 -37
- package/serialization/types/ListValueValueItem.d.ts +0 -10
- package/serialization/types/ListValueValueItem.js +0 -37
- package/serialization/types/NumberValue.d.ts +0 -13
- package/serialization/types/NumberValue.js +0 -36
- package/serialization/types/StringValue.d.ts +0 -13
- package/serialization/types/StringValue.js +0 -36
- /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/{QueryRequest.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/{DeleteRequest.js → ValuesDeleteRequest.js} +0 -0
- /package/api/resources/values/client/requests/{ListRequest.js → ValuesListRequest.js} +0 -0
- /package/dist/api/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.d.ts +0 -0
- /package/dist/api/resources/assets/{client → 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 → 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/{api/resources/values/types/UpdateValuesRequestValuesValue.js → dist/api/resources/assets/resources/rules/client/requests/RulesListRequest.js} +0 -0
- /package/{api/types/BooleanValue.js → dist/api/resources/assets/resources/rules/client/requests/RulesPullRequest.js} +0 -0
- /package/{api/types/DynamicValueBase.js → dist/api/resources/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/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.js +0 -0
- /package/{api/types/ListValue.js → dist/api/resources/values/client/requests/ValuesDeleteRequest.js} +0 -0
- /package/{api/types/ListValueValueItem.js → dist/api/resources/values/client/requests/ValuesListRequest.js} +0 -0
|
@@ -39,11 +39,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.Assets = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../environments"));
|
|
42
43
|
const core = __importStar(require("../../../../core"));
|
|
43
|
-
const RulebricksApi = __importStar(require("../../../index"));
|
|
44
|
-
const serializers = __importStar(require("../../../../serialization/index"));
|
|
45
44
|
const url_join_1 = __importDefault(require("url-join"));
|
|
45
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
46
46
|
const errors = __importStar(require("../../../../errors/index"));
|
|
47
|
+
const Client_1 = require("../resources/rules/client/Client");
|
|
48
|
+
const Client_2 = require("../resources/flows/client/Client");
|
|
49
|
+
const Client_3 = require("../resources/folders/client/Client");
|
|
47
50
|
/**
|
|
48
51
|
* Administrative operations for managing rules, flows, folders, and usage
|
|
49
52
|
*/
|
|
@@ -51,340 +54,17 @@ class Assets {
|
|
|
51
54
|
constructor(_options) {
|
|
52
55
|
this._options = _options;
|
|
53
56
|
}
|
|
54
|
-
|
|
55
|
-
* Delete a specific rule by its ID.
|
|
56
|
-
*
|
|
57
|
-
* @param {RulebricksApi.DeleteRuleRequest} request
|
|
58
|
-
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
|
-
*
|
|
60
|
-
* @throws {@link RulebricksApi.BadRequestError}
|
|
61
|
-
* @throws {@link RulebricksApi.NotFoundError}
|
|
62
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* await client.assets.deleteRule({
|
|
66
|
-
* id: "id"
|
|
67
|
-
* })
|
|
68
|
-
*/
|
|
69
|
-
deleteRule(request, requestOptions) {
|
|
57
|
+
get rules() {
|
|
70
58
|
var _a;
|
|
71
|
-
return
|
|
72
|
-
const _response = yield core.fetcher({
|
|
73
|
-
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)), "api/v1/admin/rules/delete"),
|
|
74
|
-
method: "DELETE",
|
|
75
|
-
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),
|
|
76
|
-
contentType: "application/json",
|
|
77
|
-
requestType: "json",
|
|
78
|
-
body: serializers.DeleteRuleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
79
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
80
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
81
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
82
|
-
});
|
|
83
|
-
if (_response.ok) {
|
|
84
|
-
return serializers.SuccessMessage.parseOrThrow(_response.body, {
|
|
85
|
-
unrecognizedObjectKeys: "passthrough",
|
|
86
|
-
allowUnrecognizedUnionMembers: true,
|
|
87
|
-
allowUnrecognizedEnumValues: true,
|
|
88
|
-
breadcrumbsPrefix: ["response"],
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
if (_response.error.reason === "status-code") {
|
|
92
|
-
switch (_response.error.statusCode) {
|
|
93
|
-
case 400:
|
|
94
|
-
throw new RulebricksApi.BadRequestError(_response.error.body);
|
|
95
|
-
case 404:
|
|
96
|
-
throw new RulebricksApi.NotFoundError(_response.error.body);
|
|
97
|
-
case 500:
|
|
98
|
-
throw new RulebricksApi.InternalServerError(_response.error.body);
|
|
99
|
-
default:
|
|
100
|
-
throw new errors.RulebricksApiError({
|
|
101
|
-
statusCode: _response.error.statusCode,
|
|
102
|
-
body: _response.error.body,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
switch (_response.error.reason) {
|
|
107
|
-
case "non-json":
|
|
108
|
-
throw new errors.RulebricksApiError({
|
|
109
|
-
statusCode: _response.error.statusCode,
|
|
110
|
-
body: _response.error.rawBody,
|
|
111
|
-
});
|
|
112
|
-
case "timeout":
|
|
113
|
-
throw new errors.RulebricksApiTimeoutError("Timeout exceeded when calling DELETE /api/v1/admin/rules/delete.");
|
|
114
|
-
case "unknown":
|
|
115
|
-
throw new errors.RulebricksApiError({
|
|
116
|
-
message: _response.error.errorMessage,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
});
|
|
59
|
+
return ((_a = this._rules) !== null && _a !== void 0 ? _a : (this._rules = new Client_1.Rules(this._options)));
|
|
120
60
|
}
|
|
121
|
-
|
|
122
|
-
* Export a specific rule by its ID.
|
|
123
|
-
*
|
|
124
|
-
* @param {RulebricksApi.ExportRuleRequest} request
|
|
125
|
-
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
126
|
-
*
|
|
127
|
-
* @throws {@link RulebricksApi.BadRequestError}
|
|
128
|
-
* @throws {@link RulebricksApi.NotFoundError}
|
|
129
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* await client.assets.exportRule({
|
|
133
|
-
* id: "id"
|
|
134
|
-
* })
|
|
135
|
-
*/
|
|
136
|
-
exportRule(request, requestOptions) {
|
|
61
|
+
get flows() {
|
|
137
62
|
var _a;
|
|
138
|
-
return
|
|
139
|
-
const { id } = request;
|
|
140
|
-
const _queryParams = {};
|
|
141
|
-
_queryParams["id"] = id;
|
|
142
|
-
const _response = yield core.fetcher({
|
|
143
|
-
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)), "api/v1/admin/rules/export"),
|
|
144
|
-
method: "GET",
|
|
145
|
-
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),
|
|
146
|
-
contentType: "application/json",
|
|
147
|
-
queryParameters: _queryParams,
|
|
148
|
-
requestType: "json",
|
|
149
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
150
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
151
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
152
|
-
});
|
|
153
|
-
if (_response.ok) {
|
|
154
|
-
return serializers.RuleExport.parseOrThrow(_response.body, {
|
|
155
|
-
unrecognizedObjectKeys: "passthrough",
|
|
156
|
-
allowUnrecognizedUnionMembers: true,
|
|
157
|
-
allowUnrecognizedEnumValues: true,
|
|
158
|
-
breadcrumbsPrefix: ["response"],
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
if (_response.error.reason === "status-code") {
|
|
162
|
-
switch (_response.error.statusCode) {
|
|
163
|
-
case 400:
|
|
164
|
-
throw new RulebricksApi.BadRequestError(_response.error.body);
|
|
165
|
-
case 404:
|
|
166
|
-
throw new RulebricksApi.NotFoundError(_response.error.body);
|
|
167
|
-
case 500:
|
|
168
|
-
throw new RulebricksApi.InternalServerError(_response.error.body);
|
|
169
|
-
default:
|
|
170
|
-
throw new errors.RulebricksApiError({
|
|
171
|
-
statusCode: _response.error.statusCode,
|
|
172
|
-
body: _response.error.body,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
switch (_response.error.reason) {
|
|
177
|
-
case "non-json":
|
|
178
|
-
throw new errors.RulebricksApiError({
|
|
179
|
-
statusCode: _response.error.statusCode,
|
|
180
|
-
body: _response.error.rawBody,
|
|
181
|
-
});
|
|
182
|
-
case "timeout":
|
|
183
|
-
throw new errors.RulebricksApiTimeoutError("Timeout exceeded when calling GET /api/v1/admin/rules/export.");
|
|
184
|
-
case "unknown":
|
|
185
|
-
throw new errors.RulebricksApiError({
|
|
186
|
-
message: _response.error.errorMessage,
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Import a rule into the user's account.
|
|
193
|
-
*
|
|
194
|
-
* @param {RulebricksApi.ImportRuleRequest} request
|
|
195
|
-
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
196
|
-
*
|
|
197
|
-
* @throws {@link RulebricksApi.BadRequestError}
|
|
198
|
-
* @throws {@link RulebricksApi.ForbiddenError}
|
|
199
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* await client.assets.importRule({
|
|
203
|
-
* rule: {
|
|
204
|
-
* "key": "value"
|
|
205
|
-
* }
|
|
206
|
-
* })
|
|
207
|
-
*/
|
|
208
|
-
importRule(request, requestOptions) {
|
|
209
|
-
var _a;
|
|
210
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
211
|
-
const _response = yield core.fetcher({
|
|
212
|
-
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)), "api/v1/admin/rules/import"),
|
|
213
|
-
method: "POST",
|
|
214
|
-
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),
|
|
215
|
-
contentType: "application/json",
|
|
216
|
-
requestType: "json",
|
|
217
|
-
body: serializers.ImportRuleRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
218
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
219
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
220
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
221
|
-
});
|
|
222
|
-
if (_response.ok) {
|
|
223
|
-
return serializers.RuleExport.parseOrThrow(_response.body, {
|
|
224
|
-
unrecognizedObjectKeys: "passthrough",
|
|
225
|
-
allowUnrecognizedUnionMembers: true,
|
|
226
|
-
allowUnrecognizedEnumValues: true,
|
|
227
|
-
breadcrumbsPrefix: ["response"],
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
if (_response.error.reason === "status-code") {
|
|
231
|
-
switch (_response.error.statusCode) {
|
|
232
|
-
case 400:
|
|
233
|
-
throw new RulebricksApi.BadRequestError(_response.error.body);
|
|
234
|
-
case 403:
|
|
235
|
-
throw new RulebricksApi.ForbiddenError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
236
|
-
unrecognizedObjectKeys: "passthrough",
|
|
237
|
-
allowUnrecognizedUnionMembers: true,
|
|
238
|
-
allowUnrecognizedEnumValues: true,
|
|
239
|
-
breadcrumbsPrefix: ["response"],
|
|
240
|
-
}));
|
|
241
|
-
case 500:
|
|
242
|
-
throw new RulebricksApi.InternalServerError(_response.error.body);
|
|
243
|
-
default:
|
|
244
|
-
throw new errors.RulebricksApiError({
|
|
245
|
-
statusCode: _response.error.statusCode,
|
|
246
|
-
body: _response.error.body,
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
switch (_response.error.reason) {
|
|
251
|
-
case "non-json":
|
|
252
|
-
throw new errors.RulebricksApiError({
|
|
253
|
-
statusCode: _response.error.statusCode,
|
|
254
|
-
body: _response.error.rawBody,
|
|
255
|
-
});
|
|
256
|
-
case "timeout":
|
|
257
|
-
throw new errors.RulebricksApiTimeoutError("Timeout exceeded when calling POST /api/v1/admin/rules/import.");
|
|
258
|
-
case "unknown":
|
|
259
|
-
throw new errors.RulebricksApiError({
|
|
260
|
-
message: _response.error.errorMessage,
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* List all rules in the organization. Optionally filter by folder name or ID.
|
|
267
|
-
*
|
|
268
|
-
* @param {RulebricksApi.ListRulesRequest} request
|
|
269
|
-
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
270
|
-
*
|
|
271
|
-
* @throws {@link RulebricksApi.BadRequestError}
|
|
272
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
273
|
-
*
|
|
274
|
-
* @example
|
|
275
|
-
* await client.assets.listRules()
|
|
276
|
-
*/
|
|
277
|
-
listRules(request = {}, requestOptions) {
|
|
278
|
-
var _a;
|
|
279
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
280
|
-
const { folder } = request;
|
|
281
|
-
const _queryParams = {};
|
|
282
|
-
if (folder != null) {
|
|
283
|
-
_queryParams["folder"] = folder;
|
|
284
|
-
}
|
|
285
|
-
const _response = yield core.fetcher({
|
|
286
|
-
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)), "api/v1/admin/rules/list"),
|
|
287
|
-
method: "GET",
|
|
288
|
-
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),
|
|
289
|
-
contentType: "application/json",
|
|
290
|
-
queryParameters: _queryParams,
|
|
291
|
-
requestType: "json",
|
|
292
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
293
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
294
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
295
|
-
});
|
|
296
|
-
if (_response.ok) {
|
|
297
|
-
return serializers.RuleListResponse.parseOrThrow(_response.body, {
|
|
298
|
-
unrecognizedObjectKeys: "passthrough",
|
|
299
|
-
allowUnrecognizedUnionMembers: true,
|
|
300
|
-
allowUnrecognizedEnumValues: true,
|
|
301
|
-
breadcrumbsPrefix: ["response"],
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
if (_response.error.reason === "status-code") {
|
|
305
|
-
switch (_response.error.statusCode) {
|
|
306
|
-
case 400:
|
|
307
|
-
throw new RulebricksApi.BadRequestError(_response.error.body);
|
|
308
|
-
case 500:
|
|
309
|
-
throw new RulebricksApi.InternalServerError(_response.error.body);
|
|
310
|
-
default:
|
|
311
|
-
throw new errors.RulebricksApiError({
|
|
312
|
-
statusCode: _response.error.statusCode,
|
|
313
|
-
body: _response.error.body,
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
switch (_response.error.reason) {
|
|
318
|
-
case "non-json":
|
|
319
|
-
throw new errors.RulebricksApiError({
|
|
320
|
-
statusCode: _response.error.statusCode,
|
|
321
|
-
body: _response.error.rawBody,
|
|
322
|
-
});
|
|
323
|
-
case "timeout":
|
|
324
|
-
throw new errors.RulebricksApiTimeoutError("Timeout exceeded when calling GET /api/v1/admin/rules/list.");
|
|
325
|
-
case "unknown":
|
|
326
|
-
throw new errors.RulebricksApiError({
|
|
327
|
-
message: _response.error.errorMessage,
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
});
|
|
63
|
+
return ((_a = this._flows) !== null && _a !== void 0 ? _a : (this._flows = new Client_2.Flows(this._options)));
|
|
331
64
|
}
|
|
332
|
-
|
|
333
|
-
* List all flows in the organization.
|
|
334
|
-
*
|
|
335
|
-
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
336
|
-
*
|
|
337
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
338
|
-
*
|
|
339
|
-
* @example
|
|
340
|
-
* await client.assets.listFlows()
|
|
341
|
-
*/
|
|
342
|
-
listFlows(requestOptions) {
|
|
65
|
+
get folders() {
|
|
343
66
|
var _a;
|
|
344
|
-
return
|
|
345
|
-
const _response = yield core.fetcher({
|
|
346
|
-
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)), "api/v1/admin/flows/list"),
|
|
347
|
-
method: "GET",
|
|
348
|
-
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),
|
|
349
|
-
contentType: "application/json",
|
|
350
|
-
requestType: "json",
|
|
351
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
352
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
353
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
354
|
-
});
|
|
355
|
-
if (_response.ok) {
|
|
356
|
-
return serializers.FlowListResponse.parseOrThrow(_response.body, {
|
|
357
|
-
unrecognizedObjectKeys: "passthrough",
|
|
358
|
-
allowUnrecognizedUnionMembers: true,
|
|
359
|
-
allowUnrecognizedEnumValues: true,
|
|
360
|
-
breadcrumbsPrefix: ["response"],
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
if (_response.error.reason === "status-code") {
|
|
364
|
-
switch (_response.error.statusCode) {
|
|
365
|
-
case 500:
|
|
366
|
-
throw new RulebricksApi.InternalServerError(_response.error.body);
|
|
367
|
-
default:
|
|
368
|
-
throw new errors.RulebricksApiError({
|
|
369
|
-
statusCode: _response.error.statusCode,
|
|
370
|
-
body: _response.error.body,
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
switch (_response.error.reason) {
|
|
375
|
-
case "non-json":
|
|
376
|
-
throw new errors.RulebricksApiError({
|
|
377
|
-
statusCode: _response.error.statusCode,
|
|
378
|
-
body: _response.error.rawBody,
|
|
379
|
-
});
|
|
380
|
-
case "timeout":
|
|
381
|
-
throw new errors.RulebricksApiTimeoutError("Timeout exceeded when calling GET /api/v1/admin/flows/list.");
|
|
382
|
-
case "unknown":
|
|
383
|
-
throw new errors.RulebricksApiError({
|
|
384
|
-
message: _response.error.errorMessage,
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
});
|
|
67
|
+
return ((_a = this._folders) !== null && _a !== void 0 ? _a : (this._folders = new Client_3.Folders(this._options)));
|
|
388
68
|
}
|
|
389
69
|
/**
|
|
390
70
|
* Get the rule execution usage of your organization.
|
|
@@ -395,10 +75,10 @@ class Assets {
|
|
|
395
75
|
* await client.assets.getUsage()
|
|
396
76
|
*/
|
|
397
77
|
getUsage(requestOptions) {
|
|
398
|
-
var _a;
|
|
78
|
+
var _a, _b;
|
|
399
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
400
80
|
const _response = yield core.fetcher({
|
|
401
|
-
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)), "
|
|
81
|
+
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, "admin/usage"),
|
|
402
82
|
method: "GET",
|
|
403
83
|
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),
|
|
404
84
|
contentType: "application/json",
|
|
@@ -416,210 +96,21 @@ class Assets {
|
|
|
416
96
|
});
|
|
417
97
|
}
|
|
418
98
|
if (_response.error.reason === "status-code") {
|
|
419
|
-
throw new errors.
|
|
99
|
+
throw new errors.RulebricksError({
|
|
420
100
|
statusCode: _response.error.statusCode,
|
|
421
101
|
body: _response.error.body,
|
|
422
102
|
});
|
|
423
103
|
}
|
|
424
104
|
switch (_response.error.reason) {
|
|
425
105
|
case "non-json":
|
|
426
|
-
throw new errors.
|
|
427
|
-
statusCode: _response.error.statusCode,
|
|
428
|
-
body: _response.error.rawBody,
|
|
429
|
-
});
|
|
430
|
-
case "timeout":
|
|
431
|
-
throw new errors.RulebricksApiTimeoutError("Timeout exceeded when calling GET /api/v1/admin/usage.");
|
|
432
|
-
case "unknown":
|
|
433
|
-
throw new errors.RulebricksApiError({
|
|
434
|
-
message: _response.error.errorMessage,
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Retrieve all rule folders for the authenticated user.
|
|
441
|
-
*
|
|
442
|
-
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
443
|
-
*
|
|
444
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
445
|
-
*
|
|
446
|
-
* @example
|
|
447
|
-
* await client.assets.listFolders()
|
|
448
|
-
*/
|
|
449
|
-
listFolders(requestOptions) {
|
|
450
|
-
var _a;
|
|
451
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
452
|
-
const _response = yield core.fetcher({
|
|
453
|
-
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)), "api/v1/admin/folders"),
|
|
454
|
-
method: "GET",
|
|
455
|
-
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),
|
|
456
|
-
contentType: "application/json",
|
|
457
|
-
requestType: "json",
|
|
458
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
459
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
460
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
461
|
-
});
|
|
462
|
-
if (_response.ok) {
|
|
463
|
-
return serializers.FolderListResponse.parseOrThrow(_response.body, {
|
|
464
|
-
unrecognizedObjectKeys: "passthrough",
|
|
465
|
-
allowUnrecognizedUnionMembers: true,
|
|
466
|
-
allowUnrecognizedEnumValues: true,
|
|
467
|
-
breadcrumbsPrefix: ["response"],
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
if (_response.error.reason === "status-code") {
|
|
471
|
-
switch (_response.error.statusCode) {
|
|
472
|
-
case 500:
|
|
473
|
-
throw new RulebricksApi.InternalServerError(_response.error.body);
|
|
474
|
-
default:
|
|
475
|
-
throw new errors.RulebricksApiError({
|
|
476
|
-
statusCode: _response.error.statusCode,
|
|
477
|
-
body: _response.error.body,
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
switch (_response.error.reason) {
|
|
482
|
-
case "non-json":
|
|
483
|
-
throw new errors.RulebricksApiError({
|
|
484
|
-
statusCode: _response.error.statusCode,
|
|
485
|
-
body: _response.error.rawBody,
|
|
486
|
-
});
|
|
487
|
-
case "timeout":
|
|
488
|
-
throw new errors.RulebricksApiTimeoutError("Timeout exceeded when calling GET /api/v1/admin/folders.");
|
|
489
|
-
case "unknown":
|
|
490
|
-
throw new errors.RulebricksApiError({
|
|
491
|
-
message: _response.error.errorMessage,
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Create a new rule folder or update an existing one for the authenticated user.
|
|
498
|
-
*
|
|
499
|
-
* @param {RulebricksApi.UpsertFolderRequest} request
|
|
500
|
-
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
501
|
-
*
|
|
502
|
-
* @throws {@link RulebricksApi.BadRequestError}
|
|
503
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
504
|
-
*
|
|
505
|
-
* @example
|
|
506
|
-
* await client.assets.upsertFolder({
|
|
507
|
-
* name: "Marketing Rules",
|
|
508
|
-
* description: "Rules for marketing automation workflows"
|
|
509
|
-
* })
|
|
510
|
-
*/
|
|
511
|
-
upsertFolder(request, requestOptions) {
|
|
512
|
-
var _a;
|
|
513
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
514
|
-
const _response = yield core.fetcher({
|
|
515
|
-
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)), "api/v1/admin/folders"),
|
|
516
|
-
method: "POST",
|
|
517
|
-
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),
|
|
518
|
-
contentType: "application/json",
|
|
519
|
-
requestType: "json",
|
|
520
|
-
body: serializers.UpsertFolderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
521
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
522
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
523
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
524
|
-
});
|
|
525
|
-
if (_response.ok) {
|
|
526
|
-
return serializers.Folder.parseOrThrow(_response.body, {
|
|
527
|
-
unrecognizedObjectKeys: "passthrough",
|
|
528
|
-
allowUnrecognizedUnionMembers: true,
|
|
529
|
-
allowUnrecognizedEnumValues: true,
|
|
530
|
-
breadcrumbsPrefix: ["response"],
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
if (_response.error.reason === "status-code") {
|
|
534
|
-
switch (_response.error.statusCode) {
|
|
535
|
-
case 400:
|
|
536
|
-
throw new RulebricksApi.BadRequestError(_response.error.body);
|
|
537
|
-
case 500:
|
|
538
|
-
throw new RulebricksApi.InternalServerError(_response.error.body);
|
|
539
|
-
default:
|
|
540
|
-
throw new errors.RulebricksApiError({
|
|
541
|
-
statusCode: _response.error.statusCode,
|
|
542
|
-
body: _response.error.body,
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
switch (_response.error.reason) {
|
|
547
|
-
case "non-json":
|
|
548
|
-
throw new errors.RulebricksApiError({
|
|
549
|
-
statusCode: _response.error.statusCode,
|
|
550
|
-
body: _response.error.rawBody,
|
|
551
|
-
});
|
|
552
|
-
case "timeout":
|
|
553
|
-
throw new errors.RulebricksApiTimeoutError("Timeout exceeded when calling POST /api/v1/admin/folders.");
|
|
554
|
-
case "unknown":
|
|
555
|
-
throw new errors.RulebricksApiError({
|
|
556
|
-
message: _response.error.errorMessage,
|
|
557
|
-
});
|
|
558
|
-
}
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Delete a specific rule folder for the authenticated user. This does not delete the rules within the folder.
|
|
563
|
-
*
|
|
564
|
-
* @param {RulebricksApi.DeleteFolderRequest} request
|
|
565
|
-
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
566
|
-
*
|
|
567
|
-
* @throws {@link RulebricksApi.BadRequestError}
|
|
568
|
-
* @throws {@link RulebricksApi.NotFoundError}
|
|
569
|
-
* @throws {@link RulebricksApi.InternalServerError}
|
|
570
|
-
*
|
|
571
|
-
* @example
|
|
572
|
-
* await client.assets.deleteFolder({
|
|
573
|
-
* id: "abc123"
|
|
574
|
-
* })
|
|
575
|
-
*/
|
|
576
|
-
deleteFolder(request, requestOptions) {
|
|
577
|
-
var _a;
|
|
578
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
579
|
-
const _response = yield core.fetcher({
|
|
580
|
-
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)), "api/v1/admin/folders"),
|
|
581
|
-
method: "DELETE",
|
|
582
|
-
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),
|
|
583
|
-
contentType: "application/json",
|
|
584
|
-
requestType: "json",
|
|
585
|
-
body: serializers.DeleteFolderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
586
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
587
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
588
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
589
|
-
});
|
|
590
|
-
if (_response.ok) {
|
|
591
|
-
return serializers.Folder.parseOrThrow(_response.body, {
|
|
592
|
-
unrecognizedObjectKeys: "passthrough",
|
|
593
|
-
allowUnrecognizedUnionMembers: true,
|
|
594
|
-
allowUnrecognizedEnumValues: true,
|
|
595
|
-
breadcrumbsPrefix: ["response"],
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
if (_response.error.reason === "status-code") {
|
|
599
|
-
switch (_response.error.statusCode) {
|
|
600
|
-
case 400:
|
|
601
|
-
throw new RulebricksApi.BadRequestError(_response.error.body);
|
|
602
|
-
case 404:
|
|
603
|
-
throw new RulebricksApi.NotFoundError(_response.error.body);
|
|
604
|
-
case 500:
|
|
605
|
-
throw new RulebricksApi.InternalServerError(_response.error.body);
|
|
606
|
-
default:
|
|
607
|
-
throw new errors.RulebricksApiError({
|
|
608
|
-
statusCode: _response.error.statusCode,
|
|
609
|
-
body: _response.error.body,
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
switch (_response.error.reason) {
|
|
614
|
-
case "non-json":
|
|
615
|
-
throw new errors.RulebricksApiError({
|
|
106
|
+
throw new errors.RulebricksError({
|
|
616
107
|
statusCode: _response.error.statusCode,
|
|
617
108
|
body: _response.error.rawBody,
|
|
618
109
|
});
|
|
619
110
|
case "timeout":
|
|
620
|
-
throw new errors.
|
|
111
|
+
throw new errors.RulebricksTimeoutError("Timeout exceeded when calling GET /admin/usage.");
|
|
621
112
|
case "unknown":
|
|
622
|
-
throw new errors.
|
|
113
|
+
throw new errors.RulebricksError({
|
|
623
114
|
message: _response.error.errorMessage,
|
|
624
115
|
});
|
|
625
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments";
|
|
5
|
+
import * as core from "../../../../../../core";
|
|
6
|
+
import * as Rulebricks from "../../../../../index";
|
|
7
|
+
export declare namespace Flows {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.RulebricksEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
apiKey: core.Supplier<string>;
|
|
13
|
+
}
|
|
14
|
+
interface RequestOptions {
|
|
15
|
+
/** The maximum time to wait for a response in seconds. */
|
|
16
|
+
timeoutInSeconds?: number;
|
|
17
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
18
|
+
maxRetries?: number;
|
|
19
|
+
/** A hook to abort the request. */
|
|
20
|
+
abortSignal?: AbortSignal;
|
|
21
|
+
/** Additional headers to include in the request. */
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export declare class Flows {
|
|
26
|
+
protected readonly _options: Flows.Options;
|
|
27
|
+
constructor(_options: Flows.Options);
|
|
28
|
+
/**
|
|
29
|
+
* List all flows in the organization.
|
|
30
|
+
*
|
|
31
|
+
* @param {Flows.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* await client.assets.flows.list()
|
|
37
|
+
*/
|
|
38
|
+
list(requestOptions?: Flows.RequestOptions): Promise<Rulebricks.FlowListResponse>;
|
|
39
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
40
|
+
"x-api-key": string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|