@rulebricks/sdk 1.2.1 → 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.
Files changed (487) hide show
  1. package/Client.d.ts +12 -11
  2. package/Client.js +15 -15
  3. package/api/errors/BadRequestError.d.ts +1 -1
  4. package/api/errors/BadRequestError.js +1 -1
  5. package/api/errors/ForbiddenError.d.ts +3 -3
  6. package/api/errors/ForbiddenError.js +1 -1
  7. package/api/errors/InternalServerError.d.ts +1 -1
  8. package/api/errors/InternalServerError.js +1 -1
  9. package/api/errors/NotFoundError.d.ts +1 -1
  10. package/api/errors/NotFoundError.js +1 -1
  11. package/api/resources/assets/client/Client.d.ts +13 -120
  12. package/api/resources/assets/client/Client.js +17 -526
  13. package/api/resources/assets/client/index.d.ts +1 -1
  14. package/api/resources/assets/client/index.js +0 -15
  15. package/api/resources/assets/index.d.ts +1 -0
  16. package/api/resources/assets/index.js +1 -0
  17. package/api/resources/assets/resources/flows/client/Client.d.ts +42 -0
  18. package/api/resources/assets/resources/flows/client/Client.js +116 -0
  19. package/api/resources/assets/resources/flows/client/index.d.ts +1 -0
  20. package/api/resources/assets/resources/flows/index.d.ts +1 -0
  21. package/api/resources/assets/resources/flows/index.js +17 -0
  22. package/api/resources/assets/resources/folders/client/Client.d.ts +74 -0
  23. package/api/resources/assets/resources/folders/client/Client.js +248 -0
  24. package/api/resources/assets/resources/folders/client/requests/index.d.ts +2 -0
  25. package/api/resources/assets/resources/folders/index.d.ts +1 -0
  26. package/api/resources/assets/resources/folders/index.js +17 -0
  27. package/api/resources/assets/resources/index.d.ts +5 -0
  28. package/api/resources/assets/resources/index.js +34 -0
  29. package/api/resources/assets/resources/rules/client/Client.d.ts +94 -0
  30. package/api/resources/assets/resources/rules/client/Client.js +337 -0
  31. package/{dist/api/resources/assets/client/requests/ListRulesRequest.d.ts → api/resources/assets/resources/rules/client/requests/RulesListRequest.d.ts} +1 -1
  32. package/{dist/api/resources/assets/client/requests/ExportRuleRequest.d.ts → api/resources/assets/resources/rules/client/requests/RulesPullRequest.d.ts} +1 -1
  33. package/api/resources/assets/resources/rules/client/requests/index.d.ts +4 -0
  34. package/api/resources/assets/resources/rules/client/requests/index.js +2 -0
  35. package/api/resources/assets/resources/rules/index.d.ts +1 -0
  36. package/api/resources/assets/resources/rules/index.js +17 -0
  37. package/api/resources/decisions/client/Client.d.ts +7 -6
  38. package/api/resources/decisions/client/Client.js +13 -12
  39. package/{dist/api/resources/decisions/client/requests/QueryRequest.d.ts → api/resources/decisions/client/requests/DecisionsQueryRequest.d.ts} +1 -1
  40. package/api/resources/decisions/client/requests/index.d.ts +1 -1
  41. package/api/resources/flows/client/Client.d.ts +7 -6
  42. package/api/resources/flows/client/Client.js +13 -12
  43. package/api/resources/index.d.ts +0 -1
  44. package/api/resources/index.js +0 -1
  45. package/api/resources/rules/client/Client.d.ts +15 -14
  46. package/api/resources/rules/client/Client.js +35 -34
  47. package/api/resources/tests/client/Client.d.ts +8 -120
  48. package/api/resources/tests/client/Client.js +6 -441
  49. package/api/resources/tests/index.d.ts +1 -0
  50. package/api/resources/tests/index.js +1 -0
  51. package/api/resources/tests/resources/flows/client/Client.d.ts +82 -0
  52. package/api/resources/tests/resources/flows/client/Client.js +257 -0
  53. package/api/resources/tests/resources/flows/client/index.d.ts +1 -0
  54. package/api/resources/tests/resources/flows/client/index.js +2 -0
  55. package/api/resources/tests/resources/flows/index.d.ts +1 -0
  56. package/api/resources/tests/resources/flows/index.js +17 -0
  57. package/api/resources/tests/resources/index.d.ts +2 -0
  58. package/api/resources/tests/resources/index.js +28 -0
  59. package/api/resources/tests/resources/rules/client/Client.d.ts +82 -0
  60. package/api/resources/tests/resources/rules/client/Client.js +257 -0
  61. package/api/resources/tests/resources/rules/client/index.d.ts +1 -0
  62. package/api/resources/tests/resources/rules/client/index.js +2 -0
  63. package/api/resources/tests/resources/rules/index.d.ts +1 -0
  64. package/api/resources/tests/resources/rules/index.js +17 -0
  65. package/api/resources/users/client/Client.d.ts +12 -35
  66. package/api/resources/users/client/Client.js +21 -137
  67. package/api/resources/users/client/requests/UserInviteRequest.d.ts +2 -2
  68. package/api/resources/users/client/requests/index.d.ts +0 -1
  69. package/api/resources/users/index.d.ts +1 -0
  70. package/api/resources/users/index.js +1 -0
  71. package/api/resources/users/resources/groups/client/Client.d.ts +58 -0
  72. package/api/resources/users/resources/groups/client/Client.js +181 -0
  73. package/api/resources/users/resources/groups/client/index.d.ts +1 -0
  74. package/api/resources/users/resources/groups/client/index.js +17 -0
  75. package/api/resources/users/resources/groups/client/requests/index.d.ts +1 -0
  76. package/api/resources/users/resources/groups/client/requests/index.js +2 -0
  77. package/api/resources/users/resources/groups/index.d.ts +1 -0
  78. package/api/resources/users/resources/groups/index.js +17 -0
  79. package/api/resources/users/resources/index.d.ts +2 -0
  80. package/api/resources/users/resources/index.js +31 -0
  81. package/api/resources/values/client/Client.d.ts +15 -14
  82. package/api/resources/values/client/Client.js +35 -34
  83. package/api/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -2
  84. package/{dist/api/resources/values/client/requests/DeleteRequest.d.ts → api/resources/values/client/requests/ValuesDeleteRequest.d.ts} +1 -1
  85. package/{dist/api/resources/values/client/requests/ListRequest.d.ts → api/resources/values/client/requests/ValuesListRequest.d.ts} +2 -2
  86. package/api/resources/values/client/requests/index.d.ts +2 -2
  87. package/api/types/BooleanValue.d.ts +2 -2
  88. package/api/types/BulkRuleResponseItem.d.ts +2 -2
  89. package/api/types/DecisionLog.d.ts +4 -4
  90. package/api/types/DecisionLogDecision.d.ts +2 -2
  91. package/api/types/DecisionLogResponse.d.ts +2 -2
  92. package/api/types/DynamicValue.d.ts +6 -6
  93. package/api/types/DynamicValueBase.d.ts +2 -2
  94. package/api/types/DynamicValueListResponse.d.ts +2 -2
  95. package/api/types/FlowDetail.d.ts +2 -2
  96. package/api/types/FlowListResponse.d.ts +2 -2
  97. package/api/types/FolderListResponse.d.ts +2 -2
  98. package/api/types/ListValue.d.ts +3 -3
  99. package/api/types/NumberValue.d.ts +2 -2
  100. package/api/types/ParallelSolveRequest.d.ts +2 -2
  101. package/api/types/ParallelSolveResponse.d.ts +2 -2
  102. package/api/types/RuleDetail.d.ts +5 -5
  103. package/api/types/RuleListResponse.d.ts +2 -2
  104. package/api/types/SchemaField.d.ts +3 -3
  105. package/api/types/StringValue.d.ts +2 -2
  106. package/api/types/Test.d.ts +2 -2
  107. package/api/types/TestListResponse.d.ts +2 -2
  108. package/api/types/TestTestState.d.ts +3 -3
  109. package/api/types/UserGroupListResponse.d.ts +2 -2
  110. package/api/types/UserInviteResponse.d.ts +2 -2
  111. package/dist/Client.d.ts +12 -11
  112. package/dist/Client.js +15 -15
  113. package/dist/api/errors/BadRequestError.d.ts +1 -1
  114. package/dist/api/errors/BadRequestError.js +1 -1
  115. package/dist/api/errors/ForbiddenError.d.ts +3 -3
  116. package/dist/api/errors/ForbiddenError.js +1 -1
  117. package/dist/api/errors/InternalServerError.d.ts +1 -1
  118. package/dist/api/errors/InternalServerError.js +1 -1
  119. package/dist/api/errors/NotFoundError.d.ts +1 -1
  120. package/dist/api/errors/NotFoundError.js +1 -1
  121. package/dist/api/resources/assets/client/Client.d.ts +13 -120
  122. package/dist/api/resources/assets/client/Client.js +17 -526
  123. package/dist/api/resources/assets/client/index.d.ts +1 -1
  124. package/dist/api/resources/assets/client/index.js +0 -15
  125. package/dist/api/resources/assets/index.d.ts +1 -0
  126. package/dist/api/resources/assets/index.js +1 -0
  127. package/dist/api/resources/assets/resources/flows/client/Client.d.ts +42 -0
  128. package/dist/api/resources/assets/resources/flows/client/Client.js +116 -0
  129. package/dist/api/resources/assets/resources/flows/client/index.d.ts +1 -0
  130. package/dist/api/resources/assets/resources/flows/client/index.js +2 -0
  131. package/dist/api/resources/assets/resources/flows/index.d.ts +1 -0
  132. package/dist/api/resources/assets/resources/flows/index.js +17 -0
  133. package/dist/api/resources/assets/resources/folders/client/Client.d.ts +74 -0
  134. package/dist/api/resources/assets/resources/folders/client/Client.js +248 -0
  135. package/dist/api/resources/assets/resources/folders/client/index.d.ts +1 -0
  136. package/dist/api/resources/assets/resources/folders/client/index.js +17 -0
  137. package/dist/api/resources/assets/resources/folders/client/requests/index.d.ts +2 -0
  138. package/dist/api/resources/assets/resources/folders/client/requests/index.js +2 -0
  139. package/dist/api/resources/assets/resources/folders/index.d.ts +1 -0
  140. package/dist/api/resources/assets/resources/folders/index.js +17 -0
  141. package/dist/api/resources/assets/resources/index.d.ts +5 -0
  142. package/dist/api/resources/assets/resources/index.js +34 -0
  143. package/dist/api/resources/assets/resources/rules/client/Client.d.ts +94 -0
  144. package/dist/api/resources/assets/resources/rules/client/Client.js +337 -0
  145. package/dist/api/resources/assets/resources/rules/client/index.d.ts +1 -0
  146. package/dist/api/resources/assets/resources/rules/client/index.js +17 -0
  147. package/{api/resources/assets/client/requests/ListRulesRequest.d.ts → dist/api/resources/assets/resources/rules/client/requests/RulesListRequest.d.ts} +1 -1
  148. package/{api/resources/assets/client/requests/ExportRuleRequest.d.ts → dist/api/resources/assets/resources/rules/client/requests/RulesPullRequest.d.ts} +1 -1
  149. package/dist/api/resources/assets/resources/rules/client/requests/index.d.ts +4 -0
  150. package/dist/api/resources/assets/resources/rules/client/requests/index.js +2 -0
  151. package/dist/api/resources/assets/resources/rules/index.d.ts +1 -0
  152. package/dist/api/resources/assets/resources/rules/index.js +17 -0
  153. package/dist/api/resources/decisions/client/Client.d.ts +7 -6
  154. package/dist/api/resources/decisions/client/Client.js +13 -12
  155. package/{api/resources/decisions/client/requests/QueryRequest.d.ts → dist/api/resources/decisions/client/requests/DecisionsQueryRequest.d.ts} +1 -1
  156. package/dist/api/resources/decisions/client/requests/index.d.ts +1 -1
  157. package/dist/api/resources/flows/client/Client.d.ts +7 -6
  158. package/dist/api/resources/flows/client/Client.js +13 -12
  159. package/dist/api/resources/index.d.ts +0 -1
  160. package/dist/api/resources/index.js +0 -1
  161. package/dist/api/resources/rules/client/Client.d.ts +15 -14
  162. package/dist/api/resources/rules/client/Client.js +35 -34
  163. package/dist/api/resources/tests/client/Client.d.ts +8 -120
  164. package/dist/api/resources/tests/client/Client.js +6 -441
  165. package/dist/api/resources/tests/index.d.ts +1 -0
  166. package/dist/api/resources/tests/index.js +1 -0
  167. package/dist/api/resources/tests/resources/flows/client/Client.d.ts +82 -0
  168. package/dist/api/resources/tests/resources/flows/client/Client.js +257 -0
  169. package/dist/api/resources/tests/resources/flows/client/index.d.ts +1 -0
  170. package/dist/api/resources/tests/resources/flows/client/index.js +2 -0
  171. package/dist/api/resources/tests/resources/flows/index.d.ts +1 -0
  172. package/dist/api/resources/tests/resources/flows/index.js +17 -0
  173. package/dist/api/resources/tests/resources/index.d.ts +2 -0
  174. package/dist/api/resources/tests/resources/index.js +28 -0
  175. package/dist/api/resources/tests/resources/rules/client/Client.d.ts +82 -0
  176. package/dist/api/resources/tests/resources/rules/client/Client.js +257 -0
  177. package/dist/api/resources/tests/resources/rules/client/index.d.ts +1 -0
  178. package/dist/api/resources/tests/resources/rules/client/index.js +2 -0
  179. package/dist/api/resources/tests/resources/rules/index.d.ts +1 -0
  180. package/dist/api/resources/tests/resources/rules/index.js +17 -0
  181. package/dist/api/resources/users/client/Client.d.ts +12 -35
  182. package/dist/api/resources/users/client/Client.js +21 -137
  183. package/dist/api/resources/users/client/requests/UserInviteRequest.d.ts +2 -2
  184. package/dist/api/resources/users/client/requests/index.d.ts +0 -1
  185. package/dist/api/resources/users/index.d.ts +1 -0
  186. package/dist/api/resources/users/index.js +1 -0
  187. package/dist/api/resources/users/resources/groups/client/Client.d.ts +58 -0
  188. package/dist/api/resources/users/resources/groups/client/Client.js +181 -0
  189. package/dist/api/resources/users/resources/groups/client/index.d.ts +1 -0
  190. package/dist/api/resources/users/resources/groups/client/index.js +17 -0
  191. package/dist/api/resources/users/resources/groups/client/requests/index.d.ts +1 -0
  192. package/dist/api/resources/users/resources/groups/client/requests/index.js +2 -0
  193. package/dist/api/resources/users/resources/groups/index.d.ts +1 -0
  194. package/dist/api/resources/users/resources/groups/index.js +17 -0
  195. package/dist/api/resources/users/resources/index.d.ts +2 -0
  196. package/dist/api/resources/users/resources/index.js +31 -0
  197. package/dist/api/resources/values/client/Client.d.ts +15 -14
  198. package/dist/api/resources/values/client/Client.js +35 -34
  199. package/dist/api/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -2
  200. package/{api/resources/values/client/requests/DeleteRequest.d.ts → dist/api/resources/values/client/requests/ValuesDeleteRequest.d.ts} +1 -1
  201. package/{api/resources/values/client/requests/ListRequest.d.ts → dist/api/resources/values/client/requests/ValuesListRequest.d.ts} +2 -2
  202. package/dist/api/resources/values/client/requests/index.d.ts +2 -2
  203. package/dist/api/types/BooleanValue.d.ts +2 -2
  204. package/dist/api/types/BulkRuleResponseItem.d.ts +2 -2
  205. package/dist/api/types/DecisionLog.d.ts +4 -4
  206. package/dist/api/types/DecisionLogDecision.d.ts +2 -2
  207. package/dist/api/types/DecisionLogResponse.d.ts +2 -2
  208. package/dist/api/types/DynamicValue.d.ts +6 -6
  209. package/dist/api/types/DynamicValueBase.d.ts +2 -2
  210. package/dist/api/types/DynamicValueListResponse.d.ts +2 -2
  211. package/dist/api/types/FlowDetail.d.ts +2 -2
  212. package/dist/api/types/FlowListResponse.d.ts +2 -2
  213. package/dist/api/types/FolderListResponse.d.ts +2 -2
  214. package/dist/api/types/ListValue.d.ts +3 -3
  215. package/dist/api/types/NumberValue.d.ts +2 -2
  216. package/dist/api/types/ParallelSolveRequest.d.ts +2 -2
  217. package/dist/api/types/ParallelSolveResponse.d.ts +2 -2
  218. package/dist/api/types/RuleDetail.d.ts +5 -5
  219. package/dist/api/types/RuleListResponse.d.ts +2 -2
  220. package/dist/api/types/SchemaField.d.ts +3 -3
  221. package/dist/api/types/StringValue.d.ts +2 -2
  222. package/dist/api/types/Test.d.ts +2 -2
  223. package/dist/api/types/TestListResponse.d.ts +2 -2
  224. package/dist/api/types/TestTestState.d.ts +3 -3
  225. package/dist/api/types/UserGroupListResponse.d.ts +2 -2
  226. package/dist/api/types/UserInviteResponse.d.ts +2 -2
  227. package/dist/environments.d.ts +7 -0
  228. package/dist/environments.js +9 -0
  229. package/dist/errors/{RulebricksApiError.d.ts → RulebricksError.d.ts} +1 -1
  230. package/dist/errors/{RulebricksApiError.js → RulebricksError.js} +4 -4
  231. package/dist/errors/{RulebricksApiTimeoutError.d.ts → RulebricksTimeoutError.d.ts} +1 -1
  232. package/dist/errors/RulebricksTimeoutError.js +13 -0
  233. package/dist/errors/index.d.ts +2 -2
  234. package/dist/errors/index.js +5 -5
  235. package/dist/forge/rule.d.ts +2 -2
  236. package/dist/forge/rule.js +8 -8
  237. package/dist/forge/values.d.ts +2 -2
  238. package/dist/index.d.ts +4 -3
  239. package/dist/index.js +7 -5
  240. package/dist/serialization/resources/assets/index.d.ts +1 -1
  241. package/dist/serialization/resources/assets/index.js +1 -1
  242. package/dist/serialization/resources/assets/resources/folders/client/index.d.ts +1 -0
  243. package/dist/serialization/resources/assets/resources/folders/client/index.js +17 -0
  244. package/dist/serialization/resources/assets/resources/folders/client/requests/DeleteFolderRequest.d.ts +12 -0
  245. package/dist/serialization/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.js +1 -1
  246. package/{serialization/resources/assets → dist/serialization/resources/assets/resources/folders}/client/requests/UpsertFolderRequest.d.ts +4 -4
  247. package/{serialization/resources/assets → dist/serialization/resources/assets/resources/folders}/client/requests/UpsertFolderRequest.js +1 -1
  248. package/{serialization/resources/assets → dist/serialization/resources/assets/resources/folders}/client/requests/index.d.ts +0 -2
  249. package/dist/serialization/resources/assets/resources/folders/client/requests/index.js +7 -0
  250. package/dist/serialization/resources/assets/resources/folders/index.d.ts +1 -0
  251. package/dist/serialization/resources/assets/resources/folders/index.js +17 -0
  252. package/dist/serialization/resources/assets/resources/index.d.ts +4 -0
  253. package/dist/serialization/resources/assets/resources/index.js +33 -0
  254. package/dist/serialization/resources/assets/resources/rules/client/index.d.ts +1 -0
  255. package/dist/serialization/resources/assets/resources/rules/client/index.js +17 -0
  256. package/dist/serialization/resources/assets/resources/rules/client/requests/DeleteRuleRequest.d.ts +12 -0
  257. package/{serialization/resources/assets → dist/serialization/resources/assets/resources/rules}/client/requests/DeleteRuleRequest.js +1 -1
  258. package/dist/serialization/resources/assets/resources/rules/client/requests/ImportRuleRequest.d.ts +12 -0
  259. package/{serialization/resources/assets → dist/serialization/resources/assets/resources/rules}/client/requests/ImportRuleRequest.js +1 -1
  260. package/dist/serialization/resources/assets/resources/rules/client/requests/index.d.ts +2 -0
  261. package/dist/serialization/resources/assets/resources/rules/client/requests/index.js +7 -0
  262. package/dist/serialization/resources/assets/resources/rules/index.d.ts +1 -0
  263. package/dist/serialization/resources/assets/resources/rules/index.js +17 -0
  264. package/dist/serialization/resources/index.d.ts +1 -2
  265. package/dist/serialization/resources/index.js +1 -2
  266. package/dist/serialization/resources/rules/client/bulkSolve.d.ts +3 -3
  267. package/dist/serialization/resources/users/client/requests/UserInviteRequest.d.ts +2 -2
  268. package/dist/serialization/resources/users/client/requests/index.d.ts +0 -1
  269. package/dist/serialization/resources/users/client/requests/index.js +1 -3
  270. package/dist/serialization/resources/users/index.d.ts +1 -0
  271. package/dist/serialization/resources/users/index.js +1 -0
  272. package/dist/serialization/resources/users/resources/groups/client/index.d.ts +1 -0
  273. package/dist/serialization/resources/users/resources/groups/client/index.js +17 -0
  274. package/dist/serialization/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.d.ts +4 -4
  275. package/dist/serialization/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.js +1 -1
  276. package/dist/serialization/resources/users/resources/groups/client/requests/index.d.ts +1 -0
  277. package/dist/serialization/resources/users/resources/groups/client/requests/index.js +5 -0
  278. package/dist/serialization/resources/users/resources/groups/index.d.ts +1 -0
  279. package/dist/serialization/resources/users/resources/groups/index.js +17 -0
  280. package/dist/serialization/resources/users/resources/index.d.ts +2 -0
  281. package/dist/serialization/resources/users/resources/index.js +31 -0
  282. package/dist/serialization/resources/users/types/UserInviteRequestRole.d.ts +2 -2
  283. package/dist/serialization/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -2
  284. package/dist/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +2 -2
  285. package/dist/serialization/types/BooleanValue.d.ts +2 -2
  286. package/dist/serialization/types/BulkRuleResponseItem.d.ts +2 -2
  287. package/dist/serialization/types/BulkRuleResponseItemError.d.ts +2 -2
  288. package/dist/serialization/types/CreateTestRequest.d.ts +2 -2
  289. package/dist/serialization/types/DecisionLog.d.ts +2 -2
  290. package/dist/serialization/types/DecisionLogDecision.d.ts +2 -2
  291. package/dist/serialization/types/DecisionLogDecisionConditionsItemValue.d.ts +2 -2
  292. package/dist/serialization/types/DecisionLogRequest.d.ts +2 -2
  293. package/dist/serialization/types/DecisionLogResponse.d.ts +2 -2
  294. package/dist/serialization/types/DynamicRequestPayload.d.ts +2 -2
  295. package/dist/serialization/types/DynamicResponsePayload.d.ts +2 -2
  296. package/dist/serialization/types/DynamicValue.d.ts +2 -2
  297. package/dist/serialization/types/DynamicValueBase.d.ts +2 -2
  298. package/dist/serialization/types/DynamicValueListResponse.d.ts +2 -2
  299. package/dist/serialization/types/Error_.d.ts +2 -2
  300. package/dist/serialization/types/FlowBase.d.ts +2 -2
  301. package/dist/serialization/types/FlowDetail.d.ts +2 -2
  302. package/dist/serialization/types/FlowExecutionError.d.ts +2 -2
  303. package/dist/serialization/types/FlowListResponse.d.ts +2 -2
  304. package/dist/serialization/types/Folder.d.ts +2 -2
  305. package/dist/serialization/types/FolderListResponse.d.ts +2 -2
  306. package/dist/serialization/types/ListValue.d.ts +2 -2
  307. package/dist/serialization/types/ListValueValueItem.d.ts +2 -2
  308. package/dist/serialization/types/NumberValue.d.ts +2 -2
  309. package/dist/serialization/types/ParallelSolveRequest.d.ts +2 -2
  310. package/dist/serialization/types/ParallelSolveRequestValue.d.ts +2 -2
  311. package/dist/serialization/types/ParallelSolveResponse.d.ts +2 -2
  312. package/dist/serialization/types/RuleBase.d.ts +2 -2
  313. package/dist/serialization/types/RuleDetail.d.ts +2 -2
  314. package/dist/serialization/types/RuleExport.d.ts +2 -2
  315. package/dist/serialization/types/RuleListResponse.d.ts +2 -2
  316. package/dist/serialization/types/RuleUsage.d.ts +2 -2
  317. package/dist/serialization/types/SchemaField.d.ts +2 -2
  318. package/dist/serialization/types/SchemaFieldDefaultValue.d.ts +2 -2
  319. package/dist/serialization/types/SchemaFieldType.d.ts +2 -2
  320. package/dist/serialization/types/StringValue.d.ts +2 -2
  321. package/dist/serialization/types/SuccessMessage.d.ts +2 -2
  322. package/dist/serialization/types/Test.d.ts +2 -2
  323. package/dist/serialization/types/TestListResponse.d.ts +2 -2
  324. package/dist/serialization/types/TestTestState.d.ts +2 -2
  325. package/dist/serialization/types/TestTestStateConditionsItemValue.d.ts +2 -2
  326. package/dist/serialization/types/TestTestStateEvaluationError.d.ts +2 -2
  327. package/dist/serialization/types/UsageStatistics.d.ts +2 -2
  328. package/dist/serialization/types/UserGroup.d.ts +2 -2
  329. package/dist/serialization/types/UserGroupListResponse.d.ts +2 -2
  330. package/dist/serialization/types/UserInviteResponse.d.ts +2 -2
  331. package/dist/serialization/types/UserInviteResponseUser.d.ts +2 -2
  332. package/dist/serialization/types/ValueLimits.d.ts +2 -2
  333. package/environments.d.ts +7 -0
  334. package/environments.js +9 -0
  335. package/errors/{RulebricksApiError.d.ts → RulebricksError.d.ts} +1 -1
  336. package/errors/{RulebricksApiError.js → RulebricksError.js} +4 -4
  337. package/errors/{RulebricksApiTimeoutError.d.ts → RulebricksTimeoutError.d.ts} +1 -1
  338. package/errors/RulebricksTimeoutError.js +13 -0
  339. package/errors/index.d.ts +2 -2
  340. package/errors/index.js +5 -5
  341. package/forge/rule.d.ts +2 -2
  342. package/forge/rule.js +8 -8
  343. package/forge/values.d.ts +2 -2
  344. package/index.d.ts +4 -3
  345. package/index.js +7 -5
  346. package/package.json +1 -1
  347. package/serialization/resources/assets/index.d.ts +1 -1
  348. package/serialization/resources/assets/index.js +1 -1
  349. package/serialization/resources/assets/resources/folders/client/index.d.ts +1 -0
  350. package/serialization/resources/assets/resources/folders/client/index.js +17 -0
  351. package/serialization/resources/assets/resources/folders/client/requests/DeleteFolderRequest.d.ts +12 -0
  352. package/serialization/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.js +1 -1
  353. package/{dist/serialization/resources/assets → serialization/resources/assets/resources/folders}/client/requests/UpsertFolderRequest.d.ts +4 -4
  354. package/{dist/serialization/resources/assets → serialization/resources/assets/resources/folders}/client/requests/UpsertFolderRequest.js +1 -1
  355. package/{dist/serialization/resources/assets → serialization/resources/assets/resources/folders}/client/requests/index.d.ts +0 -2
  356. package/serialization/resources/assets/resources/folders/client/requests/index.js +7 -0
  357. package/serialization/resources/assets/resources/folders/index.d.ts +1 -0
  358. package/serialization/resources/assets/resources/folders/index.js +17 -0
  359. package/serialization/resources/assets/resources/index.d.ts +4 -0
  360. package/serialization/resources/assets/resources/index.js +33 -0
  361. package/serialization/resources/assets/resources/rules/client/index.d.ts +1 -0
  362. package/serialization/resources/assets/resources/rules/client/index.js +17 -0
  363. package/serialization/resources/assets/resources/rules/client/requests/DeleteRuleRequest.d.ts +12 -0
  364. package/{dist/serialization/resources/assets → serialization/resources/assets/resources/rules}/client/requests/DeleteRuleRequest.js +1 -1
  365. package/serialization/resources/assets/resources/rules/client/requests/ImportRuleRequest.d.ts +12 -0
  366. package/{dist/serialization/resources/assets → serialization/resources/assets/resources/rules}/client/requests/ImportRuleRequest.js +1 -1
  367. package/serialization/resources/assets/resources/rules/client/requests/index.d.ts +2 -0
  368. package/serialization/resources/assets/resources/rules/client/requests/index.js +7 -0
  369. package/serialization/resources/assets/resources/rules/index.d.ts +1 -0
  370. package/serialization/resources/assets/resources/rules/index.js +17 -0
  371. package/serialization/resources/index.d.ts +1 -2
  372. package/serialization/resources/index.js +1 -2
  373. package/serialization/resources/rules/client/bulkSolve.d.ts +3 -3
  374. package/serialization/resources/users/client/requests/UserInviteRequest.d.ts +2 -2
  375. package/serialization/resources/users/client/requests/index.d.ts +0 -1
  376. package/serialization/resources/users/client/requests/index.js +1 -3
  377. package/serialization/resources/users/index.d.ts +1 -0
  378. package/serialization/resources/users/index.js +1 -0
  379. package/serialization/resources/users/resources/groups/client/index.d.ts +1 -0
  380. package/serialization/resources/users/resources/groups/client/index.js +17 -0
  381. package/serialization/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.d.ts +4 -4
  382. package/serialization/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.js +1 -1
  383. package/serialization/resources/users/resources/groups/client/requests/index.d.ts +1 -0
  384. package/serialization/resources/users/resources/groups/client/requests/index.js +5 -0
  385. package/serialization/resources/users/resources/groups/index.d.ts +1 -0
  386. package/serialization/resources/users/resources/groups/index.js +17 -0
  387. package/serialization/resources/users/resources/index.d.ts +2 -0
  388. package/serialization/resources/users/resources/index.js +31 -0
  389. package/serialization/resources/users/types/UserInviteRequestRole.d.ts +2 -2
  390. package/serialization/resources/values/client/requests/UpdateValuesRequest.d.ts +2 -2
  391. package/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +2 -2
  392. package/serialization/types/BooleanValue.d.ts +2 -2
  393. package/serialization/types/BulkRuleResponseItem.d.ts +2 -2
  394. package/serialization/types/BulkRuleResponseItemError.d.ts +2 -2
  395. package/serialization/types/CreateTestRequest.d.ts +2 -2
  396. package/serialization/types/DecisionLog.d.ts +2 -2
  397. package/serialization/types/DecisionLogDecision.d.ts +2 -2
  398. package/serialization/types/DecisionLogDecisionConditionsItemValue.d.ts +2 -2
  399. package/serialization/types/DecisionLogRequest.d.ts +2 -2
  400. package/serialization/types/DecisionLogResponse.d.ts +2 -2
  401. package/serialization/types/DynamicRequestPayload.d.ts +2 -2
  402. package/serialization/types/DynamicResponsePayload.d.ts +2 -2
  403. package/serialization/types/DynamicValue.d.ts +2 -2
  404. package/serialization/types/DynamicValueBase.d.ts +2 -2
  405. package/serialization/types/DynamicValueListResponse.d.ts +2 -2
  406. package/serialization/types/Error_.d.ts +2 -2
  407. package/serialization/types/FlowBase.d.ts +2 -2
  408. package/serialization/types/FlowDetail.d.ts +2 -2
  409. package/serialization/types/FlowExecutionError.d.ts +2 -2
  410. package/serialization/types/FlowListResponse.d.ts +2 -2
  411. package/serialization/types/Folder.d.ts +2 -2
  412. package/serialization/types/FolderListResponse.d.ts +2 -2
  413. package/serialization/types/ListValue.d.ts +2 -2
  414. package/serialization/types/ListValueValueItem.d.ts +2 -2
  415. package/serialization/types/NumberValue.d.ts +2 -2
  416. package/serialization/types/ParallelSolveRequest.d.ts +2 -2
  417. package/serialization/types/ParallelSolveRequestValue.d.ts +2 -2
  418. package/serialization/types/ParallelSolveResponse.d.ts +2 -2
  419. package/serialization/types/RuleBase.d.ts +2 -2
  420. package/serialization/types/RuleDetail.d.ts +2 -2
  421. package/serialization/types/RuleExport.d.ts +2 -2
  422. package/serialization/types/RuleListResponse.d.ts +2 -2
  423. package/serialization/types/RuleUsage.d.ts +2 -2
  424. package/serialization/types/SchemaField.d.ts +2 -2
  425. package/serialization/types/SchemaFieldDefaultValue.d.ts +2 -2
  426. package/serialization/types/SchemaFieldType.d.ts +2 -2
  427. package/serialization/types/StringValue.d.ts +2 -2
  428. package/serialization/types/SuccessMessage.d.ts +2 -2
  429. package/serialization/types/Test.d.ts +2 -2
  430. package/serialization/types/TestListResponse.d.ts +2 -2
  431. package/serialization/types/TestTestState.d.ts +2 -2
  432. package/serialization/types/TestTestStateConditionsItemValue.d.ts +2 -2
  433. package/serialization/types/TestTestStateEvaluationError.d.ts +2 -2
  434. package/serialization/types/UsageStatistics.d.ts +2 -2
  435. package/serialization/types/UserGroup.d.ts +2 -2
  436. package/serialization/types/UserGroupListResponse.d.ts +2 -2
  437. package/serialization/types/UserInviteResponse.d.ts +2 -2
  438. package/serialization/types/UserInviteResponseUser.d.ts +2 -2
  439. package/serialization/types/ValueLimits.d.ts +2 -2
  440. package/api/resources/assets/client/requests/index.d.ts +0 -6
  441. package/dist/api/resources/assets/client/requests/index.d.ts +0 -6
  442. package/dist/errors/RulebricksApiTimeoutError.js +0 -13
  443. package/dist/serialization/resources/assets/client/requests/DeleteFolderRequest.d.ts +0 -12
  444. package/dist/serialization/resources/assets/client/requests/DeleteRuleRequest.d.ts +0 -12
  445. package/dist/serialization/resources/assets/client/requests/ImportRuleRequest.d.ts +0 -12
  446. package/dist/serialization/resources/assets/client/requests/index.js +0 -11
  447. package/errors/RulebricksApiTimeoutError.js +0 -13
  448. package/serialization/resources/assets/client/requests/DeleteFolderRequest.d.ts +0 -12
  449. package/serialization/resources/assets/client/requests/DeleteRuleRequest.d.ts +0 -12
  450. package/serialization/resources/assets/client/requests/ImportRuleRequest.d.ts +0 -12
  451. package/serialization/resources/assets/client/requests/index.js +0 -11
  452. /package/api/resources/assets/{client/requests → resources/flows/client}/index.js +0 -0
  453. /package/{dist/serialization/resources/assets → api/resources/assets/resources/folders}/client/index.d.ts +0 -0
  454. /package/{dist/serialization/resources/assets → api/resources/assets/resources/folders}/client/index.js +0 -0
  455. /package/api/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.d.ts +0 -0
  456. /package/api/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.js +0 -0
  457. /package/api/resources/assets/{client → resources/folders/client}/requests/UpsertFolderRequest.d.ts +0 -0
  458. /package/api/resources/assets/{client → resources/folders/client}/requests/UpsertFolderRequest.js +0 -0
  459. /package/{dist/api/resources/assets → api/resources/assets/resources/folders}/client/requests/index.js +0 -0
  460. /package/{serialization/resources/assets → api/resources/assets/resources/rules}/client/index.d.ts +0 -0
  461. /package/{serialization/resources/assets → api/resources/assets/resources/rules}/client/index.js +0 -0
  462. /package/api/resources/assets/{client → resources/rules/client}/requests/DeleteRuleRequest.d.ts +0 -0
  463. /package/api/resources/assets/{client → resources/rules/client}/requests/DeleteRuleRequest.js +0 -0
  464. /package/api/resources/assets/{client → resources/rules/client}/requests/ImportRuleRequest.d.ts +0 -0
  465. /package/api/resources/assets/{client → resources/rules/client}/requests/ImportRuleRequest.js +0 -0
  466. /package/api/resources/assets/{client/requests/ExportRuleRequest.js → resources/rules/client/requests/RulesListRequest.js} +0 -0
  467. /package/api/resources/assets/{client/requests/ListRulesRequest.js → resources/rules/client/requests/RulesPullRequest.js} +0 -0
  468. /package/api/resources/decisions/client/requests/{QueryRequest.js → DecisionsQueryRequest.js} +0 -0
  469. /package/api/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.d.ts +0 -0
  470. /package/api/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.js +0 -0
  471. /package/api/resources/values/client/requests/{DeleteRequest.js → ValuesDeleteRequest.js} +0 -0
  472. /package/api/resources/values/client/requests/{ListRequest.js → ValuesListRequest.js} +0 -0
  473. /package/dist/api/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.d.ts +0 -0
  474. /package/dist/api/resources/assets/{client → resources/folders/client}/requests/DeleteFolderRequest.js +0 -0
  475. /package/dist/api/resources/assets/{client → resources/folders/client}/requests/UpsertFolderRequest.d.ts +0 -0
  476. /package/dist/api/resources/assets/{client → resources/folders/client}/requests/UpsertFolderRequest.js +0 -0
  477. /package/dist/api/resources/assets/{client → resources/rules/client}/requests/DeleteRuleRequest.d.ts +0 -0
  478. /package/dist/api/resources/assets/{client → resources/rules/client}/requests/DeleteRuleRequest.js +0 -0
  479. /package/dist/api/resources/assets/{client → resources/rules/client}/requests/ImportRuleRequest.d.ts +0 -0
  480. /package/dist/api/resources/assets/{client → resources/rules/client}/requests/ImportRuleRequest.js +0 -0
  481. /package/dist/api/resources/assets/{client/requests/ExportRuleRequest.js → resources/rules/client/requests/RulesListRequest.js} +0 -0
  482. /package/dist/api/resources/assets/{client/requests/ListRulesRequest.js → resources/rules/client/requests/RulesPullRequest.js} +0 -0
  483. /package/dist/api/resources/decisions/client/requests/{QueryRequest.js → DecisionsQueryRequest.js} +0 -0
  484. /package/dist/api/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.d.ts +0 -0
  485. /package/dist/api/resources/users/{client → resources/groups/client}/requests/CreateUserGroupRequest.js +0 -0
  486. /package/dist/api/resources/values/client/requests/{DeleteRequest.js → ValuesDeleteRequest.js} +0 -0
  487. /package/dist/api/resources/values/client/requests/{ListRequest.js → ValuesListRequest.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as RulebricksApi from "../index";
5
- export declare type TestListResponse = RulebricksApi.Test[];
4
+ import * as Rulebricks from "../index";
5
+ export declare type TestListResponse = Rulebricks.Test[];
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as RulebricksApi from "../index";
4
+ import * as Rulebricks from "../index";
5
5
  /**
6
6
  * The state of the test after execution.
7
7
  */
@@ -10,10 +10,10 @@ export interface TestTestState {
10
10
  duration?: number;
11
11
  /** Actual response returned */
12
12
  response?: Record<string, unknown>;
13
- conditions?: Record<string, RulebricksApi.TestTestStateConditionsItemValue>[];
13
+ conditions?: Record<string, Rulebricks.TestTestStateConditionsItemValue>[];
14
14
  /** HTTP status code returned */
15
15
  httpStatus?: number;
16
16
  successIdxs?: number[];
17
17
  /** Error message or flag indicating if evaluation error occurred */
18
- evaluationError?: RulebricksApi.TestTestStateEvaluationError;
18
+ evaluationError?: Rulebricks.TestTestStateEvaluationError;
19
19
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as RulebricksApi from "../index";
5
- export declare type UserGroupListResponse = RulebricksApi.UserGroup[];
4
+ import * as Rulebricks from "../index";
5
+ export declare type UserGroupListResponse = Rulebricks.UserGroup[];
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as RulebricksApi from "../index";
4
+ import * as Rulebricks from "../index";
5
5
  export interface UserInviteResponse {
6
6
  /** Success message indicating whether a new user was invited or an existing user's permissions were updated. */
7
7
  message?: string;
8
- user?: RulebricksApi.UserInviteResponseUser;
8
+ user?: Rulebricks.UserInviteResponseUser;
9
9
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export declare const RulebricksEnvironment: {
5
+ readonly Default: "https://rulebricks.com/api/v1";
6
+ };
7
+ export declare type RulebricksEnvironment = typeof RulebricksEnvironment.Default;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RulebricksEnvironment = void 0;
7
+ exports.RulebricksEnvironment = {
8
+ Default: "https://rulebricks.com/api/v1",
9
+ };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare class RulebricksApiError extends Error {
4
+ export declare class RulebricksError extends Error {
5
5
  readonly statusCode?: number;
6
6
  readonly body?: unknown;
7
7
  constructor({ message, statusCode, body }: {
@@ -3,12 +3,12 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.RulebricksApiError = void 0;
6
+ exports.RulebricksError = void 0;
7
7
  const json_1 = require("../core/json");
8
- class RulebricksApiError extends Error {
8
+ class RulebricksError extends Error {
9
9
  constructor({ message, statusCode, body }) {
10
10
  super(buildMessage({ message, statusCode, body }));
11
- Object.setPrototypeOf(this, RulebricksApiError.prototype);
11
+ Object.setPrototypeOf(this, RulebricksError.prototype);
12
12
  if (statusCode != null) {
13
13
  this.statusCode = statusCode;
14
14
  }
@@ -17,7 +17,7 @@ class RulebricksApiError extends Error {
17
17
  }
18
18
  }
19
19
  }
20
- exports.RulebricksApiError = RulebricksApiError;
20
+ exports.RulebricksError = RulebricksError;
21
21
  function buildMessage({ message, statusCode, body, }) {
22
22
  let lines = [];
23
23
  if (message != null) {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare class RulebricksApiTimeoutError extends Error {
4
+ export declare class RulebricksTimeoutError extends Error {
5
5
  constructor(message: string);
6
6
  }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RulebricksTimeoutError = void 0;
7
+ class RulebricksTimeoutError extends Error {
8
+ constructor(message) {
9
+ super(message);
10
+ Object.setPrototypeOf(this, RulebricksTimeoutError.prototype);
11
+ }
12
+ }
13
+ exports.RulebricksTimeoutError = RulebricksTimeoutError;
@@ -1,2 +1,2 @@
1
- export { RulebricksApiError } from "./RulebricksApiError";
2
- export { RulebricksApiTimeoutError } from "./RulebricksApiTimeoutError";
1
+ export { RulebricksError } from "./RulebricksError";
2
+ export { RulebricksTimeoutError } from "./RulebricksTimeoutError";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RulebricksApiTimeoutError = exports.RulebricksApiError = void 0;
4
- var RulebricksApiError_1 = require("./RulebricksApiError");
5
- Object.defineProperty(exports, "RulebricksApiError", { enumerable: true, get: function () { return RulebricksApiError_1.RulebricksApiError; } });
6
- var RulebricksApiTimeoutError_1 = require("./RulebricksApiTimeoutError");
7
- Object.defineProperty(exports, "RulebricksApiTimeoutError", { enumerable: true, get: function () { return RulebricksApiTimeoutError_1.RulebricksApiTimeoutError; } });
3
+ exports.RulebricksTimeoutError = exports.RulebricksError = void 0;
4
+ var RulebricksError_1 = require("./RulebricksError");
5
+ Object.defineProperty(exports, "RulebricksError", { enumerable: true, get: function () { return RulebricksError_1.RulebricksError; } });
6
+ var RulebricksTimeoutError_1 = require("./RulebricksTimeoutError");
7
+ Object.defineProperty(exports, "RulebricksTimeoutError", { enumerable: true, get: function () { return RulebricksTimeoutError_1.RulebricksTimeoutError; } });
@@ -1,4 +1,4 @@
1
- import { RulebricksApiClient } from "../Client.js";
1
+ import { RulebricksClient } from "../Client.js";
2
2
  import { Field, RuleSettings, OperatorResult } from "./types.js";
3
3
  import { BooleanField, NumberField, StringField, DateField, ListField } from "./operators.js";
4
4
  export declare class RuleTest {
@@ -80,7 +80,7 @@ export declare class Rule {
80
80
  private generateUUID;
81
81
  private generateSlug;
82
82
  private getFieldType;
83
- setWorkspace(client: RulebricksApiClient): Rule;
83
+ setWorkspace(client: RulebricksClient): Rule;
84
84
  setName(name: string): Rule;
85
85
  setDescription(description: string): Rule;
86
86
  setFolder(folderName: string, createIfMissing?: boolean): Promise<Rule>;
@@ -275,13 +275,13 @@ class Rule {
275
275
  if (!this.workspace) {
276
276
  throw new Error("A Rulebricks client is required to set a folder by name");
277
277
  }
278
- const folders = yield this.workspace.assets.listFolders();
278
+ const folders = yield this.workspace.assets.folders.list();
279
279
  let folder = folders.find((f) => f.name === folderName);
280
280
  if (!folder && createIfMissing) {
281
281
  if (folders.some((f) => f.name === folderName)) {
282
282
  throw new Error("Folder name conflicts with an existing folder");
283
283
  }
284
- folder = yield this.workspace.assets.upsertFolder({ name: folderName });
284
+ folder = yield this.workspace.assets.folders.upsert({ name: folderName });
285
285
  }
286
286
  if (!folder) {
287
287
  throw new Error(`Folder '${folderName}' not found and createIfMissing is false`);
@@ -309,7 +309,7 @@ class Rule {
309
309
  if (!validChars.test(alias)) {
310
310
  throw new Error("Alias cannot contain special characters");
311
311
  }
312
- const rules = yield this.workspace.assets.listRules();
312
+ const rules = yield this.workspace.assets.rules.list();
313
313
  if (rules.some((r) => r.slug === alias)) {
314
314
  throw new Error("Alias conflicts with an existing rule");
315
315
  }
@@ -363,13 +363,13 @@ class Rule {
363
363
  if (!this.workspace) {
364
364
  throw new Error("A Rulebricks client is required to manage access groups");
365
365
  }
366
- const existingGroups = yield this.workspace.users.listGroups();
366
+ const existingGroups = yield this.workspace.users.groups.list();
367
367
  let group = existingGroups.find((g) => g.name === groupName);
368
368
  if (!group && !createIfMissing) {
369
369
  throw new Error(`User group '${groupName}' not found and createIfMissing is False`);
370
370
  }
371
371
  if (!group && createIfMissing) {
372
- group = yield this.workspace.users.createGroup({ name: groupName });
372
+ group = yield this.workspace.users.groups.create({ name: groupName });
373
373
  }
374
374
  if (!this.accessGroups.includes(groupName)) {
375
375
  this.accessGroups.push(groupName);
@@ -506,7 +506,7 @@ class Rule {
506
506
  throw new Error("Workspace not set. Call setWorkspace() before updating the rule.");
507
507
  }
508
508
  const ruleData = this.toDict();
509
- yield this.workspace.assets.importRule({ rule: ruleData });
509
+ yield this.workspace.assets.rules.push({ rule: ruleData });
510
510
  return this;
511
511
  });
512
512
  }
@@ -517,7 +517,7 @@ class Rule {
517
517
  }
518
518
  const ruleData = this.toDict();
519
519
  ruleData._publish = true;
520
- yield this.workspace.assets.importRule({ rule: ruleData });
520
+ yield this.workspace.assets.rules.push({ rule: ruleData });
521
521
  return this;
522
522
  });
523
523
  }
@@ -526,7 +526,7 @@ class Rule {
526
526
  if (!this.workspace) {
527
527
  throw new Error("A Rulebricks client is required to load a rule from the workspace");
528
528
  }
529
- const ruleData = yield this.workspace.assets.exportRule({ id: ruleId });
529
+ const ruleData = yield this.workspace.assets.rules.pull({ id: ruleId });
530
530
  const rule = Rule.fromJSON(ruleData);
531
531
  Object.assign(this, rule);
532
532
  return this;
@@ -1,4 +1,4 @@
1
- import { RulebricksApiClient } from "../Client.js";
1
+ import { RulebricksClient } from "../Client.js";
2
2
  import { DynamicValueType } from "./types.js";
3
3
  export declare class DynamicValue {
4
4
  readonly id: string;
@@ -13,7 +13,7 @@ export declare class DynamicValue {
13
13
  export declare class DynamicValues {
14
14
  private static workspace?;
15
15
  private static cache;
16
- static configure(client: RulebricksApiClient): void;
16
+ static configure(client: RulebricksClient): void;
17
17
  static get(name: string): Promise<DynamicValue>;
18
18
  static set(dynamicValues: Record<string, any>, accessGroups?: string[]): Promise<void>;
19
19
  static clearCache(): void;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- export * as RulebricksApi from "./api";
2
- export { RulebricksApiClient } from "./Client";
3
- export { RulebricksApiError, RulebricksApiTimeoutError } from "./errors";
1
+ export * as Rulebricks from "./api";
2
+ export { RulebricksClient } from "./Client";
3
+ export { RulebricksEnvironment } from "./environments";
4
+ export { RulebricksError, RulebricksTimeoutError } from "./errors";
4
5
  export * as serialization from "./serialization";
5
6
  export { Rule, Condition, DynamicValue, DynamicValues, DynamicValueType, DynamicValueNotFoundError, TypeMismatchError, RuleTest, RuleSettings, } from "./forge";
package/dist/index.js CHANGED
@@ -23,13 +23,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.RuleTest = exports.TypeMismatchError = exports.DynamicValueNotFoundError = exports.DynamicValueType = exports.DynamicValues = exports.DynamicValue = exports.Condition = exports.Rule = exports.serialization = exports.RulebricksApiTimeoutError = exports.RulebricksApiError = exports.RulebricksApiClient = exports.RulebricksApi = void 0;
27
- exports.RulebricksApi = __importStar(require("./api"));
26
+ exports.RuleTest = exports.TypeMismatchError = exports.DynamicValueNotFoundError = exports.DynamicValueType = exports.DynamicValues = exports.DynamicValue = exports.Condition = exports.Rule = exports.serialization = exports.RulebricksTimeoutError = exports.RulebricksError = exports.RulebricksEnvironment = exports.RulebricksClient = exports.Rulebricks = void 0;
27
+ exports.Rulebricks = __importStar(require("./api"));
28
28
  var Client_1 = require("./Client");
29
- Object.defineProperty(exports, "RulebricksApiClient", { enumerable: true, get: function () { return Client_1.RulebricksApiClient; } });
29
+ Object.defineProperty(exports, "RulebricksClient", { enumerable: true, get: function () { return Client_1.RulebricksClient; } });
30
+ var environments_1 = require("./environments");
31
+ Object.defineProperty(exports, "RulebricksEnvironment", { enumerable: true, get: function () { return environments_1.RulebricksEnvironment; } });
30
32
  var errors_1 = require("./errors");
31
- Object.defineProperty(exports, "RulebricksApiError", { enumerable: true, get: function () { return errors_1.RulebricksApiError; } });
32
- Object.defineProperty(exports, "RulebricksApiTimeoutError", { enumerable: true, get: function () { return errors_1.RulebricksApiTimeoutError; } });
33
+ Object.defineProperty(exports, "RulebricksError", { enumerable: true, get: function () { return errors_1.RulebricksError; } });
34
+ Object.defineProperty(exports, "RulebricksTimeoutError", { enumerable: true, get: function () { return errors_1.RulebricksTimeoutError; } });
33
35
  exports.serialization = __importStar(require("./serialization"));
34
36
  var forge_1 = require("./forge");
35
37
  Object.defineProperty(exports, "Rule", { enumerable: true, get: function () { return forge_1.Rule; } });
@@ -1 +1 @@
1
- export * from "./client";
1
+ export * from "./resources";
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client"), exports);
17
+ __exportStar(require("./resources"), exports);
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../../../../index";
5
+ import * as Rulebricks from "../../../../../../../api/index";
6
+ import * as core from "../../../../../../../core";
7
+ export declare const DeleteFolderRequest: core.serialization.Schema<serializers.assets.DeleteFolderRequest.Raw, Rulebricks.assets.DeleteFolderRequest>;
8
+ export declare namespace DeleteFolderRequest {
9
+ interface Raw {
10
+ id: string;
11
+ }
12
+ }
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.DeleteFolderRequest = void 0;
30
- const core = __importStar(require("../../../../../core"));
30
+ const core = __importStar(require("../../../../../../../core"));
31
31
  exports.DeleteFolderRequest = core.serialization.object({
32
32
  id: core.serialization.string(),
33
33
  });
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as serializers from "../../../../index";
5
- import * as RulebricksApi from "../../../../../api/index";
6
- import * as core from "../../../../../core";
7
- export declare const UpsertFolderRequest: core.serialization.Schema<serializers.UpsertFolderRequest.Raw, RulebricksApi.UpsertFolderRequest>;
4
+ import * as serializers from "../../../../../../index";
5
+ import * as Rulebricks from "../../../../../../../api/index";
6
+ import * as core from "../../../../../../../core";
7
+ export declare const UpsertFolderRequest: core.serialization.Schema<serializers.assets.UpsertFolderRequest.Raw, Rulebricks.assets.UpsertFolderRequest>;
8
8
  export declare namespace UpsertFolderRequest {
9
9
  interface Raw {
10
10
  id?: string | null;
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.UpsertFolderRequest = void 0;
30
- const core = __importStar(require("../../../../../core"));
30
+ const core = __importStar(require("../../../../../../../core"));
31
31
  exports.UpsertFolderRequest = core.serialization.object({
32
32
  id: core.serialization.string().optional(),
33
33
  name: core.serialization.string(),
@@ -1,4 +1,2 @@
1
- export { DeleteRuleRequest } from "./DeleteRuleRequest";
2
- export { ImportRuleRequest } from "./ImportRuleRequest";
3
1
  export { UpsertFolderRequest } from "./UpsertFolderRequest";
4
2
  export { DeleteFolderRequest } from "./DeleteFolderRequest";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteFolderRequest = exports.UpsertFolderRequest = void 0;
4
+ var UpsertFolderRequest_1 = require("./UpsertFolderRequest");
5
+ Object.defineProperty(exports, "UpsertFolderRequest", { enumerable: true, get: function () { return UpsertFolderRequest_1.UpsertFolderRequest; } });
6
+ var DeleteFolderRequest_1 = require("./DeleteFolderRequest");
7
+ Object.defineProperty(exports, "DeleteFolderRequest", { enumerable: true, get: function () { return DeleteFolderRequest_1.DeleteFolderRequest; } });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -0,0 +1,17 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client"), exports);
@@ -0,0 +1,4 @@
1
+ export * as rules from "./rules";
2
+ export * from "./rules/client/requests";
3
+ export * as folders from "./folders";
4
+ export * from "./folders/client/requests";
@@ -0,0 +1,33 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.folders = exports.rules = void 0;
30
+ exports.rules = __importStar(require("./rules"));
31
+ __exportStar(require("./rules/client/requests"), exports);
32
+ exports.folders = __importStar(require("./folders"));
33
+ __exportStar(require("./folders/client/requests"), exports);
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../../../../index";
5
+ import * as Rulebricks from "../../../../../../../api/index";
6
+ import * as core from "../../../../../../../core";
7
+ export declare const DeleteRuleRequest: core.serialization.Schema<serializers.assets.DeleteRuleRequest.Raw, Rulebricks.assets.DeleteRuleRequest>;
8
+ export declare namespace DeleteRuleRequest {
9
+ interface Raw {
10
+ id: string;
11
+ }
12
+ }
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.DeleteRuleRequest = void 0;
30
- const core = __importStar(require("../../../../../core"));
30
+ const core = __importStar(require("../../../../../../../core"));
31
31
  exports.DeleteRuleRequest = core.serialization.object({
32
32
  id: core.serialization.string(),
33
33
  });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../../../../index";
5
+ import * as Rulebricks from "../../../../../../../api/index";
6
+ import * as core from "../../../../../../../core";
7
+ export declare const ImportRuleRequest: core.serialization.Schema<serializers.assets.ImportRuleRequest.Raw, Rulebricks.assets.ImportRuleRequest>;
8
+ export declare namespace ImportRuleRequest {
9
+ interface Raw {
10
+ rule: Record<string, unknown>;
11
+ }
12
+ }
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.ImportRuleRequest = void 0;
30
- const core = __importStar(require("../../../../../core"));
30
+ const core = __importStar(require("../../../../../../../core"));
31
31
  exports.ImportRuleRequest = core.serialization.object({
32
32
  rule: core.serialization.record(core.serialization.string(), core.serialization.unknown()),
33
33
  });
@@ -0,0 +1,2 @@
1
+ export { DeleteRuleRequest } from "./DeleteRuleRequest";
2
+ export { ImportRuleRequest } from "./ImportRuleRequest";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImportRuleRequest = exports.DeleteRuleRequest = void 0;
4
+ var DeleteRuleRequest_1 = require("./DeleteRuleRequest");
5
+ Object.defineProperty(exports, "DeleteRuleRequest", { enumerable: true, get: function () { return DeleteRuleRequest_1.DeleteRuleRequest; } });
6
+ var ImportRuleRequest_1 = require("./ImportRuleRequest");
7
+ Object.defineProperty(exports, "ImportRuleRequest", { enumerable: true, get: function () { return ImportRuleRequest_1.ImportRuleRequest; } });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -0,0 +1,17 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client"), exports);
@@ -3,7 +3,6 @@ export * from "./users/types";
3
3
  export * as values from "./values";
4
4
  export * from "./values/types";
5
5
  export * as rules from "./rules";
6
- export * as assets from "./assets";
7
- export * from "./assets/client/requests";
8
6
  export * from "./users/client/requests";
9
7
  export * from "./values/client/requests";
8
+ export * as assets from "./assets";
@@ -32,7 +32,6 @@ __exportStar(require("./users/types"), exports);
32
32
  exports.values = __importStar(require("./values"));
33
33
  __exportStar(require("./values/types"), exports);
34
34
  exports.rules = __importStar(require("./rules"));
35
- exports.assets = __importStar(require("./assets"));
36
- __exportStar(require("./assets/client/requests"), exports);
37
35
  __exportStar(require("./users/client/requests"), exports);
38
36
  __exportStar(require("./values/client/requests"), exports);
37
+ exports.assets = __importStar(require("./assets"));
@@ -2,15 +2,15 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as serializers from "../../../index";
5
- import * as RulebricksApi from "../../../../api/index";
5
+ import * as Rulebricks from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
7
  import { DynamicRequestPayload } from "../../../types/DynamicRequestPayload";
8
8
  import { BulkRuleResponseItem } from "../../../types/BulkRuleResponseItem";
9
- export declare const Request: core.serialization.Schema<serializers.rules.bulkSolve.Request.Raw, RulebricksApi.DynamicRequestPayload[]>;
9
+ export declare const Request: core.serialization.Schema<serializers.rules.bulkSolve.Request.Raw, Rulebricks.DynamicRequestPayload[]>;
10
10
  export declare namespace Request {
11
11
  type Raw = DynamicRequestPayload.Raw[];
12
12
  }
13
- export declare const Response: core.serialization.Schema<serializers.rules.bulkSolve.Response.Raw, RulebricksApi.BulkRuleResponseItem[]>;
13
+ export declare const Response: core.serialization.Schema<serializers.rules.bulkSolve.Response.Raw, Rulebricks.BulkRuleResponseItem[]>;
14
14
  export declare namespace Response {
15
15
  type Raw = BulkRuleResponseItem.Raw[];
16
16
  }
@@ -2,10 +2,10 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as serializers from "../../../../index";
5
- import * as RulebricksApi from "../../../../../api/index";
5
+ import * as Rulebricks from "../../../../../api/index";
6
6
  import * as core from "../../../../../core";
7
7
  import { UserInviteRequestRole } from "../../types/UserInviteRequestRole";
8
- export declare const UserInviteRequest: core.serialization.Schema<serializers.UserInviteRequest.Raw, RulebricksApi.UserInviteRequest>;
8
+ export declare const UserInviteRequest: core.serialization.Schema<serializers.UserInviteRequest.Raw, Rulebricks.UserInviteRequest>;
9
9
  export declare namespace UserInviteRequest {
10
10
  interface Raw {
11
11
  email: string;
@@ -1,2 +1 @@
1
1
  export { UserInviteRequest } from "./UserInviteRequest";
2
- export { CreateUserGroupRequest } from "./CreateUserGroupRequest";