@rulebricks/sdk 2.0.0 → 2.5.1

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 (199) hide show
  1. package/api/resources/assets/client/Client.d.ts +14 -15
  2. package/api/resources/assets/client/Client.js +17 -18
  3. package/api/resources/assets/client/requests/ExportManifestRequest.d.ts +25 -16
  4. package/api/resources/assets/client/requests/ExportManifestRequest.js +11 -0
  5. package/api/resources/assets/client/requests/ImportManifestRequest.d.ts +31 -7
  6. package/api/resources/assets/client/requests/ImportManifestRequest.js +20 -0
  7. package/api/resources/assets/resources/rules/client/Client.d.ts +118 -3
  8. package/api/resources/assets/resources/rules/client/Client.js +118 -3
  9. package/api/resources/assets/resources/rules/client/requests/ImportRuleRequest.d.ts +119 -4
  10. package/api/resources/assets/types/ExportRbmAssetsResponse.d.ts +2 -0
  11. package/api/resources/assets/types/index.d.ts +1 -1
  12. package/api/resources/assets/types/index.js +1 -1
  13. package/api/resources/contexts/client/Client.d.ts +24 -21
  14. package/api/resources/contexts/client/Client.js +26 -34
  15. package/api/resources/contexts/client/requests/{CascadeContextRequest.d.ts → CascadeContextsRequest.d.ts} +5 -4
  16. package/api/resources/contexts/client/requests/{GetInstanceContextsRequest.d.ts → DeleteContextsRequest.d.ts} +1 -1
  17. package/{dist/api/resources/contexts/client/requests/SolveContextFlowRequest.d.ts → api/resources/contexts/client/requests/ExecuteContextsRequest.d.ts} +5 -6
  18. package/{dist/api/resources/contexts/client/requests/GetInstanceContextsRequest.d.ts → api/resources/contexts/client/requests/GetContextsRequest.d.ts} +1 -1
  19. package/api/resources/contexts/client/requests/{SolveContextRuleRequest.d.ts → SolveContextsRequest.d.ts} +5 -6
  20. package/api/resources/contexts/client/requests/index.d.ts +5 -5
  21. package/api/resources/contexts/resources/index.d.ts +2 -2
  22. package/api/resources/contexts/resources/index.js +3 -3
  23. package/api/resources/contexts/resources/{admin → objects}/client/Client.d.ts +25 -24
  24. package/api/resources/contexts/resources/{admin → objects}/client/Client.js +19 -18
  25. package/{dist/api/resources/contexts/resources/admin → api/resources/contexts/resources/objects}/client/requests/CreateContextRequest.d.ts +7 -4
  26. package/{dist/api/resources/contexts/resources/admin/client/requests/DeleteAdminRequest.d.ts → api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.d.ts} +1 -1
  27. package/{dist/api/resources/contexts/resources/admin/client/requests/GetAdminRequest.d.ts → api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.d.ts} +1 -1
  28. package/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.d.ts +1 -1
  29. package/api/resources/contexts/resources/{admin → objects}/client/requests/index.d.ts +2 -2
  30. package/api/resources/contexts/resources/relationships/client/Client.d.ts +3 -3
  31. package/api/resources/contexts/resources/relationships/client/Client.js +3 -3
  32. package/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.d.ts +11 -11
  33. package/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.js +4 -4
  34. package/api/resources/users/client/Client.d.ts +2 -2
  35. package/api/resources/users/client/Client.js +2 -2
  36. package/api/resources/values/client/requests/UpdateValuesRequest.d.ts +1 -1
  37. package/api/types/CascadeContextRequest.d.ts +4 -0
  38. package/api/types/ContextInstancePendingEvaluation.d.ts +10 -2
  39. package/api/types/ContextListItem.d.ts +24 -0
  40. package/api/types/ContextListResponse.d.ts +1 -1
  41. package/api/types/ContextRelationshipBase.d.ts +6 -4
  42. package/api/types/ContextRelationshipBase.js +3 -3
  43. package/api/types/ContextRelationshipIncoming.d.ts +1 -1
  44. package/api/types/ContextRelationshipOutgoing.d.ts +1 -1
  45. package/api/types/ContextRelationshipsResponse.d.ts +12 -0
  46. package/api/types/ContextSchemaField.d.ts +4 -4
  47. package/api/types/DecisionLog.d.ts +13 -4
  48. package/api/types/DecisionLogResponse.d.ts +4 -4
  49. package/api/types/DeleteRelationshipResponse.d.ts +2 -0
  50. package/api/types/ExportManifestPreviewResponse.d.ts +53 -40
  51. package/api/types/ExportManifestResponse.d.ts +28 -7
  52. package/api/types/Folder.d.ts +4 -0
  53. package/api/types/ImportManifestResponse.d.ts +52 -24
  54. package/api/types/RuleDetail.d.ts +6 -2
  55. package/api/types/RuleImportConditionRow.d.ts +11 -0
  56. package/api/types/RuleImportPayload.d.ts +60 -0
  57. package/api/types/RuleImportRequestCell.d.ts +11 -0
  58. package/api/types/RuleImportResponseCell.d.ts +8 -0
  59. package/api/types/RuleImportRowSettings.d.ts +17 -0
  60. package/api/types/RuleImportSchemaField.d.ts +36 -0
  61. package/api/types/RuleImportSchemaField.js +17 -0
  62. package/api/types/SchemaField.d.ts +2 -2
  63. package/api/types/SolveContextFlowRequest.d.ts +4 -0
  64. package/api/types/SolveContextRuleRequest.d.ts +4 -0
  65. package/api/types/SolveContextRuleRequest.js +3 -0
  66. package/api/types/Test.d.ts +9 -9
  67. package/api/types/UpdateContextResponse.d.ts +13 -2
  68. package/api/types/UsageStatistics.d.ts +10 -4
  69. package/api/types/UserGroup.d.ts +2 -0
  70. package/api/types/index.d.ts +10 -0
  71. package/api/types/index.js +10 -0
  72. package/dist/api/resources/assets/client/Client.d.ts +14 -15
  73. package/dist/api/resources/assets/client/Client.js +17 -18
  74. package/dist/api/resources/assets/client/requests/ExportManifestRequest.d.ts +25 -16
  75. package/dist/api/resources/assets/client/requests/ExportManifestRequest.js +11 -0
  76. package/dist/api/resources/assets/client/requests/ImportManifestRequest.d.ts +31 -7
  77. package/dist/api/resources/assets/client/requests/ImportManifestRequest.js +20 -0
  78. package/dist/api/resources/assets/resources/rules/client/Client.d.ts +118 -3
  79. package/dist/api/resources/assets/resources/rules/client/Client.js +118 -3
  80. package/dist/api/resources/assets/resources/rules/client/requests/ImportRuleRequest.d.ts +119 -4
  81. package/dist/api/resources/assets/types/ExportRbmAssetsResponse.d.ts +2 -0
  82. package/dist/api/resources/assets/types/ExportRbmAssetsResponse.js +3 -0
  83. package/dist/api/resources/assets/types/index.d.ts +1 -1
  84. package/dist/api/resources/assets/types/index.js +1 -1
  85. package/dist/api/resources/contexts/client/Client.d.ts +24 -21
  86. package/dist/api/resources/contexts/client/Client.js +26 -34
  87. package/dist/api/resources/contexts/client/requests/{CascadeContextRequest.d.ts → CascadeContextsRequest.d.ts} +5 -4
  88. package/dist/api/resources/contexts/client/requests/CascadeContextsRequest.js +3 -0
  89. package/{api/resources/contexts/client/requests/DeleteInstanceContextsRequest.d.ts → dist/api/resources/contexts/client/requests/DeleteContextsRequest.d.ts} +1 -1
  90. package/dist/api/resources/contexts/client/requests/DeleteContextsRequest.js +3 -0
  91. package/{api/resources/contexts/client/requests/SolveContextFlowRequest.d.ts → dist/api/resources/contexts/client/requests/ExecuteContextsRequest.d.ts} +5 -6
  92. package/dist/api/resources/contexts/client/requests/ExecuteContextsRequest.js +3 -0
  93. package/dist/api/resources/contexts/client/requests/{DeleteInstanceContextsRequest.d.ts → GetContextsRequest.d.ts} +1 -1
  94. package/dist/api/resources/contexts/client/requests/GetContextsRequest.js +3 -0
  95. package/dist/api/resources/contexts/client/requests/{SolveContextRuleRequest.d.ts → SolveContextsRequest.d.ts} +5 -6
  96. package/dist/api/resources/contexts/client/requests/SolveContextsRequest.js +3 -0
  97. package/dist/api/resources/contexts/client/requests/index.d.ts +5 -5
  98. package/dist/api/resources/contexts/resources/index.d.ts +2 -2
  99. package/dist/api/resources/contexts/resources/index.js +3 -3
  100. package/dist/api/resources/contexts/resources/{admin → objects}/client/Client.d.ts +25 -24
  101. package/dist/api/resources/contexts/resources/{admin → objects}/client/Client.js +19 -18
  102. package/{api/resources/contexts/resources/admin → dist/api/resources/contexts/resources/objects}/client/requests/CreateContextRequest.d.ts +7 -4
  103. package/{api/resources/contexts/resources/admin/client/requests/DeleteAdminRequest.d.ts → dist/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.d.ts} +1 -1
  104. package/dist/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.js +3 -0
  105. package/{api/resources/contexts/resources/admin/client/requests/GetAdminRequest.d.ts → dist/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.d.ts} +1 -1
  106. package/dist/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.js +3 -0
  107. package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.d.ts +1 -1
  108. package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/index.d.ts +2 -2
  109. package/dist/api/resources/contexts/resources/relationships/client/Client.d.ts +3 -3
  110. package/dist/api/resources/contexts/resources/relationships/client/Client.js +3 -3
  111. package/dist/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.d.ts +11 -11
  112. package/dist/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.js +4 -4
  113. package/dist/api/resources/users/client/Client.d.ts +2 -2
  114. package/dist/api/resources/users/client/Client.js +2 -2
  115. package/dist/api/resources/values/client/requests/UpdateValuesRequest.d.ts +1 -1
  116. package/dist/api/types/CascadeContextRequest.d.ts +4 -0
  117. package/dist/api/types/CascadeContextRequest.js +3 -0
  118. package/dist/api/types/ContextInstancePendingEvaluation.d.ts +10 -2
  119. package/dist/api/types/ContextListItem.d.ts +24 -0
  120. package/dist/api/types/ContextListItem.js +3 -0
  121. package/dist/api/types/ContextListResponse.d.ts +1 -1
  122. package/dist/api/types/ContextRelationshipBase.d.ts +6 -4
  123. package/dist/api/types/ContextRelationshipBase.js +3 -3
  124. package/dist/api/types/ContextRelationshipIncoming.d.ts +1 -1
  125. package/dist/api/types/ContextRelationshipOutgoing.d.ts +1 -1
  126. package/dist/api/types/ContextRelationshipsResponse.d.ts +12 -0
  127. package/dist/api/types/ContextSchemaField.d.ts +4 -4
  128. package/dist/api/types/DecisionLog.d.ts +13 -4
  129. package/dist/api/types/DecisionLogResponse.d.ts +4 -4
  130. package/dist/api/types/DeleteRelationshipResponse.d.ts +2 -0
  131. package/dist/api/types/ExportManifestPreviewResponse.d.ts +53 -40
  132. package/dist/api/types/ExportManifestResponse.d.ts +28 -7
  133. package/dist/api/types/Folder.d.ts +4 -0
  134. package/dist/api/types/ImportManifestResponse.d.ts +52 -24
  135. package/dist/api/types/RuleDetail.d.ts +6 -2
  136. package/dist/api/types/RuleImportConditionRow.d.ts +11 -0
  137. package/dist/api/types/RuleImportConditionRow.js +3 -0
  138. package/dist/api/types/RuleImportPayload.d.ts +60 -0
  139. package/dist/api/types/RuleImportPayload.js +3 -0
  140. package/dist/api/types/RuleImportRequestCell.d.ts +11 -0
  141. package/dist/api/types/RuleImportRequestCell.js +3 -0
  142. package/dist/api/types/RuleImportResponseCell.d.ts +8 -0
  143. package/dist/api/types/RuleImportResponseCell.js +3 -0
  144. package/dist/api/types/RuleImportRowSettings.d.ts +17 -0
  145. package/dist/api/types/RuleImportRowSettings.js +3 -0
  146. package/dist/api/types/RuleImportSchemaField.d.ts +36 -0
  147. package/dist/api/types/RuleImportSchemaField.js +17 -0
  148. package/dist/api/types/SchemaField.d.ts +2 -2
  149. package/dist/api/types/SolveContextFlowRequest.d.ts +4 -0
  150. package/dist/api/types/SolveContextFlowRequest.js +3 -0
  151. package/dist/api/types/SolveContextRuleRequest.d.ts +4 -0
  152. package/dist/api/types/SolveContextRuleRequest.js +3 -0
  153. package/dist/api/types/Test.d.ts +9 -9
  154. package/dist/api/types/UpdateContextResponse.d.ts +13 -2
  155. package/dist/api/types/UsageStatistics.d.ts +10 -4
  156. package/dist/api/types/UserGroup.d.ts +2 -0
  157. package/dist/api/types/index.d.ts +10 -0
  158. package/dist/api/types/index.js +10 -0
  159. package/dist/forge/rule.d.ts +4 -3
  160. package/dist/forge/rule.js +1 -1
  161. package/dist/index.d.ts +0 -1
  162. package/dist/index.js +1 -10
  163. package/forge/rule.d.ts +4 -3
  164. package/forge/rule.js +1 -1
  165. package/index.d.ts +0 -1
  166. package/index.js +1 -10
  167. package/package.json +1 -1
  168. package/api/resources/assets/types/ExportAssetsResponse.d.ts +0 -2
  169. package/dist/api/resources/assets/types/ExportAssetsResponse.d.ts +0 -2
  170. /package/api/resources/assets/types/{ExportAssetsResponse.js → ExportRbmAssetsResponse.js} +0 -0
  171. /package/api/resources/contexts/client/requests/{CascadeContextRequest.js → CascadeContextsRequest.js} +0 -0
  172. /package/api/resources/contexts/client/requests/{DeleteInstanceContextsRequest.js → DeleteContextsRequest.js} +0 -0
  173. /package/api/resources/contexts/client/requests/{GetInstanceContextsRequest.js → ExecuteContextsRequest.js} +0 -0
  174. /package/api/resources/contexts/client/requests/{SolveContextFlowRequest.js → GetContextsRequest.js} +0 -0
  175. /package/api/resources/contexts/client/requests/{SolveContextRuleRequest.js → SolveContextsRequest.js} +0 -0
  176. /package/api/resources/contexts/resources/{admin → objects}/client/index.d.ts +0 -0
  177. /package/api/resources/contexts/resources/{admin → objects}/client/index.js +0 -0
  178. /package/api/resources/contexts/resources/{admin → objects}/client/requests/CreateContextRequest.js +0 -0
  179. /package/api/resources/contexts/resources/{admin/client/requests/DeleteAdminRequest.js → objects/client/requests/DeleteObjectsRequest.js} +0 -0
  180. /package/api/resources/contexts/resources/{admin/client/requests/GetAdminRequest.js → objects/client/requests/GetObjectsRequest.js} +0 -0
  181. /package/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.js +0 -0
  182. /package/api/resources/contexts/resources/{admin → objects}/client/requests/index.js +0 -0
  183. /package/api/resources/contexts/resources/{admin → objects}/index.d.ts +0 -0
  184. /package/api/resources/contexts/resources/{admin → objects}/index.js +0 -0
  185. /package/{dist/api/resources/contexts/client/requests → api/types}/CascadeContextRequest.js +0 -0
  186. /package/{dist/api/resources/assets/types/ExportAssetsResponse.js → api/types/ContextListItem.js} +0 -0
  187. /package/{dist/api/resources/contexts/client/requests/DeleteInstanceContextsRequest.js → api/types/RuleImportConditionRow.js} +0 -0
  188. /package/{dist/api/resources/contexts/client/requests/GetInstanceContextsRequest.js → api/types/RuleImportPayload.js} +0 -0
  189. /package/{dist/api/resources/contexts/client/requests/SolveContextFlowRequest.js → api/types/RuleImportRequestCell.js} +0 -0
  190. /package/{dist/api/resources/contexts/client/requests/SolveContextRuleRequest.js → api/types/RuleImportResponseCell.js} +0 -0
  191. /package/{dist/api/resources/contexts/resources/admin/client/requests/DeleteAdminRequest.js → api/types/RuleImportRowSettings.js} +0 -0
  192. /package/{dist/api/resources/contexts/resources/admin/client/requests/GetAdminRequest.js → api/types/SolveContextFlowRequest.js} +0 -0
  193. /package/dist/api/resources/contexts/resources/{admin → objects}/client/index.d.ts +0 -0
  194. /package/dist/api/resources/contexts/resources/{admin → objects}/client/index.js +0 -0
  195. /package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/CreateContextRequest.js +0 -0
  196. /package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.js +0 -0
  197. /package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/index.js +0 -0
  198. /package/dist/api/resources/contexts/resources/{admin → objects}/index.d.ts +0 -0
  199. /package/dist/api/resources/contexts/resources/{admin → objects}/index.js +0 -0
