@ddd-qc/profiles-dvm 0.27.0 → 0.27.3

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,7 +1,8 @@
1
1
  import { Profile } from './profiles.types';
2
- import { AgentPubKey,
2
+ import {
3
3
  /** hdk/record.ts */
4
4
  Record as HcRecord } from '@holochain/client';
5
+ type AgentArray = Uint8Array;
5
6
  /** User defined external dependencies */
6
7
  import { ProfilesLinkType as LinkTypes } from "./profiles.integrity";
7
8
  import { ZomeProxy } from '@ddd-qc/lit-happ';
@@ -16,7 +17,8 @@ export declare class ProfilesProxy extends ZomeProxy {
16
17
  static readonly LINK_TYPES: LinkTypes[];
17
18
  createProfile(profile: Profile): Promise<HcRecord>;
18
19
  updateProfile(profile: Profile): Promise<HcRecord>;
19
- searchAgents(nicknameFilter: string): Promise<AgentPubKey[]>;
20
- getAgentProfile(agentPubKey: AgentPubKey): Promise<HcRecord | null>;
21
- getAgentsWithProfile(): Promise<AgentPubKey[]>;
20
+ searchAgents(nicknameFilter: string): Promise<AgentArray[]>;
21
+ getAgentProfile(agentPubKey: AgentArray): Promise<HcRecord | null>;
22
+ getAgentsWithProfile(): Promise<AgentArray[]>;
22
23
  }
24
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.proxy.js","sourceRoot":"","sources":["../../src/bindings/profiles.proxy.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAuJ1D,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,qBAAqB,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAExE;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAS;IAM1C,KAAK,CAAC,aAAa,CAAC,OAAgB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAAgB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,cAAsB;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,WAAwB;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;;AAvBe,+BAAiB,GAAG,UAAU,CAAC;AAC/B,sBAAQ,GAAG,qBAAqB,CAAC;AACjC,yBAAW,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC9C,wBAAU,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {EntryTypes, Signal, Profile, } from './profiles.types';\nimport {\nWebsocketConnectionOptions,\n/** types.ts */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nExternalHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nDuration,\nHoloHashed,\nNetworkInfo,\nFetchPoolInfo,\n/** hdk/action.ts */\nSignedActionHashed,\nRegisterAgentActivity,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** hdk/capabilities.ts */\nCapSecret,\nCapClaim,\nGrantedFunctionsType,\nGrantedFunctions,\nZomeCallCapGrant,\nCapAccessType,\nCapAccess,\nCapGrant,\n///** hdk/countersigning.ts */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** hdk/dht-ops.ts */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** hdk/entry.ts */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** hdk/record.ts */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** hdk/link.ts */\nAnyLinkableHash,\nZomeIndex,\nLinkType,\nLinkTag,\nRateWeight,\nRateBucketId,\nRateUnits,\nLink,\n/** api/admin/types.ts */\nInstalledAppInfoStatus,\nDeactivationReason,\nDisabledAppReason,\nStemCell,\nProvisionedCell,\nClonedCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioningStrategy,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nAppRoleDnaManifest,\nAppRoleManifest,\nAppManifest,\nAppBundle,\nAppBundleSource,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDhtOpHashB64,\n//DnaHashB64, (duplicate)\n//AnyDhtHashB64, (duplicate)\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n\n/** User defined external dependencies */\nimport {ProfilesLinkType as LinkTypes} from \"./profiles.integrity\"\n\nimport {ZomeProxy} from '@ddd-qc/lit-happ';\nimport {profilesFunctionNames} from './profiles.fn';\nimport {ProfilesUnitEnum, ProfilesLinkType} from './profiles.integrity';\n\n/**\n *\n */\nexport class ProfilesProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = \"profiles\";\n static readonly FN_NAMES = profilesFunctionNames;\n static readonly ENTRY_TYPES = Object.values(ProfilesUnitEnum);\n static readonly LINK_TYPES = Object.values(ProfilesLinkType);\n \n async createProfile(profile: Profile): Promise<HcRecord> {\n return this.call('create_profile', profile);\n }\n\n async updateProfile(profile: Profile): Promise<HcRecord> {\n return this.call('update_profile', profile);\n }\n\n async searchAgents(nicknameFilter: string): Promise<AgentPubKey[]> {\n return this.call('search_agents', nicknameFilter);\n }\n\n async getAgentProfile(agentPubKey: AgentPubKey): Promise<HcRecord | null> {\n return this.call('get_agent_profile', agentPubKey);\n }\n\n async getAgentsWithProfile(): Promise<AgentPubKey[]> {\n return this.call('get_agents_with_profile', null);\n }\n}\n"]}
1
+ {"version":3,"file":"profiles.proxy.js","sourceRoot":"","sources":["../../src/bindings/profiles.proxy.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAiK1D,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,qBAAqB,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAExE;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAS;IAM1C,KAAK,CAAC,aAAa,CAAC,OAAgB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAAgB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,cAAsB;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,WAAuB;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;;AAvBe,+BAAiB,GAAG,UAAU,CAAC;AAC/B,sBAAQ,GAAG,qBAAqB,CAAC;AACjC,yBAAW,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC9C,wBAAU,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {EntryTypes, Signal, Profile, } from './profiles.types';\nimport {\nWebsocketConnectionOptions,\n/** types.ts */\n//HoloHash,\n//AgentPubKey,\n//DnaHash,\n//WasmHash,\n//EntryHash,\n//ActionHash,\n//AnyDhtHash,\n//ExternalHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nDuration,\nHoloHashed,\nNetworkInfo,\nFetchPoolInfo,\n/** hdk/action.ts */\nSignedActionHashed,\nRegisterAgentActivity,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** hdk/capabilities.ts */\nCapSecret,\nCapClaim,\nGrantedFunctionsType,\nGrantedFunctions,\nZomeCallCapGrant,\nCapAccessType,\nCapAccess,\nCapGrant,\n///** hdk/countersigning.ts */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** hdk/dht-ops.ts */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** hdk/entry.ts */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** hdk/record.ts */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** hdk/link.ts */\nAnyLinkableHash,\nZomeIndex,\nLinkType,\nLinkTag,\nRateWeight,\nRateBucketId,\nRateUnits,\nLink,\n/** api/admin/types.ts */\nInstalledAppInfoStatus,\nDeactivationReason,\nDisabledAppReason,\nStemCell,\nProvisionedCell,\nClonedCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioningStrategy,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nAppRoleDnaManifest,\nAppRoleManifest,\nAppManifest,\nAppBundle,\nAppBundleSource,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\n\n/// Simple Hashes\ntype AgentArray = Uint8Array;\ntype DnaArray = Uint8Array;\ntype WasmArray = Uint8Array;\ntype EntryArray = Uint8Array;\ntype ActionArray = Uint8Array;\ntype AnyDhtArray = Uint8Array;\ntype AnyLinkableArray = Uint8Array;\n\nimport {\n/** Common */\nDhtOpHashB64,\n//DnaHashB64, (duplicate)\n//AnyDhtHashB64, (duplicate)\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n\n/** User defined external dependencies */\nimport {ProfilesLinkType as LinkTypes} from \"./profiles.integrity\"\n\nimport {ZomeProxy} from '@ddd-qc/lit-happ';\nimport {profilesFunctionNames} from './profiles.fn';\nimport {ProfilesUnitEnum, ProfilesLinkType} from './profiles.integrity';\n\n/**\n *\n */\nexport class ProfilesProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = \"profiles\";\n static readonly FN_NAMES = profilesFunctionNames;\n static readonly ENTRY_TYPES = Object.values(ProfilesUnitEnum);\n static readonly LINK_TYPES = Object.values(ProfilesLinkType);\n \n async createProfile(profile: Profile): Promise<HcRecord> {\n return this.call('create_profile', profile);\n }\n\n async updateProfile(profile: Profile): Promise<HcRecord> {\n return this.call('update_profile', profile);\n }\n\n async searchAgents(nicknameFilter: string): Promise<AgentArray[]> {\n return this.call('search_agents', nicknameFilter);\n }\n\n async getAgentProfile(agentPubKey: AgentArray): Promise<HcRecord | null> {\n return this.call('get_agent_profile', agentPubKey);\n }\n\n async getAgentsWithProfile(): Promise<AgentArray[]> {\n return this.call('get_agents_with_profile', null);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.types.js","sourceRoot":"","sources":["../../src/bindings/profiles.types.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAmM1D,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,qCAAmB,CAAA;AACpB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {\nWebsocketConnectionOptions,\n/** types.ts */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nExternalHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nDuration,\nHoloHashed,\nNetworkInfo,\nFetchPoolInfo,\n/** hdk/action.ts */\nSignedActionHashed,\nRegisterAgentActivity,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** hdk/capabilities.ts */\nCapSecret,\nCapClaim,\nGrantedFunctionsType,\nGrantedFunctions,\nZomeCallCapGrant,\nCapAccessType,\nCapAccess,\nCapGrant,\n///** hdk/countersigning.ts */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** hdk/dht-ops.ts */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** hdk/entry.ts */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** hdk/record.ts */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** hdk/link.ts */\nAnyLinkableHash,\nZomeIndex,\nLinkType,\nLinkTag,\nRateWeight,\nRateBucketId,\nRateUnits,\nLink,\n/** api/admin/types.ts */\nInstalledAppInfoStatus,\nDeactivationReason,\nDisabledAppReason,\nStemCell,\nProvisionedCell,\nClonedCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioningStrategy,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nAppRoleDnaManifest,\nAppRoleManifest,\nAppManifest,\nAppBundle,\nAppBundleSource,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDhtOpHashB64,\n//DnaHashB64, (duplicate)\n//AnyDhtHashB64, (duplicate)\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n\n/** User defined external dependencies */\nimport {ProfilesLinkType as LinkTypes} from \"./profiles.integrity\"\n\nexport type SignalVariantLinkCreated = {\n type: \"LinkCreated\"\n action: SignedActionHashed\n link_type: LinkTypes\n}\nexport type SignalVariantLinkDeleted = {\n type: \"LinkDeleted\"\n action: SignedActionHashed\n create_link_action: SignedActionHashed\n link_type: LinkTypes\n}\nexport type SignalVariantEntryCreated = {\n type: \"EntryCreated\"\n action: SignedActionHashed\n app_entry: EntryTypes\n}\nexport type SignalVariantEntryUpdated = {\n type: \"EntryUpdated\"\n action: SignedActionHashed\n app_entry: EntryTypes\n original_app_entry: EntryTypes\n}\nexport type SignalVariantEntryDeleted = {\n type: \"EntryDeleted\"\n action: SignedActionHashed\n original_app_entry: EntryTypes\n}\nexport type Signal =\n | SignalVariantLinkCreated\n | SignalVariantLinkDeleted\n | SignalVariantEntryCreated\n | SignalVariantEntryUpdated\n | SignalVariantEntryDeleted;\n\n/**\n * Profile entry definition.\n * \n * The profile must include at a minimum the nickname of the agent\n * in order to be able to search for agents by nickname.\n */\nexport interface Profile {\n nickname: string\n fields: Record<string, string>\n}\n\nexport enum EntryTypesType {\n\tProfile = 'Profile',\n}\nexport type EntryTypes = \n | {type: {Profile: null}, content: Profile}\n\n"]}
1
+ {"version":3,"file":"profiles.types.js","sourceRoot":"","sources":["../../src/bindings/profiles.types.ts"],"names":[],"mappings":"AAAA,0DAA0D;AA6M1D,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,qCAAmB,CAAA;AACpB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {\nWebsocketConnectionOptions,\n/** types.ts */\n//HoloHash,\n//AgentPubKey,\n//DnaHash,\n//WasmHash,\n//EntryHash,\n//ActionHash,\n//AnyDhtHash,\n//ExternalHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nDuration,\nHoloHashed,\nNetworkInfo,\nFetchPoolInfo,\n/** hdk/action.ts */\nSignedActionHashed,\nRegisterAgentActivity,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** hdk/capabilities.ts */\nCapSecret,\nCapClaim,\nGrantedFunctionsType,\nGrantedFunctions,\nZomeCallCapGrant,\nCapAccessType,\nCapAccess,\nCapGrant,\n///** hdk/countersigning.ts */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** hdk/dht-ops.ts */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** hdk/entry.ts */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** hdk/record.ts */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** hdk/link.ts */\nAnyLinkableHash,\nZomeIndex,\nLinkType,\nLinkTag,\nRateWeight,\nRateBucketId,\nRateUnits,\nLink,\n/** api/admin/types.ts */\nInstalledAppInfoStatus,\nDeactivationReason,\nDisabledAppReason,\nStemCell,\nProvisionedCell,\nClonedCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioningStrategy,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nAppRoleDnaManifest,\nAppRoleManifest,\nAppManifest,\nAppBundle,\nAppBundleSource,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\n\n/// Simple Hashes\ntype AgentArray = Uint8Array;\ntype DnaArray = Uint8Array;\ntype WasmArray = Uint8Array;\ntype EntryArray = Uint8Array;\ntype ActionArray = Uint8Array;\ntype AnyDhtArray = Uint8Array;\ntype AnyLinkableArray = Uint8Array;\n\nimport {\n/** Common */\nDhtOpHashB64,\n//DnaHashB64, (duplicate)\n//AnyDhtHashB64, (duplicate)\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n\n/** User defined external dependencies */\nimport {ProfilesLinkType as LinkTypes} from \"./profiles.integrity\"\n\nexport type SignalVariantLinkCreated = {\n type: \"LinkCreated\"\n action: SignedActionHashed\n link_type: LinkTypes\n}\nexport type SignalVariantLinkDeleted = {\n type: \"LinkDeleted\"\n action: SignedActionHashed\n create_link_action: SignedActionHashed\n link_type: LinkTypes\n}\nexport type SignalVariantEntryCreated = {\n type: \"EntryCreated\"\n action: SignedActionHashed\n app_entry: EntryTypes\n}\nexport type SignalVariantEntryUpdated = {\n type: \"EntryUpdated\"\n action: SignedActionHashed\n app_entry: EntryTypes\n original_app_entry: EntryTypes\n}\nexport type SignalVariantEntryDeleted = {\n type: \"EntryDeleted\"\n action: SignedActionHashed\n original_app_entry: EntryTypes\n}\nexport type Signal =\n | SignalVariantLinkCreated\n | SignalVariantLinkDeleted\n | SignalVariantEntryCreated\n | SignalVariantEntryUpdated\n | SignalVariantEntryDeleted;\n\n/**\n * Profile entry definition.\n * \n * The profile must include at a minimum the nickname of the agent\n * in order to be able to search for agents by nickname.\n */\nexport interface Profile {\n nickname: string\n fields: Record<string, string>\n}\n\nexport enum EntryTypesType {\n\tProfile = 'Profile',\n}\nexport type EntryTypes = \n | {type: {Profile: null}, content: Profile}\n\n"]}
@@ -1,5 +1,6 @@
1
1
  import { Profile } from './profilesAlt.types';
2
- import { AgentPubKey, ActionHash } from '@holochain/client';
2
+ type AgentArray = Uint8Array;
3
+ type ActionArray = Uint8Array;
3
4
  import { ZomeProxy } from '@ddd-qc/lit-happ';
4
5
  import { ProfilesAltUnitEnum, ProfilesAltLinkType } from './profilesAlt.integrity';
5
6
  /**
@@ -10,9 +11,10 @@ export declare class ProfilesAltProxy extends ZomeProxy {
10
11
  static readonly FN_NAMES: string[];
11
12
  static readonly ENTRY_TYPES: ProfilesAltUnitEnum.Profile[];
12
13
  static readonly LINK_TYPES: ProfilesAltLinkType[];
13
- createProfile(pair: [Profile, AgentPubKey]): Promise<ActionHash>;
14
- updateProfile(pair: [Profile, AgentPubKey]): Promise<ActionHash>;
15
- searchAgents(nicknameFilter: string): Promise<AgentPubKey[]>;
16
- findProfile(agentPubKey: AgentPubKey): Promise<[ActionHash, Profile] | null>;
14
+ createProfile(pair: [Profile, AgentArray]): Promise<ActionArray>;
15
+ updateProfile(pair: [Profile, AgentArray]): Promise<ActionArray>;
16
+ searchAgents(nicknameFilter: string): Promise<AgentArray[]>;
17
+ findProfile(agentPubKey: AgentArray): Promise<[ActionArray, Profile] | null>;
17
18
  probeProfiles(): Promise<void>;
18
19
  }
20
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"profilesAlt.proxy.js","sourceRoot":"","sources":["../../src/bindings/profilesAlt.proxy.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAoJ1D,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAEjF;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAM7C,KAAK,CAAC,aAAa,CAAC,IAA4B;QAC9C,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,IAA4B;QAC9C,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,cAAsB;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,WAAwB;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;;AAvBe,kCAAiB,GAAG,UAAU,CAAC;AAC/B,yBAAQ,GAAG,wBAAwB,CAAC;AACpC,4BAAW,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACjD,2BAAU,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {EntryTypes, Profile, } from './profilesAlt.types';\nimport {\nWebsocketConnectionOptions,\n/** types.ts */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nExternalHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nDuration,\nHoloHashed,\nNetworkInfo,\nFetchPoolInfo,\n/** hdk/action.ts */\nSignedActionHashed,\nRegisterAgentActivity,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** hdk/capabilities.ts */\nCapSecret,\nCapClaim,\nGrantedFunctionsType,\nGrantedFunctions,\nZomeCallCapGrant,\nCapAccessType,\nCapAccess,\nCapGrant,\n///** hdk/countersigning.ts */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** hdk/dht-ops.ts */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** hdk/entry.ts */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** hdk/record.ts */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** hdk/link.ts */\nAnyLinkableHash,\nZomeIndex,\nLinkType,\nLinkTag,\nRateWeight,\nRateBucketId,\nRateUnits,\nLink,\n/** api/admin/types.ts */\nInstalledAppInfoStatus,\nDeactivationReason,\nDisabledAppReason,\nStemCell,\nProvisionedCell,\nClonedCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioningStrategy,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nAppRoleDnaManifest,\nAppRoleManifest,\nAppManifest,\nAppBundle,\nAppBundleSource,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDhtOpHashB64,\n//DnaHashB64, (duplicate)\n//AnyDhtHashB64, (duplicate)\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n\nimport {ZomeProxy} from '@ddd-qc/lit-happ';\nimport {profilesAltFunctionNames} from './profilesAlt.fn';\nimport {ProfilesAltUnitEnum, ProfilesAltLinkType} from './profilesAlt.integrity';\n\n/**\n *\n */\nexport class ProfilesAltProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = \"profiles\";\n static readonly FN_NAMES = profilesAltFunctionNames;\n static readonly ENTRY_TYPES = Object.values(ProfilesAltUnitEnum);\n static readonly LINK_TYPES = Object.values(ProfilesAltLinkType);\n \n async createProfile(pair: [Profile, AgentPubKey]): Promise<ActionHash> {\n return this.callBlocking('create_profile', pair);\n }\n\n async updateProfile(pair: [Profile, AgentPubKey]): Promise<ActionHash> {\n return this.callBlocking('update_profile', pair);\n }\n\n async searchAgents(nicknameFilter: string): Promise<AgentPubKey[]> {\n return this.call('search_agents', nicknameFilter);\n }\n\n async findProfile(agentPubKey: AgentPubKey): Promise<[ActionHash, Profile] | null> {\n return this.call('find_profile', agentPubKey);\n }\n\n async probeProfiles(): Promise<void> {\n return this.callBlocking('probe_profiles', null);\n }\n}\n"]}
1
+ {"version":3,"file":"profilesAlt.proxy.js","sourceRoot":"","sources":["../../src/bindings/profilesAlt.proxy.ts"],"names":[],"mappings":"AAAA,0DAA0D;AA8J1D,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,wBAAwB,EAAC,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAEjF;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAM7C,KAAK,CAAC,aAAa,CAAC,IAA2B;QAC7C,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,IAA2B;QAC7C,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,cAAsB;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,WAAuB;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;;AAvBe,kCAAiB,GAAG,UAAU,CAAC;AAC/B,yBAAQ,GAAG,wBAAwB,CAAC;AACpC,4BAAW,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACjD,2BAAU,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {EntryTypes, Profile, } from './profilesAlt.types';\nimport {\nWebsocketConnectionOptions,\n/** types.ts */\n//HoloHash,\n//AgentPubKey,\n//DnaHash,\n//WasmHash,\n//EntryHash,\n//ActionHash,\n//AnyDhtHash,\n//ExternalHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nDuration,\nHoloHashed,\nNetworkInfo,\nFetchPoolInfo,\n/** hdk/action.ts */\nSignedActionHashed,\nRegisterAgentActivity,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** hdk/capabilities.ts */\nCapSecret,\nCapClaim,\nGrantedFunctionsType,\nGrantedFunctions,\nZomeCallCapGrant,\nCapAccessType,\nCapAccess,\nCapGrant,\n///** hdk/countersigning.ts */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** hdk/dht-ops.ts */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** hdk/entry.ts */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** hdk/record.ts */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** hdk/link.ts */\nAnyLinkableHash,\nZomeIndex,\nLinkType,\nLinkTag,\nRateWeight,\nRateBucketId,\nRateUnits,\nLink,\n/** api/admin/types.ts */\nInstalledAppInfoStatus,\nDeactivationReason,\nDisabledAppReason,\nStemCell,\nProvisionedCell,\nClonedCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioningStrategy,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nAppRoleDnaManifest,\nAppRoleManifest,\nAppManifest,\nAppBundle,\nAppBundleSource,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\n\n/// Simple Hashes\ntype AgentArray = Uint8Array;\ntype DnaArray = Uint8Array;\ntype WasmArray = Uint8Array;\ntype EntryArray = Uint8Array;\ntype ActionArray = Uint8Array;\ntype AnyDhtArray = Uint8Array;\ntype AnyLinkableArray = Uint8Array;\n\nimport {\n/** Common */\nDhtOpHashB64,\n//DnaHashB64, (duplicate)\n//AnyDhtHashB64, (duplicate)\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n\nimport {ZomeProxy} from '@ddd-qc/lit-happ';\nimport {profilesAltFunctionNames} from './profilesAlt.fn';\nimport {ProfilesAltUnitEnum, ProfilesAltLinkType} from './profilesAlt.integrity';\n\n/**\n *\n */\nexport class ProfilesAltProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = \"profiles\";\n static readonly FN_NAMES = profilesAltFunctionNames;\n static readonly ENTRY_TYPES = Object.values(ProfilesAltUnitEnum);\n static readonly LINK_TYPES = Object.values(ProfilesAltLinkType);\n \n async createProfile(pair: [Profile, AgentArray]): Promise<ActionArray> {\n return this.callBlocking('create_profile', pair);\n }\n\n async updateProfile(pair: [Profile, AgentArray]): Promise<ActionArray> {\n return this.callBlocking('update_profile', pair);\n }\n\n async searchAgents(nicknameFilter: string): Promise<AgentArray[]> {\n return this.call('search_agents', nicknameFilter);\n }\n\n async findProfile(agentPubKey: AgentArray): Promise<[ActionArray, Profile] | null> {\n return this.call('find_profile', agentPubKey);\n }\n\n async probeProfiles(): Promise<void> {\n return this.callBlocking('probe_profiles', null);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"profilesAlt.types.js","sourceRoot":"","sources":["../../src/bindings/profilesAlt.types.ts"],"names":[],"mappings":"AAAA,0DAA0D;AA8J1D,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,qCAAmB,CAAA;AACpB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {\nWebsocketConnectionOptions,\n/** types.ts */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nExternalHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nDuration,\nHoloHashed,\nNetworkInfo,\nFetchPoolInfo,\n/** hdk/action.ts */\nSignedActionHashed,\nRegisterAgentActivity,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** hdk/capabilities.ts */\nCapSecret,\nCapClaim,\nGrantedFunctionsType,\nGrantedFunctions,\nZomeCallCapGrant,\nCapAccessType,\nCapAccess,\nCapGrant,\n///** hdk/countersigning.ts */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** hdk/dht-ops.ts */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** hdk/entry.ts */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** hdk/record.ts */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** hdk/link.ts */\nAnyLinkableHash,\nZomeIndex,\nLinkType,\nLinkTag,\nRateWeight,\nRateBucketId,\nRateUnits,\nLink,\n/** api/admin/types.ts */\nInstalledAppInfoStatus,\nDeactivationReason,\nDisabledAppReason,\nStemCell,\nProvisionedCell,\nClonedCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioningStrategy,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nAppRoleDnaManifest,\nAppRoleManifest,\nAppManifest,\nAppBundle,\nAppBundleSource,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDhtOpHashB64,\n//DnaHashB64, (duplicate)\n//AnyDhtHashB64, (duplicate)\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n\n/**\n * Profile entry definition.\n * \n * The profile must include at a minimum the nickname of the agent\n * in order to be able to search for agents by nickname.\n */\nexport interface Profile {\n nickname: string\n fields: Record<string, string>\n}\n\nexport enum EntryTypesType {\n\tProfile = 'Profile',\n}\nexport type EntryTypes = \n | {type: {Profile: null}, content: Profile}\n\n"]}
1
+ {"version":3,"file":"profilesAlt.types.js","sourceRoot":"","sources":["../../src/bindings/profilesAlt.types.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAwK1D,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,qCAAmB,CAAA;AACpB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {\nWebsocketConnectionOptions,\n/** types.ts */\n//HoloHash,\n//AgentPubKey,\n//DnaHash,\n//WasmHash,\n//EntryHash,\n//ActionHash,\n//AnyDhtHash,\n//ExternalHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nDuration,\nHoloHashed,\nNetworkInfo,\nFetchPoolInfo,\n/** hdk/action.ts */\nSignedActionHashed,\nRegisterAgentActivity,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** hdk/capabilities.ts */\nCapSecret,\nCapClaim,\nGrantedFunctionsType,\nGrantedFunctions,\nZomeCallCapGrant,\nCapAccessType,\nCapAccess,\nCapGrant,\n///** hdk/countersigning.ts */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** hdk/dht-ops.ts */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** hdk/entry.ts */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** hdk/record.ts */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** hdk/link.ts */\nAnyLinkableHash,\nZomeIndex,\nLinkType,\nLinkTag,\nRateWeight,\nRateBucketId,\nRateUnits,\nLink,\n/** api/admin/types.ts */\nInstalledAppInfoStatus,\nDeactivationReason,\nDisabledAppReason,\nStemCell,\nProvisionedCell,\nClonedCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioningStrategy,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nAppRoleDnaManifest,\nAppRoleManifest,\nAppManifest,\nAppBundle,\nAppBundleSource,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\n\n/// Simple Hashes\ntype AgentArray = Uint8Array;\ntype DnaArray = Uint8Array;\ntype WasmArray = Uint8Array;\ntype EntryArray = Uint8Array;\ntype ActionArray = Uint8Array;\ntype AnyDhtArray = Uint8Array;\ntype AnyLinkableArray = Uint8Array;\n\nimport {\n/** Common */\nDhtOpHashB64,\n//DnaHashB64, (duplicate)\n//AnyDhtHashB64, (duplicate)\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n\n/**\n * Profile entry definition.\n * \n * The profile must include at a minimum the nickname of the agent\n * in order to be able to search for agents by nickname.\n */\nexport interface Profile {\n nickname: string\n fields: Record<string, string>\n}\n\nexport enum EntryTypesType {\n\tProfile = 'Profile',\n}\nexport type EntryTypes = \n | {type: {Profile: null}, content: Profile}\n\n"]}
@@ -76,7 +76,7 @@ export class ProfilesAltPerspective {
76
76
  for (const [agentId, profileAh] of this.profileByAgent.entries()) {
77
77
  const pair = this.profiles.get(profileAh);
78
78
  if (pair) {
79
- all.push([agentId, profileAh, pair[0], pair[1]]);
79
+ all.push([agentId.b64, profileAh.b64, pair[0], pair[1]]);
80
80
  }
81
81
  }
82
82
  /** */
@@ -127,8 +127,8 @@ export class ProfilesAltPerspectiveMutable extends ProfilesAltPerspective {
127
127
  this.profileByAgent.clear();
128
128
  this.agentByName = {};
129
129
  /** Store */
130
- for (const [agent, profileB64, profile, ts] of snapshot.all) {
131
- const agentId = new AgentId(agent);
130
+ for (const [agentB64, profileB64, profile, ts] of snapshot.all) {
131
+ const agentId = new AgentId(agentB64);
132
132
  const profileAh = new ActionId(profileB64);
133
133
  this.storeAgentProfile(agentId, profileAh);
134
134
  this.storeProfile(profileAh, profile, ts);
@@ -1 +1 @@
1
- {"version":3,"file":"profilesAlt.perspective.js","sourceRoot":"","sources":["../src/profilesAlt.perspective.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAWhG,MAAM;AACN,MAAM,O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AC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC3C,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,CAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;CAEF","sourcesContent":["import {ActionId, ActionIdMap, AgentId, AgentIdMap, assertAllDefined} from \"@ddd-qc/cell-proxy\";\r\nimport {Profile} from \"./bindings/profiles.types\";\r\nimport {ActionHashB64, AgentPubKeyB64, Timestamp} from \"@holochain/client\";\r\n\r\n\r\n/** */\r\nexport interface ProfilesAltSnapshot {\r\n all: [AgentPubKeyB64, ActionHashB64, Profile, Timestamp][];\r\n}\r\n\r\n\r\n/** */\r\nexport class ProfilesAltPerspective {\r\n /* ActionId -> Profile */\r\n profiles: ActionIdMap<[Profile, Timestamp]> = new ActionIdMap();\r\n /* AgentId -> ActionId */\r\n profileByAgent: AgentIdMap<ActionId> = new AgentIdMap();\r\n\r\n /** -- Extra -- */\r\n /* Name -> AgentId */\r\n agentByName: Record<string, AgentId> = {};\r\n\r\n\r\n /** -- Methods -- */\r\n\r\n equals(_other: ProfilesAltPerspective) {\r\n // TODO\r\n return false;\r\n }\r\n\r\n /** -- Getters -- */\r\n\r\n get agents(): AgentId[] { return Array.from(this.profileByAgent.keys())}\r\n get names(): string[] { return Object.keys(this.agentByName)}\r\n\r\n /** */\r\n getProfileAgent(profileId: ActionId): AgentId | undefined {\r\n for (const [agentId, profId] of this.profileByAgent.entries()) {\r\n if (profileId.b64 == profId.b64) {\r\n return agentId;\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n\r\n /** */\r\n getProfile(agent: AgentId | string): Profile | undefined {\r\n if (typeof agent == \"string\") {\r\n agent = this.agentByName[agent];\r\n if (!agent) {\r\n return;\r\n }\r\n }\r\n const profileAh = this.profileByAgent.get(agent);\r\n //console.log(\"ProfilesAltZvm.getProfile()\", agent, profileAh);\r\n if (!profileAh) {\r\n return undefined;\r\n }\r\n const pair = this.profiles.get(profileAh);\r\n //console.log(\"ProfilesAltZvm.getProfile() pair\", pair);\r\n if (!pair) {\r\n return undefined;\r\n }\r\n return pair[0];\r\n }\r\n\r\n\r\n /** */\r\n getProfileTs(agent: AgentId | string): Timestamp | undefined {\r\n if (typeof agent == \"string\") {\r\n agent = this.agentByName[agent];\r\n if (!agent) {\r\n return;\r\n }\r\n }\r\n const profileAh = this.profileByAgent.get(agent);\r\n if (!profileAh) {\r\n return undefined;\r\n }\r\n const pair = this.profiles.get(profileAh);\r\n if (!pair) {\r\n return undefined;\r\n }\r\n return pair[1];\r\n }\r\n\r\n /** */\r\n getAgent(nickname: string): AgentId | undefined {\r\n return this.agentByName[nickname];\r\n }\r\n\r\n\r\n /** -- Memento -- */\r\n\r\n /** TODO: deep copy */\r\n makeSnapshot(): ProfilesAltSnapshot {\r\n let all = [];\r\n for (const [agentId, profileAh] of this.profileByAgent.entries()) {\r\n const pair = this.profiles.get(profileAh);\r\n if (pair) {\r\n all.push([agentId, profileAh, pair[0], pair[1]])\r\n }\r\n }\r\n /** */\r\n return {all}\r\n }\r\n}\r\n\r\n\r\n/** */\r\nexport class ProfilesAltPerspectiveMutable extends ProfilesAltPerspective {\r\n\r\n get readonly(): ProfilesAltPerspective {\r\n return this;\r\n }\r\n\r\n /** -- Store -- */\r\n\r\n /** */\r\n storeProfile(profileAh: ActionId, profile: Profile, ts: Timestamp) {\r\n console.debug(\"ProfilesAltZvm.storeProfile()\", profileAh.short, profile.nickname);\r\n assertAllDefined(profileAh, profile, ts);\r\n this.profiles.set(profileAh, [profile, ts]);\r\n const agentId = this.getProfileAgent(profileAh);\r\n if (agentId) {\r\n this.agentByName[profile.nickname] = agentId;\r\n }\r\n }\r\n\r\n /** */\r\n storeAgentProfile(agentId: AgentId, profileAh: ActionId) {\r\n console.debug(\"ProfilesAltZvm.storeAgentProfile()\", agentId.short, profileAh.short);\r\n assertAllDefined(agentId, profileAh);\r\n this.profileByAgent.set(agentId, profileAh);\r\n const pair = this.profiles.get(profileAh);\r\n if (pair) {\r\n this.agentByName[pair[0].nickname] = agentId;\r\n }\r\n }\r\n\r\n /** */\r\n unstoreAgentProfile(agentId: AgentId, profileAh: ActionId) {\r\n console.debug(\"ProfilesAltZvm.unstoreAgentProfile()\", agentId.short, profileAh.short);\r\n assertAllDefined(agentId, profileAh);\r\n this.profileByAgent.delete(agentId);\r\n const pair = this.profiles.get(profileAh);\r\n if (pair) {\r\n delete this.agentByName[pair[0].nickname];\r\n }\r\n }\r\n\r\n\r\n /** -- Memento -- */\r\n\r\n /** */\r\n restore(snapshot: ProfilesAltSnapshot) {\r\n /** Clear */\r\n this.profiles.clear();\r\n this.profileByAgent.clear();\r\n this.agentByName = {};\r\n /** Store */\r\n for (const [agent, profileB64, profile, ts] of snapshot.all) {\r\n const agentId = new AgentId(agent);\r\n const profileAh = new ActionId(profileB64);\r\n this.storeAgentProfile(agentId, profileAh);\r\n this.storeProfile(profileAh, profile, ts);\r\n }\r\n }\r\n\r\n\r\n /** -- Generate -- */\r\n\r\n /** */\r\n async generateRandomProfile(nickname: string, ts?: Timestamp, fields?: Record<string, string>) {\r\n const agentId = await AgentId.random();\r\n const profileAh = await ActionId.random();\r\n const profile: Profile = {nickname, fields};\r\n this.storeAgentProfile(agentId, profileAh);\r\n this.storeProfile(profileAh, profile, ts? ts : 0);\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"profilesAlt.perspective.js","sourceRoot":"","sources":["../src/profilesAlt.perspective.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAWhG,MAAM;AACN,MAAM,OAAO,sBAAsB;IAAnC;QACE,yBAAyB;QACzB,aAAQ,GAAsC,IAAI,WAAW,EAAE,CAAC;QAChE,yBAAyB;QACzB,mBAAc,GAAyB,IAAI,UAAU,EAAE,CAAC;QAExD,mBAAmB;QACnB,qBAAqB;Q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AAC,CAAC,CAAC;IACpD,CAAC;CAEF","sourcesContent":["import {ActionId, ActionIdMap, AgentId, AgentIdMap, assertAllDefined} from \"@ddd-qc/cell-proxy\";\r\nimport {Profile} from \"./bindings/profiles.types\";\r\nimport {ActionHashB64, AgentPubKeyB64, Timestamp} from \"@holochain/client\";\r\n\r\n\r\n/** */\r\nexport interface ProfilesAltSnapshot {\r\n all: [AgentPubKeyB64, ActionHashB64, Profile, Timestamp][];\r\n}\r\n\r\n\r\n/** */\r\nexport class ProfilesAltPerspective {\r\n /* ActionId -> Profile */\r\n profiles: ActionIdMap<[Profile, Timestamp]> = new ActionIdMap();\r\n /* AgentId -> ActionId */\r\n profileByAgent: AgentIdMap<ActionId> = new AgentIdMap();\r\n\r\n /** -- Extra -- */\r\n /* Name -> AgentId */\r\n agentByName: Record<string, AgentId> = {};\r\n\r\n\r\n /** -- Methods -- */\r\n\r\n equals(_other: ProfilesAltPerspective) {\r\n // TODO\r\n return false;\r\n }\r\n\r\n /** -- Getters -- */\r\n\r\n get agents(): AgentId[] { return Array.from(this.profileByAgent.keys())}\r\n get names(): string[] { return Object.keys(this.agentByName)}\r\n\r\n /** */\r\n getProfileAgent(profileId: ActionId): AgentId | undefined {\r\n for (const [agentId, profId] of this.profileByAgent.entries()) {\r\n if (profileId.b64 == profId.b64) {\r\n return agentId;\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n\r\n /** */\r\n getProfile(agent: AgentId | string): Profile | undefined {\r\n if (typeof agent == \"string\") {\r\n agent = this.agentByName[agent];\r\n if (!agent) {\r\n return;\r\n }\r\n }\r\n const profileAh = this.profileByAgent.get(agent);\r\n //console.log(\"ProfilesAltZvm.getProfile()\", agent, profileAh);\r\n if (!profileAh) {\r\n return undefined;\r\n }\r\n const pair = this.profiles.get(profileAh);\r\n //console.log(\"ProfilesAltZvm.getProfile() pair\", pair);\r\n if (!pair) {\r\n return undefined;\r\n }\r\n return pair[0];\r\n }\r\n\r\n\r\n /** */\r\n getProfileTs(agent: AgentId | string): Timestamp | undefined {\r\n if (typeof agent == \"string\") {\r\n agent = this.agentByName[agent];\r\n if (!agent) {\r\n return;\r\n }\r\n }\r\n const profileAh = this.profileByAgent.get(agent);\r\n if (!profileAh) {\r\n return undefined;\r\n }\r\n const pair = this.profiles.get(profileAh);\r\n if (!pair) {\r\n return undefined;\r\n }\r\n return pair[1];\r\n }\r\n\r\n /** */\r\n getAgent(nickname: string): AgentId | undefined {\r\n return this.agentByName[nickname];\r\n }\r\n\r\n\r\n /** -- Memento -- */\r\n\r\n /** TODO: deep copy */\r\n makeSnapshot(): ProfilesAltSnapshot {\r\n let all: [AgentPubKeyB64, ActionHashB64, Profile, Timestamp][] = [];\r\n for (const [agentId, profileAh] of this.profileByAgent.entries()) {\r\n const pair = this.profiles.get(profileAh);\r\n if (pair) {\r\n all.push([agentId.b64, profileAh.b64, pair[0], pair[1]])\r\n }\r\n }\r\n /** */\r\n return {all};\r\n }\r\n}\r\n\r\n\r\n/** */\r\nexport class ProfilesAltPerspectiveMutable extends ProfilesAltPerspective {\r\n\r\n get readonly(): ProfilesAltPerspective {\r\n return this;\r\n }\r\n\r\n /** -- Store -- */\r\n\r\n /** */\r\n storeProfile(profileAh: ActionId, profile: Profile, ts: Timestamp) {\r\n console.debug(\"ProfilesAltZvm.storeProfile()\", profileAh.short, profile.nickname);\r\n assertAllDefined(profileAh, profile, ts);\r\n this.profiles.set(profileAh, [profile, ts]);\r\n const agentId = this.getProfileAgent(profileAh);\r\n if (agentId) {\r\n this.agentByName[profile.nickname] = agentId;\r\n }\r\n }\r\n\r\n /** */\r\n storeAgentProfile(agentId: AgentId, profileAh: ActionId) {\r\n console.debug(\"ProfilesAltZvm.storeAgentProfile()\", agentId.short, profileAh.short);\r\n assertAllDefined(agentId, profileAh);\r\n this.profileByAgent.set(agentId, profileAh);\r\n const pair = this.profiles.get(profileAh);\r\n if (pair) {\r\n this.agentByName[pair[0].nickname] = agentId;\r\n }\r\n }\r\n\r\n /** */\r\n unstoreAgentProfile(agentId: AgentId, profileAh: ActionId) {\r\n console.debug(\"ProfilesAltZvm.unstoreAgentProfile()\", agentId.short, profileAh.short);\r\n assertAllDefined(agentId, profileAh);\r\n this.profileByAgent.delete(agentId);\r\n const pair = this.profiles.get(profileAh);\r\n if (pair) {\r\n delete this.agentByName[pair[0].nickname];\r\n }\r\n }\r\n\r\n\r\n /** -- Memento -- */\r\n\r\n /** */\r\n restore(snapshot: ProfilesAltSnapshot) {\r\n /** Clear */\r\n this.profiles.clear();\r\n this.profileByAgent.clear();\r\n this.agentByName = {};\r\n /** Store */\r\n for (const [agentB64, profileB64, profile, ts] of snapshot.all) {\r\n const agentId = new AgentId(agentB64);\r\n const profileAh = new ActionId(profileB64);\r\n this.storeAgentProfile(agentId, profileAh);\r\n this.storeProfile(profileAh, profile, ts);\r\n }\r\n }\r\n\r\n\r\n /** -- Generate -- */\r\n\r\n /** */\r\n async generateRandomProfile(nickname: string, ts?: Timestamp, fields?: Record<string, string>) {\r\n const agentId = await AgentId.random();\r\n const profileAh = await ActionId.random();\r\n const profile: Profile = {nickname, fields};\r\n this.storeAgentProfile(agentId, profileAh);\r\n this.storeProfile(profileAh, profile, ts? ts : 0);\r\n }\r\n\r\n}\r\n"]}
@@ -4,7 +4,6 @@ import { ProfilesAltProxy } from "./bindings/profilesAlt.proxy";
4
4
  import { ProfilesLinkType } from "./bindings/profiles.integrity";
5
5
  import { ProfilesAltUnitEnum } from "./bindings/profilesAlt.integrity";
6
6
  import { ProfilesAltPerspectiveMutable } from "./profilesAlt.perspective";
7
- import { HoloHash } from "@holochain/client";
8
7
  /**
9
8
  *
10
9
  */
@@ -83,7 +82,7 @@ export class ProfilesAltZvm extends ZomeViewModelWithSignals {
83
82
  }
84
83
  /** */
85
84
  async findProfile(agentId) {
86
- const maybeProfilePair = await this.zomeProxy.findProfile(new HoloHash(agentId.hash));
85
+ const maybeProfilePair = await this.zomeProxy.findProfile(agentId.hash);
87
86
  console.log("findProfile()", agentId, maybeProfilePair);
88
87
  if (!maybeProfilePair) {
89
88
  return;
@@ -92,19 +91,19 @@ export class ProfilesAltZvm extends ZomeViewModelWithSignals {
92
91
  }
93
92
  /** */
94
93
  async createMyProfile(profile) {
95
- const _ah = await this.zomeProxy.createProfile([profile, new HoloHash(this.cell.address.agentId.hash)]);
94
+ const _ah = await this.zomeProxy.createProfile([profile, this.cell.address.agentId.hash]);
96
95
  }
97
96
  /** */
98
97
  async updateMyProfile(profile) {
99
- const _ah = await this.zomeProxy.updateProfile([profile, new HoloHash(this.cell.address.agentId.hash)]);
98
+ const _ah = await this.zomeProxy.updateProfile([profile, this.cell.address.agentId.hash]);
100
99
  }
101
100
  /** */
102
101
  async createProfile(profile, agentId) {
103
- const _ah = await this.zomeProxy.createProfile([profile, new HoloHash(agentId.hash)]);
102
+ const _ah = await this.zomeProxy.createProfile([profile, agentId.hash]);
104
103
  }
105
104
  /** */
106
105
  async updateProfile(profile, agentId) {
107
- const _ah = await this.zomeProxy.updateProfile([profile, new HoloHash(agentId.hash)]);
106
+ const _ah = await this.zomeProxy.updateProfile([profile, agentId.hash]);
108
107
  }
109
108
  /** -- Import / Export -- */
110
109
  /** Dump perspective as JSON */
@@ -1 +1 @@
1
- {"version":3,"file":"profilesAlt.zvm.js","sourceRoot":"","sources":["../src/profilesAlt.zvm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EAEP,eAAe,EACf,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAEL,6BAA6B,EAE9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAC,QAAQ,EAAC,MAAM,m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,YAAY,CAAC,YAAY,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;IAGD,MAAM;IACN,MAAM,CAAC,IAAY,EAAE,WAAoB;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAwB,CAAC;QACzD,oBAAoB;QACpB,gFAAgF;QAChF,kDAAkD;QAClD,MAAM;QACN,YAAY;QACZ,IAAI;QACJ,MAAM;QACN,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IACrC,CAAC;;AAnJe,yBAAU,GAAG,gBAAgB,AAAnB,CAAoB","sourcesContent":["import {\n ActionId,\n AgentId,\n EntryId,\n LinkPulseMat,\n StateChangeType,\n ZomeViewModelWithSignals\n} from \"@ddd-qc/lit-happ\";\nimport {Profile} from \"./bindings/profiles.types\";\nimport {decode} from \"@msgpack/msgpack\";\nimport {ProfilesAltProxy} from \"./bindings/profilesAlt.proxy\";\nimport {EntryPulseMat} from \"@ddd-qc/lit-happ/dist/ZomeViewModelWithSignals\";\nimport {ProfilesLinkType} from \"./bindings/profiles.integrity\";\nimport {ProfilesAltUnitEnum} from \"./bindings/profilesAlt.integrity\";\nimport {\n ProfilesAltPerspective,\n ProfilesAltPerspectiveMutable,\n ProfilesAltSnapshot\n} from \"./profilesAlt.perspective\";\nimport {HoloHash} from \"@holochain/client\";\n\n\n/**\n *\n */\nexport class ProfilesAltZvm extends ZomeViewModelWithSignals {\n\n /** -- Concret -- */\n\n static readonly ZOME_PROXY = ProfilesAltProxy;\n get zomeProxy(): ProfilesAltProxy {return this._zomeProxy as ProfilesAltProxy;}\n\n\n /* */\n protected hasChanged(): boolean {\n return !this.perspective.equals(this._previousPerspective as ProfilesAltPerspective);\n }\n\n\n /** */\n async initializePerspectiveOnline(): Promise<void> {\n await this.probeAllProfiles();\n }\n\n\n /** */\n probeAllInner() {\n this.probeAllProfiles();\n }\n\n\n /* */\n get perspective(): ProfilesAltPerspective {\n return this._perspective.readonly;\n }\n\n\n /** -- */\n\n private _perspective: ProfilesAltPerspectiveMutable = new ProfilesAltPerspectiveMutable();\n\n\n /** -- Getters -- */\n\n getMyProfile(): Profile | undefined {\n return this._perspective.getProfile(this.cell.address.agentId);\n }\n\n\n\n /** -- Signals -- */\n\n /** */\n async handleLinkPulse(pulse: LinkPulseMat, _from: AgentId): Promise<void> {\n switch (pulse.link_type) {\n case ProfilesLinkType.PrefixPath:\n case ProfilesLinkType.PathToAgent: {\n const agentEh = new EntryId(pulse.target.b64);\n const agentId = AgentId.from(agentEh);\n if (pulse.state != StateChangeType.Delete) {\n await this.findProfile(agentId);\n }\n }\n break;\n case ProfilesLinkType.AgentToProfile: {\n const agentEh = new EntryId(pulse.base.b64); // Make sure its an EntryHash\n const agentId = AgentId.from(agentEh);\n const profileAh = ActionId.from(pulse.target);\n if (pulse.state == StateChangeType.Delete) {\n this._perspective.unstoreAgentProfile(agentId, profileAh)\n } else {\n this._perspective.storeAgentProfile(agentId, profileAh)\n }\n }\n break;\n }\n }\n\n\n /** */\n async handleEntryPulse(pulse: EntryPulseMat, _from: AgentId) {\n switch (pulse.entryType) {\n case ProfilesAltUnitEnum.Profile:\n const profile = decode(pulse.bytes) as Profile;\n if (pulse.state != StateChangeType.Delete) {\n this._perspective.storeProfile(pulse.ah, profile, pulse.ts);\n }\n break;\n }\n }\n\n\n /** -- Methods -- */\n\n /** */\n async probeAllProfiles()/*: Promise<Record<AgentPubKeyB64, ProfileMat>>*/ {\n await this.zomeProxy.probeProfiles();\n }\n\n\n /** */\n async findProfile(agentId: AgentId): Promise<Profile | undefined> {\n const maybeProfilePair = await this.zomeProxy.findProfile(new HoloHash(agentId.hash));\n console.log(\"findProfile()\", agentId, maybeProfilePair);\n if (!maybeProfilePair) {\n return;\n }\n return maybeProfilePair[1];\n }\n\n\n /** */\n async createMyProfile(profile: Profile): Promise<void> {\n const _ah = await this.zomeProxy.createProfile([profile, new HoloHash(this.cell.address.agentId.hash)]);\n }\n\n\n /** */\n async updateMyProfile(profile: Profile): Promise<void> {\n const _ah = await this.zomeProxy.updateProfile([profile, new HoloHash(this.cell.address.agentId.hash)]);\n }\n\n\n /** */\n async createProfile(profile: Profile, agentId: AgentId): Promise<void> {\n const _ah = await this.zomeProxy.createProfile([profile, new HoloHash(agentId.hash)]);\n }\n\n\n /** */\n async updateProfile(profile: Profile, agentId: AgentId): Promise<void> {\n const _ah = await this.zomeProxy.updateProfile([profile, new HoloHash(agentId.hash)]);\n }\n\n\n /** -- Import / Export -- */\n\n /** Dump perspective as JSON */\n export(): string {\n //console.log(\"exportPerspective()\", perspMat);\n const snapshot = this._perspective.makeSnapshot();\n return JSON.stringify(snapshot, null, 2);\n }\n\n\n /** */\n import(json: string, _canPublish: boolean) {\n const snapshot = JSON.parse(json) as ProfilesAltSnapshot;\n // if (canPublish) {\n // for (const [profileAh, [profile, _ts]] of perspective.profiles.entries()) {\n // await this.createProfile(profile, agentId);\n // }\n // return;\n // }\n /** */\n this._perspective.restore(snapshot)\n }\n}\n"]}
1
+ {"version":3,"file":"profilesAlt.zvm.js","sourceRoot":"","sources":["../src/profilesAlt.zvm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EAEP,eAAe,EACf,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAEL,6BAA6B,EAE9B,MAAM,2BAA2B,CAAC;AAGnC;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,wBAAwB;IAA5D;QAEE,oBAAoB;;QA8BpB,SAAS;QAED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wB,CAAC;QACzD,oBAAoB;QACpB,gFAAgF;QAChF,kDAAkD;QAClD,MAAM;QACN,YAAY;QACZ,IAAI;QACJ,MAAM;QACN,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IACrC,CAAC;;AAnJe,yBAAU,GAAG,gBAAgB,AAAnB,CAAoB","sourcesContent":["import {\n ActionId,\n AgentId,\n EntryId,\n LinkPulseMat,\n StateChangeType,\n ZomeViewModelWithSignals\n} from \"@ddd-qc/lit-happ\";\nimport {Profile} from \"./bindings/profiles.types\";\nimport {decode} from \"@msgpack/msgpack\";\nimport {ProfilesAltProxy} from \"./bindings/profilesAlt.proxy\";\nimport {EntryPulseMat} from \"@ddd-qc/lit-happ/dist/ZomeViewModelWithSignals\";\nimport {ProfilesLinkType} from \"./bindings/profiles.integrity\";\nimport {ProfilesAltUnitEnum} from \"./bindings/profilesAlt.integrity\";\nimport {\n ProfilesAltPerspective,\n ProfilesAltPerspectiveMutable,\n ProfilesAltSnapshot\n} from \"./profilesAlt.perspective\";\n\n\n/**\n *\n */\nexport class ProfilesAltZvm extends ZomeViewModelWithSignals {\n\n /** -- Concret -- */\n\n static readonly ZOME_PROXY = ProfilesAltProxy;\n get zomeProxy(): ProfilesAltProxy {return this._zomeProxy as ProfilesAltProxy;}\n\n\n /* */\n protected hasChanged(): boolean {\n return !this.perspective.equals(this._previousPerspective as ProfilesAltPerspective);\n }\n\n\n /** */\n async initializePerspectiveOnline(): Promise<void> {\n await this.probeAllProfiles();\n }\n\n\n /** */\n probeAllInner() {\n this.probeAllProfiles();\n }\n\n\n /* */\n get perspective(): ProfilesAltPerspective {\n return this._perspective.readonly;\n }\n\n\n /** -- */\n\n private _perspective: ProfilesAltPerspectiveMutable = new ProfilesAltPerspectiveMutable();\n\n\n /** -- Getters -- */\n\n getMyProfile(): Profile | undefined {\n return this._perspective.getProfile(this.cell.address.agentId);\n }\n\n\n\n /** -- Signals -- */\n\n /** */\n async handleLinkPulse(pulse: LinkPulseMat, _from: AgentId): Promise<void> {\n switch (pulse.link_type) {\n case ProfilesLinkType.PrefixPath:\n case ProfilesLinkType.PathToAgent: {\n const agentEh = new EntryId(pulse.target.b64);\n const agentId = AgentId.from(agentEh);\n if (pulse.state != StateChangeType.Delete) {\n await this.findProfile(agentId);\n }\n }\n break;\n case ProfilesLinkType.AgentToProfile: {\n const agentEh = new EntryId(pulse.base.b64); // Make sure its an EntryHash\n const agentId = AgentId.from(agentEh);\n const profileAh = ActionId.from(pulse.target);\n if (pulse.state == StateChangeType.Delete) {\n this._perspective.unstoreAgentProfile(agentId, profileAh)\n } else {\n this._perspective.storeAgentProfile(agentId, profileAh)\n }\n }\n break;\n }\n }\n\n\n /** */\n async handleEntryPulse(pulse: EntryPulseMat, _from: AgentId) {\n switch (pulse.entryType) {\n case ProfilesAltUnitEnum.Profile:\n const profile = decode(pulse.bytes) as Profile;\n if (pulse.state != StateChangeType.Delete) {\n this._perspective.storeProfile(pulse.ah, profile, pulse.ts);\n }\n break;\n }\n }\n\n\n /** -- Methods -- */\n\n /** */\n async probeAllProfiles()/*: Promise<Record<AgentPubKeyB64, ProfileMat>>*/ {\n await this.zomeProxy.probeProfiles();\n }\n\n\n /** */\n async findProfile(agentId: AgentId): Promise<Profile | undefined> {\n const maybeProfilePair = await this.zomeProxy.findProfile(agentId.hash);\n console.log(\"findProfile()\", agentId, maybeProfilePair);\n if (!maybeProfilePair) {\n return;\n }\n return maybeProfilePair[1];\n }\n\n\n /** */\n async createMyProfile(profile: Profile): Promise<void> {\n const _ah = await this.zomeProxy.createProfile([profile, this.cell.address.agentId.hash]);\n }\n\n\n /** */\n async updateMyProfile(profile: Profile): Promise<void> {\n const _ah = await this.zomeProxy.updateProfile([profile, this.cell.address.agentId.hash]);\n }\n\n\n /** */\n async createProfile(profile: Profile, agentId: AgentId): Promise<void> {\n const _ah = await this.zomeProxy.createProfile([profile, agentId.hash]);\n }\n\n\n /** */\n async updateProfile(profile: Profile, agentId: AgentId): Promise<void> {\n const _ah = await this.zomeProxy.updateProfile([profile, agentId.hash]);\n }\n\n\n /** -- Import / Export -- */\n\n /** Dump perspective as JSON */\n export(): string {\n //console.log(\"exportPerspective()\", perspMat);\n const snapshot = this._perspective.makeSnapshot();\n return JSON.stringify(snapshot, null, 2);\n }\n\n\n /** */\n import(json: string, _canPublish: boolean) {\n const snapshot = JSON.parse(json) as ProfilesAltSnapshot;\n // if (canPublish) {\n // for (const [profileAh, [profile, _ts]] of perspective.profiles.entries()) {\n // await this.createProfile(profile, agentId);\n // }\n // return;\n // }\n /** */\n this._perspective.restore(snapshot)\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-qc/profiles-dvm",
3
- "version": "0.27.0",
3
+ "version": "0.27.3",
4
4
  "description": "DnaViewModel implementation for the Profiles zome.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",