@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.
- package/api/resources/assets/client/Client.d.ts +14 -15
- package/api/resources/assets/client/Client.js +17 -18
- package/api/resources/assets/client/requests/ExportManifestRequest.d.ts +25 -16
- package/api/resources/assets/client/requests/ExportManifestRequest.js +11 -0
- package/api/resources/assets/client/requests/ImportManifestRequest.d.ts +31 -7
- package/api/resources/assets/client/requests/ImportManifestRequest.js +20 -0
- package/api/resources/assets/types/ExportRbmAssetsResponse.d.ts +2 -0
- package/api/resources/assets/types/index.d.ts +1 -1
- package/api/resources/assets/types/index.js +1 -1
- package/api/resources/contexts/client/Client.d.ts +24 -21
- package/api/resources/contexts/client/Client.js +26 -34
- package/api/resources/contexts/client/requests/{CascadeContextRequest.d.ts → CascadeContextsRequest.d.ts} +5 -4
- package/api/resources/contexts/client/requests/{GetInstanceContextsRequest.d.ts → DeleteContextsRequest.d.ts} +1 -1
- package/{dist/api/resources/contexts/client/requests/SolveContextFlowRequest.d.ts → api/resources/contexts/client/requests/ExecuteContextsRequest.d.ts} +5 -6
- package/{dist/api/resources/contexts/client/requests/GetInstanceContextsRequest.d.ts → api/resources/contexts/client/requests/GetContextsRequest.d.ts} +1 -1
- package/api/resources/contexts/client/requests/{SolveContextRuleRequest.d.ts → SolveContextsRequest.d.ts} +5 -6
- package/api/resources/contexts/client/requests/index.d.ts +5 -5
- package/api/resources/contexts/resources/index.d.ts +2 -2
- package/api/resources/contexts/resources/index.js +3 -3
- package/api/resources/contexts/resources/{admin → objects}/client/Client.d.ts +25 -24
- package/api/resources/contexts/resources/{admin → objects}/client/Client.js +19 -18
- package/{dist/api/resources/contexts/resources/admin → api/resources/contexts/resources/objects}/client/requests/CreateContextRequest.d.ts +7 -4
- package/{dist/api/resources/contexts/resources/admin/client/requests/DeleteAdminRequest.d.ts → api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.d.ts} +1 -1
- package/{dist/api/resources/contexts/resources/admin/client/requests/GetAdminRequest.d.ts → api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.d.ts} +1 -1
- package/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.d.ts +1 -1
- package/api/resources/contexts/resources/{admin → objects}/client/requests/index.d.ts +2 -2
- package/api/resources/contexts/resources/relationships/client/Client.d.ts +3 -3
- package/api/resources/contexts/resources/relationships/client/Client.js +3 -3
- package/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.d.ts +11 -11
- package/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.js +4 -4
- package/api/resources/users/client/Client.d.ts +2 -2
- package/api/resources/users/client/Client.js +2 -2
- package/api/resources/values/client/requests/UpdateValuesRequest.d.ts +1 -1
- package/api/types/CascadeContextRequest.d.ts +4 -0
- package/api/types/ContextInstancePendingEvaluation.d.ts +10 -2
- package/api/types/ContextListItem.d.ts +24 -0
- package/api/types/ContextListResponse.d.ts +1 -1
- package/api/types/ContextRelationshipBase.d.ts +6 -4
- package/api/types/ContextRelationshipBase.js +3 -3
- package/api/types/ContextRelationshipIncoming.d.ts +1 -1
- package/api/types/ContextRelationshipOutgoing.d.ts +1 -1
- package/api/types/ContextRelationshipsResponse.d.ts +12 -0
- package/api/types/ContextSchemaField.d.ts +4 -4
- package/api/types/DecisionLog.d.ts +13 -4
- package/api/types/DecisionLogResponse.d.ts +4 -4
- package/api/types/DeleteRelationshipResponse.d.ts +2 -0
- package/api/types/ExportManifestPreviewResponse.d.ts +53 -40
- package/api/types/ExportManifestResponse.d.ts +28 -7
- package/api/types/Folder.d.ts +4 -0
- package/api/types/ImportManifestResponse.d.ts +52 -24
- package/api/types/SchemaField.d.ts +2 -2
- package/api/types/SolveContextFlowRequest.d.ts +4 -0
- package/api/types/SolveContextRuleRequest.d.ts +4 -0
- package/api/types/Test.d.ts +9 -9
- package/api/types/UpdateContextResponse.d.ts +13 -2
- package/api/types/UsageStatistics.d.ts +10 -4
- package/api/types/UserGroup.d.ts +2 -0
- package/api/types/index.d.ts +4 -0
- package/api/types/index.js +4 -0
- package/dist/api/resources/assets/client/Client.d.ts +14 -15
- package/dist/api/resources/assets/client/Client.js +17 -18
- package/dist/api/resources/assets/client/requests/ExportManifestRequest.d.ts +25 -16
- package/dist/api/resources/assets/client/requests/ExportManifestRequest.js +11 -0
- package/dist/api/resources/assets/client/requests/ImportManifestRequest.d.ts +31 -7
- package/dist/api/resources/assets/client/requests/ImportManifestRequest.js +20 -0
- package/dist/api/resources/assets/types/ExportRbmAssetsResponse.d.ts +2 -0
- package/dist/api/resources/assets/types/index.d.ts +1 -1
- package/dist/api/resources/assets/types/index.js +1 -1
- package/dist/api/resources/contexts/client/Client.d.ts +24 -21
- package/dist/api/resources/contexts/client/Client.js +26 -34
- package/dist/api/resources/contexts/client/requests/{CascadeContextRequest.d.ts → CascadeContextsRequest.d.ts} +5 -4
- package/{api/resources/contexts/client/requests/DeleteInstanceContextsRequest.d.ts → dist/api/resources/contexts/client/requests/DeleteContextsRequest.d.ts} +1 -1
- package/{api/resources/contexts/client/requests/SolveContextFlowRequest.d.ts → dist/api/resources/contexts/client/requests/ExecuteContextsRequest.d.ts} +5 -6
- package/dist/api/resources/contexts/client/requests/{DeleteInstanceContextsRequest.d.ts → GetContextsRequest.d.ts} +1 -1
- package/dist/api/resources/contexts/client/requests/GetContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/{SolveContextRuleRequest.d.ts → SolveContextsRequest.d.ts} +5 -6
- package/dist/api/resources/contexts/client/requests/SolveContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/index.d.ts +5 -5
- package/dist/api/resources/contexts/resources/index.d.ts +2 -2
- package/dist/api/resources/contexts/resources/index.js +3 -3
- package/dist/api/resources/contexts/resources/{admin → objects}/client/Client.d.ts +25 -24
- package/dist/api/resources/contexts/resources/{admin → objects}/client/Client.js +19 -18
- package/{api/resources/contexts/resources/admin → dist/api/resources/contexts/resources/objects}/client/requests/CreateContextRequest.d.ts +7 -4
- package/{api/resources/contexts/resources/admin/client/requests/DeleteAdminRequest.d.ts → dist/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.d.ts} +1 -1
- package/dist/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.js +3 -0
- package/{api/resources/contexts/resources/admin/client/requests/GetAdminRequest.d.ts → dist/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.d.ts} +1 -1
- package/dist/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.js +3 -0
- package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.d.ts +1 -1
- package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/index.d.ts +2 -2
- package/dist/api/resources/contexts/resources/relationships/client/Client.d.ts +3 -3
- package/dist/api/resources/contexts/resources/relationships/client/Client.js +3 -3
- package/dist/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.d.ts +11 -11
- package/dist/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.js +4 -4
- package/dist/api/resources/users/client/Client.d.ts +2 -2
- package/dist/api/resources/users/client/Client.js +2 -2
- package/dist/api/resources/values/client/requests/UpdateValuesRequest.d.ts +1 -1
- package/dist/api/types/CascadeContextRequest.d.ts +4 -0
- package/dist/api/types/CascadeContextRequest.js +3 -0
- package/dist/api/types/ContextInstancePendingEvaluation.d.ts +10 -2
- package/dist/api/types/ContextListItem.d.ts +24 -0
- package/dist/api/types/ContextListItem.js +3 -0
- package/dist/api/types/ContextListResponse.d.ts +1 -1
- package/dist/api/types/ContextRelationshipBase.d.ts +6 -4
- package/dist/api/types/ContextRelationshipBase.js +3 -3
- package/dist/api/types/ContextRelationshipIncoming.d.ts +1 -1
- package/dist/api/types/ContextRelationshipOutgoing.d.ts +1 -1
- package/dist/api/types/ContextRelationshipsResponse.d.ts +12 -0
- package/dist/api/types/ContextSchemaField.d.ts +4 -4
- package/dist/api/types/DecisionLog.d.ts +13 -4
- package/dist/api/types/DecisionLogResponse.d.ts +4 -4
- package/dist/api/types/DeleteRelationshipResponse.d.ts +2 -0
- package/dist/api/types/ExportManifestPreviewResponse.d.ts +53 -40
- package/dist/api/types/ExportManifestResponse.d.ts +28 -7
- package/dist/api/types/Folder.d.ts +4 -0
- package/dist/api/types/ImportManifestResponse.d.ts +52 -24
- package/dist/api/types/SchemaField.d.ts +2 -2
- package/dist/api/types/SolveContextFlowRequest.d.ts +4 -0
- package/dist/api/types/SolveContextFlowRequest.js +3 -0
- package/dist/api/types/SolveContextRuleRequest.d.ts +4 -0
- package/dist/api/types/SolveContextRuleRequest.js +3 -0
- package/dist/api/types/Test.d.ts +9 -9
- package/dist/api/types/UpdateContextResponse.d.ts +13 -2
- package/dist/api/types/UsageStatistics.d.ts +10 -4
- package/dist/api/types/UserGroup.d.ts +2 -0
- package/dist/api/types/index.d.ts +4 -0
- package/dist/api/types/index.js +4 -0
- package/package.json +1 -1
- package/api/resources/assets/types/ExportAssetsResponse.d.ts +0 -2
- package/dist/api/resources/assets/types/ExportAssetsResponse.d.ts +0 -2
- /package/api/resources/assets/types/{ExportAssetsResponse.js → ExportRbmAssetsResponse.js} +0 -0
- /package/api/resources/contexts/client/requests/{CascadeContextRequest.js → CascadeContextsRequest.js} +0 -0
- /package/api/resources/contexts/client/requests/{DeleteInstanceContextsRequest.js → DeleteContextsRequest.js} +0 -0
- /package/api/resources/contexts/client/requests/{GetInstanceContextsRequest.js → ExecuteContextsRequest.js} +0 -0
- /package/api/resources/contexts/client/requests/{SolveContextFlowRequest.js → GetContextsRequest.js} +0 -0
- /package/api/resources/contexts/client/requests/{SolveContextRuleRequest.js → SolveContextsRequest.js} +0 -0
- /package/api/resources/contexts/resources/{admin → objects}/client/index.d.ts +0 -0
- /package/api/resources/contexts/resources/{admin → objects}/client/index.js +0 -0
- /package/api/resources/contexts/resources/{admin → objects}/client/requests/CreateContextRequest.js +0 -0
- /package/api/resources/contexts/resources/{admin/client/requests/DeleteAdminRequest.js → objects/client/requests/DeleteObjectsRequest.js} +0 -0
- /package/api/resources/contexts/resources/{admin/client/requests/GetAdminRequest.js → objects/client/requests/GetObjectsRequest.js} +0 -0
- /package/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.js +0 -0
- /package/api/resources/contexts/resources/{admin → objects}/client/requests/index.js +0 -0
- /package/api/resources/contexts/resources/{admin → objects}/index.d.ts +0 -0
- /package/api/resources/contexts/resources/{admin → objects}/index.js +0 -0
- /package/{dist/api/resources/contexts/client/requests → api/types}/CascadeContextRequest.js +0 -0
- /package/{dist/api/resources/assets/types/ExportAssetsResponse.js → api/types/ContextListItem.js} +0 -0
- /package/{dist/api/resources/contexts/client/requests → api/types}/SolveContextFlowRequest.js +0 -0
- /package/{dist/api/resources/contexts/client/requests → api/types}/SolveContextRuleRequest.js +0 -0
- /package/dist/api/resources/{contexts/client/requests/DeleteInstanceContextsRequest.js → assets/types/ExportRbmAssetsResponse.js} +0 -0
- /package/dist/api/resources/contexts/client/requests/{GetInstanceContextsRequest.js → CascadeContextsRequest.js} +0 -0
- /package/dist/api/resources/contexts/{resources/admin/client/requests/DeleteAdminRequest.js → client/requests/DeleteContextsRequest.js} +0 -0
- /package/dist/api/resources/contexts/{resources/admin/client/requests/GetAdminRequest.js → client/requests/ExecuteContextsRequest.js} +0 -0
- /package/dist/api/resources/contexts/resources/{admin → objects}/client/index.d.ts +0 -0
- /package/dist/api/resources/contexts/resources/{admin → objects}/client/index.js +0 -0
- /package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/CreateContextRequest.js +0 -0
- /package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/UpdateContextRequest.js +0 -0
- /package/dist/api/resources/contexts/resources/{admin → objects}/client/requests/index.js +0 -0
- /package/dist/api/resources/contexts/resources/{admin → objects}/index.d.ts +0 -0
- /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
|
|
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
|
-
|
|
17
|
-
additionalData?: Record<string, unknown>;
|
|
18
|
-
/** Whether to persist derived outputs to the instance. */
|
|
19
|
-
persist?: boolean;
|
|
18
|
+
body: Rulebricks.SolveContextRuleRequest;
|
|
20
19
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type {
|
|
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 {
|
|
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 "./
|
|
2
|
-
export * as
|
|
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.
|
|
40
|
-
__exportStar(require("./
|
|
41
|
-
exports.
|
|
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
|
|
5
|
+
export declare namespace ObjectsClient {
|
|
6
6
|
type Options = BaseClientOptions;
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options: NormalizedClientOptionsWithAuth<
|
|
12
|
-
constructor(options:
|
|
10
|
+
export declare class ObjectsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ObjectsClient.Options>;
|
|
12
|
+
constructor(options: ObjectsClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Retrieve all contexts
|
|
14
|
+
* Retrieve all contexts for the authenticated user.
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
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.
|
|
21
|
+
* await client.contexts.objects.list()
|
|
22
22
|
*/
|
|
23
|
-
list(requestOptions?:
|
|
23
|
+
list(requestOptions?: ObjectsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ContextListResponse>;
|
|
24
24
|
private __list;
|
|
25
25
|
/**
|
|
26
|
-
* Create a new context
|
|
26
|
+
* Create a new context for the authenticated user.
|
|
27
27
|
*
|
|
28
28
|
* @param {Rulebricks.contexts.CreateContextRequest} request
|
|
29
|
-
* @param {
|
|
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.
|
|
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?:
|
|
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.
|
|
55
|
-
* @param {
|
|
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.
|
|
62
|
+
* await client.contexts.objects.get({
|
|
62
63
|
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
|
|
63
64
|
* })
|
|
64
65
|
*/
|
|
65
|
-
get(request: Rulebricks.contexts.
|
|
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 {
|
|
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.
|
|
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?:
|
|
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.
|
|
90
|
-
* @param {
|
|
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.
|
|
97
|
+
* await client.contexts.objects.delete({
|
|
97
98
|
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
|
|
98
99
|
* })
|
|
99
100
|
*/
|
|
100
|
-
delete(request: Rulebricks.contexts.
|
|
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.
|
|
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
|
|
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
|
|
70
|
+
* Retrieve all contexts for the authenticated user.
|
|
71
71
|
*
|
|
72
|
-
* @param {
|
|
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.
|
|
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
|
|
117
|
+
* Create a new context for the authenticated user.
|
|
118
118
|
*
|
|
119
119
|
* @param {Rulebricks.contexts.CreateContextRequest} request
|
|
120
|
-
* @param {
|
|
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.
|
|
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.
|
|
186
|
-
* @param {
|
|
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.
|
|
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 {
|
|
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.
|
|
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.
|
|
302
|
-
* @param {
|
|
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.
|
|
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.
|
|
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
|
|
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
|
-
|
|
49
|
+
default_value?: unknown;
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
/** 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 {
|
|
3
|
-
export type {
|
|
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
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
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
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
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
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
-
|
|
15
|
+
to_context_id: string;
|
|
16
16
|
/** The type of relationship. */
|
|
17
|
-
|
|
17
|
+
relation_type: CreateRelationshipRequest.RelationType;
|
|
18
18
|
/** The field key to use as the foreign key. */
|
|
19
|
-
|
|
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
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
27
|
+
const RelationType: {
|
|
28
|
+
readonly HasMany: "has_many";
|
|
29
|
+
readonly HasOne: "has_one";
|
|
30
|
+
readonly BelongsTo: "belongs_to";
|
|
31
31
|
};
|
|
32
|
-
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.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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,
|
|
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
|
|
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,
|
|
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
|
|
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
|
}
|
|
@@ -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?:
|
|
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
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type * as Rulebricks from "../index.js";
|
|
2
|
-
export type ContextListResponse = Rulebricks.
|
|
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
|
-
|
|
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
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
HasMany: "has_many",
|
|
10
|
+
HasOne: "has_one",
|
|
11
|
+
BelongsTo: "belongs_to",
|
|
12
12
|
};
|
|
13
13
|
})(ContextRelationshipBase || (exports.ContextRelationshipBase = ContextRelationshipBase = {}));
|