lokalise / node-lokalise-api

Lokalise API v2 Node.js client.

Home Page:https://lokalise.github.io/node-lokalise-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ParamsWithPagination interface is not exported which is used in list()

atifsaddique211f opened this issue · comments

commented

Describe the bug
ParamsWithPagination interface is not exported but the parameter passed to lokaliseApi.keys().list(requestBody) expects this type.

To Reproduce
Steps to reproduce the behavior.

async fetchLokaliseKeysPage(page: number, keys?: string[]) {
      const requestBody: ParamsWithPagination = { page, project_id: projectId, limit: 20 };

      if (keys?.length) {
        requestBody.include_translations = 1;
        requestBody.filter_keys = keys?.join();
      }

      return await this.lokaliseApi.keys().list(requestBody);
}

Expected behavior
A clear and concise description of what you expected to happen.
interface ParamsWithPagination is exported

Your environment:

  • Node version: v16.17.0
  • "@lokalise/node-api": "^9.0.0"

Additional context
Add any other context about the problem here.
Screenshot 2022-10-13 at 2 00 45 PM

Thank you for reporting this, I'll release a new version shortly!

commented

We are facing another issue, I will create a new bug for it.

Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/@lokalise/node-api/dist/main.js from lokalise.service.js not supported.
Instead change the require of main.js in lokalise.service.js to a dynamic import() which is available in all CommonJS modules.
commented

here you go : #342
issue with same version