@ddd-qc/profiles-dvm 0.25.0 → 0.26.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.
@@ -0,0 +1,8 @@
1
+ export declare enum ProfilesUnitEnum {
2
+ Profile = "Profile"
3
+ }
4
+ export declare enum ProfilesLinkType {
5
+ PrefixPath = "PrefixPath",
6
+ PathToAgent = "PathToAgent",
7
+ AgentToProfile = "AgentToProfile"
8
+ }
@@ -0,0 +1,12 @@
1
+ /* This file is generated by zits. Do not edit manually */
2
+ export var ProfilesUnitEnum;
3
+ (function (ProfilesUnitEnum) {
4
+ ProfilesUnitEnum["Profile"] = "Profile";
5
+ })(ProfilesUnitEnum || (ProfilesUnitEnum = {}));
6
+ export var ProfilesLinkType;
7
+ (function (ProfilesLinkType) {
8
+ ProfilesLinkType["PrefixPath"] = "PrefixPath";
9
+ ProfilesLinkType["PathToAgent"] = "PathToAgent";
10
+ ProfilesLinkType["AgentToProfile"] = "AgentToProfile";
11
+ })(ProfilesLinkType || (ProfilesLinkType = {}));
12
+ //# sourceMappingURL=profiles.integrity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.integrity.js","sourceRoot":"","sources":["../../src/bindings/profiles.integrity.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D,MAAM,CAAN,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC3B,uCAAmB,CAAA;AACpB,CAAC,EAFW,gBAAgB,KAAhB,gBAAgB,QAE3B;AAED,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC3B,6CAAyB,CAAA;IACzB,+CAA2B,CAAA;IAC3B,qDAAiC,CAAA;AAClC,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nexport enum ProfilesUnitEnum {\n\tProfile = 'Profile',\n}\n\nexport enum ProfilesLinkType {\n\tPrefixPath = 'PrefixPath',\n\tPathToAgent = 'PathToAgent',\n\tAgentToProfile = 'AgentToProfile',\n}\n"]}
@@ -2,13 +2,18 @@ import { Profile } from './profiles.types';
2
2
  import { AgentPubKey,
3
3
  /** hdk/record.ts */
4
4
  Record as HcRecord } from '@holochain/client';
5
+ /** User defined external dependencies */
6
+ import { ProfilesLinkType as LinkTypes } from "./profiles.integrity";
5
7
  import { ZomeProxy } from '@ddd-qc/lit-happ';
8
+ import { ProfilesUnitEnum } from './profiles.integrity';
6
9
  /**
7
10
  *
8
11
  */
