// This file is auto-generated by @hey-api/openapi-ts

export const $MagicLinkResDTO = {
    properties: {
        status: {
            type: 'string'
        }
    },
    type: 'object',
    required: ['status']
} as const;

export const $MagicLinkReqDTO = {
    properties: {
        email: {
            format: 'email',
            type: 'string',
            description: 'The email of the user',
            examples: ['john.doe@example.com', 'jane.doe@example.com']
        },
        verifyHost: {
            type: 'string',
            description: 'The frontend host of the user',
            examples: ['https://app.composio.dev', 'https://localhost:3000']
        }
    },
    type: 'object',
    required: ['email', 'verifyHost']
} as const;

export const $LogoutResDTO = {
    properties: {
        message: {
            type: 'string',
            description: 'Message confirming the logout',
            examples: ['Logout successful']
        }
    },
    type: 'object',
    required: ['message']
} as const;

export const $VerifyMagicLinkReqDTO = {
    properties: {
        token: {
            type: 'string',
            description: 'The magic link token',
            examples: ['token123', 'token456']
        }
    },
    type: 'object',
    required: ['token']
} as const;

export const $VerifyMagicLinkDataDTO = {
    properties: {
        clientId: {
            type: 'string'
        },
        isValid: {
            type: 'boolean'
        },
        jwtToken: {
            type: 'string'
        },
        email: {
            type: 'string',
            format: 'email'
        }
    },
    type: 'object',
    required: ['clientId', 'isValid', 'jwtToken', 'email']
} as const;

export const $VerifyMagicLinkResDTO = {
    properties: {
        message: {
            type: 'string',
            description: 'Message indicating the result of the verification',
            examples: ['Verification successful', 'Invalid or expired token']
        },
        data: {
            '$ref': '#/components/schemas/VerifyMagicLinkDataDTO',
            description: 'Data containing client and token information if verification is successful'
        }
    },
    type: 'object',
    required: ['message']
} as const;

export const $IdentifyClientReqDTO = {
    properties: {
        hash: {
            type: 'string',
            description: 'The hash of the client',
            examples: ['123abc', '456def']
        },
        framework: {
            type: 'string',
            description: 'The framework used by the client',
            examples: ['autogen', 'langchain']
        }
    },
    type: 'object',
    required: ['hash']
} as const;

export const $IdentifyClientResDTO = {
    properties: {
        clientId: {
            type: 'string',
            description: 'The client ID',
            examples: ['550e8400-e29b-41d4-a716-446655440000', '123e4567-e89b-12d3-a456-426614174000']
        },
        apiKey: {
            type: 'string',
            description: 'The API key associated with the client',
            examples: ['apiKey123', 'apiKey456']
        }
    },
    type: 'object',
    required: ['clientId', 'apiKey']
} as const;

export const $UserGitUserInfo = {
    properties: {
        name: {
            type: 'string'
        },
        email: {
            format: 'email',
            type: 'string'
        }
    },
    type: 'object',
    required: ['email']
} as const;

export const $TrackClientReqDTO = {
    properties: {
        framework: {
            type: 'string',
            description: 'The framework used by the client',
            examples: ['React', 'Vue', 'Angular']
        },
        mac_address: {
            type: 'string',
            description: 'The MAC address of the client device',
            examples: ['00:1A:2B:3C:4D:5E', '00:1B:2C:3D:4E:5F']
        },
        user_git_user_info: {
            '$ref': '#/components/schemas/UserGitUserInfo',
            description: 'User Git information',
            examples: [
                {
                    name: 'John Doe',
                    email: 'john.doe@example.com'
                }
            ]
        }
    },
    type: 'object',
    required: ['framework']
} as const;

export const $TrackClientResDTO = {
    properties: {
        message: {
            type: 'string',
            description: 'Message indicating the result of the tracking operation',
            examples: ['Already tracked', 'Event tracked successfully', 'Event not tracked for this user']
        }
    },
    type: 'object',
    required: ['message']
} as const;

export const $DeleteRowAPIDTO = {
    properties: {
        status: {
            type: 'string',
            description: 'Status of the delete operation',
            examples: ['success', 'failed']
        },
        count: {
            type: 'number',
            description: 'Number of records deleted',
            examples: [1]
        }
    },
    type: 'object',
    required: ['status', 'count']
} as const;

export const $InviteMemberReqDTO = {
    properties: {
        email: {
            format: 'email',
            type: 'string',
            description: 'The email of the member',
            examples: ['user@example.com']
        },
        name: {
            type: 'string',
            description: 'The name of the member',
            examples: ['John Doe']
        },
        verifyHost: {
            type: 'string',
            description: 'The host to verify the member',
            examples: ['https://app.composio.dev', 'https://localhost:3000']
        }
    },
    type: 'object',
    required: ['email', 'name', 'verifyHost']
} as const;

export const $MemberResDTO = {
    properties: {
        email: {
            type: 'string',
            description: 'The email of the member',
            examples: ['user@example.com']
        },
        id: {
            type: 'string',
            description: 'The uuid identifier for the member',
            examples: ['123e4567-e89b-12d3-a456-426655440000']
        },
        name: {
            type: 'string',
            description: 'The name of the member',
            examples: ['John Doe']
        },
        createdAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The creation date of the member record',
            examples: ['2021-01-01T00:00:00.000Z']
        },
        updatedAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The last update date of the member record',
            examples: ['2021-01-02T00:00:00.000Z']
        }
    },
    type: 'object',
    required: ['email', 'id', 'name']
} as const;

