{"id":24590610,"url":"https://github.com/mithosk/funckly","last_synced_at":"2025-04-30T07:43:58.804Z","repository":{"id":57906545,"uuid":"492856143","full_name":"mithosk/funckly","owner":"mithosk","description":"Simple Web API Framework","archived":false,"fork":false,"pushed_at":"2024-05-30T22:37:02.000Z","size":438,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"release","last_synced_at":"2024-08-08T19:15:06.396Z","etag":null,"topics":["api","framework","functional","graphql","http","rest","restful"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mithosk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-16T13:50:57.000Z","updated_at":"2024-05-30T22:30:21.000Z","dependencies_parsed_at":"2024-05-13T17:39:13.509Z","dependency_job_id":"2fcd2e31-047c-4df6-8889-cd92277c25c2","html_url":"https://github.com/mithosk/funckly","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"a50503587315165973d594c7d2850cacd0f79be9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithosk%2Ffunckly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithosk%2Ffunckly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithosk%2Ffunckly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mithosk%2Ffunckly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mithosk","download_url":"https://codeload.github.com/mithosk/funckly/tar.gz/refs/heads/release","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235412220,"owners_count":18986078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","framework","functional","graphql","http","rest","restful"],"created_at":"2025-01-24T09:14:03.880Z","updated_at":"2025-01-24T09:14:04.474Z","avatar_url":"https://github.com/mithosk.png","language":"TypeScript","readme":"### ... how to create a funckly APPLICATION ...\n```ts\nconst server = new VanillaServer(5001)\nconst application = new Application(server)\n```\n\n\n\n### ... how to create a funckly CONTROLLER ...\n```ts\ninterface MyModel {\n    cat: string\n    dog?: number | null\n    tiger: string\n}\n\ninterface MyFilter {\n    lion?: boolean\n    crocodile?: number\n}\n\nclass MyController implements IController\u003cMyModel, MyFilter\u003e {\n\n    public async create(input: ICreateInput\u003cMyModel\u003e): Promise\u003cMyModel\u003e { \n        // my code\n    }\n\n    public async read(input: IReadInput): Promise\u003cMyModel\u003e { \n        // my code\n    }\n\n    public async update(input: IUpdateInput\u003cMyModel\u003e): Promise\u003cMyModel\u003e { \n        // my code\n    }\n\n    public async delete(input: IDeleteInput): Promise\u003cvoid\u003e { \n        // my code\n    }\n\n    public async list(input: IListInput\u003cMyFilter\u003e): Promise\u003cIPage\u003cMyModel\u003e\u003e { \n        // my code    \n    }\n    \n}\n```\n\n\n\n### ... how to create a funckly REST UNIT ...\n```ts\napplication.createRestUnit\u003cMyModel, MyFilter\u003e('horses')\n    .setController(() =\u003e new MyController())\n    .setPrevalidation(PrevalidationFormat.Ncode)\n    .setValidation(model =\u003e\n        new Validator(model)\n            .notEmpty(model =\u003e model.cat, 'empty cat')\n            .isString(model =\u003e model.cat, 'cat is not string')\n            .isFloat(model =\u003e model.dog, 'dog is not float')\n            .notEmpty(model =\u003e model.tiger, 'empty tiger')\n            .isUuid(model =\u003e model.tiger, 'tiger is not UUID')\n    )\n    .setNormalization(normalizer =\u003e\n        normalizer\n            .asBoolean('lion')\n            .asInt('crocodile')\n    )\n```\n\n\n\n### ... how to create a funckly RPC UNIT ...\n```ts\ninterface MyData {\n    cat: string\n    dog?: number | null\n    tiger: string\n}\n\ninterface MyResult {\n    lion?: boolean\n    crocodile?: number\n}\n\nclass MyResolver implements IResolver\u003cMyData, MyResult\u003e {\n\n    public async execute(input: IExecuteInput\u003cMyData\u003e): Promise\u003cMyResult\u003e {\n        // my code\n    }\n    \n}\n\napplication.createRpcUnit\u003cMyData, MyResult\u003e('snake')\n    .setResolver(() =\u003e new MyResolver())\n    .setValidation(data =\u003e\n        new Validator(data)\n            .notEmpty(data =\u003e data.cat, 'empty cat')\n            .isString(data =\u003e data.cat, 'cat is not string')\n            .isFloat(data =\u003e data.dog, 'dog is not float')\n            .notEmpty(data =\u003e data.tiger, 'empty tiger')\n            .isUuid(data =\u003e data.tiger, 'tiger is not UUID')\n    )\n```\n\n\n\n### ... available http calls ...\n```\nHTTP POST   /horses           (create)\nHTTP GET    /horses/12345     (read)\nHTTP PUT    /horses/12345     (update)\nHTTP PATCH  /horses/12345     (read \u0026 update)\nHTTP DELETE /horses/12345     (delete)\nHTTP GET    /horses?lion=true (list)\n\nHTTP POST   /snake            (execute)\n```\n\n\n\n### ... how to create a funckly GRAPHQL UNIT ...\n```ts\nconst myRunner: IRunQuery = async (\n    query: string, \n    schema: string, \n    runnable: object\n): Promise\u003cIGraphResult\u003e =\u003e {\n    // my code\n}\n\napplication.createGraphUnit('frog')\n    .setRunner(myRunner)\n    .setSchema(`\n        type Query {\n            hello: String\n        }\n    `)\n    .setRunnable(() =\u003e {\n        return {\n            hello() {\n                return 'Hello World'\n            }\n        }\n    })\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmithosk%2Ffunckly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmithosk%2Ffunckly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmithosk%2Ffunckly/lists"}