@ddd-qc/agent-directory 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- import { ZomeViewModel } from "@ddd-qc/lit-happ";
2
- import { AgentPubKeyB64 } from "@holochain/client";
3
- import { AgentDirectoryProxy } from "./bindings/agent_directory.proxy";
4
- /** */
5
- export interface AgentDirectoryPerspective {
6
- agents: AgentPubKeyB64[];
7
- }
8
- /**
9
- *
10
- */
11
- export declare class AgentDirectoryZvm extends ZomeViewModel {
12
- static readonly ZOME_PROXY: typeof AgentDirectoryProxy;
13
- get zomeProxy(): AgentDirectoryProxy;
14
- /** -- Fields -- */
15
- private _agents;
16
- /** -- Methods -- */
17
- get perspective(): AgentDirectoryPerspective;
18
- /** */
19
- protected hasChanged(): boolean;
20
- /** */
21
- probeAll(): Promise<void>;
22
- /** */
23
- probeRegisteredAgents(): Promise<void>;
24
- }
1
+ import { ZomeViewModel } from "@ddd-qc/lit-happ";
2
+ import { AgentPubKeyB64 } from "@holochain/client";
3
+ import { AgentDirectoryProxy } from "./bindings/agent_directory.proxy";
4
+ /** */
5
+ export interface AgentDirectoryPerspective {
6
+ agents: AgentPubKeyB64[];
7
+ }
8
+ /**
9
+ *
10
+ */
11
+ export declare class AgentDirectoryZvm extends ZomeViewModel {
12
+ static readonly ZOME_PROXY: typeof AgentDirectoryProxy;
13
+ get zomeProxy(): AgentDirectoryProxy;
14
+ /** -- Fields -- */
15
+ private _agents;
16
+ /** -- Methods -- */
17
+ get perspective(): AgentDirectoryPerspective;
18
+ /** */
19
+ protected hasChanged(): boolean;
20
+ /** */
21
+ probeAll(): Promise<void>;
22
+ /** */
23
+ probeRegisteredAgents(): Promise<void>;
24
+ }
@@ -1,42 +1,42 @@
1
- import { ZomeViewModel } from "@ddd-qc/lit-happ";
2
- import { encodeHashToBase64 } from "@holochain/client";
3
- import { AgentDirectoryProxy } from "./bindings/agent_directory.proxy";
4
- /**
5
- *
6
- */
7
- export class AgentDirectoryZvm extends ZomeViewModel {
8
- constructor() {
9
- super(...arguments);
10
- /** -- Fields -- */
11
- this._agents = [];
12
- }
13
- get zomeProxy() {
14
- return this._zomeProxy;
15
- }
16
- /** -- Methods -- */
17
- /* */
18
- get perspective() {
19
- return { agents: this._agents };
20
- }
21
- /** */
22
- hasChanged() {
23
- if (!this._previousPerspective)
24
- return true;
25
- let hasChanged = JSON.stringify(this.perspective.agents) !== JSON.stringify(this._previousPerspective.agents);
26
- return hasChanged;
27
- }
28
- /** */
29
- async probeAll() {
30
- await this.probeRegisteredAgents();
31
- }
32
- /** */
33
- async probeRegisteredAgents() {
34
- let agents = await this.zomeProxy.getRegisteredAgents();
35
- this._agents = agents.map((agentKey) => encodeHashToBase64(agentKey));
36
- // Debug add a random string to the perspective
37
- // this._agents.push(String.fromCharCode("A".charCodeAt(0) + Math.floor(Math.random() * 26)))
38
- this.notifySubscribers();
39
- }
40
- }
41
- AgentDirectoryZvm.ZOME_PROXY = AgentDirectoryProxy;
1
+ import { ZomeViewModel } from "@ddd-qc/lit-happ";
2
+ import { encodeHashToBase64 } from "@holochain/client";
3
+ import { AgentDirectoryProxy } from "./bindings/agent_directory.proxy";
4
+ /**
5
+ *
6
+ */
7
+ export class AgentDirectoryZvm extends ZomeViewModel {
8
+ constructor() {
9
+ super(...arguments);
10
+ /** -- Fields -- */
11
+ this._agents = [];
12
+ }
13
+ get zomeProxy() {
14
+ return this._zomeProxy;
15
+ }
16
+ /** -- Methods -- */
17
+ /* */
18
+ get perspective() {
19
+ return { agents: this._agents };
20
+ }
21
+ /** */
22
+ hasChanged() {
23
+ if (!this._previousPerspective)
24
+ return true;
25
+ let hasChanged = JSON.stringify(this.perspective.agents) !== JSON.stringify(this._previousPerspective.agents);
26
+ return hasChanged;
27
+ }
28
+ /** */
29
+ async probeAll() {
30
+ await this.probeRegisteredAgents();
31
+ }
32
+ /** */
33
+ async probeRegisteredAgents() {
34
+ let agents = await this.zomeProxy.getRegisteredAgents();
35
+ this._agents = agents.map((agentKey) => encodeHashToBase64(agentKey));
36
+ // Debug add a random string to the perspective
37
+ // this._agents.push(String.fromCharCode("A".charCodeAt(0) + Math.floor(Math.random() * 26)))
38
+ this.notifySubscribers();
39
+ }
40
+ }
41
+ AgentDirectoryZvm.ZOME_PROXY = AgentDirectoryProxy;
42
42
  //# sourceMappingURL=agent_directory.zvm.js.map