export const $GenerateAPIKeyReqDTO = {
    properties: {
        name: {
            type: 'string',
            description: 'The name of the API key to be generated',
            examples: ['primary', 'secondary']
        }
    },
    type: 'object',
    required: ['name']
} as const;

export const $APIKeyResDTO = {
    properties: {
        id: {
            type: 'string',
            description: 'The ID of the API key',
            examples: ['id123', 'id456']
        },
        name: {
            type: 'string',
            description: 'The name of the API key',
            examples: ['primary', 'secondary']
        },
        createdAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The creation date of the API key',
            examples: ['2023-01-01T00:00:00.000Z']
        },
        updatedAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The last update date of the API key',
            examples: ['2023-01-02T00:00:00.000Z']
        },
        key: {
            type: 'string',
            description: 'The generated API key',
            examples: ['apiKey123', 'apiKey456']
        }
    },
    type: 'object',
    required: ['id', 'name', 'createdAt', 'updatedAt', 'key']
} as const;

export const $DeleteAPIKeyReqDTO = {
    properties: {
        id: {
            type: 'string',
            description: 'The ID of the API key to be deleted',
            examples: ['id123', 'id456']
        }
    },
    type: 'object',
    required: ['id']
} as const;

export const $SingleAppInfoResDTO = {
    properties: {
        appId: {
            type: 'string',
            description: 'The unique identifier for the app'
        },
        key: {
            type: 'string',
            description: 'The key of the app'
        },
        name: {
            type: 'string',
            description: 'The name of the app'
        },
        description: {
            type: 'string',
            description: 'The description of the app'
        },
        logo: {
            type: 'string',
            description: 'The logo of the app'
        },
        categories: {
            items: {
                type: 'string'
            },
            type: 'array',
            description: 'The categories of the app'
        },
        path: {
            type: 'string',
            description: 'The path of the app'
        },
        docs: {
            type: 'string',
            description: 'The documentation URL of the app'
        },
        configuration_docs_text: {
            type: 'string',
            description: 'The configuration documentation text of the app'
        },
        status: {
            type: 'string',
            description: 'The status of the app'
        },
        documentation_doc_text: {
            type: 'string',
            description: 'The documentation text of the app'
        },
        testConnectors: {
            items: {},
            type: 'array',
            description: 'The test connectors of the app'
        },
        no_auth: {
            type: 'boolean',
            description: 'Indicates if the app has no authentication'
        },
        auth_schemes: {
            items: {},
            type: 'array',
            description: 'The authentication schemes of the app'
        },
        meta: {
            description: 'The metadata of the app'
        },
        yaml: {
            description: 'The yaml of the app'
        }
    },
    type: 'object',
    required: ['appId', 'key', 'name', 'description']
} as const;

export const $AddToolsReqDTO = {
    properties: {
        name: {
            type: 'string',
            description: 'The name of the tool'
        },
        openApiSpecYaml: {
            type: 'string',
            description: 'The OpenAPI specification in YAML format'
        },
        integrationYaml: {
            type: 'string',
            description: 'The integration details in YAML format'
        }
    },
    type: 'object',
    required: ['name', 'openApiSpecYaml', 'integrationYaml']
} as const;

export const $OpenAPISpecListResDTO = {
    properties: {
        id: {
            type: 'string',
            description: 'Unique identifier for the OpenAPI spec'
        },
        name: {
            type: 'string',
            description: 'Name of the OpenAPI spec'
        },
        clientId: {
            type: 'string',
            description: 'Client identifier'
        },
        openApiSpec: {
            type: 'string',
            description: 'OpenAPI specification in YAML format'
        },
        integrationYaml: {
            type: 'string',
            description: 'Integration details in YAML format'
        },
        enabled: {
            type: 'boolean',
            description: 'Whether the OpenAPI spec is enabled'
        },
        openAPISpecURL: {
            type: 'string',
            description: 'URL to the OpenAPI specification',
            format: 'uri',
            nullable: true
        },
        integrationYAMLURL: {
            type: 'string',
            description: 'URL to the integration YAML',
            format: 'uri',
            nullable: true
        },
        lastSyncAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'Last synchronization date and time',
            format: 'date-time'
        },
        createdAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'Creation date and time',
            format: 'date-time'
        },
        updatedAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'Last update date and time',
            format: 'date-time'
        },
        jobStatus: {
            enum: ['running', 'success', 'failed'],
            type: 'string',
            description: 'The job status of the app'
        }
    },
    type: 'object',
    required: ['id', 'name', 'clientId', 'openApiSpec', 'integrationYaml', 'enabled', 'lastSyncAt', 'createdAt', 'updatedAt']
} as const;

export const $AddRepoURLResDTO = {
    properties: {
        repoUrl: {
            type: 'string',
            description: 'Repository URL'
        }
    },
    type: 'object',
    required: ['repoUrl']
} as const;

export const $DeleteToolsReqDTO = {
    properties: {
        name: {
            type: 'string',
            description: 'Name of the tool'
        }
    },
    type: 'object',
    required: ['name']
} as const;

export const $DeleteToolsResDTO = {
    properties: {
        message: {
            type: 'string',
            description: 'Message indicating successful deletion of tools'
        }
    },
    type: 'object',
    required: ['message']
} as const;

export const $AddToolsRequestDTO = {
    properties: {
        name: {
            type: 'string',
            description: 'The name of the tool'
        },
        open_api_spec_yaml: {
            type: 'string',
            description: 'The OpenAPI specification in YAML format'
        },
        integration_yaml: {
            type: 'string',
            description: 'The integration details in YAML format'
        }
    },
    type: 'object',
    required: ['name', 'open_api_spec_yaml', 'integration_yaml']
} as const;