@@ -1,3 +1,4 @@
1
+ import type * as Rulebricks from "../index.js";
1
2
  /**
2
3
  * Rule/flow execution log entry with request, response, and decision details.
3
4
  */
@@ -10,14 +11,22 @@ export interface DecisionLog {
10
11
  endpoint?: string | null;
11
12
  /** HTTP status code of the response. */
12
13
  status?: number | null;
13
- /** The request payload sent to the rule/flow. */
14
- request?: Record<string, unknown> | null;
15
- /** The response payload returned by the rule/flow. */
16
- response?: Record<string, unknown> | null;
14
+ /** The request payload sent to the rule/flow. Can be an object for single requests or an array for bulk operations. */
15
+ request?: DecisionLog.Request | null;
16
+ /** The response payload returned by the rule/flow. Can be an object for single responses or an array for bulk operations. */
17
+ response?: Rulebricks.DecisionLogResponse | null;
17
18
  /** Decision details including matched conditions, rows, and evaluation metadata. */
18
19
  decision?: Record<string, unknown> | null;
19
20
  /** Error message if the execution failed. */
20
21
  error?: string | null;
21
22
  /** Whether the request/response data was truncated due to size limits. */
22
23
  abbreviated?: boolean;
24
+ /** Accepts any additional properties */
25
+ [key: string]: any;
26
+ }
27
+ export declare namespace DecisionLog {
28
+ /**
29
+ * The request payload sent to the rule/flow. Can be an object for single requests or an array for bulk operations.
30
+ */
31
+ type Request = Record<string, unknown> | Record<string, unknown>[];
23
32
  }