@@ -1,7 +1,7 @@
1
- import { ZomeName, FunctionName } from '@holochain/client';
2
- /** Array of all zome function names in "agentDirectory" */
3
- export declare const agentDirectoryFunctionNames: FunctionName[];
4
- /** Generate tuple array of function names with given zomeName */
5
- export declare function generateAgentDirectoryZomeFunctionsArray(zomeName: ZomeName): [ZomeName, FunctionName][];
6
- /** Tuple array of all zome function names with default zome name "agent_directory" */
7
- export declare const agentDirectoryZomeFunctions: [ZomeName, FunctionName][];
1
+ import { ZomeName, FunctionName } from '@holochain/client';
2
+ /** Array of all zome function names in "agentDirectory" */
3
+ export declare const agentDirectoryFunctionNames: FunctionName[];
4
+ /** Generate tuple array of function names with given zomeName */
5
+ export declare function generateAgentDirectoryZomeFunctionsArray(zomeName: ZomeName): [ZomeName, FunctionName][];
6
+ /** Tuple array of all zome function names with default zome name "agent_directory" */
7
+ export declare const agentDirectoryZomeFunctions: [ZomeName, FunctionName][];
@@ -1,17 +1,17 @@
1
- /* This file is generated by zits. Do not edit manually */
2
- /** Array of all zome function names in "agentDirectory" */
3
- export const agentDirectoryFunctionNames = [
4
- "entry_defs",
5
- "get_registered_agents",
6
- ];
7
- /** Generate tuple array of function names with given zomeName */
8
- export function generateAgentDirectoryZomeFunctionsArray(zomeName) {
9
- let fns = [];
10
- for (const fn of agentDirectoryFunctionNames) {
11
- fns.push([zomeName, fn]);
12
- }
13
- return fns;
14
- }
15
- /** Tuple array of all zome function names with default zome name "agent_directory" */
16
- export const agentDirectoryZomeFunctions = generateAgentDirectoryZomeFunctionsArray("agent_directory");
1
+ /* This file is generated by zits. Do not edit manually */
2
+ /** Array of all zome function names in "agentDirectory" */
3
+ export const agentDirectoryFunctionNames = [
4
+ "entry_defs",
5
+ "get_registered_agents",
6
+ ];
7
+ /** Generate tuple array of function names with given zomeName */
8
+ export function generateAgentDirectoryZomeFunctionsArray(zomeName) {
9
+ let fns = [];
10
+ for (const fn of agentDirectoryFunctionNames) {
11
+ fns.push([zomeName, fn]);
12
+ }
13
+ return fns;
14
+ }
15
+ /** Tuple array of all zome function names with default zome name "agent_directory" */
16
+ export const agentDirectoryZomeFunctions = generateAgentDirectoryZomeFunctionsArray("agent_directory");
17
17
  //# sourceMappingURL=agent_directory.fn.js.map
