@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
|
@@ -33,7 +33,7 @@ export declare class AssetsClient {
|
|
|
33
33
|
getUsage(requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.UsageStatistics>;
|
|
34
34
|
private __getUsage;
|
|
35
35
|
/**
|
|
36
|
-
* Import rules, flows, contexts, and values from an
|
|
36
|
+
* Import rules, flows, contexts, and values from an Rulebricks manifest file (*.rbm).
|
|
37
37
|
*
|
|
38
38
|
* @param {Rulebricks.ImportManifestRequest} request
|
|
39
39
|
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -42,7 +42,7 @@ export declare class AssetsClient {
|
|
|
42
42
|
* @throws {@link Rulebricks.InternalServerError}
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
|
-
* await client.assets.
|
|
45
|
+
* await client.assets.importRbm({
|
|
46
46
|
* manifest: {
|
|
47
47
|
* version: "1.0",
|
|
48
48
|
* rules: [{
|
|
@@ -53,22 +53,22 @@ export declare class AssetsClient {
|
|
|
53
53
|
* "name": "Onboarding Flow",
|
|
54
54
|
* "slug": "onboarding-flow"
|
|
55
55
|
* }],
|
|
56
|
-
*
|
|
56
|
+
* entities: [{
|
|
57
57
|
* "name": "Customer",
|
|
58
58
|
* "slug": "customer"
|
|
59
59
|
* }],
|
|
60
60
|
* values: [{
|
|
61
|
-
* "
|
|
61
|
+
* "name": "tax_rate",
|
|
62
62
|
* "value": 0.08
|
|
63
63
|
* }]
|
|
64
64
|
* },
|
|
65
|
-
*
|
|
65
|
+
* conflict_strategy: "update"
|
|
66
66
|
* })
|
|
67
67
|
*/
|
|
68
|
-
|
|
69
|
-
private
|
|
68
|
+
importRbm(request: Rulebricks.ImportManifestRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ImportManifestResponse>;
|
|
69
|
+
private __importRbm;
|
|
70
70
|
/**
|
|
71
|
-
* Export selected rules, flows, contexts, and values to an
|
|
71
|
+
* Export selected rules, flows, contexts, and values to an Rulebricks manifest file (*.rbm).
|
|
72
72
|
*
|
|
73
73
|
* @param {Rulebricks.ExportManifestRequest} request
|
|
74
74
|
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -77,13 +77,12 @@ export declare class AssetsClient {
|
|
|
77
77
|
* @throws {@link Rulebricks.InternalServerError}
|
|
78
78
|
*
|
|
79
79
|
* @example
|
|
80
|
-
* await client.assets.
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* values: ["tax_rate", "discount_threshold"]
|
|
80
|
+
* await client.assets.exportRbm({
|
|
81
|
+
* root_type: "rule",
|
|
82
|
+
* root_ids: ["pricing-rule", "eligibility-check"],
|
|
83
|
+
* include_downstream: false
|
|
85
84
|
* })
|
|
86
85
|
*/
|
|
87
|
-
|
|
88
|
-
private
|
|
86
|
+
exportRbm(request: Rulebricks.ExportManifestRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ExportRbmAssetsResponse>;
|
|
87
|
+
private __exportRbm;
|
|
89
88
|
}
|
|
@@ -114,7 +114,7 @@ class AssetsClient {
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
|
-
* Import rules, flows, contexts, and values from an
|
|
117
|
+
* Import rules, flows, contexts, and values from an Rulebricks manifest file (*.rbm).
|
|
118
118
|
*
|
|
119
119
|
* @param {Rulebricks.ImportManifestRequest} request
|
|
120
120
|
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -123,7 +123,7 @@ class AssetsClient {
|
|
|
123
123
|
* @throws {@link Rulebricks.InternalServerError}
|
|
124
124
|
*
|
|
125
125
|
* @example
|
|
126
|
-
* await client.assets.
|
|
126
|
+
* await client.assets.importRbm({
|
|
127
127
|
* manifest: {
|
|
128
128
|
* version: "1.0",
|
|
129
129
|
* rules: [{
|
|
@@ -134,22 +134,22 @@ class AssetsClient {
|
|
|
134
134
|
* "name": "Onboarding Flow",
|
|
135
135
|
* "slug": "onboarding-flow"
|
|
136
136
|
* }],
|
|
137
|
-
*
|
|
137
|
+
* entities: [{
|
|
138
138
|
* "name": "Customer",
|
|
139
139
|
* "slug": "customer"
|
|
140
140
|
* }],
|
|
141
141
|
* values: [{
|
|
142
|
-
* "
|
|
142
|
+
* "name": "tax_rate",
|
|
143
143
|
* "value": 0.08
|
|
144
144
|
* }]
|
|
145
145
|
* },
|
|
146
|
-
*
|
|
146
|
+
* conflict_strategy: "update"
|
|
147
147
|
* })
|
|
148
148
|
*/
|
|
149
|
-
|
|
150
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
149
|
+
importRbm(request, requestOptions) {
|
|
150
|
+
return core.HttpResponsePromise.fromPromise(this.__importRbm(request, requestOptions));
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
__importRbm(request, requestOptions) {
|
|
153
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
154
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
155
155
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
@@ -189,7 +189,7 @@ class AssetsClient {
|
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
/**
|
|
192
|
-
* Export selected rules, flows, contexts, and values to an
|
|
192
|
+
* Export selected rules, flows, contexts, and values to an Rulebricks manifest file (*.rbm).
|
|
193
193
|
*
|
|
194
194
|
* @param {Rulebricks.ExportManifestRequest} request
|
|
195
195
|
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -198,18 +198,17 @@ class AssetsClient {
|
|
|
198
198
|
* @throws {@link Rulebricks.InternalServerError}
|
|
199
199
|
*
|
|
200
200
|
* @example
|
|
201
|
-
* await client.assets.
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* values: ["tax_rate", "discount_threshold"]
|
|
201
|
+
* await client.assets.exportRbm({
|
|
202
|
+
* root_type: "rule",
|
|
203
|
+
* root_ids: ["pricing-rule", "eligibility-check"],
|
|
204
|
+
* include_downstream: false
|
|
206
205
|
* })
|
|
207
206
|
*/
|
|
208
|
-
|
|
209
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
207
|
+
exportRbm(request, requestOptions) {
|
|
208
|
+
return core.HttpResponsePromise.fromPromise(this.__exportRbm(request, requestOptions));
|
|
210
209
|
}
|
|
211
|
-
|
|
212
|
-
return __awaiter(this,
|
|
210
|
+
__exportRbm(request, requestOptions) {
|
|
211
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
212
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
214
213
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
215
214
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* values: ["tax_rate", "discount_threshold"]
|
|
4
|
+
* root_type: "rule",
|
|
5
|
+
* root_ids: ["pricing-rule", "eligibility-check"],
|
|
6
|
+
* include_downstream: false
|
|
8
7
|
* }
|
|
9
8
|
*/
|
|
10
9
|
export interface ExportManifestRequest {
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
10
|
+
/** The type of root asset to export. All dependencies will be included. */
|
|
11
|
+
root_type: ExportManifestRequest.RootType;
|
|
12
|
+
/** Array of IDs for the root assets to export. Dependencies are automatically resolved. */
|
|
13
|
+
root_ids: string[];
|
|
14
|
+
/** For context exports, whether to include rules and flows bound to the context. */
|
|
15
|
+
include_downstream?: boolean;
|
|
16
|
+
/** Optional name for the exported manifest. */
|
|
17
|
+
manifest_name?: string;
|
|
18
|
+
/** Optional description for the exported manifest. */
|
|
19
|
+
manifest_description?: string;
|
|
20
|
+
/** If true, returns a preview of what would be exported without the full data. */
|
|
21
|
+
preview_only?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare namespace ExportManifestRequest {
|
|
24
|
+
/** The type of root asset to export. All dependencies will be included. */
|
|
25
|
+
const RootType: {
|
|
26
|
+
readonly Rule: "rule";
|
|
27
|
+
readonly Flow: "flow";
|
|
28
|
+
readonly Context: "context";
|
|
29
|
+
readonly Value: "value";
|
|
30
|
+
};
|
|
31
|
+
type RootType = (typeof RootType)[keyof typeof RootType];
|
|
23
32
|
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ExportManifestRequest = void 0;
|
|
5
|
+
var ExportManifestRequest;
|
|
6
|
+
(function (ExportManifestRequest) {
|
|
7
|
+
/** The type of root asset to export. All dependencies will be included. */
|
|
8
|
+
ExportManifestRequest.RootType = {
|
|
9
|
+
Rule: "rule",
|
|
10
|
+
Flow: "flow",
|
|
11
|
+
Context: "context",
|
|
12
|
+
Value: "value",
|
|
13
|
+
};
|
|
14
|
+
})(ExportManifestRequest || (exports.ExportManifestRequest = ExportManifestRequest = {}));
|
|
@@ -11,23 +11,27 @@
|
|
|
11
11
|
* "name": "Onboarding Flow",
|
|
12
12
|
* "slug": "onboarding-flow"
|
|
13
13
|
* }],
|
|
14
|
-
*
|
|
14
|
+
* entities: [{
|
|
15
15
|
* "name": "Customer",
|
|
16
16
|
* "slug": "customer"
|
|
17
17
|
* }],
|
|
18
18
|
* values: [{
|
|
19
|
-
* "
|
|
19
|
+
* "name": "tax_rate",
|
|
20
20
|
* "value": 0.08
|
|
21
21
|
* }]
|
|
22
22
|
* },
|
|
23
|
-
*
|
|
23
|
+
* conflict_strategy: "update"
|
|
24
24
|
* }
|
|
25
25
|
*/
|
|
26
26
|
export interface ImportManifestRequest {
|
|
27
27
|
/** The RBM manifest object containing assets to import. */
|
|
28
28
|
manifest: ImportManifestRequest.Manifest;
|
|
29
|
-
/**
|
|
30
|
-
|
|
29
|
+
/** How to handle conflicts with existing assets. 'update' overwrites, 'skip' ignores, 'error' fails. */
|
|
30
|
+
conflict_strategy?: ImportManifestRequest.ConflictStrategy;
|
|
31
|
+
/** Optional folder name to place imported assets into. Created if it doesn't exist. */
|
|
32
|
+
target_folder_name?: string;
|
|
33
|
+
/** Optional mapping for legacy flow imports to reuse existing rules. */
|
|
34
|
+
legacy_rule_mapping?: Record<string, ImportManifestRequest.LegacyRuleMapping.Value>;
|
|
31
35
|
}
|
|
32
36
|
export declare namespace ImportManifestRequest {
|
|
33
37
|
/**
|
|
@@ -40,9 +44,29 @@ export declare namespace ImportManifestRequest {
|
|
|
40
44
|
rules?: Record<string, unknown>[];
|
|
41
45
|
/** Flows to import. */
|
|
42
46
|
flows?: Record<string, unknown>[];
|
|
43
|
-
/** Contexts
|
|
44
|
-
|
|
47
|
+
/** Contexts to import. */
|
|
48
|
+
entities?: Record<string, unknown>[];
|
|
45
49
|
/** Dynamic values to import. */
|
|
46
50
|
values?: Record<string, unknown>[];
|
|
47
51
|
}
|
|
52
|
+
/** How to handle conflicts with existing assets. 'update' overwrites, 'skip' ignores, 'error' fails. */
|
|
53
|
+
const ConflictStrategy: {
|
|
54
|
+
readonly Update: "update";
|
|
55
|
+
readonly Skip: "skip";
|
|
56
|
+
readonly Error: "error";
|
|
57
|
+
};
|
|
58
|
+
type ConflictStrategy = (typeof ConflictStrategy)[keyof typeof ConflictStrategy];
|
|
59
|
+
namespace LegacyRuleMapping {
|
|
60
|
+
interface Value {
|
|
61
|
+
action?: Value.Action;
|
|
62
|
+
rule_id?: string;
|
|
63
|
+
}
|
|
64
|
+
namespace Value {
|
|
65
|
+
const Action: {
|
|
66
|
+
readonly Reuse: "reuse";
|
|
67
|
+
readonly Create: "create";
|
|
68
|
+
};
|
|
69
|
+
type Action = (typeof Action)[keyof typeof Action];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
48
72
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ImportManifestRequest = void 0;
|
|
5
|
+
var ImportManifestRequest;
|
|
6
|
+
(function (ImportManifestRequest) {
|
|
7
|
+
/** How to handle conflicts with existing assets. 'update' overwrites, 'skip' ignores, 'error' fails. */
|
|
8
|
+
ImportManifestRequest.ConflictStrategy = {
|
|
9
|
+
Update: "update",
|
|
10
|
+
Skip: "skip",
|
|
11
|
+
Error: "error",
|
|
12
|
+
};
|
|
13
|
+
let LegacyRuleMapping;
|
|
14
|
+
(function (LegacyRuleMapping) {
|
|
15
|
+
let Value;
|
|
16
|
+
(function (Value) {
|
|
17
|
+
Value.Action = {
|
|
18
|
+
Reuse: "reuse",
|
|
19
|
+
Create: "create",
|
|
20
|
+
};
|
|
21
|
+
})(Value = LegacyRuleMapping.Value || (LegacyRuleMapping.Value = {}));
|
|
22
|
+
})(LegacyRuleMapping = ImportManifestRequest.LegacyRuleMapping || (ImportManifestRequest.LegacyRuleMapping = {}));
|
|
23
|
+
})(ImportManifestRequest || (exports.ImportManifestRequest = ImportManifestRequest = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./ExportRbmAssetsResponse.js";
|
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./ExportRbmAssetsResponse.js"), exports);
|
|
@@ -2,7 +2,7 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClie
|
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
3
|
import * as core from "../../../../core/index.js";
|
|
4
4
|
import * as Rulebricks from "../../../index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ObjectsClient } from "../resources/objects/client/Client.js";
|
|
6
6
|
import { RelationshipsClient } from "../resources/relationships/client/Client.js";
|
|
7
7
|
export declare namespace ContextsClient {
|
|
8
8
|
type Options = BaseClientOptions;
|
|
@@ -10,32 +10,32 @@ export declare namespace ContextsClient {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Operations for managing and interacting with
|
|
13
|
+
* Operations for managing and interacting with live Context instances
|
|
14
14
|
*/
|
|
15
15
|
export declare class ContextsClient {
|
|
16
16
|
protected readonly _options: NormalizedClientOptionsWithAuth<ContextsClient.Options>;
|
|
17
|
-
protected
|
|
17
|
+
protected _objects: ObjectsClient | undefined;
|
|
18
18
|
protected _relationships: RelationshipsClient | undefined;
|
|
19
19
|
constructor(options: ContextsClient.Options);
|
|
20
|
-
get
|
|
20
|
+
get objects(): ObjectsClient;
|
|
21
21
|
get relationships(): RelationshipsClient;
|
|
22
22
|
/**
|
|
23
23
|
* Retrieve the current state of a context instance.
|
|
24
24
|
*
|
|
25
|
-
* @param {Rulebricks.
|
|
25
|
+
* @param {Rulebricks.GetContextsRequest} request
|
|
26
26
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
27
|
*
|
|
28
28
|
* @throws {@link Rulebricks.NotFoundError}
|
|
29
29
|
* @throws {@link Rulebricks.InternalServerError}
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
|
-
* await client.contexts.
|
|
32
|
+
* await client.contexts.get({
|
|
33
33
|
* slug: "customer",
|
|
34
34
|
* instance: "cust-12345"
|
|
35
35
|
* })
|
|
36
36
|
*/
|
|
37
|
-
|
|
38
|
-
private
|
|
37
|
+
get(request: Rulebricks.GetContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ContextInstanceState>;
|
|
38
|
+
private __get;
|
|
39
39
|
/**
|
|
40
40
|
* Submit data to a context instance, creating it if it doesn't exist. May trigger bound rule/flow evaluations.
|
|
41
41
|
*
|
|
@@ -61,20 +61,20 @@ export declare class ContextsClient {
|
|
|
61
61
|
/**
|
|
62
62
|
* Delete a specific context instance and its history.
|
|
63
63
|
*
|
|
64
|
-
* @param {Rulebricks.
|
|
64
|
+
* @param {Rulebricks.DeleteContextsRequest} request
|
|
65
65
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
66
|
*
|
|
67
67
|
* @throws {@link Rulebricks.NotFoundError}
|
|
68
68
|
* @throws {@link Rulebricks.InternalServerError}
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
71
|
-
* await client.contexts.
|
|
71
|
+
* await client.contexts.delete({
|
|
72
72
|
* slug: "customer",
|
|
73
73
|
* instance: "cust-12345"
|
|
74
74
|
* })
|
|
75
75
|
*/
|
|
76
|
-
|
|
77
|
-
private
|
|
76
|
+
delete(request: Rulebricks.DeleteContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.DeleteContextInstanceResponse>;
|
|
77
|
+
private __delete;
|
|
78
78
|
/**
|
|
79
79
|
* Retrieve the change history for a context instance.
|
|
80
80
|
*
|
|
@@ -112,7 +112,7 @@ export declare class ContextsClient {
|
|
|
112
112
|
/**
|
|
113
113
|
* Execute a specific rule using the context instance's state as input.
|
|
114
114
|
*
|
|
115
|
-
* @param {Rulebricks.
|
|
115
|
+
* @param {Rulebricks.SolveContextsRequest} request
|
|
116
116
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
117
117
|
*
|
|
118
118
|
* @throws {@link Rulebricks.BadRequestError}
|
|
@@ -123,15 +123,16 @@ export declare class ContextsClient {
|
|
|
123
123
|
* await client.contexts.solve({
|
|
124
124
|
* slug: "customer",
|
|
125
125
|
* instance: "cust-12345",
|
|
126
|
-
* ruleSlug: "eligibility-check"
|
|
126
|
+
* ruleSlug: "eligibility-check",
|
|
127
|
+
* body: {}
|
|
127
128
|
* })
|
|
128
129
|
*/
|
|
129
|
-
solve(request: Rulebricks.
|
|
130
|
+
solve(request: Rulebricks.SolveContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.SolveContextRuleResponse>;
|
|
130
131
|
private __solve;
|
|
131
132
|
/**
|
|
132
133
|
* Trigger re-evaluation of all bound rules and flows for the instance.
|
|
133
134
|
*
|
|
134
|
-
* @param {Rulebricks.
|
|
135
|
+
* @param {Rulebricks.CascadeContextsRequest} request
|
|
135
136
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
137
|
*
|
|
137
138
|
* @throws {@link Rulebricks.NotFoundError}
|
|
@@ -140,15 +141,16 @@ export declare class ContextsClient {
|
|
|
140
141
|
* @example
|
|
141
142
|
* await client.contexts.cascade({
|
|
142
143
|
* slug: "customer",
|
|
143
|
-
* instance: "cust-12345"
|
|
144
|
+
* instance: "cust-12345",
|
|
145
|
+
* body: {}
|
|
144
146
|
* })
|
|
145
147
|
*/
|
|
146
|
-
cascade(request: Rulebricks.
|
|
148
|
+
cascade(request: Rulebricks.CascadeContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.CascadeContextResponse>;
|
|
147
149
|
private __cascade;
|
|
148
150
|
/**
|
|
149
151
|
* Execute a specific flow using the context instance's state as input.
|
|
150
152
|
*
|
|
151
|
-
* @param {Rulebricks.
|
|
153
|
+
* @param {Rulebricks.ExecuteContextsRequest} request
|
|
152
154
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
153
155
|
*
|
|
154
156
|
* @throws {@link Rulebricks.BadRequestError}
|
|
@@ -159,9 +161,10 @@ export declare class ContextsClient {
|
|
|
159
161
|
* await client.contexts.execute({
|
|
160
162
|
* slug: "customer",
|
|
161
163
|
* instance: "cust-12345",
|
|
162
|
-
* flowSlug: "onboarding-flow"
|
|
164
|
+
* flowSlug: "onboarding-flow",
|
|
165
|
+
* body: {}
|
|
163
166
|
* })
|
|
164
167
|
*/
|
|
165
|
-
execute(request: Rulebricks.
|
|
168
|
+
execute(request: Rulebricks.ExecuteContextsRequest, requestOptions?: ContextsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.SolveContextFlowResponse>;
|
|
166
169
|
private __execute;
|
|
167
170
|
}
|
|
@@ -42,17 +42,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
42
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
-
var t = {};
|
|
47
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
-
t[p] = s[p];
|
|
49
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
-
t[p[i]] = s[p[i]];
|
|
53
|
-
}
|
|
54
|
-
return t;
|
|
55
|
-
};
|
|
56
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
46
|
exports.ContextsClient = void 0;
|
|
58
47
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
@@ -62,18 +51,18 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
62
51
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
63
52
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
64
53
|
const Rulebricks = __importStar(require("../../../index.js"));
|
|
65
|
-
const Client_js_1 = require("../resources/
|
|
54
|
+
const Client_js_1 = require("../resources/objects/client/Client.js");
|
|
66
55
|
const Client_js_2 = require("../resources/relationships/client/Client.js");
|
|
67
56
|
/**
|
|
68
|
-
* Operations for managing and interacting with
|
|
57
|
+
* Operations for managing and interacting with live Context instances
|
|
69
58
|
*/
|
|
70
59
|
class ContextsClient {
|
|
71
60
|
constructor(options) {
|
|
72
61
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
73
62
|
}
|
|
74
|
-
get
|
|
63
|
+
get objects() {
|
|
75
64
|
var _a;
|
|
76
|
-
return ((_a = this.
|
|
65
|
+
return ((_a = this._objects) !== null && _a !== void 0 ? _a : (this._objects = new Client_js_1.ObjectsClient(this._options)));
|
|
77
66
|
}
|
|
78
67
|
get relationships() {
|
|
79
68
|
var _a;
|
|
@@ -82,22 +71,22 @@ class ContextsClient {
|
|
|
82
71
|
/**
|
|
83
72
|
* Retrieve the current state of a context instance.
|
|
84
73
|
*
|
|
85
|
-
* @param {Rulebricks.
|
|
74
|
+
* @param {Rulebricks.GetContextsRequest} request
|
|
86
75
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
87
76
|
*
|
|
88
77
|
* @throws {@link Rulebricks.NotFoundError}
|
|
89
78
|
* @throws {@link Rulebricks.InternalServerError}
|
|
90
79
|
*
|
|
91
80
|
* @example
|
|
92
|
-
* await client.contexts.
|
|
81
|
+
* await client.contexts.get({
|
|
93
82
|
* slug: "customer",
|
|
94
83
|
* instance: "cust-12345"
|
|
95
84
|
* })
|
|
96
85
|
*/
|
|
97
|
-
|
|
98
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
86
|
+
get(request, requestOptions) {
|
|
87
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
99
88
|
}
|
|
100
|
-
|
|
89
|
+
__get(request, requestOptions) {
|
|
101
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
91
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
103
92
|
const { slug, instance } = request;
|
|
@@ -202,22 +191,22 @@ class ContextsClient {
|
|
|
202
191
|
/**
|
|
203
192
|
* Delete a specific context instance and its history.
|
|
204
193
|
*
|
|
205
|
-
* @param {Rulebricks.
|
|
194
|
+
* @param {Rulebricks.DeleteContextsRequest} request
|
|
206
195
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
207
196
|
*
|
|
208
197
|
* @throws {@link Rulebricks.NotFoundError}
|
|
209
198
|
* @throws {@link Rulebricks.InternalServerError}
|
|
210
199
|
*
|
|
211
200
|
* @example
|
|
212
|
-
* await client.contexts.
|
|
201
|
+
* await client.contexts.delete({
|
|
213
202
|
* slug: "customer",
|
|
214
203
|
* instance: "cust-12345"
|
|
215
204
|
* })
|
|
216
205
|
*/
|
|
217
|
-
|
|
218
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
206
|
+
delete(request, requestOptions) {
|
|
207
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
219
208
|
}
|
|
220
|
-
|
|
209
|
+
__delete(request, requestOptions) {
|
|
221
210
|
return __awaiter(this, void 0, void 0, function* () {
|
|
222
211
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
223
212
|
const { slug, instance } = request;
|
|
@@ -380,7 +369,7 @@ class ContextsClient {
|
|
|
380
369
|
/**
|
|
381
370
|
* Execute a specific rule using the context instance's state as input.
|
|
382
371
|
*
|
|
383
|
-
* @param {Rulebricks.
|
|
372
|
+
* @param {Rulebricks.SolveContextsRequest} request
|
|
384
373
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
385
374
|
*
|
|
386
375
|
* @throws {@link Rulebricks.BadRequestError}
|
|
@@ -391,7 +380,8 @@ class ContextsClient {
|
|
|
391
380
|
* await client.contexts.solve({
|
|
392
381
|
* slug: "customer",
|
|
393
382
|
* instance: "cust-12345",
|
|
394
|
-
* ruleSlug: "eligibility-check"
|
|
383
|
+
* ruleSlug: "eligibility-check",
|
|
384
|
+
* body: {}
|
|
395
385
|
* })
|
|
396
386
|
*/
|
|
397
387
|
solve(request, requestOptions) {
|
|
@@ -400,7 +390,7 @@ class ContextsClient {
|
|
|
400
390
|
__solve(request, requestOptions) {
|
|
401
391
|
return __awaiter(this, void 0, void 0, function* () {
|
|
402
392
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
403
|
-
const { slug, instance, ruleSlug
|
|
393
|
+
const { slug, instance, ruleSlug, body: _body } = request;
|
|
404
394
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
405
395
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
406
396
|
const _response = yield core.fetcher({
|
|
@@ -442,7 +432,7 @@ class ContextsClient {
|
|
|
442
432
|
/**
|
|
443
433
|
* Trigger re-evaluation of all bound rules and flows for the instance.
|
|
444
434
|
*
|
|
445
|
-
* @param {Rulebricks.
|
|
435
|
+
* @param {Rulebricks.CascadeContextsRequest} request
|
|
446
436
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
447
437
|
*
|
|
448
438
|
* @throws {@link Rulebricks.NotFoundError}
|
|
@@ -451,7 +441,8 @@ class ContextsClient {
|
|
|
451
441
|
* @example
|
|
452
442
|
* await client.contexts.cascade({
|
|
453
443
|
* slug: "customer",
|
|
454
|
-
* instance: "cust-12345"
|
|
444
|
+
* instance: "cust-12345",
|
|
445
|
+
* body: {}
|
|
455
446
|
* })
|
|
456
447
|
*/
|
|
457
448
|
cascade(request, requestOptions) {
|
|
@@ -460,7 +451,7 @@ class ContextsClient {
|
|
|
460
451
|
__cascade(request, requestOptions) {
|
|
461
452
|
return __awaiter(this, void 0, void 0, function* () {
|
|
462
453
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
463
|
-
const { slug, instance
|
|
454
|
+
const { slug, instance, body: _body } = request;
|
|
464
455
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
465
456
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
466
457
|
const _response = yield core.fetcher({
|
|
@@ -500,7 +491,7 @@ class ContextsClient {
|
|
|
500
491
|
/**
|
|
501
492
|
* Execute a specific flow using the context instance's state as input.
|
|
502
493
|
*
|
|
503
|
-
* @param {Rulebricks.
|
|
494
|
+
* @param {Rulebricks.ExecuteContextsRequest} request
|
|
504
495
|
* @param {ContextsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
505
496
|
*
|
|
506
497
|
* @throws {@link Rulebricks.BadRequestError}
|
|
@@ -511,7 +502,8 @@ class ContextsClient {
|
|
|
511
502
|
* await client.contexts.execute({
|
|
512
503
|
* slug: "customer",
|
|
513
504
|
* instance: "cust-12345",
|
|
514
|
-
* flowSlug: "onboarding-flow"
|
|
505
|
+
* flowSlug: "onboarding-flow",
|
|
506
|
+
* body: {}
|
|
515
507
|
* })
|
|
516
508
|
*/
|
|
517
509
|
execute(request, requestOptions) {
|
|
@@ -520,7 +512,7 @@ class ContextsClient {
|
|
|
520
512
|
__execute(request, requestOptions) {
|
|
521
513
|
return __awaiter(this, void 0, void 0, function* () {
|
|
522
514
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
523
|
-
const { slug, instance, flowSlug
|
|
515
|
+
const { slug, instance, flowSlug, body: _body } = request;
|
|
524
516
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
525
517
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
526
518
|
const _response = yield core.fetcher({
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import type * as Rulebricks from "../../../../index.js";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
4
5
|
* slug: "customer",
|
|
5
|
-
* instance: "cust-12345"
|
|
6
|
+
* instance: "cust-12345",
|
|
7
|
+
* body: {}
|
|
6
8
|
* }
|
|
7
9
|
*/
|
|
8
|
-
export interface
|
|
10
|
+
export interface CascadeContextsRequest {
|
|
9
11
|
/** The unique slug for the context. */
|
|
10
12
|
slug: string;
|
|
11
13
|
/** The unique identifier for the context instance. */
|
|
12
14
|
instance: string;
|
|
13
|
-
|
|
14
|
-
maxDepth?: number;
|
|
15
|
+
body: Rulebricks.CascadeContextRequest;
|
|
15
16
|
}
|