@rulebricks/sdk 2.5.0 → 2.5.2
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/resources/rules/client/Client.d.ts +118 -3
- package/api/resources/assets/resources/rules/client/Client.js +118 -3
- package/api/resources/assets/resources/rules/client/requests/ImportRuleRequest.d.ts +119 -4
- package/api/types/RuleDetail.d.ts +6 -2
- package/api/types/RuleImportConditionRow.d.ts +11 -0
- package/api/types/RuleImportConditionRow.js +3 -0
- package/api/types/RuleImportPayload.d.ts +60 -0
- package/api/types/RuleImportPayload.js +3 -0
- package/api/types/RuleImportRequestCell.d.ts +11 -0
- package/api/types/RuleImportRequestCell.js +3 -0
- package/api/types/RuleImportResponseCell.d.ts +8 -0
- package/api/types/RuleImportResponseCell.js +3 -0
- package/api/types/RuleImportRowSettings.d.ts +17 -0
- package/api/types/RuleImportRowSettings.js +3 -0
- package/api/types/RuleImportSchemaField.d.ts +36 -0
- package/api/types/RuleImportSchemaField.js +17 -0
- package/api/types/index.d.ts +6 -0
- package/api/types/index.js +6 -0
- package/dist/api/resources/assets/resources/rules/client/Client.d.ts +118 -3
- package/dist/api/resources/assets/resources/rules/client/Client.js +118 -3
- package/dist/api/resources/assets/resources/rules/client/requests/ImportRuleRequest.d.ts +119 -4
- package/dist/api/types/RuleDetail.d.ts +6 -2
- package/dist/api/types/RuleImportConditionRow.d.ts +11 -0
- package/dist/api/types/RuleImportConditionRow.js +3 -0
- package/dist/api/types/RuleImportPayload.d.ts +60 -0
- package/dist/api/types/RuleImportPayload.js +3 -0
- package/dist/api/types/RuleImportRequestCell.d.ts +11 -0
- package/dist/api/types/RuleImportRequestCell.js +3 -0
- package/dist/api/types/RuleImportResponseCell.d.ts +8 -0
- package/dist/api/types/RuleImportResponseCell.js +3 -0
- package/dist/api/types/RuleImportRowSettings.d.ts +17 -0
- package/dist/api/types/RuleImportRowSettings.js +3 -0
- package/dist/api/types/RuleImportSchemaField.d.ts +36 -0
- package/dist/api/types/RuleImportSchemaField.js +17 -0
- package/dist/api/types/index.d.ts +6 -0
- package/dist/api/types/index.js +6 -0
- package/dist/forge/rule.d.ts +4 -3
- package/dist/forge/rule.js +1 -1
- package/forge/rule.d.ts +4 -3
- package/forge/rule.js +1 -1
- package/package.json +1 -1
|
@@ -45,7 +45,7 @@ export declare class RulesClient {
|
|
|
45
45
|
pull(request: Rulebricks.assets.PullRulesRequest, requestOptions?: RulesClient.RequestOptions): core.HttpResponsePromise<Rulebricks.RuleExport>;
|
|
46
46
|
private __pull;
|
|
47
47
|
/**
|
|
48
|
-
* Import a rule
|
|
48
|
+
* Import or update a rule. Existing rule IDs support partial updates; new rule IDs require a full rule payload.
|
|
49
49
|
*
|
|
50
50
|
* @param {Rulebricks.assets.ImportRuleRequest} request
|
|
51
51
|
* @param {RulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -57,8 +57,123 @@ export declare class RulesClient {
|
|
|
57
57
|
* @example
|
|
58
58
|
* await client.assets.rules.push({
|
|
59
59
|
* rule: {
|
|
60
|
-
*
|
|
61
|
-
*
|
|
60
|
+
* id: "11111111-2222-4333-8444-555555555555",
|
|
61
|
+
* slug: "basic-pricing-rule",
|
|
62
|
+
* name: "Basic Pricing Rule",
|
|
63
|
+
* description: "",
|
|
64
|
+
* createdAt: "2026-02-12T01:29:23.000Z",
|
|
65
|
+
* updatedAt: "2026-02-12T01:29:23.000Z",
|
|
66
|
+
* published: false,
|
|
67
|
+
* _publish: true,
|
|
68
|
+
* testRequest: {
|
|
69
|
+
* "customer_tier": "STANDARD",
|
|
70
|
+
* "order_total": 250,
|
|
71
|
+
* "expedited": false
|
|
72
|
+
* },
|
|
73
|
+
* sampleRequest: {
|
|
74
|
+
* "customer_tier": "STANDARD",
|
|
75
|
+
* "order_total": 250,
|
|
76
|
+
* "expedited": false
|
|
77
|
+
* },
|
|
78
|
+
* sampleResponse: {
|
|
79
|
+
* "discount_rate": 0,
|
|
80
|
+
* "approval_status": "standard"
|
|
81
|
+
* },
|
|
82
|
+
* requestSchema: [{
|
|
83
|
+
* key: "customer_tier",
|
|
84
|
+
* show: true,
|
|
85
|
+
* name: "Customer Tier",
|
|
86
|
+
* type: "string"
|
|
87
|
+
* }, {
|
|
88
|
+
* key: "order_total",
|
|
89
|
+
* show: true,
|
|
90
|
+
* name: "Order Total",
|
|
91
|
+
* type: "number"
|
|
92
|
+
* }, {
|
|
93
|
+
* key: "expedited",
|
|
94
|
+
* show: true,
|
|
95
|
+
* name: "Expedited",
|
|
96
|
+
* type: "boolean"
|
|
97
|
+
* }],
|
|
98
|
+
* responseSchema: [{
|
|
99
|
+
* key: "discount_rate",
|
|
100
|
+
* show: true,
|
|
101
|
+
* name: "Discount Rate",
|
|
102
|
+
* type: "number"
|
|
103
|
+
* }, {
|
|
104
|
+
* key: "approval_status",
|
|
105
|
+
* show: true,
|
|
106
|
+
* name: "Approval Status",
|
|
107
|
+
* type: "string"
|
|
108
|
+
* }],
|
|
109
|
+
* conditions: [{
|
|
110
|
+
* request: {
|
|
111
|
+
* "customer_tier": {
|
|
112
|
+
* op: "equals",
|
|
113
|
+
* args: ["VIP"]
|
|
114
|
+
* }
|
|
115
|
+
* },
|
|
116
|
+
* response: {
|
|
117
|
+
* "discount_rate": {
|
|
118
|
+
* value: 0.2
|
|
119
|
+
* },
|
|
120
|
+
* "approval_status": {
|
|
121
|
+
* value: "priority"
|
|
122
|
+
* }
|
|
123
|
+
* },
|
|
124
|
+
* settings: {
|
|
125
|
+
* enabled: true,
|
|
126
|
+
* groupId: null,
|
|
127
|
+
* priority: 0,
|
|
128
|
+
* schedule: []
|
|
129
|
+
* }
|
|
130
|
+
* }, {
|
|
131
|
+
* request: {
|
|
132
|
+
* "expedited": {
|
|
133
|
+
* op: "equals",
|
|
134
|
+
* args: [true]
|
|
135
|
+
* }
|
|
136
|
+
* },
|
|
137
|
+
* response: {
|
|
138
|
+
* "discount_rate": {
|
|
139
|
+
* value: 0.05
|
|
140
|
+
* },
|
|
141
|
+
* "approval_status": {
|
|
142
|
+
* value: "expedited"
|
|
143
|
+
* }
|
|
144
|
+
* },
|
|
145
|
+
* settings: {
|
|
146
|
+
* enabled: true,
|
|
147
|
+
* groupId: null,
|
|
148
|
+
* priority: 1,
|
|
149
|
+
* schedule: []
|
|
150
|
+
* }
|
|
151
|
+
* }, {
|
|
152
|
+
* request: {},
|
|
153
|
+
* response: {
|
|
154
|
+
* "discount_rate": {
|
|
155
|
+
* value: 0
|
|
156
|
+
* },
|
|
157
|
+
* "approval_status": {
|
|
158
|
+
* value: "standard"
|
|
159
|
+
* }
|
|
160
|
+
* },
|
|
161
|
+
* settings: {
|
|
162
|
+
* enabled: true,
|
|
163
|
+
* groupId: null,
|
|
164
|
+
* priority: 2,
|
|
165
|
+
* schedule: []
|
|
166
|
+
* }
|
|
167
|
+
* }],
|
|
168
|
+
* history: []
|
|
169
|
+
* }
|
|
170
|
+
* })
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* await client.assets.rules.push({
|
|
174
|
+
* rule: {
|
|
175
|
+
* id: "11111111-2222-4333-8444-555555555555",
|
|
176
|
+
* name: "Updated Rule Name"
|
|
62
177
|
* }
|
|
63
178
|
* })
|
|
64
179
|
*/
|
|
@@ -174,7 +174,7 @@ class RulesClient {
|
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
|
-
* Import a rule
|
|
177
|
+
* Import or update a rule. Existing rule IDs support partial updates; new rule IDs require a full rule payload.
|
|
178
178
|
*
|
|
179
179
|
* @param {Rulebricks.assets.ImportRuleRequest} request
|
|
180
180
|
* @param {RulesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -186,8 +186,123 @@ class RulesClient {
|
|
|
186
186
|
* @example
|
|
187
187
|
* await client.assets.rules.push({
|
|
188
188
|
* rule: {
|
|
189
|
-
*
|
|
190
|
-
*
|
|
189
|
+
* id: "11111111-2222-4333-8444-555555555555",
|
|
190
|
+
* slug: "basic-pricing-rule",
|
|
191
|
+
* name: "Basic Pricing Rule",
|
|
192
|
+
* description: "",
|
|
193
|
+
* createdAt: "2026-02-12T01:29:23.000Z",
|
|
194
|
+
* updatedAt: "2026-02-12T01:29:23.000Z",
|
|
195
|
+
* published: false,
|
|
196
|
+
* _publish: true,
|
|
197
|
+
* testRequest: {
|
|
198
|
+
* "customer_tier": "STANDARD",
|
|
199
|
+
* "order_total": 250,
|
|
200
|
+
* "expedited": false
|
|
201
|
+
* },
|
|
202
|
+
* sampleRequest: {
|
|
203
|
+
* "customer_tier": "STANDARD",
|
|
204
|
+
* "order_total": 250,
|
|
205
|
+
* "expedited": false
|
|
206
|
+
* },
|
|
207
|
+
* sampleResponse: {
|
|
208
|
+
* "discount_rate": 0,
|
|
209
|
+
* "approval_status": "standard"
|
|
210
|
+
* },
|
|
211
|
+
* requestSchema: [{
|
|
212
|
+
* key: "customer_tier",
|
|
213
|
+
* show: true,
|
|
214
|
+
* name: "Customer Tier",
|
|
215
|
+
* type: "string"
|
|
216
|
+
* }, {
|
|
217
|
+
* key: "order_total",
|
|
218
|
+
* show: true,
|
|
219
|
+
* name: "Order Total",
|
|
220
|
+
* type: "number"
|
|
221
|
+
* }, {
|
|
222
|
+
* key: "expedited",
|
|
223
|
+
* show: true,
|
|
224
|
+
* name: "Expedited",
|
|
225
|
+
* type: "boolean"
|
|
226
|
+
* }],
|
|
227
|
+
* responseSchema: [{
|
|
228
|
+
* key: "discount_rate",
|
|
229
|
+
* show: true,
|
|
230
|
+
* name: "Discount Rate",
|
|
231
|
+
* type: "number"
|
|
232
|
+
* }, {
|
|
233
|
+
* key: "approval_status",
|
|
234
|
+
* show: true,
|
|
235
|
+
* name: "Approval Status",
|
|
236
|
+
* type: "string"
|
|
237
|
+
* }],
|
|
238
|
+
* conditions: [{
|
|
239
|
+
* request: {
|
|
240
|
+
* "customer_tier": {
|
|
241
|
+
* op: "equals",
|
|
242
|
+
* args: ["VIP"]
|
|
243
|
+
* }
|
|
244
|
+
* },
|
|
245
|
+
* response: {
|
|
246
|
+
* "discount_rate": {
|
|
247
|
+
* value: 0.2
|
|
248
|
+
* },
|
|
249
|
+
* "approval_status": {
|
|
250
|
+
* value: "priority"
|
|
251
|
+
* }
|
|
252
|
+
* },
|
|
253
|
+
* settings: {
|
|
254
|
+
* enabled: true,
|
|
255
|
+
* groupId: null,
|
|
256
|
+
* priority: 0,
|
|
257
|
+
* schedule: []
|
|
258
|
+
* }
|
|
259
|
+
* }, {
|
|
260
|
+
* request: {
|
|
261
|
+
* "expedited": {
|
|
262
|
+
* op: "equals",
|
|
263
|
+
* args: [true]
|
|
264
|
+
* }
|
|
265
|
+
* },
|
|
266
|
+
* response: {
|
|
267
|
+
* "discount_rate": {
|
|
268
|
+
* value: 0.05
|
|
269
|
+
* },
|
|
270
|
+
* "approval_status": {
|
|
271
|
+
* value: "expedited"
|
|
272
|
+
* }
|
|
273
|
+
* },
|
|
274
|
+
* settings: {
|
|
275
|
+
* enabled: true,
|
|
276
|
+
* groupId: null,
|
|
277
|
+
* priority: 1,
|
|
278
|
+
* schedule: []
|
|
279
|
+
* }
|
|
280
|
+
* }, {
|
|
281
|
+
* request: {},
|
|
282
|
+
* response: {
|
|
283
|
+
* "discount_rate": {
|
|
284
|
+
* value: 0
|
|
285
|
+
* },
|
|
286
|
+
* "approval_status": {
|
|
287
|
+
* value: "standard"
|
|
288
|
+
* }
|
|
289
|
+
* },
|
|
290
|
+
* settings: {
|
|
291
|
+
* enabled: true,
|
|
292
|
+
* groupId: null,
|
|
293
|
+
* priority: 2,
|
|
294
|
+
* schedule: []
|
|
295
|
+
* }
|
|
296
|
+
* }],
|
|
297
|
+
* history: []
|
|
298
|
+
* }
|
|
299
|
+
* })
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* await client.assets.rules.push({
|
|
303
|
+
* rule: {
|
|
304
|
+
* id: "11111111-2222-4333-8444-555555555555",
|
|
305
|
+
* name: "Updated Rule Name"
|
|
191
306
|
* }
|
|
192
307
|
* })
|
|
193
308
|
*/
|
|
@@ -1,13 +1,128 @@
|
|
|
1
|
+
import type * as Rulebricks from "../../../../../../index.js";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
4
5
|
* rule: {
|
|
5
|
-
*
|
|
6
|
-
*
|
|
6
|
+
* id: "11111111-2222-4333-8444-555555555555",
|
|
7
|
+
* slug: "basic-pricing-rule",
|
|
8
|
+
* name: "Basic Pricing Rule",
|
|
9
|
+
* description: "",
|
|
10
|
+
* createdAt: "2026-02-12T01:29:23.000Z",
|
|
11
|
+
* updatedAt: "2026-02-12T01:29:23.000Z",
|
|
12
|
+
* published: false,
|
|
13
|
+
* _publish: true,
|
|
14
|
+
* testRequest: {
|
|
15
|
+
* "customer_tier": "STANDARD",
|
|
16
|
+
* "order_total": 250,
|
|
17
|
+
* "expedited": false
|
|
18
|
+
* },
|
|
19
|
+
* sampleRequest: {
|
|
20
|
+
* "customer_tier": "STANDARD",
|
|
21
|
+
* "order_total": 250,
|
|
22
|
+
* "expedited": false
|
|
23
|
+
* },
|
|
24
|
+
* sampleResponse: {
|
|
25
|
+
* "discount_rate": 0,
|
|
26
|
+
* "approval_status": "standard"
|
|
27
|
+
* },
|
|
28
|
+
* requestSchema: [{
|
|
29
|
+
* key: "customer_tier",
|
|
30
|
+
* show: true,
|
|
31
|
+
* name: "Customer Tier",
|
|
32
|
+
* type: "string"
|
|
33
|
+
* }, {
|
|
34
|
+
* key: "order_total",
|
|
35
|
+
* show: true,
|
|
36
|
+
* name: "Order Total",
|
|
37
|
+
* type: "number"
|
|
38
|
+
* }, {
|
|
39
|
+
* key: "expedited",
|
|
40
|
+
* show: true,
|
|
41
|
+
* name: "Expedited",
|
|
42
|
+
* type: "boolean"
|
|
43
|
+
* }],
|
|
44
|
+
* responseSchema: [{
|
|
45
|
+
* key: "discount_rate",
|
|
46
|
+
* show: true,
|
|
47
|
+
* name: "Discount Rate",
|
|
48
|
+
* type: "number"
|
|
49
|
+
* }, {
|
|
50
|
+
* key: "approval_status",
|
|
51
|
+
* show: true,
|
|
52
|
+
* name: "Approval Status",
|
|
53
|
+
* type: "string"
|
|
54
|
+
* }],
|
|
55
|
+
* conditions: [{
|
|
56
|
+
* request: {
|
|
57
|
+
* "customer_tier": {
|
|
58
|
+
* op: "equals",
|
|
59
|
+
* args: ["VIP"]
|
|
60
|
+
* }
|
|
61
|
+
* },
|
|
62
|
+
* response: {
|
|
63
|
+
* "discount_rate": {
|
|
64
|
+
* value: 0.2
|
|
65
|
+
* },
|
|
66
|
+
* "approval_status": {
|
|
67
|
+
* value: "priority"
|
|
68
|
+
* }
|
|
69
|
+
* },
|
|
70
|
+
* settings: {
|
|
71
|
+
* enabled: true,
|
|
72
|
+
* groupId: null,
|
|
73
|
+
* priority: 0,
|
|
74
|
+
* schedule: []
|
|
75
|
+
* }
|
|
76
|
+
* }, {
|
|
77
|
+
* request: {
|
|
78
|
+
* "expedited": {
|
|
79
|
+
* op: "equals",
|
|
80
|
+
* args: [true]
|
|
81
|
+
* }
|
|
82
|
+
* },
|
|
83
|
+
* response: {
|
|
84
|
+
* "discount_rate": {
|
|
85
|
+
* value: 0.05
|
|
86
|
+
* },
|
|
87
|
+
* "approval_status": {
|
|
88
|
+
* value: "expedited"
|
|
89
|
+
* }
|
|
90
|
+
* },
|
|
91
|
+
* settings: {
|
|
92
|
+
* enabled: true,
|
|
93
|
+
* groupId: null,
|
|
94
|
+
* priority: 1,
|
|
95
|
+
* schedule: []
|
|
96
|
+
* }
|
|
97
|
+
* }, {
|
|
98
|
+
* request: {},
|
|
99
|
+
* response: {
|
|
100
|
+
* "discount_rate": {
|
|
101
|
+
* value: 0
|
|
102
|
+
* },
|
|
103
|
+
* "approval_status": {
|
|
104
|
+
* value: "standard"
|
|
105
|
+
* }
|
|
106
|
+
* },
|
|
107
|
+
* settings: {
|
|
108
|
+
* enabled: true,
|
|
109
|
+
* groupId: null,
|
|
110
|
+
* priority: 2,
|
|
111
|
+
* schedule: []
|
|
112
|
+
* }
|
|
113
|
+
* }],
|
|
114
|
+
* history: []
|
|
115
|
+
* }
|
|
116
|
+
* }
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* {
|
|
120
|
+
* rule: {
|
|
121
|
+
* id: "11111111-2222-4333-8444-555555555555",
|
|
122
|
+
* name: "Updated Rule Name"
|
|
7
123
|
* }
|
|
8
124
|
* }
|
|
9
125
|
*/
|
|
10
126
|
export interface ImportRuleRequest {
|
|
11
|
-
|
|
12
|
-
rule: Record<string, unknown>;
|
|
127
|
+
rule: Rulebricks.RuleImportPayload;
|
|
13
128
|
}
|
|
@@ -4,12 +4,16 @@ export interface RuleDetail extends Rulebricks.RuleBase {
|
|
|
4
4
|
created_at?: string;
|
|
5
5
|
/** The date this rule was last updated. */
|
|
6
6
|
updated_at?: string;
|
|
7
|
+
/** Whether the rule is currently published. */
|
|
8
|
+
published?: boolean;
|
|
9
|
+
/** Optional user-defined metadata for API-first integrations. */
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
7
11
|
folder?: Rulebricks.Folder;
|
|
8
12
|
/** The context this rule is bound to (if any). Rules bound to a context have their inputs/outputs mapped to context fields. */
|
|
9
13
|
context?: RuleDetail.Context | null;
|
|
10
|
-
/** The
|
|
14
|
+
/** The request schema for the rule. Uses published schema when published, otherwise draft schema. */
|
|
11
15
|
request_schema?: Rulebricks.SchemaField[];
|
|
12
|
-
/** The
|
|
16
|
+
/** The response schema for the rule. Uses published schema when published, otherwise draft schema. */
|
|
13
17
|
response_schema?: Rulebricks.SchemaField[];
|
|
14
18
|
}
|
|
15
19
|
export declare namespace RuleDetail {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as Rulebricks from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* A single rule row containing request conditions and response output.
|
|
4
|
+
*/
|
|
5
|
+
export interface RuleImportConditionRow {
|
|
6
|
+
/** Request-side cells keyed by request schema field key. */
|
|
7
|
+
request: Record<string, Rulebricks.RuleImportRequestCell>;
|
|
8
|
+
/** Response-side cells keyed by response schema field key. */
|
|
9
|
+
response: Record<string, Rulebricks.RuleImportResponseCell>;
|
|
10
|
+
settings: Rulebricks.RuleImportRowSettings;
|
|
11
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type * as Rulebricks from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Rule object accepted by /admin/rules/import. Existing rule IDs allow partial updates; creating a new rule ID requires the full legacy import shape.
|
|
4
|
+
*/
|
|
5
|
+
export interface RuleImportPayload {
|
|
6
|
+
/** Rule ID to create or update. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Optional stable ID for cross-workspace import/export identity. */
|
|
9
|
+
stable_id?: string;
|
|
10
|
+
/** Rule slug. */
|
|
11
|
+
slug?: string;
|
|
12
|
+
/** Rule name. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Rule description. */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Creation timestamp. */
|
|
17
|
+
createdAt?: string;
|
|
18
|
+
/** Last update timestamp. */
|
|
19
|
+
updatedAt?: string;
|
|
20
|
+
/** Current publish state. Set with `_publish`/`_unpublish` to control publish transitions on import. */
|
|
21
|
+
published?: boolean;
|
|
22
|
+
/** Optional user-defined metadata for external IDs or implementation mappings. */
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
/** If true, backend publishes this rule and snapshots published_* fields from draft fields. */
|
|
25
|
+
_publish?: boolean;
|
|
26
|
+
/** If true, backend unpublishes this rule. */
|
|
27
|
+
_unpublish?: boolean;
|
|
28
|
+
/** Draft request schema. */
|
|
29
|
+
requestSchema?: Rulebricks.RuleImportSchemaField[];
|
|
30
|
+
/** Draft response schema. */
|
|
31
|
+
responseSchema?: Rulebricks.RuleImportSchemaField[];
|
|
32
|
+
/** Sample request JSON. */
|
|
33
|
+
sampleRequest?: Record<string, unknown>;
|
|
34
|
+
/** Request payload used by editor test tab. */
|
|
35
|
+
testRequest?: Record<string, unknown>;
|
|
36
|
+
/** Sample response JSON. */
|
|
37
|
+
sampleResponse?: Record<string, unknown>;
|
|
38
|
+
/** Draft condition rows. */
|
|
39
|
+
conditions?: Rulebricks.RuleImportConditionRow[];
|
|
40
|
+
/** Optional row grouping definitions. */
|
|
41
|
+
groups?: Record<string, Record<string, unknown>>;
|
|
42
|
+
/** Optional rule-level settings. */
|
|
43
|
+
settings?: Record<string, unknown>;
|
|
44
|
+
/** Optional rule test suite. */
|
|
45
|
+
testSuite?: Record<string, unknown>[];
|
|
46
|
+
/** Rule history entries. */
|
|
47
|
+
history?: Record<string, unknown>[];
|
|
48
|
+
/** Publish timestamp. */
|
|
49
|
+
publishedAt?: string | null;
|
|
50
|
+
/** Optional published request schema override. */
|
|
51
|
+
published_requestSchema?: Rulebricks.RuleImportSchemaField[] | null;
|
|
52
|
+
/** Optional published response schema override. */
|
|
53
|
+
published_responseSchema?: Rulebricks.RuleImportSchemaField[] | null;
|
|
54
|
+
/** Optional published conditions override. */
|
|
55
|
+
published_conditions?: Rulebricks.RuleImportConditionRow[] | null;
|
|
56
|
+
/** Optional published groups override. */
|
|
57
|
+
published_groups?: Record<string, Record<string, unknown> | null> | null;
|
|
58
|
+
/** Accepts any additional properties */
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A request cell in a condition row.
|
|
3
|
+
*/
|
|
4
|
+
export interface RuleImportRequestCell {
|
|
5
|
+
/** Operator name for this request comparison. */
|
|
6
|
+
op: string;
|
|
7
|
+
/** Operator arguments. */
|
|
8
|
+
args: unknown[];
|
|
9
|
+
/** Accepts any additional properties */
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution settings for a condition row.
|
|
3
|
+
*/
|
|
4
|
+
export interface RuleImportRowSettings {
|
|
5
|
+
/** Whether this row is active. */
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
/** Optional group ID for grouped aggregation. */
|
|
8
|
+
groupId: string | null;
|
|
9
|
+
/** Row priority when multiple rows match. */
|
|
10
|
+
priority: number;
|
|
11
|
+
/** Optional schedule constraints for this row. */
|
|
12
|
+
schedule: Record<string, unknown>[];
|
|
13
|
+
/** When true, request cells in this row are evaluated with OR semantics. */
|
|
14
|
+
or?: boolean;
|
|
15
|
+
/** Accepts any additional properties */
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A request or response schema field used when importing a rule.
|
|
3
|
+
*/
|
|
4
|
+
export interface RuleImportSchemaField {
|
|
5
|
+
/** Unique key for this field. */
|
|
6
|
+
key: string;
|
|
7
|
+
/** Whether this field is shown in the editor table. */
|
|
8
|
+
show: boolean;
|
|
9
|
+
/** Display name for this field. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Optional field description. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Data type for this field. */
|
|
14
|
+
type: RuleImportSchemaField.Type;
|
|
15
|
+
/** Optional default value for this field. */
|
|
16
|
+
defaultValue?: unknown | null;
|
|
17
|
+
/** When true, this field should only accept values from a value collection. */
|
|
18
|
+
valuesOnly?: boolean;
|
|
19
|
+
/** Prefix used to scope available dynamic values for this field. */
|
|
20
|
+
valuesPrefix?: string;
|
|
21
|
+
/** Accepts any additional properties */
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace RuleImportSchemaField {
|
|
25
|
+
/** Data type for this field. */
|
|
26
|
+
const Type: {
|
|
27
|
+
readonly String: "string";
|
|
28
|
+
readonly Number: "number";
|
|
29
|
+
readonly Boolean: "boolean";
|
|
30
|
+
readonly Date: "date";
|
|
31
|
+
readonly List: "list";
|
|
32
|
+
readonly Object: "object";
|
|
33
|
+
readonly Function: "function";
|
|
34
|
+
};
|
|
35
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.RuleImportSchemaField = void 0;
|
|
5
|
+
var RuleImportSchemaField;
|
|
6
|
+
(function (RuleImportSchemaField) {
|
|
7
|
+
/** Data type for this field. */
|
|
8
|
+
RuleImportSchemaField.Type = {
|
|
9
|
+
String: "string",
|
|
10
|
+
Number: "number",
|
|
11
|
+
Boolean: "boolean",
|
|
12
|
+
Date: "date",
|
|
13
|
+
List: "list",
|
|
14
|
+
Object: "object",
|
|
15
|
+
Function: "function",
|
|
16
|
+
};
|
|
17
|
+
})(RuleImportSchemaField || (exports.RuleImportSchemaField = RuleImportSchemaField = {}));
|
package/api/types/index.d.ts
CHANGED
|
@@ -45,6 +45,12 @@ export * from "./ParallelSolveResponse.js";
|
|
|
45
45
|
export * from "./RuleBase.js";
|
|
46
46
|
export * from "./RuleDetail.js";
|
|
47
47
|
export * from "./RuleExport.js";
|
|
48
|
+
export * from "./RuleImportConditionRow.js";
|
|
49
|
+
export * from "./RuleImportPayload.js";
|
|
50
|
+
export * from "./RuleImportRequestCell.js";
|
|
51
|
+
export * from "./RuleImportResponseCell.js";
|
|
52
|
+
export * from "./RuleImportRowSettings.js";
|
|
53
|
+
export * from "./RuleImportSchemaField.js";
|
|
48
54
|
export * from "./RuleListResponse.js";
|
|
49
55
|
export * from "./RuleUsage.js";
|
|
50
56
|
export * from "./SchemaField.js";
|
package/api/types/index.js
CHANGED
|
@@ -61,6 +61,12 @@ __exportStar(require("./ParallelSolveResponse.js"), exports);
|
|
|
61
61
|
__exportStar(require("./RuleBase.js"), exports);
|
|
62
62
|
__exportStar(require("./RuleDetail.js"), exports);
|
|
63
63
|
__exportStar(require("./RuleExport.js"), exports);
|
|
64
|
+
__exportStar(require("./RuleImportConditionRow.js"), exports);
|
|
65
|
+
__exportStar(require("./RuleImportPayload.js"), exports);
|
|
66
|
+
__exportStar(require("./RuleImportRequestCell.js"), exports);
|
|
67
|
+
__exportStar(require("./RuleImportResponseCell.js"), exports);
|
|
68
|
+
__exportStar(require("./RuleImportRowSettings.js"), exports);
|
|
69
|
+
__exportStar(require("./RuleImportSchemaField.js"), exports);
|
|
64
70
|
__exportStar(require("./RuleListResponse.js"), exports);
|
|
65
71
|
__exportStar(require("./RuleUsage.js"), exports);
|
|
66
72
|
__exportStar(require("./SchemaField.js"), exports);
|