Skip to content

Commit 2ca64ca

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(oracle-epcm): address independent integration review
1 parent 8a8a394 commit 2ca64ca

10 files changed

Lines changed: 80 additions & 45 deletions

File tree

apps/docs/content/docs/integrations/oracle_epm_enterprise_profitability.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ Run an existing saved metadata import. ZIP entries must match configured dimensi
512512
| --------- | ---- | -------- | ----------- |
513513
| `oauthCredential` | string | Yes | Reusable Oracle EPM service-account credential for an EPCM tenant |
514514
| `applicationName` | string | Yes | Exact EPCM application name |
515-
| `jobName` | string | Yes | Exact saved exchange-job name; optional only with complete ad hoc data parameters |
515+
| `jobName` | string | Yes | Exact saved metadata import job name; an existing job is required |
516516
| `fileName` | string | No | Optional repository ZIP filename overriding the saved job's files |
517517
| `refreshCube` | boolean | No | Override the saved job's cube refresh option |
518518

@@ -537,7 +537,7 @@ Run an existing saved metadata export to a repository ZIP file.
537537
| --------- | ---- | -------- | ----------- |
538538
| `oauthCredential` | string | Yes | Reusable Oracle EPM service-account credential for an EPCM tenant |
539539
| `applicationName` | string | Yes | Exact EPCM application name |
540-
| `jobName` | string | Yes | Exact saved exchange-job name; optional only with complete ad hoc data parameters |
540+
| `jobName` | string | Yes | Exact saved metadata export job name; an existing job is required |
541541
| `fileName` | string | No | Optional output ZIP filename; existing output may be replaced by Oracle |
542542

543543
#### Output

