@didcid/keymaster 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { Cipher, EcdsaJwkPublic } from '@didcid/cipher/types';
2
- import { GatekeeperInterface, DidCidDocument, ResolveDIDOptions } from '@didcid/gatekeeper/types';
2
+ import { GatekeeperInterface, DidCidDocument, ResolveDIDOptions, Proof } from '@didcid/gatekeeper/types';
3
3
  export interface Seed {
4
4
  /** Passphrase-encrypted mnemonic */
5
5
  mnemonicEnc?: {
@@ -60,11 +60,9 @@ export interface Group {
60
60
  name: string;
61
61
  members: string[];
62
62
  }
63
- export interface Signature {
64
- signer?: string;
65
- signed: string;
66
- hash: string;
67
- value: string;
63
+ export interface CredentialSchema {
64
+ id: string;
65
+ type: "JsonSchema";
68
66
  }
69
67
  export interface VerifiableCredential {
70
68
  "@context": string[];
@@ -72,17 +70,18 @@ export interface VerifiableCredential {
72
70
  issuer: string;
73
71
  validFrom: string;
74
72
  validUntil?: string;
73
+ credentialSchema?: CredentialSchema;
75
74
  credentialSubject?: {
76
75
  id: string;
76
+ [key: string]: unknown;
77
77
  };
78
- credential?: Record<string, unknown> | null;
79
- signature?: Signature;
78
+ proof?: Proof;
80
79
  }
81
80
  export interface IssueCredentialsOptions extends EncryptOptions {
82
81
  schema?: string;
83
82
  subject?: string;
84
83
  validFrom?: string;
85
- credential?: Record<string, unknown>;
84
+ claims?: Record<string, unknown>;
86
85
  }
87
86
  export interface Challenge {
88
87
  credentials?: {
@@ -165,7 +164,7 @@ export interface ImageAsset extends BinaryAsset {
165
164
  export interface FileAsset extends BinaryAsset {
166
165
  filename: string;
167
166
  }
168
- export interface GroupVault {
167
+ export interface Vault {
169
168
  version?: number;
170
169
  publicJwk: EcdsaJwkPublic;
171
170
  salt: string;
@@ -175,11 +174,11 @@ export interface GroupVault {
175
174
  items: string;
176
175
  sha256: string;
177
176
  }
178
- export interface GroupVaultOptions extends CreateAssetOptions {
177
+ export interface VaultOptions extends CreateAssetOptions {
179
178
  secretMembers?: boolean;
180
179
  version?: number;
181
180
  }
182
- export interface GroupVaultLogin {
181
+ export interface VaultLogin {
183
182
  service: string;
184
183
  username: string;
185
184
  password: string;
@@ -205,8 +204,8 @@ export interface EncryptedMessage {
205
204
  cipher_sender?: string | null;
206
205
  cipher_receiver?: string | null;
207
206
  }
208
- export interface PossiblySigned {
209
- signature?: Signature;
207
+ export interface PossiblyProofed {
208
+ proof?: Proof;
210
209
  }
211
210
  export interface RestClientOptions {
212
211
  url?: string;
@@ -291,10 +290,12 @@ export interface KeymasterInterface {
291
290
  testSchema(did: string): Promise<boolean>;
292
291
  listSchemas(owner?: string): Promise<string[]>;
293
292
  testAgent(did: string): Promise<boolean>;
294
- bindCredential(schema: string, subject: string, options?: {
293
+ bindCredential(subject: string, options?: {
294
+ schema?: string;
295
295
  validFrom?: string;
296
296
  validUntil?: string;
297
- credential?: Record<string, unknown>;
297
+ claims?: Record<string, unknown>;
298
+ types?: string[];
298
299
  }): Promise<VerifiableCredential>;
299
300
  issueCredential(credential: Partial<VerifiableCredential>, options?: IssueCredentialsOptions): Promise<string>;
300
301
  sendCredential(did: string, options?: CreateAssetOptions): Promise<string | null>;
@@ -340,15 +341,15 @@ export interface KeymasterInterface {
340
341
  updateDocument(did: string, data: Buffer, options?: FileAssetOptions): Promise<boolean>;
341
342
  getDocument(id: string): Promise<FileAsset | null>;
342
343
  testDocument(id: string): Promise<boolean>;
343
- createGroupVault(options?: CreateAssetOptions): Promise<string>;
344
- getGroupVault(vaultId: string, options?: ResolveDIDOptions): Promise<GroupVault>;
345
- testGroupVault(vaultId: string, options?: ResolveDIDOptions): Promise<boolean>;
346
- addGroupVaultMember(vaultId: string, memberId: string): Promise<boolean>;
347
- removeGroupVaultMember(vaultId: string, memberId: string): Promise<boolean>;
348
- addGroupVaultItem(vaultId: string, name: string, buffer: Buffer): Promise<boolean>;
349
- removeGroupVaultItem(vaultId: string, name: string): Promise<boolean>;
350
- listGroupVaultItems(vaultId: string, options?: ResolveDIDOptions): Promise<Record<string, any>>;
351
- getGroupVaultItem(vaultId: string, name: string, options?: ResolveDIDOptions): Promise<Buffer | null>;
344
+ createVault(options?: VaultOptions): Promise<string>;
345
+ getVault(vaultId: string, options?: ResolveDIDOptions): Promise<Vault>;
346
+ testVault(vaultId: string, options?: ResolveDIDOptions): Promise<boolean>;
347
+ addVaultMember(vaultId: string, memberId: string): Promise<boolean>;
348
+ removeVaultMember(vaultId: string, memberId: string): Promise<boolean>;
349
+ addVaultItem(vaultId: string, name: string, buffer: Buffer): Promise<boolean>;
350
+ removeVaultItem(vaultId: string, name: string): Promise<boolean>;
351
+ listVaultItems(vaultId: string, options?: ResolveDIDOptions): Promise<Record<string, any>>;
352
+ getVaultItem(vaultId: string, name: string, options?: ResolveDIDOptions): Promise<Buffer | null>;
352
353
  createDmail(message: DmailMessage, options?: CreateAssetOptions): Promise<string>;
353
354
  updateDmail(did: string, message: DmailMessage): Promise<boolean>;
354
355
  fileDmail(did: string, tags: string[]): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@didcid/keymaster",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Archon Keymaster",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.js",
@@ -159,5 +159,5 @@
159
159
  "type": "git",
160
160
  "url": "git+https://github.com/archetech/archon.git"
161
161
  },
162
- "gitHead": "d68898808e68e19dc5a3596dd2c68321931b744f"
162
+ "gitHead": "1563f84a36453fd632771eea93e1aa911e3ebc33"
163
163
  }