{"id":15357555,"url":"https://github.com/momocow/cloudflare-worker-leetcode-progress","last_synced_at":"2025-04-15T06:53:06.178Z","repository":{"id":39664573,"uuid":"393334347","full_name":"momocow/cloudflare-worker-leetcode-progress","owner":"momocow","description":"A library for serving LeetCode progress as a SVG on Cloudflare Workers.","archived":false,"fork":false,"pushed_at":"2022-05-28T10:32:57.000Z","size":629,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T06:53:01.618Z","etag":null,"topics":["cloudflare-workers","leetcode"],"latest_commit_sha":null,"homepage":"https://x.cow.moe/leetcode-progress/?username=momocow","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/momocow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-06T09:59:02.000Z","updated_at":"2022-09-19T09:01:17.000Z","dependencies_parsed_at":"2022-09-07T17:22:42.256Z","dependency_job_id":null,"html_url":"https://github.com/momocow/cloudflare-worker-leetcode-progress","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momocow%2Fcloudflare-worker-leetcode-progress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momocow%2Fcloudflare-worker-leetcode-progress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momocow%2Fcloudflare-worker-leetcode-progress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momocow%2Fcloudflare-worker-leetcode-progress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/momocow","download_url":"https://codeload.github.com/momocow/cloudflare-worker-leetcode-progress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023710,"owners_count":21199958,"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":["cloudflare-workers","leetcode"],"created_at":"2024-10-01T12:36:25.315Z","updated_at":"2025-04-15T06:53:06.160Z","avatar_url":"https://github.com/momocow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare Worker LeetCode Progress\n\n\u003e Generate LeetCode progress as a SVG deployed on Cloudflare Workers.\n\n## Demo\n\n[![MomoCow's LeetCode Progress](https://x.cow.moe/leetcode-progress/?username=momocow)](https://leetcode.com/momocow/)\n\n## Installation\n```\nnpm i @momocow/cloudflare-worker-leetcode-progress\n```\n\n## Usage\n\n```js\n\nconst createHandler = require('@momocow/cloudflare-worker-leetcode-progress').default\nconst handleRequest = createHandler({ /* options */ });\n\naddEventListener('fetch', (event) =\u003e {\n  event.respondWith(handleRequest(event) ?? new Response('', { status: 405 }));\n});\n```\n\n\u003e Remember to configure your `wrangler.toml` to build with webpack.\n\u003e\n\u003e ```toml\n\u003e type = \"webpack\"\n\u003e ``` \n\n## Options\n- `cacheName`: string = undefined\n  \u003e If it is `undefined`, no caches will be used. If it's `\"default\"`, the default cache will be used; otherwise a new cache is opened using the provided name. See [`await caches.open(name)`](https://developers.cloudflare.com/workers/runtime-apis/cache#accessing-cache).\n- `cacheTTL`: number = 300000 (in ms)\n  \u003e The value is used to generate the max age of `Cache-Control` and compute the `Expires` time.\n- `cors`: boolean = false\n  \u003e Allow CORS or not. If set, CORS headers will be generated and OPTIONS method will be handled.\n- `hashAlgorithm`: \"sha1\" | \"sha256\" | \"sha384\" | \"sha512\" = \"sha1\"\n  \u003e Hash algorithm to use to generate ETag.\n- `leetcodeGraphqlUrl`: string = \"https://leetcode.com/graphql\"\n  \u003e LeetCode GraphQL endpoint.\n- `progressType`: \"global\" | \"session\" = \"global\"\n  \u003e Type of LeetCode progress to display. If it's \"session\", the statistics of the current active session is fetched.\n  \u003e \n  \u003e This option is set for the default progress type; however, at each request, ones can provided `progress-type` parameter in the query string to change the value.\n- `userlist`: Set\u0026lt;string\u0026gt; = undefined\n  \u003e Access control for your Worker. If provided, only usernames appear in the set is allowed to generate the progress; otherwise, 403 forbidden is responsed.\n  \u003e  \n  \u003e Note that leave it undefined means access control disabled, every is allowed to access the Worker.\n- `fetch`: typeof [fetch](https://developers.cloudflare.com/workers/runtime-apis/fetch) = fetch\n  \u003e This option is passed to `graphql-request` to avoid using XMLHttpRequest (No such API in Worker Runtime).\n\n## Query String Parameters\n- `username`: string\n- `progress-type`: \"global\" | \"session\"\n- `theme`: \"default\" | \"dark\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomocow%2Fcloudflare-worker-leetcode-progress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomocow%2Fcloudflare-worker-leetcode-progress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomocow%2Fcloudflare-worker-leetcode-progress/lists"}