apps/sim/blocks/blocks/oracle_epm_enterprise_profitability.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,7 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
13151315
id: 'offset',
13161316
title: 'Offset',
13171317
type: 'short-input',
1318+
mode: 'advanced',
13181319
condition: {
13191320
field: 'operation',
13201321
value: [
@@ -1329,6 +1330,7 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
13291330
id: 'limit',
13301331
title: 'Limit',
13311332
type: 'short-input',
1333+
mode: 'advanced',
13321334
condition: {
13331335
field: 'operation',
13341336
value: [
@@ -1631,6 +1633,11 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
16311633
id: 'rowMembers',
16321634
title: 'Row Members',
16331635
type: 'long-input',
1636+
wandConfig: {
1637+
enabled: true,
1638+
prompt: `Format the user's explicitly supplied EPCM export row selections as a comma-separated member list, for example Revenue,Expenses, or preserve a supplied expression such as ILvl0Descendants(&RowMembers). Preserve exact tenant names, expressions, and substitution variables. Do not invent selections. Return only the list or expression, without JSON quotes, markdown, or explanation.`,
1639+
placeholder: 'Provide the exact row members or member expression',
1640+
},
16341641
condition: {
16351642
field: 'operation',
16361643
value: ['oracle_epm_enterprise_profitability_export_data'],
@@ -1641,6 +1648,11 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
16411648
id: 'columnMembers',
16421649
title: 'Column Members',
16431650
type: 'long-input',
1651+
wandConfig: {
1652+
enabled: true,
1653+
prompt: `Format the user's explicitly supplied EPCM export column selections as a comma-separated member list, for example Jan,Feb, or preserve a supplied expression such as ILvl0Descendants(&ColumnMembers). Preserve exact tenant names, expressions, and substitution variables. Do not invent selections. Return only the list or expression, without JSON quotes, markdown, or explanation.`,
1654+
placeholder: 'Provide the exact column members or member expression',
1655+
},
16441656
condition: {
16451657
field: 'operation',
16461658
value: ['oracle_epm_enterprise_profitability_export_data'],
@@ -1649,8 +1661,13 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
16491661
},
16501662
{
16511663
id: 'povMembers',
1652-
title: 'Pov Members',
1664+
title: 'POV Members',
16531665
type: 'long-input',
1666+
wandConfig: {
1667+
enabled: true,
1668+
prompt: `Format the user's explicitly supplied EPCM export POV selections as a comma-separated member list, for example Actual,FY26,Working,&Entity. Preserve exact tenant names, member expressions, substitution variables, and dimension order. Do not invent selections. Return only the list or expression, without JSON quotes, markdown, or explanation.`,
1669+
placeholder: 'Provide the exact POV members in cube dimension order',
1670+
},
16541671
condition: {
16551672
field: 'operation',
16561673
value: ['oracle_epm_enterprise_profitability_export_data'],

apps/sim/blocks/registry-maps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,6 @@ export const BLOCK_REGISTRY: Record<string, BlockConfig> = {
590590
mysql: MySQLBlock,
591591
neo4j: Neo4jBlock,
592592
netsuite: NetSuiteBlock,
593-
oracle_epm_enterprise_profitability: OracleEpcmBlock,
594593
new_relic: NewRelicBlock,
595594
note: NoteBlock,
596595
notion: NotionBlock,
@@ -600,6 +599,7 @@ export const BLOCK_REGISTRY: Record<string, BlockConfig> = {
600599
onedrive: OneDriveBlock,
601600
onepassword: OnePasswordBlock,
602601
openai: OpenAIBlock,
602+
oracle_epm_enterprise_profitability: OracleEpcmBlock,
603603
outlook: OutlookBlock,
604604
pagerduty: PagerDutyBlock,
605605
parallel_ai: ParallelBlock,
@@ -913,7 +913,6 @@ export const BLOCK_META_REGISTRY: Record<string, BlockMeta> = {
913913
mysql: MySQLBlockMeta,
914914
neo4j: Neo4jBlockMeta,
915915
netsuite: NetSuiteBlockMeta,
916-
oracle_epm_enterprise_profitability: OracleEpcmBlockMeta,
917916
neverbounce: NeverBounceBlockMeta,
918917
new_relic: NewRelicBlockMeta,
919918
notion: NotionBlockMeta,
@@ -923,6 +922,7 @@ export const BLOCK_META_REGISTRY: Record<string, BlockMeta> = {
923922
onedrive: OneDriveBlockMeta,
924923
onepassword: OnePasswordBlockMeta,
925924
openai: OpenAIBlockMeta,
925+
oracle_epm_enterprise_profitability: OracleEpcmBlockMeta,
926926
outlook: OutlookBlockMeta,
927927
pagerduty: PagerDutyBlockMeta,
928928
parallel_ai: ParallelBlockMeta,

apps/sim/lib/internal/tool-operations/registry.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,13 +1454,13 @@ registerFamily(handlerLoaders, MICROSOFT_AD_TOOL_IDS, async () => {
14541454
registerFamily(handlerLoaders, NETSUITE_TOOL_IDS, async () => {
14551455
return (await import('@/lib/internal/netsuite/execute-tool')).executeNetsuiteTool
14561456
})
1457+
registerFamily(handlerLoaders, OKTA_TOOL_IDS, async () => {
1458+
return (await import('@/lib/internal/okta/execute-tool')).executeOktaTool
1459+
})
14571460
registerFamily(handlerLoaders, ORACLE_EPCM_TOOL_IDS, async () => {
14581461
return (await import('@/lib/internal/oracle-epm-enterprise-profitability/execute-tool'))
14591462
.executeOracleEpcmTool
14601463
})
1461-
registerFamily(handlerLoaders, OKTA_TOOL_IDS, async () => {
1462-
return (await import('@/lib/internal/okta/execute-tool')).executeOktaTool
1463-
})
14641464
registerFamily(handlerLoaders, SALESFORCE_TOOL_IDS, async () => {
14651465
return (await import('@/lib/internal/salesforce/execute-tool')).executeSalesforceTool
14661466
})

apps/sim/tools/generated/tool-metadata.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

apps/sim/tools/oracle_epm_enterprise_profitability/export_metadata.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ export const oracleEpcmExportMetadataTool: InternalToolConfig<
3131
jobName: {
3232
type: 'string',
3333
required: true,
34-
description:
35-
'Exact saved exchange-job name; optional only with complete ad hoc data parameters',
34+
description: 'Exact saved metadata export job name; an existing job is required',
3635
visibility: 'user-or-llm',
3736
},
3837
fileName: {

apps/sim/tools/oracle_epm_enterprise_profitability/import_metadata.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ export const oracleEpcmImportMetadataTool: InternalToolConfig<
3232
jobName: {
3333
type: 'string',
3434
required: true,
35-
description:
36-
'Exact saved exchange-job name; optional only with complete ad hoc data parameters',
35+
description: 'Exact saved metadata import job name; an existing job is required',
3736
visibility: 'user-or-llm',
3837
},
3938
fileName: {

apps/sim/tools/oracle_epm_enterprise_profitability/utils.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@ describe('Oracle EPCM resolved input helpers', () => {
3232
expect(() => assertOracleEpcmJsonBudget(nested, 'Grid')).toThrow('complexity')
3333
expect(() => assertOracleEpcmJsonBudget(Array(200_001).fill(0), 'Grid')).toThrow('complexity')
3434
})
35+
36+
it('counts sparse array slots before schema validation or serialization materializes them', () => {
37+
expect(() => assertOracleEpcmJsonBudget(new Array(200_001), 'Grid')).toThrow('complexity')
38+
})
3539
})

apps/sim/tools/oracle_epm_enterprise_profitability/utils.ts

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,31 @@ export function assertOracleEpcmJsonBudget(value: unknown, label: string): void
6060
throw new Error(`${label} exceeds the 4 MB input limit`)
6161
}
6262
bytes += encoder.encode(next.value).length + 2
63-
} else if (next.value && typeof next.value === 'object') {
64-
const entries = Object.entries(next.value)
65-
if (entries.length + pending.length + nodes > 200_000) {
63+
} else if (Array.isArray(next.value)) {
64+
if (next.value.length + pending.length + nodes > 200_000) {
6665
throw new Error(`${label} exceeds the supported JSON complexity`)
6766
}
68-
bytes += entries.length * 4
69-
for (const [key, child] of entries) {
70-
bytes += key.length
71-
pending.push({ value: child, depth: next.depth + 1 })
67+
bytes += next.value.length * 2
68+
for (let index = 0; index < next.value.length; index++) {
69+
const descriptor = Object.getOwnPropertyDescriptor(next.value, index)
70+
if (descriptor?.get || descriptor?.set) throw new Error(`${label} must be plain JSON`)
71+
pending.push({ value: descriptor?.value, depth: next.depth + 1 })
72+
}
73+
} else if (next.value && typeof next.value === 'object') {
74+
// Enumerate incrementally: Object.entries would copy every property before admission.
75+
for (const key in next.value) {
76+
if (!Object.hasOwn(next.value, key)) continue
77+
if (pending.length + nodes >= 200_000) {
78+
throw new Error(`${label} exceeds the supported JSON complexity`)
79+
}
80+
if (key.length > 4 * 1024 * 1024) {
81+
throw new Error(`${label} exceeds the 4 MB input limit`)
82+
}
83+
bytes += encoder.encode(key).length + 4
84+
if (bytes > 4 * 1024 * 1024) throw new Error(`${label} exceeds the 4 MB input limit`)
85+
const descriptor = Object.getOwnPropertyDescriptor(next.value, key)
86+
if (descriptor?.get || descriptor?.set) throw new Error(`${label} must be plain JSON`)
87+
pending.push({ value: descriptor?.value, depth: next.depth + 1 })
7288
}
7389
} else {
7490
bytes += 8

apps/sim/tools/registry.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8045,31 +8045,6 @@ export const tools: Record<string, ExecutableToolConfig> = {
80458045
netsuite_transform_record: netsuiteTransformRecordTool,
80468046
netsuite_update_record: netsuiteUpdateRecordTool,
80478047
netsuite_upsert_record: netsuiteUpsertRecordTool,
8048-
oracle_epm_enterprise_profitability_list_applications: oracleEpcmListApplicationsTool,
8049-
oracle_epm_enterprise_profitability_get_member: oracleEpcmGetMemberTool,
8050-
oracle_epm_enterprise_profitability_add_member: oracleEpcmAddMemberTool,
8051-
oracle_epm_enterprise_profitability_list_job_definitions: oracleEpcmListJobDefinitionsTool,
8052-
oracle_epm_enterprise_profitability_generate_model_documentation:
8053-
oracleEpcmGenerateModelDocumentationTool,
8054-
oracle_epm_enterprise_profitability_validate_model: oracleEpcmValidateModelTool,
8055-
oracle_epm_enterprise_profitability_calculate_model: oracleEpcmCalculateModelTool,
8056-
oracle_epm_enterprise_profitability_clear_pov: oracleEpcmClearPovTool,
8057-
oracle_epm_enterprise_profitability_copy_pov: oracleEpcmCopyPovTool,
8058-
oracle_epm_enterprise_profitability_delete_pov: oracleEpcmDeletePovTool,
8059-
oracle_epm_enterprise_profitability_get_job_status: oracleEpcmGetJobStatusTool,
8060-
oracle_epm_enterprise_profitability_wait_for_job: oracleEpcmWaitForJobTool,
8061-
oracle_epm_enterprise_profitability_get_job_details: oracleEpcmGetJobDetailsTool,
8062-
oracle_epm_enterprise_profitability_get_child_job_details: oracleEpcmGetChildJobDetailsTool,
8063-
oracle_epm_enterprise_profitability_export_data_slice: oracleEpcmExportDataSliceTool,
8064-
oracle_epm_enterprise_profitability_import_data_slice: oracleEpcmImportDataSliceTool,
8065-
oracle_epm_enterprise_profitability_import_data: oracleEpcmImportDataTool,
8066-
oracle_epm_enterprise_profitability_export_data: oracleEpcmExportDataTool,
8067-
oracle_epm_enterprise_profitability_import_metadata: oracleEpcmImportMetadataTool,
8068-
oracle_epm_enterprise_profitability_export_metadata: oracleEpcmExportMetadataTool,
8069-
oracle_epm_enterprise_profitability_list_files: oracleEpcmListFilesTool,
8070-
oracle_epm_enterprise_profitability_upload_file: oracleEpcmUploadFileTool,
8071-
oracle_epm_enterprise_profitability_download_file: oracleEpcmDownloadFileTool,
8072-
oracle_epm_enterprise_profitability_delete_file: oracleEpcmDeleteFileTool,
80738048
new_relic_create_deployment_event: newRelicCreateDeploymentEventTool,
80748049
new_relic_get_entity: newRelicGetEntityTool,
80758050
new_relic_nrql_query: newRelicNrqlQueryTool,
@@ -9882,6 +9857,31 @@ export const tools: Record<string, ExecutableToolConfig> = {
98829857
datadog_list_services: datadogListServicesTool,
98839858
image_generate: imageGenerateTool,
98849859
openai_image: openAIImageTool,
9860+
oracle_epm_enterprise_profitability_add_member: oracleEpcmAddMemberTool,
9861+
oracle_epm_enterprise_profitability_calculate_model: oracleEpcmCalculateModelTool,
9862+
oracle_epm_enterprise_profitability_clear_pov: oracleEpcmClearPovTool,
9863+
oracle_epm_enterprise_profitability_copy_pov: oracleEpcmCopyPovTool,
9864+
oracle_epm_enterprise_profitability_delete_file: oracleEpcmDeleteFileTool,
9865+
oracle_epm_enterprise_profitability_delete_pov: oracleEpcmDeletePovTool,
9866+
oracle_epm_enterprise_profitability_download_file: oracleEpcmDownloadFileTool,
9867+
oracle_epm_enterprise_profitability_export_data: oracleEpcmExportDataTool,
9868+
oracle_epm_enterprise_profitability_export_data_slice: oracleEpcmExportDataSliceTool,
9869+
oracle_epm_enterprise_profitability_export_metadata: oracleEpcmExportMetadataTool,
9870+
oracle_epm_enterprise_profitability_generate_model_documentation:
9871+
oracleEpcmGenerateModelDocumentationTool,
9872+
oracle_epm_enterprise_profitability_get_child_job_details: oracleEpcmGetChildJobDetailsTool,
9873+
oracle_epm_enterprise_profitability_get_job_details: oracleEpcmGetJobDetailsTool,
9874+
oracle_epm_enterprise_profitability_get_job_status: oracleEpcmGetJobStatusTool,
9875+
oracle_epm_enterprise_profitability_get_member: oracleEpcmGetMemberTool,
9876+
oracle_epm_enterprise_profitability_import_data: oracleEpcmImportDataTool,
9877+
oracle_epm_enterprise_profitability_import_data_slice: oracleEpcmImportDataSliceTool,
9878+
oracle_epm_enterprise_profitability_import_metadata: oracleEpcmImportMetadataTool,
9879+
oracle_epm_enterprise_profitability_list_applications: oracleEpcmListApplicationsTool,
9880+
oracle_epm_enterprise_profitability_list_files: oracleEpcmListFilesTool,
9881+
oracle_epm_enterprise_profitability_list_job_definitions: oracleEpcmListJobDefinitionsTool,
9882+
oracle_epm_enterprise_profitability_upload_file: oracleEpcmUploadFileTool,
9883+
oracle_epm_enterprise_profitability_validate_model: oracleEpcmValidateModelTool,
9884+
oracle_epm_enterprise_profitability_wait_for_job: oracleEpcmWaitForJobTool,
98859885
microsoft_ad_list_users: microsoftAdListUsersTool,
98869886
microsoft_ad_get_user: microsoftAdGetUserTool,
98879887
microsoft_ad_create_user: microsoftAdCreateUserTool,

0 commit comments

Comments
 (0)