@ddd-qc/agent-directory 6.33.2 → 6.33.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  import { ZomeViewModel, AgentId } from "@ddd-qc/lit-happ";
2
2
  import { AgentDirectoryProxy } from "./bindings/agentDirectory.proxy";
3
+ import { GetStrategy } from "@holochain-open-dev/core-types";
3
4
  /** Perspective */
4
5
  export interface AgentDirectoryPerspective {
5
6
  agents: AgentId[];
@@ -16,7 +17,7 @@ export declare class AgentDirectoryZvm extends ZomeViewModel {
16
17
  /** */
17
18
  protected hasChanged(): boolean;
18
19
  /** */
19
- probeAllInner(): Promise<void>;
20
+ probeAllInner(strategy: GetStrategy): Promise<void>;
20
21
  /** */
21
- probeRegisteredAgents(): Promise<void>;
22
+ probeRegisteredAgents(_strategy: GetStrategy): Promise<void>;
22
23
  }
@@ -22,13 +22,13 @@ export class AgentDirectoryZvm extends ZomeViewModel {
22
22
  return JSON.stringify(this.perspective.agents) !== JSON.stringify(this._previousPerspective.agents);
23
23
  }
24
24
  /** */
25
- async probeAllInner() {
26
- await this.probeRegisteredAgents();
25
+ async probeAllInner(strategy) {
26
+ await this.probeRegisteredAgents(strategy);
27
27
  }
28
28
  /** */
29
- async probeRegisteredAgents() {
29
+ async probeRegisteredAgents(_strategy) {
30
30
  console.log("AgentDirectoryZvm.probeRegisteredAgents()");
31
- let agents = await this.zomeProxy.getRegisteredAgents();
31
+ let agents = await this.zomeProxy.getRegisteredAgents( /*strategy*/); // Implement strategy in getRegisteredAgents
32
32
  this._agents = agents.map((agentKey) => new AgentId(agentKey));
33
33
  this.notifySubscribers();
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"agentDirectory.zvm.js","sourceRoot":"","sources":["../src/agentDirectory.zvm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAOpE,MAAM;AACN,MAAM,OAAO,iBAAkB,SAAQ,aAAa;IAApD;;QASE,mBAAmB;QAEX,YAAO,GAAc,EAAE,CAAC;IA2BlC,CAAC;IAjCC,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAiC,CAAC;IAChD,CAAC;IAMD,oBAAoB;IAEpB,KAAK;IACL,IAAI,WAAW;QACb,OAAO,EAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAC,CAAA;IAC/B,CAAC;IAED,MAAM;IACI,UAAU;QAClB,IAAI,CAAC,IAAI,CAAC,oBAAoB;YAAE,OAAO,IAAI,CAAC;QAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAE,IAAI,CAAC,oBAAkD,CAAC,MAAM,CAAC,CAAA;IACpI,CAAC;IAED,MAAM;IACN,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAA;IACpC,CAAC;IAED,MAAM;IACN,KAAK,CAAC,qBAAqB;QACzB,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,iBAAiB,EAAE,CAAA;IAC1B,CAAC;;AAnCD,4BAA4B;AACZ,4BAAU,GAAG,mBAAmB,AAAtB,CAAuB","sourcesContent":["import {ZomeViewModel, AgentId} from \"@ddd-qc/lit-happ\";\nimport {AgentDirectoryProxy} from \"./bindings/agentDirectory.proxy\";\n\n/** Perspective */\nexport interface AgentDirectoryPerspective {\n agents: AgentId[],\n}\n\n/** */\nexport class AgentDirectoryZvm extends ZomeViewModel {\n\n /** -- ZVM Boilerplate -- */\n static readonly ZOME_PROXY = AgentDirectoryProxy;\n\n get zomeProxy(): AgentDirectoryProxy {\n return this._zomeProxy as AgentDirectoryProxy;\n }\n\n /** -- Fields -- */\n\n private _agents: AgentId[] = [];\n\n /** -- Methods -- */\n\n /* */\n get perspective(): AgentDirectoryPerspective {\n return {agents: this._agents}\n }\n\n /** */\n protected hasChanged(): boolean {\n if (!this._previousPerspective) return true;\n return JSON.stringify(this.perspective.agents) !== JSON.stringify((this._previousPerspective as AgentDirectoryPerspective).agents)\n }\n\n /** */\n async probeAllInner(): Promise<void> {\n await this.probeRegisteredAgents()\n }\n\n /** */\n async probeRegisteredAgents() {\n console.log(\"AgentDirectoryZvm.probeRegisteredAgents()\");\n let agents = await this.zomeProxy.getRegisteredAgents();\n this._agents = agents.map((agentKey) => new AgentId(agentKey));\n this.notifySubscribers()\n }\n}\n"]}
1
+ {"version":3,"file":"agentDirectory.zvm.js","sourceRoot":"","sources":["../src/agentDirectory.zvm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAQpE,MAAM;AACN,MAAM,OAAO,iBAAkB,SAAQ,aAAa;IAApD;;QASE,mBAAmB;QAEX,YAAO,GAAc,EAAE,CAAC;IA2BlC,CAAC;IAjCC,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAiC,CAAC;IAChD,CAAC;IAMD,oBAAoB;IAEpB,KAAK;IACL,IAAI,WAAW;QACb,OAAO,EAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAC,CAAA;IAC/B,CAAC;IAED,MAAM;IACI,UAAU;QAClB,IAAI,CAAC,IAAI,CAAC,oBAAoB;YAAE,OAAO,IAAI,CAAC;QAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAE,IAAI,CAAC,oBAAkD,CAAC,MAAM,CAAC,CAAA;IACpI,CAAC;IAED,MAAM;IACN,KAAK,CAAC,aAAa,CAAC,QAAqB;QACvC,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAA;IAC5C,CAAC;IAED,MAAM;IACN,KAAK,CAAC,qBAAqB,CAAC,SAAsB;QAChD,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAC,YAAY,CAAC,CAAC,CAAC,4CAA4C;QACjH,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,iBAAiB,EAAE,CAAA;IAC1B,CAAC;;AAnCD,4BAA4B;AACZ,4BAAU,GAAG,mBAAmB,AAAtB,CAAuB","sourcesContent":["import {ZomeViewModel, AgentId} from \"@ddd-qc/lit-happ\";\nimport {AgentDirectoryProxy} from \"./bindings/agentDirectory.proxy\";\nimport {GetStrategy} from \"@holochain-open-dev/core-types\";\n\n/** Perspective */\nexport interface AgentDirectoryPerspective {\n agents: AgentId[],\n}\n\n/** */\nexport class AgentDirectoryZvm extends ZomeViewModel {\n\n /** -- ZVM Boilerplate -- */\n static readonly ZOME_PROXY = AgentDirectoryProxy;\n\n get zomeProxy(): AgentDirectoryProxy {\n return this._zomeProxy as AgentDirectoryProxy;\n }\n\n /** -- Fields -- */\n\n private _agents: AgentId[] = [];\n\n /** -- Methods -- */\n\n /* */\n get perspective(): AgentDirectoryPerspective {\n return {agents: this._agents}\n }\n\n /** */\n protected hasChanged(): boolean {\n if (!this._previousPerspective) return true;\n return JSON.stringify(this.perspective.agents) !== JSON.stringify((this._previousPerspective as AgentDirectoryPerspective).agents)\n }\n\n /** */\n async probeAllInner(strategy: GetStrategy): Promise<void> {\n await this.probeRegisteredAgents(strategy)\n }\n\n /** */\n async probeRegisteredAgents(_strategy: GetStrategy) {\n console.log(\"AgentDirectoryZvm.probeRegisteredAgents()\");\n let agents = await this.zomeProxy.getRegisteredAgents(/*strategy*/); // Implement strategy in getRegisteredAgents\n this._agents = agents.map((agentKey) => new AgentId(agentKey));\n this.notifySubscribers()\n }\n}\n"]}
@@ -3,6 +3,7 @@ import { html } from "lit";
3
3
  import { state, customElement } from "lit/decorators.js";
4
4
  import { ZomeElement } from "@ddd-qc/lit-happ";
5
5
  import { AgentDirectoryZvm } from "../agentDirectory.zvm";
6
+ import { GetStrategy } from "@holochain-open-dev/core-types";
6
7
  /**
7
8
  * @element agent-directory-list
8
9
  */
@@ -21,7 +22,7 @@ let AgentDirectoryList = class AgentDirectoryList extends ZomeElement {
21
22
  }
22
23
  /** */
23
24
  async refresh(_e) {
24
- this._zvm.probeAll();
25
+ this._zvm.probeAll(GetStrategy.Network);
25
26
  }
26
27
  /** */
27
28
  render() {
@@ -1 +1 @@
1
- {"version":3,"file":"agent-directory-list.js","sourceRoot":"","sources":["../../src/elements/agent-directory-list.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAC,KAAK,EAAE,aAAa,EAAC,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAA4B,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAEnF;;GAEG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,WAAyD;IAC/F,WAAW;IACX;QACE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;QAG7C,mBAAmB;QAEF,iBAAY,GAAG,KAAK,CAAC;IAJtC,CAAC;IAOD,oBAAoB;IAEpB,mCAAmC;IACnC,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAGD,MAAM;IACN,KAAK,CAAC,OAAO,CAAC,EAAQ;QACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IACvB,CAAC;IAGD,MAAM;IACN,MAAM;QACJ,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,OAAO,IAAI,CAAA,yBAAyB,CAAC;SACtC;QAED,YAAY;QACZ,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CACvD,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE;YACpB,OAAO,IAAI,CAAC,cAAc,OAAO,CAAC,GAAG,KAAK,OAAO,CAAC,KAAK,OAAO,CAAA;QAChE,CAAC,CACJ,CAAA;QAED,iBAAiB;QACjB,OAAO,IAAI,CAAA,OAAO,OAAO,OAAO,CAAC;IACnC,CAAC;CACF,CAAA;AApCkB;IAAhB,KAAK,EAAE;wDAA8B;AAR3B,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA4C9B","sourcesContent":["import {html} from \"lit\";\nimport {state, customElement} from \"lit/decorators.js\";\nimport {ZomeElement} from \"@ddd-qc/lit-happ\";\nimport {AgentDirectoryPerspective, AgentDirectoryZvm} from \"../agentDirectory.zvm\";\n\n/**\n * @element agent-directory-list\n */\n@customElement(\"agent-directory-list\")\nexport class AgentDirectoryList extends ZomeElement<AgentDirectoryPerspective, AgentDirectoryZvm> {\n /** Ctor */\n constructor() {\n super(AgentDirectoryZvm.DEFAULT_ZOME_NAME);\n }\n\n /** -- Fields -- */\n\n @state() private _initialized = false;\n\n\n /** -- Methods -- */\n\n /** After first call to render() */\n async firstUpdated() {\n await this.refresh();\n this._initialized = true;\n }\n\n\n /** */\n async refresh(_e?: any) {\n this._zvm.probeAll();\n }\n\n\n /** */\n render() {\n console.debug(\"agent-directory-list render()\");\n\n if (!this._initialized) {\n return html`<span>Loading...</span>`;\n }\n\n /* Agents */\n const agentLi = Object.entries(this.perspective.agents).map(\n ([_index, agentId]) => {\n return html `<li value=\"${agentId.b64}\">${agentId.short}</li>`\n }\n )\n\n /** render all */\n return html`<ul>${agentLi}</ul>`;\n }\n}\n"]}
1
+ {"version":3,"file":"agent-directory-list.js","sourceRoot":"","sources":["../../src/elements/agent-directory-list.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAC,KAAK,EAAE,aAAa,EAAC,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAA4B,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAC,WAAW,EAAC,MAAM,gCAAgC,CAAC;AAE3D;;GAEG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,WAAyD;IAC/F,WAAW;IACX;QACE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;QAG7C,mBAAmB;QAEF,iBAAY,GAAG,KAAK,CAAC;IAJtC,CAAC;IAOD,oBAAoB;IAEpB,mCAAmC;IACnC,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAGD,MAAM;IACN,KAAK,CAAC,OAAO,CAAC,EAAQ;QACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAGD,MAAM;IACN,MAAM;QACJ,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,OAAO,IAAI,CAAA,yBAAyB,CAAC;SACtC;QAED,YAAY;QACZ,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CACvD,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE;YACpB,OAAO,IAAI,CAAC,cAAc,OAAO,CAAC,GAAG,KAAK,OAAO,CAAC,KAAK,OAAO,CAAA;QAChE,CAAC,CACJ,CAAA;QAED,iBAAiB;QACjB,OAAO,IAAI,CAAA,OAAO,OAAO,OAAO,CAAC;IACnC,CAAC;CACF,CAAA;AApCkB;IAAhB,KAAK,EAAE;wDAA8B;AAR3B,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA4C9B","sourcesContent":["import {html} from \"lit\";\nimport {state, customElement} from \"lit/decorators.js\";\nimport {ZomeElement} from \"@ddd-qc/lit-happ\";\nimport {AgentDirectoryPerspective, AgentDirectoryZvm} from \"../agentDirectory.zvm\";\nimport {GetStrategy} from \"@holochain-open-dev/core-types\";\n\n/**\n * @element agent-directory-list\n */\n@customElement(\"agent-directory-list\")\nexport class AgentDirectoryList extends ZomeElement<AgentDirectoryPerspective, AgentDirectoryZvm> {\n /** Ctor */\n constructor() {\n super(AgentDirectoryZvm.DEFAULT_ZOME_NAME);\n }\n\n /** -- Fields -- */\n\n @state() private _initialized = false;\n\n\n /** -- Methods -- */\n\n /** After first call to render() */\n async firstUpdated() {\n await this.refresh();\n this._initialized = true;\n }\n\n\n /** */\n async refresh(_e?: any) {\n this._zvm.probeAll(GetStrategy.Network);\n }\n\n\n /** */\n render() {\n console.debug(\"agent-directory-list render()\");\n\n if (!this._initialized) {\n return html`<span>Loading...</span>`;\n }\n\n /* Agents */\n const agentLi = Object.entries(this.perspective.agents).map(\n ([_index, agentId]) => {\n return html `<li value=\"${agentId.b64}\">${agentId.short}</li>`\n }\n )\n\n /** render all */\n return html`<ul>${agentLi}</ul>`;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-qc/agent-directory",
3
- "version": "6.33.2",
3
+ "version": "6.33.3",
4
4
  "license" : "CAL-1.0",
5
5
  "keywords": ["holochain", "zome"],
6
6
  "main": "./dist/index.js",