@@ -1,10 +1,10 @@
1
- import { AgentPubKey } from '@holochain/client';
2
- import { ZomeProxy } from '@ddd-qc/lit-happ';
3
- /**
4
- *
5
- */
6
- export declare class AgentDirectoryProxy extends ZomeProxy {
7
- static readonly DEFAULT_ZOME_NAME = "agent_directory";
8
- static readonly FN_NAMES: string[];
9
- getRegisteredAgents(): Promise<AgentPubKey[]>;
10
- }
1
+ import { AgentPubKey } from '@holochain/client';
2
+ import { ZomeProxy } from '@ddd-qc/lit-happ';
3
+ /**
4
+ *
5
+ */
6
+ export declare class AgentDirectoryProxy extends ZomeProxy {
7
+ static readonly DEFAULT_ZOME_NAME = "agent_directory";
8
+ static readonly FN_NAMES: string[];
9
+ getRegisteredAgents(): Promise<AgentPubKey[]>;
10
+ }
@@ -1,14 +1,14 @@
1
- /* This file is generated by zits. Do not edit manually */
2
- import { ZomeProxy } from '@ddd-qc/lit-happ';
3
- import { agentDirectoryFunctionNames } from './agent_directory.fn';
4
- /**
5
- *
6
- */
7
- export class AgentDirectoryProxy extends ZomeProxy {
8
- async getRegisteredAgents() {
9
- return this.call('get_registered_agents', null);
10
- }
11
- }
12
- AgentDirectoryProxy.DEFAULT_ZOME_NAME = "agent_directory";
13
- AgentDirectoryProxy.FN_NAMES = agentDirectoryFunctionNames;
1
+ /* This file is generated by zits. Do not edit manually */
2
+ import { ZomeProxy } from '@ddd-qc/lit-happ';
3
+ import { agentDirectoryFunctionNames } from './agent_directory.fn';
4
+ /**
5
+ *
6
+ */
7
+ export class AgentDirectoryProxy extends ZomeProxy {
8
+ async getRegisteredAgents() {
9
+ return this.call('get_registered_agents', null);
10
+ }
11
+ }
12
+ AgentDirectoryProxy.DEFAULT_ZOME_NAME = "agent_directory";
13
+ AgentDirectoryProxy.FN_NAMES = agentDirectoryFunctionNames;
14
14
  //# sourceMappingURL=agent_directory.proxy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent_directory.proxy.js","sourceRoot":"","sources":["../../src/bindings/agent_directory.proxy.ts"],"names":[],"mappings":"AAAA,0DAA0D;AA0H1D,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,2BAA2B,EAAC,MAAM,sBAAsB,CAAC;AAEjE;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAIhD,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;;AALe,qCAAiB,GAAG,iBAAiB,CAAA;AACrC,4BAAQ,GAAG,2BAA2B,CAAA","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {} from './agent_directory.types';\nimport {\n/** Types */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nHoloHashed,\nNetworkInfo,\nFetchQueueInfo,\n/** Action */\nSignedActionHashed,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** Capabilities */\nCapSecret,\nCapClaim,\nZomeCallCapGrant,\nCapAccess,\nCapGrant,\n/** CounterSigning */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** DhtOps */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** Entry */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** Record */\nRecord,\nRecordEntry,\n/** admin types */\nInstalledAppInfoStatus,\nStemCell,\nCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDictionary,\nDhtOpHashB64,\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 {agentDirectoryFunctionNames} from './agent_directory.fn';\n\n/**\n *\n */\nexport class AgentDirectoryProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = \"agent_directory\"\n static readonly FN_NAMES = agentDirectoryFunctionNames\n \n async getRegisteredAgents(): Promise<AgentPubKey[]> {\n return this.call('get_registered_agents', null);\n }\n\n\n}\n"]}
