@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,13 +1,128 @@
1
+ import type * as Rulebricks from "../../../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
4
5
  * rule: {
5
- * "name": "Imported Rule",
6
- * "description": "A rule imported via API"
6
+ * id: "11111111-2222-4333-8444-555555555555",
7
+ * slug: "basic-pricing-rule",
8
+ * name: "Basic Pricing Rule",
9
+ * description: "",
10
+ * createdAt: "2026-02-12T01:29:23.000Z",
11
+ * updatedAt: "2026-02-12T01:29:23.000Z",
12
+ * published: false,
13
+ * _publish: true,
14
+ * testRequest: {
15
+ * "customer_tier": "STANDARD",
16
+ * "order_total": 250,
17
+ * "expedited": false
18
+ * },
19
+ * sampleRequest: {
20
+ * "customer_tier": "STANDARD",
21
+ * "order_total": 250,
22
+ * "expedited": false
23
+ * },
24
+ * sampleResponse: {
25
+ * "discount_rate": 0,
26
+ * "approval_status": "standard"
27
+ * },
28
+ * requestSchema: [{
29
+ * key: "customer_tier",
30
+ * show: true,
31
+ * name: "Customer Tier",
32
+ * type: "string"
33
+ * }, {
34
+ * key: "order_total",
35
+ * show: true,
36
+ * name: "Order Total",
37
+ * type: "number"
38
+ * }, {
39
+ * key: "expedited",
40
+ * show: true,
41
+ * name: "Expedited",
42
+ * type: "boolean"
43
+ * }],
44
+ * responseSchema: [{
45
+ * key: "discount_rate",
46
+ * show: true,
47
+ * name: "Discount Rate",
48
+ * type: "number"
49
+ * }, {
50
+ * key: "approval_status",
51
+ * show: true,
52
+ * name: "Approval Status",
53
+ * type: "string"
54
+ * }],
55
+ * conditions: [{
56
+ * request: {
57
+ * "customer_tier": {
58
+ * op: "equals",
59
+ * args: ["VIP"]
60
+ * }
61
+ * },
62
+ * response: {
63
+ * "discount_rate": {
64
+ * value: 0.2
65
+ * },
66
+ * "approval_status": {
67
+ * value: "priority"
68
+ * }
69
+ * },
70
+ * settings: {
71
+ * enabled: true,
72
+ * groupId: null,
73
+ * priority: 0,
74
+ * schedule: []
75
+ * }
76
+ * }, {
77
+ * request: {
78
+ * "expedited": {
79
+ * op: "equals",
80
+ * args: [true]
81
+ * }
82
+ * },
83
+ * response: {
84
+ * "discount_rate": {
85
+ * value: 0.05
86
+ * },
87
+ * "approval_status": {
88
+ * value: "expedited"
89
+ * }
90
+ * },
91
+ * settings: {
92
+ * enabled: true,
93
+ * groupId: null,
94
+ * priority: 1,
95
+ * schedule: []
96
+ * }
97
+ * }, {
98
+ * request: {},
99
+ * response: {
100
+ * "discount_rate": {
101
+ * value: 0
102
+ * },
103
+ * "approval_status": {
104
+ * value: "standard"
105
+ * }
106
+ * },
107
+ * settings: {
108
+ * enabled: true,
109
+ * groupId: null,
110
+ * priority: 2,
111
+ * schedule: []
112
+ * }
113
+ * }],
114
+ * history: []
115
+ * }
116
+ * }
117
+ *
118
+ * @example
119
+ * {
120
+ * rule: {
121
+ * id: "11111111-2222-4333-8444-555555555555",
122
+ * name: "Updated Rule Name"
7
123
  * }
8
124
  * }
9
125
  */
10
126
  export interface ImportRuleRequest {
11
- /** The rule data to import. */
12
- rule: Record<string, unknown>;
127
+ rule: Rulebricks.RuleImportPayload;
13
128
  }