export const $AddRepoURLReqDTO = {
    properties: {
        repoUrl: {
            type: 'string',
            description: 'Repository URL'
        }
    },
    type: 'object',
    required: ['repoUrl']
} as const;

export const $AppQueryDTO = {
    properties: {
        category: {
            type: 'string',
            description: 'Category of the app',
            examples: ['popular', 'crm', 'devtools']
        }
    },
    type: 'object'
} as const;

export const $AppInfoResponseDto = {
    properties: {
        appId: {
            type: 'string',
            description: 'The ID of the app'
        },
        key: {
            type: 'string',
            description: 'The key of the app'
        },
        name: {
            type: 'string',
            description: 'The name of the app'
        },
        description: {
            type: 'string',
            description: 'The description of the app'
        },
        logo: {
            type: 'string',
            description: 'The logo of the app'
        },
        categories: {
            items: {},
            type: 'string',
            description: 'The categories of the app'
        },
        enabled: {
            type: 'boolean',
            description: 'Indicates if the app is enabled'
        },
        noAuth: {
            type: 'boolean',
            description: 'Indicates if the app has no authentication'
        }
    },
    type: 'object',
    required: ['appId', 'key', 'name', 'description', 'logo', 'categories', 'enabled']
} as const;

export const $AppListResDTO = {
    properties: {
        items: {
            items: {
                '$ref': '#/components/schemas/AppInfoResponseDto'
            },
            type: 'array',
            description: 'List of app details'
        },
        totalPages: {
            type: 'number',
            description: 'Total number of pages'
        }
    },
    type: 'object',
    required: ['items', 'totalPages']
} as const;

export const $GetConnectorInfoResDTO = {
    properties: {
        id: {
            type: 'string',
            description: 'Unique identifier of the connector',
            examples: ['connector123']
        },
        authScheme: {
            type: 'string',
            description: 'Authentication scheme used by the connector',
            examples: ['OAuth2', 'APIKey']
        },
        name: {
            type: 'string',
            description: 'Name of the connector',
            examples: ['MyConnector']
        },
        createdAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'Creation date of the connector',
            examples: ['2021-07-21T17:32:28Z']
        },
        updatedAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'Last update date of the connector',
            examples: ['2021-08-21T17:32:28Z']
        },
        enabled: {
            type: 'boolean',
            description: 'Flag to indicate if the connector is currently enabled',
            examples: [true, false]
        },
        deleted: {
            type: 'boolean',
            description: 'Flag to indicate if the connector has been deleted',
            examples: [true, false, null]
        },
        appId: {
            type: 'string',
            description: 'Application ID associated with the connector',
            examples: ['app123', 'app456']
        },
        defaultConnectorId: {
            type: 'string',
            description: 'Default connector ID if one exists',
            examples: ['connector987', 'connector654', null]
        },
        authConfig: {
            type: 'object',
            description: 'Authentication configuration with sensitive data obscured'
        },
        expectedInputFields: {
            items: {
                type: 'string'
            },
            type: 'array',
            description: 'List of required fields expected from the customer',
            examples: ['field1', 'field2']
        },
        logo: {
            type: 'string',
            description: 'Logo URL of the application associated with the connector',
            examples: ['https://example.com/logo.png']
        },
        appName: {
            type: 'string',
            description: 'Name of the application associated with the connector',
            examples: ['MyApp']
        },
        useComposioAuth: {
            type: 'boolean',
            description: 'Flag to indicate if Composio authentication is used',
            examples: [true, false]
        }
    },
    type: 'object',
    required: ['enabled', 'appId', 'authConfig', 'expectedInputFields', 'logo', 'appName', 'useComposioAuth']
} as const;

export const $AuthConfigDTO = {
    properties: {
        scopes: {
            items: {
                type: 'string'
            },
            type: 'array'
        },
        user_scopes: {
            items: {
                type: 'string'
            },
            type: 'array'
        }
    },
    type: 'object'
} as const;

export const $CreateConnectorPayloadDTO = {
    properties: {
        name: {
            type: 'string',
            description: 'Name of the connector',
            examples: ['MyConnector']
        },
        authScheme: {
            type: 'string',
            description: 'Authentication scheme',
            examples: ['OAuth2', 'APIKey']
        },
        authConfig: {
            '$ref': '#/components/schemas/AuthConfigDTO',
            description: 'Authentication configuration'
        },
        useComposioAuth: {
            type: 'boolean',
            description: 'Flag to indicate if Composio authentication should be used',
            examples: [true, false],
            anyOf: [
                {
                    type: 'boolean'
                }
            ]
        },
        appId: {
            type: 'string',
            description: 'Application ID',
            examples: ['appId123']
        },
        forceNewIntegration: {
            type: 'boolean',
            description: 'Flag to force new integration',
            examples: [true, false]
        }
    },
    type: 'object',
    required: ['name', 'appId']
} as const;

export const $PatchConnectorReqDTO = {
    properties: {
        authConfig: {
            type: 'object',
            description: 'Authentication configuration for the connector',
            examples: [
                {
                    key: 'value'
                }
            ]
        },
        enabled: {
            type: 'boolean',
            description: 'Flag to indicate if the connector is enabled',
            examples: [true, false]
        }
    },
    type: 'object'
} as const;

export const $PatchConnectorResDTO = {
    properties: {
        status: {
            type: 'string',
            description: 'Status of the patch operation',
            examples: ['success']
        }
    },
    type: 'object',
    required: ['status']
} as const;

