# navision-proxy-api

> Api for alex andersen web apps.

Latest version **1.7.7** (published 2023-11-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install navision-proxy-api
pnpm add navision-proxy-api
yarn add navision-proxy-api
bun add navision-proxy-api
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.7 |
| Published | 2023-11-08 |
| First published | 2023-11-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 49 |
| Unpacked size | 43.9 KB |
| Known vulnerabilities | 0 (+27 in 3 direct dependencies) |
| Install scripts | no |
| Author | StasKarpov |
| Maintainers | alex-andersen |

## Links

- npm: https://www.npmjs.com/package/navision-proxy-api
- Repository: git@ssh.dev.azure.com:v3/alex-andersen/Feedback%20app/FeedbackShipmentsApi
- npm.io page: https://npm.io/package/navision-proxy-api

## Dependencies (49)

- [add](https://npm.io/package/add.md) ^2.0.6
- [esm](https://npm.io/package/esm.md) ^3.2.25
- [koa](https://npm.io/package/koa.md) ^2.11.0
- [soap](https://npm.io/package/soap.md) ^0.31.0
- [yarn](https://npm.io/package/yarn.md) ^1.22.19
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [dotenv](https://npm.io/package/dotenv.md) ^10.0.0
- [koa-qs](https://npm.io/package/koa-qs.md) ^3.0.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.19
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [koa-jwt](https://npm.io/package/koa-jwt.md) ^4.0.3
- [nodemon](https://npm.io/package/nodemon.md) ^2.0.3
- [typedoc](https://npm.io/package/typedoc.md) ^0.23.28
- [winston](https://npm.io/package/winston.md) ^3.3.3
- [httpntlm](https://npm.io/package/httpntlm.md) ^1.7.6
- [koa-body](https://npm.io/package/koa-body.md) ^4.2.0
- [koa-cash](https://npm.io/package/koa-cash.md) ^4.1.1
- [mongoose](https://npm.io/package/mongoose.md) ^6.2.4
- [@koa/cors](https://npm.io/package/@koa/cors.md) ^2.2.3
- [cross-env](https://npm.io/package/cross-env.md) ^7.0.3
- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1
- [form-data](https://npm.io/package/form-data.md) ^3.0.0
- [koa-proxy](https://npm.io/package/koa-proxy.md) ^1.0.0-alpha.3
- [lru-cache](https://npm.io/package/lru-cache.md) ^7.10.1
- [node-cron](https://npm.io/package/node-cron.md) ^2.0.3
- [axios-ntlm](https://npm.io/package/axios-ntlm.md) ^1.3.0
- [koa-logger](https://npm.io/package/koa-logger.md) ^3.2.1
- [koa-multer](https://npm.io/package/koa-multer.md) ^1.0.2
- [koa-router](https://npm.io/package/koa-router.md) ^8.0.8
- [koa-sslify](https://npm.io/package/koa-sslify.md) ^4.0.3
- [koa-static](https://npm.io/package/koa-static.md) ^5.0.0
- [koa-unless](https://npm.io/package/koa-unless.md) ^1.0.7
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0
- [typescript](https://npm.io/package/typescript.md) ^4.6.4
- [axios-retry](https://npm.io/package/axios-retry.md) ^3.3.1
- [koa-compose](https://npm.io/package/koa-compose.md) ^4.1.0
- [strong-soap](https://npm.io/package/strong-soap.md) ^2.0.0
- [dtsgenerator](https://npm.io/package/dtsgenerator.md) ^3.15.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^5.8.38
- [@types/express](https://npm.io/package/@types/express.md) ^4.17.13
- [koa-bodyparser](https://npm.io/package/koa-bodyparser.md) ^4.3.0
- [to-json-schema](https://npm.io/package/to-json-schema.md) ^0.2.5
- [koa2-swagger-ui](https://npm.io/package/koa2-swagger-ui.md) ^4.0.1
- [moment-timezone](https://npm.io/package/moment-timezone.md) ^0.5.33
- [@types/crypto-js](https://npm.io/package/@types/crypto-js.md) ^4.1.2
- [koa-request-logger](https://npm.io/package/koa-request-logger.md) ^1.2.0
- [@types/koa-bodyparser](https://npm.io/package/@types/koa-bodyparser.md) ^4.3.10
- [mongoose-schema-jsonschema](https://npm.io/package/mongoose-schema-jsonschema.md) ^2.0.2

## Recent versions

- 1.7.7 (latest) — 2023-11-08
- 1.7.6 — 2023-11-08

## README

# Introduction

Navision proxy api for both SOAP and REST navision clients.

Currently typescript version is available for bookings api. Bookings api is used for Webook app. API stores data about users, quick forms, bookings templates. Also it fetches and extends data from navision api.

Also this API have endpoints for terminal app (data about loads in vehicles) and for parking app (vehicles and drivers data) which was put on hold.

# Getting Started

You can find full application documentation in `docs/index.html` file.

There is an API documentation in `/docs/modules/lib_api_booking.html` file.

Install node dependencies with `npm install` and than you can run API with `npm start` command.

# Migrations

If you changing models you probably will need to create migration to make sure old data fit new models. You can find examples of migrations in `lib/db/migrations` folder. To run migration run `export NODE_ENV=development` or `export NODE_ENV=production` and then `node --experimental-specifier-resolution=node --loader ts-node/esm ./lib/db/migrations/<NAME_OF_MIGRATION>.js`

# Local Development

1. To local develop a project you need to provide an access to mongodb.

a) You would need to create a tunel to AWS EC2 instance where the you can get an access to development document db. To do so run `ssh -i ec2.pem -f  -N -L 27017:localhost:27017 ec2-user@34.241.130.126`

b) Alternatively you can work with your local instance. You can do it with `mongod --fork --syslog --dbpath lib/db/`. Than you will also have to customise MONGO_DB_OPTIONS in lib/config.ts for your mongo client.

2. When importing modules you always should use .js endings for files. TODO: setup this as a linter rule
   When developing localy you should first run the mongo db with `npm run start-mongo` and after run project with `npm run start:local`. Also you haave to be inside AA VPN.

When importing modules you always should use .js endings for files. TODO: setup this as a linter rule

https://stackoverflow.com/questions/62619058/appending-js-extension-on-relative-import-statements-during-typescript-compilat

# Publishing

This app is stored as a package on Azure. In order to publish changes in types so it can be recognized in depending apps app needs to be authentificated. See https://dev.azure.com/alex-andersen/Alex%20Andersen/_artifacts/feed/navision-proxy-api/connect/npm. When you want to publish package update you need to run `npm version patch|minor|major` and than `npm publish`

# Common issues

## `Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'ts-node'`

Dev dependecies not installed - switch to NODE_ENV=local or NODE_ENV=production

## `Invalid XML`

Some unknown soap packaging issues.
Should work with package-lock.json from commit ced87c33

---
_Source: https://npm.io/package/navision-proxy-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
