Skip to content

Commit 5b32c96

Browse files
committed
v14.5.1
1 parent bf7c330 commit 5b32c96

File tree

8 files changed

+25
-21
lines changed

8 files changed

+25
-21
lines changed

dist/main.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ type ApiResponse = {
137137
* Handles URL construction, request initiation, response processing, and error handling.
138138
*/
139139
declare class ApiRequest {
140+
/**
141+
* The default base URL for the Lokalise API.
142+
*/
143+
protected static readonly urlRoot = "https://api.lokalise.com/api2/";
140144
/**
141145
* The resolved response from the API request.
142146
*/
@@ -146,10 +150,6 @@ declare class ApiRequest {
146150
* This object is modified during URL construction, removing parameters used in path segments.
147151
*/
148152
params: Record<string, unknown>;
149-
/**
150-
* The default base URL for the Lokalise API.
151-
*/
152-
protected readonly urlRoot = "https://api.lokalise.com/api2/";
153153
/**
154154
* Constructs a new ApiRequest instance.
155155
* @param params - Query and/or path parameters.

dist/main.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/additional_info/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 14.5.1 (04-May-2025)
4+
5+
* Minor code tweaks
6+
37
## 14.5.0 (30-Apr-2025)
48

59
* Added `projectId` attribute for glossary items:

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lokalise/node-api",
3-
"version": "14.5.0",
3+
"version": "14.5.1",
44
"description": "Official Lokalise API 2.0 Node.js client",
55
"license": "BSD-3-Clause",
66
"repository": {

src/http_client/base.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export type ApiResponse = {
1313
* Handles URL construction, request initiation, response processing, and error handling.
1414
*/
1515
export class ApiRequest {
16+
/**
17+
* The default base URL for the Lokalise API.
18+
*/
19+
protected static readonly urlRoot = "https://api.lokalise.com/api2/";
20+
1621
/**
1722
* The resolved response from the API request.
1823
*/
@@ -24,11 +29,6 @@ export class ApiRequest {
2429
*/
2530
public params: Record<string, unknown> = {};
2631

27-
/**
28-
* The default base URL for the Lokalise API.
29-
*/
30-
protected readonly urlRoot = "https://api.lokalise.com/api2/";
31-
3232
/**
3333
* Constructs a new ApiRequest instance.
3434
* @param params - Query and/or path parameters.
@@ -79,7 +79,7 @@ export class ApiRequest {
7979
clientData: ClientData,
8080
): Promise<ApiResponse> {
8181
const url = this.composeURI(`/${clientData.version}/${uri}`);
82-
const prefixUrl = clientData.host ?? this.urlRoot;
82+
const prefixUrl = clientData.host ?? ApiRequest.urlRoot;
8383
const headers = await this.buildHeaders(clientData, method, body);
8484

8585
const options: RequestInit = {

src/lokalise/base_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class BaseClient {
2424
*/
2525
constructor(params: ClientParams) {
2626
const { apiKey } = params;
27-
if (!apiKey || apiKey.trim().length === 0) {
27+
if (typeof apiKey !== "string" || apiKey.trim().length === 0) {
2828
throw new Error(
2929
"Instantiation failed: A non-empty API key or JWT must be provided.",
3030
);

0 commit comments

Comments
 (0)