export const $ConnectorListItemDTO = {
    properties: {
        appName: {
            type: 'string',
            description: 'Application name associated with the connector',
            examples: ['MyApp']
        },
        _count: {
            type: 'object',
            description: 'Count of connections for the connector',
            examples: [
                {
                    connections: 5
                }
            ]
        },
        connections: {
            items: {},
            type: 'array',
            description: 'List of connections with their details and request logs count',
            examples: [
                {
                    id: 'conn1',
                    _count: {
                        requestLogs: 10
                    }
                }
            ]
        },
        id: {
            type: 'string',
            description: 'Unique identifier of the connector',
            examples: ['connector123']
        },
        name: {
            type: 'string',
            description: 'Name of the connector',
            examples: ['MyConnector']
        },
        authScheme: {
            type: 'string',
            description: 'Authentication scheme used by the connector',
            examples: ['OAuth2']
        },
        createdAt: {
            oneOf: [
                {
                    format: 'date',
                    type: 'string'
                },
                {
                    format: 'date-time',
                    type: 'string'
                }
            ],
            description: 'Creation date of the connector',
            examples: ['2024-08-13T03:09:15.422Z']
        },
        updatedAt: {
            oneOf: [
                {
                    format: 'date',
                    type: 'string'
                },
                {
                    format: 'date-time',
                    type: 'string'
                }
            ],
            description: 'Last update date of the connector',
            examples: ['2024-08-13T03:09:15.422Z']
        },
        enabled: {
            type: 'boolean',
            description: 'Flag to indicate if the connector is enabled',
            examples: [true, false]
        },
        deleted: {
            type: 'boolean',
            description: 'Flag to indicate if the connector is deleted',
            examples: [
                null,
                true
            ]
        },
        appId: {
            type: 'string',
            description: 'App ID associated with the connector',
            examples: ['appId123']
        },
        defaultConnectorId: {
            type: 'string',
            description: 'Default connector ID if available',
            examples: [
                null,
                'defaultConn123'
            ]
        }
    },
    type: 'object',
    required: ['appName', '_count', 'connections', 'id', 'name', 'authScheme', 'createdAt', 'updatedAt', 'enabled', 'appId']
} as const;

export const $GetConnectorListResDTO = {
    properties: {
        items: {
            items: {},
            type: 'array',
            description: 'List of connectors'
        },
        totalPages: {
            type: 'number',
            description: 'Total number of pages available'
        },
        page: {
            type: 'number',
            description: 'Current page number'
        }
    },
    type: 'object',
    required: ['items', 'totalPages', 'page']
} as const;

export const $PageInfo = {
    properties: {
        total: {
            minimum: 0,
            type: 'integer'
        },
        page: {
            minimum: 1,
            type: 'integer'
        },
        pageSize: {
            minimum: 1,
            type: 'integer'
        },
        totalPages: {
            minimum: 1,
            type: 'integer'
        }
    },
    type: 'object',
    required: ['total', 'page', 'pageSize', 'totalPages']
} as const;

export const $ConnectionWithAppData = {
    properties: {
        id: {
            type: 'string'
        },
        integrationId: {
            type: 'string'
        },
        clientUniqueUserId: {
            type: 'string'
        },
        status: {
            type: 'string'
        },
        data: {
            type: 'object'
        },
        deleted: {
            type: 'boolean'
        },
        enabled: {
            type: 'boolean'
        },
        createdAt: {
            oneOf: [
                {
                    format: 'date',
                    type: 'string'
                },
                {
                    format: 'date-time',
                    type: 'string'
                }
            ]
        },
        updatedAt: {
            oneOf: [
                {
                    format: 'date',
                    type: 'string'
                },
                {
                    format: 'date-time',
                    type: 'string'
                }
            ]
        },
        appUniqueId: {
            type: 'string'
        },
        appName: {
            type: 'string'
        },
        logo: {
            type: 'string'
        },
        authConfig: {
            type: 'object'
        }
    },
    type: 'object',
    required: ['id', 'integrationId', 'status', 'createdAt', 'updatedAt', 'appUniqueId', 'appName']
} as const;

export const $GetConnectionsResult = {
    properties: {
        connections: {
            items: {
                '$ref': '#/components/schemas/ConnectionWithAppData'
            },
            type: 'array'
        },
        pageInfo: {
            '$ref': '#/components/schemas/PageInfo'
        }
    },
    type: 'object',
    required: ['connections', 'pageInfo']
} as const;

export const $ActionExecutionServiceResDTO = {
    properties: {
        response_data: {
            type: 'boolean'
        },
        execution_details: {
            type: 'object'
        }
    },
    type: 'object',
    required: ['response_data', 'execution_details']
} as const;

export const $ToolsExecuteReqDto = {
    properties: {
        actionName: {
            type: 'string'
        },
        runInSandbox: {
            type: 'boolean'
        },
        input: {
            type: 'object'
        },
        nlaInput: {
            type: 'string'
        },
        authorizationData: {
            type: 'object'
        },
        appSchema: {
            type: 'object'
        }
    },
    type: 'object',
    required: ['actionName', 'runInSandbox', 'input']
} as const;

export const $DirectExecuteReqDto = {
    properties: {
        endpoint: {
            type: 'string'
        },
        base_url: {
            type: 'string'
        },
        headers: {
            type: 'object'
        },
        queryParams: {
            type: 'object'
        }
    },
    type: 'object',
    required: ['endpoint', 'base_url', 'headers', 'queryParams']
} as const;

export const $ActionExecutionResDto = {
    properties: {
        response_data: {
            type: 'object'
        },
        status: {
            enum: ['success', 'error'],
            type: 'string'
        },
        upstreamStatusCode: {
            type: 'number'
        }
    },
    type: 'object',
    required: ['response_data', 'status', 'upstreamStatusCode']
} as const;

