@rulebricks/sdk 2.0.0 → 2.5.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 (159) 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/types/ExportRbmAssetsResponse.d.ts +2 -0
  8. package/api/resources/assets/types/index.d.ts +1 -1
  9. package/api/resources/assets/types/index.js +1 -1
  10. package/api/resources/contexts/client/Client.d.ts +24 -21
  11. package/api/resources/contexts/client/Client.js +26 -34
  12. package/api/resources/contexts/client/requests/{CascadeContextRequest.d.ts → CascadeContextsRequest.d.ts} +5 -4
  13. package/api/resources/contexts/client/requests/{GetInstanceContextsRequest.d.ts → DeleteContextsRequest.d.ts} +1 -1
  14. package/{dist/api/resources/contexts/client/requests/SolveContextFlowRequest.d.ts → api/resources/contexts/client/requests/ExecuteContextsRequest.d.ts} +5 -6
  15. package/{dist/api/resources/contexts/client/requests/GetInstanceContextsRequest.d.ts → api/resources/contexts/client/requests/GetContextsRequest.d.ts} +1 -1
  16. package/api/resources/contexts/client/requests/{SolveContextRuleRequest.d.ts → SolveContextsRequest.d.ts} +5 -6
  17. package/api/resources/contexts/client/requests/index.d.ts +5 -5
  18. package/api/resources/contexts/resources/index.d.ts +2 -2
  19. package/api/resources/contexts/resources/index.js +3 -3
  20. package/api/resources/contexts/resources/{admin → objects}/client/Client.d.ts +25 -24
  21. package/api/resources/contexts/resources/{admin → objects}/client/Client.js +19 -18
  22. package/{dist/api/resources/contexts/resources/admin → api/resources/contexts/resources/objects}/client/requests/CreateContextRequest.d.ts +7 -4
  23. package/{dist/api/resources/contexts/resources/admin/client/requests/DeleteAdminRequest.d.ts → api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.d.ts} +1 -1
  24. package/{dist/api/resources/contexts/resources/admin/client/requests/GetAdminRequest.d.ts → api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.d.ts} +1 -1
  25. package/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.d.ts +1 -1
  26. package/api/resources/contexts/resources/{admin → objects}/client/requests/index.d.ts +2 -2
  27. package/api/resources/contexts/resources/relationships/client/Client.d.ts +3 -3
  28. package/api/resources/contexts/resources/relationships/client/Client.js +3 -3
  29. package/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.d.ts +11 -11
  30. package/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.js +4 -4
  31. package/api/resources/users/client/Client.d.ts +2 -2
  32. package/api/resources/users/client/Client.js +2 -2
  33. package/api/resources/values/client/requests/UpdateValuesRequest.d.ts +1 -1
  34. package/api/types/CascadeContextRequest.d.ts +4 -0
  35. package/api/types/ContextInstancePendingEvaluation.d.ts +10 -2
  36. package/api/types/ContextListItem.d.ts +24 -0
  37. package/api/types/ContextListResponse.d.ts +1 -1
  38. package/api/types/ContextRelationshipBase.d.ts +6 -4
  39. package/api/types/ContextRelationshipBase.js +3 -3
  40. package/api/types/ContextRelationshipIncoming.d.ts +1 -1
  41. package/api/types/ContextRelationshipOutgoing.d.ts +1 -1
  42. package/api/types/ContextRelationshipsResponse.d.ts +12 -0
  43. package/api/types/ContextSchemaField.d.ts +4 -4
  44. package/api/types/DecisionLog.d.ts +13 -4
  45. package/api/types/DecisionLogResponse.d.ts +4 -4
  46. package/api/types/DeleteRelationshipResponse.d.ts +2 -0
  47. package/api/types/ExportManifestPreviewResponse.d.ts +53 -40
  48. package/api/types/ExportManifestResponse.d.ts +28 -7
  49. package/api/types/Folder.d.ts +4 -0
  50. package/api/types/ImportManifestResponse.d.ts +52 -24
  51. package/api/types/SchemaField.d.ts +2 -2
  52. package/api/types/SolveContextFlowRequest.d.ts +4 -0
  53. package/api/types/SolveContextRuleRequest.d.ts +4 -0
  54. package/api/types/Test.d.ts +9 -9
  55. package/api/types/UpdateContextResponse.d.ts +13 -2
  56. package/api/types/UsageStatistics.d.ts +10 -4
  57. package/api/types/UserGroup.d.ts +2 -0
  58. package/api/types/index.d.ts +4 -0
  59. package/api/types/index.js +4 -0
  60. package/dist/api/resources/assets/client/Client.d.ts +14 -15
  61. package/dist/api/resources/assets/client/Client.js +17 -18
  62. package/dist/api/resources/assets/client/requests/ExportManifestRequest.d.ts +25 -16
  63. package/dist/api/resources/assets/client/requests/ExportManifestRequest.js +11 -0
  64. package/dist/api/resources/assets/client/requests/ImportManifestRequest.d.ts +31 -7
  65. package/dist/api/resources/assets/client/requests/ImportManifestRequest.js +20 -0
  66. package/dist/api/resources/assets/types/ExportRbmAssetsResponse.d.ts +2 -0
  67. package/dist/api/resources/assets/types/index.d.ts +1 -1
  68. package/dist/api/resources/assets/types/index.js +1 -1
  69. package/dist/api/resources/contexts/client/Client.d.ts +24 -21
  70. package/dist/api/resources/contexts/client/Client.js +26 -34
  71. package/dist/api/resources/contexts/client/requests/{CascadeContextRequest.d.ts → CascadeContextsRequest.d.ts} +5 -4
  72. package/{api/resources/contexts/client/requests/DeleteInstanceContextsRequest.d.ts → dist/api/resources/contexts/client/requests/DeleteContextsRequest.d.ts} +1 -1
  73. package/{api/resources/contexts/client/requests/SolveContextFlowRequest.d.ts → dist/api/resources/contexts/client/requests/ExecuteContextsRequest.d.ts} +5 -6
  74. package/dist/api/resources/contexts/client/requests/{DeleteInstanceContextsRequest.d.ts → GetContextsRequest.d.ts} +1 -1
  75. package/dist/api/resources/contexts/client/requests/GetContextsRequest.js +3 -0
  76. package/dist/api/resources/contexts/client/requests/{SolveContextRuleRequest.d.ts → SolveContextsRequest.d.ts} +5 -6
  77. package/dist/api/resources/contexts/client/requests/SolveContextsRequest.js +3 -0
  78. package/dist/api/resources/contexts/client/requests/index.d.ts +5 -5
  79. package/dist/api/resources/contexts/resources/index.d.ts +2 -2
  80. package/dist/api/resources/contexts/resources/index.js +3 -3
  81. package/dist/api/resources/contexts/resources/{admin → objects}/client/Client.d.ts +25 -24
  82. package/dist/api/resources/contexts/resources/{admin → objects}/client/Client.js +19 -18
  83. package/{api/resources/contexts/resources/admin → dist/api/resources/contexts/resources/objects}/client/requests/CreateContextRequest.d.ts +7 -4
  84. package/{api/resources/contexts/resources/admin/client/requests/DeleteAdminRequest.d.ts → dist/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.d.ts} +1 -1
  85. package/dist/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.js +3 -0
  86. package/{api/resources/contexts/resources/admin/client/requests/GetAdminRequest.d.ts → dist/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.d.ts} +1 -1
  87. package/dist/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.js +3 -0
  88. package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.d.ts +1 -1
  89. package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/index.d.ts +2 -2
  90. package/dist/api/resources/contexts/resources/relationships/client/Client.d.ts +3 -3
  91. package/dist/api/resources/contexts/resources/relationships/client/Client.js +3 -3
  92. package/dist/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.d.ts +11 -11
  93. package/dist/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.js +4 -4
  94. package/dist/api/resources/users/client/Client.d.ts +2 -2
  95. package/dist/api/resources/users/client/Client.js +2 -2
  96. package/dist/api/resources/values/client/requests/UpdateValuesRequest.d.ts +1 -1
  97. package/dist/api/types/CascadeContextRequest.d.ts +4 -0
  98. package/dist/api/types/CascadeContextRequest.js +3 -0
  99. package/dist/api/types/ContextInstancePendingEvaluation.d.ts +10 -2
  100. package/dist/api/types/ContextListItem.d.ts +24 -0
  101. package/dist/api/types/ContextListItem.js +3 -0
  102. package/dist/api/types/ContextListResponse.d.ts +1 -1
  103. package/dist/api/types/ContextRelationshipBase.d.ts +6 -4
  104. package/dist/api/types/ContextRelationshipBase.js +3 -3
  105. package/dist/api/types/ContextRelationshipIncoming.d.ts +1 -1
  106. package/dist/api/types/ContextRelationshipOutgoing.d.ts +1 -1
  107. package/dist/api/types/ContextRelationshipsResponse.d.ts +12 -0
  108. package/dist/api/types/ContextSchemaField.d.ts +4 -4
  109. package/dist/api/types/DecisionLog.d.ts +13 -4
  110. package/dist/api/types/DecisionLogResponse.d.ts +4 -4
  111. package/dist/api/types/DeleteRelationshipResponse.d.ts +2 -0
  112. package/dist/api/types/ExportManifestPreviewResponse.d.ts +53 -40
  113. package/dist/api/types/ExportManifestResponse.d.ts +28 -7
  114. package/dist/api/types/Folder.d.ts +4 -0
  115. package/dist/api/types/ImportManifestResponse.d.ts +52 -24
  116. package/dist/api/types/SchemaField.d.ts +2 -2
  117. package/dist/api/types/SolveContextFlowRequest.d.ts +4 -0
  118. package/dist/api/types/SolveContextFlowRequest.js +3 -0
  119. package/dist/api/types/SolveContextRuleRequest.d.ts +4 -0
  120. package/dist/api/types/SolveContextRuleRequest.js +3 -0
  121. package/dist/api/types/Test.d.ts +9 -9
  122. package/dist/api/types/UpdateContextResponse.d.ts +13 -2
  123. package/dist/api/types/UsageStatistics.d.ts +10 -4
  124. package/dist/api/types/UserGroup.d.ts +2 -0
  125. package/dist/api/types/index.d.ts +4 -0
  126. package/dist/api/types/index.js +4 -0
  127. package/package.json +1 -1
  128. package/api/resources/assets/types/ExportAssetsResponse.d.ts +0 -2
  129. package/dist/api/resources/assets/types/ExportAssetsResponse.d.ts +0 -2
  130. /package/api/resources/assets/types/{ExportAssetsResponse.js → ExportRbmAssetsResponse.js} +0 -0
  131. /package/api/resources/contexts/client/requests/{CascadeContextRequest.js → CascadeContextsRequest.js} +0 -0
  132. /package/api/resources/contexts/client/requests/{DeleteInstanceContextsRequest.js → DeleteContextsRequest.js} +0 -0
  133. /package/api/resources/contexts/client/requests/{GetInstanceContextsRequest.js → ExecuteContextsRequest.js} +0 -0
  134. /package/api/resources/contexts/client/requests/{SolveContextFlowRequest.js → GetContextsRequest.js} +0 -0
  135. /package/api/resources/contexts/client/requests/{SolveContextRuleRequest.js → SolveContextsRequest.js} +0 -0
  136. /package/api/resources/contexts/resources/{admin → objects}/client/index.d.ts +0 -0
  137. /package/api/resources/contexts/resources/{admin → objects}/client/index.js +0 -0
  138. /package/api/resources/contexts/resources/{admin → objects}/client/requests/CreateContextRequest.js +0 -0
  139. /package/api/resources/contexts/resources/{admin/client/requests/DeleteAdminRequest.js → objects/client/requests/DeleteObjectsRequest.js} +0 -0
  140. /package/api/resources/contexts/resources/{admin/client/requests/GetAdminRequest.js → objects/client/requests/GetObjectsRequest.js} +0 -0
  141. /package/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.js +0 -0
  142. /package/api/resources/contexts/resources/{admin → objects}/client/requests/index.js +0 -0
  143. /package/api/resources/contexts/resources/{admin → objects}/index.d.ts +0 -0
  144. /package/api/resources/contexts/resources/{admin → objects}/index.js +0 -0
  145. /package/{dist/api/resources/contexts/client/requests → api/types}/CascadeContextRequest.js +0 -0
  146. /package/{dist/api/resources/assets/types/ExportAssetsResponse.js → api/types/ContextListItem.js} +0 -0
  147. /package/{dist/api/resources/contexts/client/requests → api/types}/SolveContextFlowRequest.js +0 -0
  148. /package/{dist/api/resources/contexts/client/requests → api/types}/SolveContextRuleRequest.js +0 -0
  149. /package/dist/api/resources/{contexts/client/requests/DeleteInstanceContextsRequest.js → assets/types/ExportRbmAssetsResponse.js} +0 -0
  150. /package/dist/api/resources/contexts/client/requests/{GetInstanceContextsRequest.js → CascadeContextsRequest.js} +0 -0
  151. /package/dist/api/resources/contexts/{resources/admin/client/requests/DeleteAdminRequest.js → client/requests/DeleteContextsRequest.js} +0 -0
  152. /package/dist/api/resources/contexts/{resources/admin/client/requests/GetAdminRequest.js → client/requests/ExecuteContextsRequest.js} +0 -0
  153. /package/dist/api/resources/contexts/resources/{admin → objects}/client/index.d.ts +0 -0
  154. /package/dist/api/resources/contexts/resources/{admin → objects}/client/index.js +0 -0
  155. /package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/CreateContextRequest.js +0 -0
  156. /package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.js +0 -0
  157. /package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/index.js +0 -0
  158. /package/dist/api/resources/contexts/resources/{admin → objects}/index.d.ts +0 -0
  159. /package/dist/api/resources/contexts/resources/{admin → objects}/index.js +0 -0