1
+ {"version":3,"file":"agent_directory.proxy.js","sourceRoot":"","sources":["../../src/bindings/agent_directory.proxy.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAyH1D,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,2BAA2B,EAAC,MAAM,sBAAsB,CAAC;AAEjE;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAIhD,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;;AALe,qCAAiB,GAAG,iBAAiB,CAAA;AACrC,4BAAQ,GAAG,2BAA2B,CAAA","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {\n/** Types */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nHoloHashed,\nNetworkInfo,\nFetchQueueInfo,\n/** Action */\nSignedActionHashed,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** Capabilities */\nCapSecret,\nCapClaim,\nZomeCallCapGrant,\nCapAccess,\nCapGrant,\nGrantedFunctionsType,\n/** CounterSigning */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** DhtOps */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** Entry */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** Record */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** admin types */\nInstalledAppInfoStatus,\nStemCell,\nCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDhtOpHashB64,\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 {agentDirectoryFunctionNames} from './agent_directory.fn';\n\n/**\n *\n */\nexport class AgentDirectoryProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = \"agent_directory\"\n static readonly FN_NAMES = agentDirectoryFunctionNames\n \n async getRegisteredAgents(): Promise<AgentPubKey[]> {\n return this.call('get_registered_agents', null);\n }\n\n\n}\n"]}
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,3 +1,3 @@
1
- /* This file is generated by zits. Do not edit manually */
2
- export {};
1
+ /* This file is generated by zits. Do not edit manually */
2
+ export {};
3
3
  //# sourceMappingURL=agent_directory.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent_directory.types.js","sourceRoot":"","sources":["../../src/bindings/agent_directory.types.ts"],"names":[],"mappings":"AAAA,0DAA0D","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {\n/** Types */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nHoloHashed,\nNetworkInfo,\nFetchQueueInfo,\n/** Action */\nSignedActionHashed,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** Capabilities */\nCapSecret,\nCapClaim,\nZomeCallCapGrant,\nCapAccess,\nCapGrant,\n/** CounterSigning */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** DhtOps */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** Entry */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** Record */\nRecord,\nRecordEntry,\n/** admin types */\nInstalledAppInfoStatus,\nStemCell,\nCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDictionary,\nDhtOpHashB64,\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"]}
