Skip to content

Commit f8f5e8c

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
chore(oracle-fusion): align risk integration style and docs manifest
1 parent ca1253f commit f8f5e8c

7 files changed

Lines changed: 467 additions & 137 deletions

File tree

‎apps/sim/blocks/blocks/oracle_fusion_risk_management.ts‎

Lines changed: 197 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,12 @@ export const OracleFusionRiskManagementBlock: BlockConfig = {
997997
title: 'Filter',
998998
type: 'long-input',
999999
mode: 'advanced',
1000-
condition: { field: 'operation', value: listOperations.filter((id) => id !== 'oracle_fusion_risk_management_list_simulation_results') },
1000+
condition: {
1001+
field: 'operation',
1002+
value: listOperations.filter(
1003+
(id) => id !== 'oracle_fusion_risk_management_list_simulation_results'
1004+
),
1005+
},
10011006
placeholder: 'Oracle q expression using queryable fields for this resource',
10021007
wandConfig: {
10031008
enabled: true,
@@ -1006,10 +1011,36 @@ export const OracleFusionRiskManagementBlock: BlockConfig = {
10061011
placeholder: 'Describe which records to retrieve',
10071012
},
10081013
},
1009-
{ id: 'orderBy', title: 'Sort Order', type: 'short-input', mode: 'advanced', condition: { field: 'operation', value: listOperations } },
1010-
{ id: 'limit', title: 'Page Size', type: 'short-input', mode: 'advanced', placeholder: '100', condition: { field: 'operation', value: listOperations } },
1011-
{ id: 'offset', title: 'Offset', type: 'short-input', mode: 'advanced', placeholder: '0', condition: { field: 'operation', value: listOperations } },
1012-
{ id: 'totalResults', title: 'Include Estimated Total', type: 'switch', mode: 'advanced', condition: { field: 'operation', value: listOperations } },
1014+
{
1015+
id: 'orderBy',
1016+
title: 'Sort Order',
1017+
type: 'short-input',
1018+
mode: 'advanced',
1019+
condition: { field: 'operation', value: listOperations },
1020+
},
1021+
{
1022+
id: 'limit',
1023+
title: 'Page Size',
1024+
type: 'short-input',
1025+
mode: 'advanced',
1026+
placeholder: '100',
1027+
condition: { field: 'operation', value: listOperations },
1028+
},
1029+
{
1030+
id: 'offset',
1031+
title: 'Offset',
1032+
type: 'short-input',
1033+
mode: 'advanced',
1034+
placeholder: '0',
1035+
condition: { field: 'operation', value: listOperations },
1036+
},
1037+
{
1038+
id: 'totalResults',
1039+
title: 'Include Estimated Total',
1040+
type: 'switch',
1041+
mode: 'advanced',
1042+
condition: { field: 'operation', value: listOperations },
1043+
},
10131044
],
10141045
tools: {
10151046
access: [
@@ -1132,12 +1163,20 @@ export const OracleFusionRiskManagementBlock: BlockConfig = {
11321163
config: {
11331164
tool: (params) => {
11341165
const operation = params.operation
1135-
if (typeof operation !== 'string' || !Object.hasOwn(RISK_OPERATIONS, operation)) throw new Error('Select a Risk Management operation')
1166+
if (typeof operation !== 'string' || !Object.hasOwn(RISK_OPERATIONS, operation)) {
1167+
throw new Error('Select a Risk Management operation')
1168+
}
11361169
return operation
11371170
},
11381171
params: (params) => {
1139-
if (typeof params.operation !== 'string' || !Object.hasOwn(RISK_OPERATIONS, params.operation)) throw new Error('Select a Risk Management operation')
1140-
const definition: RiskOperationDefinition = RISK_OPERATIONS[params.operation as keyof typeof RISK_OPERATIONS]
1172+
if (
1173+
typeof params.operation !== 'string' ||
1174+
!Object.hasOwn(RISK_OPERATIONS, params.operation)
1175+
) {
1176+
throw new Error('Select a Risk Management operation')
1177+
}
1178+
const definition: RiskOperationDefinition =
1179+
RISK_OPERATIONS[params.operation as keyof typeof RISK_OPERATIONS]
11411180
const result: Record<string, unknown> = {}
11421181
for (const field of definition.params) {
11431182
const value = params[field]
@@ -1150,8 +1189,16 @@ export const OracleFusionRiskManagementBlock: BlockConfig = {
11501189
const value = params[field]
11511190
if (typeof value === 'string' && value.trim()) result[field] = value.trim()
11521191
}
1153-
const limit = parseOptionalNumberInput(params.limit, 'Page size', { integer: true, min: 1, max: 100 })
1154-
const offset = parseOptionalNumberInput(params.offset, 'Offset', { integer: true, min: 0, max: 1_000_000 })
1192+
const limit = parseOptionalNumberInput(params.limit, 'Page size', {
1193+
integer: true,
1194+
min: 1,
1195+
max: 100,
1196+
})
1197+
const offset = parseOptionalNumberInput(params.offset, 'Offset', {
1198+
integer: true,
1199+
min: 0,
1200+
max: 1_000_000,
1201+
})
11551202
const totalResults = parseOptionalBooleanInput(params.totalResults)
11561203
if (limit !== undefined) result.limit = limit
11571204
if (offset !== undefined) result.offset = offset
@@ -1165,56 +1212,168 @@ export const OracleFusionRiskManagementBlock: BlockConfig = {
11651212
operation: { type: 'string', description: 'Selected Risk Management action' },
11661213
oauthCredential: { type: 'string', description: 'Oracle Fusion service-account credential' },
11671214
actionItemId: { type: 'string', description: 'Exact decimal identifier as a string' },
1168-
activityKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1215+
activityKey: {
1216+
type: 'string',
1217+
description:
1218+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1219+
},
11691220
advancedControlId: { type: 'string', description: 'Oracle identifier as a string' },
1170-
assertionKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1171-
attributeKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1221+
assertionKey: {
1222+
type: 'string',
1223+
description:
1224+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1225+
},
1226+
attributeKey: {
1227+
type: 'string',
1228+
description:
1229+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1230+
},
11721231
commentId: { type: 'string', description: 'Exact decimal identifier as a string' },
1173-
commentKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1174-
controlAssessmentResultId: { type: 'string', description: 'Exact decimal identifier as a string' },
1232+
commentKey: {
1233+
type: 'string',
1234+
description:
1235+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1236+
},
1237+
controlAssessmentResultId: {
1238+
type: 'string',
1239+
description:
1240+
'Exact decimal identifier as a string',
1241+
},
11751242
controlId: { type: 'string', description: 'Exact decimal identifier as a string' },
1176-
groupKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1177-
incidentKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1243+
groupKey: {
1244+
type: 'string',
1245+
description:
1246+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1247+
},
1248+
incidentKey: {
1249+
type: 'string',
1250+
description:
1251+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1252+
},
11781253
issueId: { type: 'string', description: 'Exact decimal identifier as a string' },
11791254
jobId: { type: 'string', description: 'Exact decimal identifier as a string' },
11801255
memberId: { type: 'string', description: 'Exact decimal identifier as a string' },
1181-
openIncidentKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1182-
perspectiveKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1183-
processAssessmentResultId: { type: 'string', description: 'Exact decimal identifier as a string' },
1256+
openIncidentKey: {
1257+
type: 'string',
1258+
description:
1259+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1260+
},
1261+
perspectiveKey: {
1262+
type: 'string',
1263+
description:
1264+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1265+
},
1266+
processAssessmentResultId: {
1267+
type: 'string',
1268+
description:
1269+
'Exact decimal identifier as a string',
1270+
},
11841271
processId: { type: 'string', description: 'Exact decimal identifier as a string' },
1185-
provisioningInfo: { type: 'json', description: 'JSON object mapping role codes to arrays of data-access scope strings. Supported scope kinds: BUSINESS_UNIT, LEDGER_SET, DATA_ACCESS_SET, ASSET_BOOK, REFERENCE_DATA_SET. Maximum 100 roles and 100 scopes per role. This runs analysis only; it grants no access and creates no incidents.' },
1186-
relationshipKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1187-
requestId: { type: 'string', description: 'Simulation request identifier returned by Run Access Simulation, preserved as a decimal string' },
1188-
riskAssessmentResultId: { type: 'string', description: 'Exact decimal identifier as a string' },
1272+
provisioningInfo: {
1273+
type: 'json',
1274+
description:
1275+
'JSON object mapping role codes to arrays of data-access scope strings. Supported scope kinds: BUSINESS_UNIT, LEDGER_SET, DATA_ACCESS_SET, ASSET_BOOK, REFERENCE_DATA_SET. Maximum 100 roles and 100 scopes per role. This runs analysis only; it grants no access and creates no incidents.',
1276+
},
1277+
relationshipKey: {
1278+
type: 'string',
1279+
description:
1280+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1281+
},
1282+
requestId: {
1283+
type: 'string',
1284+
description:
1285+
'Simulation request identifier returned by Run Access Simulation, preserved as a decimal string',
1286+
},
1287+
riskAssessmentResultId: {
1288+
type: 'string',
1289+
description:
1290+
'Exact decimal identifier as a string',
1291+
},
11891292
riskId: { type: 'string', description: 'Exact decimal identifier as a string' },
1190-
roleTypeKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1191-
securableTypeKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1192-
securityAssignmentId: { type: 'string', description: 'Exact decimal identifier as a string' },
1193-
simulationResultKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1293+
roleTypeKey: {
1294+
type: 'string',
1295+
description:
1296+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1297+
},
1298+
securableTypeKey: {
1299+
type: 'string',
1300+
description:
1301+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1302+
},
1303+
securityAssignmentId: {
1304+
type: 'string',
1305+
description:
1306+
'Exact decimal identifier as a string',
1307+
},
1308+
simulationResultKey: {
1309+
type: 'string',
1310+
description:
1311+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1312+
},
11941313
stepId: { type: 'string', description: 'Exact decimal identifier as a string' },
11951314
testPlanId: { type: 'string', description: 'Exact decimal identifier as a string' },
11961315
treeId: { type: 'string', description: 'Exact decimal identifier as a string' },
1197-
userKey: { type: 'string', description: 'Opaque key returned by the corresponding list action; retain the same parent identifiers' },
1198-
userName: { type: 'string', description: 'Exact Oracle Security Console username whose existing and proposed access will be simulated' },
1199-
body: { type: 'json', description: 'Documented writable fields for the selected action; quote integer IDs and include required fields described by the tool' },
1316+
userKey: {
1317+
type: 'string',
1318+
description:
1319+
'Opaque key returned by the corresponding list action; retain the same parent identifiers',
1320+
},
1321+
userName: {
1322+
type: 'string',
1323+
description:
1324+
'Exact Oracle Security Console username whose existing and proposed access will be simulated',
1325+
},
1326+
body: {
1327+
type: 'json',
1328+
description:
1329+
'Documented writable fields for the selected action; quote integer IDs and include required fields described by the tool',
1330+
},
12001331
q: { type: 'string', description: 'Oracle resource filter' },
12011332
orderBy: { type: 'string', description: 'Oracle resource sort order' },
12021333
limit: { type: 'number', description: 'One page of 1-100 records' },
12031334
offset: { type: 'number', description: 'Zero-based page offset' },
1204-
totalResults: { type: 'boolean', description: 'Request estimated total count' },
1335+
totalResults: {
1336+
type: 'boolean',
1337+
description:
1338+
'Request estimated total count',
1339+
},
12051340
},
12061341
outputs: {
1207-
record: { type: 'json', description: 'Selected compliance record, relationship, assessment result, incident, or assignment. Fields depend on the action; identifiers and numeric resource attributes are strings.' },
1208-
items: { type: 'json', description: 'One bounded page of projected records with documented identifiers, names, status, and resource-specific fields' },
1342+
record: {
1343+
type: 'json',
1344+
description:
1345+
'Selected compliance record, relationship, assessment result, incident, or assignment. Fields depend on the action; identifiers and numeric resource attributes are strings.',
1346+
},
1347+
items: {
1348+
type: 'json',
1349+
description:
1350+
'One bounded page of projected records with documented identifiers, names, status, and resource-specific fields',
1351+
},
12091352
count: { type: 'number', description: 'Records in the returned page' },
12101353
hasMore: { type: 'boolean', description: 'Whether another page is available' },
12111354
limit: { type: 'number', description: 'Oracle page limit' },
12121355
offset: { type: 'number', description: 'Offset of this page' },
1213-
nextOffset: { type: 'number', description: 'Offset for the next explicit request when another page exists' },
1214-
totalResults: { type: 'number', description: 'Estimated total count when requested and returned' },
1356+
nextOffset: {
1357+
type: 'number',
1358+
description:
1359+
'Offset for the next explicit request when another page exists',
1360+
},
1361+
totalResults: {
1362+
type: 'number',
1363+
description:
1364+
'Estimated total count when requested and returned',
1365+
},
12151366
deleted: { type: 'boolean', description: 'Deletion acknowledged by Oracle for delete actions' },
1216-
requestId: { type: 'string', description: 'Submitted access-simulation tracking ID; analysis may still be pending' },
1217-
status: { type: 'string', description: 'Simulation job status returned by Get Access Simulation Status' },
1367+
requestId: {
1368+
type: 'string',
1369+
description:
1370+
'Submitted access-simulation tracking ID; analysis may still be pending',
1371+
},
1372+
status: {
1373+
type: 'string',
1374+
description:
1375+
'Simulation job status returned by Get Access Simulation Status',
1376+
},
12181377
},
12191378
}
12201379

‎apps/sim/lib/copilot/generated/docs-manifest.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ export const DOCS_MANIFEST: readonly string[] = [
243243
'integrations/onedrive.mdx',
244244
'integrations/onepassword.mdx',
245245
'integrations/openai.mdx',
246+
'integrations/oracle_fusion_risk_management.mdx',
246247
'integrations/outlook.mdx',
247248
'integrations/pagerduty.mdx',
248249
'integrations/parallel_ai.mdx',

‎apps/sim/lib/internal/oracle-fusion-risk-management/operations.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,9 @@ export async function executeRiskOperation(
644644
(record.ControlId !== params.controlId ||
645645
record.AssertionCode !== (body as { AssertionCode: string }).AssertionCode)
646646
) {
647-
throw new RiskResponseError('Oracle Fusion returned a different control assertion than requested')
647+
throw new RiskResponseError(
648+
'Oracle Fusion returned a different control assertion than requested'
649+
)
648650
}
649651
return { success: true, output: { record } }
650652
}

0 commit comments

Comments
 (0)