Skip to content

Releases: RomiC/ya-disk

v4.1.1

Choose a tag to compare

@RomiC RomiC released this 22 Jun 06:19

What's Changed

  • Drop Node 20 support in v4.x (#615)
  • Migrate from Jest to Node.js built-in test runner (#660)
  • Update actions/setup-node to v6.4.0 and coverallsapp/github-action to v2.3.6 (#666)
  • Fix NPM publish workflow trigger for draft releases (#668)
  • Bump eslint from 10.1.0 to 10.4.1
  • Bump lint-staged from 16.4.0 to 17.0.6
  • Bump prettier from 3.8.1 to 3.8.3
  • Bump globals from 17.4.0 to 17.6.0
  • Bump @eslint/markdown from 8.0.1 to 8.0.2
  • Bump eslint-plugin-prettier from 5.5.5 to 5.5.6
  • Bump eslint-plugin-jest from 29.15.1 to 29.15.2
  • Other dependency updates

Migrate request transport to `fetch`

Choose a tag to compare

@RomiC RomiC released this 31 May 16:25
acdfb3e

⚡ Migrate request transport from https to fetch (#613)

The internal HTTP transport has been rewritten from Node's https module to the native fetch API. The public API is fully unchanged — this is an internal improvement only.

What changed under the hood:

  • Removed node:https and node:querystring dependencies from lib/request.js
  • Query strings now built via URL.searchParams instead of querystring.stringify
  • request() is a clean async function — no more new Promise() / stream / event boilerplate
  • node:test mock target changed from https.request to globalThis.fetch

Improved error handling:

Previously, a non-JSON response body (e.g. an HTML error page from a proxy or gateway) would throw a raw SyntaxError with no context. It now rejects with a descriptive message:

Error: Unexpected response (status 502): <html>Bad Gateway</html>

Non-2xx responses with an empty or non-JSON body also now produce a meaningful error instead of a TypeError:

Error: Request failed with status 503  [name: ApiError]

🛠️ Internals

  • Test suite for request.js fully rewritten around globalThis.fetch mocking — IncomingMessageStub, ServerResponseStub and all stream scaffolding removed
  • 3 new test cases covering invalid JSON and empty non-2xx response bodies
  • node:https, node:querystring, node:stream imports removed from test file

ESM first

Choose a tag to compare

@RomiC RomiC released this 31 May 10:21
d649429

⚠️ Breaking Changes

  • Node.js ≥ 22 is now required. Node 20 and below are no longer supported.
  • Package is now ESM-first. "type": "module" is set in package.json. Direct imports of source files (e.g. require('./lib/download')) no longer work — use the package name instead.
  • Only dist/ is published. Source files (lib/, index.js) are no longer included in the npm tarball.

✨ ESM-first with CommonJS backward compatibility (#611)

ya-disk is now distributed as dual ESM + CJS artifacts, so both import and require consumers work out of the box with no extra configuration:

// ESM
import { info, resources } from 'ya-disk';

// CommonJS
const { info, resources } = require('ya-disk');

The exports field in package.json routes each consumer to the correct artifact automatically. Deep imports into internal paths (e.g. ya-disk/dist/lib/info) are not supported — the dist/ layout is an internal implementation detail and may change between releases.

🛠️ Internals

  • Replaced Jest with Node.js built-in node:test runner (#612) — no test framework dependencies
  • Replaced Istanbul/Jest coverage with c8; reports available as text, lcov and clover
  • Build pipeline introduced via esbuild producing both ESM (.js) and CJS (.cjs) artifacts
  • Coverage gated in CI; Coveralls report updated on every push

Missing Ya-Disk methods

Choose a tag to compare

@RomiC RomiC released this 20 Apr 04:34
e171aea

ya-disk v4.1.0

Highlights

  • Added missing Yandex Disk API support for public resources and trash control.
  • Expanded resources API with publish/unpublish operations.
  • Improved request query handling by stripping empty query parameters before sending requests.

Added

  • New publicResources module:
  1. get(token, public_key, options?)
  2. download(token, public_key, path?)
  3. saveToDisk(token, public_key, path?, name?)
  4. list(token, options?)
  • New trash module:
  1. delete(token, path?)
  2. restore(token, path, name?, overwrite?)
  • New endpoint constants for public resources.

Changed

  • resources now includes:
  1. publish(token, path)
  2. unpublish(token, path)
  • README expanded with usage docs and examples for new APIs.
  • Package version bumped to 4.1.0.

Tests and Quality

  • Added/updated unit tests for:
  1. public resources module
  2. trash module
  3. resources publish/unpublish
  4. request query sanitization
  5. root exports
  • Latest release path reports full passing test suite and complete coverage for the newly introduced modules.

Changelog References

  • Feature merge: PR #602
  • Version bump/release commit: PR #604

Missing Ya-Disk methods v3.x

Choose a tag to compare

@RomiC RomiC released this 20 Apr 06:29
84eed50

ya-disk v3.1.0

Highlights

  • Added missing Yandex Disk API support for public resources and trash control.
  • Expanded resources API with publish/unpublish operations.
  • Improved request query handling by stripping empty query parameters before sending requests.

Added

  • New publicResources module:
  1. get(token, public_key, options?)
  2. download(token, public_key, path?)
  3. saveToDisk(token, public_key, path?, name?)
  4. list(token, options?)
  • New trash module:
  1. delete(token, path?)
  2. restore(token, path, name?, overwrite?)
  • New endpoint constants for public resources.

Changed

  • resources now includes:
  1. publish(token, path)
  2. unpublish(token, path)
  • README expanded with usage docs and examples for new APIs.
  • Package version bumped to 4.1.0.
  1. Removed dev files from the package

Tests and Quality

  • Added/updated unit tests for:
  1. public resources module
  2. trash module
  3. resources publish/unpublish
  4. request query sanitization
  5. root exports
  • Latest release path reports full passing test suite and complete coverage for the newly introduced modules.

JSDoc Update

Choose a tag to compare

@RomiC RomiC released this 26 Aug 18:31
  • Small updates for JSDoc

Added typings for v3.x

Choose a tag to compare

@RomiC RomiC released this 17 Aug 05:17

This version should slightly improve the developer experience, by adding typings for the library functions.

Migrated to the native Promise

Choose a tag to compare

@RomiC RomiC released this 10 Jun 03:47

Breaking changes:

  • Instead of callbacks ya-disk will use native Promise (#71)

Significant changes:

  • Populated doc with return types (#71)

Bumped minimal supported node version to 10.x

Choose a tag to compare

@RomiC RomiC released this 14 Mar 10:51
  • Due to node 8.x isn't being maintained anymore, bumped minimal supported version to 10.x
  • DX-updates:
    • Linting+formatting
      • Removed .editorconfig
      • Added prettier and integrated it with eslint
      • Formatted code
    • Migrated Travis → Github-actions
    • Rewrote tests from ava+sinon to jest

Added support of resources.copy and resources.move methods

Choose a tag to compare

@RomiC RomiC released this 11 Sep 10:16

Big thumbs up to @fan-tom for: