@ddd-qc/lit-happ 0.9.8 → 0.10.1

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.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # lit-happ
2
2
 
3
+ **Compatible with:**
4
+ - **HDK v0.1.0-beta-rc.1** & **HDI v0.2.0-beta-rc.1**
5
+ - **@holochain/client v0.11.9**
6
+ -
3
7
  Builds on the [cell-proxy](https://www.npmjs.com/package/@ddd-qc/cell-proxy) package to provide a MVVM framework for building web-UI in [Lit](https://www.npmjs.com/package/lit) for [holochain](https://www.npmjs.com/package/@holochain/client) apps.
4
8
 
5
9
 
@@ -1,28 +1,28 @@
1
1
  import { LitElement, PropertyValues } from "lit";
2
2
  import { DnaViewModel } from "./DnaViewModel";
3
- import { CellId, InstalledCell } from "@holochain/client";
4
- import { AgentPubKeyB64, EntryHashB64 } from "@holochain-open-dev/core-types";
5
- import { BaseRoleName, IInstalledCell, RoleInstanceId } from "@ddd-qc/cell-proxy";
3
+ import { Cell } from "@holochain/client";
4
+ import { BaseRoleName } from "@ddd-qc/cell-proxy";
6
5
  declare const DnaElement_base: (abstract new (...args: any[]) => {
7
- baseRoleName: string; /** Provided by Context depending on BaseRoleName */
6
+ _cell?: Cell;
7
+ readonly cell: Cell;
8
+ readonly cellId: import("@holochain/client").CellId;
9
+ readonly dnaHash: string;
10
+ readonly agentPubKey: string;
11
+ }) & ((abstract new (...args: any[]) => {
12
+ baseRoleName: string; /** if BaseRoleName is not provided, subclass must call requestDvm() in its Ctor */
8
13
  }) & {
9
14
  readonly DEFAULT_BASE_ROLE_NAME: string;
10
- } & typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
15
+ }) & typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
11
16
  /**
12
17
  * A LitElement that is bound to a specific DnaViewModel, e.g. a View for the ViewModel
13
18
  */
