🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@ng-apimock/base-client

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ng-apimock/base-client - npm Package Compare versions

Comparing version

to
2.0.0

dist/configuration.d.ts

21

CHANGELOG.md

@@ -6,7 +6,24 @@ # Changelog

# [2.0.0](https://github.com/ng-apimock/base-client/compare/v1.0.16...v2.0.0) (2020-07-08)
### Features
* 🎸 make endpoints base path configurable ([b6ef72e](https://github.com/ng-apimock/base-client/commit/b6ef72e1c6b45e666da2ce5eb6c1d20022514a0b)), closes [#5](https://github.com/ng-apimock/base-client/issues/5)
### BREAKING CHANGES
* 🧨 constructor now accepts a configuration object instead of the baseurl
## [1.0.16](https://github.com/ng-apimock/base-client/compare/v1.0.15...v1.0.16) (2020-06-15)
### Bug Fixes
### Chore
* 🤖 update project repo ([b4c026a](https://github.com/ng-apimock/base-client/commit/b4c026a970a31cbc257a6ca2a2e4eab7e7a6a0a9))
* 🎡 migrate to github-actions ([5d207f5](https://github.com/ng-apimock/base-client/commit/5d207f5b177451c02829d7a30199795f7c697914))
* 🐛 remove incorrect import ([eba751d](https://github.com/ng-apimock/base-client/commit/eba751d36752d88bd5e996736db90e77501dc8c4))
## [1.0.15](https://github.com/ng-apimock/base-client/compare/v1.0.14...v1.0.15) (2020-03-03)
### Feature
* add https support ([3eeab5](https://github.com/ng-apimock/base-client/commit/3eeab54bbe8eb680c56f2a2751916129af57e55d))

6

dist/base.client.d.ts
import { Request } from 'node-fetch';
import { Client } from './client';
import { Configuration } from './configuration';
declare abstract class BaseClient implements Client {

@@ -7,3 +8,4 @@ ngApimockId: string;

private agent;
constructor(baseUrl: string);
private configuration;
constructor(configuration: Configuration);
delayResponse(name: string, delay: number): Promise<any>;

@@ -31,2 +33,2 @@ deleteVariable(key: string): Promise<any>;

}
export { BaseClient, Client };
export { BaseClient, Client, Configuration };

@@ -17,7 +17,8 @@ "use strict";

const uuid = require("uuid");
const COOKIE_NAME = 'apimockid';
const configuration_1 = require("./configuration");
class BaseClient {
constructor(baseUrl) {
constructor(configuration) {
this.ngApimockId = uuid.v4();
this.baseUrl = urljoin(baseUrl, 'ngapimock');
this.configuration = Object.assign(Object.assign({}, configuration_1.DefaultConfiguration), JSON.parse(JSON.stringify(configuration)));
this.baseUrl = urljoin(this.configuration.baseUrl, this.configuration.basePath);
this.agent = new https.Agent({

@@ -76,3 +77,3 @@ rejectUnauthorized: false

headers: {
Cookie: `${COOKIE_NAME}=${this.ngApimockId}`,
Cookie: `${this.configuration.identifier}=${this.ngApimockId}`,
'Content-Type': 'application/json'

@@ -125,3 +126,3 @@ }

yield this.openUrl(urljoin(this.baseUrl, 'init'));
yield this.setCookie(COOKIE_NAME, this.ngApimockId);
yield this.setCookie(this.configuration.identifier, this.ngApimockId);
return this;

@@ -128,0 +129,0 @@ });

{
"name": "@ng-apimock/base-client",
"description": "Base client for @ng-apimock/core",
"version": "1.0.16",
"version": "2.0.0",
"homepage": "https://github.com/ng-apimock/base-client#readme",

@@ -35,4 +35,4 @@ "author": {

"devDependencies": {
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@commitlint/cli": "9.0.1",
"@commitlint/config-conventional": "9.0.1",
"@semantic-release/changelog": "5.0.1",

@@ -44,21 +44,21 @@ "@semantic-release/commit-analyzer": "8.0.1",

"@semantic-release/release-notes-generator": "9.0.1",
"@types/jest": "26.0.0",
"@types/jest": "26.0.4",
"@types/node-fetch": "2.5.7",
"@types/url-join": "4.0.0",
"@types/uuid": "8.0.0",
"@typescript-eslint/eslint-plugin": "3.3.0",
"@typescript-eslint/parser": "3.3.0",
"@typescript-eslint/eslint-plugin": "3.6.0",
"@typescript-eslint/parser": "3.6.0",
"commitizen": "4.1.2",
"eslint": "7.2.0",
"eslint": "7.4.0",
"eslint-config-airbnb-base": "14.2.0",
"eslint-plugin-import": "2.21.2",
"eslint-plugin-jest": "23.13.2",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jest": "23.18.0",
"husky": "4.2.5",
"jest": "26.0.1",
"jest": "26.1.0",
"jest-createspyobj": "1.2.2",
"lint-staged": "10.2.10",
"lint-staged": "10.2.11",
"rimraf": "3.0.2",
"semantic-release": "17.0.8",
"ts-jest": "26.1.0",
"typescript": "3.9.5"
"semantic-release": "17.1.1",
"ts-jest": "26.1.1",
"typescript": "3.9.6"
},

@@ -68,3 +68,3 @@ "dependencies": {

"url-join": "4.0.1",
"uuid": "8.1.0"
"uuid": "8.2.0"
},

@@ -71,0 +71,0 @@ "husky": {

@@ -5,2 +5,2 @@ # ng-apimock/base-client [![npm](https://img.shields.io/npm/v/@ng-apimock/base-client?color=brightgreen)](https://www.npmjs.com/package/@ng-apimock/base-client) [![Build Status](https://github.com/ng-apimock/base-client/workflows/CI/badge.svg)](https://github.com/ng-apimock/base-client/actions?workflow=CI) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ng-apimock_base-client&metric=alert_status)](https://sonarcloud.io/dashboard?id=ng-apimock_base-client) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-brightgreen.svg)](https://github.com/semantic-release/semantic-release) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=ng-apimock/base-client)](https://dependabot.com) [![dependency Status](https://img.shields.io/david/ng-apimock/base-client.svg)](https://david-dm.org/ng-apimock/base-client) [![devDependency Status](https://img.shields.io/david/dev/ng-apimock/base-client.svg)](https://david-dm.org/ng-apimock/base-client#info=devDependencies) ![npm downloads](https://img.shields.io/npm/dm/@ng-apimock/base-client)

## Usage
The base-client is an abstract client interface that can be implemented to connect to the ng-apimock core.
The base-client is an abstract client interface that can be implemented to connect to the @ng-apimock/core.

Sorry, the diff of this file is not supported yet