@powerhousedao/renown-package 0.0.7 → 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 -73
- 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 +9 -23
- package/dist/document-models/renown-credential/gen/manager/error.d.ts.map +1 -0
- package/dist/document-models/renown-credential/gen/manager/error.js +19 -38
- 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 -15
- 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 -117
- 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 -35
- 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 -47
- 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 -121
- 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 -36
- 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 -71
- 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 -22
- package/dist/processors/renown-credential/schema.d.ts +19 -13
- 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 -17106
- 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 +97 -50
- 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 -36
- 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 -19
- 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,38 +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
|
-
|
|
22
|
+
type CredentialSchema {
|
|
23
|
+
id: String!
|
|
24
|
+
type: String!
|
|
25
|
+
}
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
type EIP712Domain {
|
|
28
|
+
version: String!
|
|
29
|
+
chainId: Int!
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type EIP712 {
|
|
33
|
+
domain: EIP712Domain!
|
|
34
|
+
primaryType: String!
|
|
35
|
+
}
|
|
25
36
|
|
|
26
|
-
|
|
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!
|
|
27
54
|
expirationDate: DateTime
|
|
55
|
+
credentialSubject: CredentialSubject!
|
|
28
56
|
credentialStatus: CredentialStatus
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
jwt: String
|
|
32
|
-
jwtVerified: Boolean
|
|
33
|
-
jwtVerificationError: String
|
|
34
|
-
jwtPayload: String
|
|
57
|
+
credentialSchema: CredentialSchema!
|
|
58
|
+
proof: Proof!
|
|
35
59
|
|
|
36
60
|
"Revocation tracking"
|
|
37
|
-
revoked: Boolean
|
|
61
|
+
revoked: Boolean!
|
|
38
62
|
revokedAt: DateTime
|
|
39
63
|
revocationReason: String
|
|
40
64
|
}
|
|
@@ -67,44 +91,67 @@ export const schema = gql `
|
|
|
67
91
|
docId: PHID
|
|
68
92
|
input: RenownCredential_RevokeInput
|
|
69
93
|
): Int
|
|
70
|
-
RenownCredential_updateCredentialSubject(
|
|
71
|
-
driveId: String
|
|
72
|
-
docId: PHID
|
|
73
|
-
input: RenownCredential_UpdateCredentialSubjectInput
|
|
74
|
-
): Int
|
|
75
|
-
RenownCredential_setJwt(
|
|
76
|
-
driveId: String
|
|
77
|
-
docId: PHID
|
|
78
|
-
input: RenownCredential_SetJwtInput
|
|
79
|
-
): Int
|
|
80
|
-
RenownCredential_setCredentialStatus(
|
|
81
|
-
driveId: String
|
|
82
|
-
docId: PHID
|
|
83
|
-
input: RenownCredential_SetCredentialStatusInput
|
|
84
|
-
): Int
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
"""
|
|
88
97
|
Module: Manager
|
|
89
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
|
+
|
|
90
140
|
input RenownCredential_InitInput {
|
|
91
|
-
|
|
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!
|
|
92
151
|
}
|
|
152
|
+
|
|
93
153
|
input RenownCredential_RevokeInput {
|
|
94
154
|
revokedAt: DateTime!
|
|
95
155
|
reason: String
|
|
96
156
|
}
|
|
97
|
-
input RenownCredential_UpdateCredentialSubjectInput {
|
|
98
|
-
credentialSubject: String!
|
|
99
|
-
}
|
|
100
|
-
input RenownCredential_SetJwtInput {
|
|
101
|
-
jwt: String!
|
|
102
|
-
}
|
|
103
|
-
input RenownCredential_SetCredentialStatusInput {
|
|
104
|
-
statusId: String!
|
|
105
|
-
statusType: String!
|
|
106
|
-
statusPurpose: String!
|
|
107
|
-
statusListIndex: String!
|
|
108
|
-
statusListCredential: String!
|
|
109
|
-
}
|
|
110
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,30 +10,27 @@ const mapToUser = (user) => ({
|
|
|
10
10
|
});
|
|
11
11
|
const mapToCredential = (credential) => ({
|
|
12
12
|
documentId: credential.document_id,
|
|
13
|
-
vcPayload: credential.vc_payload,
|
|
14
13
|
credentialId: credential.credential_id,
|
|
15
|
-
context:
|
|
16
|
-
type:
|
|
17
|
-
|
|
14
|
+
context: JSON.parse(credential.context),
|
|
15
|
+
type: JSON.parse(credential.type),
|
|
16
|
+
issuerId: credential.issuer_id,
|
|
17
|
+
issuerEthereumAddress: credential.issuer_ethereum_address,
|
|
18
18
|
issuanceDate: credential.issuance_date,
|
|
19
|
-
credentialSubject: credential.credential_subject,
|
|
20
19
|
expirationDate: credential.expiration_date,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
jwtPayload: credential.jwt_payload,
|
|
36
|
-
jwtVerified: credential.jwt_verified,
|
|
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,
|
|
37
34
|
revoked: credential.revoked,
|
|
38
35
|
revokedAt: credential.revoked_at,
|
|
39
36
|
revocationReason: credential.revocation_reason,
|
|
@@ -41,7 +38,7 @@ const mapToCredential = (credential) => ({
|
|
|
41
38
|
updatedAt: credential.updated_at,
|
|
42
39
|
});
|
|
43
40
|
const getDriveId = (driveId) => {
|
|
44
|
-
const resolvedDriveId = driveId || process.env.RENOWN_PROFILES_DRIVE_ID;
|
|
41
|
+
const resolvedDriveId = driveId || process.env.RENOWN_PROFILES_DRIVE_ID || "renown-user";
|
|
45
42
|
if (!resolvedDriveId) {
|
|
46
43
|
throw new Error("Drive ID is required. Provide it in the input or set RENOWN_PROFILES_DRIVE_ID environment variable.");
|
|
47
44
|
}
|
|
@@ -52,9 +49,8 @@ export const getResolvers = (subgraph) => {
|
|
|
52
49
|
return {
|
|
53
50
|
Query: {
|
|
54
51
|
renownUser: async (parent, args) => {
|
|
55
|
-
const {
|
|
56
|
-
|
|
57
|
-
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");
|
|
58
54
|
// Priority: phid > ethAddress > username
|
|
59
55
|
if (phid) {
|
|
60
56
|
query = query.where("renown_user.document_id", "=", phid);
|
|
@@ -73,8 +69,7 @@ export const getResolvers = (subgraph) => {
|
|
|
73
69
|
},
|
|
74
70
|
renownUsers: async (parent, args) => {
|
|
75
71
|
const { driveId, phids, ethAddresses, usernames } = args.input;
|
|
76
|
-
|
|
77
|
-
let query = RenownUserProcessor.query(resolvedDriveId, db).selectFrom("renown_user");
|
|
72
|
+
let query = RenownUserProcessor.query("renown-user", db).selectFrom("renown_user");
|
|
78
73
|
const hasPhids = phids && phids.length > 0;
|
|
79
74
|
const hasEthAddresses = ethAddresses && ethAddresses.length > 0;
|
|
80
75
|
const hasUsernames = usernames && usernames.length > 0;
|
|
@@ -98,27 +93,31 @@ export const getResolvers = (subgraph) => {
|
|
|
98
93
|
return results.map(mapToUser);
|
|
99
94
|
},
|
|
100
95
|
renownCredentials: async (parent, args) => {
|
|
101
|
-
const { driveId, ethAddress, did, issuer, includeRevoked = true } = args.input;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// 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
|
|
105
99
|
if (ethAddress || did) {
|
|
106
100
|
query = query.where((eb) => {
|
|
107
101
|
const conditions = [];
|
|
108
102
|
if (ethAddress) {
|
|
109
|
-
// Search for ethAddress in
|
|
110
|
-
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()));
|
|
111
107
|
}
|
|
112
108
|
if (did) {
|
|
113
|
-
// Search for DID in
|
|
114
|
-
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()}%`));
|
|
115
111
|
}
|
|
116
112
|
return eb.or(conditions);
|
|
117
113
|
});
|
|
118
114
|
}
|
|
119
115
|
// Filter by issuer if provided
|
|
120
116
|
if (issuer) {
|
|
121
|
-
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
|
+
]));
|
|
122
121
|
}
|
|
123
122
|
// Filter by revoked status
|
|
124
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,18 +28,27 @@ export const schema = gql `
|
|
|
28
28
|
|
|
29
29
|
type ReadRenownCredential {
|
|
30
30
|
documentId: String!
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
issuanceDate: DateTime
|
|
37
|
-
credentialSubject: String
|
|
31
|
+
credentialId: String!
|
|
32
|
+
context: [String!]!
|
|
33
|
+
type: [String!]!
|
|
34
|
+
issuerId: String!
|
|
35
|
+
issuerEthereumAddress: String!
|
|
36
|
+
issuanceDate: DateTime!
|
|
38
37
|
expirationDate: DateTime
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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!
|
|
43
52
|
revoked: Boolean!
|
|
44
53
|
revokedAt: DateTime
|
|
45
54
|
revocationReason: String
|
|
@@ -47,14 +56,6 @@ export const schema = gql `
|
|
|
47
56
|
updatedAt: DateTime
|
|
48
57
|
}
|
|
49
58
|
|
|
50
|
-
type ReadCredentialStatus {
|
|
51
|
-
id: String!
|
|
52
|
-
type: String!
|
|
53
|
-
statusPurpose: String!
|
|
54
|
-
statusListIndex: String!
|
|
55
|
-
statusListCredential: String!
|
|
56
|
-
}
|
|
57
|
-
|
|
58
59
|
input RenownCredentialsInput {
|
|
59
60
|
driveId: String
|
|
60
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"}
|