Skip to content

Commit

Permalink
fix: exporting interfaces for claim data.
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidgil committed May 12, 2021
1 parent 98322bd commit ac9d5d2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 27 deletions.
22 changes: 22 additions & 0 deletions src/cacheServerClient/cacheServerClient.types.ts
Expand Up @@ -105,6 +105,28 @@ export interface AssetHistory {
assetId?: string;
}

export interface AssetProfile {
name?: string;
icon?: string;
}

export interface AssetProfiles {
[key:string]: AssetProfile;
}

export interface Profile {
name?: string;
birthdate?: string;
address?: string;
assetProfiles?: AssetProfiles;
}

export interface ClaimData extends Record<string, unknown> {
profile?: Profile;
claimType?: string;
claimTypeVersion?: string;
}

export enum Order {
"ASC" = "ASC",
"DESC" = "DESC"
Expand Down
12 changes: 10 additions & 2 deletions src/iam-client-lib.ts
Expand Up @@ -34,7 +34,11 @@ import {
Asset,
AssetHistory,
AssetHistoryEventType,
Order
Order,
ClaimData,
Profile,
AssetProfiles,
AssetProfile
} from "./cacheServerClient/cacheServerClient.types";

import {
Expand Down Expand Up @@ -84,7 +88,11 @@ export {
IRole,
IRoleDefinition,
Asset,
AssetHistory
AssetHistory,
ClaimData,
Profile,
AssetProfiles,
AssetProfile
};

export { GnosisIam as SafeIam } from "./GnosisIam";
Expand Down
4 changes: 2 additions & 2 deletions src/iam.ts
Expand Up @@ -26,7 +26,7 @@ import { hashes, IProofData, ISaltedFields } from "@ew-did-registry/claims";
import { ProxyOperator } from "@ew-did-registry/proxyidentity";
import { namehash } from "./utils/ENS_hash";
import { v4 as uuid } from "uuid";
import { IAMBase, ClaimData } from "./iam/iam-base";
import { IAMBase} from "./iam/iam-base";
import {
CacheClientNotProvidedError,
ChangeOwnershipNotPossibleError,
Expand All @@ -38,7 +38,7 @@ import {
ERROR_MESSAGES
} from "./errors";
import {
AssetHistoryEventType,
AssetHistoryEventType, ClaimData,
IAppDefinition,
IOrganization,
IOrganizationDefinition,
Expand Down
25 changes: 2 additions & 23 deletions src/iam/iam-base.ts
Expand Up @@ -16,6 +16,7 @@ import { isBrowser } from "../utils/isBrowser";
import { connect, NatsConnection, JSONCodec, Codec } from "nats.ws";
import { ERROR_MESSAGES } from "../errors";
import {
ClaimData,
IAppDefinition,
IOrganizationDefinition,
IRoleDefinition
Expand Down Expand Up @@ -70,28 +71,6 @@ export type Transaction = {
from: string;
};

export interface AssetProfile {
name?: string;
icon?: string;
}

export interface AssetProfiles {
[key:string]: AssetProfile;
}

export interface Profile {
name?: string;
birthdate?: string;
address?: string;
assetProfiles?: AssetProfiles;
}

export interface ClaimData extends Record<string, unknown> {
profile?: Profile;
claimType?: string;
claimTypeVersion?: string;
}

/**
* @class
*/
Expand Down Expand Up @@ -194,7 +173,7 @@ export class IAMBase {
identityToken = fromCacheLogin?.identityToken;

// We need a pubKey to create DID document.
// So if didn't get one from cache server login, need to get in some other way.
// So if didn't get one from cache server login, need to get in some other way.
if (!publicKey && this._runningInBrowser) {
// Check local storage.
// This is to that publicKey can be reused when refreshing the page
Expand Down

0 comments on commit ac9d5d2

Please sign in to comment.