@powerhousedao/renown-package 1.0.1-staging.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../processors/renown-credential/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,2BAA2B,EAChC,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../processors/renown-credential/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,2BAA2B,EAChC,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,aAAa,CAAC;AAMtC,MAAM,WAAW,QAAQ;IACvB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtD;AAED,qBAAa,yBAA0B,SAAQ,qBAAqB,CAAC,EAAE,CAAC;IACtE,OAAO,CAAC,OAAO,CAAC,CAAW;gBAGzB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,2BAA2B,EACnC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC,EAC/B,OAAO,CAAC,EAAE,QAAQ;WASJ,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAStC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ/B,SAAS,CACtB,OAAO,EAAE,yBAAyB,EAAE,GACnC,OAAO,CAAC,IAAI,CAAC;IA8KV,YAAY;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-read-model/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAwJ5D,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-read-model/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAwJ5D,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAmJxE,CAAC"}
|
|
@@ -95,22 +95,16 @@ export const getResolvers = (subgraph) => {
|
|
|
95
95
|
renownCredentials: async (parent, args) => {
|
|
96
96
|
const { driveId, ethAddress, did, issuer, includeRevoked = true, } = args.input;
|
|
97
97
|
let query = RenownCredentialProcessor.query("renown-credential", db).selectFrom("renown_credential");
|
|
98
|
-
//
|
|
99
|
-
if (ethAddress
|
|
100
|
-
query = query.where((eb) =>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (did) {
|
|
109
|
-
// Search for DID in credential_subject_id (case-insensitive)
|
|
110
|
-
conditions.push(eb(eb.fn("LOWER", ["renown_credential.credential_subject_id"]), "like", `%${did.toLowerCase()}%`));
|
|
111
|
-
}
|
|
112
|
-
return eb.or(conditions);
|
|
113
|
-
});
|
|
98
|
+
// Filter by ethAddress in issuer or proof fields
|
|
99
|
+
if (ethAddress) {
|
|
100
|
+
query = query.where((eb) => eb.and([
|
|
101
|
+
eb(eb.fn("LOWER", ["renown_credential.issuer_ethereum_address"]), "=", ethAddress.toLowerCase()),
|
|
102
|
+
eb(eb.fn("LOWER", ["renown_credential.proof_ethereum_address"]), "=", ethAddress.toLowerCase()),
|
|
103
|
+
]));
|
|
104
|
+
}
|
|
105
|
+
// Filter by app DID in credential_subject_id
|
|
106
|
+
if (did) {
|
|
107
|
+
query = query.where("renown_credential.credential_subject_id", "=", did);
|
|
114
108
|
}
|
|
115
109
|
// Filter by issuer if provided
|
|
116
110
|
if (issuer) {
|
package/package.json
CHANGED