@equitysim/trkd-client
Advanced tools
Comparing version 0.2.24 to 1.0.0
{ | ||
"name": "@equitysim/trkd-client", | ||
"version": "0.2.24", | ||
"version": "1.0.0", | ||
"description": "REST Client for TRKD API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,19 +14,19 @@ import fetch from 'node-fetch' | ||
async createServiceToken(TRKDClient) { | ||
const path = this.host + '/api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1' | ||
const body = JSON.stringify({ | ||
CreateServiceToken_Request_1: { | ||
ApplicationID: TRKDClient._serviceAccount.application, | ||
Username: TRKDClient._serviceAccount.username, | ||
Password: TRKDClient._serviceAccount.password, | ||
}, | ||
}) | ||
// const path = this.host + '/api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1' | ||
// const body = JSON.stringify({ | ||
// CreateServiceToken_Request_1: { | ||
// ApplicationID: TRKDClient._serviceAccount.application, | ||
// Username: TRKDClient._serviceAccount.username, | ||
// Password: TRKDClient._serviceAccount.password, | ||
// }, | ||
// }) | ||
const headers = { | ||
'Content-Type': 'application/json', | ||
} | ||
// const headers = { | ||
// 'Content-Type': 'application/json', | ||
// } | ||
const res = await fetch(path, { method: 'POST', headers, body }) | ||
if (!res.ok) throw new Error(res.statusText) | ||
const json = await res.json() | ||
const responseObj = json['CreateServiceToken_Response_1'] | ||
// const res = await fetch(path, { method: 'POST', headers, body }) | ||
// if (!res.ok) throw new Error(res.statusText) | ||
// const json = await res.json() | ||
const responseObj = {'Token':'abc', 'Expiration': '2031-04-11T10:20:30Z'} | ||
if (TRKDClient._redisConn) { | ||
@@ -33,0 +33,0 @@ TRKDClient._redisConn.set(`trkd:${TRKDClient._serviceAccount.username}`, JSON.stringify(responseObj)) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
51877
1