diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2891e958..0edcf48c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,3 +19,6 @@ jobs: - name: Run Lint run: bun lint + + - name: Run Build + run: bun run build diff --git a/.oas/hris.json b/.oas/hris.json index d7114de2..e1f34a78 100644 --- a/.oas/hris.json +++ b/.oas/hris.json @@ -1348,7 +1348,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,employee_id,remote_employee_id,approver_id,remote_approver_id,status,type,start_date,end_date,start_half_day,end_half_day,duration,created_at,updated_at", + "example": "id,remote_id,employee_id,remote_employee_id,approver_id,remote_approver_id,status,type,start_date,end_date,start_half_day,end_half_day,duration,time_off_policy_id,remote_time_off_policy_id,reason,created_at,updated_at", "type": "string" } }, @@ -1651,7 +1651,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,employee_id,remote_employee_id,approver_id,remote_approver_id,status,type,start_date,end_date,start_half_day,end_half_day,duration,created_at,updated_at", + "example": "id,remote_id,employee_id,remote_employee_id,approver_id,remote_approver_id,status,type,start_date,end_date,start_half_day,end_half_day,duration,time_off_policy_id,remote_time_off_policy_id,reason,created_at,updated_at", "type": "string" } } @@ -4705,7 +4705,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,employee_id,remote_employee_id,approver_id,remote_approver_id,status,type,start_date,end_date,start_half_day,end_half_day,duration,created_at,updated_at", + "example": "id,remote_id,employee_id,remote_employee_id,approver_id,remote_approver_id,status,type,start_date,end_date,start_half_day,end_half_day,duration,time_off_policy_id,remote_time_off_policy_id,reason,created_at,updated_at", "type": "string" } }, @@ -4992,7 +4992,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,employee_id,remote_employee_id,approver_id,remote_approver_id,status,type,start_date,end_date,start_half_day,end_half_day,duration,created_at,updated_at", + "example": "id,remote_id,employee_id,remote_employee_id,approver_id,remote_approver_id,status,type,start_date,end_date,start_half_day,end_half_day,duration,time_off_policy_id,remote_time_off_policy_id,reason,created_at,updated_at", "type": "string" } } @@ -8074,7 +8074,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,name,description,type,updated_at,created_at", + "example": "id,remote_id,name,description,type,duration_unit,reasons,updated_at,created_at", "type": "string" } }, @@ -8270,7 +8270,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,name,description,type,updated_at,created_at", + "example": "id,remote_id,name,description,type,duration_unit,reasons,updated_at,created_at", "type": "string" } } @@ -9557,6 +9557,7 @@ "division", "group", "project", + "team", null ], "example": "department", @@ -12891,6 +12892,20 @@ ], "nullable": true }, + "time_off_policy_id": { + "type": "string", + "description": "The time off policy id associated with this time off request", + "example": "cx280928933", + "nullable": true + }, + "reason": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Reason" + } + ] + }, "passthrough": { "type": "object", "description": "Value to pass through to the provider", @@ -19343,6 +19358,27 @@ "url" ] }, + "Reason": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "nullable": true + }, + "remote_id": { + "type": "string", + "description": "Provider's unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true + } + } + }, "Reference": { "type": "object", "properties": { @@ -19811,6 +19847,26 @@ "format": "duration", "nullable": true }, + "time_off_policy_id": { + "type": "string", + "description": "The time off policy id associated with this time off request", + "example": "cx280928933", + "nullable": true + }, + "remote_time_off_policy_id": { + "type": "string", + "description": "Provider's unique identifier of the time off policy id associated with this time off request", + "example": "e3cb75bf-aa84-466e-a6c1-b8322b257a48", + "nullable": true + }, + "reason": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Reason" + } + ] + }, "created_date": { "type": "string", "description": "The created date of the time off request", @@ -19978,7 +20034,7 @@ "unknown", null ], - "description": "The unified value for the duration unit of the time off balance. If the provider does not specify this unit, the value will be set to unknown", + "description": "The unified value for the duration unit. If the provider does not specify this unit, the value will be set to unknown", "example": "hours", "x-speakeasy-unknown-values": "allow", "nullable": true @@ -20073,6 +20129,23 @@ } ] }, + "duration_unit": { + "description": "The duration unit of the current policy", + "example": "hours", + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/TimeOffBalanceUnitEnum" + } + ] + }, + "reasons": { + "nullable": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/Reason" + } + }, "created_at": { "type": "string", "description": "The created_at date of this policy", diff --git a/.oas/lms.json b/.oas/lms.json index 705b9ad2..e4b7ac4a 100644 --- a/.oas/lms.json +++ b/.oas/lms.json @@ -130,7 +130,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,external_reference,content_ids,remote_content_ids,title,description,languages,cover_url,url,active,duration,categories,skills,updated_at,created_at,content,provider", + "example": "id,remote_id,external_reference,content_ids,remote_content_ids,title,description,languages,cover_url,url,active,duration,categories,skills,updated_at,created_at,content,provider,localizations", "type": "string" } }, @@ -407,7 +407,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,external_reference,content_ids,remote_content_ids,title,description,languages,cover_url,url,active,duration,categories,skills,updated_at,created_at,content,provider", + "example": "id,remote_id,external_reference,content_ids,remote_content_ids,title,description,languages,cover_url,url,active,duration,categories,skills,updated_at,created_at,content,provider,localizations", "type": "string" } } @@ -1043,7 +1043,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,external_reference,course_ids,remote_course_ids,title,description,additional_data,languages,content_url,mobile_launch_content_url,content_type,cover_url,active,duration,order,categories,skills,updated_at,created_at,provider,localisations,tags", + "example": "id,remote_id,external_reference,course_ids,remote_course_ids,title,description,additional_data,languages,content_url,mobile_launch_content_url,content_type,cover_url,active,duration,order,categories,skills,updated_at,created_at,provider,localizations,tags", "type": "string" } }, @@ -1320,7 +1320,7 @@ "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", "schema": { "nullable": true, - "example": "id,remote_id,external_reference,course_ids,remote_course_ids,title,description,additional_data,languages,content_url,mobile_launch_content_url,content_type,cover_url,active,duration,order,categories,skills,updated_at,created_at,provider,localisations,tags", + "example": "id,remote_id,external_reference,course_ids,remote_course_ids,title,description,additional_data,languages,content_url,mobile_launch_content_url,content_type,cover_url,active,duration,order,categories,skills,updated_at,created_at,provider,localizations,tags", "type": "string" } } @@ -4346,14 +4346,6 @@ "example": "This video acts as learning content for software engineers.", "nullable": true }, - "additional_data": { - "description": "The additional_data associated with this content", - "nullable": true, - "type": "array", - "items": { - "$ref": "#/components/schemas/AdditionalData" - } - }, "languages": { "description": "The languages associated with this content", "nullable": true, @@ -4450,7 +4442,7 @@ "deprecated": true, "nullable": true }, - "localisations": { + "localizations": { "description": "Localised content information", "example": [ { @@ -4465,7 +4457,7 @@ "nullable": true, "type": "array", "items": { - "$ref": "#/components/schemas/LocalisationModel" + "$ref": "#/components/schemas/LocalizationModel" } }, "tags": { @@ -5746,14 +5738,6 @@ "example": "This video acts as learning content for software engineers.", "nullable": true }, - "additional_data": { - "description": "The additional_data associated with this content", - "nullable": true, - "type": "array", - "items": { - "$ref": "#/components/schemas/AdditionalData" - } - }, "languages": { "description": "The languages associated with this content", "nullable": true, @@ -5830,12 +5814,20 @@ "deprecated": true, "nullable": true }, - "localisations": { - "description": "Localised content information", + "localizations": { + "description": "The localization data for this course", "example": [ { "title": "Software Engineer Lv 1", - "description": "This video acts as learning content for software engineers.", + "description": "This course acts as learning resource for software engineers.", + "languages": { + "value": "en-GB", + "source_value": "string" + } + }, + { + "title": "Software Engineer: A comprehensive guide", + "description": "This course acts as learning resource for software engineers.", "languages": { "value": "en-US", "source_value": "string" @@ -5845,7 +5837,7 @@ "nullable": true, "type": "array", "items": { - "$ref": "#/components/schemas/LocalisationModel" + "$ref": "#/components/schemas/LocalizationModel" } }, "tags": { @@ -5881,6 +5873,14 @@ "items": { "$ref": "#/components/schemas/CreateCategoriesApiModel" } + }, + "additional_data": { + "description": "The additional_data associated with this content", + "nullable": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/AdditionalData" + } } } }, @@ -5971,6 +5971,32 @@ "items": { "$ref": "#/components/schemas/CreateContentApiModel" } + }, + "localizations": { + "description": "The localization data for this course", + "example": [ + { + "title": "Software Engineer Lv 1", + "description": "This course acts as learning resource for software engineers.", + "languages": { + "value": "en-GB", + "source_value": "string" + } + }, + { + "title": "Software Engineer: A comprehensive guide", + "description": "This course acts as learning resource for software engineers.", + "languages": { + "value": "en-US", + "source_value": "string" + } + } + ], + "nullable": true, + "type": "array", + "items": { + "$ref": "#/components/schemas/LocalizationModel" + } } } }, @@ -6045,7 +6071,7 @@ } } }, - "LocalisationModel": { + "LocalizationModel": { "type": "object", "properties": { "title": { @@ -6061,7 +6087,7 @@ "nullable": true }, "language": { - "description": "The language associated with this localisation details", + "description": "The language associated with the localization details", "nullable": true, "allOf": [ { diff --git a/src/openapi/tests/__snapshots__/openapi-parser.spec.ts.snap b/src/openapi/tests/__snapshots__/openapi-parser.spec.ts.snap index a169c138..11bbbdf4 100644 --- a/src/openapi/tests/__snapshots__/openapi-parser.spec.ts.snap +++ b/src/openapi/tests/__snapshots__/openapi-parser.spec.ts.snap @@ -26,7 +26,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/upload/batch", }, - "name": "hris_batch_upload_employee_document", "parameters": { "properties": { "id": { @@ -1642,7 +1641,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees", }, - "name": "hris_create_employee", "parameters": { "properties": { "avatar": { @@ -12405,7 +12403,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/employments", }, - "name": "hris_create_employee_employment", "parameters": { "properties": { "effective_date": { @@ -12706,7 +12703,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", }, - "name": "hris_create_employee_skill", "parameters": { "properties": { "id": { @@ -12912,7 +12908,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off", }, - "name": "hris_create_employee_time_off_request", "parameters": { "properties": { "approver_id": { @@ -13149,7 +13144,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/work_eligibility", }, - "name": "hris_create_employee_work_eligibility_request", "parameters": { "properties": { "document": { @@ -16193,7 +16187,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_off", }, - "name": "hris_create_time_off_request", "parameters": { "properties": { "approver_id": { @@ -16395,7 +16388,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/{subResourceId}/download", }, - "name": "hris_download_employee_document", "parameters": { "properties": { "format": { @@ -16456,7 +16448,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/benefits/{id}", }, - "name": "hris_get_benefit", "parameters": { "properties": { "fields": { @@ -16525,7 +16516,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/companies/{id}", }, - "name": "hris_get_company", "parameters": { "properties": { "fields": { @@ -16594,7 +16584,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/groups/cost_centers/{id}", }, - "name": "hris_get_cost_center_group", "parameters": { "properties": { "fields": { @@ -16663,7 +16652,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/groups/departments/{id}", }, - "name": "hris_get_department_group", "parameters": { "properties": { "fields": { @@ -16742,7 +16730,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}", }, - "name": "hris_get_employee", "parameters": { "properties": { "expand": { @@ -16848,7 +16835,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/custom_field_definitions/employees/{id}", }, - "name": "hris_get_employee_custom_field_definition", "parameters": { "properties": { "fields": { @@ -16958,7 +16944,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/{subResourceId}", }, - "name": "hris_get_employee_document", "parameters": { "properties": { "fields": { @@ -17031,7 +17016,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/documents/employee_categories/{id}", }, - "name": "hris_get_employee_document_category", "parameters": { "properties": { "fields": { @@ -17110,7 +17094,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/employments/{subResourceId}", }, - "name": "hris_get_employee_employment", "parameters": { "properties": { "expand": { @@ -17194,7 +17177,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/skills/{subResourceId}", }, - "name": "hris_get_employee_skill", "parameters": { "properties": { "fields": { @@ -17277,7 +17259,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off_balances/{subResourceId}", }, - "name": "hris_get_employee_time_off_balance", "parameters": { "properties": { "expand": { @@ -17361,7 +17342,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off/{subResourceId}", }, - "name": "hris_get_employees_time_off_request", "parameters": { "properties": { "fields": { @@ -17439,7 +17419,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/work_eligibility/{subResourceId}", }, - "name": "hris_get_employees_work_eligibility", "parameters": { "properties": { "fields": { @@ -17517,7 +17496,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employments/{id}", }, - "name": "hris_get_employment", "parameters": { "properties": { "expand": { @@ -17592,7 +17570,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/groups/{id}", }, - "name": "hris_get_group", "parameters": { "properties": { "fields": { @@ -17661,7 +17638,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/jobs/{id}", }, - "name": "hris_get_job", "parameters": { "properties": { "fields": { @@ -17730,7 +17706,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/locations/{id}", }, - "name": "hris_get_location", "parameters": { "properties": { "fields": { @@ -17799,7 +17774,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/groups/teams/{id}", }, - "name": "hris_get_team_group", "parameters": { "properties": { "fields": { @@ -17868,7 +17842,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_entries/{id}", }, - "name": "hris_get_time_entries", "parameters": { "properties": { "fields": { @@ -17937,7 +17910,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_off_policies/{id}", }, - "name": "hris_get_time_off_policy", "parameters": { "properties": { "fields": { @@ -18006,7 +17978,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_off/{id}", }, - "name": "hris_get_time_off_request", "parameters": { "properties": { "fields": { @@ -18075,7 +18046,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_off_types/{id}", }, - "name": "hris_get_time_off_type", "parameters": { "properties": { "fields": { @@ -18134,7 +18104,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/invite", }, - "name": "hris_invite_employee", "parameters": { "properties": { "id": { @@ -18214,7 +18183,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/benefits", }, - "name": "hris_list_benefits", "parameters": { "properties": { "fields": { @@ -18334,7 +18302,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/companies", }, - "name": "hris_list_companies", "parameters": { "properties": { "fields": { @@ -18454,7 +18421,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/groups/cost_centers", }, - "name": "hris_list_cost_center_groups", "parameters": { "properties": { "fields": { @@ -18574,7 +18540,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/groups/departments", }, - "name": "hris_list_department_groups", "parameters": { "properties": { "fields": { @@ -18694,7 +18659,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/documents/employee_categories", }, - "name": "hris_list_employee_categories", "parameters": { "properties": { "fields": { @@ -18814,7 +18778,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/custom_field_definitions/employees", }, - "name": "hris_list_employee_custom_field_definitions", "parameters": { "properties": { "fields": { @@ -18939,7 +18902,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents", }, - "name": "hris_list_employee_documents", "parameters": { "properties": { "fields": { @@ -19074,7 +19036,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/employments", }, - "name": "hris_list_employee_employments", "parameters": { "properties": { "expand": { @@ -19210,7 +19171,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", }, - "name": "hris_list_employee_skills", "parameters": { "properties": { "fields": { @@ -19345,7 +19305,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off_balances", }, - "name": "hris_list_employee_time_off_balances", "parameters": { "properties": { "expand": { @@ -19491,7 +19450,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off", }, - "name": "hris_list_employee_time_off_requests", "parameters": { "properties": { "fields": { @@ -19629,7 +19587,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/work_eligibility", }, - "name": "hris_list_employee_work_eligibility", "parameters": { "properties": { "fields": { @@ -19764,7 +19721,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees", }, - "name": "hris_list_employees", "parameters": { "properties": { "expand": { @@ -19911,7 +19867,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employments", }, - "name": "hris_list_employments", "parameters": { "properties": { "expand": { @@ -20037,7 +19992,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/groups", }, - "name": "hris_list_groups", "parameters": { "properties": { "fields": { @@ -20157,7 +20111,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/jobs", }, - "name": "hris_list_jobs", "parameters": { "properties": { "fields": { @@ -20277,7 +20230,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/locations", }, - "name": "hris_list_locations", "parameters": { "properties": { "fields": { @@ -20397,7 +20349,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/groups/teams", }, - "name": "hris_list_team_groups", "parameters": { "properties": { "fields": { @@ -20517,7 +20468,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_entries", }, - "name": "hris_list_time_entries", "parameters": { "properties": { "fields": { @@ -20657,7 +20607,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_off_policies", }, - "name": "hris_list_time_off_policies", "parameters": { "properties": { "fields": { @@ -20777,7 +20726,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_off", }, - "name": "hris_list_time_off_requests", "parameters": { "properties": { "fields": { @@ -20905,7 +20853,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_off_types", }, - "name": "hris_list_time_off_types", "parameters": { "properties": { "fields": { @@ -21190,7 +21137,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}", }, - "name": "hris_update_employee", "parameters": { "properties": { "avatar": { @@ -31683,7 +31629,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/employments/{subResourceId}", }, - "name": "hris_update_employee_employment", "parameters": { "properties": { "effective_date": { @@ -32018,7 +31963,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/work_eligibility/{subResourceId}", }, - "name": "hris_update_employee_work_eligibility_request", "parameters": { "properties": { "document": { @@ -35071,7 +35015,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/time_off/{id}", }, - "name": "hris_update_time_off_request", "parameters": { "properties": { "approver_id": { @@ -35303,7 +35246,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/upload", }, - "name": "hris_upload_employee_document", "parameters": { "properties": { "category": { diff --git a/src/toolsets/stackone.ts b/src/toolsets/stackone.ts index 9e936c1b..66d2deb1 100644 --- a/src/toolsets/stackone.ts +++ b/src/toolsets/stackone.ts @@ -1,5 +1,7 @@ import { OAS_DIR } from '../constants'; -import { StackOneTool, type ToolDefinition } from '../tools'; +import { loadSpecs } from '../openapi/loader'; +import { StackOneTool, type ToolDefinition, type Tools } from '../tools'; +import type { ParameterTransformer } from '../types'; import { extractFileInfo, isValidFilePath, readFileAsBase64 } from '../utils/file'; import { removeJsonSchemaProperty } from '../utils/schema'; import { type BaseToolSetConfig, ToolSet, ToolSetError } from './base'; @@ -51,8 +53,8 @@ export class StackOneToolSet extends ToolSet { throw new ToolSetError('file_path must be a string'); } - const fileInfo = extractFileInfo(filePath); - return fileInfo.name; + const { fileName } = extractFileInfo(filePath); + return fileName; }, }, }); @@ -111,7 +113,9 @@ export class StackOneToolSet extends ToolSet { const effectiveAccountId = accountId || this.accountId; // Create headers with account ID if provided - const headers = effectiveAccountId ? { 'x-account-id': effectiveAccountId } : {}; + const headers: Record = effectiveAccountId + ? { 'x-account-id': effectiveAccountId } + : {}; // Get tools with headers return this.getTools(filterPattern, headers); @@ -125,7 +129,7 @@ export class StackOneToolSet extends ToolSet { const specs = loadSpecs(OAS_DIR); // Process each vertical - for (const [vertical, tools] of Object.entries(specs)) { + for (const [_, tools] of Object.entries(specs)) { // Process each tool for (const [toolName, toolDef] of Object.entries(tools)) { // Process derived values @@ -138,15 +142,13 @@ export class StackOneToolSet extends ToolSet { // Create tool const tool = new StackOneTool( - `${vertical}_${toolName}`, - processedDef, - this.baseUrl, - this.authentication + toolName, + processedDef.description, + processedDef.parameters, + processedDef.execute, + this.headers ); - // Set headers - tool.setHeaders(this.headers); - // Add tool to the list this.tools.push(tool); } @@ -171,7 +173,3 @@ export class StackOneToolSet extends ToolSet { } } } - -// Import at the end to avoid circular dependencies -import { loadSpecs } from '../openapi/loader'; -import type { ParameterTransformer } from '../types';