@powerhousedao/renown-package 0.0.3 → 0.0.4
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/renown-credential/gen/document-model.js +96 -10
- package/dist/document-models/renown-credential/gen/manager/actions.d.ts +14 -2
- package/dist/document-models/renown-credential/gen/manager/creators.d.ts +5 -2
- package/dist/document-models/renown-credential/gen/manager/creators.js +4 -1
- package/dist/document-models/renown-credential/gen/manager/error.d.ts +45 -1
- package/dist/document-models/renown-credential/gen/manager/error.js +53 -1
- package/dist/document-models/renown-credential/gen/manager/object.d.ts +5 -2
- package/dist/document-models/renown-credential/gen/manager/object.js +10 -1
- package/dist/document-models/renown-credential/gen/manager/operations.d.ts +4 -1
- package/dist/document-models/renown-credential/gen/object.d.ts +1 -1
- package/dist/document-models/renown-credential/gen/ph-factories.js +11 -5
- package/dist/document-models/renown-credential/gen/reducer.d.ts +1 -1
- package/dist/document-models/renown-credential/gen/reducer.js +12 -0
- package/dist/document-models/renown-credential/gen/schema/types.d.ts +43 -12
- package/dist/document-models/renown-credential/gen/schema/zod.d.ts +5 -1
- package/dist/document-models/renown-credential/gen/schema/zod.js +48 -10
- package/dist/document-models/renown-credential/gen/utils.d.ts +1 -1
- package/dist/document-models/renown-credential/gen/utils.js +11 -5
- package/dist/document-models/renown-credential/index.d.ts +3 -0
- package/dist/document-models/renown-credential/src/reducers/manager.js +69 -15
- package/dist/document-models/renown-user/gen/object.d.ts +1 -1
- package/dist/document-models/renown-user/gen/profile/object.d.ts +1 -1
- package/dist/document-models/renown-user/gen/reducer.d.ts +1 -1
- package/dist/document-models/renown-user/gen/utils.d.ts +1 -1
- package/dist/processors/index.d.ts +1 -0
- package/dist/processors/index.js +1 -0
- package/dist/processors/renown-credential/index.d.ts +9 -0
- package/dist/processors/renown-credential/index.js +129 -0
- package/dist/processors/renown-credential/migrations.d.ts +3 -0
- package/dist/processors/renown-credential/migrations.js +77 -0
- package/dist/processors/renown-credential/schema.d.ts +27 -0
- package/dist/processors/renown-credential/schema.js +1 -0
- package/dist/processors/renown-user/migrations.js +2 -2
- package/dist/style.css +15 -12
- package/dist/subgraphs/renown-credential/resolvers.js +36 -0
- package/dist/subgraphs/renown-credential/schema.js +62 -12
- package/dist/subgraphs/renown-read-model/resolvers.js +99 -76
- package/dist/subgraphs/renown-read-model/schema.js +48 -15
- package/package.json +31 -1
|
@@ -1,23 +1,77 @@
|
|
|
1
|
+
import { InvalidStatusPurposeError, MissingContextError, MissingTypeError, InvalidClaimsError, CredentialRevokedError, AlreadyRevokedError, } from "../../gen/manager/error.js";
|
|
1
2
|
export const reducer = {
|
|
2
3
|
initOperation(state, action, dispatch) {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
// Validate context
|
|
5
|
+
const context = action.input.context && action.input.context.length > 0
|
|
6
|
+
? action.input.context
|
|
7
|
+
: ["https://www.w3.org/2018/credentials/v1"];
|
|
8
|
+
if (!context.includes("https://www.w3.org/2018/credentials/v1")) {
|
|
9
|
+
throw new MissingContextError("Context must include https://www.w3.org/2018/credentials/v1");
|
|
10
|
+
}
|
|
11
|
+
// Validate type
|
|
12
|
+
const type = action.input.type && action.input.type.length > 0
|
|
13
|
+
? action.input.type
|
|
14
|
+
: ["VerifiableCredential"];
|
|
15
|
+
if (!type.includes("VerifiableCredential")) {
|
|
16
|
+
throw new MissingTypeError("Type must include VerifiableCredential");
|
|
17
|
+
}
|
|
18
|
+
// Validate credentialSubject is valid JSON
|
|
19
|
+
try {
|
|
20
|
+
JSON.parse(action.input.credentialSubject);
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
throw new InvalidClaimsError("Credential subject must be valid JSON");
|
|
24
|
+
}
|
|
25
|
+
state.context = context;
|
|
26
|
+
state.id = action.input.id || null;
|
|
27
|
+
state.type = type;
|
|
28
|
+
state.issuer = action.input.issuer;
|
|
29
|
+
state.issuanceDate = action.input.issuanceDate;
|
|
30
|
+
state.credentialSubject = action.input.credentialSubject;
|
|
31
|
+
state.expirationDate = action.input.expirationDate || null;
|
|
32
|
+
state.credentialStatus = null;
|
|
33
|
+
state.jwt = null;
|
|
34
|
+
state.revoked = false;
|
|
35
|
+
state.revokedAt = null;
|
|
36
|
+
state.revocationReason = null;
|
|
37
|
+
},
|
|
38
|
+
updateCredentialSubjectOperation(state, action, dispatch) {
|
|
39
|
+
if (state.revoked) {
|
|
40
|
+
throw new CredentialRevokedError("Cannot update a revoked credential");
|
|
41
|
+
}
|
|
42
|
+
// Validate credentialSubject is valid JSON
|
|
43
|
+
try {
|
|
44
|
+
JSON.parse(action.input.credentialSubject);
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
throw new InvalidClaimsError("Credential subject must be valid JSON");
|
|
48
|
+
}
|
|
49
|
+
state.credentialSubject = action.input.credentialSubject;
|
|
50
|
+
// Clear JWT as credential content has changed
|
|
51
|
+
state.jwt = null;
|
|
52
|
+
},
|
|
53
|
+
setJwtOperation(state, action, dispatch) {
|
|
54
|
+
state.jwt = action.input.jwt;
|
|
55
|
+
},
|
|
56
|
+
setCredentialStatusOperation(state, action, dispatch) {
|
|
57
|
+
// Validate statusPurpose
|
|
58
|
+
if (action.input.statusPurpose !== "revocation" && action.input.statusPurpose !== "suspension") {
|
|
59
|
+
throw new InvalidStatusPurposeError("Status purpose must be 'revocation' or 'suspension'");
|
|
60
|
+
}
|
|
61
|
+
state.credentialStatus = {
|
|
62
|
+
id: action.input.statusId,
|
|
63
|
+
type: action.input.statusType,
|
|
64
|
+
statusPurpose: action.input.statusPurpose,
|
|
65
|
+
statusListIndex: action.input.statusListIndex,
|
|
66
|
+
statusListCredential: action.input.statusListCredential
|
|
15
67
|
};
|
|
16
68
|
},
|
|
17
69
|
revokeOperation(state, action, dispatch) {
|
|
18
|
-
|
|
70
|
+
if (state.revoked) {
|
|
71
|
+
throw new AlreadyRevokedError("Credential is already revoked");
|
|
72
|
+
}
|
|
19
73
|
state.revoked = true;
|
|
20
|
-
state.
|
|
21
|
-
|
|
74
|
+
state.revokedAt = action.input.revokedAt;
|
|
75
|
+
state.revocationReason = action.input.reason || null;
|
|
22
76
|
},
|
|
23
77
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseDocumentClass, type SignalDispatch } from "document-model";
|
|
2
|
-
import { RenownUserPHState } from "./ph-factories.js";
|
|
2
|
+
import { type RenownUserPHState } from "./ph-factories.js";
|
|
3
3
|
import RenownUser_Profile from "./profile/object.js";
|
|
4
4
|
export * from "./profile/object.js";
|
|
5
5
|
interface RenownUser extends RenownUser_Profile {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseDocumentClass } from "document-model";
|
|
2
|
-
import { RenownUserPHState } from "../ph-factories.js";
|
|
2
|
+
import { type RenownUserPHState } from "../ph-factories.js";
|
|
3
3
|
import { type SetUsernameInput, type SetEthAddressInput, type SetUserImageInput } from "../types.js";
|
|
4
4
|
export default class RenownUser_Profile extends BaseDocumentClass<RenownUserPHState> {
|
|
5
5
|
setUsername(input: SetUsernameInput): this;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type StateReducer } from "document-model";
|
|
2
|
-
import { RenownUserPHState } from "./ph-factories.js";
|
|
2
|
+
import { type RenownUserPHState } from "./ph-factories.js";
|
|
3
3
|
export declare const stateReducer: StateReducer<RenownUserPHState>;
|
|
4
4
|
export declare const reducer: import("document-model").Reducer<RenownUserPHState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CreateDocument, type CreateState, type LoadFromFile, type LoadFromInput } from "document-model";
|
|
2
2
|
import { type RenownUserState, type RenownUserLocalState } from "./types.js";
|
|
3
|
-
import { RenownUserPHState } from "./ph-factories.js";
|
|
3
|
+
import { type RenownUserPHState } from "./ph-factories.js";
|
|
4
4
|
export declare const initialGlobalState: RenownUserState;
|
|
5
5
|
export declare const initialLocalState: RenownUserLocalState;
|
|
6
6
|
export declare const createState: CreateState<RenownUserPHState>;
|
package/dist/processors/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RelationalDbProcessor } from "document-drive/processors/relational";
|
|
2
|
+
import { type InternalTransmitterUpdate } from "document-drive/server/listener/transmitter/internal";
|
|
3
|
+
import { type DB } from "./schema.js";
|
|
4
|
+
export declare class RenownCredentialProcessor extends RelationalDbProcessor<DB> {
|
|
5
|
+
static getNamespace(driveId: string): string;
|
|
6
|
+
initAndUpgrade(): Promise<void>;
|
|
7
|
+
onStrands(strands: InternalTransmitterUpdate[]): Promise<void>;
|
|
8
|
+
onDisconnect(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { RelationalDbProcessor } from "document-drive/processors/relational";
|
|
2
|
+
import { up } from "./migrations.js";
|
|
3
|
+
export class RenownCredentialProcessor extends RelationalDbProcessor {
|
|
4
|
+
static getNamespace(driveId) {
|
|
5
|
+
// Default namespace: `${this.name}_${driveId.replaceAll("-", "_")}`
|
|
6
|
+
return super.getNamespace(driveId);
|
|
7
|
+
}
|
|
8
|
+
async initAndUpgrade() {
|
|
9
|
+
await up(this.relationalDb);
|
|
10
|
+
}
|
|
11
|
+
async onStrands(strands) {
|
|
12
|
+
if (strands.length === 0) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
for (const strand of strands) {
|
|
16
|
+
if (strand.operations.length === 0) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const documentId = strand.documentId;
|
|
20
|
+
// Ensure the Credential exists in the database
|
|
21
|
+
const existingCredential = await this.relationalDb
|
|
22
|
+
.selectFrom("renown_credential")
|
|
23
|
+
.select(["document_id"])
|
|
24
|
+
.where("document_id", "=", documentId)
|
|
25
|
+
.executeTakeFirst();
|
|
26
|
+
// Process each operation
|
|
27
|
+
for (const operation of strand.operations) {
|
|
28
|
+
switch (operation.action.type) {
|
|
29
|
+
case "INIT": {
|
|
30
|
+
const input = operation.action.input;
|
|
31
|
+
if (input && !existingCredential) {
|
|
32
|
+
await this.relationalDb
|
|
33
|
+
.insertInto("renown_credential")
|
|
34
|
+
.values({
|
|
35
|
+
document_id: documentId,
|
|
36
|
+
context: JSON.stringify(input.context || ["https://www.w3.org/2018/credentials/v1"]),
|
|
37
|
+
credential_id: input.id || null,
|
|
38
|
+
type: JSON.stringify(input.type || ["VerifiableCredential"]),
|
|
39
|
+
issuer: input.issuer,
|
|
40
|
+
issuance_date: new Date(input.issuanceDate),
|
|
41
|
+
credential_subject: input.credentialSubject,
|
|
42
|
+
expiration_date: input.expirationDate
|
|
43
|
+
? new Date(input.expirationDate)
|
|
44
|
+
: null,
|
|
45
|
+
credential_status_id: null,
|
|
46
|
+
credential_status_type: null,
|
|
47
|
+
credential_status_purpose: null,
|
|
48
|
+
credential_status_list_index: null,
|
|
49
|
+
credential_status_list_credential: null,
|
|
50
|
+
jwt: null,
|
|
51
|
+
revoked: false,
|
|
52
|
+
revoked_at: null,
|
|
53
|
+
revocation_reason: null,
|
|
54
|
+
created_at: new Date(),
|
|
55
|
+
updated_at: new Date(),
|
|
56
|
+
})
|
|
57
|
+
.execute();
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case "UPDATE_CREDENTIAL_SUBJECT": {
|
|
62
|
+
const input = operation.action.input;
|
|
63
|
+
if (input && existingCredential) {
|
|
64
|
+
await this.relationalDb
|
|
65
|
+
.updateTable("renown_credential")
|
|
66
|
+
.set({
|
|
67
|
+
credential_subject: input.credentialSubject,
|
|
68
|
+
jwt: null, // Clear JWT when content changes
|
|
69
|
+
updated_at: new Date(),
|
|
70
|
+
})
|
|
71
|
+
.where("document_id", "=", documentId)
|
|
72
|
+
.execute();
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case "SET_JWT": {
|
|
77
|
+
const input = operation.action.input;
|
|
78
|
+
if (input && existingCredential) {
|
|
79
|
+
await this.relationalDb
|
|
80
|
+
.updateTable("renown_credential")
|
|
81
|
+
.set({
|
|
82
|
+
jwt: input.jwt,
|
|
83
|
+
updated_at: new Date(),
|
|
84
|
+
})
|
|
85
|
+
.where("document_id", "=", documentId)
|
|
86
|
+
.execute();
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case "SET_CREDENTIAL_STATUS": {
|
|
91
|
+
const input = operation.action.input;
|
|
92
|
+
if (input && existingCredential) {
|
|
93
|
+
await this.relationalDb
|
|
94
|
+
.updateTable("renown_credential")
|
|
95
|
+
.set({
|
|
96
|
+
credential_status_id: input.statusId,
|
|
97
|
+
credential_status_type: input.statusType,
|
|
98
|
+
credential_status_purpose: input.statusPurpose,
|
|
99
|
+
credential_status_list_index: input.statusListIndex,
|
|
100
|
+
credential_status_list_credential: input.statusListCredential,
|
|
101
|
+
updated_at: new Date(),
|
|
102
|
+
})
|
|
103
|
+
.where("document_id", "=", documentId)
|
|
104
|
+
.execute();
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case "REVOKE": {
|
|
109
|
+
const input = operation.action.input;
|
|
110
|
+
if (input && existingCredential) {
|
|
111
|
+
await this.relationalDb
|
|
112
|
+
.updateTable("renown_credential")
|
|
113
|
+
.set({
|
|
114
|
+
revoked: true,
|
|
115
|
+
revoked_at: new Date(input.revokedAt),
|
|
116
|
+
revocation_reason: input.reason || null,
|
|
117
|
+
updated_at: new Date(),
|
|
118
|
+
})
|
|
119
|
+
.where("document_id", "=", documentId)
|
|
120
|
+
.execute();
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
async onDisconnect() { }
|
|
129
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export async function up(db) {
|
|
2
|
+
await down(db);
|
|
3
|
+
// Create renown_credential table
|
|
4
|
+
await db.schema
|
|
5
|
+
.createTable("renown_credential")
|
|
6
|
+
.addColumn("document_id", "varchar(255)")
|
|
7
|
+
.addColumn("context", "text") // JSON array
|
|
8
|
+
.addColumn("credential_id", "varchar(255)")
|
|
9
|
+
.addColumn("type", "text") // JSON array
|
|
10
|
+
.addColumn("issuer", "varchar(255)", (col) => col.notNull())
|
|
11
|
+
.addColumn("issuance_date", "timestamp", (col) => col.notNull())
|
|
12
|
+
.addColumn("credential_subject", "text", (col) => col.notNull()) // JSON object
|
|
13
|
+
.addColumn("expiration_date", "timestamp")
|
|
14
|
+
.addColumn("credential_status_id", "varchar(255)")
|
|
15
|
+
.addColumn("credential_status_type", "varchar(255)")
|
|
16
|
+
.addColumn("credential_status_purpose", "varchar(255)")
|
|
17
|
+
.addColumn("credential_status_list_index", "varchar(255)")
|
|
18
|
+
.addColumn("credential_status_list_credential", "text")
|
|
19
|
+
.addColumn("jwt", "text")
|
|
20
|
+
.addColumn("revoked", "boolean", (col) => col.notNull().defaultTo(false))
|
|
21
|
+
.addColumn("revoked_at", "timestamp")
|
|
22
|
+
.addColumn("revocation_reason", "text")
|
|
23
|
+
.addColumn("created_at", "timestamp", (col) => col.defaultTo(db.fn("now")))
|
|
24
|
+
.addColumn("updated_at", "timestamp", (col) => col.defaultTo(db.fn("now")))
|
|
25
|
+
.addPrimaryKeyConstraint("renown_credential_pkey", ["document_id"])
|
|
26
|
+
.ifNotExists()
|
|
27
|
+
.execute();
|
|
28
|
+
// Create index on credential_id for faster lookups
|
|
29
|
+
await db.schema
|
|
30
|
+
.createIndex("idx_renown_credential_credential_id")
|
|
31
|
+
.on("renown_credential")
|
|
32
|
+
.column("credential_id")
|
|
33
|
+
.ifNotExists()
|
|
34
|
+
.execute();
|
|
35
|
+
// Create index on issuer for faster lookups
|
|
36
|
+
await db.schema
|
|
37
|
+
.createIndex("idx_renown_credential_issuer")
|
|
38
|
+
.on("renown_credential")
|
|
39
|
+
.column("issuer")
|
|
40
|
+
.ifNotExists()
|
|
41
|
+
.execute();
|
|
42
|
+
// Create index on credential_subject for faster lookups (using GIN for JSONB-like searches)
|
|
43
|
+
await db.schema
|
|
44
|
+
.createIndex("idx_renown_credential_subject")
|
|
45
|
+
.on("renown_credential")
|
|
46
|
+
.column("credential_subject")
|
|
47
|
+
.ifNotExists()
|
|
48
|
+
.execute();
|
|
49
|
+
// Create index on revoked for faster validity checks
|
|
50
|
+
await db.schema
|
|
51
|
+
.createIndex("idx_renown_credential_revoked")
|
|
52
|
+
.on("renown_credential")
|
|
53
|
+
.column("revoked")
|
|
54
|
+
.ifNotExists()
|
|
55
|
+
.execute();
|
|
56
|
+
}
|
|
57
|
+
export async function down(db) {
|
|
58
|
+
// Drop renown_credential indexes
|
|
59
|
+
await db.schema
|
|
60
|
+
.dropIndex("idx_renown_credential_revoked")
|
|
61
|
+
.ifExists()
|
|
62
|
+
.execute();
|
|
63
|
+
await db.schema
|
|
64
|
+
.dropIndex("idx_renown_credential_subject")
|
|
65
|
+
.ifExists()
|
|
66
|
+
.execute();
|
|
67
|
+
await db.schema
|
|
68
|
+
.dropIndex("idx_renown_credential_issuer")
|
|
69
|
+
.ifExists()
|
|
70
|
+
.execute();
|
|
71
|
+
await db.schema
|
|
72
|
+
.dropIndex("idx_renown_credential_credential_id")
|
|
73
|
+
.ifExists()
|
|
74
|
+
.execute();
|
|
75
|
+
// Drop renown_credential table
|
|
76
|
+
await db.schema.dropTable("renown_credential").ifExists().execute();
|
|
77
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ColumnType } from "kysely";
|
|
2
|
+
export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
|
|
3
|
+
export type Timestamp = ColumnType<Date, Date | string, Date | string>;
|
|
4
|
+
export interface RenownCredential {
|
|
5
|
+
document_id: string;
|
|
6
|
+
context: string;
|
|
7
|
+
credential_id: string | null;
|
|
8
|
+
type: string;
|
|
9
|
+
issuer: string;
|
|
10
|
+
issuance_date: Timestamp;
|
|
11
|
+
credential_subject: string;
|
|
12
|
+
expiration_date: Timestamp | null;
|
|
13
|
+
credential_status_id: string | null;
|
|
14
|
+
credential_status_type: string | null;
|
|
15
|
+
credential_status_purpose: string | null;
|
|
16
|
+
credential_status_list_index: string | null;
|
|
17
|
+
credential_status_list_credential: string | null;
|
|
18
|
+
jwt: string | null;
|
|
19
|
+
revoked: boolean;
|
|
20
|
+
revoked_at: Timestamp | null;
|
|
21
|
+
revocation_reason: string | null;
|
|
22
|
+
created_at: Generated<Timestamp | null>;
|
|
23
|
+
updated_at: Generated<Timestamp | null>;
|
|
24
|
+
}
|
|
25
|
+
export interface DB {
|
|
26
|
+
renown_credential: RenownCredential;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -28,9 +28,9 @@ export async function up(db) {
|
|
|
28
28
|
.execute();
|
|
29
29
|
}
|
|
30
30
|
export async function down(db) {
|
|
31
|
-
// Drop indexes
|
|
31
|
+
// Drop renown_user indexes
|
|
32
32
|
await db.schema.dropIndex("idx_renown_user_eth_address").ifExists().execute();
|
|
33
33
|
await db.schema.dropIndex("idx_renown_user_username").ifExists().execute();
|
|
34
|
-
// Drop
|
|
34
|
+
// Drop renown_user table
|
|
35
35
|
await db.schema.dropTable("renown_user").ifExists().execute();
|
|
36
36
|
}
|
package/dist/style.css
CHANGED
|
@@ -5258,7 +5258,7 @@ input[type="number"] {
|
|
|
5258
5258
|
}
|
|
5259
5259
|
}
|
|
5260
5260
|
}
|
|
5261
|
-
/*! tailwindcss v4.1.
|
|
5261
|
+
/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */
|
|
5262
5262
|
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
|
|
5263
5263
|
@layer properties;
|
|
5264
5264
|
@layer theme, base, components, utilities;
|
|
@@ -5535,6 +5535,9 @@ input[type="number"] {
|
|
|
5535
5535
|
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
|
|
5536
5536
|
padding-block: 0;
|
|
5537
5537
|
}
|
|
5538
|
+
::-webkit-calendar-picker-indicator {
|
|
5539
|
+
line-height: 1;
|
|
5540
|
+
}
|
|
5538
5541
|
:-moz-ui-invalid {
|
|
5539
5542
|
box-shadow: none;
|
|
5540
5543
|
}
|
|
@@ -6393,7 +6396,7 @@ input[type="number"] {
|
|
|
6393
6396
|
border-radius: 100px;
|
|
6394
6397
|
}
|
|
6395
6398
|
.rounded-full {
|
|
6396
|
-
border-radius: calc(infinity * 1px);
|
|
6399
|
+
border-radius: calc(infinity * 1px) !important;
|
|
6397
6400
|
}
|
|
6398
6401
|
.rounded-lg {
|
|
6399
6402
|
border-radius: var(--radius-lg);
|
|
@@ -7221,7 +7224,7 @@ input[type="number"] {
|
|
|
7221
7224
|
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
7222
7225
|
}
|
|
7223
7226
|
.transition {
|
|
7224
|
-
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display,
|
|
7227
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
|
|
7225
7228
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
7226
7229
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
7227
7230
|
}
|
|
@@ -7408,7 +7411,7 @@ input[type="number"] {
|
|
|
7408
7411
|
}
|
|
7409
7412
|
.file\:rounded-full {
|
|
7410
7413
|
&::file-selector-button {
|
|
7411
|
-
border-radius: calc(infinity * 1px);
|
|
7414
|
+
border-radius: calc(infinity * 1px) !important;
|
|
7412
7415
|
}
|
|
7413
7416
|
}
|
|
7414
7417
|
.file\:border-0 {
|
|
@@ -7503,7 +7506,7 @@ input[type="number"] {
|
|
|
7503
7506
|
.before\:rounded-full {
|
|
7504
7507
|
&::before {
|
|
7505
7508
|
content: var(--tw-content);
|
|
7506
|
-
border-radius: calc(infinity * 1px);
|
|
7509
|
+
border-radius: calc(infinity * 1px) !important;
|
|
7507
7510
|
}
|
|
7508
7511
|
}
|
|
7509
7512
|
.before\:bg-blue-900 {
|
|
@@ -7624,7 +7627,7 @@ input[type="number"] {
|
|
|
7624
7627
|
.after\:rounded-full {
|
|
7625
7628
|
&::after {
|
|
7626
7629
|
content: var(--tw-content);
|
|
7627
|
-
border-radius: calc(infinity * 1px);
|
|
7630
|
+
border-radius: calc(infinity * 1px) !important;
|
|
7628
7631
|
}
|
|
7629
7632
|
}
|
|
7630
7633
|
.after\:bg-gray-300 {
|
|
@@ -9518,7 +9521,7 @@ input[type="number"] {
|
|
|
9518
9521
|
}
|
|
9519
9522
|
.\[\&_\.date-picker\\\\_\\\\_button-next\]\:rounded-full {
|
|
9520
9523
|
& .date-picker\_\_button-next {
|
|
9521
|
-
border-radius: calc(infinity * 1px);
|
|
9524
|
+
border-radius: calc(infinity * 1px) !important;
|
|
9522
9525
|
}
|
|
9523
9526
|
}
|
|
9524
9527
|
.\[\&_\.date-picker\\\\_\\\\_button-next\]\:border-2 {
|
|
@@ -9634,7 +9637,7 @@ input[type="number"] {
|
|
|
9634
9637
|
}
|
|
9635
9638
|
.\[\&_\.date-picker\\\\_\\\\_button-previous\]\:rounded-full {
|
|
9636
9639
|
& .date-picker\_\_button-previous {
|
|
9637
|
-
border-radius: calc(infinity * 1px);
|
|
9640
|
+
border-radius: calc(infinity * 1px) !important;
|
|
9638
9641
|
}
|
|
9639
9642
|
}
|
|
9640
9643
|
.\[\&_\.date-picker\\\\_\\\\_button-previous\]\:border-2 {
|
|
@@ -9806,7 +9809,7 @@ input[type="number"] {
|
|
|
9806
9809
|
}
|
|
9807
9810
|
.\[\&_\.date-picker\\\\_\\\\_day-button\]\:rounded-full {
|
|
9808
9811
|
& .date-picker\_\_day-button {
|
|
9809
|
-
border-radius: calc(infinity * 1px);
|
|
9812
|
+
border-radius: calc(infinity * 1px) !important;
|
|
9810
9813
|
}
|
|
9811
9814
|
}
|
|
9812
9815
|
.\[\&_\.date-picker\\\\_\\\\_day-button\]\:font-medium {
|
|
@@ -10156,7 +10159,7 @@ input[type="number"] {
|
|
|
10156
10159
|
}
|
|
10157
10160
|
.\[\&_\.date-picker\\\\_\\\\_today\]\:rounded-full {
|
|
10158
10161
|
& .date-picker\_\_today {
|
|
10159
|
-
border-radius: calc(infinity * 1px);
|
|
10162
|
+
border-radius: calc(infinity * 1px) !important;
|
|
10160
10163
|
}
|
|
10161
10164
|
}
|
|
10162
10165
|
.\[\&_\.date-picker\\\\_\\\\_today\]\:border-2 {
|
|
@@ -10422,7 +10425,7 @@ input[type="number"] {
|
|
|
10422
10425
|
}
|
|
10423
10426
|
.\[\&_\.radio-group\\\\_\\\\_item\]\:rounded-full {
|
|
10424
10427
|
& .radio-group\_\_item {
|
|
10425
|
-
border-radius: calc(infinity * 1px);
|
|
10428
|
+
border-radius: calc(infinity * 1px) !important;
|
|
10426
10429
|
}
|
|
10427
10430
|
}
|
|
10428
10431
|
.\[\&_\.radio-group\\\\_\\\\_item\]\:text-cyan-400 {
|
|
@@ -11314,7 +11317,7 @@ input[type="number"] {
|
|
|
11314
11317
|
.\[\&_\.date-picker\\\\_\\\\_date-footer\]\:\[\&\>button\]\:rounded-full {
|
|
11315
11318
|
& .date-picker\_\_date-footer {
|
|
11316
11319
|
&>button {
|
|
11317
|
-
border-radius: calc(infinity * 1px);
|
|
11320
|
+
border-radius: calc(infinity * 1px) !important;
|
|
11318
11321
|
}
|
|
11319
11322
|
}
|
|
11320
11323
|
}
|
|
@@ -91,6 +91,42 @@ 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
|
+
},
|
|
94
130
|
},
|
|
95
131
|
};
|
|
96
132
|
};
|
|
@@ -3,14 +3,34 @@ export const schema = gql `
|
|
|
3
3
|
"""
|
|
4
4
|
Subgraph definition for RenownCredential (renown/credential)
|
|
5
5
|
"""
|
|
6
|
+
type CredentialStatus {
|
|
7
|
+
id: String!
|
|
8
|
+
type: String!
|
|
9
|
+
statusPurpose: String!
|
|
10
|
+
statusListIndex: String!
|
|
11
|
+
statusListCredential: String!
|
|
12
|
+
}
|
|
13
|
+
|
|
6
14
|
type RenownCredentialState {
|
|
7
|
-
"
|
|
15
|
+
"W3C VC Required Fields"
|
|
16
|
+
context: [String!]!
|
|
17
|
+
id: String
|
|
18
|
+
type: [String!]!
|
|
19
|
+
issuer: String!
|
|
20
|
+
issuanceDate: DateTime!
|
|
21
|
+
credentialSubject: String!
|
|
22
|
+
|
|
23
|
+
"W3C VC Optional Fields"
|
|
24
|
+
expirationDate: DateTime
|
|
25
|
+
credentialStatus: CredentialStatus
|
|
26
|
+
|
|
27
|
+
"JWT Representation"
|
|
8
28
|
jwt: String
|
|
29
|
+
|
|
30
|
+
"Revocation tracking"
|
|
9
31
|
revoked: Boolean
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
audience: String
|
|
13
|
-
payload: String
|
|
32
|
+
revokedAt: DateTime
|
|
33
|
+
revocationReason: String
|
|
14
34
|
}
|
|
15
35
|
|
|
16
36
|
"""
|
|
@@ -41,20 +61,50 @@ export const schema = gql `
|
|
|
41
61
|
docId: PHID
|
|
42
62
|
input: RenownCredential_RevokeInput
|
|
43
63
|
): Int
|
|
64
|
+
RenownCredential_updateCredentialSubject(
|
|
65
|
+
driveId: String
|
|
66
|
+
docId: PHID
|
|
67
|
+
input: RenownCredential_UpdateCredentialSubjectInput
|
|
68
|
+
): Int
|
|
69
|
+
RenownCredential_setJwt(
|
|
70
|
+
driveId: String
|
|
71
|
+
docId: PHID
|
|
72
|
+
input: RenownCredential_SetJwtInput
|
|
73
|
+
): Int
|
|
74
|
+
RenownCredential_setCredentialStatus(
|
|
75
|
+
driveId: String
|
|
76
|
+
docId: PHID
|
|
77
|
+
input: RenownCredential_SetCredentialStatusInput
|
|
78
|
+
): Int
|
|
44
79
|
}
|
|
45
80
|
|
|
46
81
|
"""
|
|
47
82
|
Module: Manager
|
|
48
83
|
"""
|
|
49
84
|
input RenownCredential_InitInput {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
85
|
+
context: [String!]
|
|
86
|
+
id: String
|
|
87
|
+
type: [String!]
|
|
88
|
+
issuer: String!
|
|
89
|
+
issuanceDate: DateTime!
|
|
90
|
+
credentialSubject: String!
|
|
91
|
+
expirationDate: DateTime
|
|
56
92
|
}
|
|
57
93
|
input RenownCredential_RevokeInput {
|
|
58
|
-
|
|
94
|
+
revokedAt: DateTime!
|
|
95
|
+
reason: String
|
|
96
|
+
}
|
|
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!
|
|
59
109
|
}
|
|
60
110
|
`;
|