server/api/services/endorser.db.service.js
/**
     Start from afterIdInput (defaults to '0') and retrieve all claims by issuerDid with claimTypes.
     Note that this works in chronological order.
  **/
Start from afterIdInput (defaults to '0') and retrieve all claims by issuerDid with claimTypes.
Note that this works in chronological order.
Start from afterIdInput ( defaults to ' 0 ' ) and retrieve all claims by issuerDid with claimTypes . Note that this works in chronological order .
allIssuerClaimTypesPaged(issuerDid, claimTypes, afterIdInput) {
    return new Promise((resolve, reject) => {
      const afterId = afterIdInput || '0'
      const inListStr = claimTypes.map(value => "?").join(',')
      const params = [afterId, issuerDid].concat(claimTypes)
      let data = []
      let rowErr
      db.each(
        "SELECT id, issuedAt, issuer, subject, claimContext, claimType, claim, hashHex, hashChainHex FROM jwt WHERE id > ? AND issuer = ? AND claimType in (" + inListStr + ") ORDER BY id LIMIT " + DEFAULT_LIMIT,
        params,
        function(err, row) {
          if (err) {
            rowErr = err
          } else {
            row.issuedAt = isoAndZonify(row.issuedAt)
            data.push({id:row.id, issuedAt:row.issuedAt, issuer:row.issuer, subject:row.subject, claimContext:row.claimContext, claimType:row.claimType, claim:row.claim, hashHex:row.hashHex, hashChainHex:row.hashChainHex})
          }
        },
        function(allErr, num) {
          if (rowErr || allErr) {
            reject(rowErr || allErr)
          } else {
            const result = { data: data }
            if (num === DEFAULT_LIMIT) {
              result["maybeMoreAfter"] = data[data.length - 1].id;
            }
            resolve(result)
          }
        }
      )
    })
  }
allIssuerClaimTypesPaged ( issuerDid , claimTypes , afterIdInput ) { return new Promise ( ( resolve , reject ) => { const afterId = afterIdInput || '0' const inListStr = claimTypes . map ( value => "?" ) . join ( ',' ) const params = [ afterId , issuerDid ] . concat ( claimTypes ) let data = [ ] let rowErr db . each ( "SELECT id, issuedAt, issuer, subject, claimContext, claimType, claim, hashHex, hashChainHex FROM jwt WHERE id > ? AND issuer = ? AND claimType in (" + inListStr + ") ORDER BY id LIMIT " + DEFAULT_LIMIT , params , function ( err , row ) { if ( err ) { rowErr = err } else { row . issuedAt = isoAndZonify ( row . issuedAt ) data . push ( { id : row . id , issuedAt : row . issuedAt , issuer : row . issuer , subject : row . subject , claimContext : row . claimContext , claimType : row . claimType , claim : row . claim , hashHex : row . hashHex , hashChainHex : row . hashChainHex } ) } } , function ( allErr , num ) { if ( rowErr || allErr ) { reject ( rowErr || allErr ) } else { const result = { data : data } if ( num === DEFAULT_LIMIT ) { result [ "maybeMoreAfter" ] = data [ data . length - 1 ] . id ; } resolve ( result ) } } ) } ) }
Start from afterIdInput (defaults to '0') and retrieve all claims by issuerDid with claimTypes.
Start from afterIdInput ( defaults to ' 0 ' ) and retrieve all claims by issuerDid with claimTypes .