@powerhousedao/renown-package 0.0.30 → 0.0.32
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.
- package/dist/document-models/index.d.ts +1 -0
- package/dist/document-models/index.d.ts.map +1 -0
- package/dist/document-models/index.js +1 -0
- package/dist/document-models/renown-credential/gen/actions.d.ts +1 -0
- package/dist/document-models/renown-credential/gen/actions.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/creators.d.ts +1 -0
- package/dist/document-models/renown-credential/gen/creators.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/document-model.d.ts +3 -2
- package/dist/document-models/renown-credential/gen/document-model.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/document-model.js +3 -59
- package/dist/document-models/renown-credential/gen/index.d.ts +1 -2
- package/dist/document-models/renown-credential/gen/index.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/index.js +0 -1
- package/dist/document-models/renown-credential/gen/manager/actions.d.ts +3 -14
- package/dist/document-models/renown-credential/gen/manager/actions.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/manager/actions.js +1 -1
- package/dist/document-models/renown-credential/gen/manager/creators.d.ts +3 -5
- package/dist/document-models/renown-credential/gen/manager/creators.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/manager/creators.js +3 -5
- package/dist/document-models/renown-credential/gen/manager/error.d.ts +2 -16
- package/dist/document-models/renown-credential/gen/manager/error.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/manager/error.js +0 -19
- package/dist/document-models/renown-credential/gen/manager/operations.d.ts +2 -4
- package/dist/document-models/renown-credential/gen/manager/operations.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/manager/operations.js +3 -1
- package/dist/document-models/renown-credential/gen/ph-factories.d.ts +7 -10
- package/dist/document-models/renown-credential/gen/ph-factories.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/ph-factories.js +23 -13
- package/dist/document-models/renown-credential/gen/reducer.d.ts +3 -2
- package/dist/document-models/renown-credential/gen/reducer.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/reducer.js +1 -16
- package/dist/document-models/renown-credential/gen/schema/index.d.ts +1 -0
- package/dist/document-models/renown-credential/gen/schema/index.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/schema/types.d.ts +83 -115
- package/dist/document-models/renown-credential/gen/schema/types.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/schema/zod.d.ts +15 -4
- package/dist/document-models/renown-credential/gen/schema/zod.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/schema/zod.js +129 -33
- package/dist/document-models/renown-credential/gen/types.d.ts +10 -6
- package/dist/document-models/renown-credential/gen/types.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/types.js +1 -0
- package/dist/document-models/renown-credential/gen/utils.d.ts +10 -19
- package/dist/document-models/renown-credential/gen/utils.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/utils.js +48 -43
- package/dist/document-models/renown-credential/index.d.ts +13 -9
- package/dist/document-models/renown-credential/index.d.ts.map +1 -0
- package/dist/document-models/renown-credential/index.js +4 -3
- package/dist/document-models/renown-credential/src/reducers/manager.d.ts +1 -0
- package/dist/document-models/renown-credential/src/reducers/manager.d.ts.map +1 -0
- package/dist/document-models/renown-credential/src/reducers/manager.js +46 -108
- package/dist/document-models/renown-credential/src/tests/document-model.test.d.ts +1 -0
- package/dist/document-models/renown-credential/src/tests/document-model.test.d.ts.map +1 -0
- package/dist/document-models/renown-credential/src/tests/document-model.test.js +1 -1
- package/dist/document-models/renown-credential/src/tests/manager.test.d.ts +1 -0
- package/dist/document-models/renown-credential/src/tests/manager.test.d.ts.map +1 -0
- package/dist/document-models/renown-credential/src/utils.d.ts +1 -0
- package/dist/document-models/renown-credential/src/utils.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/actions.d.ts +1 -0
- package/dist/document-models/renown-user/gen/actions.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/creators.d.ts +1 -0
- package/dist/document-models/renown-user/gen/creators.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/document-model.d.ts +3 -2
- package/dist/document-models/renown-user/gen/document-model.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/index.d.ts +1 -2
- package/dist/document-models/renown-user/gen/index.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/index.js +0 -1
- package/dist/document-models/renown-user/gen/ph-factories.d.ts +7 -10
- package/dist/document-models/renown-user/gen/ph-factories.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/ph-factories.js +1 -4
- package/dist/document-models/renown-user/gen/profile/actions.d.ts +1 -0
- package/dist/document-models/renown-user/gen/profile/actions.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/profile/actions.js +1 -1
- package/dist/document-models/renown-user/gen/profile/creators.d.ts +1 -0
- package/dist/document-models/renown-user/gen/profile/creators.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/profile/creators.js +2 -1
- package/dist/document-models/renown-user/gen/profile/error.d.ts +1 -0
- package/dist/document-models/renown-user/gen/profile/error.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/profile/operations.d.ts +1 -0
- package/dist/document-models/renown-user/gen/profile/operations.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/profile/operations.js +3 -1
- package/dist/document-models/renown-user/gen/reducer.d.ts +3 -2
- package/dist/document-models/renown-user/gen/reducer.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/reducer.js +1 -4
- package/dist/document-models/renown-user/gen/schema/index.d.ts +1 -0
- package/dist/document-models/renown-user/gen/schema/index.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/schema/types.d.ts +1 -0
- package/dist/document-models/renown-user/gen/schema/types.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/schema/zod.d.ts +1 -0
- package/dist/document-models/renown-user/gen/schema/zod.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/types.d.ts +10 -6
- package/dist/document-models/renown-user/gen/types.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/types.js +1 -0
- package/dist/document-models/renown-user/gen/utils.d.ts +10 -19
- package/dist/document-models/renown-user/gen/utils.d.ts.map +1 -0
- package/dist/document-models/renown-user/gen/utils.js +26 -34
- package/dist/document-models/renown-user/index.d.ts +14 -7
- package/dist/document-models/renown-user/index.d.ts.map +1 -0
- package/dist/document-models/renown-user/index.js +4 -3
- package/dist/document-models/renown-user/src/reducers/profile.d.ts +1 -0
- package/dist/document-models/renown-user/src/reducers/profile.d.ts.map +1 -0
- package/dist/document-models/renown-user/src/tests/document-model.test.d.ts +1 -0
- package/dist/document-models/renown-user/src/tests/document-model.test.d.ts.map +1 -0
- package/dist/document-models/renown-user/src/tests/document-model.test.js +1 -1
- package/dist/document-models/renown-user/src/tests/profile.test.d.ts +1 -0
- package/dist/document-models/renown-user/src/tests/profile.test.d.ts.map +1 -0
- package/dist/document-models/renown-user/src/utils.d.ts +1 -0
- package/dist/document-models/renown-user/src/utils.d.ts.map +1 -0
- package/dist/editors/hooks/useRenownCredentialDocument.d.ts +1 -0
- package/dist/editors/hooks/useRenownCredentialDocument.d.ts.map +1 -0
- package/dist/editors/hooks/useRenownUserDocument.d.ts +1 -0
- package/dist/editors/hooks/useRenownUserDocument.d.ts.map +1 -0
- package/dist/editors/index.d.ts +1 -0
- package/dist/editors/index.d.ts.map +1 -0
- package/dist/editors/index.js +1 -0
- package/dist/editors/renown-credential-editor/editor.d.ts +1 -0
- package/dist/editors/renown-credential-editor/editor.d.ts.map +1 -0
- package/dist/editors/renown-credential-editor/editor.js +7 -71
- package/dist/editors/renown-credential-editor/index.d.ts +1 -0
- package/dist/editors/renown-credential-editor/index.d.ts.map +1 -0
- package/dist/editors/renown-credential-editor/index.js +1 -3
- package/dist/editors/renown-user-editor/editor.d.ts +1 -0
- package/dist/editors/renown-user-editor/editor.d.ts.map +1 -0
- package/dist/editors/renown-user-editor/editor.js +1 -1
- package/dist/editors/renown-user-editor/index.d.ts +1 -0
- package/dist/editors/renown-user-editor/index.d.ts.map +1 -0
- package/dist/editors/renown-user-editor/index.js +1 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/processors/factory.d.ts +4 -2
- package/dist/processors/factory.d.ts.map +1 -0
- package/dist/processors/factory.js +4 -0
- package/dist/processors/index.d.ts +2 -0
- package/dist/processors/index.d.ts.map +1 -0
- package/dist/processors/index.js +2 -0
- package/dist/processors/renown-credential/factory.d.ts +8 -0
- package/dist/processors/renown-credential/factory.d.ts.map +1 -0
- package/dist/processors/renown-credential/factory.js +25 -0
- package/dist/processors/renown-credential/index.d.ts +8 -2
- package/dist/processors/renown-credential/index.d.ts.map +1 -0
- package/dist/processors/renown-credential/index.js +77 -69
- package/dist/processors/renown-credential/migrations.d.ts +2 -1
- package/dist/processors/renown-credential/migrations.d.ts.map +1 -0
- package/dist/processors/renown-credential/migrations.js +53 -21
- package/dist/processors/renown-credential/schema.d.ts +19 -12
- package/dist/processors/renown-credential/schema.d.ts.map +1 -0
- package/dist/processors/renown-user/factory.d.ts +2 -1
- package/dist/processors/renown-user/factory.d.ts.map +1 -0
- package/dist/processors/renown-user/factory.js +4 -1
- package/dist/processors/renown-user/index.d.ts +3 -2
- package/dist/processors/renown-user/index.d.ts.map +1 -0
- package/dist/processors/renown-user/index.js +3 -1
- package/dist/processors/renown-user/migrations.d.ts +2 -1
- package/dist/processors/renown-user/migrations.d.ts.map +1 -0
- package/dist/processors/renown-user/migrations.js +1 -0
- package/dist/processors/renown-user/schema.d.ts +1 -0
- package/dist/processors/renown-user/schema.d.ts.map +1 -0
- package/dist/style.css +132 -17100
- package/dist/subgraphs/index.d.ts +1 -0
- package/dist/subgraphs/index.d.ts.map +1 -0
- package/dist/subgraphs/index.js +1 -0
- package/dist/subgraphs/renown-credential/index.d.ts +3 -2
- package/dist/subgraphs/renown-credential/index.d.ts.map +1 -0
- package/dist/subgraphs/renown-credential/index.js +2 -2
- package/dist/subgraphs/renown-credential/resolvers.d.ts +3 -2
- package/dist/subgraphs/renown-credential/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/renown-credential/resolvers.js +0 -36
- package/dist/subgraphs/renown-credential/schema.d.ts +1 -0
- package/dist/subgraphs/renown-credential/schema.d.ts.map +1 -0
- package/dist/subgraphs/renown-credential/schema.js +96 -47
- package/dist/subgraphs/renown-read-model/index.d.ts +3 -2
- package/dist/subgraphs/renown-read-model/index.d.ts.map +1 -0
- package/dist/subgraphs/renown-read-model/index.js +2 -2
- package/dist/subgraphs/renown-read-model/resolvers.d.ts +3 -2
- package/dist/subgraphs/renown-read-model/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/renown-read-model/resolvers.js +35 -35
- package/dist/subgraphs/renown-read-model/schema.d.ts +1 -0
- package/dist/subgraphs/renown-read-model/schema.d.ts.map +1 -0
- package/dist/subgraphs/renown-read-model/schema.js +20 -18
- package/dist/subgraphs/renown-user/index.d.ts +3 -2
- package/dist/subgraphs/renown-user/index.d.ts.map +1 -0
- package/dist/subgraphs/renown-user/index.js +2 -2
- package/dist/subgraphs/renown-user/resolvers.d.ts +3 -2
- package/dist/subgraphs/renown-user/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/renown-user/schema.d.ts +1 -0
- package/dist/subgraphs/renown-user/schema.d.ts.map +1 -0
- package/dist/vite.config.d.ts +3 -0
- package/dist/vite.config.d.ts.map +1 -0
- package/dist/vite.config.js +13 -0
- package/dist/vitest.config.d.ts +1 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/package.json +52 -39
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../subgraphs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AACV,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,uBAAuB,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,wBAAwB,MAAM,8BAA8B,CAAC"}
|
package/dist/subgraphs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseSubgraph } from "@powerhousedao/reactor-api";
|
|
2
2
|
import type { DocumentNode } from "graphql";
|
|
3
|
-
export declare class RenownCredentialSubgraph extends
|
|
3
|
+
export declare class RenownCredentialSubgraph extends BaseSubgraph {
|
|
4
4
|
name: string;
|
|
5
5
|
typeDefs: DocumentNode;
|
|
6
6
|
resolvers: Record<string, unknown>;
|
|
@@ -8,3 +8,4 @@ export declare class RenownCredentialSubgraph extends Subgraph {
|
|
|
8
8
|
onSetup(): Promise<void>;
|
|
9
9
|
onDisconnect(): Promise<void>;
|
|
10
10
|
}
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-credential/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,wBAAyB,SAAQ,YAAY;IACxD,IAAI,SAAuB;IAC3B,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseSubgraph } from "@powerhousedao/reactor-api";
|
|
2
2
|
import { schema } from "./schema.js";
|
|
3
3
|
import { getResolvers } from "./resolvers.js";
|
|
4
|
-
export class RenownCredentialSubgraph extends
|
|
4
|
+
export class RenownCredentialSubgraph extends BaseSubgraph {
|
|
5
5
|
name = "renown-credential";
|
|
6
6
|
typeDefs = schema;
|
|
7
7
|
resolvers = getResolvers(this);
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getResolvers: (subgraph:
|
|
1
|
+
import type { ISubgraph } from "@powerhousedao/reactor-api";
|
|
2
|
+
export declare const getResolvers: (subgraph: ISubgraph) => Record<string, unknown>;
|
|
3
|
+
//# sourceMappingURL=resolvers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-credential/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAU5D,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAmIxE,CAAC"}
|
|
@@ -91,42 +91,6 @@ export const getResolvers = (subgraph) => {
|
|
|
91
91
|
}
|
|
92
92
|
return true;
|
|
93
93
|
},
|
|
94
|
-
RenownCredential_updateCredentialSubject: async (_, args) => {
|
|
95
|
-
const { docId, input } = args;
|
|
96
|
-
const doc = await reactor.getDocument(docId);
|
|
97
|
-
if (!doc) {
|
|
98
|
-
throw new Error("Document not found");
|
|
99
|
-
}
|
|
100
|
-
const result = await reactor.addAction(docId, actions.updateCredentialSubject(input));
|
|
101
|
-
if (result.status !== "SUCCESS") {
|
|
102
|
-
throw new Error(result.error?.message ?? "Failed to updateCredentialSubject");
|
|
103
|
-
}
|
|
104
|
-
return true;
|
|
105
|
-
},
|
|
106
|
-
RenownCredential_setJwt: async (_, args) => {
|
|
107
|
-
const { docId, input } = args;
|
|
108
|
-
const doc = await reactor.getDocument(docId);
|
|
109
|
-
if (!doc) {
|
|
110
|
-
throw new Error("Document not found");
|
|
111
|
-
}
|
|
112
|
-
const result = await reactor.addAction(docId, actions.setJwt(input));
|
|
113
|
-
if (result.status !== "SUCCESS") {
|
|
114
|
-
throw new Error(result.error?.message ?? "Failed to setJwt");
|
|
115
|
-
}
|
|
116
|
-
return true;
|
|
117
|
-
},
|
|
118
|
-
RenownCredential_setCredentialStatus: async (_, args) => {
|
|
119
|
-
const { docId, input } = args;
|
|
120
|
-
const doc = await reactor.getDocument(docId);
|
|
121
|
-
if (!doc) {
|
|
122
|
-
throw new Error("Document not found");
|
|
123
|
-
}
|
|
124
|
-
const result = await reactor.addAction(docId, actions.setCredentialStatus(input));
|
|
125
|
-
if (result.status !== "SUCCESS") {
|
|
126
|
-
throw new Error(result.error?.message ?? "Failed to setCredentialStatus");
|
|
127
|
-
}
|
|
128
|
-
return true;
|
|
129
|
-
},
|
|
130
94
|
},
|
|
131
95
|
};
|
|
132
96
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-credential/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA2JpB,CAAC"}
|
|
@@ -3,36 +3,62 @@ export const schema = gql `
|
|
|
3
3
|
"""
|
|
4
4
|
Subgraph definition for RenownCredential (powerhouse/renown-credential)
|
|
5
5
|
"""
|
|
6
|
+
type Issuer {
|
|
7
|
+
id: String!
|
|
8
|
+
ethereumAddress: EthereumAddress!
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type CredentialSubject {
|
|
12
|
+
id: String
|
|
13
|
+
app: String!
|
|
14
|
+
name: String
|
|
15
|
+
}
|
|
16
|
+
|
|
6
17
|
type CredentialStatus {
|
|
7
18
|
id: String!
|
|
8
19
|
type: String!
|
|
9
|
-
statusPurpose: String!
|
|
10
|
-
statusListIndex: String!
|
|
11
|
-
statusListCredential: String!
|
|
12
20
|
}
|
|
13
21
|
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
type CredentialSchema {
|
|
23
|
+
id: String!
|
|
24
|
+
type: String!
|
|
25
|
+
}
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
type EIP712Domain {
|
|
28
|
+
version: String!
|
|
29
|
+
chainId: Int!
|
|
30
|
+
}
|
|
21
31
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
issuer: String
|
|
27
|
-
issuanceDate: DateTime
|
|
28
|
-
credentialSubject: String
|
|
32
|
+
type EIP712 {
|
|
33
|
+
domain: EIP712Domain!
|
|
34
|
+
primaryType: String!
|
|
35
|
+
}
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
type Proof {
|
|
38
|
+
verificationMethod: String!
|
|
39
|
+
ethereumAddress: EthereumAddress!
|
|
40
|
+
created: DateTime!
|
|
41
|
+
proofPurpose: String!
|
|
42
|
+
type: String!
|
|
43
|
+
proofValue: String!
|
|
44
|
+
eip712: EIP712!
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type RenownCredentialState {
|
|
48
|
+
"W3C VC Fields - EIP-712 Signed Verifiable Credential"
|
|
49
|
+
context: [String!]!
|
|
50
|
+
id: String!
|
|
51
|
+
type: [String!]!
|
|
52
|
+
issuer: Issuer!
|
|
53
|
+
issuanceDate: DateTime!
|
|
31
54
|
expirationDate: DateTime
|
|
55
|
+
credentialSubject: CredentialSubject!
|
|
32
56
|
credentialStatus: CredentialStatus
|
|
57
|
+
credentialSchema: CredentialSchema!
|
|
58
|
+
proof: Proof!
|
|
33
59
|
|
|
34
60
|
"Revocation tracking"
|
|
35
|
-
revoked: Boolean
|
|
61
|
+
revoked: Boolean!
|
|
36
62
|
revokedAt: DateTime
|
|
37
63
|
revocationReason: String
|
|
38
64
|
}
|
|
@@ -65,44 +91,67 @@ export const schema = gql `
|
|
|
65
91
|
docId: PHID
|
|
66
92
|
input: RenownCredential_RevokeInput
|
|
67
93
|
): Int
|
|
68
|
-
RenownCredential_updateCredentialSubject(
|
|
69
|
-
driveId: String
|
|
70
|
-
docId: PHID
|
|
71
|
-
input: RenownCredential_UpdateCredentialSubjectInput
|
|
72
|
-
): Int
|
|
73
|
-
RenownCredential_setJwt(
|
|
74
|
-
driveId: String
|
|
75
|
-
docId: PHID
|
|
76
|
-
input: RenownCredential_SetJwtInput
|
|
77
|
-
): Int
|
|
78
|
-
RenownCredential_setCredentialStatus(
|
|
79
|
-
driveId: String
|
|
80
|
-
docId: PHID
|
|
81
|
-
input: RenownCredential_SetCredentialStatusInput
|
|
82
|
-
): Int
|
|
83
94
|
}
|
|
84
95
|
|
|
85
96
|
"""
|
|
86
97
|
Module: Manager
|
|
87
98
|
"""
|
|
99
|
+
input IssuerInput {
|
|
100
|
+
id: String!
|
|
101
|
+
ethereumAddress: EthereumAddress!
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
input CredentialSubjectInput {
|
|
105
|
+
id: String
|
|
106
|
+
app: String!
|
|
107
|
+
name: String
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
input CredentialStatusInput {
|
|
111
|
+
id: String!
|
|
112
|
+
type: String!
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
input CredentialSchemaInput {
|
|
116
|
+
id: String!
|
|
117
|
+
type: String!
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
input EIP712DomainInput {
|
|
121
|
+
version: String!
|
|
122
|
+
chainId: Int!
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
input EIP712Input {
|
|
126
|
+
domain: EIP712DomainInput!
|
|
127
|
+
primaryType: String!
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
input ProofInput {
|
|
131
|
+
verificationMethod: String!
|
|
132
|
+
ethereumAddress: EthereumAddress!
|
|
133
|
+
created: DateTime!
|
|
134
|
+
proofPurpose: String!
|
|
135
|
+
type: String!
|
|
136
|
+
proofValue: String!
|
|
137
|
+
eip712: EIP712Input!
|
|
138
|
+
}
|
|
139
|
+
|
|
88
140
|
input RenownCredential_InitInput {
|
|
89
|
-
|
|
141
|
+
context: [String!]!
|
|
142
|
+
id: String!
|
|
143
|
+
type: [String!]!
|
|
144
|
+
issuer: IssuerInput!
|
|
145
|
+
issuanceDate: DateTime!
|
|
146
|
+
expirationDate: DateTime
|
|
147
|
+
credentialSubject: CredentialSubjectInput!
|
|
148
|
+
credentialStatus: CredentialStatusInput
|
|
149
|
+
credentialSchema: CredentialSchemaInput!
|
|
150
|
+
proof: ProofInput!
|
|
90
151
|
}
|
|
152
|
+
|
|
91
153
|
input RenownCredential_RevokeInput {
|
|
92
154
|
revokedAt: DateTime!
|
|
93
155
|
reason: String
|
|
94
156
|
}
|
|
95
|
-
input RenownCredential_UpdateCredentialSubjectInput {
|
|
96
|
-
credentialSubject: String!
|
|
97
|
-
}
|
|
98
|
-
input RenownCredential_SetJwtInput {
|
|
99
|
-
jwt: String!
|
|
100
|
-
}
|
|
101
|
-
input RenownCredential_SetCredentialStatusInput {
|
|
102
|
-
statusId: String!
|
|
103
|
-
statusType: String!
|
|
104
|
-
statusPurpose: String!
|
|
105
|
-
statusListIndex: String!
|
|
106
|
-
statusListCredential: String!
|
|
107
|
-
}
|
|
108
157
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseSubgraph } from "@powerhousedao/reactor-api";
|
|
2
2
|
import type { DocumentNode } from "graphql";
|
|
3
|
-
export declare class RenownReadModelSubgraph extends
|
|
3
|
+
export declare class RenownReadModelSubgraph extends BaseSubgraph {
|
|
4
4
|
name: string;
|
|
5
5
|
typeDefs: DocumentNode;
|
|
6
6
|
resolvers: Record<string, unknown>;
|
|
@@ -8,3 +8,4 @@ export declare class RenownReadModelSubgraph extends Subgraph {
|
|
|
8
8
|
onSetup(): Promise<void>;
|
|
9
9
|
onDisconnect(): Promise<void>;
|
|
10
10
|
}
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-read-model/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,uBAAwB,SAAQ,YAAY;IACvD,IAAI,SAAuB;IAC3B,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseSubgraph } from "@powerhousedao/reactor-api";
|
|
2
2
|
import { schema } from "./schema.js";
|
|
3
3
|
import { getResolvers } from "./resolvers.js";
|
|
4
|
-
export class RenownReadModelSubgraph extends
|
|
4
|
+
export class RenownReadModelSubgraph extends BaseSubgraph {
|
|
5
5
|
name = "renown-read-model";
|
|
6
6
|
typeDefs = schema;
|
|
7
7
|
resolvers = getResolvers(this);
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getResolvers: (subgraph:
|
|
1
|
+
import type { ISubgraph } from "@powerhousedao/reactor-api";
|
|
2
|
+
export declare const getResolvers: (subgraph: ISubgraph) => Record<string, unknown>;
|
|
3
|
+
//# sourceMappingURL=resolvers.d.ts.map
|
|
@@ -0,0 +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,CA+JxE,CAAC"}
|
|
@@ -10,29 +10,27 @@ const mapToUser = (user) => ({
|
|
|
10
10
|
});
|
|
11
11
|
const mapToCredential = (credential) => ({
|
|
12
12
|
documentId: credential.document_id,
|
|
13
|
-
jwt: credential.jwt,
|
|
14
|
-
jwtVerified: credential.jwt_verified,
|
|
15
|
-
vcPayload: credential.vc_payload,
|
|
16
13
|
credentialId: credential.credential_id,
|
|
17
|
-
context:
|
|
18
|
-
type:
|
|
19
|
-
|
|
14
|
+
context: JSON.parse(credential.context),
|
|
15
|
+
type: JSON.parse(credential.type),
|
|
16
|
+
issuerId: credential.issuer_id,
|
|
17
|
+
issuerEthereumAddress: credential.issuer_ethereum_address,
|
|
20
18
|
issuanceDate: credential.issuance_date,
|
|
21
|
-
credentialSubject: credential.credential_subject,
|
|
22
19
|
expirationDate: credential.expiration_date,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
credentialSubjectId: credential.credential_subject_id,
|
|
21
|
+
credentialSubjectApp: credential.credential_subject_app,
|
|
22
|
+
credentialStatusId: credential.credential_status_id,
|
|
23
|
+
credentialStatusType: credential.credential_status_type,
|
|
24
|
+
credentialSchemaId: credential.credential_schema_id,
|
|
25
|
+
credentialSchemaType: credential.credential_schema_type,
|
|
26
|
+
proofVerificationMethod: credential.proof_verification_method,
|
|
27
|
+
proofEthereumAddress: credential.proof_ethereum_address,
|
|
28
|
+
proofCreated: credential.proof_created,
|
|
29
|
+
proofPurpose: credential.proof_purpose,
|
|
30
|
+
proofType: credential.proof_type,
|
|
31
|
+
proofValue: credential.proof_value,
|
|
32
|
+
proofEip712Domain: credential.proof_eip712_domain,
|
|
33
|
+
proofEip712PrimaryType: credential.proof_eip712_primary_type,
|
|
36
34
|
revoked: credential.revoked,
|
|
37
35
|
revokedAt: credential.revoked_at,
|
|
38
36
|
revocationReason: credential.revocation_reason,
|
|
@@ -40,7 +38,7 @@ const mapToCredential = (credential) => ({
|
|
|
40
38
|
updatedAt: credential.updated_at,
|
|
41
39
|
});
|
|
42
40
|
const getDriveId = (driveId) => {
|
|
43
|
-
const resolvedDriveId = driveId || process.env.RENOWN_PROFILES_DRIVE_ID;
|
|
41
|
+
const resolvedDriveId = driveId || process.env.RENOWN_PROFILES_DRIVE_ID || "renown-user";
|
|
44
42
|
if (!resolvedDriveId) {
|
|
45
43
|
throw new Error("Drive ID is required. Provide it in the input or set RENOWN_PROFILES_DRIVE_ID environment variable.");
|
|
46
44
|
}
|
|
@@ -51,9 +49,8 @@ export const getResolvers = (subgraph) => {
|
|
|
51
49
|
return {
|
|
52
50
|
Query: {
|
|
53
51
|
renownUser: async (parent, args) => {
|
|
54
|
-
const {
|
|
55
|
-
|
|
56
|
-
let query = RenownUserProcessor.query(resolvedDriveId, db).selectFrom("renown_user");
|
|
52
|
+
const { phid, ethAddress, username } = args.input;
|
|
53
|
+
let query = RenownUserProcessor.query("renown-user", db).selectFrom("renown_user");
|
|
57
54
|
// Priority: phid > ethAddress > username
|
|
58
55
|
if (phid) {
|
|
59
56
|
query = query.where("renown_user.document_id", "=", phid);
|
|
@@ -72,8 +69,7 @@ export const getResolvers = (subgraph) => {
|
|
|
72
69
|
},
|
|
73
70
|
renownUsers: async (parent, args) => {
|
|
74
71
|
const { driveId, phids, ethAddresses, usernames } = args.input;
|
|
75
|
-
|
|
76
|
-
let query = RenownUserProcessor.query(resolvedDriveId, db).selectFrom("renown_user");
|
|
72
|
+
let query = RenownUserProcessor.query("renown-user", db).selectFrom("renown_user");
|
|
77
73
|
const hasPhids = phids && phids.length > 0;
|
|
78
74
|
const hasEthAddresses = ethAddresses && ethAddresses.length > 0;
|
|
79
75
|
const hasUsernames = usernames && usernames.length > 0;
|
|
@@ -97,27 +93,31 @@ export const getResolvers = (subgraph) => {
|
|
|
97
93
|
return results.map(mapToUser);
|
|
98
94
|
},
|
|
99
95
|
renownCredentials: async (parent, args) => {
|
|
100
|
-
const { driveId, ethAddress, did, issuer, includeRevoked = true } = args.input;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// Search by ethAddress or DID in credential_subject JSON
|
|
96
|
+
const { driveId, ethAddress, did, issuer, includeRevoked = true, } = args.input;
|
|
97
|
+
let query = RenownCredentialProcessor.query("renown-credential", db).selectFrom("renown_credential");
|
|
98
|
+
// Search by ethAddress or DID in credential_subject fields
|
|
104
99
|
if (ethAddress || did) {
|
|
105
100
|
query = query.where((eb) => {
|
|
106
101
|
const conditions = [];
|
|
107
102
|
if (ethAddress) {
|
|
108
|
-
// Search for ethAddress in
|
|
109
|
-
conditions.push(eb("renown_credential.
|
|
103
|
+
// Search for ethAddress in credential_subject_id (case-insensitive)
|
|
104
|
+
conditions.push(eb(eb.fn("LOWER", ["renown_credential.credential_subject_id"]), "like", `%${ethAddress.toLowerCase()}%`));
|
|
105
|
+
// Also search in proof_ethereum_address
|
|
106
|
+
conditions.push(eb(eb.fn("LOWER", ["renown_credential.proof_ethereum_address"]), "=", ethAddress.toLowerCase()));
|
|
110
107
|
}
|
|
111
108
|
if (did) {
|
|
112
|
-
// Search for DID in
|
|
113
|
-
conditions.push(eb("renown_credential.
|
|
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()}%`));
|
|
114
111
|
}
|
|
115
112
|
return eb.or(conditions);
|
|
116
113
|
});
|
|
117
114
|
}
|
|
118
115
|
// Filter by issuer if provided
|
|
119
116
|
if (issuer) {
|
|
120
|
-
query = query.where(
|
|
117
|
+
query = query.where((eb) => eb.or([
|
|
118
|
+
eb("renown_credential.issuer_id", "=", issuer),
|
|
119
|
+
eb(eb.fn("LOWER", ["renown_credential.issuer_ethereum_address"]), "=", issuer.toLowerCase()),
|
|
120
|
+
]));
|
|
121
121
|
}
|
|
122
122
|
// Filter by revoked status
|
|
123
123
|
if (!includeRevoked) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-read-model/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YAsEpB,CAAC"}
|
|
@@ -28,17 +28,27 @@ export const schema = gql `
|
|
|
28
28
|
|
|
29
29
|
type ReadRenownCredential {
|
|
30
30
|
documentId: String!
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
issuer: String
|
|
38
|
-
issuanceDate: DateTime
|
|
39
|
-
credentialSubject: String
|
|
31
|
+
credentialId: String!
|
|
32
|
+
context: [String!]!
|
|
33
|
+
type: [String!]!
|
|
34
|
+
issuerId: String!
|
|
35
|
+
issuerEthereumAddress: String!
|
|
36
|
+
issuanceDate: DateTime!
|
|
40
37
|
expirationDate: DateTime
|
|
41
|
-
|
|
38
|
+
credentialSubjectId: String
|
|
39
|
+
credentialSubjectApp: String!
|
|
40
|
+
credentialStatusId: String
|
|
41
|
+
credentialStatusType: String
|
|
42
|
+
credentialSchemaId: String!
|
|
43
|
+
credentialSchemaType: String!
|
|
44
|
+
proofVerificationMethod: String!
|
|
45
|
+
proofEthereumAddress: String!
|
|
46
|
+
proofCreated: DateTime!
|
|
47
|
+
proofPurpose: String!
|
|
48
|
+
proofType: String!
|
|
49
|
+
proofValue: String!
|
|
50
|
+
proofEip712Domain: String!
|
|
51
|
+
proofEip712PrimaryType: String!
|
|
42
52
|
revoked: Boolean!
|
|
43
53
|
revokedAt: DateTime
|
|
44
54
|
revocationReason: String
|
|
@@ -46,14 +56,6 @@ export const schema = gql `
|
|
|
46
56
|
updatedAt: DateTime
|
|
47
57
|
}
|
|
48
58
|
|
|
49
|
-
type ReadCredentialStatus {
|
|
50
|
-
id: String!
|
|
51
|
-
type: String!
|
|
52
|
-
statusPurpose: String!
|
|
53
|
-
statusListIndex: String!
|
|
54
|
-
statusListCredential: String!
|
|
55
|
-
}
|
|
56
|
-
|
|
57
59
|
input RenownCredentialsInput {
|
|
58
60
|
driveId: String
|
|
59
61
|
ethAddress: String
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseSubgraph } from "@powerhousedao/reactor-api";
|
|
2
2
|
import type { DocumentNode } from "graphql";
|
|
3
|
-
export declare class RenownUserSubgraph extends
|
|
3
|
+
export declare class RenownUserSubgraph extends BaseSubgraph {
|
|
4
4
|
name: string;
|
|
5
5
|
typeDefs: DocumentNode;
|
|
6
6
|
resolvers: Record<string, unknown>;
|
|
@@ -8,3 +8,4 @@ export declare class RenownUserSubgraph extends Subgraph {
|
|
|
8
8
|
onSetup(): Promise<void>;
|
|
9
9
|
onDisconnect(): Promise<void>;
|
|
10
10
|
}
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-user/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,kBAAmB,SAAQ,YAAY;IAClD,IAAI,SAAiB;IACrB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseSubgraph } from "@powerhousedao/reactor-api";
|
|
2
2
|
import { schema } from "./schema.js";
|
|
3
3
|
import { getResolvers } from "./resolvers.js";
|
|
4
|
-
export class RenownUserSubgraph extends
|
|
4
|
+
export class RenownUserSubgraph extends BaseSubgraph {
|
|
5
5
|
name = "renown-user";
|
|
6
6
|
typeDefs = schema;
|
|
7
7
|
resolvers = getResolvers(this);
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getResolvers: (subgraph:
|
|
1
|
+
import type { ISubgraph } from "@powerhousedao/reactor-api";
|
|
2
|
+
export declare const getResolvers: (subgraph: ISubgraph) => Record<string, unknown>;
|
|
3
|
+
//# sourceMappingURL=resolvers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-user/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAW5D,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CA2JxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/renown-user/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA6DpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../vite.config.ts"],"names":[],"mappings":";AAGA,wBAaG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getConnectBaseViteConfig } from "@powerhousedao/builder-tools";
|
|
2
|
+
import { defineConfig, mergeConfig } from "vite";
|
|
3
|
+
export default defineConfig(({ mode }) => {
|
|
4
|
+
const baseConnectViteConfig = getConnectBaseViteConfig({
|
|
5
|
+
mode,
|
|
6
|
+
dirname: import.meta.dirname,
|
|
7
|
+
});
|
|
8
|
+
const additionalViteConfig = {
|
|
9
|
+
// add your own vite config here
|
|
10
|
+
};
|
|
11
|
+
const config = mergeConfig(baseConnectViteConfig, additionalViteConfig);
|
|
12
|
+
return config;
|
|
13
|
+
});
|
package/dist/vitest.config.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";AAGA,wBAKG"}
|