9
12
  export declare class ProfilesProxy extends ZomeProxy {
10
13
  static readonly DEFAULT_ZOME_NAME = "profiles";
11
14
  static readonly FN_NAMES: string[];
15
+ static readonly ENTRY_TYPES: ProfilesUnitEnum.Profile[];
16
+ static readonly LINK_TYPES: LinkTypes[];
12
17
  createProfile(profile: Profile): Promise<HcRecord>;
13
18
  updateProfile(profile: Profile): Promise<HcRecord>;
14
19
  searchAgents(nicknameFilter: string): Promise<AgentPubKey[]>;
@@ -1,6 +1,7 @@
1
1
  /* This file is generated by zits. Do not edit manually */
2
2
  import { ZomeProxy } from '@ddd-qc/lit-happ';
3
3
  import { profilesFunctionNames } from './profiles.fn';
4
+ import { ProfilesUnitEnum, ProfilesLinkType } from './profiles.integrity';
4
5
  /**
5
6
  *
6
7
  */
@@ -23,4 +24,6 @@ export class ProfilesProxy extends ZomeProxy {
23
24
  }
24
25
  ProfilesProxy.DEFAULT_ZOME_NAME = "profiles";
25
26
  ProfilesProxy.FN_NAMES = profilesFunctionNames;
27
+ ProfilesProxy.ENTRY_TYPES = Object.values(ProfilesUnitEnum);
28
+ ProfilesProxy.LINK_TYPES = Object.values(ProfilesLinkType);
26
29
  //# sourceMappingURL=profiles.proxy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.proxy.js","sourceRoot":"","sources":["../../src/bindings/profiles.proxy.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAoJ1D,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,qBAAqB,EAAC,MAAM,eAAe,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAS;IAI1C,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;;AArBe,+BAAiB,GAAG,UAAU,CAAA;AAC9B,sBAAQ,GAAG,qBAAqB,CAAA","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {EntryTypes, LinkTypes, 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\nimport {ZomeProxy} from '@ddd-qc/lit-happ';\nimport {profilesFunctionNames} from './profiles.fn';\n\n/**\n *\n */\nexport class ProfilesProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = \"profiles\"\n static readonly FN_NAMES = profilesFunctionNames\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}\n"]}
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,6 +1,8 @@
1
1
  import {
2
2
  /** hdk/action.ts */
3
3
  SignedActionHashed } from '@holochain/client';
4
+ /** User defined external dependencies */
5
+ import { ProfilesLinkType as LinkTypes } from "./profiles.integrity";
4
6
  export type SignalVariantLinkCreated = {
5
7
  type: "LinkCreated";
6
8
  action: SignedActionHashed;
@@ -48,8 +50,3 @@ export type EntryTypes = {
48
50
  };
49
51
  content: Profile;
50
52
  };
51
- export declare enum LinkTypes {
52
- PrefixPath = "PrefixPath",
53
- PathToAgent = "PathToAgent",
54
- AgentToProfile = "AgentToProfile"
55
- }
@@ -3,10 +3,4 @@ export var EntryTypesType;
3
3
  (function (EntryTypesType) {
4
4
  EntryTypesType["Profile"] = "Profile";
5
5
  })(EntryTypesType || (EntryTypesType = {}));
6
- export var LinkTypes;
7
- (function (LinkTypes) {
8
- LinkTypes["PrefixPath"] = "PrefixPath";
9
- LinkTypes["PathToAgent"] = "PathToAgent";
10
- LinkTypes["AgentToProfile"] = "AgentToProfile";
11
- })(LinkTypes || (LinkTypes = {}));
12
6
  //# sourceMappingURL=profiles.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.types.js","sourceRoot":"","sources":["../../src/bindings/profiles.types.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAgM1D,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,qCAAmB,CAAA;AACpB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAKD,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACpB,sCAAyB,CAAA;IACzB,wCAA2B,CAAA;IAC3B,8CAAiC,CAAA;AAClC,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB","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\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\nexport enum LinkTypes {\n\tPrefixPath = 'PrefixPath',\n\tPathToAgent = 'PathToAgent',\n\tAgentToProfile = 'AgentToProfile',\n}\n"]}
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 +1 @@
1
- {"version":3,"file":"profilesAlt.fn.js","sourceRoot":"","sources":["../../src/bindings/profilesAlt.fn.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAK1D,wDAAwD;AACxD,MAAM,CAAC,MAAM,wBAAwB,GAAmB;IACvD,YAAY;IACZ,eAAe;IACf,cAAc;IAGd,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,UAAU;CACV,CAAC;AAGF,iEAAiE;AACjE,MAAM,UAAU,qCAAqC,CAAC,QAAkB;IACrE,MAAM,GAAG,GAA+B,EAAE,CAAC;IAC3C,KAAK,MAAM,EAAE,IAAI,wBAAwB,EAAE;QACxC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;KAC3B;IACD,OAAO,GAAG,CAAC;AACd,CAAC;AAGD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAA+B,qCAAqC,CAAC,UAAU,CAAC,CAAC","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {ZomeName, FunctionName} from '@holochain/client';\n\n\n/** Array of all zome function names in \"profilesAlt\" */\nexport const profilesAltFunctionNames: FunctionName[] = [\n\t\"entry_defs\", \n\t\"get_zome_info\", \n\t\"get_dna_info\",\n\n\n\t\"create_profile\",\n\t\"update_profile\",\n\t\"search_agents\",\n\t\"find_profile\",\n\t\"probe_profiles\",\n\t\"cast_tip\",\n];\n\n\n/** Generate tuple array of function names with given zomeName */\nexport function generateProfilesAltZomeFunctionsArray(zomeName: ZomeName): [ZomeName, FunctionName][] {\n const fns: [ZomeName, FunctionName][] = [];\n for (const fn of profilesAltFunctionNames) {\n fns.push([zomeName, fn]);\n }\n return fns;\n}\n\n\n/** Tuple array of all zome function names with default zome name \"profiles\" */\nexport const profilesAltZomeFunctions: [ZomeName, FunctionName][] = generateProfilesAltZomeFunctionsArray(\"profiles\");\n"]}
1
+ {"version":3,"file":"profilesAlt.fn.js","sourceRoot":"","sources":["../../src/bindings/profilesAlt.fn.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAK1D,wDAAwD;AACxD,MAAM,CAAC,MAAM,wBAAwB,GAAmB;IACvD,YAAY;IACZ,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,UAAU;CACV,CAAC;AAGF,iEAAiE;AACjE,MAAM,UAAU,qCAAqC,CAAC,QAAkB;IACrE,MAAM,GAAG,GAA+B,EAAE,CAAC;IAC3C,KAAK,MAAM,EAAE,IAAI,wBAAwB,EAAE;QACxC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;KAC3B;IACD,OAAO,GAAG,CAAC;AACd,CAAC;AAGD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAA+B,qCAAqC,CAAC,UAAU,CAAC,CAAC","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {ZomeName, FunctionName} from '@holochain/client';\n\n\n/** Array of all zome function names in \"profilesAlt\" */\nexport const profilesAltFunctionNames: FunctionName[] = [\n\t\"entry_defs\", \n\t\"get_zome_info\", \n\t\"get_dna_info\",\n\t\"create_profile\",\n\t\"update_profile\",\n\t\"search_agents\",\n\t\"find_profile\",\n\t\"probe_profiles\",\n\t\"cast_tip\",\n];\n\n\n/** Generate tuple array of function names with given zomeName */\nexport function generateProfilesAltZomeFunctionsArray(zomeName: ZomeName): [ZomeName, FunctionName][] {\n const fns: [ZomeName, FunctionName][] = [];\n for (const fn of profilesAltFunctionNames) {\n fns.push([zomeName, fn]);\n }\n return fns;\n}\n\n\n/** Tuple array of all zome function names with default zome name \"profiles\" */\nexport const profilesAltZomeFunctions: [ZomeName, FunctionName][] = generateProfilesAltZomeFunctionsArray(\"profiles\");\n"]}
@@ -0,0 +1,8 @@
1
+ export declare enum ProfilesAltUnitEnum {
2
+ Profile = "Profile"
3
+ }
4
+ export declare enum ProfilesAltLinkType {
5
+ PrefixPath = "PrefixPath",
6
+ PathToAgent = "PathToAgent",
7
+ AgentToProfile = "AgentToProfile"
8
+ }
@@ -0,0 +1,12 @@
1
+ /* This file is generated by zits. Do not edit manually */
2
+ export var ProfilesAltUnitEnum;
3
+ (function (ProfilesAltUnitEnum) {
4
+ ProfilesAltUnitEnum["Profile"] = "Profile";
5
+ })(ProfilesAltUnitEnum || (ProfilesAltUnitEnum = {}));
6
+ export var ProfilesAltLinkType;
7
+ (function (ProfilesAltLinkType) {
8
+ ProfilesAltLinkType["PrefixPath"] = "PrefixPath";
9
+ ProfilesAltLinkType["PathToAgent"] = "PathToAgent";
10
+ ProfilesAltLinkType["AgentToProfile"] = "AgentToProfile";
11
+ })(ProfilesAltLinkType || (ProfilesAltLinkType = {}));
12
+ //# sourceMappingURL=profilesAlt.integrity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profilesAlt.integrity.js","sourceRoot":"","sources":["../../src/bindings/profilesAlt.integrity.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D,MAAM,CAAN,IAAY,mBAEX;AAFD,WAAY,mBAAmB;IAC9B,0CAAmB,CAAA;AACpB,CAAC,EAFW,mBAAmB,KAAnB,mBAAmB,QAE9B;AAED,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC9B,gDAAyB,CAAA;IACzB,kDAA2B,CAAA;IAC3B,wDAAiC,CAAA;AAClC,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nexport enum ProfilesAltUnitEnum {\n\tProfile = 'Profile',\n}\n\nexport enum ProfilesAltLinkType {\n\tPrefixPath = 'PrefixPath',\n\tPathToAgent = 'PathToAgent',\n\tAgentToProfile = 'AgentToProfile',\n}\n"]}
@@ -1,12 +1,15 @@
1
1
  import { CastTipInput, Profile } from './profilesAlt.types';
2
2
  import { AgentPubKey, ActionHash } from '@holochain/client';
3
3
  import { ZomeProxy } from '@ddd-qc/lit-happ';
4
+ import { ProfilesAltUnitEnum, ProfilesAltLinkType } from './profilesAlt.integrity';
4
5
  /**
5
6
  *
6
7
  */
7
8
  export declare class ProfilesAltProxy extends ZomeProxy {
8
9
  static readonly DEFAULT_ZOME_NAME = "profiles";
9
10
  static readonly FN_NAMES: string[];
11
+ static readonly ENTRY_TYPES: ProfilesAltUnitEnum.Profile[];
12
+ static readonly LINK_TYPES: ProfilesAltLinkType[];
10
13
  createProfile(pair: [Profile, AgentPubKey]): Promise<ActionHash>;
11
14
  updateProfile(pair: [Profile, AgentPubKey]): Promise<ActionHash>;
12
15
  searchAgents(nicknameFilter: string): Promise<AgentPubKey[]>;
@@ -1,6 +1,7 @@
1
1
  /* This file is generated by zits. Do not edit manually */
2
2
  import { ZomeProxy } from '@ddd-qc/lit-happ';
3
3
  import { profilesAltFunctionNames } from './profilesAlt.fn';
4
+ import { ProfilesAltUnitEnum, ProfilesAltLinkType } from './profilesAlt.integrity';
4
5
  /**
5
6
  *
6
7
  */
@@ -26,4 +27,6 @@ export class ProfilesAltProxy extends ZomeProxy {
26
27
  }
27
28
  ProfilesAltProxy.DEFAULT_ZOME_NAME = "profiles";
28
29
  ProfilesAltProxy.FN_NAMES = profilesAltFunctionNames;
30
+ ProfilesAltProxy.ENTRY_TYPES = Object.values(ProfilesAltUnitEnum);
31
+ ProfilesAltProxy.LINK_TYPES = Object.values(ProfilesAltLinkType);
29
32
  //# sourceMappingURL=profilesAlt.proxy.js.map
@@ -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;AAE1D;;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;IAED,KAAK,CAAC,OAAO,CAAC,KAAmB;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;;AA3Be,kCAAiB,GAAG,UAAU,CAAA;AAC9B,yBAAQ,GAAG,wBAAwB,CAAA","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {EntryTypes, LinkTypes, StateChange, SystemSignalProtocol, TipProtocol, ZomeSignalProtocol, CastTipInput, EntryPulse, LinkPulse, Profile, ZomeSignal, } 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';\n\n/**\n *\n */\nexport class ProfilesAltProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = \"profiles\"\n static readonly FN_NAMES = profilesAltFunctionNames\n \n\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 async castTip(input: CastTipInput): Promise<void> {\n return this.call('cast_tip', input);\n }\n\n}\n"]}
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;IAED,KAAK,CAAC,OAAO,CAAC,KAAmB;QAC/B,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;;AA3Be,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, StateChange, SystemSignalProtocol, TipProtocol, ZomeSignalProtocol, CastTipInput, EntryPulse, LinkPulse, Profile, ZomeSignal, } 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 async castTip(input: CastTipInput): Promise<void> {\n return this.call('cast_tip', input);\n }\n}\n"]}
@@ -18,11 +18,6 @@ export type EntryTypes = {
18
18
  };
