{"id":15978253,"url":"https://github.com/jamashita/catacombe","last_synced_at":"2026-01-19T18:01:07.942Z","repository":{"id":38172760,"uuid":"356553484","full_name":"jamashita/catacombe","owner":"jamashita","description":"Data accessors fror Fetch, File, Heap, MySQL, Redis, Request","archived":false,"fork":false,"pushed_at":"2024-11-19T00:31:55.000Z","size":2887,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-18T00:37:05.801Z","etag":null,"topics":["data-access","fetch","file","heap","mysql","redis","request","typescript"],"latest_commit_sha":null,"homepage":"","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/jamashita.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2021-04-10T10:56:41.000Z","updated_at":"2024-07-19T20:00:52.000Z","dependencies_parsed_at":"2023-02-09T18:46:06.295Z","dependency_job_id":"cd574b77-b28c-4b96-9eb7-9fd0b38bd8e9","html_url":"https://github.com/jamashita/catacombe","commit_stats":{"total_commits":425,"total_committers":4,"mean_commits":106.25,"dds":0.5647058823529412,"last_synced_commit":"154be081c1967469b06a8aec2cc94e034ab515ad"},"previous_names":[],"tags_count":182,"template":false,"template_full_name":null,"purl":"pkg:github/jamashita/catacombe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamashita%2Fcatacombe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamashita%2Fcatacombe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamashita%2Fcatacombe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamashita%2Fcatacombe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamashita","download_url":"https://codeload.github.com/jamashita/catacombe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamashita%2Fcatacombe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28578952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T17:42:58.221Z","status":"ssl_error","status_checked_at":"2026-01-19T17:40:54.158Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["data-access","fetch","file","heap","mysql","redis","request","typescript"],"created_at":"2024-10-07T23:07:27.749Z","updated_at":"2026-01-19T18:01:07.918Z","avatar_url":"https://github.com/jamashita.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Catacombe\n\nA repository packages that provides from various datasource.\n\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\n[![CI](https://github.com/jamashita/catacombe/actions/workflows/ci.yml/badge.svg)](https://github.com/jamashita/catacombe/actions/workflows/ci.yml)\n\n## Install\n\n```text\nyarn add @jamashita/catacombe\n```\n\n## Todo\n\n- [ ] IndexedDB\n- [ ] LocalStorage\n- [ ] SessionStorage\n\n## Prerequisite\n\n```\n\u003e node -v\nv20.12.2\n\n\u003e npm -v\n10.5.0\n\n\u003e yarn -v\n1.22.21\n```\n\n## Conventional commit\n\n```\ngit cz\n```\n\n# DataSource\n\n## DatasourceError\n\nAn error class for data source that extends `RuntimeError` from `@jamashita/anden`.\n\n# Fetch classes\n\n## Fetch\\\u003cT extends FetchResponseType\\\u003e\n\nThis class provides a simple interface for making API requests to the server. `FetchResponseType` represents the type of\ndata that you can retrieve from the server. It can be one of the following values: `'arrayBuffer'`, `'blob'`, `'json'`,\nor `'text'`.\n\n### `new Fetch\u003cT extends FetchResponseType\u003e(type: T)`\n\nThis is a constructor for a class that always returns a response of the given `type`.\n\n### `Fetch.prototype.delete(url: string): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a DELETE request to the server at the specified `url`. Returns a promise that resolves to the server's response\nwith the specified data `type`.\n\n### `Fetch.prototype.get(url: string): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a GET request to the server at the specified `url`. Returns a promise that resolves to the server's response with\nthe specified data `type`.\n\n### `Fetch.prototype.head(url: string): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a HEAD request to the server at the specified `url`. Returns a promise that resolves to the server's response with\nthe specified data `type`.\n\n### `Fetch.prototype.post(url: string, payload?: ObjectLiteral): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a POST request to the server at the specified `url` with an optional body `payload`. Returns a promise that\nresolves to the server's response with the specified data `type`.\n\n### `Fetch.prototype.put(url: string, payload: ObjectLiteral): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a PUT request to the server at the specified `url` with an optional body `payload`. Returns a promise that\nresolves to the server's response with the specified data `type`.\n\n## FetchError\n\n`FetchError` is an error type for `Fetch`. It extends the `DataSourceError` class.\n\n# File classes\n\n## File\n\nThis class provides a simple interface for interacting with files on the file system.\n\n### `File.exists(path: string): Promise\u003cboolean\u003e`\n\nChecks whether a file with the given `path` exists. Returns a promise that resolves to `true` if the file exists,\nor `false` if it does not exist.\n\n### `File.read(path: string): Promise\u003cBuffer\u003e`\n\nReads the contents of a file with the given `path`. Returns a promise that resolves to a `Buffer` object containing the\nfile's data.\n\n### `File.write(path: string, data: Buffer | string): Promise\u003cvoid\u003e`\n\nWrites the given data to the file with the given `path`. `data` can be either a `Buffer` object or a string. Returns a\npromise that resolves when the write operation is complete.\n\n## FileError\n\n`FileError` is an error type for `File`. It extends the `DataSourceError` class.\n\n# Heap classes\n\n## Heap\n\nThis class provides a simple interface for storing data in memory.\n\n### `new Heap(seconds: number = Infinity)`\n\nThis is a constructor for a class that retains data for a specified number of `seconds`. If you set the seconds to\n`Infinity`, the data will be retained forever.\n\n### `Heap.prototype.get\u003cH\u003e(identifier: symbol): H`\n\nRetrieves the value associated with the given `identifier`. The type of the returned value is specified by the generic\ntype `H`.\n\n### `Heap.prototype.set(identifier: symbol, value: unknown): void`\n\nStores the given `value` with the given `identifier`. The stored value can be retrieved using the get method with the\nsame `identifier`.\n\n## HeapError\n\n`HeapError` is an error type for `Heap`. It extends the `DataSourceError` class.\n\nThis class provides a simple interface for storing data into MySQL.\n\n# MySQL classes\n\n## Connection\n\n### `Connection.prototype.commit(): Promise\u003cvoid\u003e`\n\nCommits the pending transactions.\n\n### `Connection.prototype.execute\u003cR\u003e(sql: string, value?: ObjectLiteral): Promise\u003cR\u003e`\n\nExecutes the SQL statement. The result `R` will be returned. The `value` is assigned to the prepared statement before\nexecution.\n\n### `Connection.prototype.release(): void`\n\nTerminates the current connection to the resource.\n\n### `Connection.prototype.rollback(): Promise\u003cvoid\u003e`\n\nRollbacks the current transactions.\n\n## (interface) ISQL\n\n### `SQL.prototype.execute\u003cR\u003e(sql: string, value?: ObjectLiteral): Promise\u003cR\u003e`\n\nExecutes the `sql` statement. The result `R` will be returned. The `value` is assigned to the prepared statement before\nexecution.\n\n## (interface) ITransaction\\\u003cR\\\u003e\n\n### `Transaction.prototype.with(sql: ISQL): Promise\u003cR\u003e`\n\nThis method handles a single transaction, with `R` indicating the returned value. The `ISQL` instance is used to execute\nSQL statements within the transaction.\n\n## MySQL\n\n### `MySQL.prototype.execute\u003cR\u003e(sql: string, value?: ObjectLiteral): Promise\u003cR\u003e`\n\nExecutes the SQL statement. The result `R` will be returned. The `value` is assigned to the prepared statement before\nexecution.\n\n### `MySQL.prototype.getConnection(): Promise\u003cConnection\u003e`\n\nReturns the `Connection`.\n\n### `MySQL.prototype.transact\u003cR\u003e(transaction: ITransaction\u003cR\u003e): Promise\u003cR\u003e`\n\nExecutes the given `transaction`. If successful, commit the changes and release the connection. If not, roll back the\ntransaction and release the connection.\n\n## MySQLError\n\n`MySQLError` is an error type for `MySQL`. It extends the `DataSourceError` class.\n\n# Redis classes\n\n## Redis\n\n### `Redis.prototype.delete(...keys: ReadonlyArray\u003cstring\u003e): Promise\u003cboolean\u003e`\n\nDeletes the values associated with the keys specified in the `keys` list. Returns `true` if all keys were successfully\ndeleted.\n\n### `Redis.prototype.exists(...keys: ReadonlyArray\u003cstring\u003e): Promise\u003cboolean\u003e`\n\nChecks if the specified keys in the `keys` list exist and return `true` if all of them do, otherwise return `false`.\n\n### `Redis.prototype.exipires(key: string, seconds: number): Promise\u003cboolean\u003e`\n\nAssigns an expiration time of `seconds` to the key specified in `key`. Returns `true` if the operation was successful.\n\n### `Redis.prototype.getHash(): RedisHash`\n\nReturns `RedisHash`.\n\n### `Redis.prototype.getList(): RedisList`\n\nReturns `RedisList`.\n\n### `Redis.prototype.getSet(): RedisSet`\n\nReturns `RedisSet`.\n\n### `Redis.prototype.getString(): RedisString`\n\nReturns `RedisString`.\n\n### `Redis.prototype.on(callback: BinaryConsumer\u003cstring, string\u003e): void`\n\nAdds the event listener.\n\n### `Redis.prototype.publish(channel: string, message: string): Promise\u003cnumber\u003e`\n\nBroadcasts a `message` to the specified `channel`. Returns the number of clients that received the message.\n\n### `Redis.prototype.subscribe(channel: string, callback: BinaryConsumer\u003cstring, string\u003e): Promise\u003cvoid\u003e`\n\nBegins listening for events on the specified `channel`.\n\n### `Redis.prototype.unsubscribe(...channels: ReadonlyArray\u003cstring\u003e): Promise\u003cvoid\u003e`\n\nStops listening for events on the specified `channels`.\n\n## RedisError\n\n`RedisError` is an error type for `Redis`. It extends the `DataSourceError` class.\n\n## RedisHash\n\nRedis methods for hash.\n\n### `RedisHash.prototype.delete(key: string, field: string): Promise\u003cnumber\u003e`\n\nRemoves the field specified in `field` from the Hash stored at the key specified in `key`. Returns the number of fields\nthat were removed.\n\n### `RedisHash.prototype.get(key: string, field: string): Promise\u003cNullable\u003cstring\u003e\u003e`\n\nGets the value of the given `field` from the Hash stored at the key specified in `key`. Return `null` if the value does\nnot exist.\n\n### `RedisHash.prototype.has(key: string, field: string): Promise\u003cboolean\u003e`\n\nReturns `true` if the given `field` exists in the Hash stored at the key specified in `key`.\n\n### `RedisHash.prototype.length(key: string): Promise\u003cnumber\u003e`\n\nRetrieves the number of fields in the Hash stored at the given `key`.\n\n### `RedisHash.prototype.set(key: string, field: string, value: string): Promise\u003cboolean\u003e`\n\nSets the value of `field` in the Hash stored at the key specified `key` to the given `value`. Returns `true` if\nthe `field` is new, `false` if it was updated.\n\n## RedisList\n\nRedis methods for list.\n\n### `RedisList.prototype.dump(key: string): Promise\u003cArray\u003cstring\u003e\u003e`\n\nRetrieves all elements stored under the given `key` as an Array.\n\n### `RedisList.prototype.length(key: string): Promise\u003cnumber\u003e`\n\nRetrieves the length of the list stored at the given `key`.\n\n### `RedisList.prototype.pop(key: string): Promise\u003cNullable\u003cstring\u003e\u003e`\n\nReturns the last element of the list stored in the given `key` and remove it from the list. May return `null` if it has\nno elements.\n\n### `RedisList.prototype.push(key: string, value: string): Promise\u003cnumber\u003e`\n\nAdds the given `value` to the end of the list stored in the given `key`. Then return the current length of the list.\n\n### `RedisList.prototype.remove(key: string, value: string): Promise\u003cnumber\u003e`\n\nRemoves the given `value` from the the list stored in the given `key`. Return the current length of the list.\n\n### `RedisList.prototype.select(key: string, offset: number, limit: number): Promise\u003cArray\u003cstring\u003e\u003e`\n\nRetrieves a subset of elements from the list stored in `key`, starting at `offset` index and ending at `offset + limit`\nindex.\n\n### `RedisList.prototype.shift(key: string): Promise\u003cNullable\u003cstring\u003e\u003e`\n\nReturns the first element of the list stored in the given `key` and remove it from the list. May return `null` if it has\nno elements.\n\n## RedisSet\n\nRedis methods for set.\n\n### `RedisSet.prototype.add(key: string, ...values: ReadonlyArray\u003cstring\u003e): Promise\u003cnumber\u003e`\n\nAdds the given `values` to the Set stored in specified `key`. Returns the number of elements added to the set, not\nincluding already existing elements.\n\n### `RedisSet.prototype.dump(key: string)`\n\nRetrieves all values stored under the given `key` as a Set.\n\n### `RedisSet.prototype.has(key: string, value: string): Promise\u003cboolean\u003e`\n\nReturns `true` if the given `value` exists in the Set stored at the key specified in `key`.\n\n### `RedisSet.prototype.length(key: string): Promise\u003cnumber\u003e`\n\nRetrieves the length of the Set stored at the given `key`.\n\n### `RedisSet.prototype.pop(key: string): Promise\u003cNullable\u003cstring\u003e\u003e`\n\nRemoves and returns a random element from the Set stored in the given `key`. May return `null` if it has no elements.\n\n### `RedisSet.prototype.random(key: string): Promise\u003cArray\u003cnumber\u003e | Nullable\u003cstring\u003e\u003e`\n\nRetrieves a random element from the Set stored at the specified `key`.\n\n### `RedisSet.prototype.remove(key: string, ...values: ReadonlyArray\u003cstring\u003e): Promise\u003cnumber\u003e`\n\nRemoves the given `values` from the the Set stored in the given `key`. Returns the current size of the Set.\n\n## RedisString\n\nRedis methods for string.\n\n### `RedisString.prototype.get(key: string): Promise\u003cNullable\u003cstring\u003e\u003e`\n\nRetrieves the value stored at the given `key` as a string. May return `null` if the key does not exist or the value\nstored at the `key` is not a string.\n\n### `RedisString.prototype.set(key: string, value: string): Promise\u003cboolean\u003e`\n\nStore the given `value` at the given `key`. Return `true` if the operation was successful.\n\n# Request classes\n\n## Request\\\u003cT extends RequestResponseType\\\u003e\n\nThis class provides a simple interface for sending requests to the server and receiving a response.\n`RequestResponseType` represents the type of data that can be retrieved from the server, and it can be one of the\nfollowing values: `'buffer'`, `'json'`, or `'text'`.\n\n### `new Request\u003cT extends RequestResponseType\u003e(type: T)`\n\nThis is a constructor for a class that returns a response of the specified `type` for every request.\n\n### `Request.prototype.delete(url: string): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a DELETE request to the server at the specified `url`. Returns a promise that resolves to the server's response\nwith the specified data `type`.\n\n### `Request.prototype.get(url: string): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a GET request to the server at the specified `url`. Returns a promise that resolves to the server's response with\nthe specified data `type`.\n\n### `Request.prototype.head(url: string): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a HEAD request to the server at the specified `url`. Returns a promise that resolves to the server's response with\nthe specified data `type`.\n\n### `Request.prototype.post(url: string, payload?: ObjectLiteral): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a POST request to the server at the specified `url` with an optional body `payload`. Returns a promise that\nresolves to the server's response with the specified data `type`.\n\n### `Request.prototype.put(url: string, payload?: ObjectLiteral): Promise\u003cFetchResponseType\u003cT\u003e\u003e`\n\nSends a PUT request to the server at the specified `url` with an optional body `payload`. Returns a promise that\nresolves to the server's response with the specified data `type`.\n\n## RequestError\n\n`RequestError` is an error type for `Request`. It extends the `DataSourceError` class.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamashita%2Fcatacombe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamashita%2Fcatacombe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamashita%2Fcatacombe/lists"}