export const $ActionExecutionReqDTO = {
    properties: {
        connectedAccountId: {
            type: 'string'
        },
        appName: {
            type: 'string'
        },
        entityId: {
            type: 'string'
        },
        endpoint: {
            type: 'string'
        },
        input: {
            type: 'object'
        },
        text: {
            type: 'string'
        }
    },
    type: 'object'
} as const;

export const $ActionExecutionResDTO = {
    properties: {
        connectedAccountId: {
            type: 'string'
        },
        appName: {
            type: 'string'
        },
        entityId: {
            type: 'string'
        },
        endpoint: {
            type: 'string'
        },
        input: {
            type: 'object'
        },
        text: {
            type: 'string'
        }
    },
    type: 'object'
} as const;

export const $ActionDetails = {
    properties: {
        appId: {
            type: 'string'
        },
        appKey: {
            type: 'string'
        },
        appName: {
            type: 'string'
        },
        description: {
            type: 'string'
        },
        displayName: {
            type: 'string'
        },
        enabled: {
            type: 'boolean'
        },
        logo: {
            type: 'string'
        },
        name: {
            type: 'string'
        },
        parameters: {
            type: 'object'
        },
        response: {
            type: 'object'
        },
        tags: {
            items: {
                type: 'string'
            },
            type: 'array'
        }
    },
    type: 'object',
    required: ['appKey', 'appName', 'description', 'displayName', 'enabled', 'logo', 'name', 'parameters', 'response', 'tags']
} as const;

export const $ActionsListResponseDTO = {
    properties: {
        items: {
            items: {
                '$ref': '#/components/schemas/ActionDetails'
            },
            type: 'array'
        },
        page: {
            type: 'number'
        },
        totalPages: {
            type: 'number'
        }
    },
    type: 'object',
    required: ['items', 'page', 'totalPages']
} as const;

export const $ExecuteActionResDTO = {
    properties: {
        response_data: {
            type: 'object'
        },
        status: {
            enum: ['success', 'error'],
            type: 'string'
        },
        upstreamStatusCode: {
            type: 'number'
        }
    },
    type: 'object',
    required: ['response_data', 'status', 'upstreamStatusCode']
} as const;

export const $ActionsQueryDTO = {
    properties: {
        appNames: {
            type: 'string',
            description: 'Names of the apps'
        },
        useCase: {
            type: 'string',
            description: 'Use case'
        },
        showEnabledOnly: {
            type: 'boolean',
            description: 'Show enabled only'
        },
        limit: {
            type: 'number',
            description: 'Limit'
        },
        apps: {
            type: 'string'
        },
        actions: {
            type: 'string'
        },
        tags: {
            type: 'string'
        },
        usecaseLimit: {
            type: 'number'
        },
        filterImportantActions: {
            type: 'boolean'
        },
        showAll: {
            type: 'boolean'
        }
    },
    type: 'object'
} as const;

export const $ActionsControllerV1 = {
    properties: {
        getAction: {
            items: {},
            type: 'array'
        }
    },
    type: 'object',
    required: ['getAction']
} as const;

export const $ConnectionParams = {
    properties: {
        integrationId: {
            type: 'string'
        },
        connectionParams: {
            type: 'object'
        },
        isDisabled: {
            type: 'boolean'
        },
        invocationCount: {
            type: 'number'
        },
        id: {
            type: 'string'
        },
        clientUniqueUserId: {
            type: 'string'
        },
        status: {
            type: 'string'
        },
        data: {
            type: 'object'
        },
        deleted: {
            type: 'boolean'
        },
        enabled: {
            type: 'boolean'
        },
        createdAt: {
            oneOf: [
                {
                    format: 'date',
                    type: 'string'
                },
                {
                    format: 'date-time',
                    type: 'string'
                }
            ]
        },
        updatedAt: {
            oneOf: [
                {
                    format: 'date',
                    type: 'string'
                },
                {
                    format: 'date-time',
                    type: 'string'
                }
            ]
        },
        appUniqueId: {
            type: 'string'
        },
        appName: {
            type: 'string'
        },
        logo: {
            type: 'string'
        },
        authConfig: {
            type: 'object'
        }
    },
    type: 'object',
    required: ['integrationId', 'isDisabled', 'invocationCount', 'id', 'status', 'createdAt', 'updatedAt', 'appUniqueId', 'appName']
} as const;

export const $GetConnectionsResponseDto = {
    properties: {
        items: {
            items: {
                '$ref': '#/components/schemas/ConnectionParams'
            },
            type: 'array'
        },
        totalPages: {
            type: 'number'
        },
        page: {
            type: 'number'
        }
    },
    type: 'object',
    required: ['items', 'totalPages', 'page']
} as const;

export const $GetConnectionsQueryDto = {
    properties: {
        page: {
            type: 'number'
        },
        pageSize: {
            type: 'number'
        },
        appNames: {},
        integrationId: {
            type: 'string'
        },
        connectionId: {
            type: 'string'
        },
        user_uuid: {
            type: 'string'
        },
        showActiveOnly: {
            type: 'boolean'
        },
        status: {
            type: 'string'
        },
        showDisabled: {
            type: 'boolean'
        }
    },
    type: 'object'
} as const;

export const $InitiateConnectionPayloadDto = {
    properties: {
        data: {
            type: 'string',
            minLength: 1
        },
        integrationId: {
            minLength: 1,
            type: 'string'
        },
        redirectUri: {
            type: 'string'
        },
        userUuid: {
            type: 'string'
        }
    },
    type: 'object',
    required: ['integrationId']
} as const;

