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

@codetanzania/emis-api-client

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codetanzania/emis-api-client - npm Package Compare versions

Comparing version 0.13.1 to 0.13.2

13

CHANGELOG.md

@@ -0,1 +1,14 @@

#### 0.13.2 (2019-03-22)
##### Chores
* ignore @lykmapipo/env from rollup config ([4d684921](https://github.com/CodeTanzania/emis-api-client/commit/4d6849215706f08dbb9565fa54b9374057a9fcdd))
* move peer dependencies to dependencies ([83c86004](https://github.com/CodeTanzania/emis-api-client/commit/83c8600450a740431df6db050e62c0b57e034ac5))
##### Refactors
* use env helpers from @lykmapipo/env ([016dcfa3](https://github.com/CodeTanzania/emis-api-client/commit/016dcfa3f9137c6d88130c3d9f0533cd83d29d6f))
* use helpers from @lykmapipo/common ([b9656a67](https://github.com/CodeTanzania/emis-api-client/commit/b9656a67e18f74f4f24bdd28bbe58d4247f1ffa8))
* use helpers from @lykmapipo/common ([c974b3b7](https://github.com/CodeTanzania/emis-api-client/commit/c974b3b733b1eba37ea4752ad636e29798dd7105))
#### 0.13.1 (2019-03-21)

@@ -2,0 +15,0 @@

8

package.json
{
"name": "@codetanzania/emis-api-client",
"version": "0.13.1",
"version": "0.13.2",
"description": "http client for EMIS API.",

@@ -72,3 +72,6 @@ "main": "lib/index.js",

},
"peerDependencies": {
"peerDependencies": {},
"dependencies": {
"@lykmapipo/common": ">=0.11.1",
"@lykmapipo/env": ">=0.7.2",
"axios": ">=0.18.0",

@@ -79,3 +82,2 @@ "inflection": ">=1.12.0",

},
"dependencies": {},
"config": {

@@ -82,0 +84,0 @@ "commitizen": {

@@ -12,2 +12,4 @@ import pkg from './package.json';

'moment',
'@lykmapipo/common',
'@lykmapipo/env',
],

@@ -14,0 +16,0 @@ output: [

@@ -5,6 +5,5 @@ import moment from 'moment';

import { singularize, pluralize } from 'inflection';
import { idOf, uniq, mergeObjects, variableNameFor } from '@lykmapipo/common';
import { getString } from '@lykmapipo/env';
import {
uniq,
compact,
map,
merge,

@@ -17,7 +16,5 @@ isArray,

isString,
camelCase,
max,
min,
toLower,
omitBy,
omit,

@@ -32,24 +29,2 @@ } from 'lodash';

// create duplicate free array of values
const distinct = (...values) => uniq(compact([...values]));
// merge list of objects to single object
const mergeObjects = (...objects) => {
// ensure source objects
let sources = compact([...objects]);
sources = map(sources, source => {
return omitBy(source, val => !val);
});
// return merged
const merged = merge({}, ...sources);
return merged;
};
// create dynamic camelized function name
const fn = (...name) => camelCase([...name].join(' '));
// get resource id from payload
const idOf = data => (data ? data._id || data.id : undefined); // eslint-disable-line
/**

@@ -134,3 +109,3 @@ * @function mapResponseToError

const mapIn = (...values) => {
let params = distinct(...values);
let params = uniq([...values]);
params = params.length > 1 ? { $in: params } : first(params);

@@ -317,5 +292,4 @@ return params;

if (!client) {
// Dont destructure: Fix:ReferenceError: process is not defined in react
const env = process.env; // eslint-disable-line
const { EMIS_API_URL, REACT_APP_EMIS_API_URL } = env;
const EMIS_API_URL = getString('EMIS_API_URL');
const REACT_APP_EMIS_API_URL = getString('REACT_APP_EMIS_API_URL');
BASE_URL = API_BASE_URL || EMIS_API_URL || REACT_APP_EMIS_API_URL;

@@ -541,3 +515,3 @@ const options = { baseURL: BASE_URL, headers: HEADERS };

// generate method name
const methodName = fn('get', singular, 'Schema');
const methodName = variableNameFor('get', singular, 'Schema');

@@ -576,3 +550,3 @@ // build action

// generate method name
const methodName = fn('get', shortcut.plural, 'export', 'url');
const methodName = variableNameFor('get', shortcut.plural, 'export', 'url');

@@ -614,3 +588,3 @@ // build action

// generate method name
const methodName = fn('get', shortcut.plural);
const methodName = variableNameFor('get', shortcut.plural);

@@ -654,3 +628,3 @@ // build action

// generate method name
const methodName = fn('get', singular);
const methodName = variableNameFor('get', singular);

@@ -694,3 +668,3 @@ // build action

// generate method name
const methodName = fn('post', singular);
const methodName = variableNameFor('post', singular);

@@ -735,3 +709,3 @@ // build action

// generate method name
const methodName = fn('put', singular);
const methodName = variableNameFor('put', singular);

@@ -776,3 +750,3 @@ // build action

// generate method name
const methodName = fn('patch', singular);
const methodName = variableNameFor('patch', singular);

@@ -817,3 +791,3 @@ // build action

// generate method name
const methodName = fn('delete', singular);
const methodName = variableNameFor('delete', singular);

@@ -859,4 +833,3 @@ // build action

// return resource http actions
const httpActions = merge(
{},
const httpActions = mergeObjects(
getSchema,

@@ -863,0 +836,0 @@ getExportUrl,

import { clone, forEach, merge, upperFirst } from 'lodash';
import { mergeObjects } from '@lykmapipo/common';
import { get, createHttpActionsFor } from './client';

@@ -82,3 +83,3 @@

wellknown: 'party',
params: merge({}, DEFAULT_PARAMS, {
params: mergeObjects(DEFAULT_PARAMS, {
filter: { type: 'Focal Person' },

@@ -90,3 +91,3 @@ }),

wellknown: 'party',
params: merge({}, DEFAULT_PARAMS, {
params: mergeObjects(DEFAULT_PARAMS, {
filter: { type: 'Agency' },

@@ -102,3 +103,3 @@ }),

wellknown: 'feature',
params: merge({}, DEFAULT_PARAMS, {
params: mergeObjects(DEFAULT_PARAMS, {
filter: {

@@ -114,3 +115,3 @@ nature: 'Boundary',

wellknown: 'feature',
params: merge({}, DEFAULT_PARAMS, {
params: mergeObjects(DEFAULT_PARAMS, {
filter: {

@@ -126,3 +127,3 @@ nature: 'Boundary',

wellknown: 'feature',
params: merge({}, DEFAULT_PARAMS, {
params: mergeObjects(DEFAULT_PARAMS, {
filter: {

@@ -138,3 +139,3 @@ nature: 'Boundary',

wellknown: 'feature',
params: merge({}, DEFAULT_PARAMS, {
params: mergeObjects(DEFAULT_PARAMS, {
filter: {

@@ -153,3 +154,3 @@ nature: 'Building',

wellknown: 'predefine',
params: merge({}, DEFAULT_PARAMS, {
params: mergeObjects(DEFAULT_PARAMS, {
filter: { namespace: 'ItemUnit', key: 'unit' },

@@ -161,3 +162,3 @@ }),

wellknown: 'predefine',
params: merge({}, DEFAULT_PARAMS, {
params: mergeObjects(DEFAULT_PARAMS, {
filter: { namespace: 'ItemCategory', key: 'category' },

@@ -178,4 +179,3 @@ }),

*/
export const SHORTCUTS = merge(
{},
export const SHORTCUTS = mergeObjects(
FEATURE_SHORTCUTS,

@@ -198,3 +198,3 @@ PARTY_SHORTCUTS,

*/
export const RESOURCES = merge({}, SHORTCUTS);
export const RESOURCES = mergeObjects(SHORTCUTS);

@@ -205,3 +205,3 @@ // build wellknown resources

const shortcut = clone(wellknown);
const params = merge({}, DEFAULT_PARAMS);
const params = mergeObjects(DEFAULT_PARAMS);
const resource = { shortcut, wellknown, params };

@@ -208,0 +208,0 @@ RESOURCES[name] = resource;

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