@@ -0,0 +1,2 @@
1
+ import type * as Rulebricks from "../../../index.js";
2
+ export type ExportRbmAssetsResponse = Rulebricks.ExportManifestResponse | Rulebricks.ExportManifestPreviewResponse;
@@ -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 });
@@ -1 +1 @@
1
- export * from "./ExportAssetsResponse.js";
1
+ export * from "./ExportRbmAssetsResponse.js";
@@ -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("./ExportAssetsResponse.js"), exports);
17
+ __exportStar(require("./ExportRbmAssetsResponse.js"), exports);
@@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClie
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
3
  import * as core from "../../../../core/index.js";
4
4
  import * as Rulebricks from "../../../index.js";
5
- import { AdminClient } from "../resources/admin/client/Client.js";
5
+ import { ObjectsClient } from "../resources/objects/client/Client.js";
6
6
  import { RelationshipsClient } from "../resources/relationships/client/Client.js";
7
7
  export declare namespace ContextsClient {
8
8
  type Options = BaseClientOptions;
@@ -10,32 +10,32 @@ export declare namespace ContextsClient {
10
10
  }
11
11
  }
12
12
  /**
13
- * Operations for managing and interacting with Contexts (Entities) and their instances
13
+ * Operations for managing and interacting with live Context instances
14
14
  */
