@rulebricks/sdk 1.3.0 → 1.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/README.md +3 -3
- package/api/errors/ForbiddenError.d.ts +1 -2
- package/api/resources/assets/resources/rules/client/Client.js +1 -6
- package/api/resources/index.d.ts +1 -2
- package/api/resources/index.js +2 -3
- package/api/resources/values/client/Client.d.ts +58 -4
- package/api/resources/values/client/Client.js +66 -5
- package/api/resources/values/client/requests/UpdateValuesRequest.d.ts +81 -4
- package/api/resources/values/client/requests/ValuesListRequest.d.ts +12 -1
- package/api/resources/values/index.d.ts +0 -1
- package/api/resources/values/index.js +0 -1
- package/api/types/DecisionLog.d.ts +4 -6
- package/api/types/DynamicValue.d.ts +12 -14
- package/api/types/index.d.ts +1 -10
- package/api/types/index.js +1 -10
- package/dist/api/errors/ForbiddenError.d.ts +1 -2
- package/dist/api/resources/assets/resources/rules/client/Client.js +1 -6
- package/dist/api/resources/index.d.ts +1 -2
- package/dist/api/resources/index.js +2 -3
- package/dist/api/resources/values/client/Client.d.ts +58 -4
- package/dist/api/resources/values/client/Client.js +66 -5
- package/dist/api/resources/values/client/requests/UpdateValuesRequest.d.ts +81 -4
- package/dist/api/resources/values/client/requests/ValuesListRequest.d.ts +12 -1
- package/dist/api/resources/values/index.d.ts +0 -1
- package/dist/api/resources/values/index.js +0 -1
- package/dist/api/types/DecisionLog.d.ts +4 -6
- package/dist/api/types/DynamicValue.d.ts +12 -14
- package/dist/api/types/index.d.ts +1 -10
- package/dist/api/types/index.js +1 -10
- package/dist/forge/types.d.ts +3 -1
- package/dist/forge/types.js +2 -0
- package/dist/forge/values.js +1 -0
- package/dist/serialization/resources/index.d.ts +1 -2
- package/dist/serialization/resources/index.js +2 -3
- package/dist/serialization/resources/values/client/requests/UpdateValuesRequest.d.ts +1 -2
- package/dist/serialization/resources/values/client/requests/UpdateValuesRequest.js +1 -2
- package/dist/serialization/resources/values/index.d.ts +0 -1
- package/dist/serialization/resources/values/index.js +0 -1
- package/dist/serialization/types/DecisionLog.d.ts +2 -8
- package/dist/serialization/types/DecisionLog.js +1 -8
- package/dist/serialization/types/DecisionLogResponse.d.ts +2 -1
- package/dist/serialization/types/DecisionLogResponse.js +2 -2
- package/dist/serialization/types/DynamicValue.d.ts +9 -17
- package/dist/serialization/types/DynamicValue.js +8 -14
- package/dist/serialization/types/index.d.ts +1 -10
- package/dist/serialization/types/index.js +1 -10
- package/forge/types.d.ts +3 -1
- package/forge/types.js +2 -0
- package/forge/values.js +1 -0
- package/package.json +39 -44
- package/serialization/resources/index.d.ts +1 -2
- package/serialization/resources/index.js +2 -3
- package/serialization/resources/values/client/requests/UpdateValuesRequest.d.ts +1 -2
- package/serialization/resources/values/client/requests/UpdateValuesRequest.js +1 -2
- package/serialization/resources/values/index.d.ts +0 -1
- package/serialization/resources/values/index.js +0 -1
- package/serialization/types/DecisionLog.d.ts +2 -8
- package/serialization/types/DecisionLog.js +1 -8
- package/serialization/types/DecisionLogResponse.d.ts +2 -1
- package/serialization/types/DecisionLogResponse.js +2 -2
- package/serialization/types/DynamicValue.d.ts +9 -17
- package/serialization/types/DynamicValue.js +8 -14
- package/serialization/types/index.d.ts +1 -10
- package/serialization/types/index.js +1 -10
- package/api/resources/values/types/UpdateValuesRequestValuesValue.d.ts +0 -4
- package/api/resources/values/types/UpdateValuesRequestValuesValue.js +0 -5
- package/api/resources/values/types/index.d.ts +0 -1
- package/api/resources/values/types/index.js +0 -17
- package/api/types/BooleanValue.d.ts +0 -8
- package/api/types/BooleanValue.js +0 -5
- package/api/types/DecisionLogDecision.d.ts +0 -8
- package/api/types/DecisionLogDecision.js +0 -5
- package/api/types/DecisionLogDecisionConditionsItemValue.d.ts +0 -7
- package/api/types/DecisionLogDecisionConditionsItemValue.js +0 -5
- package/api/types/DecisionLogRequest.d.ts +0 -15
- package/api/types/DecisionLogRequest.js +0 -5
- package/api/types/DynamicValueBase.d.ts +0 -14
- package/api/types/DynamicValueBase.js +0 -5
- package/api/types/ListValue.d.ts +0 -8
- package/api/types/ListValue.js +0 -5
- package/api/types/ListValueValueItem.d.ts +0 -4
- package/api/types/ListValueValueItem.js +0 -5
- package/api/types/NumberValue.d.ts +0 -8
- package/api/types/NumberValue.js +0 -5
- package/api/types/StringValue.d.ts +0 -8
- package/api/types/StringValue.js +0 -5
- package/dist/api/resources/values/types/UpdateValuesRequestValuesValue.d.ts +0 -4
- package/dist/api/resources/values/types/UpdateValuesRequestValuesValue.js +0 -5
- package/dist/api/resources/values/types/index.d.ts +0 -1
- package/dist/api/resources/values/types/index.js +0 -17
- package/dist/api/types/BooleanValue.d.ts +0 -8
- package/dist/api/types/BooleanValue.js +0 -5
- package/dist/api/types/DecisionLogDecision.d.ts +0 -8
- package/dist/api/types/DecisionLogDecision.js +0 -5
- package/dist/api/types/DecisionLogDecisionConditionsItemValue.d.ts +0 -7
- package/dist/api/types/DecisionLogDecisionConditionsItemValue.js +0 -5
- package/dist/api/types/DecisionLogRequest.d.ts +0 -15
- package/dist/api/types/DecisionLogRequest.js +0 -5
- package/dist/api/types/DynamicValueBase.d.ts +0 -14
- package/dist/api/types/DynamicValueBase.js +0 -5
- package/dist/api/types/ListValue.d.ts +0 -8
- package/dist/api/types/ListValue.js +0 -5
- package/dist/api/types/ListValueValueItem.d.ts +0 -4
- package/dist/api/types/ListValueValueItem.js +0 -5
- package/dist/api/types/NumberValue.d.ts +0 -8
- package/dist/api/types/NumberValue.js +0 -5
- package/dist/api/types/StringValue.d.ts +0 -8
- package/dist/api/types/StringValue.js +0 -5
- package/dist/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +0 -10
- package/dist/serialization/resources/values/types/UpdateValuesRequestValuesValue.js +0 -36
- package/dist/serialization/resources/values/types/index.d.ts +0 -1
- package/dist/serialization/resources/values/types/index.js +0 -17
- package/dist/serialization/types/BooleanValue.d.ts +0 -13
- package/dist/serialization/types/BooleanValue.js +0 -36
- package/dist/serialization/types/DecisionLogDecision.d.ts +0 -14
- package/dist/serialization/types/DecisionLogDecision.js +0 -37
- package/dist/serialization/types/DecisionLogDecisionConditionsItemValue.d.ts +0 -13
- package/dist/serialization/types/DecisionLogDecisionConditionsItemValue.js +0 -34
- package/dist/serialization/types/DecisionLogRequest.d.ts +0 -17
- package/dist/serialization/types/DecisionLogRequest.js +0 -40
- package/dist/serialization/types/DynamicValueBase.d.ts +0 -16
- package/dist/serialization/types/DynamicValueBase.js +0 -37
- package/dist/serialization/types/ListValue.d.ts +0 -14
- package/dist/serialization/types/ListValue.js +0 -37
- package/dist/serialization/types/ListValueValueItem.d.ts +0 -10
- package/dist/serialization/types/ListValueValueItem.js +0 -37
- package/dist/serialization/types/NumberValue.d.ts +0 -13
- package/dist/serialization/types/NumberValue.js +0 -36
- package/dist/serialization/types/StringValue.d.ts +0 -13
- package/dist/serialization/types/StringValue.js +0 -36
- package/serialization/resources/values/types/UpdateValuesRequestValuesValue.d.ts +0 -10
- package/serialization/resources/values/types/UpdateValuesRequestValuesValue.js +0 -36
- package/serialization/resources/values/types/index.d.ts +0 -1
- package/serialization/resources/values/types/index.js +0 -17
- package/serialization/types/BooleanValue.d.ts +0 -13
- package/serialization/types/BooleanValue.js +0 -36
- package/serialization/types/DecisionLogDecision.d.ts +0 -14
- package/serialization/types/DecisionLogDecision.js +0 -37
- package/serialization/types/DecisionLogDecisionConditionsItemValue.d.ts +0 -13
- package/serialization/types/DecisionLogDecisionConditionsItemValue.js +0 -34
- package/serialization/types/DecisionLogRequest.d.ts +0 -17
- package/serialization/types/DecisionLogRequest.js +0 -40
- package/serialization/types/DynamicValueBase.d.ts +0 -16
- package/serialization/types/DynamicValueBase.js +0 -37
- package/serialization/types/ListValue.d.ts +0 -14
- package/serialization/types/ListValue.js +0 -37
- package/serialization/types/ListValueValueItem.d.ts +0 -10
- package/serialization/types/ListValueValueItem.js +0 -37
- package/serialization/types/NumberValue.d.ts +0 -13
- package/serialization/types/NumberValue.js +0 -36
- package/serialization/types/StringValue.d.ts +0 -13
- package/serialization/types/StringValue.js +0 -36
package/README.md
CHANGED
|
@@ -23,12 +23,12 @@ yarn add @rulebricks/sdk
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
```typescript
|
|
26
|
-
import {
|
|
26
|
+
import { RulebricksClient } from "@rulebricks/sdk";
|
|
27
27
|
import "dotenv/config";
|
|
28
28
|
|
|
29
29
|
// Initialize the Rulebricks client
|
|
30
|
-
const rb = new
|
|
31
|
-
environment: process.env.RULEBRICKS_ENVIRONMENT || "https://rulebricks.com",
|
|
30
|
+
const rb = new RulebricksClient({
|
|
31
|
+
environment: process.env.RULEBRICKS_ENVIRONMENT || "https://rulebricks.com/api/v1",
|
|
32
32
|
apiKey:
|
|
33
33
|
process.env.RULEBRICKS_API_KEY || "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
|
|
34
34
|
});
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../errors/index";
|
|
5
|
-
import * as Rulebricks from "../index";
|
|
6
5
|
export declare class ForbiddenError extends errors.RulebricksError {
|
|
7
|
-
constructor(body
|
|
6
|
+
constructor(body?: unknown);
|
|
8
7
|
}
|
|
@@ -230,12 +230,7 @@ class Rules {
|
|
|
230
230
|
case 400:
|
|
231
231
|
throw new Rulebricks.BadRequestError(_response.error.body);
|
|
232
232
|
case 403:
|
|
233
|
-
throw new Rulebricks.ForbiddenError(
|
|
234
|
-
unrecognizedObjectKeys: "passthrough",
|
|
235
|
-
allowUnrecognizedUnionMembers: true,
|
|
236
|
-
allowUnrecognizedEnumValues: true,
|
|
237
|
-
breadcrumbsPrefix: ["response"],
|
|
238
|
-
}));
|
|
233
|
+
throw new Rulebricks.ForbiddenError(_response.error.body);
|
|
239
234
|
case 500:
|
|
240
235
|
throw new Rulebricks.InternalServerError(_response.error.body);
|
|
241
236
|
default:
|
package/api/resources/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export * as users from "./users";
|
|
2
2
|
export * from "./users/types";
|
|
3
|
-
export * as values from "./values";
|
|
4
|
-
export * from "./values/types";
|
|
5
3
|
export * as rules from "./rules";
|
|
6
4
|
export * as flows from "./flows";
|
|
7
5
|
export * as decisions from "./decisions";
|
|
8
6
|
export * as assets from "./assets";
|
|
7
|
+
export * as values from "./values";
|
|
9
8
|
export * as tests from "./tests";
|
|
10
9
|
export * from "./decisions/client/requests";
|
|
11
10
|
export * from "./users/client/requests";
|
package/api/resources/index.js
CHANGED
|
@@ -26,15 +26,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.tests = exports.
|
|
29
|
+
exports.tests = exports.values = exports.assets = exports.decisions = exports.flows = exports.rules = exports.users = void 0;
|
|
30
30
|
exports.users = __importStar(require("./users"));
|
|
31
31
|
__exportStar(require("./users/types"), exports);
|
|
32
|
-
exports.values = __importStar(require("./values"));
|
|
33
|
-
__exportStar(require("./values/types"), exports);
|
|
34
32
|
exports.rules = __importStar(require("./rules"));
|
|
35
33
|
exports.flows = __importStar(require("./flows"));
|
|
36
34
|
exports.decisions = __importStar(require("./decisions"));
|
|
37
35
|
exports.assets = __importStar(require("./assets"));
|
|
36
|
+
exports.values = __importStar(require("./values"));
|
|
38
37
|
exports.tests = __importStar(require("./tests"));
|
|
39
38
|
__exportStar(require("./decisions/client/requests"), exports);
|
|
40
39
|
__exportStar(require("./users/client/requests"), exports);
|
|
@@ -29,24 +29,28 @@ export declare class Values {
|
|
|
29
29
|
protected readonly _options: Values.Options;
|
|
30
30
|
constructor(_options: Values.Options);
|
|
31
31
|
/**
|
|
32
|
-
* Retrieve all dynamic values for the authenticated user.
|
|
32
|
+
* Retrieve all dynamic values for the authenticated user. Use the 'include' parameter to control whether usage information is returned.
|
|
33
33
|
*
|
|
34
34
|
* @param {Rulebricks.ValuesListRequest} request
|
|
35
35
|
* @param {Values.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
36
|
*
|
|
37
|
+
* @throws {@link Rulebricks.NotFoundError}
|
|
37
38
|
* @throws {@link Rulebricks.InternalServerError}
|
|
38
39
|
*
|
|
39
40
|
* @example
|
|
40
|
-
* await client.values.list(
|
|
41
|
+
* await client.values.list({
|
|
42
|
+
* include: "usage"
|
|
43
|
+
* })
|
|
41
44
|
*/
|
|
42
45
|
list(request?: Rulebricks.ValuesListRequest, requestOptions?: Values.RequestOptions): Promise<Rulebricks.DynamicValueListResponse>;
|
|
43
46
|
/**
|
|
44
|
-
* Update existing dynamic values or add new ones for the authenticated user.
|
|
47
|
+
* Update existing dynamic values or add new ones for the authenticated user. Supports both flat and nested object structures. Nested objects are automatically flattened using dot notation and keys are converted to readable format (e.g., 'user_name' becomes 'User Name', nested 'user.contact_info.email' becomes 'User.Contact Info.Email').
|
|
45
48
|
*
|
|
46
49
|
* @param {Rulebricks.UpdateValuesRequest} request
|
|
47
50
|
* @param {Values.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
51
|
*
|
|
49
52
|
* @throws {@link Rulebricks.BadRequestError}
|
|
53
|
+
* @throws {@link Rulebricks.ForbiddenError}
|
|
50
54
|
* @throws {@link Rulebricks.InternalServerError}
|
|
51
55
|
*
|
|
52
56
|
* @example
|
|
@@ -55,10 +59,60 @@ export declare class Values {
|
|
|
55
59
|
* "Favorite Color": "blue",
|
|
56
60
|
* "Age": 30,
|
|
57
61
|
* "Is Student": false,
|
|
58
|
-
* "Hobbies": [
|
|
62
|
+
* "Hobbies": [
|
|
63
|
+
* "reading",
|
|
64
|
+
* "cycling"
|
|
65
|
+
* ]
|
|
59
66
|
* },
|
|
60
67
|
* accessGroups: ["marketing", "developers"]
|
|
61
68
|
* })
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* await client.values.update({
|
|
72
|
+
* values: {
|
|
73
|
+
* "user_profile": {
|
|
74
|
+
* "first_name": "Alice",
|
|
75
|
+
* "last_name": "Johnson",
|
|
76
|
+
* "contact_info": {
|
|
77
|
+
* "email_address": "alice@example.com",
|
|
78
|
+
* "phone_number": "555-0123"
|
|
79
|
+
* }
|
|
80
|
+
* },
|
|
81
|
+
* "account_settings": {
|
|
82
|
+
* "is_premium_user": true,
|
|
83
|
+
* "subscription_tier": "gold",
|
|
84
|
+
* "preferences": [
|
|
85
|
+
* "email_notifications",
|
|
86
|
+
* "sms_alerts"
|
|
87
|
+
* ]
|
|
88
|
+
* },
|
|
89
|
+
* "account_balance": 1250.75
|
|
90
|
+
* },
|
|
91
|
+
* accessGroups: ["marketing", "developers"]
|
|
92
|
+
* })
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* await client.values.update({
|
|
96
|
+
* values: {
|
|
97
|
+
* "Company Name": "Acme Corp",
|
|
98
|
+
* "company_details": {
|
|
99
|
+
* "founded_year": 2020,
|
|
100
|
+
* "employee_count": 150,
|
|
101
|
+
* "headquarters": {
|
|
102
|
+
* "city": "San Francisco",
|
|
103
|
+
* "state": "CA",
|
|
104
|
+
* "country": "USA"
|
|
105
|
+
* }
|
|
106
|
+
* },
|
|
107
|
+
* "Is Public": false,
|
|
108
|
+
* "tags": [
|
|
109
|
+
* "tech",
|
|
110
|
+
* "startup",
|
|
111
|
+
* "saas"
|
|
112
|
+
* ]
|
|
113
|
+
* },
|
|
114
|
+
* accessGroups: ["marketing"]
|
|
115
|
+
* })
|
|
62
116
|
*/
|
|
63
117
|
update(request: Rulebricks.UpdateValuesRequest, requestOptions?: Values.RequestOptions): Promise<Rulebricks.DynamicValueListResponse>;
|
|
64
118
|
/**
|
|
@@ -53,24 +53,30 @@ class Values {
|
|
|
53
53
|
this._options = _options;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* Retrieve all dynamic values for the authenticated user.
|
|
56
|
+
* Retrieve all dynamic values for the authenticated user. Use the 'include' parameter to control whether usage information is returned.
|
|
57
57
|
*
|
|
58
58
|
* @param {Rulebricks.ValuesListRequest} request
|
|
59
59
|
* @param {Values.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
60
|
*
|
|
61
|
+
* @throws {@link Rulebricks.NotFoundError}
|
|
61
62
|
* @throws {@link Rulebricks.InternalServerError}
|
|
62
63
|
*
|
|
63
64
|
* @example
|
|
64
|
-
* await client.values.list(
|
|
65
|
+
* await client.values.list({
|
|
66
|
+
* include: "usage"
|
|
67
|
+
* })
|
|
65
68
|
*/
|
|
66
69
|
list(request = {}, requestOptions) {
|
|
67
70
|
var _a, _b;
|
|
68
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
const { name } = request;
|
|
72
|
+
const { name, include } = request;
|
|
70
73
|
const _queryParams = {};
|
|
71
74
|
if (name != null) {
|
|
72
75
|
_queryParams["name"] = name;
|
|
73
76
|
}
|
|
77
|
+
if (include != null) {
|
|
78
|
+
_queryParams["include"] = include;
|
|
79
|
+
}
|
|
74
80
|
const _response = yield core.fetcher({
|
|
75
81
|
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.RulebricksEnvironment.Default, "values"),
|
|
76
82
|
method: "GET",
|
|
@@ -92,6 +98,8 @@ class Values {
|
|
|
92
98
|
}
|
|
93
99
|
if (_response.error.reason === "status-code") {
|
|
94
100
|
switch (_response.error.statusCode) {
|
|
101
|
+
case 404:
|
|
102
|
+
throw new Rulebricks.NotFoundError(_response.error.body);
|
|
95
103
|
case 500:
|
|
96
104
|
throw new Rulebricks.InternalServerError(_response.error.body);
|
|
97
105
|
default:
|
|
@@ -117,12 +125,13 @@ class Values {
|
|
|
117
125
|
});
|
|
118
126
|
}
|
|
119
127
|
/**
|
|
120
|
-
* Update existing dynamic values or add new ones for the authenticated user.
|
|
128
|
+
* Update existing dynamic values or add new ones for the authenticated user. Supports both flat and nested object structures. Nested objects are automatically flattened using dot notation and keys are converted to readable format (e.g., 'user_name' becomes 'User Name', nested 'user.contact_info.email' becomes 'User.Contact Info.Email').
|
|
121
129
|
*
|
|
122
130
|
* @param {Rulebricks.UpdateValuesRequest} request
|
|
123
131
|
* @param {Values.RequestOptions} requestOptions - Request-specific configuration.
|
|
124
132
|
*
|
|
125
133
|
* @throws {@link Rulebricks.BadRequestError}
|
|
134
|
+
* @throws {@link Rulebricks.ForbiddenError}
|
|
126
135
|
* @throws {@link Rulebricks.InternalServerError}
|
|
127
136
|
*
|
|
128
137
|
* @example
|
|
@@ -131,10 +140,60 @@ class Values {
|
|
|
131
140
|
* "Favorite Color": "blue",
|
|
132
141
|
* "Age": 30,
|
|
133
142
|
* "Is Student": false,
|
|
134
|
-
* "Hobbies": [
|
|
143
|
+
* "Hobbies": [
|
|
144
|
+
* "reading",
|
|
145
|
+
* "cycling"
|
|
146
|
+
* ]
|
|
147
|
+
* },
|
|
148
|
+
* accessGroups: ["marketing", "developers"]
|
|
149
|
+
* })
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* await client.values.update({
|
|
153
|
+
* values: {
|
|
154
|
+
* "user_profile": {
|
|
155
|
+
* "first_name": "Alice",
|
|
156
|
+
* "last_name": "Johnson",
|
|
157
|
+
* "contact_info": {
|
|
158
|
+
* "email_address": "alice@example.com",
|
|
159
|
+
* "phone_number": "555-0123"
|
|
160
|
+
* }
|
|
161
|
+
* },
|
|
162
|
+
* "account_settings": {
|
|
163
|
+
* "is_premium_user": true,
|
|
164
|
+
* "subscription_tier": "gold",
|
|
165
|
+
* "preferences": [
|
|
166
|
+
* "email_notifications",
|
|
167
|
+
* "sms_alerts"
|
|
168
|
+
* ]
|
|
169
|
+
* },
|
|
170
|
+
* "account_balance": 1250.75
|
|
135
171
|
* },
|
|
136
172
|
* accessGroups: ["marketing", "developers"]
|
|
137
173
|
* })
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* await client.values.update({
|
|
177
|
+
* values: {
|
|
178
|
+
* "Company Name": "Acme Corp",
|
|
179
|
+
* "company_details": {
|
|
180
|
+
* "founded_year": 2020,
|
|
181
|
+
* "employee_count": 150,
|
|
182
|
+
* "headquarters": {
|
|
183
|
+
* "city": "San Francisco",
|
|
184
|
+
* "state": "CA",
|
|
185
|
+
* "country": "USA"
|
|
186
|
+
* }
|
|
187
|
+
* },
|
|
188
|
+
* "Is Public": false,
|
|
189
|
+
* "tags": [
|
|
190
|
+
* "tech",
|
|
191
|
+
* "startup",
|
|
192
|
+
* "saas"
|
|
193
|
+
* ]
|
|
194
|
+
* },
|
|
195
|
+
* accessGroups: ["marketing"]
|
|
196
|
+
* })
|
|
138
197
|
*/
|
|
139
198
|
update(request, requestOptions) {
|
|
140
199
|
var _a, _b;
|
|
@@ -162,6 +221,8 @@ class Values {
|
|
|
162
221
|
switch (_response.error.statusCode) {
|
|
163
222
|
case 400:
|
|
164
223
|
throw new Rulebricks.BadRequestError(_response.error.body);
|
|
224
|
+
case 403:
|
|
225
|
+
throw new Rulebricks.ForbiddenError(_response.error.body);
|
|
165
226
|
case 500:
|
|
166
227
|
throw new Rulebricks.InternalServerError(_response.error.body);
|
|
167
228
|
default:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as Rulebricks from "../../../../index";
|
|
5
4
|
/**
|
|
6
5
|
* @example
|
|
7
6
|
* {
|
|
@@ -9,14 +8,92 @@ import * as Rulebricks from "../../../../index";
|
|
|
9
8
|
* "Favorite Color": "blue",
|
|
10
9
|
* "Age": 30,
|
|
11
10
|
* "Is Student": false,
|
|
12
|
-
* "Hobbies": [
|
|
11
|
+
* "Hobbies": [
|
|
12
|
+
* "reading",
|
|
13
|
+
* "cycling"
|
|
14
|
+
* ]
|
|
15
|
+
* },
|
|
16
|
+
* accessGroups: ["marketing", "developers"]
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* {
|
|
21
|
+
* values: {
|
|
22
|
+
* "user_profile": {
|
|
23
|
+
* "first_name": "Alice",
|
|
24
|
+
* "last_name": "Johnson",
|
|
25
|
+
* "contact_info": {
|
|
26
|
+
* "email_address": "alice@example.com",
|
|
27
|
+
* "phone_number": "555-0123"
|
|
28
|
+
* }
|
|
29
|
+
* },
|
|
30
|
+
* "account_settings": {
|
|
31
|
+
* "is_premium_user": true,
|
|
32
|
+
* "subscription_tier": "gold",
|
|
33
|
+
* "preferences": [
|
|
34
|
+
* "email_notifications",
|
|
35
|
+
* "sms_alerts"
|
|
36
|
+
* ]
|
|
37
|
+
* },
|
|
38
|
+
* "account_balance": 1250.75
|
|
39
|
+
* },
|
|
40
|
+
* accessGroups: ["marketing", "developers"]
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* {
|
|
45
|
+
* values: {
|
|
46
|
+
* "Company Name": "Acme Corp",
|
|
47
|
+
* "company_details": {
|
|
48
|
+
* "founded_year": 2020,
|
|
49
|
+
* "employee_count": 150,
|
|
50
|
+
* "headquarters": {
|
|
51
|
+
* "city": "San Francisco",
|
|
52
|
+
* "state": "CA",
|
|
53
|
+
* "country": "USA"
|
|
54
|
+
* }
|
|
55
|
+
* },
|
|
56
|
+
* "Is Public": false,
|
|
57
|
+
* "tags": [
|
|
58
|
+
* "tech",
|
|
59
|
+
* "startup",
|
|
60
|
+
* "saas"
|
|
61
|
+
* ]
|
|
62
|
+
* },
|
|
63
|
+
* accessGroups: ["marketing"]
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* {
|
|
68
|
+
* values: {
|
|
69
|
+
* "Favorite Color": "blue",
|
|
70
|
+
* "Age": 30,
|
|
71
|
+
* "Is Student": false,
|
|
72
|
+
* "Hobbies": [
|
|
73
|
+
* "reading",
|
|
74
|
+
* "cycling"
|
|
75
|
+
* ]
|
|
76
|
+
* },
|
|
77
|
+
* accessGroups: ["marketing", "developers"]
|
|
78
|
+
* }
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* {
|
|
82
|
+
* values: {
|
|
83
|
+
* "Favorite Color": "blue",
|
|
84
|
+
* "Age": 30,
|
|
85
|
+
* "Is Student": false,
|
|
86
|
+
* "Hobbies": [
|
|
87
|
+
* "reading",
|
|
88
|
+
* "cycling"
|
|
89
|
+
* ]
|
|
13
90
|
* },
|
|
14
91
|
* accessGroups: ["marketing", "developers"]
|
|
15
92
|
* }
|
|
16
93
|
*/
|
|
17
94
|
export interface UpdateValuesRequest {
|
|
18
|
-
/** A
|
|
19
|
-
values: Record<string,
|
|
95
|
+
/** 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'). */
|
|
96
|
+
values: Record<string, unknown>;
|
|
20
97
|
/** 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. */
|
|
21
98
|
accessGroups?: string[];
|
|
22
99
|
}
|
|
@@ -3,11 +3,22 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
|
-
* {
|
|
6
|
+
* {
|
|
7
|
+
* include: "usage"
|
|
8
|
+
* }
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* {
|
|
12
|
+
* include: "usage"
|
|
13
|
+
* }
|
|
7
14
|
*/
|
|
8
15
|
export interface ValuesListRequest {
|
|
9
16
|
/**
|
|
10
17
|
* Query all dynamic values containing a specific name
|
|
11
18
|
*/
|
|
12
19
|
name?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Comma-separated list of additional data to include. Use 'usage' to include which rules reference each value.
|
|
22
|
+
*/
|
|
23
|
+
include?: string;
|
|
13
24
|
}
|
|
@@ -14,5 +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("./types"), exports);
|
|
18
17
|
__exportStar(require("./client"), exports);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
decision?: Rulebricks.DecisionLogDecision;
|
|
9
|
-
}
|
|
4
|
+
/**
|
|
5
|
+
* Rule/flow execution log entry. Explore this object's schema from your Rulebricks dashboard in the Logs tab.
|
|
6
|
+
*/
|
|
7
|
+
export declare type DecisionLog = Record<string, unknown>;
|
|
@@ -2,18 +2,16 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Rulebricks from "../index";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type: "list";
|
|
18
|
-
}
|
|
5
|
+
export interface DynamicValue {
|
|
6
|
+
/** Unique identifier for the dynamic value. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Name of the dynamic value (may include dot notation for nested properties). */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Type identifier for the value (e.g., 'string', 'number', 'boolean', 'list', 'function', etc.) */
|
|
11
|
+
type: string;
|
|
12
|
+
value?: unknown;
|
|
13
|
+
/** Rules that use this dynamic value (only included when 'include=usage' parameter is used). */
|
|
14
|
+
usages?: Rulebricks.RuleUsage[];
|
|
15
|
+
/** Access groups assigned to this value. */
|
|
16
|
+
accessGroups?: string[];
|
|
19
17
|
}
|
package/api/types/index.d.ts
CHANGED
|
@@ -23,18 +23,9 @@ export * from "./UserInviteResponseUser";
|
|
|
23
23
|
export * from "./UserInviteResponse";
|
|
24
24
|
export * from "./UserGroup";
|
|
25
25
|
export * from "./UserGroupListResponse";
|
|
26
|
-
export * from "./DecisionLogRequest";
|
|
27
|
-
export * from "./DecisionLogResponse";
|
|
28
|
-
export * from "./DecisionLogDecisionConditionsItemValue";
|
|
29
|
-
export * from "./DecisionLogDecision";
|
|
30
26
|
export * from "./DecisionLog";
|
|
27
|
+
export * from "./DecisionLogResponse";
|
|
31
28
|
export * from "./UsageStatistics";
|
|
32
|
-
export * from "./DynamicValueBase";
|
|
33
|
-
export * from "./StringValue";
|
|
34
|
-
export * from "./NumberValue";
|
|
35
|
-
export * from "./BooleanValue";
|
|
36
|
-
export * from "./ListValueValueItem";
|
|
37
|
-
export * from "./ListValue";
|
|
38
29
|
export * from "./DynamicValue";
|
|
39
30
|
export * from "./DynamicValueListResponse";
|
|
40
31
|
export * from "./RuleUsage";
|
package/api/types/index.js
CHANGED
|
@@ -39,18 +39,9 @@ __exportStar(require("./UserInviteResponseUser"), exports);
|
|
|
39
39
|
__exportStar(require("./UserInviteResponse"), exports);
|
|
40
40
|
__exportStar(require("./UserGroup"), exports);
|
|
41
41
|
__exportStar(require("./UserGroupListResponse"), exports);
|
|
42
|
-
__exportStar(require("./DecisionLogRequest"), exports);
|
|
43
|
-
__exportStar(require("./DecisionLogResponse"), exports);
|
|
44
|
-
__exportStar(require("./DecisionLogDecisionConditionsItemValue"), exports);
|
|
45
|
-
__exportStar(require("./DecisionLogDecision"), exports);
|
|
46
42
|
__exportStar(require("./DecisionLog"), exports);
|
|
43
|
+
__exportStar(require("./DecisionLogResponse"), exports);
|
|
47
44
|
__exportStar(require("./UsageStatistics"), exports);
|
|
48
|
-
__exportStar(require("./DynamicValueBase"), exports);
|
|
49
|
-
__exportStar(require("./StringValue"), exports);
|
|
50
|
-
__exportStar(require("./NumberValue"), exports);
|
|
51
|
-
__exportStar(require("./BooleanValue"), exports);
|
|
52
|
-
__exportStar(require("./ListValueValueItem"), exports);
|
|
53
|
-
__exportStar(require("./ListValue"), exports);
|
|
54
45
|
__exportStar(require("./DynamicValue"), exports);
|
|
55
46
|
__exportStar(require("./DynamicValueListResponse"), exports);
|
|
56
47
|
__exportStar(require("./RuleUsage"), exports);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../errors/index";
|
|
5
|
-
import * as Rulebricks from "../index";
|
|
6
5
|
export declare class ForbiddenError extends errors.RulebricksError {
|
|
7
|
-
constructor(body
|
|
6
|
+
constructor(body?: unknown);
|
|
8
7
|
}
|
|
@@ -230,12 +230,7 @@ class Rules {
|
|
|
230
230
|
case 400:
|
|
231
231
|
throw new Rulebricks.BadRequestError(_response.error.body);
|
|
232
232
|
case 403:
|
|
233
|
-
throw new Rulebricks.ForbiddenError(
|
|
234
|
-
unrecognizedObjectKeys: "passthrough",
|
|
235
|
-
allowUnrecognizedUnionMembers: true,
|
|
236
|
-
allowUnrecognizedEnumValues: true,
|
|
237
|
-
breadcrumbsPrefix: ["response"],
|
|
238
|
-
}));
|
|
233
|
+
throw new Rulebricks.ForbiddenError(_response.error.body);
|
|
239
234
|
case 500:
|
|
240
235
|
throw new Rulebricks.InternalServerError(_response.error.body);
|
|
241
236
|
default:
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export * as users from "./users";
|
|
2
2
|
export * from "./users/types";
|
|
3
|
-
export * as values from "./values";
|
|
4
|
-
export * from "./values/types";
|
|
5
3
|
export * as rules from "./rules";
|
|
6
4
|
export * as flows from "./flows";
|
|
7
5
|
export * as decisions from "./decisions";
|
|
8
6
|
export * as assets from "./assets";
|
|
7
|
+
export * as values from "./values";
|
|
9
8
|
export * as tests from "./tests";
|
|
10
9
|
export * from "./decisions/client/requests";
|
|
11
10
|
export * from "./users/client/requests";
|
|
@@ -26,15 +26,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.tests = exports.
|
|
29
|
+
exports.tests = exports.values = exports.assets = exports.decisions = exports.flows = exports.rules = exports.users = void 0;
|
|
30
30
|
exports.users = __importStar(require("./users"));
|
|
31
31
|
__exportStar(require("./users/types"), exports);
|
|
32
|
-
exports.values = __importStar(require("./values"));
|
|
33
|
-
__exportStar(require("./values/types"), exports);
|
|
34
32
|
exports.rules = __importStar(require("./rules"));
|
|
35
33
|
exports.flows = __importStar(require("./flows"));
|
|
36
34
|
exports.decisions = __importStar(require("./decisions"));
|
|
37
35
|
exports.assets = __importStar(require("./assets"));
|
|
36
|
+
exports.values = __importStar(require("./values"));
|
|
38
37
|
exports.tests = __importStar(require("./tests"));
|
|
39
38
|
__exportStar(require("./decisions/client/requests"), exports);
|
|
40
39
|
__exportStar(require("./users/client/requests"), exports);
|