file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
lua/avante/ui/selector/providers/mini_pick.lua | Lua | local Utils = require("avante.utils")
local M = {}
---@param selector avante.ui.Selector
function M.show(selector)
-- luacheck: globals MiniPick
---@diagnostic disable-next-line: undefined-field
if not _G.MiniPick then
Utils.error("mini.pick is not set up. Please install and set up mini.pick to use it as a f... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/ui/selector/providers/native.lua | Lua | local M = {}
---@param selector avante.ui.Selector
function M.show(selector)
local items = {}
for _, item in ipairs(selector.items) do
if not vim.list_contains(selector.selected_item_ids, item.id) then table.insert(items, item) end
end
vim.ui.select(items, {
prompt = selector.title,
format_item = f... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/ui/selector/providers/snacks.lua | Lua | local Utils = require("avante.utils")
local M = {}
---@param selector avante.ui.Selector
function M.show(selector)
---@diagnostic disable-next-line: undefined-field
if not _G.Snacks then
Utils.error("Snacks is not set up. Please install and set up Snacks to use it as a file selector.")
return
end
local... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/ui/selector/providers/telescope.lua | Lua | local Utils = require("avante.utils")
local M = {}
---@param selector avante.ui.Selector
function M.show(selector)
local success, _ = pcall(require, "telescope")
if not success then
Utils.error("telescope is not installed. Please install telescope to use it as a file selector.")
return
end
local pick... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/diff2search_replace.lua | Lua | local function trim(s) return s:gsub("^%s+", ""):gsub("%s+$", "") end
local function split_lines(text)
local lines = {}
for line in text:gmatch("[^\r\n]+") do
table.insert(lines, line)
end
return lines
end
local function diff2search_replace(diff_text)
if not diff_text:match("@@%s*%-%d+,%d+%s%+") then re... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/environment.lua | Lua | local Utils = require("avante.utils")
---@class avante.utils.environment
local M = {}
---@private
---@type table<string, string>
M.cache = {}
---Parse environment variable using optional cmd: feature with an override fallback
---@param key_name string
---@param override? string
---@return string | nil
function M.par... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/file.lua | Lua | local LRUCache = require("avante.utils.lru_cache")
local Filetype = require("plenary.filetype")
---@class avante.utils.file
local M = {}
local api = vim.api
local fn = vim.fn
local _file_content_lru_cache = LRUCache:new(60)
api.nvim_create_autocmd("BufWritePost", {
callback = function()
local filepath = api.n... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/init.lua | Lua | local api = vim.api
local fn = vim.fn
local lsp = vim.lsp
local LRUCache = require("avante.utils.lru_cache")
local diff2search_replace = require("avante.utils.diff2search_replace")
---@class avante.utils: LazyUtilCore
---@field tokens avante.utils.tokens
---@field root avante.utils.root
---@field file avante.utils.fi... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/logo.lua | Lua | local logo = [[
⠀⢠⣤⣤⣤⡄⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⣿⣿⣿⣿⢁⣿⣿⣷⡶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⣤⡀⠀⠀
⣀⣛⣛⣛⣛⣸⣿⣿⣿⢁⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢸⣿⣿⣦⡀
⠈⠻⣿⣿⣿⣿⣿⣿⣿⢸⣿⣿⣿⡿⠿⠿⠿⠿⠿⠿⢿⣿⣿⣿⡟⢸⣿⣿⣿⠇
⠀⠀⢸⢛⣛⣛⣛⣛⣃⣼⣿⣿⣿⠁⣿⣿⣿⣿⣿⣿⢠⣿⣿⣿⡇⣿⣿⣿⣿⠀
⠀⠀⡇⣾⣿⣿⣿⣿⣿⣿⣿⣿⣏⠸⠿⠿⠿⠿⠿⠏⣼⣿⣿⣿⢸⣿⣿⣿⡇⠀
⠀⢸⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⣾⣿⣿⣿⠀⠀
⠀⡼⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⢰⣶⣶⣶⣶⣶⣶⢸⣿⣿⣿⠃⣿⣿⣿⡿⠀⠀
⢸⣀⣉⣉⣉⣉⣉⣉⣉⣉⣉⣡⣿⣿⣿⡿⠀⢸⣅⣉⣉⣉⣁⣿⣿⣿⣿⣿⣦⡀
⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠙⣿⣿⣿⣿⣿... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/lru_cache.lua | Lua | local LRUCache = {}
LRUCache.__index = LRUCache
function LRUCache:new(capacity)
return setmetatable({
capacity = capacity,
cache = {},
head = nil,
tail = nil,
size = 0,
}, LRUCache)
end
-- Internal function: Move node to head (indicating most recently used)
function LRUCache:_move_to_head(node... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/lsp.lua | Lua | ---@class avante.utils.lsp
local M = {}
local LspMethod = vim.lsp.protocol.Methods
---@alias vim.lsp.Client.filter {id?: number, bufnr?: number, name?: string, method?: string, filter?:fun(client: vim.lsp.Client):boolean}
---@param opts? vim.lsp.Client.filter
---@return vim.lsp.Client[]
function M.get_clients(opts)
... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/path.lua | Lua | local OS_NAME = vim.uv.os_uname().sysname ---@type string|nil
local IS_WIN = OS_NAME == "Windows_NT" ---@type boolean
local SEP = IS_WIN and "\\" or "/" ---@type string
local BYTE_SLASH = 0x2f ---@type integer '/'
local BYTE_BACKSLASH = 0x5c ---@type integer '\\'
local BYTE_COLON = 0x3a ---@type integer ':'
local BYT... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/promptLogger.lua | Lua | local Config = require("avante.config")
local Utils = require("avante.utils")
local AVANTE_PROMPT_INPUT_HL = "AvantePromptInputHL"
-- last one in entries is always to hold current input
local entries, idx = {}, 0
local filtered_entries = {}
---@class avante.utils.promptLogger
local M = {}
function M.init()
vim.ap... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/prompts.lua | Lua | local Config = require("avante.config")
local M = {}
---@param provider_conf AvanteDefaultBaseProvider
---@param opts AvantePromptOptions
---@return string
function M.get_ReAct_system_prompt(provider_conf, opts)
local system_prompt = opts.system_prompt
local disable_tools = provider_conf.disable_tools or false
i... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/root.lua | Lua | -- COPIED and MODIFIED from https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/util/root.lua
local Utils = require("avante.utils")
local Config = require("avante.config")
---@class avante.utils.root
---@overload fun(): string
local M = setmetatable({}, {
__call = function(m) return m.get() end,
})
---@class A... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/streaming_json_parser.lua | Lua | -- StreamingJSONParser: 一个能够处理不完整 JSON 流的解析器
local StreamingJSONParser = {}
StreamingJSONParser.__index = StreamingJSONParser
-- Create a new StreamingJSONParser instance
function StreamingJSONParser:new()
local obj = setmetatable({}, StreamingJSONParser)
obj:reset()
return obj
end
-- Reset the parser state
fun... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/test.lua | Lua | -- This is a helper for unit tests.
local M = {}
function M.read_file(fn)
fn = vim.uv.cwd() .. "/" .. fn
local file = io.open(fn, "r")
if file then
local data = file:read("*all")
file:close()
return data
end
return fn
end
return M
| yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante/utils/tokens.lua | Lua | --Taken from https://github.com/jackMort/ChatGPT.nvim/blob/main/lua/chatgpt/flows/chat/tokens.lua
local Tokenizer = require("avante.tokenizers")
---@class avante.utils.tokens
local Tokens = {}
---@type table<[string], number>
local cost_per_token = {
davinci = 0.000002,
}
--- Calculate the number of tokens in a gi... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/avante_lib.lua | Lua | local M = {}
local function get_library_path()
local os_name = require("avante.utils").get_os_name()
local ext = os_name == "linux" and "so" or (os_name == "darwin" and "dylib" or "dll")
local dirname = string.sub(debug.getinfo(1).source, 2, #"/avante_lib.lua" * -1)
return dirname .. ("../build/?.%s"):format(e... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/cmp_avante/commands.lua | Lua | local api = vim.api
---@class CommandsSource : cmp.Source
local CommandsSource = {}
CommandsSource.__index = CommandsSource
function CommandsSource:new()
local instance = setmetatable({}, CommandsSource)
return instance
end
function CommandsSource:is_available() return vim.bo.filetype == "AvanteInput" end
func... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/cmp_avante/mentions.lua | Lua | local api = vim.api
---@class mentions_source : cmp.Source
---@field get_mentions fun(): AvanteMention[]
local MentionsSource = {}
MentionsSource.__index = MentionsSource
---@param get_mentions fun(): AvanteMention[]
function MentionsSource:new(get_mentions)
local instance = setmetatable({}, MentionsSource)
inst... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
lua/cmp_avante/shortcuts.lua | Lua | local api = vim.api
---@class ShortcutsSource : cmp.Source
local ShortcutsSource = {}
ShortcutsSource.__index = ShortcutsSource
function ShortcutsSource:new()
local instance = setmetatable({}, ShortcutsSource)
return instance
end
function ShortcutsSource:is_available() return vim.bo.filetype == "AvanteInput" end... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
plugin/avante.lua | Lua | if vim.fn.has("nvim-0.10") == 0 then
vim.api.nvim_echo({
{ "Avante requires at least nvim-0.10", "ErrorMsg" },
{ "Please upgrade your neovim version", "WarningMsg" },
{ "Press any key to exit", "ErrorMsg" },
}, true, {})
vim.fn.getchar()
vim.cmd([[quit]])
end
if vim.g.avante ~= nil then return end
... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/run.sh | Shell | #!/usr/bin/env bash
# Set the target directory (use the first argument or default to a local state directory)
TARGET_DIR=$1
if [ -z "$TARGET_DIR" ]; then
TARGET_DIR="$HOME/.local/state/avante-rag-service"
fi
# Create the target directory if it doesn't exist
mkdir -p "$TARGET_DIR"
# Copy the required files to the ta... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/libs/configs.py | Python | import os
from pathlib import Path
# Configuration
BASE_DATA_DIR = Path(os.environ.get("DATA_DIR", "data"))
CHROMA_PERSIST_DIR = BASE_DATA_DIR / "chroma_db"
LOG_DIR = BASE_DATA_DIR / "logs"
DB_FILE = BASE_DATA_DIR / "sqlite" / "indexing_history.db"
# Configure directories
BASE_DATA_DIR.mkdir(parents=True, exist_ok=Tr... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/libs/db.py | Python | import sqlite3
from collections.abc import Generator
from contextlib import contextmanager
from libs.configs import DB_FILE
# SQLite table schemas
CREATE_TABLES_SQL = """
CREATE TABLE IF NOT EXISTS indexing_history (
id INTEGER PRIMARY KEY AUTOINCREMENT,
uri TEXT NOT NULL,
content_hash TEXT NOT NULL,
... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/libs/logger.py | Python | import logging
from datetime import datetime
from libs.configs import LOG_DIR
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s",
handlers=[
logging.FileHandler(
LOG_DIR / f"rag_service_{datetime.now().astimezone().strftime('%Y%m%d')}.log",
... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/libs/utils.py | Python | from __future__ import annotations
import re
from pathlib import Path
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from llama_index.core.schema import BaseNode
PATTERN_URI_PART = re.compile(r"(?P<uri>.+)__part_\d+")
METADATA_KEY_URI = "uri"
def uri_to_path(uri: str) -> Path:
"""Convert URI to path.""... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/main.py | Python | """RAG Service API for managing document indexing and retrieval.""" # noqa: INP001
from __future__ import annotations
# Standard library imports
import asyncio
import fcntl
import json
import multiprocessing
import os
import re
import shutil
import subprocess
import threading
import time
from concurrent.futures impo... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/models/indexing_history.py | Python | """Indexing History Model."""
from datetime import datetime
from typing import Any
from pydantic import BaseModel, Field
class IndexingHistory(BaseModel):
"""Model for indexing history record."""
id: int | None = Field(None, description="Record ID")
uri: str = Field(..., description="URI of the indexed... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/models/resource.py | Python | """Resource Model."""
from datetime import datetime
from typing import Literal
from pydantic import BaseModel, Field
class Resource(BaseModel):
"""Model for resource record."""
id: int | None = Field(None, description="Resource ID")
name: str = Field(..., description="Name of the resource")
uri: st... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/providers/dashscope.py | Python | # src/providers/dashscope.py
from typing import Any
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.core.llms.llm import LLM
from llama_index.embeddings.dashscope import DashScopeEmbedding
from llama_index.llms.dashscope import DashScope
def initialize_embed_model(
embed_endpoin... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/providers/factory.py | Python | import importlib
from typing import TYPE_CHECKING, Any, cast
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.core.llms.llm import LLM
if TYPE_CHECKING:
from collections.abc import Callable
from libs.logger import logger # Assuming libs.logger exists and provides a logger instanc... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/providers/ollama.py | Python | # src/providers/ollama.py
from typing import Any
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.core.llms.llm import LLM
from llama_index.embeddings.ollama import OllamaEmbedding
from llama_index.llms.ollama import Ollama
def initialize_embed_model(
embed_endpoint: str,
emb... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/providers/openai.py | Python | # src/providers/openai.py
from typing import Any
from llama_index.core.base.embeddings.base import BaseEmbedding
from llama_index.core.llms.llm import LLM
from llama_index.embeddings.openai import OpenAIEmbedding
from llama_index.llms.openai import OpenAI
def initialize_embed_model(
embed_endpoint: str,
emb... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/providers/openrouter.py | Python | # src/providers/openrouter.py
from typing import Any
from llama_index.core.llms.llm import LLM
from llama_index.llms.openrouter import OpenRouter
def initialize_llm_model(
llm_endpoint: str,
llm_api_key: str,
llm_model: str,
**llm_extra: Any, # noqa: ANN401
) -> LLM:
"""
Create OpenRouter L... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/services/indexing_history.py | Python | import json
import os
from datetime import datetime
from typing import Any
from libs.db import get_db_connection
from libs.logger import logger
from libs.utils import get_node_uri
from llama_index.core.schema import Document
from models.indexing_history import IndexingHistory
class IndexingHistoryService:
def de... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
py/rag-service/src/services/resource.py | Python | """Resource Service."""
from libs.db import get_db_connection
from models.resource import Resource
class ResourceService:
"""Resource Service."""
def add_resource_to_db(self, resource: Resource) -> None:
"""Add a resource to the database."""
with get_db_connection() as conn:
conn... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
scripts/lua-typecheck.sh | Shell | #!/usr/bin/env bash
set -e
# This script performs a Lua typecheck, with different behaviors for local and CI environments.
#
# It supports two local modes:
# 1. Default (Managed): Downloads all dependencies into a project-local ./target/deps directory.
# 2. --live: Uses the system's installed `nvim` and `lua-language-... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
scripts/run-luatest.sh | Shell | #!/usr/bin/env bash
set -e
DEST_DIR="$PWD/target/tests"
DEPS_DIR="$DEST_DIR/deps"
log() {
echo "$1" >&2
}
check_tools() {
command -v rg &>/dev/null || {
log "Error: ripgrep (rg) is not installed. Please install it."
exit 1
}
command -v ag &>/dev/null || {
log "Error: silversea... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
scripts/setup-deps.sh | Shell | #!/bin/bash
DEPS=(
"folke/neodev.nvim"
"nvim-lua/plenary.nvim"
"MunifTanjim/nui.nvim"
"stevearc/dressing.nvim"
"folke/snacks.nvim"
"echasnovski/mini.nvim"
"nvim-telescope/telescope.nvim"
"hrsh7th/nvim-cmp"
"ibhagwan/fzf-lua"
"nvim-tree/nvim-web-devicons"
"zbirenbaum/copilot.lua"
"folke/lazy.nvi... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
syntax/jinja.vim | Vim Script | " reference: https://github.com/lepture/vim-jinja/blob/master/syntax/jinja.vim
if exists("b:current_syntax")
finish
endif
if !exists("main_syntax")
let main_syntax = 'html'
endif
runtime! syntax/html.vim
unlet b:current_syntax
syntax case match
" jinja template built-in tags and parameters
" 'comment' doesn't ... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/libs/acp_client_spec.lua | Lua | local ACPClient = require("avante.libs.acp_client")
local stub = require("luassert.stub")
describe("ACPClient", function()
local schedule_stub
local setup_transport_stub
before_each(function()
schedule_stub = stub(vim, "schedule")
schedule_stub.invokes(function(fn) fn() end)
setup_transport_stub = s... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/libs/jsonparser_spec.lua | Lua | local JsonParser = require("avante.libs.jsonparser")
describe("JsonParser", function()
describe("parse (one-time parsing)", function()
it("should parse simple objects", function()
local result, err = JsonParser.parse('{"name": "test", "value": 42}')
assert.is_nil(err)
assert.equals("test", resu... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/llm_spec.lua | Lua | local utils = require("avante.utils")
local PPath = require("plenary.path")
local llm = require("avante.llm")
describe("generate_prompts", function()
local project_root = "/tmp/project_root"
before_each(function()
local mock_dir = PPath:new("tests", project_root)
mock_dir:mkdir({ parents = true })
l... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/llm_tools/helpers_spec.lua | Lua | local LlmToolHelpers = require("avante.llm_tools.helpers")
local Utils = require("avante.utils")
local stub = require("luassert.stub")
describe("has_permission_to_access", function()
local test_dir = "/tmp/test_llm_tools_helpers"
before_each(function()
os.execute("mkdir -p " .. test_dir)
-- create .gitign... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/llm_tools_spec.lua | Lua | local stub = require("luassert.stub")
local LlmTools = require("avante.llm_tools")
local LlmToolHelpers = require("avante.llm_tools.helpers")
local Config = require("avante.config")
local Utils = require("avante.utils")
local ls = require("avante.llm_tools.ls")
local grep = require("avante.llm_tools.grep")
local glob =... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/providers/bedrock_spec.lua | Lua | local bedrock_provider = require("avante.providers.bedrock")
local test_util = require("avante.utils.test")
local Config = require("avante.config")
Config.setup({})
describe("bedrock_provider", function()
describe("parse_stream_data", function()
it("should parse response in a stream.", function()
local da... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/providers/claude_spec.lua | Lua | ---@diagnostic disable: duplicate-set-field, need-check-nil
local busted = require("plenary.busted")
local async = require("plenary.async.tests")
local async_util = require("plenary.async")
local test_util = require("avante.utils.test")
local pkce = require("avante.auth.pkce")
-- Mock data helpers
local function creat... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/providers/watsonx_code_assistant_spec.lua | Lua | local busted = require("plenary.busted")
busted.describe("watsonx_code_assistant provider", function()
local watsonx_provider
busted.before_each(function()
-- Minimal setup without extensive mocking
watsonx_provider = require("avante.providers.watsonx_code_assistant")
end)
busted.describe("basic conf... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/rag_service_spec.lua | Lua | local mock = require("luassert.mock")
local match = require("luassert.match")
describe("RagService", function()
local RagService
local Config_mock
before_each(function()
-- Load the module before each test
RagService = require("avante.rag_service")
-- Setup common mocks
Config_mock = mock(requi... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/ui/acp_confirm_adapter_spec.lua | Lua | local ACPConfirmAdapter = require("avante.ui.acp_confirm_adapter")
describe("ACPConfirmAdapter", function()
describe("map_acp_options", function()
it("should ignore reject_always", function()
local options = { { kind = "reject_always", optionId = "opt4" } }
local result = ACPConfirmAdapter.map_acp_op... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/utils/file_spec.lua | Lua | local File = require("avante.utils.file")
local mock = require("luassert.mock")
local stub = require("luassert.stub")
describe("File", function()
local test_file = "test.txt"
local test_content = "test content\nline 2"
-- Mock vim API
local api_mock
local uv_mock
before_each(function()
-- Setup mocks... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/utils/fix_diff_spec.lua | Lua | local Utils = require("avante.utils")
describe("Utils.fix_diff", function()
it("should not break normal diff", function()
local diff = [[------- SEARCH
<Modal isOpen={showLogs} onClose={() => setShowLogs(false)} title="Project PRD Logs" size="xl">
<div className="p-6">
... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/utils/get_parent_path_spec.lua | Lua | local utils = require("avante.utils")
describe("get_parent_path", function()
-- Define path separator for our tests, using the same logic as in the utils module
local path_sep = jit.os:find("Windows") ~= nil and "\\" or "/"
it("should return the parent directory of a file path", function()
local filepath = ... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/utils/init_spec.lua | Lua | local Utils = require("avante.utils")
describe("Utils", function()
describe("trim", function()
it("should trim prefix", function() assert.equals("test", Utils.trim("prefix_test", { prefix = "prefix_" })) end)
it("should trim suffix", function() assert.equals("test", Utils.trim("test_suffix", { suffix = "_su... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/utils/join_paths_spec.lua | Lua | local assert = require("luassert")
local utils = require("avante.utils")
describe("join_paths", function()
it("should join multiple path segments with proper separator", function()
local result = utils.join_paths("path", "to", "file.lua")
assert.equals("path" .. utils.path_sep .. "to" .. utils.path_sep .. "f... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/utils/make_relative_path_spec.lua | Lua | local assert = require("luassert")
local utils = require("avante.utils")
describe("make_relative_path", function()
it("should remove base directory from filepath", function()
local test_filepath = "/path/to/project/src/file.lua"
local test_base_dir = "/path/to/project"
local result = utils.make_relative_... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
tests/utils/streaming_json_parser_spec.lua | Lua | local StreamingJSONParser = require("avante.utils.streaming_json_parser")
describe("StreamingJSONParser", function()
local parser
before_each(function() parser = StreamingJSONParser:new() end)
describe("initialization", function()
it("should create a new parser with empty state", function()
assert.is... | yetone/avante.nvim | 17,366 | Use your Neovim like using Cursor AI IDE! | Lua | yetone | yetone | Isoform |
docs/css/custom.css | CSS | .termynal-comment {
color: #4a968f;
font-style: italic;
display: block;
}
.termy {
/* For right to left languages */
direction: ltr;
}
.termy [data-termynal] {
white-space: pre-wrap;
}
/* Right to left languages */
code {
direction: ltr;
display: inline-bl... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
docs/css/termynal.css | CSS | /**
* termynal.js
*
* @author Ines Montani <ines@ines.io>
* @version 0.0.1
* @license MIT
*/
:root {
--color-bg: #252a33;
--color-text: #eee;
--color-text-subtle: #a2a2a2;
}
[data-termynal] {
width: 750px;
max-width: 100%;
background: var(--color-bg);
color: var(--color-tex... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
docs/js/custom.js | JavaScript | function setupTermynal() {
document.querySelectorAll(".use-termynal").forEach(node => {
node.style.display = "block";
new Termynal(node, {
lineDelay: 500
});
});
const progressLiteralStart = "---> 100%";
const promptLiteralStart = "$ ";
const customPrompt... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
docs/js/termynal.js | JavaScript | /**
* termynal.js
* A lightweight, modern and extensible animated terminal window, using
* async/await.
*
* @author Ines Montani <ines@ines.io>
* @version 0.0.1
* @license MIT
*/
'use strict';
/** Generate a terminal widget. */
class Termynal {
/**
* Construct the widget's settings.
* @param {(s... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/config/environment.rs | Rust | use crate::{
models::{Grouping, Method, OpenapiPath},
utils::Error,
};
use float_eq::float_eq;
use lazy_static::lazy_static;
use std::{
collections::{HashMap, HashSet},
env,
path::Path,
str::FromStr,
sync::{Arc, RwLock},
};
use url::Url;
use super::{CoveAPIConfig, OpenapiSource, Runtime};
... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/config/mod.rs | Rust | use std::{collections::HashSet, path::Path, sync::Arc};
use url::Url;
mod environment;
mod nginx;
pub use nginx::configure_nginx;
use crate::models::Grouping;
#[derive(Debug)]
pub struct CoveAPIConfig {
pub debug: bool,
pub security_accounts_for_forbidden: bool,
pub security_accounts_for_unautorized: b... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/config/nginx.rs | Rust | use std::{
fs::{File, OpenOptions},
io::{Read, Write},
path::Path,
sync::Arc,
};
use super::{CoveAPIConfig, Runtime};
use crate::utils::Error;
pub fn configure_nginx(config: &CoveAPIConfig) -> Result<(), Error> {
configure_nginx_file(config, Path::new("/etc/nginx/nginx.conf"))
}
fn replace_url(ba... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/evaluator/compare.rs | Rust | use std::{
cell::RefCell,
collections::{HashMap, HashSet},
};
use crate::models::{EndpointConfiguration, Grouping};
pub fn evaluate<'a>(
openapi_endpoints: &'a Vec<EndpointConfiguration>,
pre_merge_endpoints: &Option<Vec<EndpointConfiguration>>,
nginx_endpoints: &Vec<EndpointConfiguration>,
gr... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/evaluator/mod.rs | Rust | mod compare;
pub use compare::evaluate;
pub use compare::Evaluation;
| yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/lib.rs | Rust | use std::process::{Command, Stdio};
use config::{configure_nginx, CoveAPIConfig};
use evaluator::evaluate;
use models::EndpointConfiguration;
use parser::{get_openapi_endpoint_configs, get_pre_merge_openapi_endpoints};
use utils::print_debug_message;
use crate::{parser::parse_nginx_access_log, utils::print_error_and_... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/main.rs | Rust | use coveapi::{initialize_coveapi, run_eval, run_nginx};
fn main() {
let (config, openapi_endpoints, pre_merge_endpoints) = initialize_coveapi();
if config.debug {
config.print();
}
run_nginx(&config);
run_eval(&config, openapi_endpoints, pre_merge_endpoints);
}
| yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/models/endpoint.rs | Rust | use std::{fmt::Display, str::FromStr, sync::Arc};
use crate::{config::Runtime, utils::Error};
use super::misc::Method;
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct EndpointConfiguration {
pub method: Method,
pub path: OpenapiPath,
pub status_code: u16,
pub runtime: Arc<Runtime>,
pub is... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/models/grouping.rs | Rust | use super::{EndpointConfiguration, Method, OpenapiPath};
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct Grouping {
methods: Vec<Method>,
status: Vec<u16>,
path: OpenapiPath,
pub is_ignore_group: bool,
}
impl Grouping {
pub fn incompases_endpoint_config(&self, endpoint: &EndpointConfiguration) ->... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/models/misc.rs | Rust | use std::fmt::Display;
const METHOD_GET_STR: &str = "GET";
const METHOD_PUT_STR: &str = "PUT";
const METHOD_POST_STR: &str = "POST";
const METHOD_DELETE_STR: &str = "DELETE";
const METHOD_OPTIONS_STR: &str = "OPTIONS";
const METHOD_HEAD_STR: &str = "HEAD";
const METHOD_PATCH_STR: &str = "PATCH";
const METHOD_TRACE_STR... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/models/mod.rs | Rust | mod endpoint;
mod grouping;
mod misc;
pub use endpoint::EndpointConfiguration;
pub use endpoint::OpenapiPath;
pub use grouping::Grouping;
pub use misc::Method;
| yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/parser/common.rs | Rust | pub fn format_basepath(basepath: &str) -> &str {
if basepath.ends_with('/') {
&basepath[0..basepath.len() - 1]
} else {
basepath
}
}
#[cfg(test)]
mod tests {
use super::format_basepath;
#[test]
fn coverts_slash_to_empty_string() {
assert_eq!(format_basepath("/"), "");
... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/parser/http.rs | Rust | use std::sync::Arc;
use crate::{
config::{OpenapiSource, Runtime},
models::EndpointConfiguration,
utils::{print_debug_message, Error},
};
use super::{json_parser::parse_json_doc, yaml_parser::parse_yaml_doc};
pub fn fetch_openapi_endpoints_for_runtime(runtime: Arc<Runtime>) -> Result<Vec<EndpointConfigur... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/parser/json_parser.rs | Rust | use std::sync::Arc;
use json::JsonValue;
use crate::{
config::Runtime,
models::{EndpointConfiguration, Method},
utils::Error,
};
use super::common::format_basepath;
pub fn parse_json_doc(json_string: &str, runtime: Arc<Runtime>) -> Result<Vec<EndpointConfiguration>, Error> {
let mut endpoints = vec!... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/parser/mod.rs | Rust | mod common;
mod http;
mod json_parser;
mod nginx_parser;
mod yaml_parser;
use std::{path::Path, sync::Arc};
pub use nginx_parser::parse_nginx_access_log;
use crate::{
config::{CoveAPIConfig, OpenapiSource, Runtime},
models::EndpointConfiguration,
utils::{read_file_to_string_or_err, Error},
};
use self::... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/parser/nginx_parser.rs | Rust | use std::{
fs::File,
io::{BufRead, BufReader},
path::Path,
sync::Arc,
};
use crate::{
config::Runtime,
models::{EndpointConfiguration, Method},
utils::{print_debug_message, Error},
};
use lazy_static::lazy_static;
use regex::Regex;
pub fn parse_nginx_access_log(runtimes: &Vec<Arc<Runtime>>... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/parser/yaml_parser.rs | Rust | use std::sync::Arc;
use linked_hash_map::LinkedHashMap;
use yaml_rust::{Yaml, YamlLoader};
use crate::{
config::Runtime,
models::{EndpointConfiguration, Method},
parser::common::format_basepath,
utils::Error,
};
pub fn parse_yaml_doc(yaml_string: &str, runtime: Arc<Runtime>) -> Result<Vec<EndpointCon... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/utils/debug.rs | Rust | use std::{fmt::Display, process};
use crate::config::CoveAPIConfig;
pub fn print_debug_message<T: Display>(debug_message: T) {
if CoveAPIConfig::global_is_debug() {
println!("{}", debug_message);
}
}
pub fn print_error_and_exit<T: Display>(debug_message: T) -> ! {
eprintln!("{}", debug_message);
... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/utils/error.rs | Rust | use std::path::Path;
use super::print_error_and_exit;
#[derive(Debug)]
pub enum Error {
InvalidApplicationURL(String),
MissingConfiguration,
ConflictingConfiguration,
UnexpectedIOIssue(String),
InvalidParseSyntax,
InvalidBasePath,
InvalidStatusCode(String),
InvalidMethodString(String),... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/utils/io.rs | Rust | use std::{fs::File, io::Read, path::Path};
use crate::models::EndpointConfiguration;
use super::print_debug_message;
pub fn read_file_to_string_or_err<E>(path: &Path, err: E) -> Result<String, E> {
let mut file = match File::open(path) {
Ok(file) => file,
Err(why) => {
print_debug_mes... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/utils/mod.rs | Rust | mod debug;
mod error;
mod io;
mod runtime;
#[cfg(test)]
pub mod test;
pub use debug::print_debug_message;
pub use debug::print_error_and_exit;
pub use error::Error;
pub use io::print_endpoints;
pub use io::read_file_to_string_or_err;
pub use runtime::sort_by_runtime;
| yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/utils/runtime.rs | Rust | use std::{collections::HashMap, sync::Arc};
use crate::{config::Runtime, models::EndpointConfiguration};
pub fn sort_by_runtime(
endpoint_configs: &Vec<EndpointConfiguration>,
) -> HashMap<Arc<Runtime>, Vec<&EndpointConfiguration>> {
let mut runtime_sorted_endpoint_configs = HashMap::new();
for endpoit_co... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
src/utils/test.rs | Rust | use std::{collections::HashMap, str::FromStr};
use reqwest::Url;
use crate::config::{CoveAPIConfig, OpenapiSource, Runtime};
pub fn create_mock_config() -> CoveAPIConfig {
let mut env_vars = HashMap::new();
env_vars.insert("COVEAPI_DEBUG".to_string(), "1".to_string());
env_vars.insert("COVEAPI_APP_BASE_... | yezz123/CoveAPI | 25 | OpenAPI-based test coverage analysis tool that helps teams improve integration test coverage in CI/CD pipelines | Rust | yezz123 | Yasser Tahiri | Yezz LLC. |
asgi_aws/__init__.py | Python | """Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨"""
__version__ = "2.0.0"
import asyncio
from typing import Any, Callable, Type, Union
from asgi_aws.service import find_service
from asgi_aws.services import Service
from asgi_aws.services.aws import AWS
from asgi_aws.... | yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
asgi_aws/service.py | Python | import os
from typing import Union
from asgi_aws.services import Service
def find_service() -> Union[Service, None]:
# ref: https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html
return Service.aws_lambda if "AWS_LAMBDA_FUNCTION_NAME" in os.environ else None
| yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
asgi_aws/services/__init__.py | Python | from enum import Enum
class Service(str, Enum):
aws_lambda = "AWS Lambda"
| yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
asgi_aws/services/aws.py | Python | from base64 import b64decode, b64encode
from typing import Any, Dict, Iterator
from urllib.parse import urlencode
from asgi_aws.services.http import HttpCycleBase
from asgi_aws.types import Message, Scope
Request = Dict[str, Dict[str, Any]]
Response = Dict[str, Any]
class AWS(HttpCycleBase[Request, Response]):
... | yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
asgi_aws/services/http.py | Python | import asyncio
from typing import Any, Generic, Iterable, MutableMapping, Tuple, TypeVar
from asgi_aws.types import ASGIApp, Message, Scope
Req = TypeVar("Req")
Res = TypeVar("Res")
class Lifespan:
def __init__(self, startup_event: asyncio.Event, shutdown_event: asyncio.Event):
self.state: MutableMappin... | yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
asgi_aws/types.py | Python | from typing import Any, Awaitable, Callable, MutableMapping
from typing_extensions import Protocol
Message = MutableMapping[str, Any]
Scope = MutableMapping[str, Any]
Receive = Callable[[], Awaitable[Message]]
Send = Callable[[Message], Awaitable[None]]
Request = Any
Response = Any
class ASGIApp(Protocol):
"""A... | yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
scripts/clean.sh | Shell | #!/bin/sh -e
rm -f `find . -type f -name '*.py[co]' `
rm -f `find . -type f -name '*~' `
rm -f `find . -type f -name '.*~' `
rm -f `find . -type f -name .coverage`
rm -f `find . -type f -name ".coverage.*"`
rm -rf `find . -name __pycache__`
rm -rf `find . -type d -name '*.egg-info' `
rm -rf `find . -type d -name 'pip-... | yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
scripts/format.sh | Shell | #!/usr/bin/env bash
set -e
set -x
pre-commit run --all-files --verbose --show-diff-on-failure
| yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
scripts/lint.sh | Shell | #!/usr/bin/env bash
set -e
set -x
mypy --show-error-codes asgi_aws
| yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
scripts/test.sh | Shell | #!/usr/bin/env bash
set -e
set -x
echo "ENV=${ENV}"
export PYTHONPATH=.
pytest --cov=asgi_aws --cov=tests
| yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
tests/template/app.py | Python | import contextlib
from typing import Optional
from fastapi import (
Cookie,
FastAPI,
File,
Form,
Header,
HTTPException,
Request,
UploadFile,
)
from fastapi.responses import PlainTextResponse, Response
from pydantic import BaseModel
class Item(BaseModel):
name: str
@contextlib.as... | yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
tests/test_app.py | Python | import base64
import pytest
@pytest.fixture()
def app():
from asgi_aws import Asgi
from tests.template.app import app
return Asgi.entry_point(app)
@pytest.fixture()
def failed_app():
from asgi_aws import Asgi
from tests.template.app import failed_app
return Asgi.entry_point(failed_app)
... | yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
tests/test_http.py | Python | import base64
import pytest
@pytest.fixture()
def app():
from asgi_aws import Asgi
from tests.template.app import app
return Asgi.entry_point(app)
@pytest.fixture()
def failed_app():
from asgi_aws import Asgi
from tests.template.app import failed_app
return Asgi.entry_point(failed_app)
... | yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
tests/test_version.py | Python | import asgi_aws
def test_version() -> None:
assert asgi_aws.__version__ == "2.0.0"
| yezz123/asgi-aws | 29 | Build API with ASGI in AWS Lambda with API Gateway HTTP API or REST API, or with Function URL ✨ | Python | yezz123 | Yasser Tahiri | Yezz LLC. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.