1.1.28 • Published 2 years ago

statotest-api-requests v1.1.28

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Statotest API requests

This library is mainly for restricted usage by company Statotest s.r.o.

It contains almost every API call for different Statotest's APIs - Output API, Input API, Notification API, GetImage API.

Everything is in Typescript => all necessary types of API responses are included.

Whenever you work on a JavaScript/TypeScript project where API requests are send to one of our API's => use this library, for better management of request in the future.

Installation

Standard node module installation.

npm install statotest-api-requests

Or if you are using Yarn

yarn add statotest-api-requests

Usage

Before using any of the requets => set API URLs and Tokens:

import { initAPIVariables } from 'statotest-api-requests/dist/helper'
initAPIVariables(OUTPUT_API_URL, optionalVariables = {});

OUTPUT_API_URL: string,

Object optionalVariables can have these optional values.

API_OUTPUT_EXPORT_TOKEN?: string - for using getExport

FUNCTION_GET_IMAGE?: string - for using getImage

Set method for retrieving authentication (Bearer) token

import { setMethodForRetrievingToken } from 'statotest-api-requests/lib/helper'
setMethodForRetrievingToken(getTokenMethod: () Promise<string> | string); 

getTokenMethod => returns Promise<string> or string

e.g. Browser => returns values stored in localStorage, Cookies...

e.g. Smartphone => retuns value stored in AsyncStorage...

List of self-explanatory methods for almost every endpoint of our API

OutputAPI

Account

MethodEndpointrequestFunction
POSTAccounts/authenticateauthenticate
GETAccountsgetAccounts
POSTAccountscreateAccount
PUTAccountsputAccount
POSTAccounts/forgot-passwordforgotPassword (doesn't work)
POSTAccounts/refresh-tokenrefreshToken (doesn't work)
POSTAccounts/revoke-tokenrevokeToken (doesn't work)

Company

MethodEndpointrequestFunction
POSTCompany/GetgetCompany
POSTCompany/AddaddCompany
POSTCompany/UpdupdateCompany
PUTCompany/RemremoveCompany

Permissions Company

MethodEndpointrequestFunction
POSTPermissionsCompany/getCompUsersgetCompanyPermissionsCompanyUsers
POSTPermissionsCompany/addCompUseraddCompanyPermissionsUser
POSTPermissionsCompany/UpdCompUserupdateCompanyPermissionsUser
POSTPermissionsCompany/remCompUserremoveCompanyPermissionsUser

Construction

MethodEndpointrequestFunction
POSTConstructions/GetgetConstructions
POSTConstructions/addaddConstruction
POSTConstructions/remremoveConstruction
POSTConstructions/UpdupdateConstruction
PUTConstructions/Img/AddaddConstructionImages

DataOutput

MethodEndpointrequestFunction
POSTDataOutput/GetDataTypegetDataTypes
POSTDataOutput/GetMeasuregetMeasure
POSTDataOutput/ExportDatagetExport
POSTDataOutput/getDataOutputDataupdateConstruction

DataOutput Types:

const dataOutputTypes = {
    0: "/DataOutput/getdevice",
    1: "/DataOutput/getaccelero",
    2: "/DataOutput/getinclino",
    3: "/DataOutput/getmeteo",
    4: "/DataOutput/getenvironment",
    5: "/DataOutput/getvoltage",
    6: "/DataOutput/getraw",
    7: "/DataOutput/getstate",
    8: "/DataOutput/GetStrain",
    9: "/DataOutput/GetCoordinateLocal",
    10: "/DataOutput/GetCoordinateJTSK",
    99: "/DataOutput/GetUnit",
    100: "/MP/Dev/get",
};

Device

MethodEndpointrequestFunction
POSTMP/Dev/GetgetMeasurePointsDev
POSTMP/Dev/addaddMeasurePointDev
POSTMP/Dev/remremoveMeasurePointDev
POSTMP/Dev/GetAvailablegetCompanyAvailableDevices
POSTCompany/Dev/DashBoardgetDevicesDashboard
POSTCompany/Dev/GetgetCompanyDevices
POSTCompany/Dev/GetAvailabelgetAllCompaniesAvailableDevices
POSTCompany/Dev/RegregisterDeviceToComp
POSTCompany/Dev/UnRegunregisterDeviceFromComp
POSTDevice/AddpostCreateDevice

Measurepoint

MethodEndpointrequestFunction
POSTMP/getgetMeasurePoints
POSTMP/addaddMeasurePoint
POSTMP/remremoveMeasurePoint
POSTMP/UpdupdateMeasurePoint
POSTMP/Img/Add?uploadMeasurePointImage

Updates

Whenever change is needed => write me an email to kramar@statotest.com

License

Proprietary

1.1.28

2 years ago

1.1.27

2 years ago

1.1.26

2 years ago

1.1.25

2 years ago

1.1.24

2 years ago

1.1.23

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.20

2 years ago

1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago