diff --git a/examples/experimental-document-handling.ts b/examples/experimental-document-handling.ts new file mode 100644 index 0000000..a8e43fb --- /dev/null +++ b/examples/experimental-document-handling.ts @@ -0,0 +1,387 @@ +/** + * EXPERIMENTAL: Document Handling with Schema Override + PreExecute + * + * This example demonstrates the new experimental schema override + preExecute functionality + * for handling documents from various sources (local files, URLs, databases, etc.) + * + * The new API provides two-stage transformation: + * 1. Schema Override: Changes the tool's input schema at creation time + * 2. PreExecute: Transforms from override schema back to original API format at execution time + * + * This is an experimental feature and the API may change in future versions. + * + * Run this example with: + * bun run examples/experimental-document-handling.ts + */ + +import assert from 'node:assert'; +import * as fs from 'node:fs'; +import * as path from 'node:path'; +import type { JSONSchema7Definition } from 'json-schema'; +import { + type Experimental_PreExecuteFunction, + type Experimental_SchemaOverride, + StackOneToolSet, +} from '../src'; + +const accountId = '45072196112816593343'; + +interface FileFormatParam { + value: string; +} + +interface DocumentParams { + content: string; + name: string; + file_format: FileFormatParam; + [key: string]: unknown; +} + +/** + * EXPERIMENTAL: Schema override for document upload - changes from complex schema to simple doc_id + */ +const createDocumentSchemaOverride = (): Experimental_SchemaOverride => { + return (originalSchema) => { + // Extract only the category from original schema, replace file-related params with doc_id + const newProperties: Record = {}; + + // Keep non-file parameters from original schema + for (const [key, value] of Object.entries(originalSchema.properties)) { + if (!['content', 'name', 'file_format'].includes(key)) { + newProperties[key] = value; + } + } + + // Add simplified document ID parameter + newProperties.doc_id = { + type: 'string', + description: 'Document identifier or file path', + }; + + return { + type: 'object', + properties: newProperties, + required: [ + 'doc_id', + ...(originalSchema.required?.filter( + (r) => !['content', 'name', 'file_format'].includes(r) + ) || []), + ], + }; + }; +}; + +/** + * EXPERIMENTAL: PreExecute function that transforms doc_id back to original file parameters + */ +const createDocumentPreExecute = (allowedPaths: string[]): Experimental_PreExecuteFunction => { + return async (params) => { + const { doc_id, ...otherParams } = params; + + if (typeof doc_id !== 'string') { + throw new Error('doc_id must be a string'); + } + + // Security check: only allow certain paths + const isAllowed = allowedPaths.some((allowedPath) => doc_id.startsWith(allowedPath)); + + if (!isAllowed) { + throw new Error(`Document path not allowed: ${doc_id}`); + } + + if (!fs.existsSync(doc_id)) { + throw new Error(`Document not found: ${doc_id}`); + } + + // Read file and convert to base64 + const fileContent = fs.readFileSync(doc_id); + const base64Content = fileContent.toString('base64'); + const fileName = path.basename(doc_id); + const extension = path.extname(doc_id).slice(1); + + // Transform back to original API format + return { + ...otherParams, + content: base64Content, + name: fileName, + file_format: { value: extension }, + }; + }; +}; + +/** + * EXPERIMENTAL: Schema override for external document references + */ +const createExternalDocumentSchemaOverride = (): Experimental_SchemaOverride => { + return (originalSchema) => { + const newProperties: Record = {}; + + // Keep non-file parameters from original schema + for (const [key, value] of Object.entries(originalSchema.properties)) { + if (!['content', 'name', 'file_format'].includes(key)) { + newProperties[key] = value; + } + } + + // Add external document reference parameter + newProperties.document_reference = { + type: 'string', + description: 'External document reference (S3 key, database ID, etc.)', + }; + + return { + type: 'object', + properties: newProperties, + required: [ + 'document_reference', + ...(originalSchema.required?.filter( + (r) => !['content', 'name', 'file_format'].includes(r) + ) || []), + ], + }; + }; +}; + +/** + * EXPERIMENTAL: PreExecute function for external document fetching + */ +const createExternalDocumentPreExecute = (): Experimental_PreExecuteFunction => { + return async (params) => { + const { document_reference, ...otherParams } = params; + + if (typeof document_reference !== 'string') { + throw new Error('document_reference must be a string'); + } + + // Simulate fetching from external source (S3, database, etc.) + console.log(`Fetching document from external source: ${document_reference}`); + + // In a real implementation, this would fetch from S3, database, etc. + const mockDocumentContent = 'This is a mock document fetched from external source'; + const base64Content = Buffer.from(mockDocumentContent).toString('base64'); + + // Transform back to original API format + return { + ...otherParams, + content: base64Content, + name: `external-doc-${document_reference}.txt`, + file_format: { value: 'txt' }, + }; + }; +}; + +/** + * EXPERIMENTAL: Schema override for multi-source documents (supports both local and external) + */ +const createMultiSourceSchemaOverride = (): Experimental_SchemaOverride => { + return (originalSchema) => { + const newProperties: Record = {}; + + // Keep non-file parameters from original schema + for (const [key, value] of Object.entries(originalSchema.properties)) { + if (!['content', 'name', 'file_format'].includes(key)) { + newProperties[key] = value; + } + } + + // Add both document parameters (user can provide either) + newProperties.doc_id = { + type: 'string', + description: 'Local document path (takes precedence if both provided)', + }; + + newProperties.document_reference = { + type: 'string', + description: 'External document reference (used if doc_id not provided)', + }; + + return { + type: 'object', + properties: newProperties, + required: [ + ...(originalSchema.required?.filter( + (r) => !['content', 'name', 'file_format'].includes(r) + ) || []), + ], + }; + }; +}; + +/** + * EXPERIMENTAL: PreExecute function for multi-source document handling with fallback + */ +const createMultiSourcePreExecute = (localPaths: string[]): Experimental_PreExecuteFunction => { + const localPreExecute = createDocumentPreExecute(localPaths); + const externalPreExecute = createExternalDocumentPreExecute(); + + return async (params) => { + // Try local file first if doc_id is provided + if (params.doc_id) { + try { + return await localPreExecute(params); + } catch (error) { + console.warn(`Local file handler failed: ${error}`); + } + } + + // Fallback to external handler if document_reference is provided + if (params.document_reference) { + return await externalPreExecute(params); + } + + // No document parameters provided + throw new Error('Either doc_id or document_reference must be provided'); + }; +}; + +const experimentalDocumentHandling = async (): Promise => { + // Create a sample file for testing + const sampleFilePath = path.join(__dirname, 'sample-document.txt'); + fs.writeFileSync(sampleFilePath, 'This is an experimental document handling test file.'); + + try { + // Initialize the StackOne toolset + const toolset = new StackOneToolSet(); + + // Get base tools for documents + const tools = toolset.getStackOneTools('hris_*', accountId); + + console.log('🧪 Testing EXPERIMENTAL schema override + preExecute for local files...'); + + // EXPERIMENTAL: Create a tool with schema override and preExecute for local files + const localDocumentTool = tools.getTool('hris_upload_employee_document', { + experimental_schemaOverride: createDocumentSchemaOverride(), + experimental_preExecute: createDocumentPreExecute([__dirname]), + }); + + assert(localDocumentTool !== undefined, 'Local document tool not found'); + + // Use the new simplified schema (doc_id instead of content/name/file_format) + const localFileResult = await localDocumentTool.execute( + { + doc_id: sampleFilePath, // Simplified schema - just document ID + id: 'c28xIQaWQ6MzM5MzczMDA2NzMzMzkwNzIwNA', + category: { value: 'shared' }, + }, + { + dryRun: true, + } + ); + + console.log('✅ Local file schema override + preExecute successful'); + const localParams = localFileResult.mappedParams as Record; + const localDocumentParams = localParams as DocumentParams & Record; + assert( + localDocumentParams.file_format?.value === 'txt', + 'File format was not transformed correctly' + ); + assert( + localDocumentParams.name === 'sample-document.txt', + 'File name was not transformed correctly' + ); + assert( + typeof localDocumentParams.content === 'string', + 'File content was not transformed correctly' + ); + + console.log('🧪 Testing EXPERIMENTAL schema override + preExecute for external documents...'); + + // EXPERIMENTAL: Create a tool for external document references + const externalDocumentTool = tools.getTool('hris_upload_employee_document', { + experimental_schemaOverride: createExternalDocumentSchemaOverride(), + experimental_preExecute: createExternalDocumentPreExecute(), + }); + + assert(externalDocumentTool !== undefined, 'External document tool not found'); + + const externalResult = await externalDocumentTool.execute( + { + document_reference: 'external-doc-123', // Simplified schema - just reference + id: 'c28xIQaWQ6MzM5MzczMDA2NzMzMzkwNzIwNA', + category: { value: 'shared' }, + }, + { + dryRun: true, + } + ); + + console.log('✅ External document schema override + preExecute successful'); + const externalParams = externalResult.mappedParams as Record; + const externalDocumentParams = externalParams as DocumentParams & Record; + assert( + externalDocumentParams.name.includes('external-doc-123'), + 'External document name was not transformed correctly' + ); + + console.log('🧪 Testing EXPERIMENTAL multi-source schema override + preExecute...'); + + // EXPERIMENTAL: Create a tool that supports both local and external documents + const multiSourceTool = tools.getTool('hris_upload_employee_document', { + experimental_schemaOverride: createMultiSourceSchemaOverride(), + experimental_preExecute: createMultiSourcePreExecute([__dirname]), + }); + + assert(multiSourceTool !== undefined, 'Multi-source tool not found'); + + // Test with local file + const multiSourceLocalResult = await multiSourceTool.execute( + { + doc_id: sampleFilePath, // Local file takes precedence + id: 'c28xIQaWQ6MzM5MzczMDA2NzMzMzkwNzIwNA', + category: { value: 'shared' }, + }, + { + dryRun: true, + } + ); + + console.log('✅ Multi-source (local) schema override + preExecute successful'); + const multiLocalParams = multiSourceLocalResult.mappedParams as Record; + const multiLocalDocumentParams = multiLocalParams as DocumentParams & Record; + assert( + multiLocalDocumentParams.name === 'sample-document.txt', + 'Multi-source local document name was not transformed correctly' + ); + + // Test with external reference + const multiSourceExternalResult = await multiSourceTool.execute( + { + document_reference: 'external-doc-456', // Fallback to external + id: 'c28xIQaWQ6MzM5MzczMDA2NzMzMzkwNzIwNA', + category: { value: 'shared' }, + }, + { + dryRun: true, + } + ); + + console.log('✅ Multi-source (external) schema override + preExecute successful'); + const multiExternalParams = multiSourceExternalResult.mappedParams as Record; + const multiExternalDocumentParams = multiExternalParams as DocumentParams & + Record; + assert( + multiExternalDocumentParams.name.includes('external-doc-456'), + 'Multi-source external document name was not transformed correctly' + ); + + console.log('🎉 All EXPERIMENTAL schema override + preExecute tests passed!'); + console.log(''); + console.log('📋 API Summary:'); + console.log(' 1. experimental_schemaOverride: Changes tool input schema at creation time'); + console.log( + ' 2. experimental_preExecute: Transforms from override schema to original API format' + ); + console.log(' 3. Two-stage transformation: Schema definition → Parameter transformation'); + console.log(''); + console.log('⚠️ IMPORTANT: This is experimental functionality.'); + console.log(' The API may change in future versions.'); + console.log(' Use at your own risk in production environments.'); + } finally { + // Clean up the sample file + if (fs.existsSync(sampleFilePath)) { + fs.unlinkSync(sampleFilePath); + } + } +}; + +experimentalDocumentHandling(); diff --git a/examples/file-uploads.ts b/examples/file-uploads.ts deleted file mode 100644 index 5e9148f..0000000 --- a/examples/file-uploads.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Example showing how to upload files using the StackOne SDK. - * - * This example demonstrates how to upload files using the simplified file_path parameter, - * which is the only parameter needed for file uploads. The SDK automatically derives - * the necessary file parameters (content, name, file_format) from the file_path. - * - * Run this example with: - * bun run examples/file-uploads.ts - */ - -import assert from 'node:assert'; -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import { StackOneToolSet } from '../src'; - -const accountId = '45072196112816593343'; - -const fileUploads = async (): Promise => { - // Create a sample file for testing - const sampleFilePath = path.join(__dirname, 'sample-file.txt'); - fs.writeFileSync(sampleFilePath, 'This is a sample file for testing file uploads.'); - - try { - // Initialize the StackOne toolset - const toolset = new StackOneToolSet(); - - // Get tools for documents - const tools = toolset.getStackOneTools('hris_*', accountId); - - // Get the upload file tool - const uploadTool = tools.getTool('hris_upload_employee_document'); - - // Check if upload tool exists - assert(uploadTool !== undefined, 'Upload document tool not found'); - - /* - * Upload a file using the file_path parameter - * The SDK will automatically derive content, name, and file_format from the file_path - */ - // Use dry run to check parameter mapping - const dryRunResult = await uploadTool.execute( - { - file_path: sampleFilePath, - id: 'c28xIQaWQ6MzM5MzczMDA2NzMzMzkwNzIwNA', - category: { value: 'shared' }, - }, - { dryRun: true } - ); - - assert( - (dryRunResult.mappedParams as Record).file_format.value === 'txt', - 'File format was not mapped correctly' - ); - } finally { - // Clean up the sample file - if (fs.existsSync(sampleFilePath)) { - fs.unlinkSync(sampleFilePath); - } - } -}; - -fileUploads(); diff --git a/examples/index.ts b/examples/index.ts index 6c1e464..0f06a4e 100644 --- a/examples/index.ts +++ b/examples/index.ts @@ -75,7 +75,7 @@ quickstart(); * - [OpenAI Integration](openai-integration.md) * - [AI SDK Integration](ai-sdk-integration.md) * - [Error Handling](error-handling.md) - * - [File Uploads](file-uploads.md) + * - [EXPERIMENTAL: Document Handling](experimental-document-handling.md) * - [Custom Base URL](custom-base-url.md) * - [Account ID Usage](account-id-usage.md) */ diff --git a/examples/openapi-transformations.ts b/examples/openapi-transformations.ts deleted file mode 100644 index 61ebda7..0000000 --- a/examples/openapi-transformations.ts +++ /dev/null @@ -1,215 +0,0 @@ -/** - * OpenAPI with Parameter Transformations Example - * - * This example demonstrates how to: - * 1. Create custom parameter transformers - * 2. Use them with OpenAPI tools to derive additional parameters - * 3. Execute tools with minimal input, letting the transformers handle the rest - */ - -import assert from 'node:assert'; -import fs from 'node:fs'; -import path from 'node:path'; -import { OpenAPIToolSet } from '../src/toolsets/openapi'; -import type { ParameterTransformer } from '../src/types'; - -/** - * Create a mock OpenAPI specification for testing - */ -const createMockOpenAPISpec = (): string => { - // Create a simple OpenAPI spec with two operations - const spec = { - openapi: '3.0.0', - info: { - title: 'Parameter Transformation API', - version: '1.0.0', - }, - paths: { - '/upload': { - post: { - operationId: 'upload_file', - description: 'Upload a file', - requestBody: { - content: { - 'multipart/form-data': { - schema: { - type: 'object', - properties: { - file_content: { - type: 'string', - description: 'Base64-encoded file content', - }, - file_name: { - type: 'string', - description: 'Name of the file', - }, - file_format: { - type: 'string', - description: 'Format of the file', - }, - }, - required: ['file_content', 'file_name', 'file_format'], - }, - }, - }, - }, - responses: { - '200': { - description: 'File uploaded successfully', - }, - }, - }, - }, - '/users/{user_id}': { - put: { - operationId: 'update_user', - description: 'Update user details', - parameters: [ - { - name: 'user_id', - in: 'path', - required: true, - schema: { - type: 'string', - }, - }, - ], - requestBody: { - content: { - 'application/json': { - schema: { - type: 'object', - properties: { - user_name: { - type: 'string', - description: 'User name', - }, - user_email: { - type: 'string', - description: 'User email', - }, - user_role: { - type: 'string', - description: 'User role', - }, - }, - }, - }, - }, - }, - responses: { - '200': { - description: 'User updated successfully', - }, - }, - }, - }, - }, - }; - - // Write the spec to a temporary file - const tempFile = path.join( - process.env.TMPDIR || '/tmp', - `parameter-transformation-spec-${Date.now()}.json` - ); - fs.writeFileSync(tempFile, JSON.stringify(spec, null, 2)); - - return tempFile; -}; - -/** - * Create a file transformer - * This transformer extracts file_content, file_name, and file_format from file_path - */ -const createFileTransformer = (): ParameterTransformer => { - return { - transforms: { - // Extract file content as base64 - file_content: (filePath: unknown): string => { - if (typeof filePath !== 'string') { - throw new Error('file_path must be a string'); - } - - if (!fs.existsSync(filePath)) { - throw new Error(`File not found: ${filePath}`); - } - - return fs.readFileSync(filePath).toString('base64'); - }, - - // Extract file name - file_name: (filePath: unknown): string => { - if (typeof filePath !== 'string') { - throw new Error('file_path must be a string'); - } - - return path.basename(filePath); - }, - - // Extract file format (extension) - file_format: (filePath: unknown): string => { - if (typeof filePath !== 'string') { - throw new Error('file_path must be a string'); - } - - const extension = path.extname(filePath).slice(1); - return extension || ''; - }, - }, - }; -}; - -/** - * Example of using parameter transformations with OpenAPI - */ -async function main(): Promise { - const specFilePath = createMockOpenAPISpec(); - const fileTransformer = createFileTransformer(); - - // Create a transformers map for the toolset - const transformers = new Map(); - transformers.set('file_path', fileTransformer); - - // Create the toolset with transformers - const toolset = new OpenAPIToolSet({ - filePath: specFilePath, - transformers, - }); - - // Get the tools - const tools = toolset.getTools(); - const fileUploadTool = tools.getTool('upload_file'); - - assert(fileUploadTool, 'Expected to find upload_file tool'); - - const tempFilePath = path.join(__dirname, 'temp.txt'); - fs.writeFileSync(tempFilePath, 'Hello, world!'); - - try { - // Execute with just file_path - other parameters will be transformed - const fileUploadResult = await fileUploadTool.execute( - { file_path: tempFilePath }, - { dryRun: true } - ); - - const fileParams = fileUploadResult.mappedParams as Record; - - // Assertions to validate the transformations worked - assert(fileParams.file_name === 'temp.txt', 'Expected file_name to be transformed correctly'); - assert(fileParams.file_format === 'txt', 'Expected file_format to be transformed correctly'); - assert( - typeof fileParams.file_content === 'string' && fileParams.file_content.length > 0, - 'Expected file_content to be transformed correctly' - ); - } finally { - try { - fs.unlinkSync(tempFilePath); - fs.unlinkSync(specFilePath); - console.log('Cleaned up temporary files'); - } catch (error) { - console.error('Error cleaning up temporary files:', error); - } - } -} - -main(); diff --git a/src/index.ts b/src/index.ts index 29e859d..cef2c09 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,9 +23,10 @@ export { export type { ExecuteConfig, ExecuteOptions, + Experimental_PreExecuteFunction, + Experimental_SchemaOverride, + Experimental_ToolCreationOptions, JsonDict, ParameterLocation, - ParameterTransformer, - ParameterTransformerMap, ToolDefinition, } from './types'; diff --git a/src/modules/parameterMapper.ts b/src/modules/parameterMapper.ts deleted file mode 100644 index 531bacb..0000000 --- a/src/modules/parameterMapper.ts +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Parameter derivation functions for StackOne tools - * - * This file contains functions to transform parameter values from other parameters, - * particularly for file uploads where we want to extract multiple values from a file path. - */ - -import type { JsonDict, ParameterTransformer, ParameterTransformerMap } from '../types'; -import { StackOneError } from '../utils/errors'; - -/** - * Handles parameter mapping and transformation - */ -export class ParameterMapper { - private transformers: ParameterTransformerMap; - - constructor(transformers?: ParameterTransformerMap) { - this.transformers = transformers || new Map(); - } - - /** - * Add a transformer for a parameter - */ - addTransformer(sourceParam: string, transformer: ParameterTransformer): void { - this.transformers.set(sourceParam, transformer); - } - - /** - * Get a transformer for a parameter - */ - getTransformer(sourceParam: string): ParameterTransformer | undefined { - return this.transformers.get(sourceParam); - } - - /** - * Map parameters from user input to API parameters - */ - mapParameters(userParams: JsonDict | string | undefined): JsonDict { - // If no parameters provided, return empty object - if (!userParams) return {}; - - // If parameters are provided as a string, parse them as JSON - const params = typeof userParams === 'string' ? JSON.parse(userParams) : userParams; - - // Create a copy of the parameters to avoid modifying the original - const mappedParams: JsonDict = { ...params }; - - // Process transformed parameters - for (const [sourceParam, config] of this.transformers.entries()) { - // Skip if source parameter is not present - if (!(sourceParam in params)) continue; - - // Get the source parameter value - const sourceValue = params[sourceParam]; - - // Process each derivation function - for (const targetParam of Object.keys(config.transforms)) { - try { - // Derive the parameter value - const derivedValues = transformParameter(sourceValue, targetParam, sourceParam, config); - - // Add derived values to mapped parameters - Object.assign(mappedParams, derivedValues); - } catch (error) { - // Log error but continue processing other parameters - console.error(`Error deriving parameter ${targetParam}:`, error); - } - } - - // Always remove source parameters after transformation - delete mappedParams[sourceParam]; - } - - return mappedParams; - } -} - -/** - * Apply derivation functions to derive a parameter from a source parameter - * - * @param sourceValue Value of the source parameter - * @param targetParam Name of the parameter to derive - * @param sourceParam Name of the source parameter - * @param transformer The derivation configuration containing derivation functions - * @returns Object with the transformed parameter value - */ -export const transformParameter = ( - sourceValue: unknown, - targetParam: string, - sourceParam: string, - transformer: ParameterTransformer -): JsonDict => { - const result: JsonDict = {}; - - // Get the derivation function for the target parameter - const deriveFn = transformer.transforms[targetParam]; - if (!deriveFn) return result; - - try { - const derivedValue = deriveFn(sourceValue); - if (derivedValue !== null) { - result[targetParam] = derivedValue; - } - } catch (error) { - throw new StackOneError( - `Error deriving parameter ${targetParam} from ${sourceParam}: ${error instanceof Error ? error.message : 'Unknown error'}` - ); - } - - return result; -}; diff --git a/src/modules/tests/parameterMapper.spec.ts b/src/modules/tests/parameterMapper.spec.ts deleted file mode 100644 index 6a85c71..0000000 --- a/src/modules/tests/parameterMapper.spec.ts +++ /dev/null @@ -1,210 +0,0 @@ -import { describe, expect, it } from 'bun:test'; -import type { ParameterTransformer } from '../../types'; -import { StackOneError } from '../../utils/errors'; -import { ParameterMapper, transformParameter } from '../parameterMapper'; - -describe('ParameterMapper', () => { - it('should initialize with no transformers', () => { - const mapper = new ParameterMapper(); - expect(mapper).toBeDefined(); - }); - - it('should initialize with provided transformers', () => { - const transformers = new Map(); - transformers.set('sourceParam', { - transforms: { - targetParam: (value) => `transformed-${value}`, - }, - }); - - const mapper = new ParameterMapper(transformers); - expect(mapper).toBeDefined(); - expect(mapper.getTransformer('sourceParam')).toBeDefined(); - }); - - it('should add a transformer', () => { - const mapper = new ParameterMapper(); - - const transformer: ParameterTransformer = { - transforms: { - targetParam: (value) => `transformed-${value}`, - }, - }; - - mapper.addTransformer('sourceParam', transformer); - - const retrievedTransformer = mapper.getTransformer('sourceParam'); - expect(retrievedTransformer).toBe(transformer); - }); - - it('should map parameters without transformations', () => { - const mapper = new ParameterMapper(); - const params = { param1: 'value1', param2: 'value2' }; - - const result = mapper.mapParameters(params); - - expect(result).toEqual(params); - }); - - it('should map parameters with transformations', () => { - const transformers = new Map(); - transformers.set('sourceParam', { - transforms: { - targetParam: (value) => `transformed-${value}`, - }, - }); - - const mapper = new ParameterMapper(transformers); - const params = { sourceParam: 'value', otherParam: 'not-transformed' }; - - const result = mapper.mapParameters(params); - - expect(result).toEqual({ - otherParam: 'not-transformed', - targetParam: 'transformed-value', - }); - }); - - it('should handle parameters provided as a JSON string', () => { - const mapper = new ParameterMapper(); - const paramsString = JSON.stringify({ param1: 'value1', param2: 'value2' }); - - const result = mapper.mapParameters(paramsString); - - expect(result).toEqual({ param1: 'value1', param2: 'value2' }); - }); - - it('should handle undefined parameters', () => { - const mapper = new ParameterMapper(); - const result = mapper.mapParameters(undefined); - - expect(result).toEqual({}); - }); - - it('should skip transformation if source parameter is not present', () => { - const transformers = new Map(); - transformers.set('sourceParam', { - transforms: { - targetParam: (value) => `transformed-${value}`, - }, - }); - - const mapper = new ParameterMapper(transformers); - const params = { otherParam: 'value' }; - - const result = mapper.mapParameters(params); - - expect(result).toEqual({ otherParam: 'value' }); - expect(result).not.toHaveProperty('targetParam'); - }); - - it('should handle multiple target parameters from a single source', () => { - const transformers = new Map(); - transformers.set('sourceParam', { - transforms: { - targetParam1: (value) => `${value}-1`, - targetParam2: (value) => `${value}-2`, - }, - }); - - const mapper = new ParameterMapper(transformers); - const params = { sourceParam: 'value' }; - - const result = mapper.mapParameters(params); - - expect(result).toEqual({ - targetParam1: 'value-1', - targetParam2: 'value-2', - }); - }); - - it('should handle multiple source parameters with transformations', () => { - const transformers = new Map(); - - transformers.set('sourceParam1', { - transforms: { - targetParam1: (value) => `${value}-1`, - }, - }); - - transformers.set('sourceParam2', { - transforms: { - targetParam2: (value) => `${value}-2`, - }, - }); - - const mapper = new ParameterMapper(transformers); - const params = { sourceParam1: 'value1', sourceParam2: 'value2' }; - - const result = mapper.mapParameters(params); - - expect(result).toEqual({ - targetParam1: 'value1-1', - targetParam2: 'value2-2', - }); - }); -}); - -describe('transformParameter', () => { - it('should transform a parameter correctly', () => { - const sourceValue = 'test'; - const targetParam = 'target'; - const sourceParam = 'source'; - const transformer: ParameterTransformer = { - transforms: { - target: (value) => `transformed-${value}`, - }, - }; - - const result = transformParameter(sourceValue, targetParam, sourceParam, transformer); - - expect(result).toEqual({ target: 'transformed-test' }); - }); - - it('should return empty object if transformer for target param does not exist', () => { - const sourceValue = 'test'; - const targetParam = 'nonExistentTarget'; - const sourceParam = 'source'; - const transformer: ParameterTransformer = { - transforms: { - target: (value) => `transformed-${value}`, - }, - }; - - const result = transformParameter(sourceValue, targetParam, sourceParam, transformer); - - expect(result).toEqual({}); - }); - - it('should handle null return from transformation function', () => { - const sourceValue = 'test'; - const targetParam = 'target'; - const sourceParam = 'source'; - const transformer: ParameterTransformer = { - transforms: { - target: () => null, - }, - }; - - const result = transformParameter(sourceValue, targetParam, sourceParam, transformer); - - expect(result).toEqual({}); - }); - - it('should throw StackOneError when transformation function throws', () => { - const sourceValue = 'test'; - const targetParam = 'target'; - const sourceParam = 'source'; - const transformer: ParameterTransformer = { - transforms: { - target: () => { - throw new Error('Transformation error'); - }, - }, - }; - - expect(() => { - transformParameter(sourceValue, targetParam, sourceParam, transformer); - }).toThrow(StackOneError); - }); -}); diff --git a/src/openapi/tests/__snapshots__/openapi-parser.spec.ts.snap b/src/openapi/tests/__snapshots__/openapi-parser.spec.ts.snap index 196b0be..ae96bb6 100644 --- a/src/openapi/tests/__snapshots__/openapi-parser.spec.ts.snap +++ b/src/openapi/tests/__snapshots__/openapi-parser.spec.ts.snap @@ -117,7 +117,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "enum": [ "true", "false", - "unmapped_value", null, ], "example": "true", @@ -135,7 +134,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "description": "The file format of the file", "properties": { "source_value": { - "example": "application/pdf", + "example": "abc", "oneOf": [ { "type": "string", @@ -1404,110 +1403,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "object", }, }, - "hris_cancel_employee_time_off_request": { - "description": "Cancel Employee Time Off Request", - "execute": { - "bodyType": "json", - "method": "DELETE", - "params": [ - { - "location": "header", - "name": "x-account-id", - "type": "string", - }, - { - "location": "path", - "name": "id", - "type": "string", - }, - { - "location": "path", - "name": "subResourceId", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off/{subResourceId}", - }, - "parameters": { - "properties": { - "id": { - "type": "string", - }, - "subResourceId": { - "type": "string", - }, - "x-account-id": { - "description": "The account identifier", - "type": "string", - }, - }, - "required": [ - "id", - "subResourceId", - ], - "type": "object", - }, - }, - "hris_complete_employee_task": { - "description": "Complete Employee Task", - "execute": { - "bodyType": "json", - "method": "PATCH", - "params": [ - { - "location": "header", - "name": "x-account-id", - "type": "string", - }, - { - "location": "path", - "name": "id", - "type": "string", - }, - { - "location": "path", - "name": "subResourceId", - "type": "string", - }, - { - "location": "query", - "name": "proxy", - "type": "string", - }, - { - "location": "body", - "name": "comment", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/tasks/{subResourceId}", - }, - "parameters": { - "properties": { - "comment": { - "description": "Comment or note about the task completion", - "example": "All required documents have been submitted", - "type": "string", - }, - "id": { - "type": "string", - }, - "proxy": {}, - "subResourceId": { - "type": "string", - }, - "x-account-id": { - "description": "The account identifier", - "type": "string", - }, - }, - "required": [ - "id", - "subResourceId", - ], - "type": "object", - }, - }, "hris_create_employee": { "description": "Creates an employee", "execute": { @@ -1564,6 +1459,11 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "name": "work_phone_number", "type": "string", }, + { + "location": "body", + "name": "job_id", + "type": "string", + }, { "location": "body", "name": "job_title", @@ -1634,6 +1534,16 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "name": "start_date", "type": "string", }, + { + "location": "body", + "name": "employment_type", + "type": "object", + }, + { + "location": "body", + "name": "employment_contract_type", + "type": "object", + }, { "location": "body", "name": "employment_status", @@ -2179,7 +2089,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "date_of_birth": { "description": "The employee date_of_birth", - "example": "1990-01-01T00:00:00.000Z", + "example": "1990-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -2206,51 +2116,103 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "employment": { "description": "The employee employment", "properties": { - "end_date": { - "description": "The end date of employment", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "grade": { - "description": "Represents the employee’s position within the organizational hierarchy.", + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", "properties": { - "description": { - "description": "description of the grade", - "example": "Mid-level employee demonstrating proficiency and autonomy.", - "type": "string", + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], }, - "id": { - "description": "The reference id", - "example": "1687-3", + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], "type": "string", }, - "name": { - "description": "The reference name", - "example": "1687-4", - "type": "string", + }, + "type": "object", + }, + "employment_type": { + "description": "The type of employment (e.g., contractor, permanent)", + "example": "permanent", + "properties": { + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], "type": "string", }, }, "type": "object", }, + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, "job_title": { "description": "The job title of the employee", "example": "Software Engineer", "type": "string", }, - "passthrough": { - "additionalProperties": true, - "description": "Value to pass through to the provider", - "example": { - "other_known_names": "John Doe", - }, - "type": "object", - }, "pay_currency": { "description": "The currency used for pay", "example": "USD", @@ -2352,9 +2314,10 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "example": "40.00", "type": "string", }, - "payroll_code": { - "description": "The payroll code of the employee", - "example": "PC1", + "time_worked": { + "description": "The time worked for the employee in ISO 8601 duration format", + "example": "P0Y0M0DT8H0M0S", + "format": "duration", "type": "string", }, "unified_custom_fields": { @@ -2366,56 +2329,42 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "type": "object", }, - "work_time": { - "properties": { - "duration": { - "description": "The work time duration in ISO 8601 duration format", - "example": "P0Y0M0DT8H0M0S", - "format": "duration", + }, + "type": "object", + }, + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", + "properties": { + "source_value": { + "oneOf": [ + { "type": "string", }, - "duration_unit": { - "description": "The duration unit of the work time", - "example": "month", - "properties": { - "source_value": { - "oneOf": [ - { - "type": "string", - }, - { - "type": "number", - }, - { - "type": "boolean", - }, - { - "type": "object", - }, - { - "items": {}, - "type": "array", - }, - ], - }, - "value": { - "description": "The unified value for the period.", - "enum": [ - "day", - "week", - "month", - "year", - "unmapped_value", - null, - ], - "example": "month", - "type": "string", - }, - }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { "type": "object", }, - }, - "type": "object", + { + "items": {}, + "type": "array", + }, + ], + }, + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], + "type": "string", }, }, "type": "object", @@ -2460,6 +2409,56 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "type": "object", }, + "employment_type": { + "description": "The employee employment type", + "example": "full_time", + "properties": { + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], + }, + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], + "type": "string", + }, + }, + "type": "object", + }, "ethnicity": { "description": "The employee ethnicity", "example": "white", @@ -2550,7 +2549,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "hire_date": { "description": "The employee hire date", - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -2917,8 +2916,13 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "type": "object", }, + "job_id": { + "description": "The employee job id", + "example": "R-6789", + "type": "string", + }, "job_title": { - "description": "If the source of the job_title is the Employee's current Employment, and that Employment pertains exclusively to this Employee, then the active Employment job_title will also be written", + "description": "The employee job title", "example": "Physicist", "type": "string", }, @@ -3473,7 +3477,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "preferred_language": { "description": "The employee preferred language", - "example": "eng", + "example": "en_US", "properties": { "source_value": { "oneOf": [ @@ -3513,7 +3517,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "cat", "cha", "ces", - "dan", "deu", "div", "dzo", @@ -3530,7 +3533,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "fra", "gle", "grn", - "guj", "glv", "heb", "hin", @@ -3561,8 +3563,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "mah", "mri", "mkd", - "mon", - "mar", "msa", "mlt", "mya", @@ -3577,18 +3577,15 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "pol", "pus", "por", - "que", "rar", "roh", "rup", "ron", "rus", "kin", - "sme", "sag", "sin", "slk", - "slv", "smo", "sna", "som", @@ -3598,24 +3595,11 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "swe", "swa", "tam", - "tel", "tgk", "tha", "tir", "tig", - "tuk", - "tsn", - "ton", - "tur", - "tso", - "ukr", - "urd", - "uzb", - "ven", - "vie", - "xho", "zho", - "zul", "unmapped_value", null, ], @@ -3627,7 +3611,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "start_date": { "description": "The employee start date", - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -4036,7 +4020,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "string", }, { - "location": "path", + "location": "body", "name": "id", "type": "string", }, @@ -4072,32 +4056,17 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, { "location": "body", - "name": "effective_date", - "type": "string", + "name": "employment_type", + "type": "object", }, { "location": "body", - "name": "end_date", - "type": "string", - }, - { - "location": "body", - "name": "grade", - "type": "object", - }, - { - "location": "body", - "name": "work_time", + "name": "employment_contract_type", "type": "object", }, { "location": "body", - "name": "payroll_code", - "type": "string", - }, - { - "location": "body", - "name": "job_id", + "name": "time_worked", "type": "string", }, { @@ -4110,50 +4079,96 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "parameters": { "properties": { - "effective_date": { - "description": "The effective date of the employment contract", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "end_date": { - "description": "The end date of employment", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "grade": { - "description": "Represents the employee’s position within the organizational hierarchy.", + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", "properties": { - "description": { - "description": "description of the grade", - "example": "Mid-level employee demonstrating proficiency and autonomy.", - "type": "string", + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], }, - "id": { - "description": "The reference id", - "example": "1687-3", + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], "type": "string", }, - "name": { - "description": "The reference name", - "example": "1687-4", - "type": "string", + }, + "type": "object", + }, + "employment_type": { + "description": "The type of employment (e.g., contractor, permanent)", + "example": "permanent", + "properties": { + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], "type": "string", }, }, "type": "object", }, "id": { - "type": "string", - }, - "job_id": { - "description": "The employee job id", - "example": "5290", + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", "type": "string", }, "job_title": { @@ -4270,9 +4285,10 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "example": "40.00", "type": "string", }, - "payroll_code": { - "description": "The payroll code of the employee", - "example": "PC1", + "time_worked": { + "description": "The time worked for the employee in ISO 8601 duration format", + "example": "P0Y0M0DT8H0M0S", + "format": "duration", "type": "string", }, "unified_custom_fields": { @@ -4284,57 +4300,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "type": "object", }, - "work_time": { - "properties": { - "duration": { - "description": "The work time duration in ISO 8601 duration format", - "example": "P0Y0M0DT8H0M0S", - "format": "duration", - "type": "string", - }, - "duration_unit": { - "description": "The duration unit of the work time", - "example": "month", - "properties": { - "source_value": { - "oneOf": [ - { - "type": "string", - }, - { - "type": "number", - }, - { - "type": "boolean", - }, - { - "type": "object", - }, - { - "items": {}, - "type": "array", - }, - ], - }, - "value": { - "description": "The unified value for the period.", - "enum": [ - "day", - "week", - "month", - "year", - "unmapped_value", - null, - ], - "example": "month", - "type": "string", - }, - }, - "type": "object", - }, - }, - "type": "object", - }, "x-account-id": { "description": "The account identifier", "type": "string", @@ -4432,7 +4397,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "3", "4", "5", - "unmapped_value", null, ], "type": "string", @@ -4485,7 +4449,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "3", "4", "5", - "unmapped_value", null, ], "type": "string", @@ -4525,6 +4488,11 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "name": "id", "type": "string", }, + { + "location": "body", + "name": "employee_id", + "type": "string", + }, { "location": "body", "name": "approver_id", @@ -4580,10 +4548,15 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "example": "1687-4", "type": "string", }, + "employee_id": { + "description": "The employee ID", + "example": "1687-3", + "type": "string", + }, "end_date": { - "description": "Inclusive end date of the time off request (ISO8601 date-time without timezone). The time off includes this day", - "example": "2021-01-01T01:01:01.000", - "format": "datetime-local", + "description": "The end date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, "end_half_day": { @@ -4632,9 +4605,9 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "object", }, "start_date": { - "description": "The start date of the time off request (ISO8601 date-time without timezone)", - "example": "2021-01-01T01:01:01.000", - "format": "datetime-local", + "description": "The start date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, "start_half_day": { @@ -4683,7 +4656,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "rejected", "pending", "deleted", - "draft", "unmapped_value", null, ], @@ -4817,7 +4789,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "description": "The file format of the file", "properties": { "source_value": { - "example": "application/pdf", + "example": "abc", "oneOf": [ { "type": "string", @@ -6425,7 +6397,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "driver_license", "birth_certificate", "other", - "unmapped_value", null, ], "type": "string", @@ -6434,12 +6405,12 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "object", }, "valid_from": { - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, "valid_to": { - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -6454,11 +6425,11 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "object", }, }, - "hris_download_employee_document": { - "description": "Download Employee Document", + "hris_create_time_off_request": { + "description": "Creates a time off request", "execute": { "bodyType": "json", - "method": "GET", + "method": "POST", "params": [ { "location": "header", @@ -6466,126 +6437,314 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "string", }, { - "location": "path", - "name": "id", + "location": "body", + "name": "employee_id", "type": "string", }, { - "location": "path", - "name": "subResourceId", + "location": "body", + "name": "approver_id", "type": "string", }, { - "location": "query", - "name": "format", - "type": "string", + "location": "body", + "name": "status", + "type": "object", }, { - "location": "query", - "name": "export_format", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/{subResourceId}/download", - }, - "parameters": { - "properties": { - "export_format": { - "description": "The export format of the file", - "example": "text/plain", - "type": "string", - }, - "format": { - "description": "The format to download the file in", - "example": "base64", - "type": "string", - }, - "id": { - "type": "string", - }, - "subResourceId": { + "location": "body", + "name": "start_date", "type": "string", }, - "x-account-id": { - "description": "The account identifier", + { + "location": "body", + "name": "end_date", "type": "string", }, - }, - "required": [ - "id", - "subResourceId", - ], - "type": "object", - }, - }, - "hris_get_benefit": { - "description": "Get Benefit", - "execute": { - "bodyType": "json", - "method": "GET", - "params": [ { - "location": "header", - "name": "x-account-id", + "location": "body", + "name": "start_half_day", "type": "string", }, { - "location": "path", - "name": "id", + "location": "body", + "name": "end_half_day", "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", + "location": "body", + "name": "time_off_policy_id", + "type": "string", }, { - "location": "query", - "name": "proxy", + "location": "body", + "name": "reason", "type": "object", }, { - "location": "query", - "name": "fields", - "type": "string", + "location": "body", + "name": "passthrough", + "type": "object", }, ], - "url": "https://api.stackone.com/unified/hris/benefits/{id}", + "url": "https://api.stackone.com/unified/hris/time_off", }, "parameters": { "properties": { - "fields": { - "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,benefit_type,provider,description,created_at,updated_at", + "approver_id": { + "description": "The approver ID", + "example": "1687-4", "type": "string", }, - "id": { + "employee_id": { + "description": "The employee ID", + "example": "1687-3", "type": "string", }, - "proxy": { - "additionalProperties": true, - "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", - "type": "object", - }, - "raw": { - "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", - "type": "boolean", - }, - "x-account-id": { - "description": "The account identifier", + "end_date": { + "description": "The end date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, - }, - "required": [ - "id", - ], - "type": "object", - }, - }, - "hris_get_company": { - "description": "Get Company", - "execute": { - "bodyType": "json", + "end_half_day": { + "description": "True if the end of the time off request ends half way through the day", + "example": true, + "oneOf": [ + { + "type": "boolean", + }, + { + "enum": [ + "true", + "false", + ], + "type": "string", + }, + ], + }, + "passthrough": { + "additionalProperties": true, + "description": "Value to pass through to the provider", + "example": { + "other_known_names": "John Doe", + }, + "type": "object", + }, + "reason": { + "properties": { + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, + "name": { + "type": "string", + }, + "remote_id": { + "description": "Provider's unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, + }, + "type": "object", + }, + "start_date": { + "description": "The start date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", + "type": "string", + }, + "start_half_day": { + "description": "True if the start of the time off request begins half way through the day", + "example": true, + "oneOf": [ + { + "type": "boolean", + }, + { + "enum": [ + "true", + "false", + ], + "type": "string", + }, + ], + }, + "status": { + "description": "The status of the time off request", + "properties": { + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], + }, + "value": { + "enum": [ + "approved", + "cancelled", + "rejected", + "pending", + "deleted", + "unmapped_value", + null, + ], + "type": "string", + }, + }, + "type": "object", + }, + "time_off_policy_id": { + "description": "The time off policy id associated with this time off request", + "example": "cx280928933", + "type": "string", + }, + "x-account-id": { + "description": "The account identifier", + "type": "string", + }, + }, + "required": undefined, + "type": "object", + }, + }, + "hris_download_employee_document": { + "description": "Download Employee Document", + "execute": { + "bodyType": "json", + "method": "GET", + "params": [ + { + "location": "header", + "name": "x-account-id", + "type": "string", + }, + { + "location": "path", + "name": "id", + "type": "string", + }, + { + "location": "path", + "name": "subResourceId", + "type": "string", + }, + { + "location": "query", + "name": "format", + "type": "string", + }, + ], + "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/{subResourceId}/download", + }, + "parameters": { + "properties": { + "format": { + "description": "The format to download the file in", + "example": "base64", + "type": "string", + }, + "id": { + "type": "string", + }, + "subResourceId": { + "type": "string", + }, + "x-account-id": { + "description": "The account identifier", + "type": "string", + }, + }, + "required": [ + "id", + "subResourceId", + ], + "type": "object", + }, + }, + "hris_get_benefit": { + "description": "Get Benefit", + "execute": { + "bodyType": "json", + "method": "GET", + "params": [ + { + "location": "header", + "name": "x-account-id", + "type": "string", + }, + { + "location": "path", + "name": "id", + "type": "string", + }, + { + "location": "query", + "name": "raw", + "type": "boolean", + }, + { + "location": "query", + "name": "proxy", + "type": "object", + }, + { + "location": "query", + "name": "fields", + "type": "string", + }, + ], + "url": "https://api.stackone.com/unified/hris/benefits/{id}", + }, + "parameters": { + "properties": { + "fields": { + "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", + "example": "id,remote_id,name,benefit_type,provider,description,created_at,updated_at", + "type": "string", + }, + "id": { + "type": "string", + }, + "proxy": { + "additionalProperties": true, + "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", + "type": "object", + }, + "raw": { + "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", + "type": "boolean", + }, + "x-account-id": { + "description": "The account identifier", + "type": "string", + }, + }, + "required": [ + "id", + ], + "type": "object", + }, + }, + "hris_get_company": { + "description": "Get Company", + "execute": { + "bodyType": "json", "method": "GET", "params": [ { @@ -6684,7 +6843,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,distribution_percentage,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", + "example": "id,remote_id,name,type,distribution_percentage,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, "id": { @@ -6827,7 +6986,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,benefits,employee_number,national_identity_number,national_identity_numbers,skills", + "example": "id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,benefits,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,employee_number,national_identity_number,national_identity_numbers,skills", "type": "string", }, "id": { @@ -7147,7 +7306,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,end_date,employment_type,employment_contract_type,change_reason,grade,work_time,payroll_code,fte,created_at,updated_at,start_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", + "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,employment_type,employment_contract_type,time_worked,created_at,updated_at,start_date,end_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", "type": "string", }, "id": { @@ -7250,89 +7409,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "object", }, }, - "hris_get_employee_task": { - "description": "Get Employee Task", - "execute": { - "bodyType": "json", - "method": "GET", - "params": [ - { - "location": "header", - "name": "x-account-id", - "type": "string", - }, - { - "location": "path", - "name": "id", - "type": "string", - }, - { - "location": "path", - "name": "subResourceId", - "type": "string", - }, - { - "location": "query", - "name": "raw", - "type": "boolean", - }, - { - "location": "query", - "name": "proxy", - "type": "object", - }, - { - "location": "query", - "name": "fields", - "type": "string", - }, - { - "location": "query", - "name": "expand", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/tasks/{subResourceId}", - }, - "parameters": { - "properties": { - "expand": { - "description": "The comma separated list of fields that will be expanded in the response", - "example": "attachments", - "type": "string", - }, - "fields": { - "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,name,description,type,status,due_date,completion_date,assigned_by_employee_id,remote_assigned_by_employee_id,assigned_by_employee_name,link_to_task,extracted_links,next_task_id,remote_next_task_id,parent_process_name,comments,attachments,created_at,updated_at", - "type": "string", - }, - "id": { - "type": "string", - }, - "proxy": { - "additionalProperties": true, - "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", - "type": "object", - }, - "raw": { - "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", - "type": "boolean", - }, - "subResourceId": { - "type": "string", - }, - "x-account-id": { - "description": "The account identifier", - "type": "string", - }, - }, - "required": [ - "id", - "subResourceId", - ], - "type": "object", - }, - }, "hris_get_employee_time_off_balance": { "description": "Get Employee Time Off Balance", "execute": { @@ -7469,7 +7545,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "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,time_off_policy_id,remote_time_off_policy_id,reason,duration,created_at,updated_at,policy", + "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,policy", "type": "string", }, "id": { @@ -7620,7 +7696,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,end_date,employment_type,employment_contract_type,change_reason,grade,work_time,payroll_code,fte,created_at,updated_at,start_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", + "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,employment_type,employment_contract_type,time_worked,created_at,updated_at,start_date,end_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", "type": "string", }, "id": { @@ -7684,7 +7760,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", + "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, "id": { @@ -7748,7 +7824,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", + "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, "id": { @@ -8078,7 +8154,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "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,time_off_policy_id,remote_time_off_policy_id,reason,duration,created_at,updated_at,policy", + "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,policy", "type": "string", }, "id": { @@ -8442,7 +8518,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,distribution_percentage,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", + "example": "id,remote_id,name,type,distribution_percentage,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, "filter": { @@ -8912,7 +8988,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,end_date,employment_type,employment_contract_type,change_reason,grade,work_time,payroll_code,fte,created_at,updated_at,start_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", + "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,employment_type,employment_contract_type,time_worked,created_at,updated_at,start_date,end_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", "type": "string", }, "filter": { @@ -9057,115 +9133,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "object", }, }, - "hris_list_employee_tasks": { - "description": "List Employee Tasks", - "execute": { - "bodyType": "json", - "method": "GET", - "params": [ - { - "location": "header", - "name": "x-account-id", - "type": "string", - }, - { - "location": "path", - "name": "id", - "type": "string", - }, - { - "location": "query", - "name": "raw", - "type": "boolean", - }, - { - "location": "query", - "name": "proxy", - "type": "object", - }, - { - "location": "query", - "name": "fields", - "type": "string", - }, - { - "location": "query", - "name": "filter", - "type": "object", - }, - { - "location": "query", - "name": "page_size", - "type": "string", - }, - { - "location": "query", - "name": "next", - "type": "string", - }, - { - "location": "query", - "name": "expand", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/tasks", - }, - "parameters": { - "properties": { - "expand": { - "description": "The comma separated list of fields that will be expanded in the response", - "example": "attachments", - "type": "string", - }, - "fields": { - "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,name,description,type,status,due_date,completion_date,assigned_by_employee_id,remote_assigned_by_employee_id,assigned_by_employee_name,link_to_task,extracted_links,next_task_id,remote_next_task_id,parent_process_name,comments,attachments,created_at,updated_at", - "type": "string", - }, - "filter": { - "description": "Filter parameters that allow greater customisation of the list response", - "properties": { - "updated_after": { - "additionalProperties": false, - "description": "Use a string with a date to only select results updated after that given date", - "example": "2020-01-01T00:00:00.000Z", - "type": "string", - }, - }, - "type": "object", - }, - "id": { - "type": "string", - }, - "next": { - "description": "The unified cursor", - "type": "string", - }, - "page_size": { - "description": "The number of results per page (default value is 25)", - "type": "string", - }, - "proxy": { - "additionalProperties": true, - "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", - "type": "object", - }, - "raw": { - "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", - "type": "boolean", - }, - "x-account-id": { - "description": "The account identifier", - "type": "string", - }, - }, - "required": [ - "id", - ], - "type": "object", - }, - }, "hris_list_employee_time_off_balances": { "description": "List Employee Time Off Balances", "execute": { @@ -9340,37 +9307,8 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "string", }, "filter": { - "description": "HRIS Time-Off Policies filters", + "description": "Filter parameters that allow greater customisation of the list response", "properties": { - "type": { - "description": "Filter to select time-off policies by type", - "enum": [ - "sick", - "unmapped_value", - "vacation", - "long_term_disability", - "short_term_disability", - "absent", - "comp_time", - "training", - "annual_leave", - "leave_of_absence", - "break", - "child_care_leave", - "maternity_leave", - "jury_duty", - "sabbatical", - "accident", - "paid", - "unpaid", - "holiday", - "personal", - "in_lieu", - "bereavement", - null, - ], - "type": "string", - }, "updated_after": { "additionalProperties": false, "description": "Use a string with a date to only select results updated after that given date", @@ -9474,7 +9412,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "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,time_off_policy_id,remote_time_off_policy_id,reason,duration,created_at,updated_at,policy", + "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,policy", "type": "string", }, "filter": { @@ -9689,7 +9627,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,benefits,employee_number,national_identity_number,national_identity_numbers,skills", + "example": "id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,benefits,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,employee_number,national_identity_number,national_identity_numbers,skills", "type": "string", }, "filter": { @@ -9801,7 +9739,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,end_date,employment_type,employment_contract_type,change_reason,grade,work_time,payroll_code,fte,created_at,updated_at,start_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", + "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,employment_type,employment_contract_type,time_worked,created_at,updated_at,start_date,end_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", "type": "string", }, "filter": { @@ -9890,7 +9828,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", + "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, "filter": { @@ -9979,7 +9917,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", + "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, "filter": { @@ -10356,37 +10294,8 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "string", }, "filter": { - "description": "HRIS Time-Off Policies filters", + "description": "Filter parameters that allow greater customisation of the list response", "properties": { - "type": { - "description": "Filter to select time-off policies by type", - "enum": [ - "sick", - "unmapped_value", - "vacation", - "long_term_disability", - "short_term_disability", - "absent", - "comp_time", - "training", - "annual_leave", - "leave_of_absence", - "break", - "child_care_leave", - "maternity_leave", - "jury_duty", - "sabbatical", - "accident", - "paid", - "unpaid", - "holiday", - "personal", - "in_lieu", - "bereavement", - null, - ], - "type": "string", - }, "updated_after": { "additionalProperties": false, "description": "Use a string with a date to only select results updated after that given date", @@ -10480,7 +10389,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "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,time_off_policy_id,remote_time_off_policy_id,reason,duration,created_at,updated_at,policy", + "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,policy", "type": "string", }, "filter": { @@ -10678,6 +10587,11 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "name": "work_phone_number", "type": "string", }, + { + "location": "body", + "name": "job_id", + "type": "string", + }, { "location": "body", "name": "job_title", @@ -10748,6 +10662,16 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "name": "start_date", "type": "string", }, + { + "location": "body", + "name": "employment_type", + "type": "object", + }, + { + "location": "body", + "name": "employment_contract_type", + "type": "object", + }, { "location": "body", "name": "employment_status", @@ -11266,7 +11190,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "date_of_birth": { "description": "The employee date_of_birth", - "example": "1990-01-01T00:00:00.000Z", + "example": "1990-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -11293,51 +11217,103 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "employment": { "description": "The employee employment", "properties": { - "end_date": { - "description": "The end date of employment", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "grade": { - "description": "Represents the employee’s position within the organizational hierarchy.", + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", "properties": { - "description": { - "description": "description of the grade", - "example": "Mid-level employee demonstrating proficiency and autonomy.", - "type": "string", + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], }, - "id": { - "description": "The reference id", - "example": "1687-3", + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], "type": "string", }, - "name": { - "description": "The reference name", - "example": "1687-4", - "type": "string", + }, + "type": "object", + }, + "employment_type": { + "description": "The type of employment (e.g., contractor, permanent)", + "example": "permanent", + "properties": { + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], "type": "string", }, }, "type": "object", }, + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, "job_title": { "description": "The job title of the employee", "example": "Software Engineer", "type": "string", }, - "passthrough": { - "additionalProperties": true, - "description": "Value to pass through to the provider", - "example": { - "other_known_names": "John Doe", - }, - "type": "object", - }, "pay_currency": { "description": "The currency used for pay", "example": "USD", @@ -11439,9 +11415,10 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "example": "40.00", "type": "string", }, - "payroll_code": { - "description": "The payroll code of the employee", - "example": "PC1", + "time_worked": { + "description": "The time worked for the employee in ISO 8601 duration format", + "example": "P0Y0M0DT8H0M0S", + "format": "duration", "type": "string", }, "unified_custom_fields": { @@ -11453,56 +11430,42 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "type": "object", }, - "work_time": { - "properties": { - "duration": { - "description": "The work time duration in ISO 8601 duration format", - "example": "P0Y0M0DT8H0M0S", - "format": "duration", + }, + "type": "object", + }, + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", + "properties": { + "source_value": { + "oneOf": [ + { "type": "string", }, - "duration_unit": { - "description": "The duration unit of the work time", - "example": "month", - "properties": { - "source_value": { - "oneOf": [ - { - "type": "string", - }, - { - "type": "number", - }, - { - "type": "boolean", - }, - { - "type": "object", - }, - { - "items": {}, - "type": "array", - }, - ], - }, - "value": { - "description": "The unified value for the period.", - "enum": [ - "day", - "week", - "month", - "year", - "unmapped_value", - null, - ], - "example": "month", - "type": "string", - }, - }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { "type": "object", }, - }, - "type": "object", + { + "items": {}, + "type": "array", + }, + ], + }, + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], + "type": "string", }, }, "type": "object", @@ -11547,6 +11510,56 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "type": "object", }, + "employment_type": { + "description": "The employee employment type", + "example": "full_time", + "properties": { + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], + }, + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], + "type": "string", + }, + }, + "type": "object", + }, "ethnicity": { "description": "The employee ethnicity", "example": "white", @@ -11637,7 +11650,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "hire_date": { "description": "The employee hire date", - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -12007,8 +12020,13 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "id": { "type": "string", }, + "job_id": { + "description": "The employee job id", + "example": "R-6789", + "type": "string", + }, "job_title": { - "description": "If the source of the job_title is the Employee's current Employment, and that Employment pertains exclusively to this Employee, then the active Employment job_title will also be written", + "description": "The employee job title", "example": "Physicist", "type": "string", }, @@ -12563,7 +12581,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "preferred_language": { "description": "The employee preferred language", - "example": "eng", + "example": "en_US", "properties": { "source_value": { "oneOf": [ @@ -12603,7 +12621,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "cat", "cha", "ces", - "dan", "deu", "div", "dzo", @@ -12620,7 +12637,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "fra", "gle", "grn", - "guj", "glv", "heb", "hin", @@ -12651,8 +12667,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "mah", "mri", "mkd", - "mon", - "mar", "msa", "mlt", "mya", @@ -12667,18 +12681,15 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "pol", "pus", "por", - "que", "rar", "roh", "rup", "ron", "rus", "kin", - "sme", "sag", "sin", "slk", - "slv", "smo", "sna", "som", @@ -12688,24 +12699,11 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "swe", "swa", "tam", - "tel", "tgk", "tha", "tir", "tig", - "tuk", - "tsn", - "ton", - "tur", - "tso", - "ukr", - "urd", - "uzb", - "ven", - "vie", - "xho", "zho", - "zul", "unmapped_value", null, ], @@ -12717,7 +12715,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "start_date": { "description": "The employee start date", - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -13128,7 +13126,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "string", }, { - "location": "path", + "location": "body", "name": "id", "type": "string", }, @@ -13169,27 +13167,17 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, { "location": "body", - "name": "effective_date", - "type": "string", - }, - { - "location": "body", - "name": "end_date", - "type": "string", - }, - { - "location": "body", - "name": "grade", + "name": "employment_type", "type": "object", }, { "location": "body", - "name": "work_time", + "name": "employment_contract_type", "type": "object", }, { "location": "body", - "name": "payroll_code", + "name": "time_worked", "type": "string", }, { @@ -13202,45 +13190,96 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, "parameters": { "properties": { - "effective_date": { - "description": "The effective date of the employment contract", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "end_date": { - "description": "The end date of employment", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "grade": { - "description": "Represents the employee’s position within the organizational hierarchy.", + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", "properties": { - "description": { - "description": "description of the grade", - "example": "Mid-level employee demonstrating proficiency and autonomy.", - "type": "string", + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], }, - "id": { - "description": "The reference id", - "example": "1687-3", + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], "type": "string", }, - "name": { - "description": "The reference name", - "example": "1687-4", - "type": "string", + }, + "type": "object", + }, + "employment_type": { + "description": "The type of employment (e.g., contractor, permanent)", + "example": "permanent", + "properties": { + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], "type": "string", }, }, "type": "object", }, "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", "type": "string", }, "job_title": { @@ -13328,103 +13367,53 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 { "type": "object", }, - { - "items": {}, - "type": "array", - }, - ], - }, - "value": { - "enum": [ - "hour", - "day", - "week", - "every_two_weeks", - "month", - "quarter", - "every_six_months", - "year", - "unmapped_value", - null, - ], - "type": "string", - }, - }, - "type": "object", - }, - "pay_rate": { - "description": "The pay rate for the employee", - "example": "40.00", - "type": "string", - }, - "payroll_code": { - "description": "The payroll code of the employee", - "example": "PC1", - "type": "string", - }, - "subResourceId": { - "type": "string", - }, - "unified_custom_fields": { - "additionalProperties": true, - "description": "Custom Unified Fields configured in your StackOne project", - "example": { - "my_project_custom_field_1": "REF-1236", - "my_project_custom_field_2": "some other value", - }, - "type": "object", - }, - "work_time": { - "properties": { - "duration": { - "description": "The work time duration in ISO 8601 duration format", - "example": "P0Y0M0DT8H0M0S", - "format": "duration", - "type": "string", - }, - "duration_unit": { - "description": "The duration unit of the work time", - "example": "month", - "properties": { - "source_value": { - "oneOf": [ - { - "type": "string", - }, - { - "type": "number", - }, - { - "type": "boolean", - }, - { - "type": "object", - }, - { - "items": {}, - "type": "array", - }, - ], - }, - "value": { - "description": "The unified value for the period.", - "enum": [ - "day", - "week", - "month", - "year", - "unmapped_value", - null, - ], - "example": "month", - "type": "string", + { + "items": {}, + "type": "array", }, - }, - "type": "object", + ], + }, + "value": { + "enum": [ + "hour", + "day", + "week", + "every_two_weeks", + "month", + "quarter", + "every_six_months", + "year", + "unmapped_value", + null, + ], + "type": "string", }, }, "type": "object", }, + "pay_rate": { + "description": "The pay rate for the employee", + "example": "40.00", + "type": "string", + }, + "subResourceId": { + "type": "string", + }, + "time_worked": { + "description": "The time worked for the employee in ISO 8601 duration format", + "example": "P0Y0M0DT8H0M0S", + "format": "duration", + "type": "string", + }, + "unified_custom_fields": { + "additionalProperties": true, + "description": "Custom Unified Fields configured in your StackOne project", + "example": { + "my_project_custom_field_1": "REF-1236", + "my_project_custom_field_2": "some other value", + }, + "type": "object", + }, "x-account-id": { "description": "The account identifier", "type": "string", @@ -13458,6 +13447,11 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "name": "subResourceId", "type": "string", }, + { + "location": "body", + "name": "employee_id", + "type": "string", + }, { "location": "body", "name": "approver_id", @@ -13513,10 +13507,15 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "example": "1687-4", "type": "string", }, + "employee_id": { + "description": "The employee ID", + "example": "1687-3", + "type": "string", + }, "end_date": { - "description": "Inclusive end date of the time off request (ISO8601 date-time without timezone). The time off includes this day", - "example": "2021-01-01T01:01:01.000", - "format": "datetime-local", + "description": "The end date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, "end_half_day": { @@ -13565,9 +13564,9 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "object", }, "start_date": { - "description": "The start date of the time off request (ISO8601 date-time without timezone)", - "example": "2021-01-01T01:01:01.000", - "format": "datetime-local", + "description": "The start date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, "start_half_day": { @@ -13616,7 +13615,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "rejected", "pending", "deleted", - "draft", "unmapped_value", null, ], @@ -13759,7 +13757,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "description": "The file format of the file", "properties": { "source_value": { - "example": "application/pdf", + "example": "abc", "oneOf": [ { "type": "string", @@ -15370,7 +15368,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "driver_license", "birth_certificate", "other", - "unmapped_value", null, ], "type": "string", @@ -15379,12 +15376,12 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "object", }, "valid_from": { - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, "valid_to": { - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -15400,6 +15397,214 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "type": "object", }, }, + "hris_update_time_off_request": { + "description": "Update time off request", + "execute": { + "bodyType": "json", + "method": "PATCH", + "params": [ + { + "location": "header", + "name": "x-account-id", + "type": "string", + }, + { + "location": "path", + "name": "id", + "type": "string", + }, + { + "location": "body", + "name": "employee_id", + "type": "string", + }, + { + "location": "body", + "name": "approver_id", + "type": "string", + }, + { + "location": "body", + "name": "status", + "type": "object", + }, + { + "location": "body", + "name": "start_date", + "type": "string", + }, + { + "location": "body", + "name": "end_date", + "type": "string", + }, + { + "location": "body", + "name": "start_half_day", + "type": "string", + }, + { + "location": "body", + "name": "end_half_day", + "type": "string", + }, + { + "location": "body", + "name": "time_off_policy_id", + "type": "string", + }, + { + "location": "body", + "name": "reason", + "type": "object", + }, + { + "location": "body", + "name": "passthrough", + "type": "object", + }, + ], + "url": "https://api.stackone.com/unified/hris/time_off/{id}", + }, + "parameters": { + "properties": { + "approver_id": { + "description": "The approver ID", + "example": "1687-4", + "type": "string", + }, + "employee_id": { + "description": "The employee ID", + "example": "1687-3", + "type": "string", + }, + "end_date": { + "description": "The end date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", + "type": "string", + }, + "end_half_day": { + "description": "True if the end of the time off request ends half way through the day", + "example": true, + "oneOf": [ + { + "type": "boolean", + }, + { + "enum": [ + "true", + "false", + ], + "type": "string", + }, + ], + }, + "id": { + "type": "string", + }, + "passthrough": { + "additionalProperties": true, + "description": "Value to pass through to the provider", + "example": { + "other_known_names": "John Doe", + }, + "type": "object", + }, + "reason": { + "properties": { + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, + "name": { + "type": "string", + }, + "remote_id": { + "description": "Provider's unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, + }, + "type": "object", + }, + "start_date": { + "description": "The start date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", + "type": "string", + }, + "start_half_day": { + "description": "True if the start of the time off request begins half way through the day", + "example": true, + "oneOf": [ + { + "type": "boolean", + }, + { + "enum": [ + "true", + "false", + ], + "type": "string", + }, + ], + }, + "status": { + "description": "The status of the time off request", + "properties": { + "source_value": { + "oneOf": [ + { + "type": "string", + }, + { + "type": "number", + }, + { + "type": "boolean", + }, + { + "type": "object", + }, + { + "items": {}, + "type": "array", + }, + ], + }, + "value": { + "enum": [ + "approved", + "cancelled", + "rejected", + "pending", + "deleted", + "unmapped_value", + null, + ], + "type": "string", + }, + }, + "type": "object", + }, + "time_off_policy_id": { + "description": "The time off policy id associated with this time off request", + "example": "cx280928933", + "type": "string", + }, + "x-account-id": { + "description": "The account identifier", + "type": "string", + }, + }, + "required": [ + "id", + ], + "type": "object", + }, + }, "hris_upload_employee_document": { "description": "Upload Employee Document", "execute": { @@ -15443,12 +15648,12 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 }, { "location": "body", - "name": "confidential", + "name": "category", "type": "object", }, { "location": "body", - "name": "category", + "name": "confidential", "type": "object", }, ], @@ -15538,7 +15743,6 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "enum": [ "true", "false", - "unmapped_value", null, ], "example": "true", @@ -15556,7 +15760,7 @@ exports[`OpenAPIParser Snapshot Tests should parse all OpenAPI specs correctly 1 "description": "The file format of the file", "properties": { "source_value": { - "example": "application/pdf", + "example": "abc", "oneOf": [ { "type": "string", diff --git a/src/tests/transformations.spec.ts b/src/tests/transformations.spec.ts deleted file mode 100644 index 1458c70..0000000 --- a/src/tests/transformations.spec.ts +++ /dev/null @@ -1,539 +0,0 @@ -/** - * Tests for parameter transformation functions - */ - -import { - type Mock, - afterAll, - afterEach, - beforeAll, - beforeEach, - describe, - expect, - it, - mock, - spyOn, -} from 'bun:test'; -import fs from 'node:fs'; -import os from 'node:os'; -import path from 'node:path'; -import { transformParameter } from '../modules/parameterMapper'; -import type { Tools } from '../tool'; -import { OpenAPIToolSet } from '../toolsets'; -import type { ParameterTransformer } from '../types'; -import { mockFetch } from './utils/fetch-mock'; - -describe('Parameter Transformations', () => { - // Create a test file for derivation tests - const testFileContent = 'Test file content'; - const testFilePath = path.join(import.meta.dir, 'test-file.txt'); - - // Create the test file before tests - beforeAll(() => { - fs.writeFileSync(testFilePath, testFileContent); - }); - - // Remove the test file after tests - afterAll(() => { - fs.unlinkSync(testFilePath); - }); - - // Create a test derivation config - const testParameterTransformer: ParameterTransformer = { - transforms: { - derived_param1: (value: unknown): string => { - if (typeof value !== 'string') { - throw new Error('Value must be a string'); - } - return `derived_${value}`; - }, - derived_param2: (value: unknown): string => { - if (typeof value !== 'string') { - throw new Error('Value must be a string'); - } - return `${value}_derived`; - }, - }, - }; - - describe('transformParameter', () => { - it('should derive multiple parameters from a source parameter', () => { - // Test data - const sourceParam = 'source_param'; - const sourceValue = 'test_value'; - - // Transform parameters for derived_param1 - const result1 = transformParameter( - sourceValue, - 'derived_param1', - sourceParam, - testParameterTransformer - ); - - // Transform parameters for derived_param2 - const result2 = transformParameter( - sourceValue, - 'derived_param2', - sourceParam, - testParameterTransformer - ); - - // Verify derived parameters - expect(result1).toHaveProperty('derived_param1', 'derived_test_value'); - expect(result2).toHaveProperty('derived_param2', 'test_value_derived'); - }); - - it('should handle unknown parameters gracefully', () => { - // Test with a parameter that doesn't exist - const result = transformParameter( - 'test_value', - 'nonexistent_param', - 'source_param', - testParameterTransformer - ); - - // Verify no parameters were added - expect(Object.keys(result).length).toBe(0); - }); - - it('should handle errors in derivation functions', () => { - // Create a derivation config with a function that throws - const errorConfig: ParameterTransformer = { - transforms: { - error_param: (_value: unknown): string => { - throw new Error('Test error'); - }, - success_param: (value: unknown): string => { - if (typeof value !== 'string') { - throw new Error('Value must be a string'); - } - return `success_${value}`; - }, - }, - }; - - // Test data - const sourceValue = 'test_value'; - const sourceParam = 'source_param'; - - // Transform parameters for success_param - const successResult = transformParameter( - sourceValue, - 'success_param', - sourceParam, - errorConfig - ); - - // Verify success parameter is present - expect(successResult).toHaveProperty('success_param', 'success_test_value'); - - // Verify error parameter throws - expect(() => - transformParameter(sourceValue, 'error_param', sourceParam, errorConfig) - ).toThrow(); - }); - }); -}); - -describe('Parameter Transformation Edge Cases', () => { - // Create a temporary directory and file for tests - let tempDir: string; - let tempSpecFile: string; - let fetchMock: ReturnType; - let mockTool: { - execute: Mock< - ( - params: Record, - options?: unknown - ) => Promise<{ - mappedParams: Record; - url: string; - method: string; - headers: Record; - body: unknown; - originalParams: Record; - }> - >; - }; - - // Set up before each test - beforeEach(() => { - // Create a temporary directory - tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'openapi-test-')); - - // Create a temporary spec file - tempSpecFile = path.join(tempDir, 'test-spec.json'); - - // Write a minimal OpenAPI spec to the file - fs.writeFileSync( - tempSpecFile, - JSON.stringify({ - openapi: '3.0.0', - info: { - title: 'Test API', - version: '1.0.0', - }, - paths: { - '/test': { - post: { - operationId: 'test_derivation', - parameters: [ - { - name: 'source_param', - in: 'query', - schema: { - type: 'string', - }, - }, - ], - responses: { - '200': { - description: 'OK', - }, - }, - }, - }, - }, - }) - ); - - // Set up fetch mock - fetchMock = mockFetch({ - defaultResponse: { - ok: true, - json: async () => ({ success: true }), - }, - }); - - // Create a mock tool with an execute method - mockTool = { - execute: mock(async (params, _options) => { - return { - mappedParams: params, - url: 'https://example.com/api', - method: 'POST', - headers: {}, - body: null, - originalParams: params, - }; - }), - }; - - // Mock the OpenAPIToolSet.getTools method - spyOn(OpenAPIToolSet.prototype, 'getTools').mockImplementation(() => { - return { - getTool: mock(() => mockTool), - } as unknown as Tools; - }); - }); - - // Clean up after each test - afterEach(() => { - // Restore fetch mock - fetchMock.restore(); - - // Clean up temporary files - try { - fs.unlinkSync(tempSpecFile); - fs.rmdirSync(tempDir, { recursive: true }); - } catch (error) { - console.error('Error cleaning up temp files:', error); - } - }); - - describe('Empty derivation configs', () => { - it('should handle empty derivation configs map', async () => { - // Create OpenAPIToolSet with empty derivation configs - const toolset = new OpenAPIToolSet({ - filePath: tempSpecFile, - transformers: new Map(), - }); - - // Get test tool - const tools = toolset.getTools(); - const testTool = tools.getTool('test_derivation'); - - expect(testTool).toBeDefined(); - if (!testTool) return; - - // Execute tool with dry run - await testTool.execute({ source_param: 'test_value' }, { dryRun: true }); - - // Verify the execute method was called with the correct parameters - expect(mockTool.execute).toHaveBeenCalledWith( - { source_param: 'test_value' }, - { dryRun: true } - ); - }); - - it('should handle derivation config with no derivation functions', async () => { - // Create a transformation config with no transformation functions - const emptyConfig: ParameterTransformer = { - transforms: {}, - }; - - // Create a map of transformation configs - const transformers = new Map(); - transformers.set('source_param', emptyConfig); - - // Create OpenAPIToolSet with transformation configs - const toolset = new OpenAPIToolSet({ - filePath: tempSpecFile, - transformers, - }); - - // Get test tool - const tools = toolset.getTools(); - const testTool = tools.getTool('test_derivation'); - - expect(testTool).toBeDefined(); - if (!testTool) return; - - // Execute tool with dry run - await testTool.execute({ source_param: 'test_value' }, { dryRun: true }); - - // Verify the execute method was called with the correct parameters - expect(mockTool.execute).toHaveBeenCalledWith( - { source_param: 'test_value' }, - { dryRun: true } - ); - }); - }); - - describe('Invalid transformation configs', () => { - it('should handle transformation config with invalid source parameter', async () => { - // Create a transformation config with a non-existent source parameter - const invalidConfig: ParameterTransformer = { - transforms: { - derived_param1: (value: unknown): string => { - if (typeof value !== 'string') { - throw new Error('Value must be a string'); - } - return `derived_${value}`; - }, - }, - }; - - // Create a map of transformation configs - const transformers = new Map(); - transformers.set('non_existent_param', invalidConfig); - - // Create OpenAPIToolSet with transformation configs - const toolset = new OpenAPIToolSet({ - filePath: tempSpecFile, - transformers, - }); - - // Get test tool - const tools = toolset.getTools(); - const testTool = tools.getTool('test_derivation'); - - expect(testTool).toBeDefined(); - if (!testTool) return; - - // Execute tool with dry run - await testTool.execute({ source_param: 'test_value' }, { dryRun: true }); - - // Verify the execute method was called with the correct parameters - expect(mockTool.execute).toHaveBeenCalledWith( - { source_param: 'test_value' }, - { dryRun: true } - ); - }); - }); - - describe('Error handling in transformation functions', () => { - it('should handle one transformation function failing while others succeed', async () => { - // Create a transformation config with mixed success/failure - const mixedConfig: ParameterTransformer = { - transforms: { - derived_param1: (_value: unknown): string => { - throw new Error('Error in derived_param1'); - }, - derived_param2: (_value: unknown): string => { - return 'derived_value'; - }, - }, - }; - - // Create a map of transformation configs - const transformers = new Map(); - transformers.set('source_param', mixedConfig); - - // Create OpenAPIToolSet with transformation configs - const toolset = new OpenAPIToolSet({ - filePath: tempSpecFile, - transformers, - }); - - // Get test tool - const tools = toolset.getTools(); - const testTool = tools.getTool('test_derivation'); - - expect(testTool).toBeDefined(); - if (!testTool) return; - - // Execute tool with dry run - await testTool.execute({ source_param: 'test_value' }, { dryRun: true }); - - // Verify the execute method was called with the correct parameters - expect(mockTool.execute).toHaveBeenCalledWith( - { source_param: 'test_value' }, - { dryRun: true } - ); - }); - - it('should handle all transformation functions failing', async () => { - // Create a transformation config with all functions that throw - const errorConfig: ParameterTransformer = { - transforms: { - derived_param1: (_value: unknown): string => { - throw new Error('Error in derived_param1'); - }, - derived_param2: (_value: unknown): string => { - throw new Error('Error in derived_param2'); - }, - }, - }; - - // Create a map of transformation configs - const transformers = new Map(); - transformers.set('source_param', errorConfig); - - // Create OpenAPIToolSet with transformation configs - const toolset = new OpenAPIToolSet({ - filePath: tempSpecFile, - transformers, - }); - - // Get test tool - const tools = toolset.getTools(); - const testTool = tools.getTool('test_derivation'); - - expect(testTool).toBeDefined(); - if (!testTool) return; - - // Execute tool with dry run - await testTool.execute({ source_param: 'test_value' }, { dryRun: true }); - - // Verify the execute method was called with the correct parameters - expect(mockTool.execute).toHaveBeenCalledWith( - { source_param: 'test_value' }, - { dryRun: true } - ); - }); - }); - - describe('Nested derivations', () => { - it('should handle nested derivations', async () => { - // Create a first-level derivation config - const firstLevelConfig: ParameterTransformer = { - transforms: { - nested_source: (value: unknown): string => { - if (typeof value !== 'string') { - throw new Error('Value must be a string'); - } - return `nested_${value}`; - }, - }, - }; - - // Create a second-level derivation config - const secondLevelConfig: ParameterTransformer = { - transforms: { - nested_derived: (value: unknown): string => { - if (typeof value !== 'string') { - throw new Error('Value must be a string'); - } - return `derived_from_${value}`; - }, - }, - }; - - // Create a map of derivation configs - const transformers = new Map(); - transformers.set('source_param', firstLevelConfig); - transformers.set('nested_source', secondLevelConfig); - - // Create a mock OpenAPIToolSet with the transformers - const toolset = new OpenAPIToolSet({ - filePath: tempSpecFile, - transformers, - }); - - // Get test tool - const tools = toolset.getTools(); - const testTool = tools.getTool('test_derivation'); - - expect(testTool).toBeDefined(); - if (!testTool) return; - - // Execute tool with dry run - await testTool.execute({ source_param: 'test_value' }, { dryRun: true }); - - // Verify the execute method was called with the correct parameters - expect(mockTool.execute).toHaveBeenCalledWith( - { source_param: 'test_value' }, - { dryRun: true } - ); - }); - }); - - describe('Conflicting derivations', () => { - it('should handle conflicting derivation configs', async () => { - // Create a derivation config for the first parameter - const config1: ParameterTransformer = { - transforms: { - derived_param: (value: unknown): string => { - if (typeof value !== 'string') { - throw new Error('Value must be a string'); - } - return `derived_from_source_${value}`; - }, - }, - }; - - // Create a derivation config for the second parameter - const config2: ParameterTransformer = { - transforms: { - derived_param: (value: unknown): string => { - if (typeof value !== 'string') { - throw new Error('Value must be a string'); - } - return `derived_from_other_${value}`; - }, - }, - }; - - // Create a map of derivation configs - const transformers = new Map(); - transformers.set('source_param', config1); - transformers.set('other_param', config2); - - // Create a mock OpenAPIToolSet with the transformers - const toolset = new OpenAPIToolSet({ - filePath: tempSpecFile, - transformers, - }); - - // Get test tool - const tools = toolset.getTools(); - const testTool = tools.getTool('test_derivation'); - - expect(testTool).toBeDefined(); - if (!testTool) return; - - // Execute tool with dry run - await testTool.execute( - { source_param: 'test_value', other_param: 'other_value' }, - { dryRun: true } - ); - - // Verify the execute method was called with the correct parameters - expect(mockTool.execute).toHaveBeenCalledWith( - { source_param: 'test_value', other_param: 'other_value' }, - { dryRun: true } - ); - }); - }); -}); diff --git a/src/tool.ts b/src/tool.ts index 5c230e2..1672c40 100644 --- a/src/tool.ts +++ b/src/tool.ts @@ -1,13 +1,12 @@ import { type ToolSet, jsonSchema } from 'ai'; import type { ChatCompletionTool } from 'openai/resources/chat/completions'; -import { ParameterMapper } from './modules/parameterMapper'; import { RequestBuilder } from './modules/requestBuilder'; import type { ExecuteConfig, ExecuteOptions, + Experimental_PreExecuteFunction, + Experimental_ToolCreationOptions, JsonDict, - ParameterTransformer, - ParameterTransformerMap, ToolParameters, } from './types'; import { StackOneError } from './utils/errors'; @@ -21,8 +20,8 @@ export class BaseTool { description: string; parameters: ToolParameters; executeConfig: ExecuteConfig; - protected parameterMapper: ParameterMapper; protected requestBuilder: RequestBuilder; + protected experimental_preExecute?: Experimental_PreExecuteFunction; constructor( name: string, @@ -30,28 +29,14 @@ export class BaseTool { parameters: ToolParameters, executeConfig: ExecuteConfig, headers?: Record, - transformers?: ParameterTransformerMap + experimental_preExecute?: Experimental_PreExecuteFunction ) { this.name = name; this.description = description; this.parameters = parameters; this.executeConfig = executeConfig; - this.parameterMapper = new ParameterMapper(transformers); this.requestBuilder = new RequestBuilder(executeConfig, headers); - } - - /** - * Add a parameter transformer - */ - public setParameterTransformer(sourceParam: string, config: ParameterTransformer): void { - this.parameterMapper.addTransformer(sourceParam, config); - } - - /** - * Get a parameter transformer - */ - public getParameterTransformer(sourceParam: string): ParameterTransformer | undefined { - return this.parameterMapper.getTransformer(sourceParam); + this.experimental_preExecute = experimental_preExecute; } /** @@ -85,11 +70,18 @@ export class BaseTool { ); } - // Map parameters from user input to API parameters - const mappedParams = this.parameterMapper.mapParameters(inputParams); + // Convert string params to object + const params = typeof inputParams === 'string' ? JSON.parse(inputParams) : inputParams || {}; + + // Apply experimental preExecute function (either from tool creation or execution options) + let processedParams = params; + + if (this.experimental_preExecute) { + processedParams = await this.experimental_preExecute(params); + } - // Execute the request - return await this.requestBuilder.execute(mappedParams, options); + // Execute the request directly with processed parameters + return await this.requestBuilder.execute(processedParams, options); } catch (error) { if (error instanceof StackOneError) { throw error; @@ -187,8 +179,46 @@ export class Tools implements Iterable { /** * Get a tool by name */ - getTool(name: string): BaseTool | undefined { - return this.tools.find((tool) => tool.name === name); + getTool(name: string, options?: Experimental_ToolCreationOptions): BaseTool | undefined { + const originalTool = this.tools.find((tool) => tool.name === name); + if (!originalTool) { + return undefined; + } + + // If no experimental options provided, return original tool + if (!options?.experimental_schemaOverride && !options?.experimental_preExecute) { + return originalTool; + } + + // Create a new tool with experimental schema override and preExecute + let parameters = originalTool.parameters; + + // Apply schema override if provided + if (options.experimental_schemaOverride) { + parameters = options.experimental_schemaOverride(originalTool.parameters); + } + + // Create new tool instance with modified schema and preExecute function + if (originalTool instanceof StackOneTool) { + const newTool = new StackOneTool( + originalTool.name, + originalTool.description, + parameters, + originalTool.executeConfig, + originalTool.getHeaders(), + options.experimental_preExecute + ); + return newTool; + } + const newTool = new BaseTool( + originalTool.name, + originalTool.description, + parameters, + originalTool.executeConfig, + originalTool.getHeaders(), + options.experimental_preExecute + ); + return newTool; } /** diff --git a/src/toolsets/base.ts b/src/toolsets/base.ts index b9e4f87..982dd7a 100644 --- a/src/toolsets/base.ts +++ b/src/toolsets/base.ts @@ -1,10 +1,5 @@ import { type BaseTool, Tools } from '../tool'; -import { - ParameterLocation, - type ParameterTransformer, - type ParameterTransformerMap, - type ToolDefinition, -} from '../types'; +import type { Experimental_ToolCreationOptions } from '../types'; /** * Base exception for toolset errors @@ -56,7 +51,6 @@ export interface BaseToolSetConfig { baseUrl?: string; authentication?: AuthenticationConfig; headers?: Record; - transformers?: ParameterTransformerMap; _oasUrl?: string; } @@ -68,7 +62,6 @@ export abstract class ToolSet { protected authentication?: AuthenticationConfig; protected headers: Record; protected tools: BaseTool[] = []; - protected transformers: ParameterTransformerMap; /** * Initialize a toolset with optional configuration @@ -78,7 +71,6 @@ export abstract class ToolSet { this.baseUrl = config?.baseUrl; this.authentication = config?.authentication; this.headers = config?.headers || {}; - this.transformers = new Map(config?.transformers || []); // Set Authentication headers if provided if (this.authentication) { @@ -113,15 +105,6 @@ export abstract class ToolSet { } } - /** - * Add a parameter transformer to the toolset - * @param sourceParam Source parameter name - * @param config Transformer configuration - */ - public setParameterTransformer(sourceParam: string, config: ParameterTransformer): void { - this.transformers.set(sourceParam, config); - } - /** * Check if a tool name matches a filter pattern * @param toolName Tool name to check @@ -206,74 +189,48 @@ export abstract class ToolSet { * @param headers Optional headers to apply to the tool * @returns Tool instance */ - getTool(name: string, headers?: Record): BaseTool { + getTool(name: string, headers?: Record): BaseTool; + getTool(name: string, options: Experimental_ToolCreationOptions): BaseTool; + getTool( + name: string, + headersOrOptions?: Record | Experimental_ToolCreationOptions + ): BaseTool { const tool = this.tools.find((tool) => tool.name === name); if (!tool) { throw new ToolSetError(`Tool with name ${name} not found`); } - const mergedHeaders = { ...this.headers, ...headers }; - if (mergedHeaders && tool.setHeaders) { - tool.setHeaders(mergedHeaders); - } - return tool; - } - /** - * Process transformed parameters in a tool definition - * @param toolDef Tool definition to process - * @returns Updated tool definition with transformed parameters - */ - protected processDerivedValues(toolDef: ToolDefinition): ToolDefinition { - // Create a copy of the tool definition to avoid modifying the original - const processedDef = { ...toolDef }; - - // Process each parameter in the execute config - for (const param of processedDef.execute.params) { - // Skip parameters that are already derived - if (param.derivedFrom) continue; - - // Check if this parameter is a source for any derivation config - if (this.transformers.has(param.name)) { - const config = this.transformers.get(param.name); - - // Only proceed if config exists - if (config) { - // Add transformed parameters to the tool definition - for (const targetParam of Object.keys(config.transforms)) { - // Skip if the parameter already exists in execute params - if (processedDef.execute.params.some((p) => p.name === targetParam)) continue; - - // Add the transformed parameter to execute params - processedDef.execute.params.push({ - name: targetParam, - location: this.determineParameterLocation(targetParam), - type: param.type, - derivedFrom: param.name, - }); - } - } - } - } + // Determine if the second parameter is headers or experimental options + const isExperimentalOptions = + headersOrOptions && + ('experimental_schemaOverride' in headersOrOptions || + 'experimental_preExecute' in headersOrOptions); - return processedDef; - } + if (isExperimentalOptions) { + const options = headersOrOptions as Experimental_ToolCreationOptions; - /** - * Determine the location of a parameter - * @param paramName Parameter name - * @returns Parameter location (HEADER, QUERY, PATH, or BODY) - */ - protected determineParameterLocation(paramName: string): ParameterLocation { - // Check if the parameter exists in any of the tools - for (const tool of this.tools) { - // Check if the parameter exists in the execute config - const param = tool.executeConfig.params.find((p) => p.name === paramName); - if (param) { - return param.location; + // Get the tools collection and use its getTool method with experimental options + const toolsCollection = new Tools([tool]); + const experimentalTool = toolsCollection.getTool(name, options); + + if (!experimentalTool) { + throw new ToolSetError(`Tool with name ${name} not found`); + } + + // Apply instance headers to the tool + if (this.headers && experimentalTool.setHeaders) { + experimentalTool.setHeaders(this.headers); } + + return experimentalTool; } - // Default to BODY if not found - return ParameterLocation.BODY; + // Traditional headers-based approach + const headers = headersOrOptions as Record | undefined; + const mergedHeaders = { ...this.headers, ...headers }; + if (mergedHeaders && tool.setHeaders) { + tool.setHeaders(mergedHeaders); + } + return tool; } } diff --git a/src/toolsets/openapi.ts b/src/toolsets/openapi.ts index a9a0fb1..45c017e 100644 --- a/src/toolsets/openapi.ts +++ b/src/toolsets/openapi.ts @@ -39,7 +39,6 @@ export class OpenAPIToolSet extends ToolSet { baseUrl: config?.baseUrl, authentication: config?.authentication, headers: config?.headers, - transformers: config?.transformers, }); if ('filePath' in config) { @@ -67,7 +66,6 @@ export class OpenAPIToolSet extends ToolSet { baseUrl: config.baseUrl, authentication: config.authentication, headers: config.headers, - transformers: config.transformers, _oasUrl: config.url, }); @@ -88,11 +86,8 @@ export class OpenAPIToolSet extends ToolSet { // Process each tool for (const [toolName, toolDef] of Object.entries(tools)) { - // Process derived values - const processedDef = this.processDerivedValues(toolDef); - // Create tool - const tool = this.createTool(toolName, processedDef); + const tool = this.createTool(toolName, toolDef); // Add tool to the list this.tools.push(tool); @@ -116,11 +111,8 @@ export class OpenAPIToolSet extends ToolSet { // Process each tool for (const [toolName, toolDef] of Object.entries(tools)) { - // Process derived values - const processedDef = this.processDerivedValues(toolDef); - // Create tool - const tool = this.createTool(toolName, processedDef); + const tool = this.createTool(toolName, toolDef); // Add tool to the list this.tools.push(tool); @@ -141,14 +133,7 @@ export class OpenAPIToolSet extends ToolSet { private createTool(toolName: string, toolDef: ToolDefinition): BaseTool { // Create tool const { description, parameters, execute } = toolDef; - const tool = new BaseTool( - toolName, - description, - parameters, - execute, - this.headers, - this.transformers - ); + const tool = new BaseTool(toolName, description, parameters, execute, this.headers); return tool; } diff --git a/src/toolsets/stackone.ts b/src/toolsets/stackone.ts index 423f3b0..907b5a9 100644 --- a/src/toolsets/stackone.ts +++ b/src/toolsets/stackone.ts @@ -1,9 +1,8 @@ import { loadStackOneSpecs } from '../openapi/loader'; import { StackOneTool, type Tools } from '../tool'; -import type { ParameterTransformer, ToolDefinition } from '../types'; -import { extractFileInfo, isValidFilePath, readFileAsBase64 } from '../utils/file'; +import type { ToolDefinition } from '../types'; import { removeJsonSchemaProperty } from '../utils/schema'; -import { type BaseToolSetConfig, ToolSet, ToolSetConfigError, ToolSetError } from './base'; +import { type BaseToolSetConfig, ToolSet, ToolSetConfigError } from './base'; /** * Configuration for StackOne toolset @@ -76,65 +75,15 @@ export class StackOneToolSet extends ToolSet { baseUrl: config?.baseUrl, authentication, headers, - transformers: config?.transformers, }); this.accountId = accountId; this._removedParams = ['source_value']; - // Add default parameter transformers - const defaultTransformers = StackOneToolSet.getDefaultParameterTransformers(); - for (const [sourceParam, config] of defaultTransformers.entries()) { - this.setParameterTransformer(sourceParam, config); - } - // Load tools this.loadTools(); } - /** - * Get the default derivation configurations for StackOne tools - */ - private static getDefaultParameterTransformers(): Map { - const transformers = new Map(); - - // File path derivation config - transformers.set('file_path', { - transforms: { - content: (filePath: unknown): string => { - if (typeof filePath !== 'string') { - throw new ToolSetError('file_path must be a string'); - } - - if (!isValidFilePath(filePath)) { - throw new ToolSetError(`Invalid file path or file not found: ${filePath}`); - } - - return readFileAsBase64(filePath); - }, - name: (filePath: unknown): string => { - if (typeof filePath !== 'string') { - throw new ToolSetError('file_path must be a string'); - } - - const { fileName } = extractFileInfo(filePath); - return fileName; - }, - file_format: (filePath: unknown): { value: string } => { - if (typeof filePath !== 'string') { - throw new ToolSetError('file_path must be a string'); - } - - // get the file extension - const { extension } = extractFileInfo(filePath); - return { value: extension || '' }; - }, - }, - }); - - return transformers; - } - /** * Get StackOne tools matching a filter pattern * @param filterPattern Optional glob pattern or array of patterns to filter tools @@ -173,25 +122,18 @@ export class StackOneToolSet extends ToolSet { for (const [_, tools] of Object.entries(specs)) { // Process each tool for (const [toolName, toolDef] of Object.entries(tools)) { - // Process derived values - const processedDef = this.processDerivedValues(toolDef); - // Remove account ID parameter if not provided if (!this.accountId) { - this.removeAccountIdParameter(processedDef); + this.removeAccountIdParameter(toolDef); } - // Add transformation source parameters to the tool's parameters schema - this.addTransformationSourceParameters(processedDef); - // Create tool const tool = new StackOneTool( toolName, - processedDef.description, - processedDef.parameters, - processedDef.execute, - this.headers, - this.transformers + toolDef.description, + toolDef.parameters, + toolDef.execute, + this.headers ); // Add tool to the list @@ -217,27 +159,4 @@ export class StackOneToolSet extends ToolSet { ); } } - - /** - * Add transformation source parameters to the tool's parameters schema - * This ensures parameters like file_path are included in the schema for model consumption - * @param toolDef Tool definition to modify - */ - private addTransformationSourceParameters(toolDef: ToolDefinition): void { - // Skip if there are no transformers or no parameters - if (!this.transformers || !toolDef.parameters.properties) return; - - // Add each transformer source parameter to the schema - for (const [sourceParam, _] of this.transformers.entries()) { - // Skip if the parameter is already in the schema - if (sourceParam in toolDef.parameters.properties) continue; - - // Add the parameter to the schema - toolDef.parameters.properties[sourceParam] = { - type: 'string', - description: - 'Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.', - }; - } - } } diff --git a/src/toolsets/tests/__snapshots__/stackone.spec.ts.snap b/src/toolsets/tests/__snapshots__/stackone.spec.ts.snap index dd85573..0653d38 100644 --- a/src/toolsets/tests/__snapshots__/stackone.spec.ts.snap +++ b/src/toolsets/tests/__snapshots__/stackone.spec.ts.snap @@ -47,20 +47,8 @@ Tools { ], "url": "https://api.stackone.com/unified/hris/companies", }, + "experimental_preExecute": undefined, "name": "hris_list_companies", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -68,10 +56,6 @@ Map { "example": "id,remote_id,name,full_name,display_name,created_at,updated_at", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "filter": { "description": "Filter parameters that allow greater customisation of the list response", "properties": { @@ -186,20 +170,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/companies/{id}", }, + "experimental_preExecute": undefined, "name": "hris_get_company", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -207,10 +179,6 @@ Map { "example": "id,remote_id,name,full_name,display_name,created_at,updated_at", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -310,20 +278,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/custom_field_definitions/employees", }, + "experimental_preExecute": undefined, "name": "hris_list_employee_custom_field_definitions", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -331,10 +287,6 @@ Map { "example": "id,remote_id,name,description,type,options", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "filter": { "description": "Filter parameters that allow greater customisation of the list response", "properties": { @@ -464,20 +416,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/custom_field_definitions/employees/{id}", }, + "experimental_preExecute": undefined, "name": "hris_get_employee_custom_field_definition", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -485,10 +425,6 @@ Map { "example": "id,remote_id,name,description,type,options", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "filter": { "description": "Filter parameters that allow greater customisation of the list response", "properties": { @@ -633,20 +569,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees", }, + "experimental_preExecute": undefined, "name": "hris_list_employees", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -656,11 +580,7 @@ Map { }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,benefits,employee_number,national_identity_number,national_identity_numbers,skills", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,benefits,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,employee_number,national_identity_number,national_identity_numbers,skills", "type": "string", }, "filter": { @@ -822,6 +742,11 @@ Map { "name": "work_phone_number", "type": "string", }, + { + "location": "body", + "name": "job_id", + "type": "string", + }, { "location": "body", "name": "job_title", @@ -892,6 +817,16 @@ Map { "name": "start_date", "type": "string", }, + { + "location": "body", + "name": "employment_type", + "type": "object", + }, + { + "location": "body", + "name": "employment_contract_type", + "type": "object", + }, { "location": "body", "name": "employment_status", @@ -960,20 +895,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees", }, + "experimental_preExecute": undefined, "name": "hris_create_employee", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "avatar": { @@ -1411,7 +1334,7 @@ Map { }, "date_of_birth": { "description": "The employee date_of_birth", - "example": "1990-01-01T00:00:00.000Z", + "example": "1990-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -1438,51 +1361,63 @@ Map { "employment": { "description": "The employee employment", "properties": { - "end_date": { - "description": "The end date of employment", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "grade": { - "description": "Represents the employee’s position within the organizational hierarchy.", + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", "properties": { - "description": { - "description": "description of the grade", - "example": "Mid-level employee demonstrating proficiency and autonomy.", - "type": "string", - }, - "id": { - "description": "The reference id", - "example": "1687-3", - "type": "string", - }, - "name": { - "description": "The reference name", - "example": "1687-4", + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], "type": "string", }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + }, + "type": "object", + }, + "employment_type": { + "description": "The type of employment (e.g., contractor, permanent)", + "example": "permanent", + "properties": { + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], "type": "string", }, }, "type": "object", }, + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, "job_title": { "description": "The job title of the employee", "example": "Software Engineer", "type": "string", }, - "passthrough": { - "additionalProperties": true, - "description": "Value to pass through to the provider", - "example": { - "other_known_names": "John Doe", - }, - "type": "object", - }, "pay_currency": { "description": "The currency used for pay", "example": "USD", @@ -1544,9 +1479,10 @@ Map { "example": "40.00", "type": "string", }, - "payroll_code": { - "description": "The payroll code of the employee", - "example": "PC1", + "time_worked": { + "description": "The time worked for the employee in ISO 8601 duration format", + "example": "P0Y0M0DT8H0M0S", + "format": "duration", "type": "string", }, "unified_custom_fields": { @@ -1558,36 +1494,22 @@ Map { }, "type": "object", }, - "work_time": { - "properties": { - "duration": { - "description": "The work time duration in ISO 8601 duration format", - "example": "P0Y0M0DT8H0M0S", - "format": "duration", - "type": "string", - }, - "duration_unit": { - "description": "The duration unit of the work time", - "example": "month", - "properties": { - "value": { - "description": "The unified value for the period.", - "enum": [ - "day", - "week", - "month", - "year", - "unmapped_value", - null, - ], - "example": "month", - "type": "string", - }, - }, - "type": "object", - }, - }, - "type": "object", + }, + "type": "object", + }, + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", + "properties": { + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], + "type": "string", }, }, "type": "object", @@ -1612,6 +1534,36 @@ Map { }, "type": "object", }, + "employment_type": { + "description": "The employee employment type", + "example": "full_time", + "properties": { + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], + "type": "string", + }, + }, + "type": "object", + }, "ethnicity": { "description": "The employee ethnicity", "example": "white", @@ -1635,10 +1587,6 @@ Map { }, "type": "object", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "first_name": { "description": "The employee first name", "example": "Isaac", @@ -1666,7 +1614,7 @@ Map { }, "hire_date": { "description": "The employee hire date", - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -1993,8 +1941,13 @@ Map { }, "type": "object", }, + "job_id": { + "description": "The employee job id", + "example": "R-6789", + "type": "string", + }, "job_title": { - "description": "If the source of the job_title is the Employee's current Employment, and that Employment pertains exclusively to this Employee, then the active Employment job_title will also be written", + "description": "The employee job title", "example": "Physicist", "type": "string", }, @@ -2489,7 +2442,7 @@ Map { }, "preferred_language": { "description": "The employee preferred language", - "example": "eng", + "example": "en_US", "properties": { "value": { "description": "The ISO639-2 Code of the language", @@ -2509,7 +2462,6 @@ Map { "cat", "cha", "ces", - "dan", "deu", "div", "dzo", @@ -2526,7 +2478,6 @@ Map { "fra", "gle", "grn", - "guj", "glv", "heb", "hin", @@ -2557,8 +2508,6 @@ Map { "mah", "mri", "mkd", - "mon", - "mar", "msa", "mlt", "mya", @@ -2573,18 +2522,15 @@ Map { "pol", "pus", "por", - "que", "rar", "roh", "rup", "ron", "rus", "kin", - "sme", "sag", "sin", "slk", - "slv", "smo", "sna", "som", @@ -2594,24 +2540,11 @@ Map { "swe", "swa", "tam", - "tel", "tgk", "tha", "tir", "tig", - "tuk", - "tsn", - "ton", - "tur", - "tso", - "ukr", - "urd", - "uzb", - "ven", - "vie", - "xho", "zho", - "zul", "unmapped_value", null, ], @@ -2623,7 +2556,7 @@ Map { }, "start_date": { "description": "The employee start date", - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -3033,6 +2966,11 @@ Map { "name": "work_phone_number", "type": "string", }, + { + "location": "body", + "name": "job_id", + "type": "string", + }, { "location": "body", "name": "job_title", @@ -3103,6 +3041,16 @@ Map { "name": "start_date", "type": "string", }, + { + "location": "body", + "name": "employment_type", + "type": "object", + }, + { + "location": "body", + "name": "employment_contract_type", + "type": "object", + }, { "location": "body", "name": "employment_status", @@ -3216,20 +3164,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}", }, + "experimental_preExecute": undefined, "name": "hris_get_employee", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -3239,11 +3175,7 @@ Map { }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,benefits,employee_number,national_identity_number,national_identity_numbers,skills", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,benefits,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,documents,created_at,updated_at,employee_number,national_identity_number,national_identity_numbers,skills", "type": "string", }, "id": { @@ -3377,6 +3309,11 @@ Map { "name": "work_phone_number", "type": "string", }, + { + "location": "body", + "name": "job_id", + "type": "string", + }, { "location": "body", "name": "job_title", @@ -3447,6 +3384,16 @@ Map { "name": "start_date", "type": "string", }, + { + "location": "body", + "name": "employment_type", + "type": "object", + }, + { + "location": "body", + "name": "employment_contract_type", + "type": "object", + }, { "location": "body", "name": "employment_status", @@ -3510,20 +3457,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}", }, + "experimental_preExecute": undefined, "name": "hris_update_employee", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "avatar": { @@ -3939,7 +3874,7 @@ Map { }, "date_of_birth": { "description": "The employee date_of_birth", - "example": "1990-01-01T00:00:00.000Z", + "example": "1990-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -3966,51 +3901,63 @@ Map { "employment": { "description": "The employee employment", "properties": { - "end_date": { - "description": "The end date of employment", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "grade": { - "description": "Represents the employee’s position within the organizational hierarchy.", + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", "properties": { - "description": { - "description": "description of the grade", - "example": "Mid-level employee demonstrating proficiency and autonomy.", - "type": "string", - }, - "id": { - "description": "The reference id", - "example": "1687-3", - "type": "string", - }, - "name": { - "description": "The reference name", - "example": "1687-4", + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], "type": "string", }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + }, + "type": "object", + }, + "employment_type": { + "description": "The type of employment (e.g., contractor, permanent)", + "example": "permanent", + "properties": { + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], "type": "string", }, }, "type": "object", }, + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, "job_title": { "description": "The job title of the employee", "example": "Software Engineer", "type": "string", }, - "passthrough": { - "additionalProperties": true, - "description": "Value to pass through to the provider", - "example": { - "other_known_names": "John Doe", - }, - "type": "object", - }, "pay_currency": { "description": "The currency used for pay", "example": "USD", @@ -4072,9 +4019,10 @@ Map { "example": "40.00", "type": "string", }, - "payroll_code": { - "description": "The payroll code of the employee", - "example": "PC1", + "time_worked": { + "description": "The time worked for the employee in ISO 8601 duration format", + "example": "P0Y0M0DT8H0M0S", + "format": "duration", "type": "string", }, "unified_custom_fields": { @@ -4086,36 +4034,22 @@ Map { }, "type": "object", }, - "work_time": { - "properties": { - "duration": { - "description": "The work time duration in ISO 8601 duration format", - "example": "P0Y0M0DT8H0M0S", - "format": "duration", - "type": "string", - }, - "duration_unit": { - "description": "The duration unit of the work time", - "example": "month", - "properties": { - "value": { - "description": "The unified value for the period.", - "enum": [ - "day", - "week", - "month", - "year", - "unmapped_value", - null, - ], - "example": "month", - "type": "string", - }, - }, - "type": "object", - }, - }, - "type": "object", + }, + "type": "object", + }, + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", + "properties": { + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], + "type": "string", }, }, "type": "object", @@ -4140,6 +4074,36 @@ Map { }, "type": "object", }, + "employment_type": { + "description": "The employee employment type", + "example": "full_time", + "properties": { + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], + "type": "string", + }, + }, + "type": "object", + }, "ethnicity": { "description": "The employee ethnicity", "example": "white", @@ -4163,10 +4127,6 @@ Map { }, "type": "object", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "first_name": { "description": "The employee first name", "example": "Isaac", @@ -4194,7 +4154,7 @@ Map { }, "hire_date": { "description": "The employee hire date", - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -4524,8 +4484,13 @@ Map { "id": { "type": "string", }, + "job_id": { + "description": "The employee job id", + "example": "R-6789", + "type": "string", + }, "job_title": { - "description": "If the source of the job_title is the Employee's current Employment, and that Employment pertains exclusively to this Employee, then the active Employment job_title will also be written", + "description": "The employee job title", "example": "Physicist", "type": "string", }, @@ -5020,7 +4985,7 @@ Map { }, "preferred_language": { "description": "The employee preferred language", - "example": "eng", + "example": "en_US", "properties": { "value": { "description": "The ISO639-2 Code of the language", @@ -5040,7 +5005,6 @@ Map { "cat", "cha", "ces", - "dan", "deu", "div", "dzo", @@ -5057,7 +5021,6 @@ Map { "fra", "gle", "grn", - "guj", "glv", "heb", "hin", @@ -5088,8 +5051,6 @@ Map { "mah", "mri", "mkd", - "mon", - "mar", "msa", "mlt", "mya", @@ -5104,18 +5065,15 @@ Map { "pol", "pus", "por", - "que", "rar", "roh", "rup", "ron", "rus", "kin", - "sme", "sag", "sin", "slk", - "slv", "smo", "sna", "som", @@ -5125,24 +5083,11 @@ Map { "swe", "swa", "tam", - "tel", "tgk", "tha", "tir", "tig", - "tuk", - "tsn", - "ton", - "tur", - "tso", - "ukr", - "urd", - "uzb", - "ven", - "vie", - "xho", "zho", - "zul", "unmapped_value", null, ], @@ -5154,7 +5099,7 @@ Map { }, "start_date": { "description": "The employee start date", - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -5571,6 +5516,11 @@ Map { "name": "work_phone_number", "type": "string", }, + { + "location": "body", + "name": "job_id", + "type": "string", + }, { "location": "body", "name": "job_title", @@ -5641,6 +5591,16 @@ Map { "name": "start_date", "type": "string", }, + { + "location": "body", + "name": "employment_type", + "type": "object", + }, + { + "location": "body", + "name": "employment_contract_type", + "type": "object", + }, { "location": "body", "name": "employment_status", @@ -5729,26 +5689,10 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/invite", }, + "experimental_preExecute": undefined, "name": "hris_invite_employee", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -5847,20 +5791,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off", }, + "experimental_preExecute": undefined, "name": "hris_list_employee_time_off_requests", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -5870,11 +5802,7 @@ Map { }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "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,time_off_policy_id,remote_time_off_policy_id,reason,duration,created_at,updated_at,policy", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "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,policy", "type": "string", }, "filter": { @@ -5995,6 +5923,11 @@ Map { "name": "id", "type": "string", }, + { + "location": "body", + "name": "employee_id", + "type": "string", + }, { "location": "body", "name": "approver_id", @@ -6043,20 +5976,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off", }, + "experimental_preExecute": undefined, "name": "hris_create_employee_time_off_request", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "approver_id": { @@ -6064,10 +5985,15 @@ Map { "example": "1687-4", "type": "string", }, + "employee_id": { + "description": "The employee ID", + "example": "1687-3", + "type": "string", + }, "end_date": { - "description": "Inclusive end date of the time off request (ISO8601 date-time without timezone). The time off includes this day", - "example": "2021-01-01T01:01:01.000", - "format": "datetime-local", + "description": "The end date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, "end_half_day": { @@ -6086,11 +6012,7 @@ Map { }, ], }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, - "id": { + "id": { "type": "string", }, "passthrough": { @@ -6120,9 +6042,9 @@ Map { "type": "object", }, "start_date": { - "description": "The start date of the time off request (ISO8601 date-time without timezone)", - "example": "2021-01-01T01:01:01.000", - "format": "datetime-local", + "description": "The start date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, "start_half_day": { @@ -6151,7 +6073,6 @@ Map { "rejected", "pending", "deleted", - "draft", "unmapped_value", null, ], @@ -6189,6 +6110,11 @@ Map { "name": "id", "type": "string", }, + { + "location": "body", + "name": "employee_id", + "type": "string", + }, { "location": "body", "name": "approver_id", @@ -6282,20 +6208,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off/{subResourceId}", }, + "experimental_preExecute": undefined, "name": "hris_get_employees_time_off_request", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -6305,11 +6219,7 @@ Map { }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "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,time_off_policy_id,remote_time_off_policy_id,reason,duration,created_at,updated_at,policy", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "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,policy", "type": "string", }, "id": { @@ -6382,69 +6292,10 @@ Map { }, }, StackOneTool { - "description": "Cancel Employee Time Off Request", + "description": "Update Employee Time Off Request", "executeConfig": { "bodyType": "json", - "method": "DELETE", - "params": [ - { - "location": "header", - "name": "x-account-id", - "type": "string", - }, - { - "location": "path", - "name": "id", - "type": "string", - }, - { - "location": "path", - "name": "subResourceId", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off/{subResourceId}", - }, - "name": "hris_cancel_employee_time_off_request", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, - "parameters": { - "properties": { - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, - "id": { - "type": "string", - }, - "subResourceId": { - "type": "string", - }, - "x-account-id": undefined, - }, - "required": [ - "id", - "subResourceId", - ], - "type": "object", - }, - "requestBuilder": RequestBuilder { - "bodyType": "json", - "headers": { - "Authorization": "Basic dGVzdF9rZXk6", - }, - "method": "DELETE", + "method": "PATCH", "params": [ { "location": "header", @@ -6461,29 +6312,9 @@ Map { "name": "subResourceId", "type": "string", }, - ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off/{subResourceId}", - }, - }, - StackOneTool { - "description": "Update Employee Time Off Request", - "executeConfig": { - "bodyType": "json", - "method": "PATCH", - "params": [ - { - "location": "header", - "name": "x-account-id", - "type": "string", - }, - { - "location": "path", - "name": "id", - "type": "string", - }, { - "location": "path", - "name": "subResourceId", + "location": "body", + "name": "employee_id", "type": "string", }, { @@ -6534,20 +6365,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off/{subResourceId}", }, + "experimental_preExecute": undefined, "name": "hris_update_employee_time_off_request", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "approver_id": { @@ -6555,10 +6374,15 @@ Map { "example": "1687-4", "type": "string", }, + "employee_id": { + "description": "The employee ID", + "example": "1687-3", + "type": "string", + }, "end_date": { - "description": "Inclusive end date of the time off request (ISO8601 date-time without timezone). The time off includes this day", - "example": "2021-01-01T01:01:01.000", - "format": "datetime-local", + "description": "The end date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, "end_half_day": { @@ -6577,10 +6401,6 @@ Map { }, ], }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -6611,9 +6431,9 @@ Map { "type": "object", }, "start_date": { - "description": "The start date of the time off request (ISO8601 date-time without timezone)", - "example": "2021-01-01T01:01:01.000", - "format": "datetime-local", + "description": "The start date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, "start_half_day": { @@ -6642,7 +6462,6 @@ Map { "rejected", "pending", "deleted", - "draft", "unmapped_value", null, ], @@ -6689,6 +6508,11 @@ Map { "name": "subResourceId", "type": "string", }, + { + "location": "body", + "name": "employee_id", + "type": "string", + }, { "location": "body", "name": "approver_id", @@ -6762,26 +6586,10 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/upload/batch", }, + "experimental_preExecute": undefined, "name": "hris_batch_upload_employee_document", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -6845,7 +6653,6 @@ Map { "enum": [ "true", "false", - "unmapped_value", null, ], "example": "true", @@ -8176,31 +7983,19 @@ Map { }, { "location": "body", - "name": "confidential", + "name": "category", "type": "object", }, { "location": "body", - "name": "category", + "name": "confidential", "type": "object", }, ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/upload", }, + "experimental_preExecute": undefined, "name": "hris_upload_employee_document", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "category": { @@ -8259,7 +8054,6 @@ Map { "enum": [ "true", "false", - "unmapped_value", null, ], "example": "true", @@ -9498,10 +9292,6 @@ Map { }, "type": "object", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -9566,12 +9356,12 @@ Map { }, { "location": "body", - "name": "confidential", + "name": "category", "type": "object", }, { "location": "body", - "name": "category", + "name": "confidential", "type": "object", }, ], @@ -9604,39 +9394,13 @@ Map { "name": "format", "type": "string", }, - { - "location": "query", - "name": "export_format", - "type": "string", - }, ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/{subResourceId}/download", }, + "experimental_preExecute": undefined, "name": "hris_download_employee_document", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { - "export_format": { - "description": "The export format of the file", - "example": "text/plain", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "format": { "description": "The format to download the file in", "example": "base64", @@ -9683,11 +9447,6 @@ Map { "name": "format", "type": "string", }, - { - "location": "query", - "name": "export_format", - "type": "string", - }, ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/{subResourceId}/download", }, @@ -9741,20 +9500,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents", }, + "experimental_preExecute": undefined, "name": "hris_list_employee_documents", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -9762,10 +9509,6 @@ Map { "example": "id,remote_id,name,path,type,category,category_id,remote_category_id,contents,created_at,updated_at,remote_url,file_format", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "filter": { "description": "Filter parameters that allow greater customisation of the list response", "properties": { @@ -9895,20 +9638,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/documents/{subResourceId}", }, + "experimental_preExecute": undefined, "name": "hris_get_employee_document", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -9916,10 +9647,6 @@ Map { "example": "id,remote_id,name,path,type,category,category_id,remote_category_id,contents,created_at,updated_at,remote_url,file_format", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -10028,20 +9755,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/documents/employee_categories", }, + "experimental_preExecute": undefined, "name": "hris_list_employee_categories", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -10049,10 +9764,6 @@ Map { "example": "id,remote_id,name,active", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "filter": { "description": "Filter parameters that allow greater customisation of the list response", "properties": { @@ -10167,20 +9878,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/documents/employee_categories/{id}", }, + "experimental_preExecute": undefined, "name": "hris_get_employee_document_category", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -10188,10 +9887,6 @@ Map { "example": "id,remote_id,name,active", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -10296,20 +9991,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/work_eligibility", }, + "experimental_preExecute": undefined, "name": "hris_list_employee_work_eligibility", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -10317,10 +10000,6 @@ Map { "example": "id,remote_id,type,sub_type,document,valid_from,valid_to,issued_by,number", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "filter": { "description": "Filter parameters that allow greater customisation of the list response", "properties": { @@ -10470,20 +10149,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/work_eligibility", }, + "experimental_preExecute": undefined, "name": "hris_create_employee_work_eligibility_request", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "document": { @@ -11769,10 +11436,6 @@ Map { }, "type": "object", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -12065,7 +11728,6 @@ Map { "driver_license", "birth_certificate", "other", - "unmapped_value", null, ], "type": "string", @@ -12074,12 +11736,12 @@ Map { "type": "object", }, "valid_from": { - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, "valid_to": { - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -12190,20 +11852,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/work_eligibility/{subResourceId}", }, + "experimental_preExecute": undefined, "name": "hris_get_employees_work_eligibility", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -12211,10 +11861,6 @@ Map { "example": "id,remote_id,type,sub_type,document,valid_from,valid_to,issued_by,number", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -12343,20 +11989,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/work_eligibility/{subResourceId}", }, + "experimental_preExecute": undefined, "name": "hris_update_employee_work_eligibility_request", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "document": { @@ -13642,10 +13276,6 @@ Map { }, "type": "object", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -13941,7 +13571,6 @@ Map { "driver_license", "birth_certificate", "other", - "unmapped_value", null, ], "type": "string", @@ -13950,12 +13579,12 @@ Map { "type": "object", }, "valid_from": { - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, "valid_to": { - "example": "2021-01-01T00:00:00.000Z", + "example": "2021-01-01T00:00.000Z", "format": "date-time", "type": "string", }, @@ -14087,20 +13716,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off_balances", }, + "experimental_preExecute": undefined, "name": "hris_list_employee_time_off_balances", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -14113,10 +13730,6 @@ Map { "example": "id,remote_id,employee_id,remote_employee_id,policy_id,remote_policy_id,policy,current_balance,initial_balance,balance_unit,balance_start_date,balance_expiry_date,updated_at", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "filter": { "description": "HRIS Time Off Balance filters", "properties": { @@ -14264,20 +13877,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off_balances/{subResourceId}", }, + "experimental_preExecute": undefined, "name": "hris_get_employee_time_off_balance", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -14290,10 +13891,6 @@ Map { "example": "id,remote_id,employee_id,remote_employee_id,policy_id,remote_policy_id,policy,current_balance,initial_balance,balance_unit,balance_start_date,balance_expiry_date,updated_at", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -14412,20 +14009,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employments", }, + "experimental_preExecute": undefined, "name": "hris_list_employments", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -14435,11 +14020,7 @@ Map { }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,end_date,employment_type,employment_contract_type,change_reason,grade,work_time,payroll_code,fte,created_at,updated_at,start_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,employment_type,employment_contract_type,time_worked,created_at,updated_at,start_date,end_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", "type": "string", }, "filter": { @@ -14566,20 +14147,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employments/{id}", }, + "experimental_preExecute": undefined, "name": "hris_get_employment", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -14589,11 +14158,7 @@ Map { }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,end_date,employment_type,employment_contract_type,change_reason,grade,work_time,payroll_code,fte,created_at,updated_at,start_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,employment_type,employment_contract_type,time_worked,created_at,updated_at,start_date,end_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", "type": "string", }, "id": { @@ -14710,20 +14275,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/employments", }, + "experimental_preExecute": undefined, "name": "hris_list_employee_employments", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -14733,11 +14286,7 @@ Map { }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,end_date,employment_type,employment_contract_type,change_reason,grade,work_time,payroll_code,fte,created_at,updated_at,start_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,employment_type,employment_contract_type,time_worked,created_at,updated_at,start_date,end_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", "type": "string", }, "filter": { @@ -14847,7 +14396,7 @@ Map { "type": "string", }, { - "location": "path", + "location": "body", "name": "id", "type": "string", }, @@ -14883,32 +14432,17 @@ Map { }, { "location": "body", - "name": "effective_date", - "type": "string", - }, - { - "location": "body", - "name": "end_date", - "type": "string", - }, - { - "location": "body", - "name": "grade", + "name": "employment_type", "type": "object", }, { "location": "body", - "name": "work_time", + "name": "employment_contract_type", "type": "object", }, { "location": "body", - "name": "payroll_code", - "type": "string", - }, - { - "location": "body", - "name": "job_id", + "name": "time_worked", "type": "string", }, { @@ -14919,70 +14453,60 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/employments", }, + "experimental_preExecute": undefined, "name": "hris_create_employee_employment", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { - "effective_date": { - "description": "The effective date of the employment contract", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "end_date": { - "description": "The end date of employment", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, - "grade": { - "description": "Represents the employee’s position within the organizational hierarchy.", + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", "properties": { - "description": { - "description": "description of the grade", - "example": "Mid-level employee demonstrating proficiency and autonomy.", - "type": "string", - }, - "id": { - "description": "The reference id", - "example": "1687-3", - "type": "string", - }, - "name": { - "description": "The reference name", - "example": "1687-4", + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], "type": "string", }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + }, + "type": "object", + }, + "employment_type": { + "description": "The type of employment (e.g., contractor, permanent)", + "example": "permanent", + "properties": { + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], "type": "string", }, }, "type": "object", }, "id": { - "type": "string", - }, - "job_id": { - "description": "The employee job id", - "example": "5290", + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", "type": "string", }, "job_title": { @@ -15059,9 +14583,10 @@ Map { "example": "40.00", "type": "string", }, - "payroll_code": { - "description": "The payroll code of the employee", - "example": "PC1", + "time_worked": { + "description": "The time worked for the employee in ISO 8601 duration format", + "example": "P0Y0M0DT8H0M0S", + "format": "duration", "type": "string", }, "unified_custom_fields": { @@ -15073,37 +14598,6 @@ Map { }, "type": "object", }, - "work_time": { - "properties": { - "duration": { - "description": "The work time duration in ISO 8601 duration format", - "example": "P0Y0M0DT8H0M0S", - "format": "duration", - "type": "string", - }, - "duration_unit": { - "description": "The duration unit of the work time", - "example": "month", - "properties": { - "value": { - "description": "The unified value for the period.", - "enum": [ - "day", - "week", - "month", - "year", - "unmapped_value", - null, - ], - "example": "month", - "type": "string", - }, - }, - "type": "object", - }, - }, - "type": "object", - }, "x-account-id": undefined, }, "required": [ @@ -15124,7 +14618,7 @@ Map { "type": "string", }, { - "location": "path", + "location": "body", "name": "id", "type": "string", }, @@ -15160,32 +14654,17 @@ Map { }, { "location": "body", - "name": "effective_date", - "type": "string", - }, - { - "location": "body", - "name": "end_date", - "type": "string", - }, - { - "location": "body", - "name": "grade", + "name": "employment_type", "type": "object", }, { "location": "body", - "name": "work_time", + "name": "employment_contract_type", "type": "object", }, { "location": "body", - "name": "payroll_code", - "type": "string", - }, - { - "location": "body", - "name": "job_id", + "name": "time_worked", "type": "string", }, { @@ -15241,20 +14720,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/employments/{subResourceId}", }, + "experimental_preExecute": undefined, "name": "hris_get_employee_employment", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -15264,11 +14731,7 @@ Map { }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,end_date,employment_type,employment_contract_type,change_reason,grade,work_time,payroll_code,fte,created_at,updated_at,start_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,employee_id,remote_employee_id,job_title,pay_rate,pay_period,pay_frequency,pay_currency,effective_date,employment_type,employment_contract_type,time_worked,created_at,updated_at,start_date,end_date,active,department,team,cost_center,cost_centers,division,job,type,contract_type,manager", "type": "string", }, "id": { @@ -15352,7 +14815,7 @@ Map { "type": "string", }, { - "location": "path", + "location": "body", "name": "id", "type": "string", }, @@ -15393,27 +14856,17 @@ Map { }, { "location": "body", - "name": "effective_date", - "type": "string", - }, - { - "location": "body", - "name": "end_date", - "type": "string", - }, - { - "location": "body", - "name": "grade", + "name": "employment_type", "type": "object", }, { "location": "body", - "name": "work_time", + "name": "employment_contract_type", "type": "object", }, { "location": "body", - "name": "payroll_code", + "name": "time_worked", "type": "string", }, { @@ -15424,65 +14877,60 @@ Map { ], "url": "https://api.stackone.com/unified/hris/employees/{id}/employments/{subResourceId}", }, + "experimental_preExecute": undefined, "name": "hris_update_employee_employment", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { - "effective_date": { - "description": "The effective date of the employment contract", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "end_date": { - "description": "The end date of employment", - "example": "2021-01-01T01:01:01.000Z", - "format": "date-time", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, - "grade": { - "description": "Represents the employee’s position within the organizational hierarchy.", + "employment_contract_type": { + "description": "The employment work schedule type (e.g., full-time, part-time)", + "example": "full_time", "properties": { - "description": { - "description": "description of the grade", - "example": "Mid-level employee demonstrating proficiency and autonomy.", - "type": "string", - }, - "id": { - "description": "The reference id", - "example": "1687-3", - "type": "string", - }, - "name": { - "description": "The reference name", - "example": "1687-4", + "value": { + "enum": [ + "full_time", + "shifts", + "part_time", + "unmapped_value", + null, + ], "type": "string", }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + }, + "type": "object", + }, + "employment_type": { + "description": "The type of employment (e.g., contractor, permanent)", + "example": "permanent", + "properties": { + "value": { + "enum": [ + "contractor", + "intern", + "permanent", + "apprentice", + "freelance", + "terminated", + "temporary", + "seasonal", + "volunteer", + "probation", + "internal", + "external", + "expatriate", + "employer_of_record", + "casual", + "Programme", + "unmapped_value", + null, + ], "type": "string", }, }, "type": "object", }, "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", "type": "string", }, "job_title": { @@ -15559,12 +15007,13 @@ Map { "example": "40.00", "type": "string", }, - "payroll_code": { - "description": "The payroll code of the employee", - "example": "PC1", + "subResourceId": { "type": "string", }, - "subResourceId": { + "time_worked": { + "description": "The time worked for the employee in ISO 8601 duration format", + "example": "P0Y0M0DT8H0M0S", + "format": "duration", "type": "string", }, "unified_custom_fields": { @@ -15576,37 +15025,6 @@ Map { }, "type": "object", }, - "work_time": { - "properties": { - "duration": { - "description": "The work time duration in ISO 8601 duration format", - "example": "P0Y0M0DT8H0M0S", - "format": "duration", - "type": "string", - }, - "duration_unit": { - "description": "The duration unit of the work time", - "example": "month", - "properties": { - "value": { - "description": "The unified value for the period.", - "enum": [ - "day", - "week", - "month", - "year", - "unmapped_value", - null, - ], - "example": "month", - "type": "string", - }, - }, - "type": "object", - }, - }, - "type": "object", - }, "x-account-id": undefined, }, "required": [ @@ -15628,7 +15046,7 @@ Map { "type": "string", }, { - "location": "path", + "location": "body", "name": "id", "type": "string", }, @@ -15669,27 +15087,17 @@ Map { }, { "location": "body", - "name": "effective_date", - "type": "string", - }, - { - "location": "body", - "name": "end_date", - "type": "string", - }, - { - "location": "body", - "name": "grade", + "name": "employment_type", "type": "object", }, { "location": "body", - "name": "work_time", + "name": "employment_contract_type", "type": "object", }, { "location": "body", - "name": "payroll_code", + "name": "time_worked", "type": "string", }, { @@ -15745,20 +15153,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/locations", }, + "experimental_preExecute": undefined, "name": "hris_list_locations", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -15766,10 +15162,6 @@ Map { "example": "id,remote_id,employee_id,remote_employee_id,name,phone_number,street_1,street_2,city,state,zip_code,country,location_type,created_at,updated_at", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "filter": { "description": "Filter parameters that allow greater customisation of the list response", "properties": { @@ -15884,20 +15276,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/locations/{id}", }, + "experimental_preExecute": undefined, "name": "hris_get_location", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "fields": { @@ -15905,10 +15285,6 @@ Map { "example": "id,remote_id,employee_id,remote_employee_id,name,phone_number,street_1,street_2,city,state,zip_code,country,location_type,created_at,updated_at", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -16013,20 +15389,8 @@ Map { ], "url": "https://api.stackone.com/unified/hris/time_off", }, + "experimental_preExecute": undefined, "name": "hris_list_time_off_requests", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, "parameters": { "properties": { "expand": { @@ -16036,11 +15400,7 @@ Map { }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "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,time_off_policy_id,remote_time_off_policy_id,reason,duration,created_at,updated_at,policy", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "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,policy", "type": "string", }, "filter": { @@ -16136,10 +15496,10 @@ Map { }, }, StackOneTool { - "description": "Get time off request", + "description": "Creates a time off request", "executeConfig": { "bodyType": "json", - "method": "GET", + "method": "POST", "params": [ { "location": "header", @@ -16147,221 +15507,165 @@ Map { "type": "string", }, { - "location": "path", - "name": "id", + "location": "body", + "name": "employee_id", "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", + "location": "body", + "name": "approver_id", + "type": "string", }, { - "location": "query", - "name": "proxy", + "location": "body", + "name": "status", "type": "object", }, { - "location": "query", - "name": "fields", + "location": "body", + "name": "start_date", "type": "string", }, { - "location": "query", - "name": "expand", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/time_off/{id}", - }, - "name": "hris_get_time_off_request", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, - "parameters": { - "properties": { - "expand": { - "description": "The comma separated list of fields that will be expanded in the response", - "example": "policy", - "type": "string", - }, - "fields": { - "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "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,time_off_policy_id,remote_time_off_policy_id,reason,duration,created_at,updated_at,policy", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "location": "body", + "name": "end_date", "type": "string", }, - "id": { + { + "location": "body", + "name": "start_half_day", "type": "string", }, - "proxy": { - "additionalProperties": true, - "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", - "type": "object", - }, - "raw": { - "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", - "type": "boolean", - }, - "x-account-id": undefined, - }, - "required": [ - "id", - ], - "type": "object", - }, - "requestBuilder": RequestBuilder { - "bodyType": "json", - "headers": { - "Authorization": "Basic dGVzdF9rZXk6", - }, - "method": "GET", - "params": [ { - "location": "header", - "name": "x-account-id", + "location": "body", + "name": "end_half_day", "type": "string", }, { - "location": "path", - "name": "id", + "location": "body", + "name": "time_off_policy_id", "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", + "location": "body", + "name": "reason", + "type": "object", }, { - "location": "query", - "name": "proxy", + "location": "body", + "name": "passthrough", "type": "object", }, - { - "location": "query", - "name": "fields", + ], + "url": "https://api.stackone.com/unified/hris/time_off", + }, + "experimental_preExecute": undefined, + "name": "hris_create_time_off_request", + "parameters": { + "properties": { + "approver_id": { + "description": "The approver ID", + "example": "1687-4", "type": "string", }, - { - "location": "query", - "name": "expand", + "employee_id": { + "description": "The employee ID", + "example": "1687-3", "type": "string", }, - ], - "url": "https://api.stackone.com/unified/hris/time_off/{id}", - }, - }, - StackOneTool { - "description": "List time off types", - "executeConfig": { - "bodyType": "json", - "method": "GET", - "params": [ - { - "location": "header", - "name": "x-account-id", + "end_date": { + "description": "The end date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, - { - "location": "query", - "name": "raw", - "type": "boolean", - }, - { - "location": "query", - "name": "proxy", - "type": "object", - }, - { - "location": "query", - "name": "fields", - "type": "string", + "end_half_day": { + "description": "True if the end of the time off request ends half way through the day", + "example": true, + "oneOf": [ + { + "type": "boolean", + }, + { + "enum": [ + "true", + "false", + ], + "type": "string", + }, + ], }, - { - "location": "query", - "name": "filter", + "passthrough": { + "additionalProperties": true, + "description": "Value to pass through to the provider", + "example": { + "other_known_names": "John Doe", + }, "type": "object", }, - { - "location": "query", - "name": "page_size", - "type": "string", - }, - { - "location": "query", - "name": "next", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/time_off_types", - }, - "name": "hris_list_time_off_types", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], + "reason": { + "properties": { + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, + "name": { + "type": "string", + }, + "remote_id": { + "description": "Provider's unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, }, + "type": "object", }, - } -, - }, - "parameters": { - "properties": { - "fields": { - "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,active", + "start_date": { + "description": "The start date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", + "start_half_day": { + "description": "True if the start of the time off request begins half way through the day", + "example": true, + "oneOf": [ + { + "type": "boolean", + }, + { + "enum": [ + "true", + "false", + ], + "type": "string", + }, + ], }, - "filter": { - "description": "Filter parameters that allow greater customisation of the list response", + "status": { + "description": "The status of the time off request", "properties": { - "updated_after": { - "additionalProperties": false, - "description": "Use a string with a date to only select results updated after that given date", - "example": "2020-01-01T00:00:00.000Z", + "value": { + "enum": [ + "approved", + "cancelled", + "rejected", + "pending", + "deleted", + "unmapped_value", + null, + ], "type": "string", }, }, "type": "object", }, - "next": { - "description": "The unified cursor", - "type": "string", - }, - "page_size": { - "description": "The number of results per page (default value is 25)", + "time_off_policy_id": { + "description": "The time off policy id associated with this time off request", + "example": "cx280928933", "type": "string", }, - "proxy": { - "additionalProperties": true, - "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", - "type": "object", - }, - "raw": { - "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", - "type": "boolean", - }, "x-account-id": undefined, }, "required": undefined, @@ -16372,7 +15676,7 @@ Map { "headers": { "Authorization": "Basic dGVzdF9rZXk6", }, - "method": "GET", + "method": "POST", "params": [ { "location": "header", @@ -16380,41 +15684,61 @@ Map { "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", + "location": "body", + "name": "employee_id", + "type": "string", }, { - "location": "query", - "name": "proxy", + "location": "body", + "name": "approver_id", + "type": "string", + }, + { + "location": "body", + "name": "status", "type": "object", }, { - "location": "query", - "name": "fields", + "location": "body", + "name": "start_date", "type": "string", }, { - "location": "query", - "name": "filter", - "type": "object", + "location": "body", + "name": "end_date", + "type": "string", }, { - "location": "query", - "name": "page_size", + "location": "body", + "name": "start_half_day", "type": "string", }, { - "location": "query", - "name": "next", + "location": "body", + "name": "end_half_day", + "type": "string", + }, + { + "location": "body", + "name": "time_off_policy_id", "type": "string", }, + { + "location": "body", + "name": "reason", + "type": "object", + }, + { + "location": "body", + "name": "passthrough", + "type": "object", + }, ], - "url": "https://api.stackone.com/unified/hris/time_off_types", + "url": "https://api.stackone.com/unified/hris/time_off", }, }, StackOneTool { - "description": "Get time off type", + "description": "Get time off request", "executeConfig": { "bodyType": "json", "method": "GET", @@ -16444,32 +15768,26 @@ Map { "name": "fields", "type": "string", }, - ], - "url": "https://api.stackone.com/unified/hris/time_off_types/{id}", - }, - "name": "hris_get_time_off_type", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, + { + "location": "query", + "name": "expand", + "type": "string", }, - } -, + ], + "url": "https://api.stackone.com/unified/hris/time_off/{id}", }, + "experimental_preExecute": undefined, + "name": "hris_get_time_off_request", "parameters": { "properties": { - "fields": { - "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,active", + "expand": { + "description": "The comma separated list of fields that will be expanded in the response", + "example": "policy", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "fields": { + "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", + "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,policy", "type": "string", }, "id": { @@ -16523,15 +15841,20 @@ Map { "name": "fields", "type": "string", }, + { + "location": "query", + "name": "expand", + "type": "string", + }, ], - "url": "https://api.stackone.com/unified/hris/time_off_types/{id}", + "url": "https://api.stackone.com/unified/hris/time_off/{id}", }, }, StackOneTool { - "description": "List Time Entries", + "description": "Update time off request", "executeConfig": { "bodyType": "json", - "method": "GET", + "method": "PATCH", "params": [ { "location": "header", @@ -16539,112 +15862,178 @@ Map { "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", + "location": "path", + "name": "id", + "type": "string", }, { - "location": "query", - "name": "proxy", - "type": "object", + "location": "body", + "name": "employee_id", + "type": "string", }, { - "location": "query", - "name": "fields", + "location": "body", + "name": "approver_id", "type": "string", }, { - "location": "query", - "name": "filter", + "location": "body", + "name": "status", "type": "object", }, { - "location": "query", - "name": "page_size", + "location": "body", + "name": "start_date", "type": "string", }, { - "location": "query", - "name": "next", + "location": "body", + "name": "end_date", "type": "string", }, - ], - "url": "https://api.stackone.com/unified/hris/time_entries", - }, - "name": "hris_list_time_entries", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, + { + "location": "body", + "name": "start_half_day", + "type": "string", + }, + { + "location": "body", + "name": "end_half_day", + "type": "string", + }, + { + "location": "body", + "name": "time_off_policy_id", + "type": "string", + }, + { + "location": "body", + "name": "reason", + "type": "object", + }, + { + "location": "body", + "name": "passthrough", + "type": "object", + }, + ], + "url": "https://api.stackone.com/unified/hris/time_off/{id}", + }, + "experimental_preExecute": undefined, + "name": "hris_update_time_off_request", "parameters": { "properties": { - "fields": { - "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,start_time,end_time,hours_worked,break_duration,labor_type,location,status,created_at,updated_at", + "approver_id": { + "description": "The approver ID", + "example": "1687-4", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "employee_id": { + "description": "The employee ID", + "example": "1687-3", "type": "string", }, - "filter": { - "description": "HRIS Time Entries filters", - "properties": { - "employee_id": { - "additionalProperties": false, - "description": "Filter to select time entries by employee_id", + "end_date": { + "description": "The end date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", + "type": "string", + }, + "end_half_day": { + "description": "True if the end of the time off request ends half way through the day", + "example": true, + "oneOf": [ + { + "type": "boolean", + }, + { + "enum": [ + "true", + "false", + ], "type": "string", }, - "end_time": { - "additionalProperties": false, - "description": "Filter to select time entries before a given time", - "example": "2020-01-01T00:00:00.000Z", + ], + }, + "id": { + "type": "string", + }, + "passthrough": { + "additionalProperties": true, + "description": "Value to pass through to the provider", + "example": { + "other_known_names": "John Doe", + }, + "type": "object", + }, + "reason": { + "properties": { + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", "type": "string", }, - "start_time": { - "additionalProperties": false, - "description": "Filter to select time entries after a given time", - "example": "2020-01-01T00:00:00.000Z", + "name": { "type": "string", }, - "updated_after": { - "additionalProperties": false, - "description": "Use a string with a date to only select results updated after that given date", - "example": "2020-01-01T00:00:00.000Z", + "remote_id": { + "description": "Provider's unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", "type": "string", }, }, "type": "object", }, - "next": { - "description": "The unified cursor", + "start_date": { + "description": "The start date of the time off request", + "example": "2021-01-01T01:01:01.000Z", + "format": "date-time", "type": "string", }, - "page_size": { - "description": "The number of results per page (default value is 25)", - "type": "string", + "start_half_day": { + "description": "True if the start of the time off request begins half way through the day", + "example": true, + "oneOf": [ + { + "type": "boolean", + }, + { + "enum": [ + "true", + "false", + ], + "type": "string", + }, + ], }, - "proxy": { - "additionalProperties": true, - "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", + "status": { + "description": "The status of the time off request", + "properties": { + "value": { + "enum": [ + "approved", + "cancelled", + "rejected", + "pending", + "deleted", + "unmapped_value", + null, + ], + "type": "string", + }, + }, "type": "object", }, - "raw": { - "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", - "type": "boolean", + "time_off_policy_id": { + "description": "The time off policy id associated with this time off request", + "example": "cx280928933", + "type": "string", }, "x-account-id": undefined, }, - "required": undefined, + "required": [ + "id", + ], "type": "object", }, "requestBuilder": RequestBuilder { @@ -16652,7 +16041,7 @@ Map { "headers": { "Authorization": "Basic dGVzdF9rZXk6", }, - "method": "GET", + "method": "PATCH", "params": [ { "location": "header", @@ -16660,155 +16049,66 @@ Map { "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", - }, - { - "location": "query", - "name": "proxy", - "type": "object", - }, - { - "location": "query", - "name": "fields", - "type": "string", - }, - { - "location": "query", - "name": "filter", - "type": "object", - }, - { - "location": "query", - "name": "page_size", + "location": "path", + "name": "id", "type": "string", }, { - "location": "query", - "name": "next", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/time_entries", - }, - }, - StackOneTool { - "description": "Get Time Entry", - "executeConfig": { - "bodyType": "json", - "method": "GET", - "params": [ - { - "location": "header", - "name": "x-account-id", + "location": "body", + "name": "employee_id", "type": "string", }, { - "location": "path", - "name": "id", + "location": "body", + "name": "approver_id", "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", - }, - { - "location": "query", - "name": "proxy", + "location": "body", + "name": "status", "type": "object", }, { - "location": "query", - "name": "fields", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/time_entries/{id}", - }, - "name": "hris_get_time_entries", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, - }, - "parameters": { - "properties": { - "fields": { - "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,start_time,end_time,hours_worked,break_duration,labor_type,location,status,created_at,updated_at", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "location": "body", + "name": "start_date", "type": "string", }, - "id": { + { + "location": "body", + "name": "end_date", "type": "string", }, - "proxy": { - "additionalProperties": true, - "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", - "type": "object", - }, - "raw": { - "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", - "type": "boolean", - }, - "x-account-id": undefined, - }, - "required": [ - "id", - ], - "type": "object", - }, - "requestBuilder": RequestBuilder { - "bodyType": "json", - "headers": { - "Authorization": "Basic dGVzdF9rZXk6", - }, - "method": "GET", - "params": [ { - "location": "header", - "name": "x-account-id", + "location": "body", + "name": "start_half_day", "type": "string", }, { - "location": "path", - "name": "id", + "location": "body", + "name": "end_half_day", "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", + "location": "body", + "name": "time_off_policy_id", + "type": "string", }, { - "location": "query", - "name": "proxy", + "location": "body", + "name": "reason", "type": "object", }, { - "location": "query", - "name": "fields", - "type": "string", + "location": "body", + "name": "passthrough", + "type": "object", }, ], - "url": "https://api.stackone.com/unified/hris/time_entries/{id}", + "url": "https://api.stackone.com/unified/hris/time_off/{id}", }, }, StackOneTool { - "description": "List benefits", + "description": "List time off types", "executeConfig": { "bodyType": "json", "method": "GET", @@ -16846,34 +16146,18 @@ Map { { "location": "query", "name": "next", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/benefits", - }, - "name": "hris_list_benefits", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, + "type": "string", }, - } -, + ], + "url": "https://api.stackone.com/unified/hris/time_off_types", }, + "experimental_preExecute": undefined, + "name": "hris_list_time_off_types", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,benefit_type,provider,description,created_at,updated_at", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,active", "type": "string", }, "filter": { @@ -16953,11 +16237,11 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/benefits", + "url": "https://api.stackone.com/unified/hris/time_off_types", }, }, StackOneTool { - "description": "Get Benefit", + "description": "Get time off type", "executeConfig": { "bodyType": "json", "method": "GET", @@ -16988,31 +16272,15 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/benefits/{id}", - }, - "name": "hris_get_benefit", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/time_off_types/{id}", }, + "experimental_preExecute": undefined, + "name": "hris_get_time_off_type", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,benefit_type,provider,description,created_at,updated_at", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,active", "type": "string", }, "id": { @@ -17067,11 +16335,11 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/benefits/{id}", + "url": "https://api.stackone.com/unified/hris/time_off_types/{id}", }, }, StackOneTool { - "description": "List Groups", + "description": "List Time Entries", "executeConfig": { "bodyType": "json", "method": "GET", @@ -17112,36 +16380,37 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/groups", - }, - "name": "hris_list_groups", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/time_entries", }, + "experimental_preExecute": undefined, + "name": "hris_list_time_entries", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,employee_id,remote_employee_id,start_time,end_time,hours_worked,break_duration,labor_type,location,status,created_at,updated_at", "type": "string", }, "filter": { - "description": "Filter parameters that allow greater customisation of the list response", + "description": "HRIS Time Entries filters", "properties": { + "employee_id": { + "additionalProperties": false, + "description": "Filter to select time entries by employee_id", + "type": "string", + }, + "end_time": { + "additionalProperties": false, + "description": "Filter to select time entries before a given time", + "example": "2020-01-01T00:00:00.000Z", + "type": "string", + }, + "start_time": { + "additionalProperties": false, + "description": "Filter to select time entries after a given time", + "example": "2020-01-01T00:00:00.000Z", + "type": "string", + }, "updated_after": { "additionalProperties": false, "description": "Use a string with a date to only select results updated after that given date", @@ -17216,11 +16485,11 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/groups", + "url": "https://api.stackone.com/unified/hris/time_entries", }, }, StackOneTool { - "description": "List Department Groups", + "description": "Get Time Entry", "executeConfig": { "bodyType": "json", "method": "GET", @@ -17230,6 +16499,11 @@ Map { "name": "x-account-id", "type": "string", }, + { + "location": "path", + "name": "id", + "type": "string", + }, { "location": "query", "name": "raw", @@ -17245,67 +16519,19 @@ Map { "name": "fields", "type": "string", }, - { - "location": "query", - "name": "filter", - "type": "object", - }, - { - "location": "query", - "name": "page_size", - "type": "string", - }, - { - "location": "query", - "name": "next", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/groups/departments", - }, - "name": "hris_list_department_groups", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/time_entries/{id}", }, + "experimental_preExecute": undefined, + "name": "hris_get_time_entries", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, - "filter": { - "description": "Filter parameters that allow greater customisation of the list response", - "properties": { - "updated_after": { - "additionalProperties": false, - "description": "Use a string with a date to only select results updated after that given date", - "example": "2020-01-01T00:00:00.000Z", - "type": "string", - }, - }, - "type": "object", - }, - "next": { - "description": "The unified cursor", + "example": "id,remote_id,employee_id,remote_employee_id,start_time,end_time,hours_worked,break_duration,labor_type,location,status,created_at,updated_at", "type": "string", }, - "page_size": { - "description": "The number of results per page (default value is 25)", + "id": { "type": "string", }, "proxy": { @@ -17319,7 +16545,9 @@ Map { }, "x-account-id": undefined, }, - "required": undefined, + "required": [ + "id", + ], "type": "object", }, "requestBuilder": RequestBuilder { @@ -17334,6 +16562,11 @@ Map { "name": "x-account-id", "type": "string", }, + { + "location": "path", + "name": "id", + "type": "string", + }, { "location": "query", "name": "raw", @@ -17349,27 +16582,12 @@ Map { "name": "fields", "type": "string", }, - { - "location": "query", - "name": "filter", - "type": "object", - }, - { - "location": "query", - "name": "page_size", - "type": "string", - }, - { - "location": "query", - "name": "next", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/groups/departments", + "url": "https://api.stackone.com/unified/hris/time_entries/{id}", }, }, StackOneTool { - "description": "List Cost Center Groups", + "description": "List benefits", "executeConfig": { "bodyType": "json", "method": "GET", @@ -17410,31 +16628,15 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/groups/cost_centers", - }, - "name": "hris_list_cost_center_groups", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/benefits", }, + "experimental_preExecute": undefined, + "name": "hris_list_benefits", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,distribution_percentage,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,benefit_type,provider,description,created_at,updated_at", "type": "string", }, "filter": { @@ -17514,11 +16716,109 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/groups/cost_centers", + "url": "https://api.stackone.com/unified/hris/benefits", }, }, StackOneTool { - "description": "List Team Groups", + "description": "Get Benefit", + "executeConfig": { + "bodyType": "json", + "method": "GET", + "params": [ + { + "location": "header", + "name": "x-account-id", + "type": "string", + }, + { + "location": "path", + "name": "id", + "type": "string", + }, + { + "location": "query", + "name": "raw", + "type": "boolean", + }, + { + "location": "query", + "name": "proxy", + "type": "object", + }, + { + "location": "query", + "name": "fields", + "type": "string", + }, + ], + "url": "https://api.stackone.com/unified/hris/benefits/{id}", + }, + "experimental_preExecute": undefined, + "name": "hris_get_benefit", + "parameters": { + "properties": { + "fields": { + "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", + "example": "id,remote_id,name,benefit_type,provider,description,created_at,updated_at", + "type": "string", + }, + "id": { + "type": "string", + }, + "proxy": { + "additionalProperties": true, + "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", + "type": "object", + }, + "raw": { + "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", + "type": "boolean", + }, + "x-account-id": undefined, + }, + "required": [ + "id", + ], + "type": "object", + }, + "requestBuilder": RequestBuilder { + "bodyType": "json", + "headers": { + "Authorization": "Basic dGVzdF9rZXk6", + }, + "method": "GET", + "params": [ + { + "location": "header", + "name": "x-account-id", + "type": "string", + }, + { + "location": "path", + "name": "id", + "type": "string", + }, + { + "location": "query", + "name": "raw", + "type": "boolean", + }, + { + "location": "query", + "name": "proxy", + "type": "object", + }, + { + "location": "query", + "name": "fields", + "type": "string", + }, + ], + "url": "https://api.stackone.com/unified/hris/benefits/{id}", + }, + }, + StackOneTool { + "description": "List Groups", "executeConfig": { "bodyType": "json", "method": "GET", @@ -17556,25 +16856,13 @@ Map { { "location": "query", "name": "next", - "type": "string", - }, - ], - "url": "https://api.stackone.com/unified/hris/groups/teams", - }, - "name": "hris_list_team_groups", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, + "type": "string", }, - } -, + ], + "url": "https://api.stackone.com/unified/hris/groups", }, + "experimental_preExecute": undefined, + "name": "hris_list_groups", "parameters": { "properties": { "fields": { @@ -17582,10 +16870,6 @@ Map { "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "filter": { "description": "Filter parameters that allow greater customisation of the list response", "properties": { @@ -17663,11 +16947,11 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/groups/teams", + "url": "https://api.stackone.com/unified/hris/groups", }, }, StackOneTool { - "description": "Get Group", + "description": "List Department Groups", "executeConfig": { "bodyType": "json", "method": "GET", @@ -17677,11 +16961,6 @@ Map { "name": "x-account-id", "type": "string", }, - { - "location": "path", - "name": "id", - "type": "string", - }, { "location": "query", "name": "raw", @@ -17697,35 +16976,51 @@ Map { "name": "fields", "type": "string", }, - ], - "url": "https://api.stackone.com/unified/hris/groups/{id}", - }, - "name": "hris_get_group", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, + { + "location": "query", + "name": "filter", + "type": "object", + }, + { + "location": "query", + "name": "page_size", + "type": "string", + }, + { + "location": "query", + "name": "next", + "type": "string", }, - } -, + ], + "url": "https://api.stackone.com/unified/hris/groups/departments", }, + "experimental_preExecute": undefined, + "name": "hris_list_department_groups", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", + "example": "id,remote_id,name", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "filter": { + "description": "Filter parameters that allow greater customisation of the list response", + "properties": { + "updated_after": { + "additionalProperties": false, + "description": "Use a string with a date to only select results updated after that given date", + "example": "2020-01-01T00:00:00.000Z", + "type": "string", + }, + }, + "type": "object", + }, + "next": { + "description": "The unified cursor", "type": "string", }, - "id": { + "page_size": { + "description": "The number of results per page (default value is 25)", "type": "string", }, "proxy": { @@ -17739,9 +17034,7 @@ Map { }, "x-account-id": undefined, }, - "required": [ - "id", - ], + "required": undefined, "type": "object", }, "requestBuilder": RequestBuilder { @@ -17756,11 +17049,6 @@ Map { "name": "x-account-id", "type": "string", }, - { - "location": "path", - "name": "id", - "type": "string", - }, { "location": "query", "name": "raw", @@ -17776,12 +17064,27 @@ Map { "name": "fields", "type": "string", }, + { + "location": "query", + "name": "filter", + "type": "object", + }, + { + "location": "query", + "name": "page_size", + "type": "string", + }, + { + "location": "query", + "name": "next", + "type": "string", + }, ], - "url": "https://api.stackone.com/unified/hris/groups/{id}", + "url": "https://api.stackone.com/unified/hris/groups/departments", }, }, StackOneTool { - "description": "Get Department Group", + "description": "List Cost Center Groups", "executeConfig": { "bodyType": "json", "method": "GET", @@ -17791,11 +17094,6 @@ Map { "name": "x-account-id", "type": "string", }, - { - "location": "path", - "name": "id", - "type": "string", - }, { "location": "query", "name": "raw", @@ -17811,35 +17109,51 @@ Map { "name": "fields", "type": "string", }, - ], - "url": "https://api.stackone.com/unified/hris/groups/departments/{id}", - }, - "name": "hris_get_department_group", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, + { + "location": "query", + "name": "filter", + "type": "object", + }, + { + "location": "query", + "name": "page_size", + "type": "string", + }, + { + "location": "query", + "name": "next", + "type": "string", }, - } -, + ], + "url": "https://api.stackone.com/unified/hris/groups/cost_centers", }, + "experimental_preExecute": undefined, + "name": "hris_list_cost_center_groups", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name", + "example": "id,remote_id,name,type,distribution_percentage,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "filter": { + "description": "Filter parameters that allow greater customisation of the list response", + "properties": { + "updated_after": { + "additionalProperties": false, + "description": "Use a string with a date to only select results updated after that given date", + "example": "2020-01-01T00:00:00.000Z", + "type": "string", + }, + }, + "type": "object", + }, + "next": { + "description": "The unified cursor", "type": "string", }, - "id": { + "page_size": { + "description": "The number of results per page (default value is 25)", "type": "string", }, "proxy": { @@ -17853,9 +17167,7 @@ Map { }, "x-account-id": undefined, }, - "required": [ - "id", - ], + "required": undefined, "type": "object", }, "requestBuilder": RequestBuilder { @@ -17870,11 +17182,6 @@ Map { "name": "x-account-id", "type": "string", }, - { - "location": "path", - "name": "id", - "type": "string", - }, { "location": "query", "name": "raw", @@ -17890,12 +17197,27 @@ Map { "name": "fields", "type": "string", }, + { + "location": "query", + "name": "filter", + "type": "object", + }, + { + "location": "query", + "name": "page_size", + "type": "string", + }, + { + "location": "query", + "name": "next", + "type": "string", + }, ], - "url": "https://api.stackone.com/unified/hris/groups/departments/{id}", + "url": "https://api.stackone.com/unified/hris/groups/cost_centers", }, }, StackOneTool { - "description": "Get Cost Center Group", + "description": "List Team Groups", "executeConfig": { "bodyType": "json", "method": "GET", @@ -17905,11 +17227,6 @@ Map { "name": "x-account-id", "type": "string", }, - { - "location": "path", - "name": "id", - "type": "string", - }, { "location": "query", "name": "raw", @@ -17925,35 +17242,51 @@ Map { "name": "fields", "type": "string", }, - ], - "url": "https://api.stackone.com/unified/hris/groups/cost_centers/{id}", - }, - "name": "hris_get_cost_center_group", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, + { + "location": "query", + "name": "filter", + "type": "object", + }, + { + "location": "query", + "name": "page_size", + "type": "string", + }, + { + "location": "query", + "name": "next", + "type": "string", }, - } -, + ], + "url": "https://api.stackone.com/unified/hris/groups/teams", }, + "experimental_preExecute": undefined, + "name": "hris_list_team_groups", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,distribution_percentage,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", + "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "filter": { + "description": "Filter parameters that allow greater customisation of the list response", + "properties": { + "updated_after": { + "additionalProperties": false, + "description": "Use a string with a date to only select results updated after that given date", + "example": "2020-01-01T00:00:00.000Z", + "type": "string", + }, + }, + "type": "object", + }, + "next": { + "description": "The unified cursor", "type": "string", }, - "id": { + "page_size": { + "description": "The number of results per page (default value is 25)", "type": "string", }, "proxy": { @@ -17967,9 +17300,7 @@ Map { }, "x-account-id": undefined, }, - "required": [ - "id", - ], + "required": undefined, "type": "object", }, "requestBuilder": RequestBuilder { @@ -17984,11 +17315,6 @@ Map { "name": "x-account-id", "type": "string", }, - { - "location": "path", - "name": "id", - "type": "string", - }, { "location": "query", "name": "raw", @@ -18004,12 +17330,27 @@ Map { "name": "fields", "type": "string", }, + { + "location": "query", + "name": "filter", + "type": "object", + }, + { + "location": "query", + "name": "page_size", + "type": "string", + }, + { + "location": "query", + "name": "next", + "type": "string", + }, ], - "url": "https://api.stackone.com/unified/hris/groups/cost_centers/{id}", + "url": "https://api.stackone.com/unified/hris/groups/teams", }, }, StackOneTool { - "description": "Get Team Group", + "description": "Get Group", "executeConfig": { "bodyType": "json", "method": "GET", @@ -18040,22 +17381,10 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/groups/teams/{id}", - }, - "name": "hris_get_team_group", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/groups/{id}", }, + "experimental_preExecute": undefined, + "name": "hris_get_group", "parameters": { "properties": { "fields": { @@ -18063,10 +17392,6 @@ Map { "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { "type": "string", }, @@ -18119,11 +17444,11 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/groups/teams/{id}", + "url": "https://api.stackone.com/unified/hris/groups/{id}", }, }, StackOneTool { - "description": "List Jobs", + "description": "Get Department Group", "executeConfig": { "bodyType": "json", "method": "GET", @@ -18134,81 +17459,38 @@ Map { "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", - }, - { - "location": "query", - "name": "proxy", - "type": "object", - }, - { - "location": "query", - "name": "fields", + "location": "path", + "name": "id", "type": "string", }, { "location": "query", - "name": "filter", - "type": "object", + "name": "raw", + "type": "boolean", }, { "location": "query", - "name": "page_size", - "type": "string", + "name": "proxy", + "type": "object", }, { "location": "query", - "name": "next", + "name": "fields", "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/jobs", - }, - "name": "hris_list_jobs", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/groups/departments/{id}", }, + "experimental_preExecute": undefined, + "name": "hris_get_department_group", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, - "filter": { - "description": "Filter parameters that allow greater customisation of the list response", - "properties": { - "updated_after": { - "additionalProperties": false, - "description": "Use a string with a date to only select results updated after that given date", - "example": "2020-01-01T00:00:00.000Z", - "type": "string", - }, - }, - "type": "object", - }, - "next": { - "description": "The unified cursor", + "example": "id,remote_id,name", "type": "string", }, - "page_size": { - "description": "The number of results per page (default value is 25)", + "id": { "type": "string", }, "proxy": { @@ -18222,7 +17504,9 @@ Map { }, "x-account-id": undefined, }, - "required": undefined, + "required": [ + "id", + ], "type": "object", }, "requestBuilder": RequestBuilder { @@ -18237,6 +17521,11 @@ Map { "name": "x-account-id", "type": "string", }, + { + "location": "path", + "name": "id", + "type": "string", + }, { "location": "query", "name": "raw", @@ -18252,27 +17541,12 @@ Map { "name": "fields", "type": "string", }, - { - "location": "query", - "name": "filter", - "type": "object", - }, - { - "location": "query", - "name": "page_size", - "type": "string", - }, - { - "location": "query", - "name": "next", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/jobs", + "url": "https://api.stackone.com/unified/hris/groups/departments/{id}", }, }, StackOneTool { - "description": "Get Job", + "description": "Get Cost Center Group", "executeConfig": { "bodyType": "json", "method": "GET", @@ -18303,31 +17577,15 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/jobs/{id}", - }, - "name": "hris_get_job", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/groups/cost_centers/{id}", }, + "experimental_preExecute": undefined, + "name": "hris_get_cost_center_group", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids,company_id,remote_company_id", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,type,distribution_percentage,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, "id": { @@ -18382,11 +17640,11 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/jobs/{id}", + "url": "https://api.stackone.com/unified/hris/groups/cost_centers/{id}", }, }, StackOneTool { - "description": "List Employee Skills", + "description": "Get Team Group", "executeConfig": { "bodyType": "json", "method": "GET", @@ -18416,72 +17674,21 @@ Map { "name": "fields", "type": "string", }, - { - "location": "query", - "name": "filter", - "type": "object", - }, - { - "location": "query", - "name": "page_size", - "type": "string", - }, - { - "location": "query", - "name": "next", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", - }, - "name": "hris_list_employee_skills", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/groups/teams/{id}", }, + "experimental_preExecute": undefined, + "name": "hris_get_team_group", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,active,language,maximum_proficiency,minimum_proficiency", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, - "filter": { - "description": "Filter parameters that allow greater customisation of the list response", - "properties": { - "updated_after": { - "additionalProperties": false, - "description": "Use a string with a date to only select results updated after that given date", - "example": "2020-01-01T00:00:00.000Z", - "type": "string", - }, - }, - "type": "object", - }, "id": { "type": "string", }, - "next": { - "description": "The unified cursor", - "type": "string", - }, - "page_size": { - "description": "The number of results per page (default value is 25)", - "type": "string", - }, "proxy": { "additionalProperties": true, "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", @@ -18530,30 +17737,15 @@ Map { "name": "fields", "type": "string", }, - { - "location": "query", - "name": "filter", - "type": "object", - }, - { - "location": "query", - "name": "page_size", - "type": "string", - }, - { - "location": "query", - "name": "next", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", + "url": "https://api.stackone.com/unified/hris/groups/teams/{id}", }, }, StackOneTool { - "description": "Create Employee Skill", + "description": "List Jobs", "executeConfig": { "bodyType": "json", - "method": "POST", + "method": "GET", "params": [ { "location": "header", @@ -18561,129 +17753,79 @@ Map { "type": "string", }, { - "location": "body", - "name": "id", - "type": "string", + "location": "query", + "name": "raw", + "type": "boolean", }, { - "location": "body", - "name": "name", + "location": "query", + "name": "proxy", + "type": "object", + }, + { + "location": "query", + "name": "fields", "type": "string", }, { - "location": "body", - "name": "maximum_proficiency", + "location": "query", + "name": "filter", "type": "object", }, { - "location": "body", - "name": "minimum_proficiency", - "type": "object", + "location": "query", + "name": "page_size", + "type": "string", }, - ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", - }, - "name": "hris_create_employee_skill", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, + { + "location": "query", + "name": "next", + "type": "string", }, - } -, + ], + "url": "https://api.stackone.com/unified/hris/jobs", }, + "experimental_preExecute": undefined, + "name": "hris_list_jobs", "parameters": { "properties": { - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, - "id": { - "description": "The ID associated with this skill", - "example": "16873-IT345", + "fields": { + "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", + "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, - "maximum_proficiency": { - "description": "The proficiency level of the skill", - "properties": { - "id": { - "description": "Unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", - "type": "string", - }, - "name": { - "description": "The name associated with this proficiency", - "example": "Expert", - "type": "string", - }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", - "type": "string", - }, - "value": { - "enum": [ - "1", - "2", - "3", - "4", - "5", - "unmapped_value", - null, - ], - "type": "string", - }, - }, - "type": "object", - }, - "minimum_proficiency": { - "description": "The proficiency level of the skill", + "filter": { + "description": "Filter parameters that allow greater customisation of the list response", "properties": { - "id": { - "description": "Unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", - "type": "string", - }, - "name": { - "description": "The name associated with this proficiency", - "example": "Expert", - "type": "string", - }, - "remote_id": { - "description": "Provider's unique identifier", - "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", - "type": "string", - }, - "value": { - "enum": [ - "1", - "2", - "3", - "4", - "5", - "unmapped_value", - null, - ], + "updated_after": { + "additionalProperties": false, + "description": "Use a string with a date to only select results updated after that given date", + "example": "2020-01-01T00:00:00.000Z", "type": "string", }, }, "type": "object", }, - "name": { - "description": "The name associated with this skill", - "example": "Information-Technology", + "next": { + "description": "The unified cursor", + "type": "string", + }, + "page_size": { + "description": "The number of results per page (default value is 25)", "type": "string", }, + "proxy": { + "additionalProperties": true, + "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", + "type": "object", + }, + "raw": { + "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", + "type": "boolean", + }, "x-account-id": undefined, }, - "required": [ - "id", - ], + "required": undefined, "type": "object", }, "requestBuilder": RequestBuilder { @@ -18691,7 +17833,7 @@ Map { "headers": { "Authorization": "Basic dGVzdF9rZXk6", }, - "method": "POST", + "method": "GET", "params": [ { "location": "header", @@ -18699,31 +17841,41 @@ Map { "type": "string", }, { - "location": "body", - "name": "id", - "type": "string", + "location": "query", + "name": "raw", + "type": "boolean", }, { - "location": "body", - "name": "name", + "location": "query", + "name": "proxy", + "type": "object", + }, + { + "location": "query", + "name": "fields", "type": "string", }, { - "location": "body", - "name": "maximum_proficiency", + "location": "query", + "name": "filter", "type": "object", }, { - "location": "body", - "name": "minimum_proficiency", - "type": "object", + "location": "query", + "name": "page_size", + "type": "string", + }, + { + "location": "query", + "name": "next", + "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", + "url": "https://api.stackone.com/unified/hris/jobs", }, }, StackOneTool { - "description": "Get Employee Skill", + "description": "Get Job", "executeConfig": { "bodyType": "json", "method": "GET", @@ -18738,11 +17890,6 @@ Map { "name": "id", "type": "string", }, - { - "location": "path", - "name": "subResourceId", - "type": "string", - }, { "location": "query", "name": "raw", @@ -18759,31 +17906,15 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/skills/{subResourceId}", - }, - "name": "hris_get_employee_skill", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/jobs/{id}", }, + "experimental_preExecute": undefined, + "name": "hris_get_job", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,active,language,maximum_proficiency,minimum_proficiency", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,type,parent_ids,remote_parent_ids,owner_ids,remote_owner_ids", "type": "string", }, "id": { @@ -18798,14 +17929,10 @@ Map { "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", "type": "boolean", }, - "subResourceId": { - "type": "string", - }, "x-account-id": undefined, }, "required": [ "id", - "subResourceId", ], "type": "object", }, @@ -18826,11 +17953,6 @@ Map { "name": "id", "type": "string", }, - { - "location": "path", - "name": "subResourceId", - "type": "string", - }, { "location": "query", "name": "raw", @@ -18847,11 +17969,11 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/skills/{subResourceId}", + "url": "https://api.stackone.com/unified/hris/jobs/{id}", }, }, StackOneTool { - "description": "List Time Off Policies", + "description": "List Employee Skills", "executeConfig": { "bodyType": "json", "method": "GET", @@ -18861,6 +17983,11 @@ Map { "name": "x-account-id", "type": "string", }, + { + "location": "path", + "name": "id", + "type": "string", + }, { "location": "query", "name": "raw", @@ -18892,65 +18019,20 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/time_off_policies", - }, - "name": "hris_list_time_off_policies", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", }, + "experimental_preExecute": undefined, + "name": "hris_list_employee_skills", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,description,type,duration_unit,reasons,updated_at,created_at", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,active,language,maximum_proficiency,minimum_proficiency", "type": "string", }, "filter": { - "description": "HRIS Time-Off Policies filters", + "description": "Filter parameters that allow greater customisation of the list response", "properties": { - "type": { - "description": "Filter to select time-off policies by type", - "enum": [ - "sick", - "unmapped_value", - "vacation", - "long_term_disability", - "short_term_disability", - "absent", - "comp_time", - "training", - "annual_leave", - "leave_of_absence", - "break", - "child_care_leave", - "maternity_leave", - "jury_duty", - "sabbatical", - "accident", - "paid", - "unpaid", - "holiday", - "personal", - "in_lieu", - "bereavement", - null, - ], - "type": "string", - }, "updated_after": { "additionalProperties": false, "description": "Use a string with a date to only select results updated after that given date", @@ -18960,6 +18042,9 @@ Map { }, "type": "object", }, + "id": { + "type": "string", + }, "next": { "description": "The unified cursor", "type": "string", @@ -18979,7 +18064,9 @@ Map { }, "x-account-id": undefined, }, - "required": undefined, + "required": [ + "id", + ], "type": "object", }, "requestBuilder": RequestBuilder { @@ -18994,6 +18081,11 @@ Map { "name": "x-account-id", "type": "string", }, + { + "location": "path", + "name": "id", + "type": "string", + }, { "location": "query", "name": "raw", @@ -19025,14 +18117,14 @@ Map { "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/time_off_policies", + "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", }, }, StackOneTool { - "description": "Get Time Off Policy", + "description": "Create Employee Skill", "executeConfig": { "bodyType": "json", - "method": "GET", + "method": "POST", "params": [ { "location": "header", @@ -19040,64 +18132,105 @@ Map { "type": "string", }, { - "location": "path", + "location": "body", "name": "id", "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", + "location": "body", + "name": "name", + "type": "string", }, { - "location": "query", - "name": "proxy", + "location": "body", + "name": "maximum_proficiency", "type": "object", }, { - "location": "query", - "name": "fields", - "type": "string", + "location": "body", + "name": "minimum_proficiency", + "type": "object", }, ], - "url": "https://api.stackone.com/unified/hris/time_off_policies/{id}", - }, - "name": "hris_get_time_off_policy", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", }, + "experimental_preExecute": undefined, + "name": "hris_create_employee_skill", "parameters": { "properties": { - "fields": { - "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,description,type,duration_unit,reasons,updated_at,created_at", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", - }, "id": { + "description": "The ID associated with this skill", + "example": "16873-IT345", "type": "string", }, - "proxy": { - "additionalProperties": true, - "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", + "maximum_proficiency": { + "description": "The proficiency level of the skill", + "properties": { + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, + "name": { + "description": "The name associated with this proficiency", + "example": "Expert", + "type": "string", + }, + "remote_id": { + "description": "Provider's unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, + "value": { + "enum": [ + "1", + "2", + "3", + "4", + "5", + null, + ], + "type": "string", + }, + }, "type": "object", }, - "raw": { - "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", - "type": "boolean", + "minimum_proficiency": { + "description": "The proficiency level of the skill", + "properties": { + "id": { + "description": "Unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, + "name": { + "description": "The name associated with this proficiency", + "example": "Expert", + "type": "string", + }, + "remote_id": { + "description": "Provider's unique identifier", + "example": "8187e5da-dc77-475e-9949-af0f1fa4e4e3", + "type": "string", + }, + "value": { + "enum": [ + "1", + "2", + "3", + "4", + "5", + null, + ], + "type": "string", + }, + }, + "type": "object", + }, + "name": { + "description": "The name associated with this skill", + "example": "Information-Technology", + "type": "string", }, "x-account-id": undefined, }, @@ -19111,7 +18244,7 @@ Map { "headers": { "Authorization": "Basic dGVzdF9rZXk6", }, - "method": "GET", + "method": "POST", "params": [ { "location": "header", @@ -19119,31 +18252,31 @@ Map { "type": "string", }, { - "location": "path", + "location": "body", "name": "id", "type": "string", }, { - "location": "query", - "name": "raw", - "type": "boolean", + "location": "body", + "name": "name", + "type": "string", }, { - "location": "query", - "name": "proxy", + "location": "body", + "name": "maximum_proficiency", "type": "object", }, { - "location": "query", - "name": "fields", - "type": "string", + "location": "body", + "name": "minimum_proficiency", + "type": "object", }, ], - "url": "https://api.stackone.com/unified/hris/time_off_policies/{id}", + "url": "https://api.stackone.com/unified/hris/employees/{id}/skills", }, }, StackOneTool { - "description": "List Assigned Time Off Policies", + "description": "Get Employee Skill", "executeConfig": { "bodyType": "json", "method": "GET", @@ -19158,6 +18291,11 @@ Map { "name": "id", "type": "string", }, + { + "location": "path", + "name": "subResourceId", + "type": "string", + }, { "location": "query", "name": "raw", @@ -19173,101 +18311,21 @@ Map { "name": "fields", "type": "string", }, - { - "location": "query", - "name": "filter", - "type": "object", - }, - { - "location": "query", - "name": "page_size", - "type": "string", - }, - { - "location": "query", - "name": "next", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off_policies", - }, - "name": "hris_list_employee_time_off_policies", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/employees/{id}/skills/{subResourceId}", }, + "experimental_preExecute": undefined, + "name": "hris_get_employee_skill", "parameters": { "properties": { "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,name,description,type,duration_unit,reasons,updated_at,created_at", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,active,language,maximum_proficiency,minimum_proficiency", "type": "string", }, - "filter": { - "description": "HRIS Time-Off Policies filters", - "properties": { - "type": { - "description": "Filter to select time-off policies by type", - "enum": [ - "sick", - "unmapped_value", - "vacation", - "long_term_disability", - "short_term_disability", - "absent", - "comp_time", - "training", - "annual_leave", - "leave_of_absence", - "break", - "child_care_leave", - "maternity_leave", - "jury_duty", - "sabbatical", - "accident", - "paid", - "unpaid", - "holiday", - "personal", - "in_lieu", - "bereavement", - null, - ], - "type": "string", - }, - "updated_after": { - "additionalProperties": false, - "description": "Use a string with a date to only select results updated after that given date", - "example": "2020-01-01T00:00:00.000Z", - "type": "string", - }, - }, - "type": "object", - }, "id": { "type": "string", }, - "next": { - "description": "The unified cursor", - "type": "string", - }, - "page_size": { - "description": "The number of results per page (default value is 25)", - "type": "string", - }, "proxy": { "additionalProperties": true, "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", @@ -19277,10 +18335,14 @@ Map { "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", "type": "boolean", }, + "subResourceId": { + "type": "string", + }, "x-account-id": undefined, }, "required": [ "id", + "subResourceId", ], "type": "object", }, @@ -19301,6 +18363,11 @@ Map { "name": "id", "type": "string", }, + { + "location": "path", + "name": "subResourceId", + "type": "string", + }, { "location": "query", "name": "raw", @@ -19316,27 +18383,12 @@ Map { "name": "fields", "type": "string", }, - { - "location": "query", - "name": "filter", - "type": "object", - }, - { - "location": "query", - "name": "page_size", - "type": "string", - }, - { - "location": "query", - "name": "next", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off_policies", + "url": "https://api.stackone.com/unified/hris/employees/{id}/skills/{subResourceId}", }, }, StackOneTool { - "description": "List Employee Tasks", + "description": "List Time Off Policies", "executeConfig": { "bodyType": "json", "method": "GET", @@ -19346,11 +18398,6 @@ Map { "name": "x-account-id", "type": "string", }, - { - "location": "path", - "name": "id", - "type": "string", - }, { "location": "query", "name": "raw", @@ -19381,42 +18428,16 @@ Map { "name": "next", "type": "string", }, - { - "location": "query", - "name": "expand", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/tasks", - }, - "name": "hris_list_employee_tasks", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/time_off_policies", }, + "experimental_preExecute": undefined, + "name": "hris_list_time_off_policies", "parameters": { "properties": { - "expand": { - "description": "The comma separated list of fields that will be expanded in the response", - "example": "attachments", - "type": "string", - }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,name,description,type,status,due_date,completion_date,assigned_by_employee_id,remote_assigned_by_employee_id,assigned_by_employee_name,link_to_task,extracted_links,next_task_id,remote_next_task_id,parent_process_name,comments,attachments,created_at,updated_at", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,description,type,duration_unit,reasons,updated_at,created_at", "type": "string", }, "filter": { @@ -19431,9 +18452,6 @@ Map { }, "type": "object", }, - "id": { - "type": "string", - }, "next": { "description": "The unified cursor", "type": "string", @@ -19453,9 +18471,7 @@ Map { }, "x-account-id": undefined, }, - "required": [ - "id", - ], + "required": undefined, "type": "object", }, "requestBuilder": RequestBuilder { @@ -19470,11 +18486,6 @@ Map { "name": "x-account-id", "type": "string", }, - { - "location": "path", - "name": "id", - "type": "string", - }, { "location": "query", "name": "raw", @@ -19505,17 +18516,12 @@ Map { "name": "next", "type": "string", }, - { - "location": "query", - "name": "expand", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/tasks", + "url": "https://api.stackone.com/unified/hris/time_off_policies", }, }, StackOneTool { - "description": "Get Employee Task", + "description": "Get Time Off Policy", "executeConfig": { "bodyType": "json", "method": "GET", @@ -19530,11 +18536,6 @@ Map { "name": "id", "type": "string", }, - { - "location": "path", - "name": "subResourceId", - "type": "string", - }, { "location": "query", "name": "raw", @@ -19550,42 +18551,16 @@ Map { "name": "fields", "type": "string", }, - { - "location": "query", - "name": "expand", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/tasks/{subResourceId}", - }, - "name": "hris_get_employee_task", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, - }, - } -, + "url": "https://api.stackone.com/unified/hris/time_off_policies/{id}", }, + "experimental_preExecute": undefined, + "name": "hris_get_time_off_policy", "parameters": { "properties": { - "expand": { - "description": "The comma separated list of fields that will be expanded in the response", - "example": "attachments", - "type": "string", - }, "fields": { "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", - "example": "id,remote_id,employee_id,remote_employee_id,name,description,type,status,due_date,completion_date,assigned_by_employee_id,remote_assigned_by_employee_id,assigned_by_employee_name,link_to_task,extracted_links,next_task_id,remote_next_task_id,parent_process_name,comments,attachments,created_at,updated_at", - "type": "string", - }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", + "example": "id,remote_id,name,description,type,duration_unit,reasons,updated_at,created_at", "type": "string", }, "id": { @@ -19600,14 +18575,10 @@ Map { "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", "type": "boolean", }, - "subResourceId": { - "type": "string", - }, "x-account-id": undefined, }, "required": [ "id", - "subResourceId", ], "type": "object", }, @@ -19628,11 +18599,6 @@ Map { "name": "id", "type": "string", }, - { - "location": "path", - "name": "subResourceId", - "type": "string", - }, { "location": "query", "name": "raw", @@ -19648,20 +18614,15 @@ Map { "name": "fields", "type": "string", }, - { - "location": "query", - "name": "expand", - "type": "string", - }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/tasks/{subResourceId}", + "url": "https://api.stackone.com/unified/hris/time_off_policies/{id}", }, }, StackOneTool { - "description": "Complete Employee Task", + "description": "List Assigned Time Off Policies", "executeConfig": { "bodyType": "json", - "method": "PATCH", + "method": "GET", "params": [ { "location": "header", @@ -19674,60 +18635,83 @@ Map { "type": "string", }, { - "location": "path", - "name": "subResourceId", - "type": "string", + "location": "query", + "name": "raw", + "type": "boolean", }, { "location": "query", "name": "proxy", + "type": "object", + }, + { + "location": "query", + "name": "fields", "type": "string", }, { - "location": "body", - "name": "comment", + "location": "query", + "name": "filter", + "type": "object", + }, + { + "location": "query", + "name": "page_size", "type": "string", }, - ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/tasks/{subResourceId}", - }, - "name": "hris_complete_employee_task", - "parameterMapper": ParameterMapper { - "transformers": -Map { - "file_path" => { - "transforms": { - "content": [Function], - "file_format": [Function], - "name": [Function], - }, + { + "location": "query", + "name": "next", + "type": "string", }, - } -, + ], + "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off_policies", }, + "experimental_preExecute": undefined, + "name": "hris_list_employee_time_off_policies", "parameters": { "properties": { - "comment": { - "description": "Comment or note about the task completion", - "example": "All required documents have been submitted", + "fields": { + "description": "The comma separated list of fields that will be returned in the response (if empty, all fields are returned)", + "example": "id,remote_id,name,description,type,duration_unit,reasons,updated_at,created_at", "type": "string", }, - "file_path": { - "description": "Convenience parameter that will be transformed into other parameters. Try and use this parameter in your tool call.", - "type": "string", + "filter": { + "description": "Filter parameters that allow greater customisation of the list response", + "properties": { + "updated_after": { + "additionalProperties": false, + "description": "Use a string with a date to only select results updated after that given date", + "example": "2020-01-01T00:00:00.000Z", + "type": "string", + }, + }, + "type": "object", }, "id": { "type": "string", }, - "proxy": {}, - "subResourceId": { + "next": { + "description": "The unified cursor", + "type": "string", + }, + "page_size": { + "description": "The number of results per page (default value is 25)", "type": "string", }, + "proxy": { + "additionalProperties": true, + "description": "Query parameters that can be used to pass through parameters to the underlying provider request by surrounding them with 'proxy' key", + "type": "object", + }, + "raw": { + "description": "Indicates that the raw request result should be returned in addition to the mapped result (default value is false)", + "type": "boolean", + }, "x-account-id": undefined, }, "required": [ "id", - "subResourceId", ], "type": "object", }, @@ -19736,7 +18720,7 @@ Map { "headers": { "Authorization": "Basic dGVzdF9rZXk6", }, - "method": "PATCH", + "method": "GET", "params": [ { "location": "header", @@ -19749,22 +18733,37 @@ Map { "type": "string", }, { - "location": "path", - "name": "subResourceId", - "type": "string", + "location": "query", + "name": "raw", + "type": "boolean", }, { "location": "query", "name": "proxy", + "type": "object", + }, + { + "location": "query", + "name": "fields", "type": "string", }, { - "location": "body", - "name": "comment", + "location": "query", + "name": "filter", + "type": "object", + }, + { + "location": "query", + "name": "page_size", + "type": "string", + }, + { + "location": "query", + "name": "next", "type": "string", }, ], - "url": "https://api.stackone.com/unified/hris/employees/{id}/tasks/{subResourceId}", + "url": "https://api.stackone.com/unified/hris/employees/{id}/time_off_policies", }, }, ], diff --git a/src/types.ts b/src/types.ts index 54042af..167647a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -25,30 +25,20 @@ export type JsonSchemaProperties = Record; export type JsonSchemaType = JSONSchema7['type']; /** - * Type definition for a derivation function - * Takes a source value and returns a derived value + * EXPERIMENTAL: Function to override the tool schema at creation time + * Takes the original tool parameters and returns a new schema + * @param originalSchema - The original tool parameters schema from OpenAPI + * @returns New schema definition for the tool */ -export type TransformFunction = (sourceValue: unknown) => unknown; +export type Experimental_SchemaOverride = (originalSchema: ToolParameters) => ToolParameters; /** - * Type definition for a map of derivation functions - * Keys are transformed parameter names, values are functions to derive that parameter + * EXPERIMENTAL: Function to preprocess parameters before tool execution + * Transforms parameters from override schema format back to original API format + * @param params - The input parameters in override schema format + * @returns Parameters in original API format */ -export type TransformFunctions = Record; - -/** - * Configuration for parameter transformations - * The key in the derivation configs map is the source parameter name - */ -export type ParameterTransformer = { - transforms: TransformFunctions; -}; - -/** - * Type definition for a map of derivation configurations - * Keys are source parameter names, values are derivation functions - */ -export type ParameterTransformerMap = Map; +export type Experimental_PreExecuteFunction = (params: JsonDict) => Promise | JsonDict; /** * Valid locations for parameters in requests @@ -75,6 +65,23 @@ export interface ExecuteConfig { }[]; // this params are the full list of params used to execute. This should come straight from the OpenAPI spec. } +/** + * EXPERIMENTAL: Options for creating tools with schema overrides and preExecute functions + */ +export interface Experimental_ToolCreationOptions { + /** + * EXPERIMENTAL: Function to override the tool schema at creation time + * Takes the original schema and returns a new schema for the tool + */ + experimental_schemaOverride?: Experimental_SchemaOverride; + + /** + * EXPERIMENTAL: Function to preprocess parameters before execution + * Transforms parameters from override schema format back to original API format + */ + experimental_preExecute?: Experimental_PreExecuteFunction; +} + /** * Options for executing a tool */