hc-service-client
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -107,2 +107,5 @@ 'use strict'; | ||
// set `nestedQuerystring` to true if it's null or undefined. see https://github.com/node-modules/urllib/tree/677e2ef90b3c0e0f26889696ca6eb88e2c4f5ded#arguments | ||
options.nestedQuerystring = _.isNil(options.nestedQuerystring) ? true : !!options.nestedQuerystring; | ||
// get data content from stream promise | ||
@@ -109,0 +112,0 @@ const getSteamData = new Promise(function (resolve) { |
{ | ||
"name": "hc-service-client", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Service Client Extension for Honeybee", | ||
@@ -22,3 +22,3 @@ "main": "index.js", | ||
"qs": "6.4.0", | ||
"urllib": "2.21.2" | ||
"urllib": "2.26.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "devDependencies": { |
@@ -19,3 +19,3 @@ 'use strict'; | ||
dtboost: { | ||
endpoint: 'http://10.189.225.91', | ||
endpoint: 'http://10.125.25.106', | ||
token: 'a6be75f05b681c633465276910c5a994', | ||
@@ -25,3 +25,3 @@ extension: ['otm'] | ||
system: { | ||
endpoint: 'http://10.189.225.91:8000', | ||
endpoint: 'http://10.125.25.106:8000', | ||
token: 'a6be75f05b681c633465276910c5a994' | ||
@@ -28,0 +28,0 @@ }, |
@@ -43,3 +43,3 @@ 'use strict'; | ||
endpoint: services.dtboost.endpoint, | ||
accessKeyId: 'serviceClientTest', | ||
accessKeyId: 'dtboost-system', | ||
accessKeySecret: config.systemToken, | ||
@@ -184,3 +184,3 @@ headers: { | ||
debug('request with href', err, body); | ||
assert(body); | ||
assert(!err); | ||
done(); | ||
@@ -198,2 +198,3 @@ }); | ||
client.post('/service/otm/api/v2/objects', {}, function (err) { | ||
debug(arguments); | ||
assert(err); | ||
@@ -204,2 +205,54 @@ assert(err.code = 'OTM_ILLEGAL_PARAMETER'); | ||
}); | ||
it('urllib should use qs to stringify querystring.', function (done) { | ||
const client = new ServiceClient({ | ||
endpoint: services.azk.endpoint, | ||
accessKeyId: config.accessKeyId, | ||
accessKeySecret: services.azk.accessKeySecret, | ||
headers: { | ||
'EagleEye-TraceId': '123456', | ||
'X-ScopeId': config.tenantCode, | ||
'X-Operator': config.userId, | ||
'X-Work-App': config.workApp | ||
} | ||
}); | ||
client.get('/alg/categories', { | ||
scopeId: 'dtboost', | ||
isPrivate: true, | ||
referType: 'DEFINE', | ||
tenant: config.tenantCode, | ||
a: [1, 2, 3] | ||
}, function (err, body) { | ||
// debug('azk service success', err, body); | ||
assert(body); | ||
done(); | ||
}); | ||
}); | ||
it('urllib should use querystring to signature occur error.', function (done) { | ||
const client = new ServiceClient({ | ||
endpoint: services.azk.endpoint, | ||
accessKeyId: config.accessKeyId, | ||
accessKeySecret: services.azk.accessKeySecret, | ||
headers: { | ||
'EagleEye-TraceId': '123456', | ||
'X-ScopeId': config.tenantCode, | ||
'X-Operator': config.userId, | ||
'X-Work-App': config.workApp | ||
} | ||
}); | ||
client.get('/alg/categories', { | ||
scopeId: 'dtboost', | ||
isPrivate: true, | ||
referType: 'DEFINE', | ||
tenant: config.tenantCode, | ||
a: [1, 2, 3] | ||
}, { | ||
nestedQuerystring: false | ||
}, function (err, body) { | ||
// debug('azk service error', err, body); | ||
assert(err.code, 'AZK-AUTHC-ERROR'); | ||
done(); | ||
}); | ||
}); | ||
}); |
41774
844
+ Addedagent-base@4.3.0(transitive)
+ Addedast-types@0.16.1(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedco@4.6.0(transitive)
+ Addedcopy-to@2.0.1(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddata-uri-to-buffer@1.2.0(transitive)
+ Addeddebug@3.1.03.2.7(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addeddegenerator@1.0.4(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addedes6-promise@4.2.8(transitive)
+ Addedes6-promisify@5.0.0(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedesprima@3.1.34.0.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextend-shallow@2.0.1(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedftp@0.3.10(transitive)
+ Addedget-uri@2.0.4(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedhttp-proxy-agent@2.1.0(transitive)
+ Addedhttps-proxy-agent@2.2.4(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedip@1.1.9(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedisarray@0.0.11.0.0(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedmz@2.7.0(transitive)
+ Addednetmask@1.0.6(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedpac-proxy-agent@2.0.2(transitive)
+ Addedpac-resolver@3.0.0(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedproxy-agent@2.3.1(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedreadable-stream@1.1.142.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedsmart-buffer@1.1.15(transitive)
+ Addedsocks@1.1.10(transitive)
+ Addedsocks-proxy-agent@3.0.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedstring_decoder@0.10.311.1.1(transitive)
+ Addedthenify@3.3.1(transitive)
+ Addedthenify-all@1.6.0(transitive)
+ Addedthunkify@2.1.2(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedunescape@1.0.1(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addedurllib@2.26.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedutility@1.18.0(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedxregexp@2.0.0(transitive)
+ Addedyallist@2.1.2(transitive)
- Removedurllib@2.21.2(transitive)
Updatedurllib@2.26.0