Skip to content

Commit 6a7bce6

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
style(oracle-fusion-learning): apply GitHub lint corrections
1 parent 20fbb86 commit 6a7bce6

16 files changed

Lines changed: 406 additions & 128 deletions

apps/sim/blocks/blocks/oracle_fusion_learning.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ export const OracleFusionLearningBlock: BlockConfig = {
238238
{ text: ', up to', field: 'limit', after: 'per page' },
239239
],
240240
list_assignment_profiles: [
241-
'List Assignment Profiles', { text: ', up to', field: 'limit', after: 'per page' },
241+
'List Assignment Profiles',
242+
{ text: ', up to', field: 'limit', after: 'per page' },
242243
],
243244
get_assignment_profile: [
244245
{
@@ -1063,7 +1064,8 @@ export const OracleFusionLearningBlock: BlockConfig = {
10631064
'contentId',
10641065
] as const) {
10651066
const value = rest[key]
1066-
if (value == null || (typeof value === 'string' && value.trim() === '')) rest[key] = undefined
1067+
if (value == null || (typeof value === 'string' && value.trim() === ''))
1068+
rest[key] = undefined
10671069
}
10681070
for (const key of ['limit', 'offset'] as const) {
10691071
if (typeof rest[key] === 'string') rest[key] = Number(rest[key])
@@ -1115,13 +1117,15 @@ export const OracleFusionLearningBlock: BlockConfig = {
11151117
criterionId: { type: 'string', description: 'criterionId' },
11161118
audienceId: { type: 'string', description: 'audienceId' },
11171119
contentId: { type: 'string', description: 'contentId' },
1118-
body: { type: 'json', description: 'Documented writable fields, with string IDs and explicit nulls' },
1120+
body: {
1121+
type: 'json',
1122+
description: 'Documented writable fields, with string IDs and explicit nulls',
1123+
},
11191124
},
11201125
outputs: {
11211126
item: {
11221127
type: 'json',
1123-
description:
1124-
'Projected Learning resource with IDs, metadata, and applicable lifecycle state',
1128+
description: 'Projected Learning resource with IDs, metadata, and applicable lifecycle state',
11251129
condition: { field: 'operation', value: ITEM_OPERATIONS },
11261130
},
11271131
items: {
@@ -1282,7 +1286,8 @@ export const OracleFusionLearningBlockMeta = {
12821286
},
12831287
{
12841288
name: 'oracle-learning-process-administrator-assignment-profiles',
1285-
description: 'Process administrator assignment profiles using documented Fusion Learning APIs.',
1289+
description:
1290+
'Process administrator assignment profiles using documented Fusion Learning APIs.',
12861291
content:
12871292
'# Process administrator assignment profiles\n\n## Steps\n\nBuild a workflow that creates a Learning assignment profile, adds documented selection criteria, requests processing, and separately reads assignment-profile records to report actual processing outcomes.\n\n## Output and Guidance\n\nUse the authorized Fusion credential and tenant lookup codes. Keep IDs as strings, read one requested page, and distinguish acknowledgements from final assignment outcomes. Oracle roles and lifecycle rules remain authoritative.\n\nSource: https://docs.oracle.com/en/cloud/saas/human-resources/farws/op-learningassignmentprofiles-learningassignmentprofilesuniqid-action-process-post.html',
12881293
},

apps/sim/lib/internal/oracle-fusion-learning/execute-tool.test.ts

Lines changed: 73 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -156,31 +156,79 @@ describe('Learning operation dispatch', () => {
156156
],
157157
['list_enrollment_history', 'executeListEnrollmentHistory', { personId: '1', recordId: '1' }],
158158
['list_assignment_profiles', 'executeListAssignmentProfiles', {}],
159-
['get_assignment_profile', 'executeGetAssignmentProfile', {"profileId":"1"}],
160-
['create_assignment_profile', 'executeCreateAssignmentProfile', {"body":{"assignmentProfileStatus":"TEST_STATUS","assignmentType":"ORA_REQUIRE_ASSIGNMENT","learningItemId":"3"}}],
161-
['update_assignment_profile', 'executeUpdateAssignmentProfile', {"profileId":"1","body":{"completionComments":null}}],
162-
['process_assignment_profile', 'executeProcessAssignmentProfile', {"profileId":"1"}],
163-
['list_assignment_profile_records', 'executeListAssignmentProfileRecords', {"profileId":"1"}],
164-
['list_assignment_profile_criteria', 'executeListAssignmentProfileCriteria', {"profileId":"1"}],
165-
['add_assignment_profile_criterion', 'executeAddAssignmentProfileCriterion', {"profileId":"1","body":{"assignmentProfileCriteriaTypeId":"5"}}],
166-
['remove_assignment_profile_criterion', 'executeRemoveAssignmentProfileCriterion', {"profileId":"1","criterionId":"1"}],
167-
['list_learning_item_audiences', 'executeListLearningItemAudiences', {"learningItemId":"1"}],
168-
['add_learning_item_audience', 'executeAddLearningItemAudience', {"learningItemId":"1","body":{"sourceType":"ORA_PERSON","sourceTypeId":"6","learningItemType":"TEST_TYPE"}}],
169-
['remove_learning_item_audience', 'executeRemoveLearningItemAudience', {"learningItemId":"1","audienceId":"1"}],
170-
['get_content_item', 'executeGetContentItem', {"contentId":"1"}],
171-
['create_web_link_content', 'executeCreateWebLinkContent', {"body":{"Title":"Web course","URL":"https://example.com"}}],
172-
['update_content_item', 'executeUpdateContentItem', {"contentId":"1","body":{"Description":null}}],
159+
['get_assignment_profile', 'executeGetAssignmentProfile', { profileId: '1' }],
160+
[
161+
'create_assignment_profile',
162+
'executeCreateAssignmentProfile',
163+
{
164+
body: {
165+
assignmentProfileStatus: 'TEST_STATUS',
166+
assignmentType: 'ORA_REQUIRE_ASSIGNMENT',
167+
learningItemId: '3',
168+
},
169+
},
170+
],
171+
[
172+
'update_assignment_profile',
173+
'executeUpdateAssignmentProfile',
174+
{ profileId: '1', body: { completionComments: null } },
175+
],
176+
['process_assignment_profile', 'executeProcessAssignmentProfile', { profileId: '1' }],
177+
['list_assignment_profile_records', 'executeListAssignmentProfileRecords', { profileId: '1' }],
178+
['list_assignment_profile_criteria', 'executeListAssignmentProfileCriteria', { profileId: '1' }],
179+
[
180+
'add_assignment_profile_criterion',
181+
'executeAddAssignmentProfileCriterion',
182+
{ profileId: '1', body: { assignmentProfileCriteriaTypeId: '5' } },
183+
],
184+
[
185+
'remove_assignment_profile_criterion',
186+
'executeRemoveAssignmentProfileCriterion',
187+
{ profileId: '1', criterionId: '1' },
188+
],
189+
['list_learning_item_audiences', 'executeListLearningItemAudiences', { learningItemId: '1' }],
190+
[
191+
'add_learning_item_audience',
192+
'executeAddLearningItemAudience',
193+
{
194+
learningItemId: '1',
195+
body: { sourceType: 'ORA_PERSON', sourceTypeId: '6', learningItemType: 'TEST_TYPE' },
196+
},
197+
],
198+
[
199+
'remove_learning_item_audience',
200+
'executeRemoveLearningItemAudience',
201+
{ learningItemId: '1', audienceId: '1' },
202+
],
203+
['get_content_item', 'executeGetContentItem', { contentId: '1' }],
204+
[
205+
'create_web_link_content',
206+
'executeCreateWebLinkContent',
207+
{ body: { Title: 'Web course', URL: 'https://example.com' } },
208+
],
209+
['update_content_item', 'executeUpdateContentItem', { contentId: '1', body: { Description: null } }],
173210
] as const)('dispatches %s through its product schema', async (operation, handler, input) => {
174211
const signal = new AbortController().signal
175-
const response = await invoke({ toolId: `oracle_fusion_learning_${operation}`, input: { ...auth, ...input }, signal })
212+
const response = await invoke({
213+
toolId: `oracle_fusion_learning_${operation}`,
214+
input: { ...auth, ...input },
215+
signal,
216+
})
176217
expect(response.status).toBe(200)
177218
expect(mocks[handler]).toHaveBeenCalledWith({ ...auth, ...input }, signal)
178219
})
179220

180221
it('rejects unsupported fields before calling the mutation operation', async () => {
181-
const response = await invoke({ toolId: 'oracle_fusion_learning_update_completion_detail', input: {
182-
...auth, personId: '1', recordId: '2', completionDetailId: '3', body: { completedDate: '2026-09-05' },
183-
} })
222+
const response = await invoke({
223+
toolId: 'oracle_fusion_learning_update_completion_detail',
224+
input: {
225+
...auth,
226+
personId: '1',
227+
recordId: '2',
228+
completionDetailId: '3',
229+
body: { completedDate: '2026-09-05' },
230+
},
231+
})
184232
expect(response.status).toBe(400)
185233
expect(mocks.executeUpdateCompletionDetail).not.toHaveBeenCalled()
186234
})
@@ -200,7 +248,9 @@ describe('Learning operation dispatch', () => {
200248
})
201249
expect(response.status).toBe(500)
202250
expect(await response.json()).toEqual({
203-
success: false, error: 'Oracle Fusion Learning request failed', retryable: false,
251+
success: false,
252+
error: 'Oracle Fusion Learning request failed',
253+
retryable: false,
204254
})
205255
expect(mocks.executeCreateWebLinkContent).toHaveBeenCalledTimes(1)
206256
})
@@ -209,6 +259,9 @@ describe('Learning operation dispatch', () => {
209259
mocks.executeListSelfPacedItems.mockRejectedValue(new Error('private-provider-data'))
210260
const response = await invoke()
211261
expect(response.status).toBe(500)
212-
expect(await response.json()).toEqual({ success: false, error: 'Oracle Fusion Learning request failed' })
262+
expect(await response.json()).toEqual({
263+
success: false,
264+
error: 'Oracle Fusion Learning request failed',
265+
})
213266
})
214267
})

0 commit comments

Comments
 (0)