export const $InitiateConnectionResponse = {
    properties: {
        connectionStatus: {
            minLength: 1,
            type: 'string'
        },
        connectedAccountId: {
            minLength: 1,
            type: 'string'
        }
    },
    type: 'object',
    required: ['connectionStatus', 'connectedAccountId']
} as const;

export const $OAuth2CallbackQueryDto = {
    properties: {
        state: {
            type: 'string'
        }
    },
    type: 'object',
    required: ['state']
} as const;

export const $RedirectUriDTO = {
    properties: {
        redirectUri: {
            type: 'string'
        }
    },
    type: 'object',
    required: ['redirectUri']
} as const;

export const $ListTriggersQueryDTO = {
    properties: {
        appNames: {
            type: 'string',
            description: 'Names of the apps'
        },
        connectedAccountIds: {
            type: 'string',
            description: 'IDs of the connected accounts'
        },
        triggerIds: {
            type: 'string',
            description: 'IDs of the triggers'
        },
        showEnabledOnly: {
            type: 'boolean',
            description: 'Show enabled only'
        }
    },
    type: 'object'
} as const;

export const $GetActiveTriggersQueryDTO = {
    properties: {
        connectedAccountIds: {
            type: 'string',
            description: 'IDs of the connected accounts'
        },
        integrationIds: {
            type: 'string',
            description: 'IDs of the integrations'
        },
        triggerIds: {
            type: 'string',
            description: 'IDs of the triggers'
        },
        triggerNames: {
            type: 'string',
            description: 'Names of the triggers'
        },
        page: {
            type: 'number',
            description: 'Page number'
        },
        limit: {
            type: 'number',
            description: 'Limit per page'
        },
        showDisabled: {
            type: 'boolean',
            description: 'Show disabled triggers'
        }
    },
    type: 'object'
} as const;

export const $GetLogsQueryDTO = {
    properties: {
        connectionId: {
            type: 'string',
            description: 'ID of the connection'
        },
        integrationId: {
            type: 'string',
            description: 'ID of the integration'
        },
        page: {
            type: 'number',
            description: 'Page number'
        },
        limit: {
            type: 'number',
            description: 'Limit per page'
        }
    },
    type: 'object'
} as const;

export const $TriggerResDTO = {
    properties: {
        name: {
            type: 'string',
            description: 'Trigger name'
        },
        display_name: {
            type: 'string',
            description: 'Trigger display name'
        },
        description: {
            type: 'string',
            description: 'Trigger description'
        },
        enabled: {
            type: 'boolean',
            description: 'Is trigger enabled'
        },
        config: {
            type: 'object',
            description: 'Trigger configuration'
        },
        payload: {
            type: 'object',
            description: 'Trigger payload'
        },
        logo: {
            type: 'string',
            description: 'Trigger logo URL'
        },
        count: {
            type: 'number',
            description: 'Trigger count'
        },
        appKey: {
            type: 'string',
            description: 'App key'
        },
        appId: {
            type: 'string',
            description: 'App ID'
        },
        appName: {
            type: 'string',
            description: 'App name'
        },
        instructions: {
            type: 'string',
            description: 'Trigger instructions'
        },
        type: {
            type: 'string',
            description: 'Trigger type'
        }
    },
    type: 'object',
    required: ['name', 'display_name', 'appKey', 'appId', 'appName']
} as const;

export const $TriggerConfig = {
    properties: {
        repo: {
            type: 'string',
            description: 'Repository name'
        },
        owner: {
            type: 'string',
            description: 'Repository owner'
        }
    },
    type: 'object',
    required: ['repo', 'owner']
} as const;

export const $ActiveTriggerInstance = {
    properties: {
        id: {
            type: 'string',
            description: 'Trigger instance ID'
        },
        connectionId: {
            type: 'string',
            description: 'Connected account ID'
        },
        triggerName: {
            type: 'string',
            description: 'Trigger name'
        },
        triggerData: {
            type: 'string',
            description: 'Trigger data'
        },
        triggerConfig: {
            '$ref': '#/components/schemas/TriggerConfig',
            description: 'Trigger configuration'
        },
        createdAt: {
            type: 'string',
            description: 'Created at timestamp',
            format: 'date-time'
        },
        updatedAt: {
            type: 'string',
            description: 'Updated at timestamp',
            format: 'date-time'
        },
        disabledAt: {
            type: 'string',
            description: 'Disabled at timestamp',
            format: 'date-time',
            nullable: true
        }
    },
    type: 'object',
    required: ['connectionId', 'triggerName', 'triggerConfig', 'createdAt', 'updatedAt']
} as const;

export const $PageInfoDTO = {
    properties: {
        currentPage: {
            type: 'number'
        },
        perPage: {
            type: 'number'
        },
        totalPages: {
            type: 'number'
        }
    },
    type: 'object',
    required: ['currentPage', 'perPage', 'totalPages']
} as const;

export const $ActiveTriggersResDTO = {
    properties: {
        triggers: {
            items: {},
            type: 'array'
        },
        pageInfo: {
            items: {
                '$ref': '#/components/schemas/PageInfoDTO'
            },
            type: 'array'
        }
    },
    type: 'object',
    required: ['triggers', 'pageInfo']
} as const;

export const $TriggerLogsResDTO = {
    properties: {
        data: {
            items: {
                '$ref': '#/components/schemas/TriggerLogItemDTO'
            },
            type: 'array'
        },
        pageInfo: {
            '$ref': '#/components/schemas/PageInfoDTO'
        }
    },
    type: 'object',
    required: ['data', 'pageInfo']
} as const;