1
+ {"version":3,"file":"agent_directory.types.js","sourceRoot":"","sources":["../../src/bindings/agent_directory.types.ts"],"names":[],"mappings":"AAAA,0DAA0D","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {\n/** Types */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nHoloHashed,\nNetworkInfo,\nFetchQueueInfo,\n/** Action */\nSignedActionHashed,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** Capabilities */\nCapSecret,\nCapClaim,\nZomeCallCapGrant,\nCapAccess,\nCapGrant,\nGrantedFunctionsType,\n/** CounterSigning */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** DhtOps */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** Entry */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** Record */\nRecord as HcRecord,\nRecordEntry as HcRecordEntry,\n/** admin types */\nInstalledAppInfoStatus,\nStemCell,\nCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDhtOpHashB64,\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"]}
@@ -1,20 +1,20 @@
1
- import { ZomeElement } from "@ddd-qc/lit-happ";
2
- import { AgentDirectoryPerspective, AgentDirectoryZvm } from "../agent_directory.zvm";
3
- /**
4
- * @element agent-directory-list
5
- */
6
- export declare class AgentDirectoryList extends ZomeElement<AgentDirectoryPerspective, AgentDirectoryZvm> {
7
- /** Ctor */
8
- constructor();
9
- /** -- Fields -- */
10
- private _initialized;
11
- /** -- Methods -- */
12
- /** After first call to render() */
13
- firstUpdated(): Promise<void>;
14
- /** After each call to render() */
15
- updated(changedProperties: any): Promise<void>;
16
- /** */
17
- refresh(_e?: any): Promise<void>;
18
- /** */
19
- render(): import("lit-html").TemplateResult<1>;
20
- }
1
+ import { ZomeElement } from "@ddd-qc/lit-happ";
2
+ import { AgentDirectoryPerspective, AgentDirectoryZvm } from "../agent_directory.zvm";
3
+ /**
4
+ * @element agent-directory-list
5
+ */
6
+ export declare class AgentDirectoryList extends ZomeElement<AgentDirectoryPerspective, AgentDirectoryZvm> {
7
+ /** Ctor */
8
+ constructor();
9
+ /** -- Fields -- */
10
+ private _initialized;
11
+ /** -- Methods -- */
12
+ /** After first call to render() */
13
+ firstUpdated(): Promise<void>;
14
+ /** After each call to render() */
15
+ updated(changedProperties: any): Promise<void>;
16
+ /** */
17
+ refresh(_e?: any): Promise<void>;
18
+ /** */
19
+ render(): import("lit-html").TemplateResult<1>;
20
+ }
@@ -1,54 +1,54 @@
1
- import { __decorate } from "tslib";
2
- import { html } from "lit";
3
- import { state } from "lit/decorators.js";
4
- import { ZomeElement } from "@ddd-qc/lit-happ";
5
- import { AgentDirectoryZvm } from "../agent_directory.zvm";
6
- /**
7
- * @element agent-directory-list
8
- */
9
- export class AgentDirectoryList extends ZomeElement {
10
- /** Ctor */
11
- constructor() {
12
- super(AgentDirectoryZvm.DEFAULT_ZOME_NAME);
13
- /** -- Fields -- */
14
- this._initialized = false;
15
- }
16
- /** -- Methods -- */
17
- /** After first call to render() */
18
- async firstUpdated() {
19
- //this._viewModel.subscribe(this, 'perspective');
20
- await this.refresh();
21
- this._initialized = true;
22
- }
23
- /** After each call to render() */
24
- async updated(changedProperties) {
25
- // n/a
26
- }
27
- /** */
28
- async refresh(_e) {
29
- //console.log("refresh(): Pulling data from DHT")
30
- await this._zvm.probeAll();
31
- }
32
- /** */
33
- render() {
34
- console.log("agent-directory-list render() START");
35
- if (!this._initialized) {
36
- return html `<span>Loading...</span>`;
37
- }
38
- /* Agents */
39
- const agentLi = Object.entries(this.perspective.agents).map(([_index, agentIdB64]) => {
40
- //console.log("" + index + ". " + agentIdB64)
41
- return html `<li value="${agentIdB64}">${agentIdB64}</li>`;
42
- });
43
- /** render all */
1
+ import { __decorate } from "tslib";
2
+ import { html } from "lit";
3
+ import { state } from "lit/decorators.js";
4
+ import { ZomeElement } from "@ddd-qc/lit-happ";
5
+ import { AgentDirectoryZvm } from "../agent_directory.zvm";
6
+ /**
7
+ * @element agent-directory-list
8
+ */
9
+ export class AgentDirectoryList extends ZomeElement {
10
+ /** Ctor */
11
+ constructor() {
12
+ super(AgentDirectoryZvm.DEFAULT_ZOME_NAME);
13
+ /** -- Fields -- */
14
+ this._initialized = false;
15
+ }
16
+ /** -- Methods -- */
17
+ /** After first call to render() */
18
+ async firstUpdated() {
19
+ //this._viewModel.subscribe(this, 'perspective');
20
+ await this.refresh();
21
+ this._initialized = true;
22
+ }
23
+ /** After each call to render() */
24
+ async updated(changedProperties) {
25
+ // n/a
26
+ }
27
+ /** */
28
+ async refresh(_e) {
29
+ //console.log("refresh(): Pulling data from DHT")
30
+ await this._zvm.probeAll();
31
+ }
32
+ /** */
33
+ render() {
34
+ console.log("agent-directory-list render() START");
35
+ if (!this._initialized) {
36
+ return html `<span>Loading...</span>`;
37
+ }
38
+ /* Agents */
39
+ const agentLi = Object.entries(this.perspective.agents).map(([_index, agentIdB64]) => {
40
+ //console.log("" + index + ". " + agentIdB64)
41
+ return html `<li value="${agentIdB64}">${agentIdB64}</li>`;
42
+ });
43
+ /** render all */
44
44
  return html `
45
45
  <ul>
46
46
  ${agentLi}
47
47
  </ul>
48
- `;
49
- }
50
- }
51
- __decorate([
52
- state()
53
- ], AgentDirectoryList.prototype, "_initialized", void 0);
48
+ `;
49
+ }
50
+ }
51
+ __decorate([
52
+ state()
53
+ ], AgentDirectoryList.prototype, "_initialized", void 0);
54
54
  //# sourceMappingURL=agent-directory-list.js.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from './agent_directory.zvm';
2
- export * from './bindings/agent_directory.proxy';
3
- export * from './elements/agent-directory-list';
1
+ export * from './agent_directory.zvm';
2
+ export * from './elements/agent-directory-list';
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export * from './agent_directory.zvm';
2
- export * from './bindings/agent_directory.proxy';
3
- export * from './elements/agent-directory-list';
1
+ export * from './agent_directory.zvm';
2
+ export * from './elements/agent-directory-list';
4
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './agent_directory.zvm';\nexport * from './bindings/agent_directory.proxy';\nexport * from './elements/agent-directory-list';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './agent_directory.zvm';\nexport * from './elements/agent-directory-list';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-qc/agent-directory",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "license" : "CAL-1.0",
5
5
  "keywords": ["holochain", "zome"],
6
6
  "main": "./dist/index.js",
@@ -21,14 +21,14 @@
21
21
  "devDependencies": {
22
22
  "lit-analyzer": "^1.2.1",
23
23
  "watch-cli": "^0.2.3",
24
- "tslib": "^2.3.1",
25
- "typescript": "4.3.5"
24
+ "tslib": "^2.4.0",
25
+ "typescript": "^4.9.0"
26
26
  },
27
27
  "dependencies": {
28
- "@ddd-qc/lit-happ": "0.10.0",
29
- "@ddd-qc/cell-proxy": "0.10.0",
30
- "@holochain/client": "^0.11.8",
31
- "@holochain-open-dev/core-types": "^0.6.1",
28
+ "@ddd-qc/lit-happ": "0.10.1",
29
+ "@ddd-qc/cell-proxy": "0.10.1",
30
+ "@holochain/client": "^0.11.9",
31
+ "@holochain-open-dev/core-types": "^0.6.3",
32
32
  "lit": "^2.3.0"
33
33
  },
34
34
  "type": "module",
package/README.md DELETED
@@ -1,25 +0,0 @@
1
- # Agent Directory
2
-
3
- A holochain zome module that registers agents to a known directory path on agent init.
4
-
5
-
6
- # API
7
-
8
- Uses [dna-client](https://www.npmjs.com/package/@ddd-qc/dna-client) framework.
9
- Provides a ZomeProxy and ZomeViewModel.
10
-
11
- ### Perspective
12
-
13
- ```typescript
14
- interface AgentDirectoryPerspective {
15
- agents: AgentPubKeyB64[], // List of registered agents
16
- }
17
- ```
18
-
19
- ### ZomeViewModel
20
- - `probeAll()`: Check the DHT for any kind of new data.
21
- - `probeRegisteredAgents()`: Check the DHT for new registered agents.
22
-
23
-
24
- # Custom Elements
25
- - `<agent-directory-list>`: A `ul` of all the AgentPubKeys found by `get_registered_agents()`