Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lokalise/node-api

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lokalise/node-api - npm Package Compare versions

Comparing version 2.0.2 to 2.1.0

test/cassettes/Webhooks regenerate_secret.cassette

6

CHANGELOG.md
# Lokalise API Node Client Changelog
## 2.1.0 (28-Feb-20)
* Added method to [regenerate webhook secret](https://lokalise.com/api2docs/curl/#transition-regenerate-a-webhook-secret-patch): `lokaliseApi.webhooks.regenerate_secret(webhook_id, {project_id: project_id});`
## 2.0.2 (25-Feb-20)
* Hotfix the pagination parameters are now available under collection names like under following names: totalResults, totalPages, resultsPerPage, currentPage
* Pagination data can now be fetched using the following methods: `totalResults`, `totalPages`, `resultsPerPage`, `currentPage`

@@ -7,0 +11,0 @@ ## 2.0.1 (09-Dec-19)

@@ -13,2 +13,6 @@ "use strict";

}
regenerate_secret(id, params = {}) {
params['id'] = id;
return this.createPromise('PATCH', params, this.returnBareJSON, this.handleReject, null, 'projects/{!:project_id}/webhooks/{:id}/secret/regenerate');
}
}

@@ -15,0 +19,0 @@ exports.Webhooks = Webhooks;

2

dist/http_client/base.js

@@ -7,3 +7,3 @@ "use strict";

constructor(uri, method, body = null, params = {}) {
this.urlRoot = 'https://api.lokalise.co/api2/';
this.urlRoot = 'https://api.lokalise.com/api2/';
this.params = {};

@@ -10,0 +10,0 @@ this.params = params;

@@ -505,3 +505,4 @@ declare module '@lokalise/node-api' {

create(body: any, params: StandartParams): Promise<any>;
update(id: any, body: any, params: StandartParams) : Promise<any>
update(id: any, body: any, params: StandartParams) : Promise<any>;
regenerate_secret(id: any, params : StandartParams) : Promise<any>;
}

@@ -508,0 +509,0 @@

{
"name": "@lokalise/node-api",
"version": "2.0.2",
"version": "2.1.0",
"description": "Official Lokalise API 2.0 Node.js client",

@@ -26,3 +26,3 @@ "license": "MIT",

"@types/mocha": "^5.2.7",
"@types/node": "^12.12.14",
"@types/node": "^13.7.6",
"acorn": "^7.1.0",

@@ -29,0 +29,0 @@ "dotenv": "^8.2.0",

@@ -91,8 +91,13 @@ # Lokalise API v2 official Node.js client

The response pagination data are now available under collection names like under following names: totalResults, totalPages, resultsPerPage, currentPage. They are safe to use only in a synchronized manner. If you will run a concurrent request using the same lokaliseApi instance, the pagination data may be corrupted. It will be fixed later
The response pagination data can be fetched in the following way:
```js
const projects = lokaliseApi.projects.totalResults
lokaliseApi.projects.totalResults;
lokaliseApi.projects.totalPages;
lokaliseApi.projects.resultsPerPage;
lokaliseApi.projects.currentPage;
```
These methods are safe to use only in a synchronized manner. If you are running a concurrent request using the same `lokaliseApi` instance, the pagination data may be corrupted. This will be fixed in the upcoming releases.
## Usage

@@ -887,2 +892,11 @@

#### Regenerate webhook secret
```js
lokaliseApi.webhooks.regenerate_secret(
webhook_id,
{project_id: project_id}
);
```
## Additional Info

@@ -889,0 +903,0 @@

@@ -94,3 +94,3 @@ import { ApiRequest } from '../http_client/base';

this.populatePaginationDataFor(headers);
let json = result['body']
let json = result['body'];
resolve(resolveFn.call(this, json));

@@ -97,0 +97,0 @@ }).catch((data) => {

@@ -20,2 +20,8 @@ import { BaseCollection } from './base_collection';

}
regenerate_secret(id: any, params : StandartParams = {}) : Promise<any> {
params['id'] = id;
return this.createPromise('PATCH', params, this.returnBareJSON, this.handleReject, null,
'projects/{!:project_id}/webhooks/{:id}/secret/regenerate');
}
}

@@ -5,3 +5,3 @@ import request = require('request');

export class ApiRequest {
private urlRoot: string = 'https://api.lokalise.co/api2/';
private urlRoot: string = 'https://api.lokalise.com/api2/';
public promise: Promise<any>;

@@ -8,0 +8,0 @@ public params: any = {};

@@ -70,2 +70,12 @@ require('../setup');

}).register(this);
deck.createTest('regenerate_secret', async () => {
const response = await lokaliseApi.webhooks.regenerate_secret(
'795565582e5ab15a59bb68156c7e2e9eaa1e8d1a',
{project_id: project_id}
);
expect(response.project_id).to.eq(project_id);
expect(response.secret).to.eq('06fbaf3aba6f1b47ec68c3cf6f6a8a361a0572b7');
}).register(this);
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc