New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

iubenda-consent-solution-api

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iubenda-consent-solution-api - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

dist/index.d.ts

@@ -81,3 +81,3 @@ export interface ConsentsQueryParameters {

*/
ip_address?: null;
ip_address?: string;
/**

@@ -84,0 +84,0 @@ * Default `true`, Considered only when using a `public` key. Enables or disables (true, false) the IP address autedetection. Default true

@@ -113,9 +113,6 @@ "use strict";

return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_b = (_a = IubendaConsentSolution).sendRequest;
return [4 /*yield*/, IubendaConsentSolution.sendRequest(this.addHeaders((0, superagent_1.post)(this.generateUrl('consent')).send(consent)))];
case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, IubendaConsentSolution.sendRequest(this.addHeaders((0, superagent_1.post)(this.generateUrl('consent')).send(consent)))];
case 1: return [2 /*return*/, _a.sent()];
}

@@ -122,0 +119,0 @@ });

{
"name": "iubenda-consent-solution-api",
"version": "0.1.2",
"version": "0.1.3",
"description": "API client to implement Iubenda Consent Solution in backend service",

@@ -47,4 +47,2 @@ "main": "dist/index.js",

"hooks": {
"pre-commit": "lint-staged",
"post-commit": "git update-index --again"
}

@@ -51,0 +49,0 @@ },

@@ -51,3 +51,38 @@ import {expect} from 'chai';

//ToDo implements createConsent()
it('Add Consent', async function () {
const client = new IubendaConsentSolution({apiKey: validApiKey});
const result = await client.createConsent({
autodetect_ip_address: 'false',
subject: {
id: '1',
email: 'test@test.it',
first_name: 'John',
last_name: 'Fix',
},
legal_notices: [
{identifier: 'privacy_policy',version: '1'},
{identifier: 'terms_and_conditions',version: '1'},
{identifier: 'cookie_policy',version: '1'},
],
proofs: [
{
content: '{}',
form: '<form></form>',
},
],
preferences: {
privacy_policy: 'true',
terms_and_conditions: 'true',
cookie_policy: 'true',
newsletter_subscription: 'false',
},
ip_address: '',
});
if ('error' in result) {
console.log(result);
expect.fail('Response error! ' + result.message);
}
else
expect(true);
});
});

@@ -54,0 +89,0 @@ describe('Subjects', function () {

@@ -85,3 +85,3 @@ import {get, post, put, SuperAgentRequest} from 'superagent';

*/
ip_address?: null;
ip_address?: string;
/**

@@ -303,3 +303,3 @@ * Default `true`, Considered only when using a `public` key. Enables or disables (true, false) the IP address autedetection. Default true

async createConsent(consent: ConsentExtended): Promise<ResponseError | ConsentPostResponse> {
return IubendaConsentSolution.sendRequest(await IubendaConsentSolution.sendRequest(this.addHeaders(post(this.generateUrl('consent')).send(consent))));
return await IubendaConsentSolution.sendRequest(this.addHeaders(post(this.generateUrl('consent')).send(consent)));
}

@@ -306,0 +306,0 @@

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