@@ -1,12 +1,12 @@
1
1
  import type * as Rulebricks from "../index.js";
2
2
  /**
3
- * Response containing decision logs or a count.
3
+ * Response containing decision logs or a count. Returns either {data, cursor} for log queries OR {count} for count queries - these are mutually exclusive based on the count parameter.
4
4
  */
5
5
  export interface DecisionLogResponse {
6
- /** Array of decision log entries (omitted when count=true). */
6
+ /** Array of decision log entries. Only present when count parameter is not 'true'. */
7
7
  data?: Rulebricks.DecisionLog[];
8
- /** Pagination cursor for fetching the next page. Null if no more results. */
8
+ /** Pagination cursor for fetching the next page. Null if no more results. Only present when count parameter is not 'true'. */
9
9
  cursor?: string | null;
10
- /** Total count of matching logs (only present when count=true parameter is used). */
10
+ /** Total count of matching logs. Only present when count parameter is 'true'. When this is returned, data and cursor are not included. */
11
11
  count?: number;
12
12
  }
@@ -1,4 +1,6 @@
1
1
  export interface DeleteRelationshipResponse {
2
2
  /** Success message. */
3
3
  message?: string;
4
+ /** The ID of the deleted relationship. */
5
+ id?: string;
4
6
  }
@@ -1,50 +1,63 @@
1
1
  export interface ExportManifestPreviewResponse {
2
- counts?: ExportManifestPreviewResponse.Counts;
3
- items?: ExportManifestPreviewResponse.Items;
2
+ /** Whether the preview completed successfully. */
3
+ success?: boolean;
4
+ /** Preview of assets that would be exported. */
5
+ preview?: ExportManifestPreviewResponse.Preview;
6
+ /** Error message if preview failed. */
7
+ error?: string;
4
8
  }
5
9
  export declare namespace ExportManifestPreviewResponse {
6
- interface Counts {
7
- rules?: number;
8
- flows?: number;
9
- contexts?: number;
10
- values?: number;
10
+ /**
11
+ * Preview of assets that would be exported.
12
+ */
13
+ interface Preview {
14
+ counts?: Preview.Counts;
15
+ items?: Preview.Items;
11
16
  }
12
- interface Items {
13
- rules?: Items.Rules.Item[];
14
- flows?: Items.Flows.Item[];
15
- contexts?: Items.Contexts.Item[];
16
- values?: Items.Values.Item[];
17
- }
18
- namespace Items {
19
- type Rules = Rules.Item[];
20
- namespace Rules {
21
- interface Item {
22
- id?: string;
23
- name?: string;
24
- slug?: string;
25
- }
17
+ namespace Preview {
18
+ interface Counts {
19
+ rules?: number;
20
+ flows?: number;
21
+ contexts?: number;
22
+ values?: number;
26
23
  }
27
- type Flows = Flows.Item[];
28
- namespace Flows {
29
- interface Item {
30
- id?: string;
31
- name?: string;
32
- slug?: string;
33
- }
24
+ interface Items {
25
+ rules?: Items.Rules.Item[];
26
+ flows?: Items.Flows.Item[];
27
+ contexts?: Items.Contexts.Item[];
28
+ values?: Items.Values.Item[];
34
29
  }
35
- type Contexts = Contexts.Item[];
36
- namespace Contexts {
37
- interface Item {
38
- id?: string;
39
- name?: string;
40
- slug?: string;
30
+ namespace Items {
31
+ type Rules = Rules.Item[];
32
+ namespace Rules {
33
+ interface Item {
34
+ id?: string;
35
+ name?: string;
36
+ slug?: string;
37
+ }
41
38
  }
42
- }
43
- type Values = Values.Item[];
44
- namespace Values {
45
- interface Item {
46
- id?: string;
47
- name?: string;
39
+ type Flows = Flows.Item[];
40
+ namespace Flows {
41
+ interface Item {
42
+ id?: string;
43
+ name?: string;
44
+ slug?: string;
45
+ }
46
+ }
47
+ type Contexts = Contexts.Item[];
48
+ namespace Contexts {
49
+ interface Item {
50
+ id?: string;
51
+ name?: string;
52
+ slug?: string;
53
+ }
54
+ }
55
+ type Values = Values.Item[];
56
+ namespace Values {
57
+ interface Item {
58
+ id?: string;
59
+ name?: string;
60
+ }
48
61
  }
49
62
  }
50
63
  }
@@ -1,9 +1,30 @@
1
1
  export interface ExportManifestResponse {
2
- /** Manifest format version. */
3
- version?: string;
4
- exported_at?: string;
5
- rules?: Record<string, unknown>[];
6
- flows?: Record<string, unknown>[];
7
- contexts?: Record<string, unknown>[];
8
- values?: Record<string, unknown>[];
2
+ /** Whether the export completed successfully. */
3
+ success?: boolean;
4
+ /** The exported manifest data. */
5
+ manifest?: ExportManifestResponse.Manifest;
6
+ /** Error message if export failed. */
7
+ error?: string;
8
+ }
9
+ export declare namespace ExportManifestResponse {
10
+ /**
11
+ * The exported manifest data.
12
+ */
13
+ interface Manifest {
14
+ /** Manifest format version. */
15
+ version?: string;
16
+ /** Manifest name. */
17
+ name?: string;
18
+ /** Manifest description. */
19
+ description?: string;
20
+ exported_at?: string;
21
+ /** Exported contexts. */
22
+ contexts?: Record<string, unknown>[];
23
+ /** Exported dynamic values. */
24
+ values?: Record<string, unknown>[];
25
+ /** Exported rules. */
26
+ rules?: Record<string, unknown>[];
27
+ /** Exported flows. */
28
+ flows?: Record<string, unknown>[];
29
+ }
9
30
  }
@@ -5,6 +5,10 @@ export interface Folder {
5
5
  name?: string;
6
6
  /** Description of the folder. */
7
7
  description?: string;
8
+ /** Timestamp of when the folder was created. */
9
+ created_at?: string;
8
10
  /** Timestamp of when the folder was last updated. */
9
11
  updated_at?: string;
12
+ /** User groups that can view this folder. */
13
+ user_groups?: string[];
10
14
  }
@@ -1,38 +1,66 @@
1
1
  export interface ImportManifestResponse {
2
- /** Success message. */
3
- message?: string;
4
- /** Count of imported assets by type. */
5
- imported?: ImportManifestResponse.Imported;
6
- /** Count of skipped assets by type (already exist and overwrite=false). */
7
- skipped?: ImportManifestResponse.Skipped;
2
+ /** Whether the import completed successfully. */
3
+ success?: boolean;
4
+ /** Assets that were created during import. */
5
+ created?: ImportManifestResponse.Created.Item[];
6
+ /** Assets that were updated during import. */
7
+ updated?: ImportManifestResponse.Updated.Item[];
8
+ /** Assets that were skipped during import. */
9
+ skipped?: ImportManifestResponse.Skipped.Item[];
8
10
  /** Any errors encountered during import. */
9
11
  errors?: ImportManifestResponse.Errors.Item[];
12
+ /** Non-fatal warnings from import validation. */
13
+ warnings?: string[];
14
+ /** IDs of any organizational folders created during import. */
15
+ organization_created?: ImportManifestResponse.OrganizationCreated | null;
10
16
  }
11
17
  export declare namespace ImportManifestResponse {
12
- /**
13
- * Count of imported assets by type.
14
- */
15
- interface Imported {
16
- rules?: number;
17
- flows?: number;
18
- contexts?: number;
19
- values?: number;
18
+ type Created = Created.Item[];
19
+ namespace Created {
20
+ interface Item {
21
+ /** Asset type (context, value, rule, flow, relationship). */
22
+ type?: string;
23
+ /** Stable ID of asset. */
24
+ stable_id?: string;
25
+ /** Database ID of asset. */
26
+ db_id?: string;
27
+ /** Import status. */
28
+ status?: string;
29
+ }
20
30
  }
21
- /**
22
- * Count of skipped assets by type (already exist and overwrite=false).
23
- */
24
- interface Skipped {
25
- rules?: number;
26
- flows?: number;
27
- contexts?: number;
28
- values?: number;
31
+ type Updated = Updated.Item[];
32
+ namespace Updated {
33
+ interface Item {
34
+ type?: string;
35
+ stable_id?: string;
36
+ db_id?: string;
37
+ status?: string;
38
+ }
39
+ }
40
+ type Skipped = Skipped.Item[];
41
+ namespace Skipped {
42
+ interface Item {
43
+ type?: string;
44
+ stable_id?: string;
45
+ status?: string;
46
+ reason?: string;
47
+ }
29
48
  }
30
49
  type Errors = Errors.Item[];
31
50
  namespace Errors {
32
51
  interface Item {
33
52
  type?: string;
34
- id?: string;
35
- error?: string;
53
+ stable_id?: string;
54
+ status?: string;
55
+ reason?: string;
36
56
  }
37
57
  }
58
+ /**
59
+ * IDs of any organizational folders created during import.
60
+ */
61
+ interface OrganizationCreated {
62
+ entity_set_id?: string | null;
63
+ rule_tag_id?: string | null;
64
+ flow_tag_id?: string | null;
65
+ }
38
66
  }
@@ -4,12 +4,16 @@ export interface RuleDetail extends Rulebricks.RuleBase {
4
4
  created_at?: string;
5
5
  /** The date this rule was last updated. */
6
6
  updated_at?: string;
7
+ /** Whether the rule is currently published. */
8
+ published?: boolean;
9
+ /** Optional user-defined metadata for API-first integrations. */
10
+ metadata?: Record<string, unknown>;
7
11
  folder?: Rulebricks.Folder;
8
12
  /** The context this rule is bound to (if any). Rules bound to a context have their inputs/outputs mapped to context fields. */
9
13
  context?: RuleDetail.Context | null;
10
- /** The published request schema for the rule. */
14
+ /** The request schema for the rule. Uses published schema when published, otherwise draft schema. */
11
15
  request_schema?: Rulebricks.SchemaField[];
12
- /** The published response schema for the rule. */
16
+ /** The response schema for the rule. Uses published schema when published, otherwise draft schema. */
13
17
  response_schema?: Rulebricks.SchemaField[];
14
18
  }
15
19
  export declare namespace RuleDetail {
@@ -0,0 +1,11 @@
1
+ import type * as Rulebricks from "../index.js";
2
+ /**
3
+ * A single rule row containing request conditions and response output.
4
+ */
5
+ export interface RuleImportConditionRow {
6
+ /** Request-side cells keyed by request schema field key. */
7
+ request: Record<string, Rulebricks.RuleImportRequestCell>;
8
+ /** Response-side cells keyed by response schema field key. */
9
+ response: Record<string, Rulebricks.RuleImportResponseCell>;
10
+ settings: Rulebricks.RuleImportRowSettings;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,60 @@
1
+ import type * as Rulebricks from "../index.js";
2
+ /**
3
+ * Rule object accepted by /admin/rules/import. Existing rule IDs allow partial updates; creating a new rule ID requires the full legacy import shape.
4
+ */
5
+ export interface RuleImportPayload {
6
+ /** Rule ID to create or update. */
7
+ id: string;
8
+ /** Optional stable ID for cross-workspace import/export identity. */
9
+ stable_id?: string;
10
+ /** Rule slug. */
11
+ slug?: string;
12
+ /** Rule name. */
13
+ name?: string;
14
+ /** Rule description. */
15
+ description?: string;
16
+ /** Creation timestamp. */
17
+ createdAt?: string;
18
+ /** Last update timestamp. */
19
+ updatedAt?: string;
20
+ /** Current publish state. Set with `_publish`/`_unpublish` to control publish transitions on import. */
21
+ published?: boolean;
22
+ /** Optional user-defined metadata for external IDs or implementation mappings. */
23
+ metadata?: Record<string, unknown>;
24
+ /** If true, backend publishes this rule and snapshots published_* fields from draft fields. */
25
+ _publish?: boolean;
26
+ /** If true, backend unpublishes this rule. */
27
+ _unpublish?: boolean;
28
+ /** Draft request schema. */
29
+ requestSchema?: Rulebricks.RuleImportSchemaField[];
30
+ /** Draft response schema. */
31
+ responseSchema?: Rulebricks.RuleImportSchemaField[];
32
+ /** Sample request JSON. */
33
+ sampleRequest?: Record<string, unknown>;
34
+ /** Request payload used by editor test tab. */
35
+ testRequest?: Record<string, unknown>;
36
+ /** Sample response JSON. */
37
+ sampleResponse?: Record<string, unknown>;
38
+ /** Draft condition rows. */
39
+ conditions?: Rulebricks.RuleImportConditionRow[];
40
+ /** Optional row grouping definitions. */
41
+ groups?: Record<string, Record<string, unknown>>;
42
+ /** Optional rule-level settings. */
43
+ settings?: Record<string, unknown>;
44
+ /** Optional rule test suite. */
45
+ testSuite?: Record<string, unknown>[];
46
+ /** Rule history entries. */
47
+ history?: Record<string, unknown>[];
48
+ /** Publish timestamp. */
49
+ publishedAt?: string | null;
50
+ /** Optional published request schema override. */
51
+ published_requestSchema?: Rulebricks.RuleImportSchemaField[] | null;
52
+ /** Optional published response schema override. */
53
+ published_responseSchema?: Rulebricks.RuleImportSchemaField[] | null;
54
+ /** Optional published conditions override. */
55
+ published_conditions?: Rulebricks.RuleImportConditionRow[] | null;
56
+ /** Optional published groups override. */
57
+ published_groups?: Record<string, Record<string, unknown> | null> | null;
58
+ /** Accepts any additional properties */
59
+ [key: string]: any;
60
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A request cell in a condition row.
3
+ */
4
+ export interface RuleImportRequestCell {
5
+ /** Operator name for this request comparison. */
6
+ op: string;
7
+ /** Operator arguments. */
8
+ args: unknown[];
9
+ /** Accepts any additional properties */
10
+ [key: string]: any;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A response cell in a condition row.
3
+ */
4
+ export interface RuleImportResponseCell {
5
+ value?: unknown;
6
+ /** Accepts any additional properties */
7
+ [key: string]: any;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Execution settings for a condition row.
3
+ */
4
+ export interface RuleImportRowSettings {
5
+ /** Whether this row is active. */
6
+ enabled: boolean;
7
+ /** Optional group ID for grouped aggregation. */
8
+ groupId: string | null;
9
+ /** Row priority when multiple rows match. */
10
+ priority: number;
11
+ /** Optional schedule constraints for this row. */
12
+ schedule: Record<string, unknown>[];
13
+ /** When true, request cells in this row are evaluated with OR semantics. */
14
+ or?: boolean;
15
+ /** Accepts any additional properties */
16
+ [key: string]: any;
17
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,36 @@
1
+ /**
2
+ * A request or response schema field used when importing a rule.
3
+ */
4
+ export interface RuleImportSchemaField {
5
+ /** Unique key for this field. */
6
+ key: string;
7
+ /** Whether this field is shown in the editor table. */
8
+ show: boolean;
9
+ /** Display name for this field. */
10
+ name: string;
11
+ /** Optional field description. */
12
+ description?: string;
13
+ /** Data type for this field. */
14
+ type: RuleImportSchemaField.Type;
15
+ /** Optional default value for this field. */
16
+ defaultValue?: unknown | null;
17
+ /** When true, this field should only accept values from a value collection. */
18
+ valuesOnly?: boolean;
19
+ /** Prefix used to scope available dynamic values for this field. */
20
+ valuesPrefix?: string;
21
+ /** Accepts any additional properties */
22
+ [key: string]: any;
23
+ }
24
+ export declare namespace RuleImportSchemaField {
25
+ /** Data type for this field. */
26
+ const Type: {
27
+ readonly String: "string";
28
+ readonly Number: "number";
29
+ readonly Boolean: "boolean";
30
+ readonly Date: "date";
31
+ readonly List: "list";
32
+ readonly Object: "object";
33
+ readonly Function: "function";
34
+ };
35
+ type Type = (typeof Type)[keyof typeof Type];
36
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RuleImportSchemaField = void 0;
5
+ var RuleImportSchemaField;
6
+ (function (RuleImportSchemaField) {
7
+ /** Data type for this field. */
8
+ RuleImportSchemaField.Type = {
9
+ String: "string",
10
+ Number: "number",
11
+ Boolean: "boolean",
12
+ Date: "date",
13
+ List: "list",
14
+ Object: "object",
15
+ Function: "function",
16
+ };
17
+ })(RuleImportSchemaField || (exports.RuleImportSchemaField = RuleImportSchemaField = {}));
@@ -10,9 +10,9 @@ export interface SchemaField {
10
10
  /** Data type of this field. */
11
11
  type?: SchemaField.Type;
12
12
  /** Default value for this field. */
13
- defaultValue?: SchemaField.DefaultValue | null;
13
+ default_value?: SchemaField.DefaultValue | null;
14
14
  /** Computed default value for this field. */
15
- defaultComputedValue?: string | null;
15
+ default_computed_value?: string | null;
16
16
  /** Transformation expression to apply to this field. */
17
17
  transform?: string;
18
18
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Optional request body for executing a flow against context. The entire body is merged with instance state before flow execution.
3
+ */
4
+ export type SolveContextFlowRequest = Record<string, unknown>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Optional request body for solving a rule against context. The entire body is merged with the instance state before rule evaluation.
3
+ */
4
+ export type SolveContextRuleRequest = Record<string, unknown>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,14 +9,14 @@ export interface Test {
9
9
  response: Record<string, unknown>;
10
10
  /** Indicates whether the test is critical. */
11
11
  critical: boolean;
12
- /** Indicates if the test resulted in an error. */
13
- error: boolean;
14
- /** Indicates if the test was successful. */
15
- success: boolean;
12
+ /** Indicates if the test resulted in an error. Null if test has not been executed. */
13
+ error?: boolean | null;
14
+ /** Indicates if the test was successful. Null if test has not been executed. */
15
+ success?: boolean | null;
16
16
  /** The state of the test after execution. */
17
- testState?: Test.TestState | null;
17
+ test_state?: Test.TestState | null;
18
18
  /** The timestamp when the test was last executed. */
19
- lastExecuted?: string | null;
19
+ last_executed?: string | null;
20
20
  }
21
21
  export declare namespace Test {
22
22
  /**
@@ -29,10 +29,10 @@ export declare namespace Test {
29
29
  response?: Record<string, unknown> | null;
30
30
  conditions?: Record<string, unknown>[];
31
31
  /** HTTP status code returned */
32
- httpStatus?: number;
33
- successIdxs?: number[];
32
+ http_status?: number;
33
+ success_idxs?: number[];
34
34
  /** Error message or flag indicating if evaluation error occurred */
35
- evaluationError?: TestState.EvaluationError;
35
+ evaluation_error?: TestState.EvaluationError;
36
36
  }
37
37
  namespace TestState {
38
38
  /**
@@ -1,2 +1,13 @@
1
- import type * as Rulebricks from "../index.js";
2
- export type UpdateContextResponse = Rulebricks.ContextDetail;
1
+ /**
2
+ * Response after updating a context.
3
+ */
4
+ export interface UpdateContextResponse {
5
+ /** The unique identifier of the updated context. */
6
+ id?: string;
7
+ /** The slug of the updated context. */
8
+ slug?: string;
9
+ /** The name of the updated context. */
10
+ name?: string;
11
+ /** Timestamp of when the context was updated. */
12
+ updated_at?: string;
13
+ }
@@ -1,14 +1,20 @@
1
1
  export interface UsageStatistics {
2
2
  /** The current plan of the organization. */
3
3
  plan?: string;
4
- /** The start date of the current monthly period. */
4
+ /** The start date of the current monthly period (MM-DD-YYYY). */
5
5
  monthly_period_start?: string;
6
- /** The end date of the current monthly period. */
6
+ /** The end date of the current monthly period (MM-DD-YYYY). */
7
7
  monthly_period_end?: string;
8
8
  /** The number of rule executions used this month. */
9
9
  monthly_executions_usage?: number;
10
- /** The total number of rule executions allowed this month. */
10
+ /** The total number of rule executions allowed this month. -1 indicates unlimited. */
11
11
  monthly_executions_limit?: number;
12
- /** The number of rule executions remaining this month. */
12
+ /** The number of rule executions remaining this month. -1 indicates unlimited. */
13
13
  monthly_executions_remaining?: number;
14
+ /** Whether the plan has unlimited executions (true when monthly_executions_limit is -1). */
15
+ unlimited_plan?: boolean;
16
+ /** Number of days remaining in the current billing period. */
17
+ days_remaining_in_period?: number;
18
+ /** Average number of executions per day in the current period. */
19
+ daily_average_usage?: number;
14
20
  }
@@ -7,4 +7,6 @@ export interface UserGroup {
7
7
  description?: string;
8
8
  /** List of member emails in the user group. */
9
9
  members?: string[];
10
+ /** When the user group was created. */
11
+ created_at?: string;
10
12
  }