Skip to content

Commit

Permalink
Version 11.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bodrovis committed Aug 23, 2023
1 parent d1d8f82 commit 3ffa01b
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 98 deletions.
2 changes: 1 addition & 1 deletion dist/http_client/base.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/http_client/base.js.map

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

4 changes: 4 additions & 0 deletions docs/additional_info/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 11.0.1 (23-Aug-2023)

* Fix certain edge cases for OTA endpoints when the body is not present

## 11.0.0 (23-Aug-2023)

* Added support for the OTA endpoints. Please refer to the [OTA introduction article](https://lokalise.github.io/node-lokalise-api/ota/introduction) to learn more.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lokalise/node-api",
"version": "11.0.0",
"version": "11.0.1",
"description": "Official Lokalise API 2.0 Node.js client",
"license": "BSD-3-Clause",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/http_client/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class ApiRequest {
prefixUrl: clientData.host ?? this.urlRoot,
headers: {
Accept: "application/json",
"Content-type": "application/json",
"User-Agent": `node-lokalise-api/${await LokalisePkg.getVersion()}`,
},
throwHttpErrors: false,
Expand All @@ -56,6 +55,7 @@ export class ApiRequest {

if (method !== "GET" && body) {
options.body = JSON.stringify(body);
options.headers["Content-type"] = "application/json";
}

try {
Expand Down
44 changes: 15 additions & 29 deletions test/cassettes/OtaBundleManagement list.cassette
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,42 @@
"response": {
"data": [
{
"id": 664595,
"projectId": "963054665b7c313dd9b323.35886655",
"isPrerelease": true,
"isProduction": true,
"createdAt": "2023-08-23T11:21:29.827Z",
"createdBy": "20181",
"framework": "android_sdk",
"description": "android_demo",
"isFrozen": false,
"lokaliseId": null,
"fileId": "843d1a17-306e-426e-b709-13fce39a8549",
"modifiedAt": "2023-08-23T11:21:29.827Z"
},
{
"id": 664594,
"id": 664864,
"projectId": "963054665b7c313dd9b323.35886655",
"isPrerelease": true,
"isProduction": false,
"createdAt": "2023-08-23T11:21:14.887Z",
"createdAt": "2023-08-23T15:25:21.521Z",
"createdBy": "20181",
"framework": "ios_sdk",
"description": "demo2",
"description": "",
"isFrozen": false,
"lokaliseId": 847046,
"fileId": "2f6fe338-1ad0-47ba-9475-c12bf3128b55",
"modifiedAt": "2023-08-23T11:21:14.887Z"
"lokaliseId": 847259,
"fileId": "f32370bb-a826-4565-a06a-40155c6b0569",
"modifiedAt": "2023-08-23T15:25:21.521Z"
},
{
"id": 664155,
"id": 664863,
"projectId": "963054665b7c313dd9b323.35886655",
"isPrerelease": false,
"isProduction": true,
"createdAt": "2023-08-22T18:15:01.277Z",
"createdAt": "2023-08-23T15:25:15.849Z",
"createdBy": "20181",
"framework": "ios_sdk",
"description": "ios_demo",
"description": "",
"isFrozen": false,
"lokaliseId": 846685,
"fileId": "5c1b2d04-5576-4cfd-850a-282b35b9efc1",
"modifiedAt": "2023-08-23T11:21:14.887Z"
"lokaliseId": 847258,
"fileId": "7a27461c-0887-4da9-8276-fa9bf084669f",
"modifiedAt": "2023-08-23T15:25:21.521Z"
}
]
},
"rawHeaders": [
"Date",
"Wed, 23 Aug 2023 11:35:03 GMT",
"Wed, 23 Aug 2023 15:26:02 GMT",
"Content-Type",
"application/json; charset=utf-8",
"Content-Length",
"1008",
"658",
"Connection",
"close",
"Content-Security-Policy",
Expand Down Expand Up @@ -87,7 +73,7 @@
"X-XSS-Protection",
"0",
"x-request-id",
"341b6fb84bacf1ce2b14996346d624ff",
"aaddcb073b76755c2d2479259a0157d0",
"Access-Control-Allow-Origin",
"*",
"Access-Control-Allow-Credentials",
Expand Down
10 changes: 5 additions & 5 deletions test/cassettes/OtaFreezePeriods create.cassette
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
"body": {
"from": "5.0",
"to": "6.0",
"bundleId": 664798
"bundleId": 664864
},
"status": 200,
"response": {
"data": {
"id": 34301,
"id": 34303,
"projectId": 20984,
"bundleId": 664798,
"bundleId": 664864,
"framework": "ios_sdk",
"from": "5.0",
"to": "6.0"
}
},
"rawHeaders": [
"Date",
"Wed, 23 Aug 2023 14:24:56 GMT",
"Wed, 23 Aug 2023 15:28:04 GMT",
"Content-Type",
"application/json; charset=utf-8",
"Content-Length",
Expand Down Expand Up @@ -55,7 +55,7 @@
"X-XSS-Protection",
"0",
"x-request-id",
"6d480522546337a0eb48500eb9f0e7b1",
"94b8de18cdfccdb1f10c5c667652b04b",
"Access-Control-Allow-Origin",
"*",
"Access-Control-Allow-Credentials",
Expand Down
10 changes: 5 additions & 5 deletions test/cassettes/OtaSdkTokens create.cassette
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"status": 200,
"response": {
"data": {
"id": 9433,
"token": "c72f9bf9f88e0779275d4832ca0e56933a89",
"id": 9451,
"token": "a3511c8e335ac3c770ea96ede1a28f3ce263",
"projectId": 20984,
"lokaliseId": null,
"createdAt": "2023-08-22T15:05:51.227Z"
"createdAt": "2023-08-23T15:23:39.843Z"
}
},
"rawHeaders": [
"Date",
"Tue, 22 Aug 2023 15:05:51 GMT",
"Wed, 23 Aug 2023 15:23:39 GMT",
"Content-Type",
"application/json; charset=utf-8",
"Content-Length",
Expand Down Expand Up @@ -50,7 +50,7 @@
"X-XSS-Protection",
"0",
"x-request-id",
"e08cd5502e3a6234267608c8d3db4d00",
"547cd6a2289cbdf2f5be93617ef56f1f",
"Access-Control-Allow-Origin",
"*",
"Access-Control-Allow-Credentials",
Expand Down
26 changes: 6 additions & 20 deletions test/cassettes/OtaSdkTokens list.cassette
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,21 @@
"response": {
"data": [
{
"id": 9428,
"token": "a952aac5c1a5811618253acd7c935582596e",
"id": 9434,
"token": "752171461d3c37dcd0c9899b796b00aa27e0",
"projectId": 20984,
"lokaliseId": null,
"createdAt": "2023-08-22T14:21:25.643Z"
},
{
"id": 9429,
"token": "8531fd155d5ac3c76564f4a22dbada4f0a6f",
"projectId": 20984,
"lokaliseId": null,
"createdAt": "2023-08-22T14:21:26.883Z"
},
{
"id": 9430,
"token": "f9de1558a5b41416e6f96b40dc1c2e348cd5",
"projectId": 20984,
"lokaliseId": null,
"createdAt": "2023-08-22T14:21:28.473Z"
"createdAt": "2023-08-22T18:14:25.162Z"
}
]
},
"rawHeaders": [
"Date",
"Tue, 22 Aug 2023 14:39:07 GMT",
"Wed, 23 Aug 2023 15:20:45 GMT",
"Content-Type",
"application/json; charset=utf-8",
"Content-Length",
"412",
"144",
"Connection",
"close",
"Content-Security-Policy",
Expand Down Expand Up @@ -66,7 +52,7 @@
"X-XSS-Protection",
"0",
"x-request-id",
"4bbfefec7c0b88ca28b4f1c3d3d0ccd6",
"79055338e84b44ed1ecab3874c78ce69",
"Access-Control-Allow-Origin",
"*",
"Access-Control-Allow-Credentials",
Expand Down
49 changes: 28 additions & 21 deletions test/cassettes/TranslationStatuses create.cassette
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,56 @@
{
"scope": "https://api.lokalise.com:443",
"method": "POST",
"path": "/api2/projects/803826145ba90b42d5d860.46800099/custom_translation_statuses",
"path": "/api2/projects/963054665b7c313dd9b323.35886655/custom_translation_statuses",
"body": {
"title": "node",
"color": "#344563"
},
"status": 200,
"response": {
"project_id": "803826145ba90b42d5d860.46800099",
"project_id": "963054665b7c313dd9b323.35886655",
"custom_translation_status": {
"status_id": 131,
"status_id": 15694,
"title": "node",
"color": "#344563"
}
},
"rawHeaders": [
"Server",
"nginx",
"Date",
"Thu, 18 Jul 2019 16:51:55 GMT",
"Wed, 23 Aug 2023 15:30:17 GMT",
"Content-Type",
"application/json",
"Transfer-Encoding",
"chunked",
"Connection",
"close",
"Server",
"nginx",
"Vary",
"Accept-Encoding",
"Set-Cookie",
"PHPSESSID=db373fb4bdb9493d64b27d074ee3804a; expires=Mon, 16-Sep-2019 16:51:55 GMT; Max-Age=5184000; path=/; secure; HttpOnly",
"Expires",
"Thu, 19 Nov 1981 08:52:00 GMT",
"Cache-Control",
"no-store, no-cache, must-revalidate",
"Pragma",
"no-cache",
"Pragma",
"max-age=-172800, must-revalidate, no-cache, no-store, private",
"pragma",
"no-cache",
"Cache-Control",
"no-store, no-cache",
"Access-Control-Allow-Origin",
"*",
"Access-Control-Allow-Headers",
"Content-Type"
]
"Allow",
"GET",
"X-Content-Type-Options",
"nosniff",
"X-Frame-Options",
"deny",
"X-XSS-Protection",
"1; mode=block",
"Strict-Transport-Security",
"max-age=31536000",
"Referrer-Policy",
"origin",
"X-Lokalise-Process-Id",
"e941f016-13f8-465a-bd35-66446924cdad",
"Expires",
"Mon, 21 Aug 2023 15:30:17 GMT",
"Set-Cookie",
"PHPSESSID=deleted; expires=Tue, 23-Aug-2022 15:30:16 GMT; Max-Age=0; path=/; httponly"
],
"responseIsBinary": false
}
]
4 changes: 2 additions & 2 deletions test/ota/ota_bundle_management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ describe("OtaBundleManagement", function () {
lokaliseProjectId: projectId,
});

expect(bundles.length).to.eq(3);
expect(bundles.length).to.eq(2);

const bundle = bundles[0];
expect(bundle.id).to.eq(bundleId);
expect(bundle.id).to.eq(664864);
})
.register(this);

Expand Down
6 changes: 3 additions & 3 deletions test/ota/ota_freeze_periods.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ describe("OtaFreezePeriods", function () {

cassette
.createTest("create", async () => {
const bundleId = 664798;
const bundleId = 664864;
const freeze = await lokaliseApiOta.otaFreezePeriods().create(
{
from: "5.0",
to: "6.0",
bundleId: 664798,
bundleId: bundleId,
},
{
teamId: teamId,
lokaliseProjectId: projectId,
},
);

expect(freeze.id).to.eq(freezeId);
expect(freeze.id).to.eq(34303);
expect(freeze.projectId).to.eq(20984);
expect(freeze.bundleId).to.eq(bundleId);
expect(freeze.framework).to.eq("ios_sdk");
Expand Down
Loading

0 comments on commit 3ffa01b

Please sign in to comment.