Skip to content

Commit

Permalink
Version 9 (#340)
Browse files Browse the repository at this point in the history
* Version 9, beta 1

* Prepare for stable version 9

* link to v8 [skip ci]
  • Loading branch information
bodrovis authored Oct 5, 2022
1 parent ebd196a commit c9ff67d
Show file tree
Hide file tree
Showing 344 changed files with 3,186 additions and 1,834 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ samples

main.d.ts

docs
docs
56 changes: 56 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.eslint.json"],
ecmaVersion: 2022,
},
plugins: ["@typescript-eslint", "node", "prettier"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:node/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
],
rules: {
"prettier/prettier": "error",
"@typescript-eslint/consistent-type-assertions": [
"warn",
{
assertionStyle: "angle-bracket",
},
],
"@typescript-eslint/no-explicit-any": "off",
"node/file-extension-in-import": [
"error",
"always",
{ tryExtensions: [".js", ".json", ".node"] },
],
"node/no-missing-import": "off",
"node/no-unpublished-import": ["off"],
"import/no-unresolved": "error",
"import/no-named-as-default": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/unbound-method": "off",
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
typescript: true,
node: true,
},
},
},
};
47 changes: 0 additions & 47 deletions .eslintrc.js

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Official Node interface for the [Lokalise API](https://app.lokalise.com/api2docs

## Quickstart

**Please note that starting from version 9 this SDK is a pure [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) module. It does not provide a CommonJS export (`require`) anymore.** Therefore you should either [convert your project to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c), use [dynamic import](https://v8.dev/features/dynamic-import), or stay on [version 8](https://github.com/lokalise/node-lokalise-api/tree/v8) which we are fully supporting.

Install the library:

```bash
Expand All @@ -18,10 +20,10 @@ npm install @lokalise/node-api
Obtain Lokalise API token in your personal profile, initialize and use the client:

```ts
const { LokaliseApi } = require('@lokalise/node-api');
import { LokaliseApi } from "@lokalise/node-api";

const lokaliseApi = new LokaliseApi({ apiKey: '<apiKey>'});
const projects = lokaliseApi.projects().list();
const projects = await lokaliseApi.projects().list();
projects.items[0].name;

process = await lokaliseApi.files().upload(project_id,
Expand Down
10 changes: 5 additions & 5 deletions dist/collections/base_collection.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Options } from "got";
import { ApiError } from "../models/api_error";
import { PaginatedResult } from "../models/paginated_result";
import { Keyable } from "../interfaces/keyable";
import { ClientData } from "../interfaces/client_data";
import { BulkResult } from "../interfaces/bulk_result";
import { ApiError } from "../models/api_error.js";
import { PaginatedResult } from "../models/paginated_result.js";
import { Keyable } from "../interfaces/keyable.js";
import { ClientData } from "../interfaces/client_data.js";
import { BulkResult } from "../interfaces/bulk_result.js";
declare type RejectHandler = (data: any) => ApiError;
declare type ResolveHandler = (json: Keyable, headers: Keyable, ...args: any[]) => any;
export declare abstract class BaseCollection {
Expand Down
14 changes: 5 additions & 9 deletions dist/collections/base_collection.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/collections/base_collection.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions dist/collections/branches.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BaseCollection } from "./base_collection";
import { Branch } from "../models/branch";
import { PaginatedResult } from "../interfaces/paginated_result";
import { ProjectWithPagination } from "../interfaces/project_with_pagination";
import { ProjectOnly } from "../interfaces/project_only";
import { BaseCollection } from "./base_collection.js";
import { Branch } from "../models/branch.js";
import { PaginatedResult } from "../interfaces/paginated_result.js";
import { ProjectWithPagination } from "../interfaces/project_with_pagination.js";
import { ProjectOnly } from "../interfaces/project_only.js";
declare type BranchParams = {
name?: string;
};
Expand Down
12 changes: 4 additions & 8 deletions dist/collections/branches.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/collections/branches.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions dist/collections/comments.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BaseCollection } from "./base_collection";
import { Comment } from "../models/comment";
import { PaginatedResult } from "../interfaces/paginated_result";
import { ProjectWithPagination } from "../interfaces/project_with_pagination";
import { ProjectOnly } from "../interfaces/project_only";
import { BaseCollection } from "./base_collection.js";
import { Comment } from "../models/comment.js";
import { PaginatedResult } from "../interfaces/paginated_result.js";
import { ProjectWithPagination } from "../interfaces/project_with_pagination.js";
import { ProjectOnly } from "../interfaces/project_only.js";
interface ParamsWithPagination extends ProjectWithPagination {
key_id: number | string;
}
Expand Down
Loading

0 comments on commit c9ff67d

Please sign in to comment.