@rulebricks/sdk 1.5.2 → 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/Client.d.ts +3 -0
- package/Client.js +17 -12
- package/api/resources/assets/client/Client.d.ts +54 -1
- package/api/resources/assets/client/Client.js +134 -0
- package/api/resources/assets/client/index.d.ts +1 -1
- package/api/resources/assets/client/index.js +15 -0
- package/api/resources/assets/client/requests/ExportManifestRequest.d.ts +32 -0
- package/api/resources/assets/client/requests/ExportManifestRequest.js +14 -0
- package/api/resources/assets/client/requests/ImportManifestRequest.d.ts +72 -0
- package/api/resources/assets/client/requests/ImportManifestRequest.js +23 -0
- package/api/resources/assets/client/requests/index.d.ts +2 -0
- package/api/resources/assets/client/requests/index.js +2 -0
- package/api/resources/assets/index.d.ts +1 -0
- package/api/resources/assets/index.js +1 -0
- package/api/resources/assets/types/ExportRbmAssetsResponse.d.ts +2 -0
- package/api/resources/assets/types/ExportRbmAssetsResponse.js +3 -0
- package/api/resources/assets/types/index.d.ts +1 -0
- package/api/resources/assets/types/index.js +17 -0
- package/api/resources/contexts/client/Client.d.ts +170 -0
- package/api/resources/contexts/client/Client.js +555 -0
- package/api/resources/contexts/client/index.d.ts +1 -0
- package/api/resources/contexts/client/index.js +17 -0
- package/api/resources/contexts/client/requests/CascadeContextsRequest.d.ts +16 -0
- package/api/resources/contexts/client/requests/CascadeContextsRequest.js +3 -0
- package/api/resources/contexts/client/requests/DeleteContextsRequest.d.ts +13 -0
- package/api/resources/contexts/client/requests/DeleteContextsRequest.js +3 -0
- package/api/resources/contexts/client/requests/ExecuteContextsRequest.d.ts +19 -0
- package/api/resources/contexts/client/requests/ExecuteContextsRequest.js +3 -0
- package/api/resources/contexts/client/requests/GetContextsRequest.d.ts +13 -0
- package/api/resources/contexts/client/requests/GetContextsRequest.js +3 -0
- package/api/resources/contexts/client/requests/GetHistoryContextsRequest.d.ts +17 -0
- package/api/resources/contexts/client/requests/GetHistoryContextsRequest.js +3 -0
- package/api/resources/contexts/client/requests/GetPendingContextsRequest.d.ts +13 -0
- package/api/resources/contexts/client/requests/GetPendingContextsRequest.js +3 -0
- package/api/resources/contexts/client/requests/SolveContextsRequest.d.ts +19 -0
- package/api/resources/contexts/client/requests/SolveContextsRequest.js +3 -0
- package/api/resources/contexts/client/requests/SubmitContextsRequest.d.ts +19 -0
- package/api/resources/contexts/client/requests/SubmitContextsRequest.js +3 -0
- package/api/resources/contexts/client/requests/index.d.ts +8 -0
- package/api/resources/contexts/client/requests/index.js +2 -0
- package/api/resources/contexts/index.d.ts +2 -0
- package/api/resources/contexts/index.js +18 -0
- package/api/resources/contexts/resources/index.d.ts +4 -0
- package/api/resources/contexts/resources/index.js +43 -0
- package/api/resources/contexts/resources/objects/client/Client.d.ts +103 -0
- package/api/resources/contexts/resources/objects/client/Client.js +354 -0
- package/api/resources/contexts/resources/objects/client/index.d.ts +1 -0
- package/api/resources/contexts/resources/objects/client/index.js +17 -0
- package/api/resources/contexts/resources/objects/client/requests/CreateContextRequest.d.ts +58 -0
- package/api/resources/contexts/resources/objects/client/requests/CreateContextRequest.js +12 -0
- package/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.d.ts +10 -0
- package/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.js +3 -0
- package/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.d.ts +10 -0
- package/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.js +3 -0
- package/api/resources/contexts/resources/objects/client/requests/UpdateContextRequest.d.ts +49 -0
- package/api/resources/contexts/resources/objects/client/requests/UpdateContextRequest.js +12 -0
- package/api/resources/contexts/resources/objects/client/requests/index.d.ts +4 -0
- package/api/resources/contexts/resources/objects/client/requests/index.js +2 -0
- package/api/resources/contexts/resources/objects/index.d.ts +1 -0
- package/api/resources/contexts/resources/objects/index.js +17 -0
- package/api/resources/contexts/resources/relationships/client/Client.d.ts +67 -0
- package/api/resources/contexts/resources/relationships/client/Client.js +252 -0
- package/api/resources/contexts/resources/relationships/client/index.d.ts +1 -0
- package/api/resources/contexts/resources/relationships/client/index.js +17 -0
- package/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.d.ts +33 -0
- package/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.js +13 -0
- package/api/resources/contexts/resources/relationships/client/requests/DeleteRelationshipsRequest.d.ts +13 -0
- package/api/resources/contexts/resources/relationships/client/requests/DeleteRelationshipsRequest.js +3 -0
- package/api/resources/contexts/resources/relationships/client/requests/ListRelationshipsRequest.d.ts +10 -0
- package/api/resources/contexts/resources/relationships/client/requests/ListRelationshipsRequest.js +3 -0
- package/api/resources/contexts/resources/relationships/client/requests/index.d.ts +3 -0
- package/api/resources/contexts/resources/relationships/client/requests/index.js +2 -0
- package/api/resources/contexts/resources/relationships/index.d.ts +1 -0
- package/api/resources/contexts/resources/relationships/index.js +17 -0
- package/api/resources/index.d.ts +4 -0
- package/api/resources/index.js +8 -4
- package/api/resources/users/client/Client.d.ts +5 -5
- package/api/resources/users/client/Client.js +5 -5
- package/api/resources/users/client/requests/CreateUserRequest.d.ts +3 -3
- package/api/resources/users/client/requests/UserInviteRequest.d.ts +6 -6
- package/api/resources/values/client/Client.d.ts +3 -3
- package/api/resources/values/client/Client.js +3 -3
- package/api/resources/values/client/requests/UpdateValuesRequest.d.ts +7 -7
- package/api/types/CascadeContextRequest.d.ts +4 -0
- package/api/types/CascadeContextRequest.js +3 -0
- package/api/types/CascadeContextResponse.d.ts +10 -0
- package/api/types/CascadeContextResponse.js +3 -0
- package/api/types/CascadeResult.d.ts +29 -0
- package/api/types/CascadeResult.js +12 -0
- package/api/types/ContextBase.d.ts +33 -0
- package/api/types/ContextBase.js +12 -0
- package/api/types/ContextDetail.d.ts +58 -0
- package/api/types/ContextDetail.js +3 -0
- package/api/types/ContextInstanceHistory.d.ts +10 -0
- package/api/types/ContextInstanceHistory.js +3 -0
- package/api/types/ContextInstanceHistoryEntry.d.ts +9 -0
- package/api/types/ContextInstanceHistoryEntry.js +3 -0
- package/api/types/ContextInstancePendingEvaluation.d.ts +37 -0
- package/api/types/ContextInstancePendingEvaluation.js +12 -0
- package/api/types/ContextInstancePendingResponse.d.ts +8 -0
- package/api/types/ContextInstancePendingResponse.js +3 -0
- package/api/types/ContextInstanceState.d.ts +31 -0
- package/api/types/ContextInstanceState.js +12 -0
- package/api/types/ContextListItem.d.ts +24 -0
- package/api/types/ContextListItem.js +3 -0
- package/api/types/ContextListResponse.d.ts +2 -0
- package/api/types/ContextListResponse.js +3 -0
- package/api/types/ContextRelationshipBase.d.ts +23 -0
- package/api/types/ContextRelationshipBase.js +13 -0
- package/api/types/ContextRelationshipIncoming.d.ts +11 -0
- package/api/types/ContextRelationshipIncoming.js +3 -0
- package/api/types/ContextRelationshipOutgoing.d.ts +11 -0
- package/api/types/ContextRelationshipOutgoing.js +3 -0
- package/api/types/ContextRelationshipsResponse.d.ts +17 -0
- package/api/types/ContextRelationshipsResponse.js +3 -0
- package/api/types/ContextSchema.d.ts +10 -0
- package/api/types/ContextSchema.js +3 -0
- package/api/types/ContextSchemaField.d.ts +35 -0
- package/api/types/ContextSchemaField.js +16 -0
- package/api/types/CreateContextResponse.d.ts +2 -0
- package/api/types/CreateContextResponse.js +3 -0
- package/api/types/CreateRelationshipResponse.d.ts +2 -0
- package/api/types/CreateRelationshipResponse.js +3 -0
- package/api/types/CreateUserResponse.d.ts +3 -3
- package/api/types/DecisionLog.d.ts +13 -4
- package/api/types/DecisionLogResponse.d.ts +4 -4
- package/api/types/DeleteContextInstanceResponse.d.ts +9 -0
- package/api/types/DeleteContextInstanceResponse.js +3 -0
- package/api/types/DeleteContextResponse.d.ts +13 -0
- package/api/types/DeleteContextResponse.js +3 -0
- package/api/types/DeleteRelationshipResponse.d.ts +6 -0
- package/api/types/DeleteRelationshipResponse.js +3 -0
- package/api/types/DynamicValue.d.ts +9 -3
- package/api/types/ExportManifestPreviewResponse.d.ts +64 -0
- package/api/types/ExportManifestPreviewResponse.js +3 -0
- package/api/types/ExportManifestResponse.d.ts +30 -0
- package/api/types/ExportManifestResponse.js +3 -0
- package/api/types/FlowDetail.d.ts +28 -0
- package/api/types/Folder.d.ts +5 -1
- package/api/types/ImportManifestResponse.d.ts +66 -0
- package/api/types/ImportManifestResponse.js +3 -0
- package/api/types/RuleDetail.d.ts +17 -0
- package/api/types/SchemaField.d.ts +2 -2
- package/api/types/SolveContextFlowRequest.d.ts +4 -0
- package/api/types/SolveContextFlowRequest.js +3 -0
- package/api/types/SolveContextFlowResponse.d.ts +23 -0
- package/api/types/SolveContextFlowResponse.js +12 -0
- package/api/types/SolveContextRuleRequest.d.ts +4 -0
- package/api/types/SolveContextRuleRequest.js +3 -0
- package/api/types/SolveContextRuleResponse.d.ts +26 -0
- package/api/types/SolveContextRuleResponse.js +12 -0
- package/api/types/SubmitContextDataRequest.d.ts +4 -0
- package/api/types/SubmitContextDataRequest.js +3 -0
- package/api/types/SubmitContextDataResponse.d.ts +30 -0
- package/api/types/SubmitContextDataResponse.js +12 -0
- package/api/types/Test.d.ts +9 -9
- package/api/types/UpdateContextResponse.d.ts +13 -0
- package/api/types/UpdateContextResponse.js +3 -0
- package/api/types/UsageStatistics.d.ts +10 -4
- package/api/types/UserDetail.d.ts +4 -4
- package/api/types/UserGroup.d.ts +2 -0
- package/api/types/UserInviteResponse.d.ts +2 -2
- package/api/types/index.d.ts +33 -0
- package/api/types/index.js +33 -0
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +17 -12
- package/dist/api/resources/assets/client/Client.d.ts +54 -1
- package/dist/api/resources/assets/client/Client.js +134 -0
- package/dist/api/resources/assets/client/index.d.ts +1 -1
- package/dist/api/resources/assets/client/index.js +15 -0
- package/dist/api/resources/assets/client/requests/ExportManifestRequest.d.ts +32 -0
- package/dist/api/resources/assets/client/requests/ExportManifestRequest.js +14 -0
- package/dist/api/resources/assets/client/requests/ImportManifestRequest.d.ts +72 -0
- package/dist/api/resources/assets/client/requests/ImportManifestRequest.js +23 -0
- package/dist/api/resources/assets/client/requests/index.d.ts +2 -0
- package/dist/api/resources/assets/client/requests/index.js +2 -0
- package/dist/api/resources/assets/index.d.ts +1 -0
- package/dist/api/resources/assets/index.js +1 -0
- package/dist/api/resources/assets/types/ExportRbmAssetsResponse.d.ts +2 -0
- package/dist/api/resources/assets/types/ExportRbmAssetsResponse.js +3 -0
- package/dist/api/resources/assets/types/index.d.ts +1 -0
- package/dist/api/resources/assets/types/index.js +17 -0
- package/dist/api/resources/contexts/client/Client.d.ts +170 -0
- package/dist/api/resources/contexts/client/Client.js +555 -0
- package/dist/api/resources/contexts/client/index.d.ts +1 -0
- package/dist/api/resources/contexts/client/index.js +17 -0
- package/dist/api/resources/contexts/client/requests/CascadeContextsRequest.d.ts +16 -0
- package/dist/api/resources/contexts/client/requests/CascadeContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/DeleteContextsRequest.d.ts +13 -0
- package/dist/api/resources/contexts/client/requests/DeleteContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/ExecuteContextsRequest.d.ts +19 -0
- package/dist/api/resources/contexts/client/requests/ExecuteContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/GetContextsRequest.d.ts +13 -0
- package/dist/api/resources/contexts/client/requests/GetContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/GetHistoryContextsRequest.d.ts +17 -0
- package/dist/api/resources/contexts/client/requests/GetHistoryContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/GetPendingContextsRequest.d.ts +13 -0
- package/dist/api/resources/contexts/client/requests/GetPendingContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/SolveContextsRequest.d.ts +19 -0
- package/dist/api/resources/contexts/client/requests/SolveContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/SubmitContextsRequest.d.ts +19 -0
- package/dist/api/resources/contexts/client/requests/SubmitContextsRequest.js +3 -0
- package/dist/api/resources/contexts/client/requests/index.d.ts +8 -0
- package/dist/api/resources/contexts/client/requests/index.js +2 -0
- package/dist/api/resources/contexts/index.d.ts +2 -0
- package/dist/api/resources/contexts/index.js +18 -0
- package/dist/api/resources/contexts/resources/index.d.ts +4 -0
- package/dist/api/resources/contexts/resources/index.js +43 -0
- package/dist/api/resources/contexts/resources/objects/client/Client.d.ts +103 -0
- package/dist/api/resources/contexts/resources/objects/client/Client.js +354 -0
- package/dist/api/resources/contexts/resources/objects/client/index.d.ts +1 -0
- package/dist/api/resources/contexts/resources/objects/client/index.js +17 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/CreateContextRequest.d.ts +58 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/CreateContextRequest.js +12 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.d.ts +10 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/DeleteObjectsRequest.js +3 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.d.ts +10 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/GetObjectsRequest.js +3 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/UpdateContextRequest.d.ts +49 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/UpdateContextRequest.js +12 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/index.d.ts +4 -0
- package/dist/api/resources/contexts/resources/objects/client/requests/index.js +2 -0
- package/dist/api/resources/contexts/resources/objects/index.d.ts +1 -0
- package/dist/api/resources/contexts/resources/objects/index.js +17 -0
- package/dist/api/resources/contexts/resources/relationships/client/Client.d.ts +67 -0
- package/dist/api/resources/contexts/resources/relationships/client/Client.js +252 -0
- package/dist/api/resources/contexts/resources/relationships/client/index.d.ts +1 -0
- package/dist/api/resources/contexts/resources/relationships/client/index.js +17 -0
- package/dist/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.d.ts +33 -0
- package/dist/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.js +13 -0
- package/dist/api/resources/contexts/resources/relationships/client/requests/DeleteRelationshipsRequest.d.ts +13 -0
- package/dist/api/resources/contexts/resources/relationships/client/requests/DeleteRelationshipsRequest.js +3 -0
- package/dist/api/resources/contexts/resources/relationships/client/requests/ListRelationshipsRequest.d.ts +10 -0
- package/dist/api/resources/contexts/resources/relationships/client/requests/ListRelationshipsRequest.js +3 -0
- package/dist/api/resources/contexts/resources/relationships/client/requests/index.d.ts +3 -0
- package/dist/api/resources/contexts/resources/relationships/client/requests/index.js +2 -0
- package/dist/api/resources/contexts/resources/relationships/index.d.ts +1 -0
- package/dist/api/resources/contexts/resources/relationships/index.js +17 -0
- package/dist/api/resources/index.d.ts +4 -0
- package/dist/api/resources/index.js +8 -4
- package/dist/api/resources/users/client/Client.d.ts +5 -5
- package/dist/api/resources/users/client/Client.js +5 -5
- package/dist/api/resources/users/client/requests/CreateUserRequest.d.ts +3 -3
- package/dist/api/resources/users/client/requests/UserInviteRequest.d.ts +6 -6
- package/dist/api/resources/values/client/Client.d.ts +3 -3
- package/dist/api/resources/values/client/Client.js +3 -3
- package/dist/api/resources/values/client/requests/UpdateValuesRequest.d.ts +7 -7
- package/dist/api/types/CascadeContextRequest.d.ts +4 -0
- package/dist/api/types/CascadeContextRequest.js +3 -0
- package/dist/api/types/CascadeContextResponse.d.ts +10 -0
- package/dist/api/types/CascadeContextResponse.js +3 -0
- package/dist/api/types/CascadeResult.d.ts +29 -0
- package/dist/api/types/CascadeResult.js +12 -0
- package/dist/api/types/ContextBase.d.ts +33 -0
- package/dist/api/types/ContextBase.js +12 -0
- package/dist/api/types/ContextDetail.d.ts +58 -0
- package/dist/api/types/ContextDetail.js +3 -0
- package/dist/api/types/ContextInstanceHistory.d.ts +10 -0
- package/dist/api/types/ContextInstanceHistory.js +3 -0
- package/dist/api/types/ContextInstanceHistoryEntry.d.ts +9 -0
- package/dist/api/types/ContextInstanceHistoryEntry.js +3 -0
- package/dist/api/types/ContextInstancePendingEvaluation.d.ts +37 -0
- package/dist/api/types/ContextInstancePendingEvaluation.js +12 -0
- package/dist/api/types/ContextInstancePendingResponse.d.ts +8 -0
- package/dist/api/types/ContextInstancePendingResponse.js +3 -0
- package/dist/api/types/ContextInstanceState.d.ts +31 -0
- package/dist/api/types/ContextInstanceState.js +12 -0
- package/dist/api/types/ContextListItem.d.ts +24 -0
- package/dist/api/types/ContextListItem.js +3 -0
- package/dist/api/types/ContextListResponse.d.ts +2 -0
- package/dist/api/types/ContextListResponse.js +3 -0
- package/dist/api/types/ContextRelationshipBase.d.ts +23 -0
- package/dist/api/types/ContextRelationshipBase.js +13 -0
- package/dist/api/types/ContextRelationshipIncoming.d.ts +11 -0
- package/dist/api/types/ContextRelationshipIncoming.js +3 -0
- package/dist/api/types/ContextRelationshipOutgoing.d.ts +11 -0
- package/dist/api/types/ContextRelationshipOutgoing.js +3 -0
- package/dist/api/types/ContextRelationshipsResponse.d.ts +17 -0
- package/dist/api/types/ContextRelationshipsResponse.js +3 -0
- package/dist/api/types/ContextSchema.d.ts +10 -0
- package/dist/api/types/ContextSchema.js +3 -0
- package/dist/api/types/ContextSchemaField.d.ts +35 -0
- package/dist/api/types/ContextSchemaField.js +16 -0
- package/dist/api/types/CreateContextResponse.d.ts +2 -0
- package/dist/api/types/CreateContextResponse.js +3 -0
- package/dist/api/types/CreateRelationshipResponse.d.ts +2 -0
- package/dist/api/types/CreateRelationshipResponse.js +3 -0
- package/dist/api/types/CreateUserResponse.d.ts +3 -3
- package/dist/api/types/DecisionLog.d.ts +13 -4
- package/dist/api/types/DecisionLogResponse.d.ts +4 -4
- package/dist/api/types/DeleteContextInstanceResponse.d.ts +9 -0
- package/dist/api/types/DeleteContextInstanceResponse.js +3 -0
- package/dist/api/types/DeleteContextResponse.d.ts +13 -0
- package/dist/api/types/DeleteContextResponse.js +3 -0
- package/dist/api/types/DeleteRelationshipResponse.d.ts +6 -0
- package/dist/api/types/DeleteRelationshipResponse.js +3 -0
- package/dist/api/types/DynamicValue.d.ts +9 -3
- package/dist/api/types/ExportManifestPreviewResponse.d.ts +64 -0
- package/dist/api/types/ExportManifestPreviewResponse.js +3 -0
- package/dist/api/types/ExportManifestResponse.d.ts +30 -0
- package/dist/api/types/ExportManifestResponse.js +3 -0
- package/dist/api/types/FlowDetail.d.ts +28 -0
- package/dist/api/types/Folder.d.ts +5 -1
- package/dist/api/types/ImportManifestResponse.d.ts +66 -0
- package/dist/api/types/ImportManifestResponse.js +3 -0
- package/dist/api/types/RuleDetail.d.ts +17 -0
- 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/SolveContextFlowResponse.d.ts +23 -0
- package/dist/api/types/SolveContextFlowResponse.js +12 -0
- package/dist/api/types/SolveContextRuleRequest.d.ts +4 -0
- package/dist/api/types/SolveContextRuleRequest.js +3 -0
- package/dist/api/types/SolveContextRuleResponse.d.ts +26 -0
- package/dist/api/types/SolveContextRuleResponse.js +12 -0
- package/dist/api/types/SubmitContextDataRequest.d.ts +4 -0
- package/dist/api/types/SubmitContextDataRequest.js +3 -0
- package/dist/api/types/SubmitContextDataResponse.d.ts +30 -0
- package/dist/api/types/SubmitContextDataResponse.js +12 -0
- package/dist/api/types/Test.d.ts +9 -9
- package/dist/api/types/UpdateContextResponse.d.ts +13 -0
- package/dist/api/types/UpdateContextResponse.js +3 -0
- package/dist/api/types/UsageStatistics.d.ts +10 -4
- package/dist/api/types/UserDetail.d.ts +4 -4
- package/dist/api/types/UserGroup.d.ts +2 -0
- package/dist/api/types/UserInviteResponse.d.ts +2 -2
- package/dist/api/types/index.d.ts +33 -0
- package/dist/api/types/index.js +33 -0
- package/dist/forge/values.d.ts +1 -1
- package/dist/forge/values.js +2 -2
- package/forge/values.d.ts +1 -1
- package/forge/values.js +2 -2
- package/package.json +1 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* name: "Customer",
|
|
5
|
+
* description: "Represents a customer in the system",
|
|
6
|
+
* schema: [{
|
|
7
|
+
* key: "email",
|
|
8
|
+
* name: "Email",
|
|
9
|
+
* type: "string"
|
|
10
|
+
* }, {
|
|
11
|
+
* key: "age",
|
|
12
|
+
* name: "Age",
|
|
13
|
+
* type: "number"
|
|
14
|
+
* }],
|
|
15
|
+
* identity_fact: "email"
|
|
16
|
+
* }
|
|
17
|
+
*/
|
|
18
|
+
export interface CreateContextRequest {
|
|
19
|
+
/** The name of the context. */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Optional custom slug. Auto-generated if not provided. */
|
|
22
|
+
slug?: string;
|
|
23
|
+
/** The description of the context. */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** Initial schema fields for the context. At least one field must be defined. */
|
|
26
|
+
schema: CreateContextRequest.Schema.Item[];
|
|
27
|
+
/** The field key to use as the unique identifier for instances. Must be a key from the schema. */
|
|
28
|
+
identity_fact: string;
|
|
29
|
+
/** When true (default), bound rules and flows automatically execute when their inputs are satisfied. */
|
|
30
|
+
auto_execute_decisions?: boolean;
|
|
31
|
+
/** Time-to-live in seconds for live context instances. Instances expire after this duration. */
|
|
32
|
+
ttl_seconds?: number | null;
|
|
33
|
+
/** Maximum number of history entries to retain per field. */
|
|
34
|
+
history_limit?: number;
|
|
35
|
+
/** How to handle fields that don't match the schema. */
|
|
36
|
+
on_schema_mismatch?: CreateContextRequest.OnSchemaMismatch;
|
|
37
|
+
/** Webhook URL called when a rule or flow successfully solves. */
|
|
38
|
+
webhook_on_solve?: string;
|
|
39
|
+
/** Webhook URL called when a live context expires due to TTL. */
|
|
40
|
+
webhook_on_expire?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare namespace CreateContextRequest {
|
|
43
|
+
type Schema = Schema.Item[];
|
|
44
|
+
namespace Schema {
|
|
45
|
+
interface Item {
|
|
46
|
+
key?: string;
|
|
47
|
+
name?: string;
|
|
48
|
+
type?: string;
|
|
49
|
+
default_value?: unknown;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** How to handle fields that don't match the schema. */
|
|
53
|
+
const OnSchemaMismatch: {
|
|
54
|
+
readonly Ignore: "ignore";
|
|
55
|
+
readonly Reject: "reject";
|
|
56
|
+
};
|
|
57
|
+
type OnSchemaMismatch = (typeof OnSchemaMismatch)[keyof typeof OnSchemaMismatch];
|
|
58
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CreateContextRequest = void 0;
|
|
5
|
+
var CreateContextRequest;
|
|
6
|
+
(function (CreateContextRequest) {
|
|
7
|
+
/** How to handle fields that don't match the schema. */
|
|
8
|
+
CreateContextRequest.OnSchemaMismatch = {
|
|
9
|
+
Ignore: "ignore",
|
|
10
|
+
Reject: "reject",
|
|
11
|
+
};
|
|
12
|
+
})(CreateContextRequest || (exports.CreateContextRequest = CreateContextRequest = {}));
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
5
|
+
* name: "Updated Customer",
|
|
6
|
+
* description: "Updated description for premium customers"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface UpdateContextRequest {
|
|
10
|
+
/** The unique identifier for the context. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** The name of the context. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** The slug of the context. */
|
|
15
|
+
slug?: string;
|
|
16
|
+
/** The description of the context. */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** Updated schema fields for the context. */
|
|
19
|
+
schema?: UpdateContextRequest.Schema.Item[];
|
|
20
|
+
/** When true, bound rules and flows automatically execute when their inputs are satisfied. */
|
|
21
|
+
auto_execute_decisions?: boolean;
|
|
22
|
+
/** Time-to-live in seconds for live context instances. Instances expire after this duration. */
|
|
23
|
+
ttl_seconds?: number | null;
|
|
24
|
+
/** Maximum number of history entries to retain per field. */
|
|
25
|
+
history_limit?: number;
|
|
26
|
+
/** How to handle fields that don't match the schema. */
|
|
27
|
+
on_schema_mismatch?: UpdateContextRequest.OnSchemaMismatch;
|
|
28
|
+
/** Webhook URL called when a rule or flow successfully solves. */
|
|
29
|
+
webhook_on_solve?: string | null;
|
|
30
|
+
/** Webhook URL called when a live context expires due to TTL. */
|
|
31
|
+
webhook_on_expire?: string | null;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace UpdateContextRequest {
|
|
34
|
+
type Schema = Schema.Item[];
|
|
35
|
+
namespace Schema {
|
|
36
|
+
interface Item {
|
|
37
|
+
key?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
type?: string;
|
|
40
|
+
default_value?: unknown;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** How to handle fields that don't match the schema. */
|
|
44
|
+
const OnSchemaMismatch: {
|
|
45
|
+
readonly Ignore: "ignore";
|
|
46
|
+
readonly Reject: "reject";
|
|
47
|
+
};
|
|
48
|
+
type OnSchemaMismatch = (typeof OnSchemaMismatch)[keyof typeof OnSchemaMismatch];
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.UpdateContextRequest = void 0;
|
|
5
|
+
var UpdateContextRequest;
|
|
6
|
+
(function (UpdateContextRequest) {
|
|
7
|
+
/** How to handle fields that don't match the schema. */
|
|
8
|
+
UpdateContextRequest.OnSchemaMismatch = {
|
|
9
|
+
Ignore: "ignore",
|
|
10
|
+
Reject: "reject",
|
|
11
|
+
};
|
|
12
|
+
})(UpdateContextRequest || (exports.UpdateContextRequest = UpdateContextRequest = {}));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { CreateContextRequest } from "./CreateContextRequest.js";
|
|
2
|
+
export type { DeleteObjectsRequest } from "./DeleteObjectsRequest.js";
|
|
3
|
+
export type { GetObjectsRequest } from "./GetObjectsRequest.js";
|
|
4
|
+
export type { UpdateContextRequest } from "./UpdateContextRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../../../core/index.js";
|
|
4
|
+
import * as Rulebricks from "../../../../../index.js";
|
|
5
|
+
export declare namespace RelationshipsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class RelationshipsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<RelationshipsClient.Options>;
|
|
12
|
+
constructor(options: RelationshipsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* List all relationships for a specific context.
|
|
15
|
+
*
|
|
16
|
+
* @param {Rulebricks.contexts.ListRelationshipsRequest} request
|
|
17
|
+
* @param {RelationshipsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link Rulebricks.NotFoundError}
|
|
20
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* await client.contexts.relationships.list({
|
|
24
|
+
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
|
|
25
|
+
* })
|
|
26
|
+
*/
|
|
27
|
+
list(request: Rulebricks.contexts.ListRelationshipsRequest, requestOptions?: RelationshipsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.ContextRelationshipsResponse>;
|
|
28
|
+
private __list;
|
|
29
|
+
/**
|
|
30
|
+
* Create a new relationship between two contexts.
|
|
31
|
+
*
|
|
32
|
+
* @param {Rulebricks.contexts.CreateRelationshipRequest} request
|
|
33
|
+
* @param {RelationshipsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
|
+
*
|
|
35
|
+
* @throws {@link Rulebricks.BadRequestError}
|
|
36
|
+
* @throws {@link Rulebricks.NotFoundError}
|
|
37
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* await client.contexts.relationships.create({
|
|
41
|
+
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
42
|
+
* to_context_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
43
|
+
* relation_type: "has_many",
|
|
44
|
+
* foreign_key_fact: "customer_id",
|
|
45
|
+
* name: "Customer Orders"
|
|
46
|
+
* })
|
|
47
|
+
*/
|
|
48
|
+
create(request: Rulebricks.contexts.CreateRelationshipRequest, requestOptions?: RelationshipsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.CreateRelationshipResponse>;
|
|
49
|
+
private __create;
|
|
50
|
+
/**
|
|
51
|
+
* Delete a specific relationship between contexts.
|
|
52
|
+
*
|
|
53
|
+
* @param {Rulebricks.contexts.DeleteRelationshipsRequest} request
|
|
54
|
+
* @param {RelationshipsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
|
+
*
|
|
56
|
+
* @throws {@link Rulebricks.NotFoundError}
|
|
57
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await client.contexts.relationships.delete({
|
|
61
|
+
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
62
|
+
* relationship: "c3d4e5f6-a7b8-9012-cdef-123456789012"
|
|
63
|
+
* })
|
|
64
|
+
*/
|
|
65
|
+
delete(request: Rulebricks.contexts.DeleteRelationshipsRequest, requestOptions?: RelationshipsClient.RequestOptions): core.HttpResponsePromise<Rulebricks.DeleteRelationshipResponse>;
|
|
66
|
+
private __delete;
|
|
67
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.RelationshipsClient = void 0;
|
|
58
|
+
const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
59
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
60
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
61
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
62
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
63
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
64
|
+
const Rulebricks = __importStar(require("../../../../../index.js"));
|
|
65
|
+
class RelationshipsClient {
|
|
66
|
+
constructor(options) {
|
|
67
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* List all relationships for a specific context.
|
|
71
|
+
*
|
|
72
|
+
* @param {Rulebricks.contexts.ListRelationshipsRequest} request
|
|
73
|
+
* @param {RelationshipsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
|
+
*
|
|
75
|
+
* @throws {@link Rulebricks.NotFoundError}
|
|
76
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* await client.contexts.relationships.list({
|
|
80
|
+
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
|
|
81
|
+
* })
|
|
82
|
+
*/
|
|
83
|
+
list(request, requestOptions) {
|
|
84
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
85
|
+
}
|
|
86
|
+
__list(request, requestOptions) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
89
|
+
const { id } = request;
|
|
90
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
91
|
+
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);
|
|
92
|
+
const _response = yield core.fetcher({
|
|
93
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.RulebricksEnvironment.Default, `admin/contexts/${core.url.encodePathParam(id)}/relationships`),
|
|
94
|
+
method: "GET",
|
|
95
|
+
headers: _headers,
|
|
96
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
97
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
98
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
99
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
100
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
101
|
+
logging: this._options.logging,
|
|
102
|
+
});
|
|
103
|
+
if (_response.ok) {
|
|
104
|
+
return {
|
|
105
|
+
data: _response.body,
|
|
106
|
+
rawResponse: _response.rawResponse,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
if (_response.error.reason === "status-code") {
|
|
110
|
+
switch (_response.error.statusCode) {
|
|
111
|
+
case 404:
|
|
112
|
+
throw new Rulebricks.NotFoundError(_response.error.body, _response.rawResponse);
|
|
113
|
+
case 500:
|
|
114
|
+
throw new Rulebricks.InternalServerError(_response.error.body, _response.rawResponse);
|
|
115
|
+
default:
|
|
116
|
+
throw new errors.RulebricksError({
|
|
117
|
+
statusCode: _response.error.statusCode,
|
|
118
|
+
body: _response.error.body,
|
|
119
|
+
rawResponse: _response.rawResponse,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/admin/contexts/{id}/relationships");
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Create a new relationship between two contexts.
|
|
128
|
+
*
|
|
129
|
+
* @param {Rulebricks.contexts.CreateRelationshipRequest} request
|
|
130
|
+
* @param {RelationshipsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
131
|
+
*
|
|
132
|
+
* @throws {@link Rulebricks.BadRequestError}
|
|
133
|
+
* @throws {@link Rulebricks.NotFoundError}
|
|
134
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* await client.contexts.relationships.create({
|
|
138
|
+
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
139
|
+
* to_context_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
140
|
+
* relation_type: "has_many",
|
|
141
|
+
* foreign_key_fact: "customer_id",
|
|
142
|
+
* name: "Customer Orders"
|
|
143
|
+
* })
|
|
144
|
+
*/
|
|
145
|
+
create(request, requestOptions) {
|
|
146
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
147
|
+
}
|
|
148
|
+
__create(request, requestOptions) {
|
|
149
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
151
|
+
const { id } = request, _body = __rest(request, ["id"]);
|
|
152
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
153
|
+
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);
|
|
154
|
+
const _response = yield core.fetcher({
|
|
155
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.RulebricksEnvironment.Default, `admin/contexts/${core.url.encodePathParam(id)}/relationships`),
|
|
156
|
+
method: "POST",
|
|
157
|
+
headers: _headers,
|
|
158
|
+
contentType: "application/json",
|
|
159
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
160
|
+
requestType: "json",
|
|
161
|
+
body: _body,
|
|
162
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
163
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
164
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
165
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
166
|
+
logging: this._options.logging,
|
|
167
|
+
});
|
|
168
|
+
if (_response.ok) {
|
|
169
|
+
return {
|
|
170
|
+
data: _response.body,
|
|
171
|
+
rawResponse: _response.rawResponse,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (_response.error.reason === "status-code") {
|
|
175
|
+
switch (_response.error.statusCode) {
|
|
176
|
+
case 400:
|
|
177
|
+
throw new Rulebricks.BadRequestError(_response.error.body, _response.rawResponse);
|
|
178
|
+
case 404:
|
|
179
|
+
throw new Rulebricks.NotFoundError(_response.error.body, _response.rawResponse);
|
|
180
|
+
case 500:
|
|
181
|
+
throw new Rulebricks.InternalServerError(_response.error.body, _response.rawResponse);
|
|
182
|
+
default:
|
|
183
|
+
throw new errors.RulebricksError({
|
|
184
|
+
statusCode: _response.error.statusCode,
|
|
185
|
+
body: _response.error.body,
|
|
186
|
+
rawResponse: _response.rawResponse,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/admin/contexts/{id}/relationships");
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Delete a specific relationship between contexts.
|
|
195
|
+
*
|
|
196
|
+
* @param {Rulebricks.contexts.DeleteRelationshipsRequest} request
|
|
197
|
+
* @param {RelationshipsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
|
+
*
|
|
199
|
+
* @throws {@link Rulebricks.NotFoundError}
|
|
200
|
+
* @throws {@link Rulebricks.InternalServerError}
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* await client.contexts.relationships.delete({
|
|
204
|
+
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
205
|
+
* relationship: "c3d4e5f6-a7b8-9012-cdef-123456789012"
|
|
206
|
+
* })
|
|
207
|
+
*/
|
|
208
|
+
delete(request, requestOptions) {
|
|
209
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
|
|
210
|
+
}
|
|
211
|
+
__delete(request, requestOptions) {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
214
|
+
const { id, relationship } = request;
|
|
215
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
216
|
+
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);
|
|
217
|
+
const _response = yield core.fetcher({
|
|
218
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.RulebricksEnvironment.Default, `admin/contexts/${core.url.encodePathParam(id)}/relationships/${core.url.encodePathParam(relationship)}`),
|
|
219
|
+
method: "DELETE",
|
|
220
|
+
headers: _headers,
|
|
221
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
222
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
223
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
224
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
225
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
226
|
+
logging: this._options.logging,
|
|
227
|
+
});
|
|
228
|
+
if (_response.ok) {
|
|
229
|
+
return {
|
|
230
|
+
data: _response.body,
|
|
231
|
+
rawResponse: _response.rawResponse,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
if (_response.error.reason === "status-code") {
|
|
235
|
+
switch (_response.error.statusCode) {
|
|
236
|
+
case 404:
|
|
237
|
+
throw new Rulebricks.NotFoundError(_response.error.body, _response.rawResponse);
|
|
238
|
+
case 500:
|
|
239
|
+
throw new Rulebricks.InternalServerError(_response.error.body, _response.rawResponse);
|
|
240
|
+
default:
|
|
241
|
+
throw new errors.RulebricksError({
|
|
242
|
+
statusCode: _response.error.statusCode,
|
|
243
|
+
body: _response.error.body,
|
|
244
|
+
rawResponse: _response.rawResponse,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/admin/contexts/{id}/relationships/{relationship}");
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
exports.RelationshipsClient = RelationshipsClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
5
|
+
* to_context_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
|
|
6
|
+
* relation_type: "has_many",
|
|
7
|
+
* foreign_key_fact: "customer_id",
|
|
8
|
+
* name: "Customer Orders"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface CreateRelationshipRequest {
|
|
12
|
+
/** The unique identifier for the context. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** The ID of the target context. */
|
|
15
|
+
to_context_id: string;
|
|
16
|
+
/** The type of relationship. */
|
|
17
|
+
relation_type: CreateRelationshipRequest.RelationType;
|
|
18
|
+
/** The field key to use as the foreign key. */
|
|
19
|
+
foreign_key_fact: string;
|
|
20
|
+
/** Display name for the relationship. */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** Description of the relationship. */
|
|
23
|
+
description?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare namespace CreateRelationshipRequest {
|
|
26
|
+
/** The type of relationship. */
|
|
27
|
+
const RelationType: {
|
|
28
|
+
readonly HasMany: "has_many";
|
|
29
|
+
readonly HasOne: "has_one";
|
|
30
|
+
readonly BelongsTo: "belongs_to";
|
|
31
|
+
};
|
|
32
|
+
type RelationType = (typeof RelationType)[keyof typeof RelationType];
|
|
33
|
+
}
|
package/api/resources/contexts/resources/relationships/client/requests/CreateRelationshipRequest.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CreateRelationshipRequest = void 0;
|
|
5
|
+
var CreateRelationshipRequest;
|
|
6
|
+
(function (CreateRelationshipRequest) {
|
|
7
|
+
/** The type of relationship. */
|
|
8
|
+
CreateRelationshipRequest.RelationType = {
|
|
9
|
+
HasMany: "has_many",
|
|
10
|
+
HasOne: "has_one",
|
|
11
|
+
BelongsTo: "belongs_to",
|
|
12
|
+
};
|
|
13
|
+
})(CreateRelationshipRequest || (exports.CreateRelationshipRequest = CreateRelationshipRequest = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
|
|
5
|
+
* relationship: "c3d4e5f6-a7b8-9012-cdef-123456789012"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface DeleteRelationshipsRequest {
|
|
9
|
+
/** The unique identifier for the context. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** The unique identifier for the relationship. */
|
|
12
|
+
relationship: string;
|
|
13
|
+
}
|