export const $TriggerLogItemDTO = {
    properties: {
        clientId: {
            type: 'string',
            description: 'Client ID'
        },
        connectionId: {
            type: 'string',
            description: 'Connection ID'
        },
        errorTrigger: {
            type: 'string',
            description: 'Error trigger',
            nullable: true
        },
        triggerClientError: {
            type: 'string',
            description: 'Trigger client error',
            nullable: true
        },
        triggerClientPayload: {
            type: 'string',
            description: 'Trigger client payload',
            nullable: true
        },
        triggerProviderPayload: {
            type: 'string',
            description: 'Trigger provider payload',
            nullable: true
        },
        triggerName: {
            type: 'string',
            description: 'Trigger name',
            nullable: true
        },
        id: {
            type: 'string',
            description: 'Log ID'
        },
        appKey: {
            type: 'string',
            description: 'App key'
        },
        createdAt: {
            type: 'string',
            description: 'Created at timestamp',
            format: 'date-time'
        }
    },
    type: 'object',
    required: ['clientId', 'connectionId', 'id', 'appKey', 'createdAt']
} as const;

export const $GenerateCLISessionReqDTO = {
    properties: {
        channel_name: {
            type: 'string',
            description: 'The channel name for the CLI session',
            examples: ['general', 'development']
        }
    },
    type: 'object',
    required: ['channel_name']
} as const;

export const $LoginAccountAsAdminReqDTO = {
    properties: {
        email: {
            type: 'string',
            description: 'Email of the client',
            examples: ['utkarshdix02@gmail.com']
        },
        apiKey: {
            type: 'string',
            description: 'API Key of the client',
            examples: ['Xfhidushj312x21']
        },
        adminToken: {
            type: 'string',
            description: 'Admin token',
            examples: ['Xfhidushj312x21']
        }
    },
    type: 'object',
    required: ['adminToken']
} as const;

export const $GenerateCLISessionResDTO = {
    properties: {
        key: {
            type: 'string',
            description: 'The key for the CLI session',
            examples: ['550e8400-e29b-41d4-a716-446655440000', '123e4567-e89b-12d3-a456-426614174000']
        }
    },
    type: 'object',
    required: ['key']
} as const;

export const $GetCLISessionResDTO = {
    properties: {
        clientId: {
            type: 'string',
            description: 'The client ID',
            examples: ['550e8400-e29b-41d4-a716-446655440000', '123e4567-e89b-12d3-a456-426614174000']
        },
        cliCode: {
            type: 'string',
            description: 'The CLI code',
            examples: ['cliCode123', 'cliCode456']
        }
    },
    type: 'object',
    required: ['clientId', 'cliCode']
} as const;

export const $VerifyCLICodeResDTO = {
    properties: {
        clientId: {
            type: 'string',
            description: 'The client ID',
            examples: ['550e8400-e29b-41d4-a716-446655440000', '123e4567-e89b-12d3-a456-426614174000']
        },
        cliCode: {
            type: 'string',
            description: 'The CLI code',
            examples: ['cliCode123', 'cliCode456']
        },
        apiKey: {
            type: 'string',
            description: 'The API key associated with the client',
            examples: ['apiKey123', 'apiKey456']
        }
    },
    type: 'object',
    required: ['clientId', 'cliCode', 'apiKey']
} as const;

export const $CLIQueryDTO = {
    properties: {
        key: {
            type: 'string',
            description: 'Unique key for CLI session',
            examples: ['123e4567-e89b-12d3-a456-426614174000']
        },
        code: {
            type: 'string',
            description: 'Code for CLI verification',
            examples: ['ABCD1234']
        }
    },
    type: 'object',
    required: ['key']
} as const;

export const $MetadataReqDTO = {
    properties: {
        email: {
            type: 'string',
            description: 'The email associated with the metadata request',
            examples: ['user@example.com']
        },
        metadata: {
            description: 'Additional metadata as a key-value pair',
            examples: [
                {
                    key: 'value'
                }
            ]
        }
    },
    type: 'object',
    required: ['email']
} as const;

export const $TriggersEnabledToggleReqDTO = {
    properties: {
        enabled: {
            type: 'boolean',
            description: 'Flag to enable or disable triggers',
            examples: [true, false]
        }
    },
    type: 'object',
    required: ['enabled']
} as const;

export const $TriggersEnabledToggleResDTO = {
    properties: {
        message: {
            type: 'string',
            description: 'Message indicating the result of the toggle operation',
            examples: ['Triggers enabled successfully', 'Triggers disabled successfully']
        }
    },
    type: 'object',
    required: ['message']
} as const;

export const $MetadataQueryDTO = {
    properties: {
        email: {
            type: 'string',
            description: 'Email of the client',
            examples: ['example@example.com']
        }
    },
    type: 'object',
    required: ['email']
} as const;

export const $TriggerMetadata = {
    properties: {
        id: {
            type: 'string',
            description: 'The unique id of the log',
            examples: ['123e4567-e89b-12d3-a456-426655440000']
        },
        type: {
            type: 'string',
            description: 'The type of the log',
            oneOf: [
                {
                    type: 'string',
                    enum: ['trigger']
                }
            ]
        },
        createdAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The date and time when the log was created',
            format: 'date-time'
        },
        updatedAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The date and time when the log was updated',
            format: 'date-time'
        },
        provider: {
            type: 'string',
            description: 'The provider of the log'
        },
        clientId: {
            type: 'string',
            description: 'The client uuid of the log'
        },
        connectionId: {
            type: 'string',
            description: 'The connection id of the log'
        },
        triggerProviderPayload: {
            type: 'string',
            description: 'The trigger provider payload of the log'
        },
        triggerClientPayload: {
            type: 'string'
        },
        triggerClientError: {
            type: 'string',
            description: 'The trigger client error of the log'
        },
        triggerName: {
            type: 'string',
            description: 'The trigger name of the log'
        },
        triggerClientResponse: {
            type: 'string',
            description: 'The trigger client response of the log'
        }
    },
    type: 'object',
    required: ['id', 'type', 'createdAt', 'updatedAt', 'provider', 'clientId', 'connectionId']
} as const;

