Skip to content

Commit d07ebf8

Browse files
committed
nodejs - issuerCreateCredential optional reader handle, and 0.2.5
Signed-off-by: Matthew Wright <[email protected]>
1 parent e094217 commit d07ebf8

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

wrappers/nodejs/codegen/api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
{"name": "cred_req_json", "type": "const char*", "json": true},
139139
{"name": "cred_values_json", "type": "const char*", "json": true},
140140
{"name": "rev_reg_id", "type": "const char*"},
141-
{"name": "blob_storage_reader_handle", "type": "indy_i32_t"},
141+
{"name": "blob_storage_reader_handle", "type": "indy_i32_t", "optional": true},
142142
{
143143
"name": "cb",
144144
"params": [

wrappers/nodejs/codegen/hParser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ api.functions.indy_parse_get_revoc_reg_delta_response.params[1].json = true
240240
api.functions.indy_parse_get_revoc_reg_response.params[1].json = true
241241
api.functions.indy_parse_get_schema_response.params[1].json = true
242242
api.functions.indy_build_revoc_reg_def_request.params[2].json = true
243+
api.functions.indy_issuer_create_credential.params[6].optional = true
243244

244245
api.functions.indy_build_get_revoc_reg_delta_request.params[3].timestamp = true
245246
api.functions.indy_build_get_revoc_reg_delta_request.params[4].timestamp = true

wrappers/nodejs/codegen/js.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ apiFunctions.forEach(function (fn) {
6969
fn.jsParams.forEach(function (arg) {
7070
if (arg.json) {
7171
js += 'toJson(' + arg.jsName + '), '
72+
} else if (arg.optional && arg.type === 'indy_i32_t') {
73+
js += arg.jsName + ' == null ? -1 : ' + arg.jsName + ', '
7274
} else {
7375
js += arg.jsName + ', '
7476
}

wrappers/nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "indy-sdk",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "Native bindings for hyperledger indy",
55
"author": "hyperledger",
66
"license": "Apache-2.0",

wrappers/nodejs/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ indy.issuerCreateCredential = function issuerCreateCredential (wh, credOffer, cr
6161
cb = wrapIndyCallback(cb, function (data) {
6262
return [fromJson(data[0]), data[1], fromJson(data[2])]
6363
})
64-
capi.issuerCreateCredential(wh, toJson(credOffer), toJson(credReq), toJson(credValues), revRegId, blobStorageReaderHandle, cb)
64+
capi.issuerCreateCredential(wh, toJson(credOffer), toJson(credReq), toJson(credValues), revRegId, blobStorageReaderHandle == null ? -1 : blobStorageReaderHandle, cb)
6565
return cb.promise
6666
}
6767

0 commit comments

Comments
 (0)