Skip to content

Commit

Permalink
refactor grant methods into util
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Aug 5, 2024
1 parent 50764d9 commit e2e1885
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/agent/src/store-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Web5PlatformAgent } from './types/agent.js';

import { TENANT_SEPARATOR } from './utils-internal.js';
import { getDataStoreTenant } from './utils-internal.js';
import { DwnInterface } from './types/dwn.js';
import { DwnInterface, DwnMessageParams } from './types/dwn.js';
import { ProtocolDefinition } from '@tbd54566975/dwn-sdk-js';

export type DataStoreTenantParams = {
Expand Down Expand Up @@ -74,9 +74,7 @@ export class DwnDataStore<TStoreObject extends Record<string, any> = Jwk> implem
/**
* Properties to use when writing and querying records with the DWN store.
*/
protected _recordProperties = {
dataFormat: 'application/json',
};
protected _recordProperties!: DwnMessageParams[DwnInterface.RecordsWrite];

public async delete({ id, agent, tenant }: DataStoreDeleteParams): Promise<boolean> {
// Determine the tenant identifier (DID) for the delete operation.
Expand Down
1 change: 1 addition & 0 deletions packages/agent/src/types/dwn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export {
DwnConstant,
Signer as DwnSigner,
DateSort as DwnDateSort,
DataEncodedRecordsWriteMessage as DwnDataEncodedRecordsWriteMessage,
PublicJwk as DwnPublicKeyJwk, // TODO: Remove once DWN SDK switches to Jwk from @web5/crypto
PaginationCursor as DwnPaginationCursor,
MessageSubscriptionHandler as DwnMessageSubscriptionHandler,
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/types/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export interface IdentityMetadata {
name: string;
tenant: string;
uri: string;
/** connectedDid is the DID which the identity acts on behalf of using permissions */
connectedDid?: string;
}

export interface PortableIdentity {
Expand Down

0 comments on commit e2e1885

Please sign in to comment.