14
- export declare class DnaElement<P, DVM extends DnaViewModel> extends DnaElement_base implements IInstalledCell {
19
+ export declare class DnaElement<P, DVM extends DnaViewModel> extends DnaElement_base {
15
20
  /** if BaseRoleName is not provided, subclass must call requestDvm() in its Ctor */
16
21
  constructor(baseRoleName?: BaseRoleName);
17
22
  /** Provided by Context depending on BaseRoleName */
18
23
  protected _dvm: DVM;
19
- installedCell: InstalledCell;
24
+ _cell_via_context: Cell;
20
25
  perspective: P;
21
- /** InstalledCell interface */
22
- get roleInstanceId(): RoleInstanceId;
23
- get cellId(): CellId;
24
- get dnaHash(): EntryHashB64;
25
- get agentPubKey(): AgentPubKeyB64;
26
26
  /** -- Methods -- */
27
27
  /** */
28
28
  protected requestDvm(): void;
@@ -32,7 +32,7 @@ export declare class DnaElement<P, DVM extends DnaViewModel> extends DnaElement_
32
32
  */
33
33
  protected dvmUpdated(newDvm: DVM, oldDvm?: DVM): Promise<void>;
34
34
  /** */
35
- shouldUpdate(_changedProperties: PropertyValues<this>): boolean;
35
+ shouldUpdate(changedProperties: PropertyValues<this>): boolean;
36
36
  /** */
37
37
  protected willUpdate(changedProperties: PropertyValues<this>): void;
38
38
  }
@@ -1,14 +1,15 @@
1
- import { __decorate } from "tslib";
1
+ import { __awaiter, __decorate } from "tslib";
2
2
  import { ScopedElementsMixin } from "@open-wc/scoped-elements";
3
3
  import { LitElement } from "lit";
4
4
  import { property, state } from "lit/decorators.js";
5
5
  import { ContextConsumer, contextProvided, createContext } from "@lit-labs/context";
6
- import { RoleSpecificMixin } from "@ddd-qc/cell-proxy";
6
+ import { CellMixin } from "@ddd-qc/cell-proxy";
7
7
  import { cellContext } from "./elements/cell-context";
8
+ import { RoleMixin } from "./roleMixin";
8
9
  /**
9
10
  * A LitElement that is bound to a specific DnaViewModel, e.g. a View for the ViewModel
10
11
  */
11
- export class DnaElement extends RoleSpecificMixin(ScopedElementsMixin(LitElement)) {
12
+ export class DnaElement extends CellMixin(RoleMixin(ScopedElementsMixin(LitElement))) {
12
13
  /** if BaseRoleName is not provided, subclass must call requestDvm() in its Ctor */
13
14
  constructor(baseRoleName) {
14
15
  super();
@@ -17,18 +18,12 @@ export class DnaElement extends RoleSpecificMixin(ScopedElementsMixin(LitElement
17
18
  this.requestDvm();
18
19
  }
19
20
  }
20
- /** InstalledCell interface */
21
- //get installedCell(): InstalledCell {return this._dvm.installedCell}
22
- get roleInstanceId() { return this._dvm.roleInstanceId; }
23
- get cellId() { return this._dvm.cellId; }
24
- get dnaHash() { return this._dvm.dnaHash; }
25
- get agentPubKey() { return this._dvm.agentPubKey; }
26
21
  /** -- Methods -- */
27
22
  /** */
28
23
  requestDvm() {
29
24
  /** Consume Context based on given dnaHash */
30
- const roleInstanceId = this.installedCell ? this.installedCell.role_id : this.baseRoleName;
31
- const contextType = createContext('dvm/' + roleInstanceId);
25
+ const cellName = this._cell_via_context ? this._cell_via_context.name : this.baseRoleName;
26
+ const contextType = createContext('dvm/' + cellName);
32
27
  console.log(`\t\t Requesting context "${contextType}"`);
33
28
  /*const consumer =*/ new ContextConsumer(this, contextType, (value, dispose) => {
34
29
  console.log(`\t\t Received value for context "${contextType}"`);
@@ -45,16 +40,24 @@ export class DnaElement extends RoleSpecificMixin(ScopedElementsMixin(LitElement
45
40
  * To be overriden by subclasses
46
41
  * Example: Have a subclass unsubscribe to oldDvm's zvms and subscribe to the new ones
47
42
  */
48
- async dvmUpdated(newDvm, oldDvm) {
49
- //console.log(`\t\t Default dvmUpdated() called`)
43
+ dvmUpdated(newDvm, oldDvm) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ //console.log(`\t\t Default dvmUpdated() called`)
46
+ });
50
47
  }
51
48
  /** */
52
- shouldUpdate(_changedProperties) {
49
+ shouldUpdate(changedProperties) {
50
+ if (changedProperties.has("_cell_via_context")) {
51
+ this._cell = this._cell_via_context;
52
+ }
53
+ if (!this._dvm) {
54
+ this.requestDvm();
55
+ }
53
56
  return !!this._dvm;
54
57
  }
55
58
  /** */
56
59
  willUpdate(changedProperties) {
57
- if (changedProperties.has("installedCell")) {
60
+ if (changedProperties.has("_cell_via_context")) {
58
61
  this.requestDvm();
59
62
  }
60
63
  }
@@ -64,8 +67,8 @@ __decorate([
64
67
  ], DnaElement.prototype, "_dvm", void 0);
65
68
  __decorate([
66
69
  contextProvided({ context: cellContext, subscribe: true }),
67
- property({ type: Object })
68
- ], DnaElement.prototype, "installedCell", void 0);
70
+ property({ type: Object, attribute: false })
71
+ ], DnaElement.prototype, "_cell_via_context", void 0);
69
72
  __decorate([
70
73
  property({ type: Object, attribute: false, hasChanged: (_v, _old) => true })
71
74
  ], DnaElement.prototype, "perspective", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"DnaElement.js","sourceRoot":"","sources":["../src/DnaElement.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAC,UAAU,EAAiB,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAE,eAAe,EAAE,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAIlF,OAAO,EAA+C,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,UAAwC,SAAQ,iBAAiB,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAE7G,mFAAmF;IACnF,YAAY,YAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,YAAY,EAAE;YAChB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;YACjC,IAAI,CAAC,UAAU,EAAE,CAAC;SACnB;IACH,CAAC;IAYD,8BAA8B;IAC9B,qEAAqE;IACrE,IAAI,cAAc,KAAqB,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,CAAA,CAAC,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I,CAAC,IAAI,CAAC;IACrB,CAAC;IAGD,MAAM;IACI,UAAU,CAAC,iBAAuC;QAC1D,IAAI,iBAAiB,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC9C,IAAI,CAAC,UAAU,EAAE,CAAC;SACnB;IACH,CAAC;CACF;AA/DU;IAAR,KAAK,EAAE;wCAAsB;AAI9B;IAFC,eAAe,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;IACzD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAC,CAAC;qDAClB;AAGzB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAC,CAAC;+CAC3D"}
@@ -1,10 +1,10 @@
1
1
  import { ZomeViewModel } from "./ZomeViewModel";
2
2
  import { ReactiveElement } from "lit";
3
- import { AgentPubKeyB64, Dictionary, EntryHashB64 } from "@holochain-open-dev/core-types";
4
3
  import { ViewModel } from "./ViewModel";
5
- import { AppSignalCb, CellId, InstalledAppId, InstalledCell, ZomeName } from "@holochain/client";
4
+ import { AdminWebsocket, AppSignalCb, InstalledAppId, ZomeName } from "@holochain/client";
6
5
  import { DnaModifiersOptions, ZvmDef } from "./definitions";
7
- import { CellProxy, RoleSpecific, ConductorAppProxy, HCL, IInstalledCell, RoleInstanceId } from "@ddd-qc/cell-proxy";
6
+ import { CellProxy, ConductorAppProxy, HCL, Dictionary } from "@ddd-qc/cell-proxy";
7
+ import { RoleSpecific } from "./roleMixin";
8
8
  /** Interface specific to DnaViewModel class */
9
9
  interface IDnaViewModel {
10
10
  dumpLogs(zomeName?: ZomeName): void;
@@ -16,17 +16,23 @@ export type DvmConstructor = typeof RoleSpecific & {
16
16
  new (host: ReactiveElement, proxy: ConductorAppProxy, idOrHcl: HCL | InstalledAppId): DnaViewModel;
17
17
  };
18
18
  declare const DnaViewModel_base: (abstract new (...args: any[]) => {
19
+ _cell?: import("@holochain/client").Cell;
20
+ readonly cell: import("@holochain/client").Cell;
21
+ readonly cellId: import("@holochain/client").CellId;
22
+ readonly dnaHash: string;
23
+ readonly agentPubKey: string;
24
+ }) & ((abstract new (...args: any[]) => {
19
25
  baseRoleName: string;
20
26
  }) & {
21
27
  readonly DEFAULT_BASE_ROLE_NAME: string;
22
- } & typeof ViewModel;
28
+ }) & typeof ViewModel;
23
29
  /**
24
30
  * Abstract ViewModel for a DNA.
25
31
  * It holds the CellProxy and all the ZomeViewModels of the DNA.
26
32
  * A DNA is expected to derive this class and add extra logic at the DNA level.
27
33
  * TODO: Split into RoleViewModel and CellViewModel (e.g. have call logs separated by role)
28
34
  */
29
- export declare abstract class DnaViewModel extends DnaViewModel_base implements IInstalledCell, IDnaViewModel {
35
+ export declare abstract class DnaViewModel extends DnaViewModel_base implements IDnaViewModel {
30
36
  static ZVM_DEFS: ZvmDef[];
31
37
  static DNA_MODIFIERS: DnaModifiersOptions;
32
38
  abstract signalHandler?: AppSignalCb;
@@ -38,12 +44,6 @@ export declare abstract class DnaViewModel extends DnaViewModel_base implements
38
44
  protected _zomeNames: Dictionary<ZomeName>;
39
45
  private _allEntryDefs;
40
46
  readonly hcl: HCL;
41
- /** InstalledCell interface */
42
- get installedCell(): InstalledCell;
43
- get roleInstanceId(): RoleInstanceId;
44
- get cellId(): CellId;
45
- get dnaHash(): EntryHashB64;
46
- get agentPubKey(): AgentPubKeyB64;
47
47
  /** -- Getters -- */
48
48
  getZomeEntryDefs(zomeName: ZomeName): [string, boolean][] | undefined;
49
49
  getZomeViewModel(zomeName: ZomeName): ZomeViewModel | undefined;
@@ -53,6 +53,8 @@ export declare abstract class DnaViewModel extends DnaViewModel_base implements
53
53
  provideContext(host: ReactiveElement): void;
54
54
  getContext(): any;
55
55
  /** */
56
+ authorizeZomeCalls(adminWs: AdminWebsocket): Promise<void>;
57
+ /** */
56
58
  probeAll(): Promise<void>;
57
59
  /** Maybe useless since the entry defs are in the integrity zome which is not represented here */
58
60
  fetchAllEntryDefs(): Promise<Dictionary<[string, boolean][]>>;
@@ -1,16 +1,20 @@
1
+ import { __awaiter } from "tslib";
1
2
  import { ViewModel } from "./ViewModel";
3
+ import { GrantedFunctionsType, } from "@holochain/client";
2
4
  import { createContext } from "@lit-labs/context";
3
- import { RoleSpecificMixin, HCL } from "@ddd-qc/cell-proxy";
5
+ import { HCL, CellMixin } from "@ddd-qc/cell-proxy";
6
+ import { RoleMixin } from "./roleMixin";
4
7
  /**
5
8
  * Abstract ViewModel for a DNA.
6
9
  * It holds the CellProxy and all the ZomeViewModels of the DNA.
7
10
  * A DNA is expected to derive this class and add extra logic at the DNA level.
8
11
  * TODO: Split into RoleViewModel and CellViewModel (e.g. have call logs separated by role)
9
12
  */
10
- export class DnaViewModel extends RoleSpecificMixin(ViewModel) {
13
+ export class DnaViewModel extends CellMixin(RoleMixin(ViewModel)) {
11
14
  /** Ctor */
12
15
  constructor(host, conductorAppProxy, idOrHcl) {
13
16
  super();
17
+ /* ZomeName -> Zvm */
14
18
  this._zomeViewModels = {};
15
19
  /* ZvmCtorName -> ZomeName */
16
20
  this._zomeNames = {};
@@ -25,6 +29,8 @@ export class DnaViewModel extends RoleSpecificMixin(ViewModel) {
25
29
  const dvmCtor = this.constructor;
26
30
  const zvmDefs = dvmCtor.ZVM_DEFS;
27
31
  this._cellProxy = conductorAppProxy.getCellProxy(this.hcl); // WARN can throw error
32
+ this._cell = this._cellProxy.cell;
33
+ console.log(`DVM.ctor of ${this.baseRoleName}`, this._cellProxy.cell);
28
34
  /** Create all ZVMs for this DNA */
29
35
  for (const zvmDef of zvmDefs) {
30
36
  let zvm;
@@ -40,12 +46,6 @@ export class DnaViewModel extends RoleSpecificMixin(ViewModel) {
40
46
  }
41
47
  this.provideContext(host); // TODO move this to host.connectedCallback? e.g. change ViewModel to a ReactiveController
42
48
  }
43
- /** InstalledCell interface */
44
- get installedCell() { return this._cellProxy.installedCell; }
45
- get roleInstanceId() { return this.hcl.roleInstanceId; }
46
- get cellId() { return this._cellProxy.cellId; }
47
- get dnaHash() { return this._cellProxy.dnaHash; }
48
- get agentPubKey() { return this._cellProxy.agentPubKey; }
49
49
  /** -- Getters -- */
50
50
  getZomeEntryDefs(zomeName) { return this._allEntryDefs[zomeName]; }
51
51
  getZomeViewModel(zomeName) { return this._zomeViewModels[zomeName]; }
@@ -59,29 +59,56 @@ export class DnaViewModel extends RoleSpecificMixin(ViewModel) {
59
59
  zvm.provideContext(host);
60
60
  }
61
61
  }
62
- getContext() { return createContext('dvm/' + this.roleInstanceId); }
62
+ getContext() { return createContext('dvm/' + this.cell.name); }
63
63
  ;
64
64
  /** */
65
- async probeAll() {
66
- for (const [name, zvm] of Object.entries(this._zomeViewModels)) {
67
- //console.log("Dvm.probeAll()", name)
68
- await zvm.probeAll();
69
- }
70
- }
71
- /** Maybe useless since the entry defs are in the integrity zome which is not represented here */
72
- async fetchAllEntryDefs() {
73
- for (const zvm of Object.values(this._zomeViewModels)) {
74
- const zomeName = zvm.zomeName;
65
+ authorizeZomeCalls(adminWs) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ let allFnNames = [];
68
+ for (const [zomeName, zvm] of Object.entries(this._zomeViewModels)) {
69
+ allFnNames = allFnNames.concat(zvm.zomeProxy.fnNames);
70
+ }
71
+ const grantedFns = { [GrantedFunctionsType.Listed]: allFnNames };
75
72
  try {
76
- const defs = await this._cellProxy.callEntryDefs(zomeName); // TODO optimize
77
- this._allEntryDefs[zomeName] = defs;
73
+ console.log("authorizeSigningCredentials: " + this.baseRoleName, allFnNames);
74
+ yield adminWs.authorizeSigningCredentials(this.cellId, grantedFns);
78
75
  }
79
76
  catch (e) {
80
- console.warn(`Calling "entry_defs()" failed on zome "${zomeName}". Possibly because zome does not have any entry types defined.`);
81
- this._allEntryDefs[zomeName] = [];
77
+ console.warn("authorizeSigningCredentials FAILED.", e);
82
78
  }
83
- }
84
- return this._allEntryDefs;
79
+ // this._signingProps = getSigningCredentials(this.cellId);
80
+ // console.log({signProps: this._signingProps})
81
+ //
82
+ // for (const [zomeName, zvm] of Object.entries(this._zomeViewModels)) {
83
+ // zvm.zomeProxy.setSigningProps(this._signingProps);
84
+ // }
85
+ });
86
+ }
87
+ /** */
88
+ probeAll() {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ for (const [name, zvm] of Object.entries(this._zomeViewModels)) {
91
+ //console.log("Dvm.probeAll()", name)
92
+ yield zvm.probeAll();
93
+ }
94
+ });
95
+ }
96
+ /** Maybe useless since the entry defs are in the integrity zome which is not represented here */
97
+ fetchAllEntryDefs() {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ for (const zvm of Object.values(this._zomeViewModels)) {
100
+ const zomeName = zvm.zomeName;
101
+ try {
102
+ const defs = yield this._cellProxy.callEntryDefs(zomeName); // TODO optimize
103
+ this._allEntryDefs[zomeName] = defs;
104
+ }
105
+ catch (e) {
106
+ console.warn(`Calling "entry_defs()" failed on zome "${zomeName}". Possibly because zome does not have any entry types defined.`);
107
+ this._allEntryDefs[zomeName] = [];
108
+ }
109
+ }
110
+ return this._allEntryDefs;
111
+ });
85
112
  }
86
113
  /** */
87
114
  dumpLogs(zomeName) {
@@ -1 +1 @@
1
- {"version":3,"file":"DnaViewModel.js","sourceRoot":"","sources":["../src/DnaViewModel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAA0B,iBAAiB,EAAqB,GAAG,EAAiC,MAAM,oBAAoB,CAAC;AAmBtI;;;;;GAKG;AACH,MAAM,OAAgB,YAAa,SAAQ,iBAAiB,CAAC,SAAS,CAAC;IAQrE,WAAW;IACX,YAAY,IAAqB,EAAE,iBAAoC,EAAE,OAA6B;QACpG,KAAK,EAAE,CAAC;QA6BA,oBAAe,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QAC1B,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;CACF"}
@@ -11,6 +11,7 @@ declare const HappElement_base: typeof LitElement & import("@open-wc/dedupe-mixi
11
11
  export declare class HappElement extends HappElement_base {
12
12
  /** Must be defined by subclass */
13
13
  static HVM_DEF: HvmDef;
14
+ /** Set during init triggered at ctor */
14
15
  conductorAppProxy: ConductorAppProxy;
15
16
  hvm: HappViewModel;
16
17
  /** Ctor */
@@ -1,4 +1,4 @@
1
- import { __decorate } from "tslib";
1
+ import { __awaiter, __decorate } from "tslib";
2
2
  import { LitElement } from "lit";
3
3
  import { state } from "lit/decorators.js";
4
4
  import { ConductorAppProxy } from "@ddd-qc/cell-proxy";
@@ -14,24 +14,30 @@ export class HappElement extends ScopedElementsMixin(LitElement) {
14
14
  /* await */ this.initHapp(port_or_socket, appId);
15
15
  }
16
16
  /** */
17
- async happInitialized() { }
17
+ happInitialized() {
18
+ return __awaiter(this, void 0, void 0, function* () { });
19
+ }
18
20
  /** */
19
- async initHapp(port_or_socket, appId) {
20
- this.conductorAppProxy = await ConductorAppProxy.new(port_or_socket);
21
- const hvmDef = this.constructor.HVM_DEF;
22
- if (!hvmDef) {
23
- throw Error("HVM_DEF static field undefined in HappElement subclass " + this.constructor.name);
24
- }
25
- /** Override appId */
26
- if (appId) {
27
- hvmDef.id = appId;
28
- }
29
- this.hvm = await HappViewModel.new(this, this.conductorAppProxy, hvmDef);
30
- await this.happInitialized();
21
+ initHapp(port_or_socket, appId) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ this.conductorAppProxy = yield ConductorAppProxy.new(port_or_socket);
24
+ const hvmDef = this.constructor.HVM_DEF;
25
+ if (!hvmDef) {
26
+ throw Error("HVM_DEF static field undefined in HappElement subclass " + this.constructor.name);
27
+ }
28
+ /** Override appId */
29
+ if (appId) {
30
+ hvmDef.id = appId;
31
+ }
32
+ this.hvm = yield HappViewModel.new(this, this.conductorAppProxy, hvmDef);
33
+ yield this.happInitialized();
34
+ });
31
35
  }
32
36
  /** */
33
- async createClone(baseRoleName, cellDef) {
34
- return this.hvm.cloneDvm(baseRoleName, cellDef);
37
+ createClone(baseRoleName, cellDef) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ return this.hvm.cloneDvm(baseRoleName, cellDef);
40
+ });
35
41
  }
36
42
  /** */
37
43
  shouldUpdate() {
@@ -1 +1 @@
1
- {"version":3,"file":"HappElement.js","sourceRoot":"","sources":["../src/HappElement.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAe,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAK/D;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,mBAAmB,CAAC,UAAU,CAAC;IAS9D,WAAW;IACX,YAAsB,cAAqC,EAAE,KAAsB;QACjF,KAAK,EAAE,CAAC;QACR,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;IAGD,MAAM;IACN,KAAK,CAAC,eAAe,KAAmB,CAAC;IAGzC,MAAM;IACI,KAAK,CAAC,QAAQ,CAAC,cAAqC,EAAE,KAAsB;QACpF,IAAI,CAAC,iBAAiB,GAAG,MAAM,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACrE,MAAM,MAAM,GAAI,IAAI,CAAC,WAAkC,CAAC,OAAO,CAAC;QAChE,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,KAAK,CAAC,yDAAyD,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;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B,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YACrE,MAAM,MAAM,GAAI,IAAI,CAAC,WAAkC,CAAC,OAAO,CAAC;YAChE,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,KAAK,CAAC,yDAAyD,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aAChG;YACD,qBAAqB;YACrB,IAAI,KAAK,EAAE;gBACT,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC;aACnB;YACD,IAAI,CAAC,GAAG,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;YACzE,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC/B,CAAC;KAAA;IAGD,MAAM;IACA,WAAW,CAAC,YAA0B,EAAE,OAAiB;;YAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IAGD,MAAM;IACN,YAAY;QACV,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;CAEF;AAzCU;IAAR,KAAK,EAAE;wCAAqB"}
@@ -1,7 +1,6 @@
1
- import { Dictionary } from "@holochain-open-dev/core-types";
2
- import { InstalledAppId } from "@holochain/client";
1
+ import { AdminWebsocket, InstalledAppId } from "@holochain/client";
3
2
  import { ReactiveElement } from "lit";
4
- import { BaseRoleName, ConductorAppProxy, HCL, RoleInstanceId } from "@ddd-qc/cell-proxy";
3
+ import { BaseRoleName, ConductorAppProxy, Dictionary, HCL } from "@ddd-qc/cell-proxy";
5
4
  import { CellDef, DvmDef, HvmDef } from "./definitions";
6
5
  import { DnaViewModel } from "./DnaViewModel";
7
6
  import { CellId } from "@holochain/client/lib/types";
@@ -18,13 +17,14 @@ export declare class HappViewModel {
18
17
  protected _dvmMap: Dictionary<DnaViewModel>;
19
18
  /** BaseRoleName -> DvmDef */
20
19
  protected _defMap: Dictionary<DvmDef>;
20
+ protected _adminWs?: AdminWebsocket;
21
21
  /** -- Getters -- */
22
22
  /** */
23
23
  getDef(name: BaseRoleName): DvmDef | undefined;
24
24
  /** */
25
25
  getCellDvms(cellId: CellId): Dictionary<DnaViewModel> | undefined;
26
26
  /** */
27
- getDvm(hclOrId: HCL | RoleInstanceId): DnaViewModel | undefined;
27
+ getDvm(hclOrId: HCL | BaseRoleName): DnaViewModel | undefined;
28
28
  /** */
29
29
  getClones(baseRoleName: BaseRoleName): DnaViewModel[];
30
30
  /** -- Create -- */
@@ -33,6 +33,7 @@ export declare class HappViewModel {
33
33
  /** Ctor */
34
34
  private constructor();
35
35
  /** -- Methods -- */
36
+ authorizeAllZomeCalls(adminWs: AdminWebsocket): Promise<void>;
36
37
  /** */
37
38
  private createStartingClonesDvm;
38
39
  /** */
@@ -46,5 +47,5 @@ export declare class HappViewModel {
46
47
  /** */
47
48
  private initialProbe;
48
49
  /** */
49
- dumpLogs(roleInstanceId?: RoleInstanceId): void;
50
+ dumpLogs(baseRoleName?: BaseRoleName): void;
50
51
  }