export const $ActionMetadata = {
    properties: {
        id: {
            type: 'string',
            description: 'The unique id of the log',
            examples: ['123e4567-e89b-12d3-a456-426655440000']
        },
        request: {
            type: 'string',
            description: 'The request sent to the provider'
        },
        response: {
            type: 'string',
            description: 'The response from the provider'
        },
        errorRequest: {
            type: 'string',
            description: 'The error request sent to the provider'
        },
        type: {
            type: 'string',
            description: 'The type of the log',
            oneOf: [
                {
                    type: 'string',
                    enum: ['action']
                }
            ]
        },
        createdAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The date and time when the log was created',
            format: 'date-time'
        },
        updatedAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The date and time when the log was updated',
            format: 'date-time'
        },
        provider: {
            type: 'string',
            description: 'The provider of the log'
        },
        clientId: {
            type: 'string',
            description: 'The client uuid of the log'
        },
        connectionId: {
            type: 'string',
            description: 'The connection id of the log'
        },
        actionName: {
            type: 'string',
            description: 'The action name of the log'
        }
    },
    type: 'object',
    required: ['id', 'request', 'type', 'createdAt', 'updatedAt', 'provider', 'clientId', 'connectionId', 'actionName']
} as const;

export const $TriggerLogData = {
    properties: {
        id: {
            type: 'string',
            description: 'The unique identifier of the trigger log'
        },
        connectionId: {
            type: 'string',
            description: 'The connection identifier associated with the trigger log'
        },
        clientId: {
            type: 'string',
            description: 'The client identifier associated with the trigger log'
        },
        status: {
            type: 'string',
            description: 'The status of the trigger log'
        },
        appName: {
            type: 'string',
            description: 'The name of the application associated with the trigger log'
        },
        createdAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The creation date and time of the trigger log',
            format: 'date-time'
        },
        type: {
            type: 'string',
            description: 'The type of the log',
            oneOf: [
                {
                    type: 'string',
                    enum: ['trigger']
                }
            ]
        },
        meta: {
            '$ref': '#/components/schemas/TriggerMetadata',
            description: 'Metadata associated with the trigger log'
        }
    },
    type: 'object',
    required: ['id', 'connectionId', 'clientId', 'status', 'appName', 'createdAt', 'type', 'meta']
} as const;

export const $ActionLogData = {
    properties: {
        id: {
            type: 'string',
            description: 'The unique identifier of the action log'
        },
        connectionId: {
            type: 'string',
            description: 'The connection identifier associated with the action log'
        },
        clientId: {
            type: 'string',
            description: 'The client identifier associated with the action log'
        },
        status: {
            type: 'string',
            description: 'The status of the action log'
        },
        appName: {
            type: 'string',
            description: 'The name of the application associated with the action log'
        },
        createdAt: {
            pattern: '\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+Z?',
            type: 'string',
            description: 'The creation date and time of the action log',
            format: 'date-time'
        },
        type: {
            type: 'string',
            description: 'The type of the log',
            oneOf: [
                {
                    type: 'string',
                    enum: ['action']
                }
            ]
        },
        meta: {
            '$ref': '#/components/schemas/ActionMetadata',
            description: 'Metadata associated with the action log'
        }
    },
    type: 'object',
    required: ['id', 'connectionId', 'clientId', 'status', 'appName', 'createdAt', 'type', 'meta']
} as const;

export const $LogsResDTO = {
    properties: {
        nextCursor: {
            type: 'string',
            description: 'The cursor to get the next page of logs',
            examples: ['123e4567-e89b-12d3-a456-426655440000']
        },
        data: {
            items: {},
            type: 'array',
            description: 'Logs data'
        }
    },
    type: 'object',
    required: ['data']
} as const;

export const $GetLogsDTO = {
    properties: {
        type: {
            enum: ['error', 'info', 'debug'],
            type: 'string',
            description: 'Type of the log',
            examples: ['error', 'info', 'debug']
        },
        time: {
            enum: ['30m', '6h', '1d', '1w', '1month', '1y'],
            type: 'string',
            description: 'Time interval for which data needs to be fetched',
            examples: ['30m', '6h', '1d', '1w', '1month', '1y']
        },
        status: {
            enum: ['pending', 'processed', 'failed'],
            type: 'string',
            description: 'Status of the log',
            examples: ['pending', 'processed', 'failed']
        },
        search: {
            type: 'string',
            description: 'Search term in the log',
            examples: ['error', 'user not found']
        },
        integrationId: {
            type: 'string',
            description: 'Integration UUID',
            examples: ['123e4567-e89b-12d3-a456-426655440000']
        },
        limit: {
            type: 'number',
            description: 'Limit of the logs',
            examples: [10],
            default: 10
        },
        cursor: {
            type: 'string',
            description: 'Cursor for pagination',
            examples: ['cursor123']
        },
        connectionId: {
            type: 'string',
            description: 'Connection ID of the log',
            examples: ['connection123']
        }
    },
    type: 'object'
} as const;