@@ -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"));
@@ -2,37 +2,37 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../Ba
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
- export declare namespace AdminClient {
5
+ export declare namespace ObjectsClient {
6
6
  type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class AdminClient {
11
- protected readonly _options: NormalizedClientOptionsWithAuth<AdminClient.Options>;
12
- constructor(options: AdminClient.Options);
10
+ export declare class ObjectsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<ObjectsClient.Options>;
12
+ constructor(options: ObjectsClient.Options);
13
13
  /**
14
- * Retrieve all contexts (entities) for the authenticated user.
14
+ * Retrieve all contexts for the authenticated user.
15
15
  *
16
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
16
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
17
17
  *
18
18
  * @throws {@link Rulebricks.InternalServerError}
19
19
  *
20
20
  * @example
21
- * await client.contexts.admin.list()
21
+ * await client.contexts.objects.list()
22
22
  */
23
- list(requestOptions?: AdminClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ContextListResponse>;
23
+ list(requestOptions?: ObjectsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ContextListResponse>;
24
24
  private __list;
25
25
  /**
26
- * Create a new context (entity) for the authenticated user.
26
+ * Create a new context for the authenticated user.
27
27
  *
28
28
  * @param {Rulebricks.contexts.CreateContextRequest} request
29
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
29
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
30
30
  *
31
31
  * @throws {@link Rulebricks.BadRequestError}
32
32
  * @throws {@link Rulebricks.InternalServerError}
33
33
  *
34
34
  * @example
35
- * await client.contexts.admin.create({
35
+ * await client.contexts.objects.create({
36
36
  * name: "Customer",
37
37
  * description: "Represents a customer in the system",
38
38
  * schema: [{
@@ -43,60 +43,61 @@ export declare class AdminClient {
43
43
  * key: "age",
44
44
  * name: "Age",
45
45
  * type: "number"
46
- * }]
46
+ * }],
47
+ * identity_fact: "email"
47
48
  * })
48
49
  */
49
- create(request: Rulebricks.contexts.CreateContextRequest, requestOptions?: AdminClient.RequestOptions): core.HttpResponsePromise<Rulebricks.CreateContextResponse>;
50
+ create(request: Rulebricks.contexts.CreateContextRequest, requestOptions?: ObjectsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.CreateContextResponse>;
50
51
  private __create;
51
52
  /**
52
53
  * Retrieve a specific context by its ID.
53
54
  *
54
- * @param {Rulebricks.contexts.GetAdminRequest} request
55
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
55
+ * @param {Rulebricks.contexts.GetObjectsRequest} request
56
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
56
57
  *
57
58
  * @throws {@link Rulebricks.NotFoundError}
58
59
  * @throws {@link Rulebricks.InternalServerError}
59
60
  *
60
61
  * @example
61
- * await client.contexts.admin.get({
62
+ * await client.contexts.objects.get({
62
63
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
63
64
  * })
64
65
  */
65
- get(request: Rulebricks.contexts.GetAdminRequest, requestOptions?: AdminClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ContextDetail>;
66
+ get(request: Rulebricks.contexts.GetObjectsRequest, requestOptions?: ObjectsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ContextDetail>;
66
67
  private __get;
67
68
  /**
68
69
  * Update an existing context's properties and schema.
69
70
  *
70
71
  * @param {Rulebricks.contexts.UpdateContextRequest} request
71
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
72
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
72
73
  *
73
74
  * @throws {@link Rulebricks.BadRequestError}
74
75
  * @throws {@link Rulebricks.NotFoundError}
75
76
  * @throws {@link Rulebricks.InternalServerError}
76
77
  *
77
78
  * @example
78
- * await client.contexts.admin.update({
79
+ * await client.contexts.objects.update({
79
80
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
80
81
  * name: "Updated Customer",
81
82
  * description: "Updated description for premium customers"
82
83
  * })
83
84
  */
84
- update(request: Rulebricks.contexts.UpdateContextRequest, requestOptions?: AdminClient.RequestOptions): core.HttpResponsePromise<Rulebricks.UpdateContextResponse>;
85
+ update(request: Rulebricks.contexts.UpdateContextRequest, requestOptions?: ObjectsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.UpdateContextResponse>;
85
86
  private __update;
86
87
  /**
87
88
  * Delete a specific context and all its instances.
88
89
  *
89
- * @param {Rulebricks.contexts.DeleteAdminRequest} request
90
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
90
+ * @param {Rulebricks.contexts.DeleteObjectsRequest} request
91
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
91
92
  *
92
93
  * @throws {@link Rulebricks.NotFoundError}
93
94
  * @throws {@link Rulebricks.InternalServerError}
94
95
  *
95
96
  * @example
96
- * await client.contexts.admin.delete({
97
+ * await client.contexts.objects.delete({
97
98
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
98
99
  * })
99
100
  */
100
- delete(request: Rulebricks.contexts.DeleteAdminRequest, requestOptions?: AdminClient.RequestOptions): core.HttpResponsePromise<Rulebricks.DeleteContextResponse>;
101
+ delete(request: Rulebricks.contexts.DeleteObjectsRequest, requestOptions?: ObjectsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.DeleteContextResponse>;
101
102
  private __delete;
102
103
  }
@@ -54,7 +54,7 @@ var __rest = (this && this.__rest) || function (s, e) {
54
54
  return t;
55
55
  };
56
56
  Object.defineProperty(exports, "__esModule", { value: true });
57
- exports.AdminClient = void 0;
57
+ exports.ObjectsClient = void 0;
58
58
  const BaseClient_js_1 = require("../../../../../../BaseClient.js");
59
59
  const headers_js_1 = require("../../../../../../core/headers.js");
60
60
  const core = __importStar(require("../../../../../../core/index.js"));
@@ -62,19 +62,19 @@ const environments = __importStar(require("../../../../../../environments.js"));
62
62
  const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
63
63
  const errors = __importStar(require("../../../../../../errors/index.js"));
64
64
  const Rulebricks = __importStar(require("../../../../../index.js"));
65
- class AdminClient {
65
+ class ObjectsClient {
66
66
  constructor(options) {
67
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
68
  }
69
69
  /**
70
- * Retrieve all contexts (entities) for the authenticated user.
70
+ * Retrieve all contexts for the authenticated user.
71
71
  *
72
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
72
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
73
73
  *
74
74
  * @throws {@link Rulebricks.InternalServerError}
75
75
  *
76
76
  * @example
77
- * await client.contexts.admin.list()
77
+ * await client.contexts.objects.list()
78
78
  */
79
79
  list(requestOptions) {
80
80
  return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
@@ -114,16 +114,16 @@ class AdminClient {
114
114
  });
115
115
  }
116
116
  /**
117
- * Create a new context (entity) for the authenticated user.
117
+ * Create a new context for the authenticated user.
118
118
  *
119
119
  * @param {Rulebricks.contexts.CreateContextRequest} request
120
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
120
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
121
121
  *
122
122
  * @throws {@link Rulebricks.BadRequestError}
123
123
  * @throws {@link Rulebricks.InternalServerError}
124
124
  *
125
125
  * @example
126
- * await client.contexts.admin.create({
126
+ * await client.contexts.objects.create({
127
127
  * name: "Customer",
128
128
  * description: "Represents a customer in the system",
129
129
  * schema: [{
@@ -134,7 +134,8 @@ class AdminClient {
134
134
  * key: "age",
135
135
  * name: "Age",
136
136
  * type: "number"
137
- * }]
137
+ * }],
138
+ * identity_fact: "email"
138
139
  * })
139
140
  */
140
141
  create(request, requestOptions) {
@@ -182,14 +183,14 @@ class AdminClient {
182
183
  /**
183
184
  * Retrieve a specific context by its ID.
184
185
  *
185
- * @param {Rulebricks.contexts.GetAdminRequest} request
186
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
186
+ * @param {Rulebricks.contexts.GetObjectsRequest} request
187
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
187
188
  *
188
189
  * @throws {@link Rulebricks.NotFoundError}
189
190
  * @throws {@link Rulebricks.InternalServerError}
190
191
  *
191
192
  * @example
192
- * await client.contexts.admin.get({
193
+ * await client.contexts.objects.get({
193
194
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
194
195
  * })
195
196
  */
@@ -237,14 +238,14 @@ class AdminClient {
237
238
  * Update an existing context's properties and schema.
238
239
  *
239
240
  * @param {Rulebricks.contexts.UpdateContextRequest} request
240
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
241
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
241
242
  *
242
243
  * @throws {@link Rulebricks.BadRequestError}
243
244
  * @throws {@link Rulebricks.NotFoundError}
244
245
  * @throws {@link Rulebricks.InternalServerError}
245
246
  *
246
247
  * @example
247
- * await client.contexts.admin.update({
248
+ * await client.contexts.objects.update({
248
249
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
249
250
  * name: "Updated Customer",
250
251
  * description: "Updated description for premium customers"
@@ -298,14 +299,14 @@ class AdminClient {
298
299
  /**
299
300
  * Delete a specific context and all its instances.
300
301
  *
301
- * @param {Rulebricks.contexts.DeleteAdminRequest} request
302
- * @param {AdminClient.RequestOptions} requestOptions - Request-specific configuration.
302
+ * @param {Rulebricks.contexts.DeleteObjectsRequest} request
303
+ * @param {ObjectsClient.RequestOptions} requestOptions - Request-specific configuration.
303
304
  *
304
305
  * @throws {@link Rulebricks.NotFoundError}
305
306
  * @throws {@link Rulebricks.InternalServerError}
306
307
  *
307
308
  * @example
308
- * await client.contexts.admin.delete({
309
+ * await client.contexts.objects.delete({
309
310
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
310
311
  * })
311
312
  */
@@ -350,4 +351,4 @@ class AdminClient {
350
351
  });
351
352
  }
352
353
  }
353
- exports.AdminClient = AdminClient;
354
+ exports.ObjectsClient = ObjectsClient;
@@ -11,7 +11,8 @@
11
11
  * key: "age",
12
12
  * name: "Age",
13
13
  * type: "number"
14
- * }]
14
+ * }],
15
+ * identity_fact: "email"
15
16
  * }
16
17
  */
17
18
  export interface CreateContextRequest {
@@ -21,8 +22,10 @@ export interface CreateContextRequest {
21
22
  slug?: string;
22
23
  /** The description of the context. */
23
24
  description?: string;
24
- /** Initial schema fields for the context. */
25
- schema?: CreateContextRequest.Schema.Item[];
25
+ /** Initial schema fields for the context. At least one field must be defined. */
26
+ schema: CreateContextRequest.Schema.Item[];
27
+ /** The field key to use as the unique identifier for instances. Must be a key from the schema. */
28
+ identity_fact: string;
26
29
  /** When true (default), bound rules and flows automatically execute when their inputs are satisfied. */
27
30
  auto_execute_decisions?: boolean;
28
31
  /** Time-to-live in seconds for live context instances. Instances expire after this duration. */
@@ -43,7 +46,7 @@ export declare namespace CreateContextRequest {
43
46
  key?: string;
44
47
  name?: string;
45
48
  type?: string;
46
- defaultValue?: unknown;
49
+ default_value?: unknown;
47
50
  }
48
51
  }
49
52
  /** How to handle fields that don't match the schema. */
@@ -4,7 +4,7 @@
4
4
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
5
5
  * }
6
6
  */
7
- export interface DeleteAdminRequest {
7
+ export interface DeleteObjectsRequest {
8
8
  /** The unique identifier for the context. */
9
9
  id: string;
10
10
  }
@@ -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 });
@@ -4,7 +4,7 @@
4
4
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
5
5
  * }
6
6
  */
7
- export interface GetAdminRequest {
7
+ export interface GetObjectsRequest {
8
8
  /** The unique identifier for the context. */
9
9
  id: string;
10
10
  }
@@ -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 });
@@ -37,7 +37,7 @@ export declare namespace UpdateContextRequest {
37
37
  key?: string;
38
38
  name?: string;
39
39
  type?: string;
40
- defaultValue?: unknown;
40
+ default_value?: unknown;
41
41
  }
42
42
  }
43
43
  /** How to handle fields that don't match the schema. */
@@ -1,4 +1,4 @@
1
1
  export type { CreateContextRequest } from "./CreateContextRequest.js";
2
- export type { DeleteAdminRequest } from "./DeleteAdminRequest.js";
3
- export type { GetAdminRequest } from "./GetAdminRequest.js";
2
+ export type { DeleteObjectsRequest } from "./DeleteObjectsRequest.js";
3
+ export type { GetObjectsRequest } from "./GetObjectsRequest.js";
4
4
  export type { UpdateContextRequest } from "./UpdateContextRequest.js";
@@ -39,9 +39,9 @@ export declare class RelationshipsClient {
39
39
  * @example
40
40
  * await client.contexts.relationships.create({
41
41
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
42
- * targetContextId: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
43
- * type: "one-to-many",
44
- * foreignKey: "customer_id",
42
+ * to_context_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
43
+ * relation_type: "has_many",
44
+ * foreign_key_fact: "customer_id",
45
45
  * name: "Customer Orders"
46
46
  * })
47
47
  */
@@ -136,9 +136,9 @@ class RelationshipsClient {
136
136
  * @example
137
137
  * await client.contexts.relationships.create({
138
138
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
139
- * targetContextId: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
140
- * type: "one-to-many",
141
- * foreignKey: "customer_id",
139
+ * to_context_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
140
+ * relation_type: "has_many",
141
+ * foreign_key_fact: "customer_id",
142
142
  * name: "Customer Orders"
143
143
  * })
144
144
  */
@@ -2,9 +2,9 @@
2
2
  * @example
3
3
  * {
4
4
  * id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
5
- * targetContextId: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
6
- * type: "one-to-many",
7
- * foreignKey: "customer_id",
5
+ * to_context_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
6
+ * relation_type: "has_many",
7
+ * foreign_key_fact: "customer_id",
8
8
  * name: "Customer Orders"
9
9
  * }
10
10
  */
@@ -12,11 +12,11 @@ export interface CreateRelationshipRequest {
12
12
  /** The unique identifier for the context. */
13
13
  id: string;
14
14
  /** The ID of the target context. */
15
- targetContextId: string;
15
+ to_context_id: string;
16
16
  /** The type of relationship. */
17
- type: CreateRelationshipRequest.Type;
17
+ relation_type: CreateRelationshipRequest.RelationType;
18
18
  /** The field key to use as the foreign key. */
19
- foreignKey: string;
19
+ foreign_key_fact: string;
20
20
  /** Display name for the relationship. */
21
21
  name?: string;
22
22
  /** Description of the relationship. */
@@ -24,10 +24,10 @@ export interface CreateRelationshipRequest {
24
24
  }
25
25
  export declare namespace CreateRelationshipRequest {
26
26
  /** The type of relationship. */
27
- const Type: {
28
- readonly OneToOne: "one-to-one";
29
- readonly OneToMany: "one-to-many";
30
- readonly ManyToOne: "many-to-one";
27
+ const RelationType: {
28
+ readonly HasMany: "has_many";
29
+ readonly HasOne: "has_one";
30
+ readonly BelongsTo: "belongs_to";
31
31
  };
32
- type Type = (typeof Type)[keyof typeof Type];
32
+ type RelationType = (typeof RelationType)[keyof typeof RelationType];
33
33
  }
@@ -5,9 +5,9 @@ exports.CreateRelationshipRequest = void 0;
5
5
  var CreateRelationshipRequest;
6
6
  (function (CreateRelationshipRequest) {
7
7
  /** The type of relationship. */
8
- CreateRelationshipRequest.Type = {
9
- OneToOne: "one-to-one",
10
- OneToMany: "one-to-many",
11
- ManyToOne: "many-to-one",
8
+ CreateRelationshipRequest.RelationType = {
9
+ HasMany: "has_many",
10
+ HasOne: "has_one",
11
+ BelongsTo: "belongs_to",
12
12
  };
13
13
  })(CreateRelationshipRequest || (exports.CreateRelationshipRequest = CreateRelationshipRequest = {}));
@@ -17,7 +17,7 @@ export declare class UsersClient {
17
17
  constructor(options: UsersClient.Options);
18
18
  get groups(): GroupsClient;
19
19
  /**
20
- * Invite a new user to the organization or update role or access group data for an existing user.
20
+ * Invite a new user to the organization or update role or user group data for an existing user.
21
21
  *
22
22
  * @param {Rulebricks.UserInviteRequest} request
23
23
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -42,7 +42,7 @@ export declare class UsersClient {
42
42
  invite(request: Rulebricks.UserInviteRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Rulebricks.UserInviteResponse>;
43
43
  private __invite;
44
44
  /**
45
- * List all users (including the admin and all team members) in the organization with their details including email, name, API key, role, access groups, and join date.
45
+ * List all users (including the admin and all team members) in the organization with their details including email, name, API key, role, user groups, and join date.
46
46
  *
47
47
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
48
48
  *
@@ -64,7 +64,7 @@ class UsersClient {
64
64
  return ((_a = this._groups) !== null && _a !== void 0 ? _a : (this._groups = new Client_js_1.GroupsClient(this._options)));
65
65
  }
66
66
  /**
67
- * Invite a new user to the organization or update role or access group data for an existing user.
67
+ * Invite a new user to the organization or update role or user group data for an existing user.
68
68
  *
69
69
  * @param {Rulebricks.UserInviteRequest} request
70
70
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -129,7 +129,7 @@ class UsersClient {
129
129
  });
130
130
  }
131
131
  /**
132
- * List all users (including the admin and all team members) in the organization with their details including email, name, API key, role, access groups, and join date.
132
+ * List all users (including the admin and all team members) in the organization with their details including email, name, API key, role, user groups, and join date.
133
133
  *
134
134
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
135
135
  *
@@ -91,6 +91,6 @@
91
91
  export interface UpdateValuesRequest {
92
92
  /** A dictionary of keys and values to update or add. Supports both flat key-value pairs and nested objects. Nested objects will be automatically flattened using dot notation with readable key names (e.g., 'user.contact_info.email' becomes 'User.Contact Info.Email'). */
93
93
  values: Record<string, unknown>;
94
- /** Optional array of access group names or IDs. If omitted and user belongs to access groups, values will be assigned to all user's access groups. Required if values should be restricted to specific access groups. */
94
+ /** Optional array of user group names or IDs. If omitted and user belongs to user groups, values will be assigned to all user's user groups. Required if values should be restricted to specific user groups. */
95
95
  user_groups?: string[];
96
96
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Optional request body for triggering a cascade. Currently no properties are used.
3
+ */
4
+ export type CascadeContextRequest = 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 });
@@ -12,8 +12,8 @@ export interface ContextInstancePendingEvaluation {
12
12
  flow?: string | null;
13
13
  /** The flow ID (if type is 'flow'). */
14
14
  flow_id?: string | null;
15
- /** List of field keys this evaluation is waiting for. */
16
- waiting_on?: string[];
15
+ /** List of field keys or dependency objects this evaluation is waiting for. Can contain simple strings for direct fields or objects for relationship dependencies. */
16
+ waiting_on?: ContextInstancePendingEvaluation.WaitingOn.Item[];
17
17
  /** When this pending evaluation was registered. */
18
18
  created_at?: string;
19
19
  /** When this pending evaluation will expire. */
@@ -26,4 +26,12 @@ export declare namespace ContextInstancePendingEvaluation {
26
26
  readonly Flow: "flow";
27
27
  };
28
28
  type Type = (typeof Type)[keyof typeof Type];
29
+ type WaitingOn = WaitingOn.Item[];
30
+ namespace WaitingOn {
31
+ type Item = string | {
32
+ field?: string | undefined;
33
+ relation?: string | undefined;
34
+ instance?: string | undefined;
35
+ };
36
+ }
29
37
  }
@@ -0,0 +1,24 @@
1
+ import type * as Rulebricks from "../index.js";
2
+ /**
3
+ * Summary of a context for listing. Uses counts instead of full arrays.
4
+ */
5
+ export interface ContextListItem extends Rulebricks.ContextBase {
6
+ /** The field key used as the unique identifier for instances. */
7
+ identity_fact?: string | null;
8
+ schema?: Rulebricks.ContextSchema;
9
+ folder?: ContextListItem.Folder | null;
10
+ /** Number of rules bound to this context. */
11
+ bound_rules_count?: number;
12
+ /** Number of flows bound to this context. */
13
+ bound_flows_count?: number;
14
+ /** Total number of relationships for this context. */
15
+ relationships_count?: number;
16
+ created_at?: string;
17
+ updated_at?: string;
18
+ }
19
+ export declare namespace ContextListItem {
20
+ interface Folder {
21
+ id?: string;
22
+ name?: string;
23
+ }
24
+ }
@@ -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,2 +1,2 @@
1
1
  import type * as Rulebricks from "../index.js";
2
- export type ContextListResponse = Rulebricks.ContextDetail[];
2
+ export type ContextListResponse = Rulebricks.ContextListItem[];
@@ -4,18 +4,20 @@ export interface ContextRelationshipBase {
4
4
  /** The type of relationship. */
5
5
  type?: ContextRelationshipBase.Type;
6
6
  /** The field key used as the foreign key. */
7
- foreignKey?: string;
7
+ foreign_key?: string;
8
8
  /** Display name for the relationship. */
9
9
  name?: string;
10
10
  /** Description of the relationship. */
11
11
  description?: string;
12
+ /** When the relationship was created. */
13
+ created_at?: string;
12
14
  }
13
15
  export declare namespace ContextRelationshipBase {
14
16
  /** The type of relationship. */
15
17
  const Type: {
16
- readonly OneToOne: "one-to-one";
17
- readonly OneToMany: "one-to-many";
18
- readonly ManyToOne: "many-to-one";
18
+ readonly HasMany: "has_many";
19
+ readonly HasOne: "has_one";
20
+ readonly BelongsTo: "belongs_to";
19
21
  };
20
22
  type Type = (typeof Type)[keyof typeof Type];
21
23
  }
@@ -6,8 +6,8 @@ var ContextRelationshipBase;
6
6
  (function (ContextRelationshipBase) {
7
7
  /** The type of relationship. */
8
8
  ContextRelationshipBase.Type = {
9
- OneToOne: "one-to-one",
10
- OneToMany: "one-to-many",
11
- ManyToOne: "many-to-one",
9
+ HasMany: "has_many",
10
+ HasOne: "has_one",
11
+ BelongsTo: "belongs_to",
12
12
  };
13
13
  })(ContextRelationshipBase || (exports.ContextRelationshipBase = ContextRelationshipBase = {}));