15
15
  export declare class ContextsClient {
16
16
  protected readonly _options: NormalizedClientOptionsWithAuth<ContextsClient.Options>;
17
- protected _admin: AdminClient | undefined;
17
+ protected _objects: ObjectsClient | undefined;
18
18
  protected _relationships: RelationshipsClient | undefined;
19
19
  constructor(options: ContextsClient.Options);
20
- get admin(): AdminClient;
20
+ get objects(): ObjectsClient;
21
21
  get relationships(): RelationshipsClient;
22
22
  /**
23
23
  * Retrieve the current state of a context instance.
24
24
  *
25
- * @param {Rulebricks.GetInstanceContextsRequest} request
25
+ * @param {Rulebricks.GetContextsRequest} request
26
26
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
27
27
  *
28
28
  * @throws {@link Rulebricks.NotFoundError}
29
29
  * @throws {@link Rulebricks.InternalServerError}
30
30
  *
31
31
  * @example
32
- * await client.contexts.getInstance({
32
+ * await client.contexts.get({
33
33
  * slug: "customer",
34
34
  * instance: "cust-12345"
35
35
  * })
36
36
  */
37
- getInstance(request: Rulebricks.GetInstanceContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ContextInstanceState>;
38
- private __getInstance;
37
+ get(request: Rulebricks.GetContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ContextInstanceState>;
38
+ private __get;
39
39
  /**
40
40
  * Submit data to a context instance, creating it if it doesn't exist. May trigger bound rule/flow evaluations.
41
41
  *
@@ -61,20 +61,20 @@ export declare class ContextsClient {
61
61
  /**
62
62
  * Delete a specific context instance and its history.
63
63
  *
64
- * @param {Rulebricks.DeleteInstanceContextsRequest} request
64
+ * @param {Rulebricks.DeleteContextsRequest} request
65
65
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
66
66
  *
67
67
  * @throws {@link Rulebricks.NotFoundError}
68
68
  * @throws {@link Rulebricks.InternalServerError}
69
69
  *
70
70
  * @example
71
- * await client.contexts.deleteInstance({
71
+ * await client.contexts.delete({
72
72
  * slug: "customer",
73
73
  * instance: "cust-12345"
74
74
  * })
75
75
  */
76
- deleteInstance(request: Rulebricks.DeleteInstanceContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.DeleteContextInstanceResponse>;
77
- private __deleteInstance;
76
+ delete(request: Rulebricks.DeleteContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.DeleteContextInstanceResponse>;
77
+ private __delete;
78
78
  /**
79
79
  * Retrieve the change history for a context instance.
80
80
  *
@@ -112,7 +112,7 @@ export declare class ContextsClient {
112
112
  /**
113
113
  * Execute a specific rule using the context instance's state as input.
114
114
  *
115
- * @param {Rulebricks.SolveContextRuleRequest} request
115
+ * @param {Rulebricks.SolveContextsRequest} request
116
116
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
117
117
  *
118
118
  * @throws {@link Rulebricks.BadRequestError}
@@ -123,15 +123,16 @@ export declare class ContextsClient {
123
123
  * await client.contexts.solve({
124
124
  * slug: "customer",
125
125
  * instance: "cust-12345",
126
- * ruleSlug: "eligibility-check"
126
+ * ruleSlug: "eligibility-check",
127
+ * body: {}
127
128
  * })
128
129
  */
129
- solve(request: Rulebricks.SolveContextRuleRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.SolveContextRuleResponse>;
130
+ solve(request: Rulebricks.SolveContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.SolveContextRuleResponse>;
130
131
  private __solve;
131
132
  /**
132
133
  * Trigger re-evaluation of all bound rules and flows for the instance.
133
134
  *
134
- * @param {Rulebricks.CascadeContextRequest} request
135
+ * @param {Rulebricks.CascadeContextsRequest} request
135
136
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
136
137
  *
137
138
  * @throws {@link Rulebricks.NotFoundError}
@@ -140,15 +141,16 @@ export declare class ContextsClient {
140
141
  * @example
141
142
  * await client.contexts.cascade({
142
143
  * slug: "customer",
143
- * instance: "cust-12345"
144
+ * instance: "cust-12345",
145
+ * body: {}
144
146
  * })
145
147
  */
146
- cascade(request: Rulebricks.CascadeContextRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.CascadeContextResponse>;
148
+ cascade(request: Rulebricks.CascadeContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.CascadeContextResponse>;
147
149
  private __cascade;
148
150
  /**
149
151
  * Execute a specific flow using the context instance's state as input.
150
152
  *
151
- * @param {Rulebricks.SolveContextFlowRequest} request
153
+ * @param {Rulebricks.ExecuteContextsRequest} request
152
154
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
153
155
  *
154
156
  * @throws {@link Rulebricks.BadRequestError}
@@ -159,9 +161,10 @@ export declare class ContextsClient {
159
161
  * await client.contexts.execute({
160
162
  * slug: "customer",
161
163
  * instance: "cust-12345",
162
- * flowSlug: "onboarding-flow"
164
+ * flowSlug: "onboarding-flow",
165
+ * body: {}
163
166
  * })
164
167
  */
165
- execute(request: Rulebricks.SolveContextFlowRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.SolveContextFlowResponse>;
168
+ execute(request: Rulebricks.ExecuteContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.SolveContextFlowResponse>;
166
169
  private __execute;
167
170
  }
@@ -42,17 +42,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
43
43
  });
44
44
  };
45
- var __rest = (this && this.__rest) || function (s, e) {
46
- var t = {};
47
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
- t[p] = s[p];
49
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
- t[p[i]] = s[p[i]];
53
- }
54
- return t;
55
- };
56
45
  Object.defineProperty(exports, "__esModule", { value: true });
57
46
  exports.ContextsClient = void 0;
58
47
  const BaseClient_js_1 = require("../../../../BaseClient.js");
@@ -62,18 +51,18 @@ const environments = __importStar(require("../../../../environments.js"));
62
51
  const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
63
52
  const errors = __importStar(require("../../../../errors/index.js"));
64
53
  const Rulebricks = __importStar(require("../../../index.js"));
65
- const Client_js_1 = require("../resources/admin/client/Client.js");
54
+ const Client_js_1 = require("../resources/objects/client/Client.js");
66
55
  const Client_js_2 = require("../resources/relationships/client/Client.js");
67
56
  /**
68
- * Operations for managing and interacting with Contexts (Entities) and their instances
57
+ * Operations for managing and interacting with live Context instances
69
58
  */
70
59
  class ContextsClient {
71
60
  constructor(options) {
72
61
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
73
62
  }
74
- get admin() {
63
+ get objects() {
75
64
  var _a;
76
- return ((_a = this._admin) !== null && _a !== void 0 ? _a : (this._admin = new Client_js_1.AdminClient(this._options)));
65
+ return ((_a = this._objects) !== null && _a !== void 0 ? _a : (this._objects = new Client_js_1.ObjectsClient(this._options)));
77
66
  }
78
67
  get relationships() {
79
68
  var _a;
@@ -82,22 +71,22 @@ class ContextsClient {
82
71
  /**
83
72
  * Retrieve the current state of a context instance.
84
73
  *
85
- * @param {Rulebricks.GetInstanceContextsRequest} request
74
+ * @param {Rulebricks.GetContextsRequest} request
86
75
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
87
76
  *
88
77
  * @throws {@link Rulebricks.NotFoundError}
89
78
  * @throws {@link Rulebricks.InternalServerError}
90
79
  *
91
80
  * @example
92
- * await client.contexts.getInstance({
81
+ * await client.contexts.get({
93
82
  * slug: "customer",
94
83
  * instance: "cust-12345"
95
84
  * })
96
85
  */
97
- getInstance(request, requestOptions) {
98
- return core.HttpResponsePromise.fromPromise(this.__getInstance(request, requestOptions));
86
+ get(request, requestOptions) {
87
+ return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
99
88
  }
100
- __getInstance(request, requestOptions) {
89
+ __get(request, requestOptions) {
101
90
  return __awaiter(this, void 0, void 0, function* () {
102
91
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
103
92
  const { slug, instance } = request;
@@ -202,22 +191,22 @@ class ContextsClient {
202
191
  /**
203
192
  * Delete a specific context instance and its history.
204
193
  *
205
- * @param {Rulebricks.DeleteInstanceContextsRequest} request
194
+ * @param {Rulebricks.DeleteContextsRequest} request
206
195
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
207
196
  *
208
197
  * @throws {@link Rulebricks.NotFoundError}
209
198
  * @throws {@link Rulebricks.InternalServerError}
210
199
  *
211
200
  * @example
212
- * await client.contexts.deleteInstance({
201
+ * await client.contexts.delete({
213
202
  * slug: "customer",
214
203
  * instance: "cust-12345"
215
204
  * })
216
205
  */
217
- deleteInstance(request, requestOptions) {
218
- return core.HttpResponsePromise.fromPromise(this.__deleteInstance(request, requestOptions));
206
+ delete(request, requestOptions) {
207
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
219
208
  }
220
- __deleteInstance(request, requestOptions) {
209
+ __delete(request, requestOptions) {
221
210
  return __awaiter(this, void 0, void 0, function* () {
222
211
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
223
212
  const { slug, instance } = request;
@@ -380,7 +369,7 @@ class ContextsClient {
380
369
  /**
381
370
  * Execute a specific rule using the context instance's state as input.
382
371
  *
383
- * @param {Rulebricks.SolveContextRuleRequest} request
372
+ * @param {Rulebricks.SolveContextsRequest} request
384
373
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
385
374
  *
386
375
  * @throws {@link Rulebricks.BadRequestError}
@@ -391,7 +380,8 @@ class ContextsClient {
391
380
  * await client.contexts.solve({
392
381
  * slug: "customer",
393
382
  * instance: "cust-12345",
394
- * ruleSlug: "eligibility-check"
383
+ * ruleSlug: "eligibility-check",
384
+ * body: {}
395
385
  * })
396
386
  */
397
387
  solve(request, requestOptions) {
@@ -400,7 +390,7 @@ class ContextsClient {
400
390
  __solve(request, requestOptions) {
401
391
  return __awaiter(this, void 0, void 0, function* () {
402
392
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
403
- const { slug, instance, ruleSlug } = request, _body = __rest(request, ["slug", "instance", "ruleSlug"]);
393
+ const { slug, instance, ruleSlug, body: _body } = request;
404
394
  const _authRequest = yield this._options.authProvider.getAuthRequest();
405
395
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
406
396
  const _response = yield core.fetcher({
@@ -442,7 +432,7 @@ class ContextsClient {
442
432
  /**
443
433
  * Trigger re-evaluation of all bound rules and flows for the instance.
444
434
  *
445
- * @param {Rulebricks.CascadeContextRequest} request
435
+ * @param {Rulebricks.CascadeContextsRequest} request
446
436
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
447
437
  *
448
438
  * @throws {@link Rulebricks.NotFoundError}
@@ -451,7 +441,8 @@ class ContextsClient {
451
441
  * @example
452
442
  * await client.contexts.cascade({
453
443
  * slug: "customer",
454
- * instance: "cust-12345"
444
+ * instance: "cust-12345",
445
+ * body: {}
455
446
  * })
456
447
  */
457
448
  cascade(request, requestOptions) {
@@ -460,7 +451,7 @@ class ContextsClient {
460
451
  __cascade(request, requestOptions) {
461
452
  return __awaiter(this, void 0, void 0, function* () {
462
453
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
463
- const { slug, instance } = request, _body = __rest(request, ["slug", "instance"]);
454
+ const { slug, instance, body: _body } = request;
464
455
  const _authRequest = yield this._options.authProvider.getAuthRequest();
465
456
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
466
457
  const _response = yield core.fetcher({
@@ -500,7 +491,7 @@ class ContextsClient {
500
491
  /**
501
492
  * Execute a specific flow using the context instance's state as input.
502
493
  *
503
- * @param {Rulebricks.SolveContextFlowRequest} request
494
+ * @param {Rulebricks.ExecuteContextsRequest} request
504
495
  * @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
505
496
  *
506
497
  * @throws {@link Rulebricks.BadRequestError}
@@ -511,7 +502,8 @@ class ContextsClient {
511
502
  * await client.contexts.execute({
512
503
  * slug: "customer",
513
504
  * instance: "cust-12345",
514
- * flowSlug: "onboarding-flow"
505
+ * flowSlug: "onboarding-flow",
506
+ * body: {}
515
507
  * })
516
508
  */
517
509
  execute(request, requestOptions) {
@@ -520,7 +512,7 @@ class ContextsClient {
520
512
  __execute(request, requestOptions) {
521
513
  return __awaiter(this, void 0, void 0, function* () {
522
514
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
523
- const { slug, instance, flowSlug } = request, _body = __rest(request, ["slug", "instance", "flowSlug"]);
515
+ const { slug, instance, flowSlug, body: _body } = request;
524
516
  const _authRequest = yield this._options.authProvider.getAuthRequest();
525
517
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
526
518
  const _response = yield core.fetcher({
@@ -1,15 +1,16 @@
1
+ import type * as Rulebricks from "../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
4
5
  * slug: "customer",
5
- * instance: "cust-12345"
6
+ * instance: "cust-12345",
7
+ * body: {}
6
8
  * }
7
9
  */
8
- export interface CascadeContextRequest {
10
+ export interface CascadeContextsRequest {
9
11
  /** The unique slug for the context. */
10
12
  slug: string;
11
13
  /** The unique identifier for the context instance. */
12
14
  instance: string;
13
- /** Maximum depth for cascading evaluations. */
14
- maxDepth?: number;
15
+ body: Rulebricks.CascadeContextRequest;
15
16
  }
@@ -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 });
@@ -5,7 +5,7 @@
5
5
  * instance: "cust-12345"
6
6
  * }
7
7
  */
8
- export interface DeleteInstanceContextsRequest {
8
+ export interface DeleteContextsRequest {
9
9
  /** The unique slug for the context. */
10
10
  slug: string;
11
11
  /** The unique identifier for the context instance. */
@@ -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 });
@@ -1,20 +1,19 @@
1
+ import type * as Rulebricks from "../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
4
5
  * slug: "customer",
5
6
  * instance: "cust-12345",
6
- * flowSlug: "onboarding-flow"
7
+ * flowSlug: "onboarding-flow",
8
+ * body: {}
7
9
  * }
8
10
  */
9
- export interface SolveContextFlowRequest {
11
+ export interface ExecuteContextsRequest {
10
12
  /** The unique slug for the context. */
11
13
  slug: string;
12
14
  /** The unique identifier for the context instance. */
13
15
  instance: string;
14
16
  /** The unique slug for the flow. */
15
17
  flowSlug: string;
16
- /** Additional data to merge with instance state for flow execution. */
17
- additionalData?: Record<string, unknown>;
18
- /** Whether to persist derived outputs to the instance. */
19
- persist?: boolean;
18
+ body: Rulebricks.SolveContextFlowRequest;
20
19
  }
@@ -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 });
@@ -5,7 +5,7 @@
5
5
  * instance: "cust-12345"
6
6
  * }
7
7
  */
8
- export interface DeleteInstanceContextsRequest {
8
+ export interface GetContextsRequest {
9
9
  /** The unique slug for the context. */
10
10
  slug: string;
11
11
  /** The unique identifier for the context instance. */
@@ -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 });
@@ -1,20 +1,19 @@
1
+ import type * as Rulebricks from "../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
4
5
  * slug: "customer",
5
6
  * instance: "cust-12345",
6
- * ruleSlug: "eligibility-check"
7
+ * ruleSlug: "eligibility-check",
8
+ * body: {}
7
9
  * }
8
10
  */
9
- export interface SolveContextRuleRequest {
11
+ export interface SolveContextsRequest {
10
12
  /** The unique slug for the context. */
11
13
  slug: string;
12
14
  /** The unique identifier for the context instance. */
13
15
  instance: string;
14
16
  /** The unique slug for the rule. */
15
17
  ruleSlug: string;
16
- /** Additional data to merge with instance state for rule evaluation. */
17
- additionalData?: Record<string, unknown>;
18
- /** Whether to persist derived outputs to the instance. */
19
- persist?: boolean;
18
+ body: Rulebricks.SolveContextRuleRequest;
20
19
  }
@@ -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 });
@@ -1,8 +1,8 @@
1
- export type { CascadeContextRequest } from "./CascadeContextRequest.js";
2
- export type { DeleteInstanceContextsRequest } from "./DeleteInstanceContextsRequest.js";
1
+ export type { CascadeContextsRequest } from "./CascadeContextsRequest.js";
2
+ export type { DeleteContextsRequest } from "./DeleteContextsRequest.js";
3
+ export type { ExecuteContextsRequest } from "./ExecuteContextsRequest.js";
4
+ export type { GetContextsRequest } from "./GetContextsRequest.js";
3
5
  export type { GetHistoryContextsRequest } from "./GetHistoryContextsRequest.js";
4
- export type { GetInstanceContextsRequest } from "./GetInstanceContextsRequest.js";
5
6
  export type { GetPendingContextsRequest } from "./GetPendingContextsRequest.js";
6
- export type { SolveContextFlowRequest } from "./SolveContextFlowRequest.js";
7
- export type { SolveContextRuleRequest } from "./SolveContextRuleRequest.js";
7
+ export type { SolveContextsRequest } from "./SolveContextsRequest.js";
8
8
  export type { SubmitContextsRequest } from "./SubmitContextsRequest.js";
@@ -1,4 +1,4 @@
1
- export * from "./admin/client/requests/index.js";
2
- export * as admin from "./admin/index.js";
1
+ export * from "./objects/client/requests/index.js";
2
+ export * as objects from "./objects/index.js";
3
3
  export * from "./relationships/client/requests/index.js";
4
4
  export * as relationships from "./relationships/index.js";
@@ -36,8 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.relationships = exports.admin = void 0;
40
- __exportStar(require("./admin/client/requests/index.js"), exports);
41
- exports.admin = __importStar(require("./admin/index.js"));
39
+ exports.relationships = exports.objects = void 0;
40
+ __exportStar(require("./objects/client/requests/index.js"), exports);
41
+ exports.objects = __importStar(require("./objects/index.js"));
42
42
  __exportStar(require("./relationships/client/requests/index.js"), exports);
43
43
  exports.relationships = __importStar(require("./relationships/index.js"));