19
19
  content: Profile;
20
20
  };
21
- export declare enum LinkTypes {
22
- PrefixPath = "PrefixPath",
23
- PathToAgent = "PathToAgent",
24
- AgentToProfile = "AgentToProfile"
25
- }
26
21
  export interface CastTipInput {
27
22
  tip: TipProtocol;
28
23
  peers: AgentPubKey[];
@@ -3,12 +3,6 @@ export var EntryTypesType;
3
3
  (function (EntryTypesType) {
4
4
  EntryTypesType["Profile"] = "Profile";
5
5
  })(EntryTypesType || (EntryTypesType = {}));
6
- export var LinkTypes;
7
- (function (LinkTypes) {
8
- LinkTypes["PrefixPath"] = "PrefixPath";
9
- LinkTypes["PathToAgent"] = "PathToAgent";
10
- LinkTypes["AgentToProfile"] = "AgentToProfile";
11
- })(LinkTypes || (LinkTypes = {}));
12
6
  /** Bool: True if state change just happened (real-time) */
13
7
  export var StateChangeType;
14
8
  (function (StateChangeType) {
@@ -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;AAKD,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACpB,sCAAyB,CAAA;IACzB,wCAA2B,CAAA;IAC3B,8CAAiC,CAAA;AAClC,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAOD,2DAA2D;AAC3D,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IAC1B,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;AAClB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B;AA4BD,OAAO;AACP,MAAM,CAAN,IAAY,sBAKX;AALD,WAAY,sBAAsB;IACjC,2CAAiB,CAAA;IACjB,yCAAe,CAAA;IACf,uCAAa,CAAA;IACb,qCAAW,CAAA;AACZ,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC;AA8CD,mDAAmD;AACnD,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,gCAAa,CAAA;IACb,8BAAW,CAAA;AACZ,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B","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\nexport enum LinkTypes {\n\tPrefixPath = 'PrefixPath',\n\tPathToAgent = 'PathToAgent',\n\tAgentToProfile = 'AgentToProfile',\n}\n\nexport interface CastTipInput {\n tip: TipProtocol\n peers: AgentPubKey[]\n}\n\n/** Bool: True if state change just happened (real-time) */\nexport enum StateChangeType {\n\tCreate = 'Create',\n\tUpdate = 'Update',\n\tDelete = 'Delete',\n}\nexport type StateChangeVariantCreate = {Create: boolean}\nexport type StateChangeVariantUpdate = {Update: boolean}\nexport type StateChangeVariantDelete = {Delete: boolean}\nexport type StateChange = \n | StateChangeVariantCreate | StateChangeVariantUpdate | StateChangeVariantDelete;\n\nexport interface LinkPulse {\n link: Link\n state: StateChange\n}\n\nexport interface EntryPulse {\n ah: ActionHash\n state: StateChange\n ts: Timestamp\n author: AgentPubKey\n eh: EntryHash\n def: AppEntryDef\n bytes: Uint8Array\n}\n\n/** */\nexport interface ZomeSignal {\n from: AgentPubKey\n pulses: ZomeSignalProtocol[]\n}\n\n/** */\nexport enum ZomeSignalProtocolType {\n\tSystem = 'System',\n\tEntry = 'Entry',\n\tLink = 'Link',\n\tTip = 'Tip',\n}\nexport type ZomeSignalProtocolVariantSystem = {System: SystemSignalProtocol}\nexport type ZomeSignalProtocolVariantEntry = {Entry: EntryPulse}\nexport type ZomeSignalProtocolVariantLink = {Link: LinkPulse}\nexport type ZomeSignalProtocolVariantTip = {Tip: TipProtocol}\nexport type ZomeSignalProtocol = \n | ZomeSignalProtocolVariantSystem | ZomeSignalProtocolVariantEntry | ZomeSignalProtocolVariantLink | ZomeSignalProtocolVariantTip;\n\n/** Protocol for notifying the ViewModel (UI) of system level events */\nexport type SystemSignalProtocolVariantPostCommitNewStart = {\n type: \"PostCommitNewStart\"\n app_entry_type: string\n}\nexport type SystemSignalProtocolVariantPostCommitNewEnd = {\n type: \"PostCommitNewEnd\"\n app_entry_type: string\n succeeded: boolean\n}\nexport type SystemSignalProtocolVariantPostCommitDeleteStart = {\n type: \"PostCommitDeleteStart\"\n app_entry_type: string\n}\nexport type SystemSignalProtocolVariantPostCommitDeleteEnd = {\n type: \"PostCommitDeleteEnd\"\n app_entry_type: string\n succeeded: boolean\n}\nexport type SystemSignalProtocolVariantSelfCallStart = {\n type: \"SelfCallStart\"\n zome_name: string\n fn_name: string\n}\nexport type SystemSignalProtocolVariantSelfCallEnd = {\n type: \"SelfCallEnd\"\n zome_name: string\n fn_name: string\n succeeded: boolean\n}\nexport type SystemSignalProtocol =\n | SystemSignalProtocolVariantPostCommitNewStart\n | SystemSignalProtocolVariantPostCommitNewEnd\n | SystemSignalProtocolVariantPostCommitDeleteStart\n | SystemSignalProtocolVariantPostCommitDeleteEnd\n | SystemSignalProtocolVariantSelfCallStart\n | SystemSignalProtocolVariantSelfCallEnd;\n\n/** Used by UI ONLY. That's why we use B64 here. */\nexport enum TipProtocolType {\n\tPing = 'Ping',\n\tPong = 'Pong',\n\tEntry = 'Entry',\n\tLink = 'Link',\n\tApp = 'App',\n}\nexport type TipProtocolVariantPing = {Ping: AgentPubKey}\nexport type TipProtocolVariantPong = {Pong: AgentPubKey}\nexport type TipProtocolVariantEntry = {Entry: EntryPulse}\nexport type TipProtocolVariantLink = {Link: LinkPulse}\nexport type TipProtocolVariantApp = {App: Uint8Array}\nexport type TipProtocol = \n | TipProtocolVariantPing | TipProtocolVariantPong | TipProtocolVariantEntry | TipProtocolVariantLink | TipProtocolVariantApp;\n"]}
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;AAUD,2DAA2D;AAC3D,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IAC1B,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;AAClB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B;AA4BD,OAAO;AACP,MAAM,CAAN,IAAY,sBAKX;AALD,WAAY,sBAAsB;IACjC,2CAAiB,CAAA;IACjB,yCAAe,CAAA;IACf,uCAAa,CAAA;IACb,qCAAW,CAAA;AACZ,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,QAKjC;AA8CD,mDAAmD;AACnD,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,gCAAa,CAAA;IACb,8BAAW,CAAA;AACZ,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B","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\nexport interface CastTipInput {\n tip: TipProtocol\n peers: AgentPubKey[]\n}\n\n/** Bool: True if state change just happened (real-time) */\nexport enum StateChangeType {\n\tCreate = 'Create',\n\tUpdate = 'Update',\n\tDelete = 'Delete',\n}\nexport type StateChangeVariantCreate = {Create: boolean}\nexport type StateChangeVariantUpdate = {Update: boolean}\nexport type StateChangeVariantDelete = {Delete: boolean}\nexport type StateChange = \n | StateChangeVariantCreate | StateChangeVariantUpdate | StateChangeVariantDelete;\n\nexport interface LinkPulse {\n link: Link\n state: StateChange\n}\n\nexport interface EntryPulse {\n ah: ActionHash\n state: StateChange\n ts: Timestamp\n author: AgentPubKey\n eh: EntryHash\n def: AppEntryDef\n bytes: Uint8Array\n}\n\n/** */\nexport interface ZomeSignal {\n from: AgentPubKey\n pulses: ZomeSignalProtocol[]\n}\n\n/** */\nexport enum ZomeSignalProtocolType {\n\tSystem = 'System',\n\tEntry = 'Entry',\n\tLink = 'Link',\n\tTip = 'Tip',\n}\nexport type ZomeSignalProtocolVariantSystem = {System: SystemSignalProtocol}\nexport type ZomeSignalProtocolVariantEntry = {Entry: EntryPulse}\nexport type ZomeSignalProtocolVariantLink = {Link: LinkPulse}\nexport type ZomeSignalProtocolVariantTip = {Tip: TipProtocol}\nexport type ZomeSignalProtocol = \n | ZomeSignalProtocolVariantSystem | ZomeSignalProtocolVariantEntry | ZomeSignalProtocolVariantLink | ZomeSignalProtocolVariantTip;\n\n/** Protocol for notifying the ViewModel (UI) of system level events */\nexport type SystemSignalProtocolVariantPostCommitNewStart = {\n type: \"PostCommitNewStart\"\n app_entry_type: string\n}\nexport type SystemSignalProtocolVariantPostCommitNewEnd = {\n type: \"PostCommitNewEnd\"\n app_entry_type: string\n succeeded: boolean\n}\nexport type SystemSignalProtocolVariantPostCommitDeleteStart = {\n type: \"PostCommitDeleteStart\"\n app_entry_type: string\n}\nexport type SystemSignalProtocolVariantPostCommitDeleteEnd = {\n type: \"PostCommitDeleteEnd\"\n app_entry_type: string\n succeeded: boolean\n}\nexport type SystemSignalProtocolVariantSelfCallStart = {\n type: \"SelfCallStart\"\n zome_name: string\n fn_name: string\n}\nexport type SystemSignalProtocolVariantSelfCallEnd = {\n type: \"SelfCallEnd\"\n zome_name: string\n fn_name: string\n succeeded: boolean\n}\nexport type SystemSignalProtocol =\n | SystemSignalProtocolVariantPostCommitNewStart\n | SystemSignalProtocolVariantPostCommitNewEnd\n | SystemSignalProtocolVariantPostCommitDeleteStart\n | SystemSignalProtocolVariantPostCommitDeleteEnd\n | SystemSignalProtocolVariantSelfCallStart\n | SystemSignalProtocolVariantSelfCallEnd;\n\n/** Used by UI ONLY. That's why we use B64 here. */\nexport enum TipProtocolType {\n\tPing = 'Ping',\n\tPong = 'Pong',\n\tEntry = 'Entry',\n\tLink = 'Link',\n\tApp = 'App',\n}\nexport type TipProtocolVariantPing = {Ping: AgentPubKey}\nexport type TipProtocolVariantPong = {Pong: AgentPubKey}\nexport type TipProtocolVariantEntry = {Entry: EntryPulse}\nexport type TipProtocolVariantLink = {Link: LinkPulse}\nexport type TipProtocolVariantApp = {App: Uint8Array}\nexport type TipProtocol = \n | TipProtocolVariantPing | TipProtocolVariantPong | TipProtocolVariantEntry | TipProtocolVariantLink | TipProtocolVariantApp;\n"]}
@@ -1,8 +1,8 @@
1
- import { ActionId, ActionIdMap, AgentId, AgentIdMap, ZomeViewModelWithSignals } from "@ddd-qc/lit-happ";
1
+ import { ActionId, ActionIdMap, AgentId, AgentIdMap, LinkPulseMat, ZomeViewModelWithSignals } from "@ddd-qc/lit-happ";
2
2
  import { Profile } from "./bindings/profiles.types";
3
3
  import { Timestamp } from "@holochain/client";
4
4
  import { ProfilesAltProxy } from "./bindings/profilesAlt.proxy";
5
- import { EntryPulse, LinkPulse } from "./bindings/profilesAlt.types";
5
+ import { EntryPulseMat } from "@ddd-qc/lit-happ/dist/ZomeViewModelWithSignals";
6
6
  /** */
7
7
  export interface ProfilesAltPerspectiveCore {
8
8
  profiles: ActionIdMap<[Profile, Timestamp]>;
@@ -34,9 +34,9 @@ export declare class ProfilesAltZvm extends ZomeViewModelWithSignals {
34
34
  getAgents(): AgentId[];
35
35
  getNames(): string[];
36
36
  /** */
37
- handleLinkPulse(pulse: LinkPulse, from: AgentId): Promise<void>;
37
+ handleLinkPulse(pulse: LinkPulseMat, from: AgentId): Promise<void>;
38
38
  /** */
39
- handleEntryPulse(pulse: EntryPulse, from: AgentId): Promise<void>;
39
+ handleEntryPulse(pulse: EntryPulseMat, from: AgentId): Promise<void>;
40
40
  /** -- perspective -- */
41
41
  /** Dump perspective as JSON */
42
42
  exportPerspective(): string;
@@ -1,8 +1,8 @@
1
- import { ActionId, ActionIdMap, AgentId, AgentIdMap, EntryId, getVariantByIndex, intoLinkableId, ZomeViewModelWithSignals } from "@ddd-qc/lit-happ";
2
- import { LinkTypes } from "./bindings/profiles.types";
1
+ import { ActionIdMap, AgentIdMap, ZomeViewModelWithSignals } from "@ddd-qc/lit-happ";
3
2
  import { decode } from "@msgpack/msgpack";
4
3
  import { ProfilesAltProxy } from "./bindings/profilesAlt.proxy";
5
4
  import { EntryTypesType, StateChangeType, } from "./bindings/profilesAlt.types";
5
+ import { ProfilesLinkType } from "./bindings/profiles.integrity";
6
6
  function createProfilesAltPerspective() {
7
7
  return {
8
8
  profiles: new ActionIdMap(),
@@ -72,48 +72,37 @@ export class ProfilesAltZvm extends ZomeViewModelWithSignals {
72
72
  getNames() { return Object.keys(this._perspective.agentByName); }
73
73
  /** */
74
74
  async handleLinkPulse(pulse, from) {
75
- const link = pulse.link;
76
- const linkAh = new ActionId(link.create_link_hash);
77
- const author = new AgentId(link.author);
78
- const base = intoLinkableId(link.base);
79
- const target = intoLinkableId(link.target);
80
- const state = Object.keys(pulse.state)[0];
81
- const isNew = pulse.state[state];
82
75
  /** */
83
- switch (getVariantByIndex(LinkTypes, link.link_type)) {
84
- case LinkTypes.PrefixPath:
85
- case LinkTypes.PathToAgent:
76
+ switch (pulse.link_type) {
77
+ case ProfilesLinkType.PrefixPath:
78
+ case ProfilesLinkType.PathToAgent:
86
79
  break;
87
- case LinkTypes.AgentToProfile:
88
- if (state == StateChangeType.Delete) {
89
- this.unstoreAgentProfile(base, target);
80
+ case ProfilesLinkType.AgentToProfile:
81
+ if (pulse.state == StateChangeType.Delete) {
82
+ this.unstoreAgentProfile(pulse.base, pulse.target);
90
83
  }
91
84
  else {
92
- this.storeAgentProfile(base, target);
93
- }
94
- if (isNew && from.b64 == this.cell.agentId.b64) {
95
- await this.broadcastTip({ Link: pulse });
85
+ this.storeAgentProfile(pulse.base, pulse.target);
96
86
  }
87
+ // FIXME
88
+ // if (pulse.isNew && from.b64 == this.cell.agentId.b64) {
89
+ // await this.broadcastTip({Link: pulse});
90
+ // }
97
91
  break;
98
92
  }
99
93
  }
100
94
  /** */
101
95
  async handleEntryPulse(pulse, from) {
102
- const entryType = getVariantByIndex(EntryTypesType, pulse.def.entry_index);
103
- const author = new AgentId(pulse.author);
104
- const ah = new ActionId(pulse.ah);
105
- const eh = new EntryId(pulse.eh);
106
- const state = Object.keys(pulse.state)[0];
107
- const isNew = pulse.state[state];
108
- switch (entryType) {
96
+ switch (pulse.entryType) {
109
97
  case EntryTypesType.Profile:
110
98
  const profile = decode(pulse.bytes);
111
- if (state != StateChangeType.Delete) {
112
- this.storeProfile(ah, profile, pulse.ts);
113
- }
114
- if (isNew && from.b64 == this.cell.agentId.b64) {
115
- await this.broadcastTip({ Entry: pulse });
99
+ if (pulse.state != StateChangeType.Delete) {
100
+ this.storeProfile(pulse.ah, profile, pulse.ts);
116
101
  }
102
+ // FIXME
103
+ // if (isNew && from.b64 == this.cell.agentId.b64) {
104
+ // await this.broadcastTip({Entry: pulse});
105
+ // }
117
106
  break;
118
107
  }
119
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"profilesAlt.zvm.js","sourceRoot":"","sources":["../src/profilesAlt.zvm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAAE,WAAW,EACrB,OAAO,EACP,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,SAAS,EAAU,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAC,MAAM,EAAC,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C,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1E,CAAC;IAGD,MAAM;IACN,KAAK,CAAC,aAAa,CAAC,OAAgB,EAAE,OAAgB;QACpD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1E,CAAC;;AA9Ne,yBAAU,GAAG,gBAAgB,AAAnB,CAAoB","sourcesContent":["import {\n ActionId, ActionIdMap,\n AgentId,\n AgentIdMap,\n EntryId,\n getVariantByIndex,\n intoLinkableId,\n ZomeViewModelWithSignals\n} from \"@ddd-qc/lit-happ\";\nimport {LinkTypes, Profile} from \"./bindings/profiles.types\";\nimport {Timestamp} from \"@holochain/client\";\nimport {decode} from \"@msgpack/msgpack\";\nimport {ProfilesAltProxy} from \"./bindings/profilesAlt.proxy\";\nimport {\n EntryPulse,\n EntryTypesType,\n LinkPulse, StateChangeType,\n} from \"./bindings/profilesAlt.types\";\n\n\n/** */\nexport interface ProfilesAltPerspectiveCore {\n /* ActionId -> Profile */\n profiles: ActionIdMap<[Profile, Timestamp]>,\n /* AgentId -> ActionId */\n profileByAgent: AgentIdMap<ActionId>,\n}\n\nexport interface ProfilesAltPerspectiveLive {\n /** Nickname -> AgentId */\n agentByName: Record<string, AgentId>,\n}\n\nexport type ProfilesAltPerspective = ProfilesAltPerspectiveCore & ProfilesAltPerspectiveLive;\n\n\nfunction createProfilesAltPerspective(): ProfilesAltPerspective {\n return {\n profiles: new ActionIdMap(),\n profileByAgent: new AgentIdMap(),\n agentByName: {},\n }\n}\n\n\n/**\n *\n */\nexport class ProfilesAltZvm extends ZomeViewModelWithSignals {\n\n static readonly ZOME_PROXY = ProfilesAltProxy;\n get zomeProxy(): ProfilesAltProxy {return this._zomeProxy as ProfilesAltProxy;}\n\n\n /* */\n protected hasChanged(): boolean {\n // TODO\n return true;\n }\n\n\n /** */\n async initializePerspectiveOnline(): Promise<void> {\n await this.probeAllProfiles();\n }\n\n /** */\n probeAllInner() {\n this.probeAllProfiles();\n }\n\n /** -- Perspective -- */\n\n /* */\n get perspective(): ProfilesAltPerspective {\n return this._perspective;\n }\n\n private _perspective: ProfilesAltPerspective = createProfilesAltPerspective();\n\n getMyProfile(): Profile | undefined {\n const pair = this._perspective.profiles.get(this.cell.agentId)\n if (!pair) {\n return undefined;\n }\n return pair[0];\n }\n\n getProfileAgent(profileId: ActionId): AgentId | undefined {\n for (const [agentId, profId] of this._perspective.profileByAgent.entries()) {\n if (profileId.b64 == profId.b64) {\n return agentId;\n }\n }\n return undefined;\n }\n\n getProfile(agent: AgentId): Profile | undefined {\n const profileAh = this._perspective.profileByAgent.get(agent);\n if (!profileAh) {\n return undefined;\n }\n const pair = this._perspective.profiles.get(profileAh);\n return pair[0];\n\n }\n\n getProfileTs(agent: AgentId): Timestamp | undefined {\n const profileAh = this._perspective.profileByAgent.get(agent);\n if (!profileAh) {\n return undefined;\n }\n const pair = this._perspective.profiles.get(profileAh);\n return pair[1];\n }\n\n getAgents(): AgentId[] { return Array.from(this._perspective.profileByAgent.keys())}\n\n getNames(): string[] { return Object.keys(this._perspective.agentByName)}\n\n\n\n /** */\n async handleLinkPulse(pulse: LinkPulse, from: AgentId): Promise<void> {\n const link = pulse.link;\n const linkAh = new ActionId(link.create_link_hash);\n const author = new AgentId(link.author);\n const base = intoLinkableId((link as any).base);\n const target = intoLinkableId(link.target);\n const state = Object.keys(pulse.state)[0];\n const isNew = (pulse.state as any)[state];\n /** */\n switch (getVariantByIndex(LinkTypes, link.link_type)) {\n case LinkTypes.PrefixPath:\n case LinkTypes.PathToAgent:\n break;\n case LinkTypes.AgentToProfile:\n if (state == StateChangeType.Delete) {\n this.unstoreAgentProfile(base, target)\n } else {\n this.storeAgentProfile(base, target)\n }\n if (isNew && from.b64 == this.cell.agentId.b64) {\n await this.broadcastTip({Link: pulse});\n }\n break;\n }\n }\n\n\n /** */\n async handleEntryPulse(pulse: EntryPulse, from: AgentId) {\n const entryType = getVariantByIndex(EntryTypesType, pulse.def.entry_index);\n const author = new AgentId(pulse.author);\n const ah = new ActionId(pulse.ah);\n const eh = new EntryId(pulse.eh);\n const state = Object.keys(pulse.state)[0];\n const isNew = (pulse.state as any)[state];\n switch (entryType) {\n case EntryTypesType.Profile:\n const profile = decode(pulse.bytes) as Profile;\n if (state != StateChangeType.Delete) {\n this.storeProfile(ah, profile, pulse.ts);\n }\n if (isNew && from.b64 == this.cell.agentId.b64) {\n await this.broadcastTip({Entry: pulse});\n }\n break;\n }\n }\n\n\n /** -- perspective -- */\n\n /** Dump perspective as JSON */\n exportPerspective(): string {\n //console.log(\"exportPerspective()\", perspMat);\n const core = this._perspective as ProfilesAltPerspectiveCore; // FIXME: check if this actually works as expected\n return JSON.stringify(core, null, 2);\n }\n\n\n /** */\n async importPerspective(json: string, canPublish: boolean) {\n const perspective = JSON.parse(json) as ProfilesAltPerspectiveCore;\n if (canPublish) {\n for (const [agentId, [profile, _ts]] of perspective.profiles.entries()) {\n await this.createProfile(profile, agentId);\n }\n return;\n }\n /** */\n for (const [actionId, [profile, ts]] of perspective.profiles.entries()) {\n this.storeProfile(actionId, profile, ts);\n }\n for (const [agentId, actionId] of perspective.profileByAgent.entries()) {\n this.storeAgentProfile(agentId, actionId);\n }\n }\n\n\n /** -- Store -- */\n\n\n /** */\n storeProfile(profileAh: ActionId, profile: Profile, ts: Timestamp) {\n this._perspective.profiles.set(profileAh, [profile, ts]);\n const agentId = this.getProfileAgent(profileAh);\n if (agentId) {\n this._perspective.agentByName[profile.nickname] = agentId;\n }\n }\n\n /** */\n storeAgentProfile(agentId: AgentId, profileAh: ActionId) {\n this._perspective.profileByAgent.set(agentId, profileAh);\n const pair = this._perspective.profiles.get(profileAh);\n if (pair) {\n this._perspective.agentByName[pair[0].nickname] = agentId;\n }\n }\n\n /** */\n unstoreAgentProfile(agentId: AgentId, profileAh: ActionId) {\n this._perspective.profileByAgent.delete(agentId);\n const pair = this._perspective.profiles.get(profileAh);\n if (pair) {\n delete this._perspective.agentByName[pair[0].nickname];\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(\"probeProfile() maybeProfilePair\", 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.agentId.hash]);\n }\n\n\n /** */\n async updateMyProfile(profile: Profile): Promise<void> {\n const _ah = await this.zomeProxy.updateProfile([profile, this.cell.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"]}
1
+ {"version":3,"file":"profilesAlt.zvm.js","sourceRoot":"","sources":["../src/profilesAlt.zvm.ts"],"names":[],"mappings":"AAAA,OAAO,EACK,WAAW,EAErB,UAAU,EAIV,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAEL,cAAc,EACH,eAAe,GAC3B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AAmB/D,SAAS,4BAA4B;IACnC,OAAO;QACL,QAAQ,EAAE,IAAI,WAAW,EAAE;QAC3B,cAAc,EAAE,IAAI,UAAU,EAAE;QAChC,WAAW,EA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AAa,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1E,CAAC;;AAnNe,yBAAU,GAAG,gBAAgB,AAAnB,CAAoB","sourcesContent":["import {\n ActionId, ActionIdMap,\n AgentId,\n AgentIdMap,\n EntryId,\n getVariantByIndex,\n intoLinkableId, LinkPulseMat,\n ZomeViewModelWithSignals\n} from \"@ddd-qc/lit-happ\";\nimport {Profile} from \"./bindings/profiles.types\";\nimport {Timestamp} from \"@holochain/client\";\nimport {decode} from \"@msgpack/msgpack\";\nimport {ProfilesAltProxy} from \"./bindings/profilesAlt.proxy\";\nimport {\n EntryPulse,\n EntryTypesType,\n LinkPulse, StateChangeType,\n} from \"./bindings/profilesAlt.types\";\nimport {EntryPulseMat} from \"@ddd-qc/lit-happ/dist/ZomeViewModelWithSignals\";\nimport {ProfilesLinkType} from \"./bindings/profiles.integrity\";\n\n\n/** */\nexport interface ProfilesAltPerspectiveCore {\n /* ActionId -> Profile */\n profiles: ActionIdMap<[Profile, Timestamp]>,\n /* AgentId -> ActionId */\n profileByAgent: AgentIdMap<ActionId>,\n}\n\nexport interface ProfilesAltPerspectiveLive {\n /** Nickname -> AgentId */\n agentByName: Record<string, AgentId>,\n}\n\nexport type ProfilesAltPerspective = ProfilesAltPerspectiveCore & ProfilesAltPerspectiveLive;\n\n\nfunction createProfilesAltPerspective(): ProfilesAltPerspective {\n return {\n profiles: new ActionIdMap(),\n profileByAgent: new AgentIdMap(),\n agentByName: {},\n }\n}\n\n\n/**\n *\n */\nexport class ProfilesAltZvm extends ZomeViewModelWithSignals {\n\n static readonly ZOME_PROXY = ProfilesAltProxy;\n get zomeProxy(): ProfilesAltProxy {return this._zomeProxy as ProfilesAltProxy;}\n\n\n /* */\n protected hasChanged(): boolean {\n // TODO\n return true;\n }\n\n\n /** */\n async initializePerspectiveOnline(): Promise<void> {\n await this.probeAllProfiles();\n }\n\n /** */\n probeAllInner() {\n this.probeAllProfiles();\n }\n\n /** -- Perspective -- */\n\n /* */\n get perspective(): ProfilesAltPerspective {\n return this._perspective;\n }\n\n private _perspective: ProfilesAltPerspective = createProfilesAltPerspective();\n\n getMyProfile(): Profile | undefined {\n const pair = this._perspective.profiles.get(this.cell.agentId)\n if (!pair) {\n return undefined;\n }\n return pair[0];\n }\n\n getProfileAgent(profileId: ActionId): AgentId | undefined {\n for (const [agentId, profId] of this._perspective.profileByAgent.entries()) {\n if (profileId.b64 == profId.b64) {\n return agentId;\n }\n }\n return undefined;\n }\n\n getProfile(agent: AgentId): Profile | undefined {\n const profileAh = this._perspective.profileByAgent.get(agent);\n if (!profileAh) {\n return undefined;\n }\n const pair = this._perspective.profiles.get(profileAh);\n return pair[0];\n\n }\n\n getProfileTs(agent: AgentId): Timestamp | undefined {\n const profileAh = this._perspective.profileByAgent.get(agent);\n if (!profileAh) {\n return undefined;\n }\n const pair = this._perspective.profiles.get(profileAh);\n return pair[1];\n }\n\n getAgents(): AgentId[] { return Array.from(this._perspective.profileByAgent.keys())}\n\n getNames(): string[] { return Object.keys(this._perspective.agentByName)}\n\n\n\n /** */\n async handleLinkPulse(pulse: LinkPulseMat, from: AgentId): Promise<void> {\n /** */\n switch (pulse.link_type) {\n case ProfilesLinkType.PrefixPath:\n case ProfilesLinkType.PathToAgent:\n break;\n case ProfilesLinkType.AgentToProfile:\n if (pulse.state == StateChangeType.Delete) {\n this.unstoreAgentProfile(pulse.base, pulse.target)\n } else {\n this.storeAgentProfile(pulse.base, pulse.target)\n }\n // FIXME\n // if (pulse.isNew && from.b64 == this.cell.agentId.b64) {\n // await this.broadcastTip({Link: pulse});\n // }\n break;\n }\n }\n\n\n /** */\n async handleEntryPulse(pulse: EntryPulseMat, from: AgentId) {\n switch (pulse.entryType) {\n case EntryTypesType.Profile:\n const profile = decode(pulse.bytes) as Profile;\n if (pulse.state != StateChangeType.Delete) {\n this.storeProfile(pulse.ah, profile, pulse.ts);\n }\n // FIXME\n // if (isNew && from.b64 == this.cell.agentId.b64) {\n // await this.broadcastTip({Entry: pulse});\n // }\n break;\n }\n }\n\n\n /** -- perspective -- */\n\n /** Dump perspective as JSON */\n exportPerspective(): string {\n //console.log(\"exportPerspective()\", perspMat);\n const core = this._perspective as ProfilesAltPerspectiveCore; // FIXME: check if this actually works as expected\n return JSON.stringify(core, null, 2);\n }\n\n\n /** */\n async importPerspective(json: string, canPublish: boolean) {\n const perspective = JSON.parse(json) as ProfilesAltPerspectiveCore;\n if (canPublish) {\n for (const [agentId, [profile, _ts]] of perspective.profiles.entries()) {\n await this.createProfile(profile, agentId);\n }\n return;\n }\n /** */\n for (const [actionId, [profile, ts]] of perspective.profiles.entries()) {\n this.storeProfile(actionId, profile, ts);\n }\n for (const [agentId, actionId] of perspective.profileByAgent.entries()) {\n this.storeAgentProfile(agentId, actionId);\n }\n }\n\n\n /** -- Store -- */\n\n\n /** */\n storeProfile(profileAh: ActionId, profile: Profile, ts: Timestamp) {\n this._perspective.profiles.set(profileAh, [profile, ts]);\n const agentId = this.getProfileAgent(profileAh);\n if (agentId) {\n this._perspective.agentByName[profile.nickname] = agentId;\n }\n }\n\n /** */\n storeAgentProfile(agentId: AgentId, profileAh: ActionId) {\n this._perspective.profileByAgent.set(agentId, profileAh);\n const pair = this._perspective.profiles.get(profileAh);\n if (pair) {\n this._perspective.agentByName[pair[0].nickname] = agentId;\n }\n }\n\n /** */\n unstoreAgentProfile(agentId: AgentId, profileAh: ActionId) {\n this._perspective.profileByAgent.delete(agentId);\n const pair = this._perspective.profiles.get(profileAh);\n if (pair) {\n delete this._perspective.agentByName[pair[0].nickname];\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(\"probeProfile() maybeProfilePair\", 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.agentId.hash]);\n }\n\n\n /** */\n async updateMyProfile(profile: Profile): Promise<void> {\n const _ah = await this.zomeProxy.updateProfile([profile, this.cell.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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-qc/profiles-dvm",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "DnaViewModel implementation for the Profiles zome.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",