@ddd-qc/cell-proxy 0.24.7 → 0.25.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pretty.js","sourceRoot":"","sources":["../src/pretty.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAA6B,UAAU,EAAC,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAC,KAAK,EAAC,MAAM,QAAQ,CAAC;AAG7B,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAElF,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,OAAO,IAAI,CAAC,UAAU,EAAE,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAA;AACrE,CAAC;AAED,MAAM;AACN,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,OAAO,EAAE;UACL,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;UAC3B,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;UACnC,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;UACnC,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC;AAGD,MAAM,UAAU,gBAAgB,CAAC,UAAuB;IACtD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,MAA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ACV;YACD,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,EAAE;gBAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;gBAC7B,KAAK,IAAI,QAAQ,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,IAAI,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvF,SAAS;aACV;SACF;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAGD,MAAM;AACN,MAAM,UAAU,iBAAiB,CAAC,YAA0B,EAAE,KAAmB;IAC/E,IAAI,KAAK,GAAG,iBAAiB,YAAY,OAAO,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACzF,KAAK,IAAI,oBAAoB,KAAK,CAAC,WAAW,CAAC,IAAI,MAAM,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACjG,KAAK,IAAI,gBAAgB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,CAAC;IAChE,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QAC3D,KAAK,IAAI,UAAU,KAAK,CAAC,OAAO,CAAA,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAAI,OAAO,KAAK,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KACrH;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["\r\nimport {SignalLog} from \"./AppProxy\";\r\nimport {AppInfo, CellType} from \"@holochain/client\";\r\nimport {BaseRoleName, CellsForRole, str2CellId} from \"./types\";\r\nimport {intoStem} from \"./cell\";\r\nimport {enc64} from \"./hash\";\r\n\r\n\r\nconst zeroPad = (num: number, places: number) => String(num).padStart(places, '0')\r\n\r\nexport function prettyDuration(date: Date): string {\r\n return date.getSeconds() + \".\" + zeroPad(date.getMilliseconds(), 3)\r\n}\r\n\r\n/** */\r\nexport function prettyDate(date: Date): string {\r\n return \"\"\r\n + zeroPad(date.getHours(), 2)\r\n + \":\" + zeroPad(date.getMinutes(), 2)\r\n + \":\" + zeroPad(date.getSeconds(), 2)\r\n + \".\" + zeroPad(date.getMilliseconds(), 3);\r\n}\r\n\r\n\r\nexport function prettySignalLogs(signalLogs: SignalLog[]) {\r\n return signalLogs.map((log) => {\r\n const dnaHash = enc64(str2CellId(log.cellId)[0]).slice(-8);\r\n return {timestamp: prettyDate(new Date(log.ts)), dnaHash, zome: log.zomeName, type: log.type, payload: log.zomeSignal};\r\n })\r\n}\r\n\r\n\r\n/** */\r\nexport function printAppInfo(appInfo: AppInfo): string {\r\n let print = `Happ \"${appInfo.installed_app_id}\" info: (status: ${JSON.stringify(appInfo.status)})`;\r\n for (const [roleName, cellInfos] of Object.entries(appInfo.cell_info)) {\r\n for (const cellInfo of Object.values(cellInfos)) {\r\n if (CellType.Stem in cellInfo) {\r\n const stem = intoStem(cellInfo)!;\r\n print += `\\n - ${roleName}.${stem.name? stem.name : \"unnamed\"}: ${enc64(stem.dna)} (stem)`;\r\n continue;\r\n }\r\n if (CellType.Provisioned in cellInfo) {\r\n const cell = cellInfo.provisioned;\r\n print += `\\n - ${roleName}: ${cell.name} | ${enc64(cell.cell_id[0])}`;\r\n continue;\r\n }\r\n if (CellType.Cloned in cellInfo) {\r\n const cell = cellInfo.cloned;\r\n print += `\\n - ${roleName}.${cell.clone_id}: ${cell.name} | ${enc64(cell.cell_id[0])}`;\r\n continue;\r\n }\r\n }\r\n }\r\n return print;\r\n}\r\n\r\n\r\n/** */\r\nexport function printCellsForRole(baseRoleName: BaseRoleName, cells: CellsForRole): string {\r\n let print = `CellsForRole \"${baseRoleName}\": (${enc64(cells.provisioned.cell_id[1])})\\n`;\r\n print += ` - Provisioned: ${cells.provisioned.name} | ${enc64(cells.provisioned.cell_id[0])}\\n`;\r\n print += ` - Clones : ${Object.values(cells.clones).length}\\n`;\r\n for (const [cloneId, clone] of Object.entries(cells.clones)) {\r\n print += ` - (${clone.enabled? \"enabled\" : \"disabled\"})${cloneId}: ${clone.name} | ${enc64(clone.cell_id[0])}\\n`;\r\n }\r\n return print;\r\n}\r\n"]}
package/dist/types.d.ts CHANGED
@@ -1,20 +1,17 @@
1
1
  import { CellId, RoleName, ClonedCell, ProvisionedCell, ZomeName, FunctionName } from "@holochain/client";
2
- import { AgentPubKey, DnaHash } from "@holochain/client/lib/types";
3
2
  import { Dictionary } from "./utils";
4
- import { SystemSignalProtocol } from "./AppProxy";
3
+ import { AgentId, DnaId } from "./hash";
4
+ import { SystemSignalProtocol } from "./zomeSignals.types";
5
+ /** Signal types */
5
6
  export declare enum SignalType {
6
7
  Unknown = "Unknown",
7
- System = "System",
8
- LitHapp = "LitHapp"
8
+ Empty = "Empty",
9
+ Zome = "Zome"
9
10
  }
10
- export type SignalPayload = unknown | SystemSignal | LitHappSignal;
11
- export type SystemSignal = {
11
+ export type SystemPulse = {
12
12
  System: SystemSignalProtocol;
13
13
  };
14
- export interface LitHappSignal {
15
- from: AgentPubKey;
16
- pulses: unknown[];
17
- }
14
+ /** ---- */
18
15
  export type BaseRoleName = string;
19
16
  export type CloneIndex = number;
20
17
  export type ZomeIndex = number;
@@ -37,7 +34,7 @@ export type ZomeInfo = {
37
34
  };
38
35
  export type DnaInfo = {
39
36
  name: string;
40
- hash: DnaHash;
37
+ id: DnaId;
41
38
  properties: Uint8Array;
42
39
  zome_names: ZomeName[];
43
40
  };
@@ -57,8 +54,10 @@ export type CloneId = RoleName;
57
54
  export declare function createCloneName(baseRoleName: BaseRoleName, cloneIndex: CloneIndex): string;
58
55
  /** */
59
56
  export declare function destructureCloneId(cloneId: CloneId): [BaseRoleName, CloneIndex] | undefined;
57
+ /** */
58
+ export declare function decomposeCellId(cellId: CellId): [DnaId, AgentId];
60
59
  /** -- CellIdStr -- */
61
60
  export type CellIdStr = string;
62
- export declare function CellIdStr(hash_or_id: DnaHash | CellId, key?: AgentPubKey): CellIdStr;
61
+ export declare function CellIdStr(dna_or_cell_id: DnaId | CellId, key?: AgentId): CellIdStr;
63
62
  /** */
64
63
  export declare function str2CellId(str: CellIdStr): CellId;
package/dist/types.js CHANGED
@@ -1,9 +1,11 @@
1
- import { decodeHashFromBase64, encodeHashToBase64, } from "@holochain/client";
1
+ import { AgentId, dec64, DnaId, enc64 } from "./hash";
2
+ //import {AgentPubKey} from "@holochain/client/lib/types";
3
+ /** Signal types */
2
4
  export var SignalType;
3
5
  (function (SignalType) {
4
6
  SignalType["Unknown"] = "Unknown";
5
- SignalType["System"] = "System";
6
- SignalType["LitHapp"] = "LitHapp";
7
+ SignalType["Empty"] = "Empty";
8
+ SignalType["Zome"] = "Zome";
7
9
  })(SignalType || (SignalType = {}));
8
10
  /** */
9
11
  export function flattenCells(cells) {
@@ -25,15 +27,19 @@ export function destructureCloneId(cloneId) {
25
27
  }
26
28
  return [subs[0], Number(subs[1])];
27
29
  }
30
+ /** */
31
+ export function decomposeCellId(cellId) {
32
+ return [new DnaId(cellId[0]), new AgentId(cellId[1])];
33
+ }
28
34
  const CELL_ID_SEPARATOR = "||";
29
- export function CellIdStr(hash_or_id, key) {
30
- if (Array.isArray(hash_or_id)) {
31
- return "" + encodeHashToBase64(hash_or_id[0]) + CELL_ID_SEPARATOR + encodeHashToBase64(hash_or_id[1]);
35
+ export function CellIdStr(dna_or_cell_id, key) {
36
+ if (Array.isArray(dna_or_cell_id)) {
37
+ return "" + enc64(dna_or_cell_id[0]) + CELL_ID_SEPARATOR + enc64(dna_or_cell_id[1]);
32
38
  }
33
39
  if (!key) {
34
40
  throw Error("CellIdStr() failed. AgentPubKey not provided");
35
41
  }
36
- return "" + encodeHashToBase64(hash_or_id) + CELL_ID_SEPARATOR + encodeHashToBase64(key);
42
+ return "" + dna_or_cell_id.b64 + CELL_ID_SEPARATOR + key.b64;
37
43
  }
38
44
  /** */
39
45
  export function str2CellId(str) {
@@ -41,6 +47,6 @@ export function str2CellId(str) {
41
47
  if (subs.length != 2) {
42
48
  throw Error("str2CellId() failed. Bad input string format");
43
49
  }
44
- return [decodeHashFromBase64(subs[0]), decodeHashFromBase64(subs[1])];
50
+ return [dec64(subs[0]), dec64(subs[1])];
45
51
  }
46
52
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EACpB,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAK3B,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;AACrB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAqDD,MAAM;AACN,MAAM,UAAU,YAAY,CAAC,KAAmB;IAC9C,IAAI,GAAG,GAAa,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1F,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,GAAG,CAAC;AACb,CAAC;AAKD,oDAAoD;AACpD,MAAM,UAAU,eAAe,CAAC,YAA0B,EAAE,UAAsB;IAChF,oDAAoD;IACpD,OAAO,EAAE,GAAG,YAAY,GAAG,GAAG,GAAG,UAAU,CAAC;AAC9C,CAAC;AAED,MAAM;AACN,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;QACpB,qDAAqD;QACrD,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAe,CAAC,CAAC;AAClE,CAAC;AAOD,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAE9B,MAAM,UAAU,SAAS,CAAC,UAA4B,EAAE,GAAiB;IACvE,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC7B,OAAO,EAAE,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;KACvG;IACD,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,KAAK,CAAC,8CAA8C,CAAC,CAAC;KAC7D;IACD,OAAO,EAAE,GAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM;AACN,MAAM,UAAU,UAAU,CAAC,GAAc;IACvC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC1C,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;QACpB,MAAM,KAAK,CAAC,8CAA8C,CAAC,CAAC;KAC7D;IACD,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACvE,CAAC","sourcesContent":["import {\n CellId,\n decodeHashFromBase64,\n encodeHashToBase64,\n RoleName, ClonedCell, ProvisionedCell, ZomeName, FunctionName,\n} from \"@holochain/client\";\nimport {AgentPubKey, DnaHash} from \"@holochain/client/lib/types\";\nimport {Dictionary} from \"./utils\";\nimport {SystemSignalProtocol} from \"./AppProxy\";\n\nexport enum SignalType {\n Unknown = \"Unknown\",\n System = \"System\",\n LitHapp = \"LitHapp\",\n}\n\n\nexport type SignalPayload = unknown | SystemSignal | LitHappSignal;\nexport type SystemSignal = {System: SystemSignalProtocol}\nexport interface LitHappSignal {\n from: AgentPubKey,\n pulses: unknown[],\n}\n\nexport type BaseRoleName = string;\nexport type CloneIndex = number;\n\nexport type ZomeIndex = number;\n\nexport type EntryDef = any; // FIXME\nexport type EntryDefsCallbackResult = {Defs: EntryDef[]}\n\nexport type ScopedZomeTypes = [ZomeIndex, number[]][];\n\nexport type ScopedZomeTypesSet = {\n entries: ScopedZomeTypes, // EntryDefIndex\n links: ScopedZomeTypes, // LinkType\n};\n\nexport type ZomeInfo = {\n name: ZomeName,\n id: ZomeIndex,\n properties: Uint8Array,\n entry_defs: EntryDef[],\n extern_fns: FunctionName[],\n zome_types: ScopedZomeTypesSet,\n}\n\n\nexport type DnaInfo = {\n name: string,\n hash: DnaHash,\n properties: Uint8Array,\n zome_names: ZomeName[],\n}\n\n/** */\nexport type CellsForRole = {\n //baseRoleName: BaseRoleName,\n provisioned: ProvisionedCell,\n /** CloneId -> Cell */\n clones: Dictionary<ClonedCell>,\n}\n\n/** BaseRoleName -> RoleCells */\nexport type RoleCellsMap = Dictionary<CellsForRole>;\n\n/** */\nexport function flattenCells(cells: CellsForRole): CellId[] {\n let res: CellId[] = Object.entries(cells.clones).map(([cloneId, clone]) => clone.cell_id);\n res.push(cells.provisioned.cell_id);\n return res;\n}\n\n\n/** -- CloneId -- */\nexport type CloneId = RoleName;\n/** type for string \"<baseRoleName>.<cloneIndex>\" */\nexport function createCloneName(baseRoleName: BaseRoleName, cloneIndex: CloneIndex): string {\n //if (!cloneIndex) return baseRoleName as CloneName;\n return \"\" + baseRoleName + \".\" + cloneIndex;\n}\n\n/** */\nexport function destructureCloneId(cloneId: CloneId): [BaseRoleName, CloneIndex] | undefined {\n const subs = cloneId.split(\".\");\n if (subs.length != 2) {\n //throw Error(`Bad RoleInstance id format: \"${id}\"`);\n return undefined;\n }\n return [subs[0] as BaseRoleName, Number(subs[1]) as CloneIndex];\n}\n\n\n/** -- CellIdStr -- */\n\nexport type CellIdStr = string;\n\nconst CELL_ID_SEPARATOR = \"||\"\n\nexport function CellIdStr(hash_or_id: DnaHash | CellId, key?: AgentPubKey): CellIdStr {\n if (Array.isArray(hash_or_id)) {\n return \"\" + encodeHashToBase64(hash_or_id[0]) + CELL_ID_SEPARATOR + encodeHashToBase64(hash_or_id[1]);\n }\n if (!key) {\n throw Error(\"CellIdStr() failed. AgentPubKey not provided\");\n }\n return \"\" + encodeHashToBase64(hash_or_id) + CELL_ID_SEPARATOR + encodeHashToBase64(key);\n}\n\n/** */\nexport function str2CellId(str: CellIdStr): CellId {\n const subs = str.split(CELL_ID_SEPARATOR);\n if (subs.length != 2) {\n throw Error(\"str2CellId() failed. Bad input string format\");\n }\n return [decodeHashFromBase64(subs[0]), decodeHashFromBase64(subs[1])]\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,QAAQ,CAAC;AAEpD,0DAA0D;AAG1D,mBAAmB;AAEnB,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IACf,2BAAa,CAAA;AACf,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAgGD,MAAM;AACN,MAAM,UAAU,YAAY,CAAC,KAAmB;IAC9C,IAAI,GAAG,GAAa,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1F,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,W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,GAAc;IACvC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC1C,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;QACpB,MAAM,KAAK,CAAC,8CAA8C,CAAC,CAAC;KAC7D;IACD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACzC,CAAC","sourcesContent":["import {\n CellId,\n RoleName, ClonedCell, ProvisionedCell, ZomeName, FunctionName,\n} from \"@holochain/client\";\nimport {Dictionary} from \"./utils\";\nimport {AgentId, dec64, DnaId, enc64} from \"./hash\";\nimport {SystemSignalProtocol} from \"./zomeSignals.types\";\n//import {AgentPubKey} from \"@holochain/client/lib/types\";\n\n\n/** Signal types */\n\nexport enum SignalType {\n Unknown = \"Unknown\",\n Empty = \"Empty\",\n Zome = \"Zome\",\n}\n\nexport type SystemPulse = {System: SystemSignalProtocol}\n\n//\n// //export type SignalPayload = unknown | LitHappSignal;\n\n// export interface LitHappSignal {\n// from: AgentPubKey,\n// pulses: unknown[],\n// }\n//\n// /** Protocol for notifying the ViewModel (UI) of system level events */\n// export type SystemSignalProtocolVariantPostCommitNewStart = {\n// type: \"PostCommitNewStart\"\n// app_entry_type: string\n// }\n// export type SystemSignalProtocolVariantPostCommitNewEnd = {\n// type: \"PostCommitNewEnd\"\n// app_entry_type: string\n// succeeded: boolean\n// }\n// export type SystemSignalProtocolVariantPostCommitDeleteStart = {\n// type: \"PostCommitDeleteStart\"\n// app_entry_type: string\n// }\n// export type SystemSignalProtocolVariantPostCommitDeleteEnd = {\n// type: \"PostCommitDeleteEnd\"\n// app_entry_type: string\n// succeeded: boolean\n// }\n// export type SystemSignalProtocolVariantSelfCallStart = {\n// type: \"SelfCallStart\"\n// zome_name: string\n// fn_name: string\n// }\n// export type SystemSignalProtocolVariantSelfCallEnd = {\n// type: \"SelfCallEnd\"\n// zome_name: string\n// fn_name: string\n// succeeded: boolean\n// }\n// export type SystemSignalProtocol =\n// | SystemSignalProtocolVariantPostCommitNewStart\n// | SystemSignalProtocolVariantPostCommitNewEnd\n// | SystemSignalProtocolVariantPostCommitDeleteStart\n// | SystemSignalProtocolVariantPostCommitDeleteEnd\n// | SystemSignalProtocolVariantSelfCallStart\n// | SystemSignalProtocolVariantSelfCallEnd;\n//\n\n/** ---- */\n\nexport type BaseRoleName = string;\nexport type CloneIndex = number;\n\nexport type ZomeIndex = number;\n\nexport type EntryDef = any; // FIXME\nexport type EntryDefsCallbackResult = {Defs: EntryDef[]}\n\nexport type ScopedZomeTypes = [ZomeIndex, number[]][];\n\nexport type ScopedZomeTypesSet = {\n entries: ScopedZomeTypes, // EntryDefIndex\n links: ScopedZomeTypes, // LinkType\n};\n\nexport type ZomeInfo = {\n name: ZomeName,\n id: ZomeIndex,\n properties: Uint8Array,\n entry_defs: EntryDef[],\n extern_fns: FunctionName[],\n zome_types: ScopedZomeTypesSet,\n}\n\n\nexport type DnaInfo = {\n name: string,\n id: DnaId,\n properties: Uint8Array,\n zome_names: ZomeName[],\n}\n\n/** */\nexport type CellsForRole = {\n //baseRoleName: BaseRoleName,\n provisioned: ProvisionedCell,\n /** CloneId -> Cell */\n clones: Dictionary<ClonedCell>,\n}\n\n/** BaseRoleName -> RoleCells */\nexport type RoleCellsMap = Dictionary<CellsForRole>;\n\n/** */\nexport function flattenCells(cells: CellsForRole): CellId[] {\n let res: CellId[] = Object.entries(cells.clones).map(([cloneId, clone]) => clone.cell_id);\n res.push(cells.provisioned.cell_id);\n return res;\n}\n\n\n/** -- CloneId -- */\nexport type CloneId = RoleName;\n/** type for string \"<baseRoleName>.<cloneIndex>\" */\nexport function createCloneName(baseRoleName: BaseRoleName, cloneIndex: CloneIndex): string {\n //if (!cloneIndex) return baseRoleName as CloneName;\n return \"\" + baseRoleName + \".\" + cloneIndex;\n}\n\n/** */\nexport function destructureCloneId(cloneId: CloneId): [BaseRoleName, CloneIndex] | undefined {\n const subs = cloneId.split(\".\");\n if (subs.length != 2) {\n //throw Error(`Bad RoleInstance id format: \"${id}\"`);\n return undefined;\n }\n return [subs[0] as BaseRoleName, Number(subs[1]) as CloneIndex];\n}\n\n\n/** */\nexport function decomposeCellId(cellId: CellId): [DnaId, AgentId] {\n return [new DnaId(cellId[0]), new AgentId(cellId[1])]\n}\n\n\n/** -- CellIdStr -- */\n\nexport type CellIdStr = string;\n\nconst CELL_ID_SEPARATOR = \"||\"\n\nexport function CellIdStr(dna_or_cell_id: DnaId | CellId, key?: AgentId): CellIdStr {\n if (Array.isArray(dna_or_cell_id)) {\n return \"\" + enc64(dna_or_cell_id[0]) + CELL_ID_SEPARATOR + enc64(dna_or_cell_id[1]);\n }\n if (!key) {\n throw Error(\"CellIdStr() failed. AgentPubKey not provided\");\n }\n return \"\" + dna_or_cell_id.b64 + CELL_ID_SEPARATOR + key.b64;\n}\n\n/** */\nexport function str2CellId(str: CellIdStr): CellId {\n const subs = str.split(CELL_ID_SEPARATOR);\n if (subs.length != 2) {\n throw Error(\"str2CellId() failed. Bad input string format\");\n }\n return [dec64(subs[0]), dec64(subs[1])]\n}\n"]}
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- import { CellId, AppInfo } from "@holochain/client";
2
- import { BaseRoleName, CellsForRole } from "./types";
3
- import { SignalLog } from "./AppProxy";
1
+ import { CellId } from "@holochain/client";
4
2
  export declare type Dictionary<T> = {
5
3
  [key: string]: T;
6
4
  };
@@ -14,21 +12,5 @@ export declare const delay: (ms: number) => Promise<unknown>;
14
12
  export declare const snake: (str: any) => any;
15
13
  /** convert snake case to pascal case */
16
14
  export declare const pascal: (str: any) => any;
17
- /**
18
- * Checks if obj is a Hash or list of hashes and tries to convert it a B64 or list of B64
19
- */
20
- export declare function anyToB64(obj: any): any;
21
- export declare function prettyDuration(date: Date): string;
22
15
  /** */
23
- export declare function prettyDate(date: Date): string;
24
- export declare function prettySignalLogs(signalLogs: SignalLog[]): {
25
- timestamp: string;
26
- dnaHash: string;
27
- zome: string;
28
- type: import("./types").SignalType;
29
- payload: unknown;
30
- }[];
31
- /** */
32
- export declare function printAppInfo(appInfo: AppInfo): string;
33
- /** */
34
- export declare function printCellsForRole(baseRoleName: BaseRoleName, cells: CellsForRole): string;
16
+ export declare function getVariantByIndex(enumType: any, index: number): string;
package/dist/utils.js CHANGED
@@ -1,7 +1,3 @@
1
- import { encodeHashToBase64 } from "@holochain/client";
2
- import { CellType } from "@holochain/client";
3
- import { intoStem } from "./cell";
4
- import { str2CellId } from "./types";
5
1
  /** */
6
2
  export function areArraysEqual(first, second) {
7
3
  return first.length === second.length && first.every((value, index) => value === second[index]);
@@ -16,83 +12,13 @@ export const delay = (ms) => new Promise(r => setTimeout(r, ms));
16
12
  export const snake = str => str[0].toLowerCase() + str.slice(1, str.length).replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);
17
13
  /** convert snake case to pascal case */
18
14
  export const pascal = str => str[0].toUpperCase() + str.slice(1, str.length).replace(/_([a-z])/g, letter => `${letter[1].toUpperCase()}`);
19
- /**
20
- * Checks if obj is a Hash or list of hashes and tries to convert it a B64 or list of B64
21
- */
22
- export function anyToB64(obj) {
23
- /** Check if it's a hash */
24
- if (obj instanceof Uint8Array) {
25
- return encodeHashToBase64(obj);
26
- }
27
- else {
28
- /** Check if it's an array of hashes */
29
- if (Array.isArray(obj)) {
30
- const isUint8Array = obj.length > 0 &&
31
- obj.every((value) => {
32
- return value instanceof Uint8Array;
33
- });
34
- if (isUint8Array) {
35
- let result = [];
36
- for (const cur of obj) {
37
- result.push(encodeHashToBase64(cur));
38
- }
39
- return result;
40
- }
41
- }
42
- }
43
- return obj;
44
- }
45
- /** -- Pretty print -- */
46
- const zeroPad = (num, places) => String(num).padStart(places, '0');
47
- export function prettyDuration(date) {
48
- return date.getSeconds() + "." + zeroPad(date.getMilliseconds(), 3);
49
- }
50
- /** */
51
- export function prettyDate(date) {
52
- return ""
53
- + zeroPad(date.getHours(), 2)
54
- + ":" + zeroPad(date.getMinutes(), 2)
55
- + ":" + zeroPad(date.getSeconds(), 2)
56
- + "." + zeroPad(date.getMilliseconds(), 3);
57
- }
58
- export function prettySignalLogs(signalLogs) {
59
- return signalLogs.map((log) => {
60
- const dnaHash = encodeHashToBase64(str2CellId(log.cellId)[0]).slice(-8);
61
- return { timestamp: prettyDate(new Date(log.ts)), dnaHash, zome: log.zome_name, type: log.type, payload: log.payload };
62
- });
63
- }
64
- /** */
65
- export function printAppInfo(appInfo) {
66
- let print = `Happ "${appInfo.installed_app_id}" info: (status: ${JSON.stringify(appInfo.status)})`;
67
- for (const [roleName, cellInfos] of Object.entries(appInfo.cell_info)) {
68
- for (const cellInfo of Object.values(cellInfos)) {
69
- if (CellType.Stem in cellInfo) {
70
- const stem = intoStem(cellInfo);
71
- print += `\n - ${roleName}.${stem.name ? stem.name : "unnamed"}: ${encodeHashToBase64(stem.dna)} (stem)`;
72
- continue;
73
- }
74
- if (CellType.Provisioned in cellInfo) {
75
- const cell = cellInfo.provisioned;
76
- print += `\n - ${roleName}: ${cell.name} | ${encodeHashToBase64(cell.cell_id[0])}`;
77
- continue;
78
- }
79
- if (CellType.Cloned in cellInfo) {
80
- const cell = cellInfo.cloned;
81
- print += `\n - ${roleName}.${cell.clone_id}: ${cell.name} | ${encodeHashToBase64(cell.cell_id[0])}`;
82
- continue;
83
- }
84
- }
85
- }
86
- return print;
87
- }
88
15
  /** */
89
- export function printCellsForRole(baseRoleName, cells) {
90
- let print = `CellsForRole "${baseRoleName}": (${encodeHashToBase64(cells.provisioned.cell_id[1])})\n`;
91
- print += ` - Provisioned: ${cells.provisioned.name} | ${encodeHashToBase64(cells.provisioned.cell_id[0])}\n`;
92
- print += ` - Clones : ${Object.values(cells.clones).length}\n`;
93
- for (const [cloneId, clone] of Object.entries(cells.clones)) {
94
- print += ` - (${clone.enabled ? "enabled" : "disabled"})${cloneId}: ${clone.name} | ${encodeHashToBase64(clone.cell_id[0])}\n`;
16
+ export function getVariantByIndex(enumType, index) {
17
+ const keys = Object.keys(enumType);
18
+ if (index >= 0 && index < keys.length) {
19
+ const key = keys[index];
20
+ return enumType[key];
95
21
  }
96
- return print;
22
+ throw Error("Out of bounds index");
97
23
  }
98
24
  //# sourceMappingURL=utils.js.map
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAChC,OAAO,EAA6B,UAAU,EAAC,MAAM,SAAS,CAAC;AAQ/D,MAAM;AACN,MAAM,UAAU,cAAc,CAAC,KAAiB,EAAE,MAAkB;IAClE,OAAO,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AACjG,CAAC;AAED,MAAM;AACN,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,KAAa;IACxD,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACjF,CAAC;AAED,OAAO;AACP,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAExE,wCAAwC;AACxC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC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,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACtG,KAAK,IAAI,oBAAoB,KAAK,CAAC,WAAW,CAAC,IAAI,MAAM,kBAAkB,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9G,KAAK,IAAI,gBAAgB,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,CAAC;IAChE,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QAC3D,KAAK,IAAI,UAAU,KAAK,CAAC,OAAO,CAAA,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAAI,OAAO,KAAK,KAAK,CAAC,IAAI,MAAM,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KAClI;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import {CellId, AppInfo, encodeHashToBase64} from \"@holochain/client\";\nimport {CellType} from \"@holochain/client\";\nimport {intoStem} from \"./cell\";\nimport {BaseRoleName, CellsForRole, str2CellId} from \"./types\";\nimport {SignalLog} from \"./AppProxy\";\n\n\nexport declare type Dictionary<T> = {\n [key: string]: T;\n};\n\n/** */\nexport function areArraysEqual(first: Uint8Array, second: Uint8Array) {\n return first.length === second.length && first.every((value, index) => value === second[index])\n}\n\n/** */\nexport function areCellsEqual(cellA: CellId, cellB: CellId) {\n return areArraysEqual(cellA[0], cellB[0]) && areArraysEqual(cellA[1], cellB[1])\n}\n\n/** */\nexport const delay = (ms: number) => new Promise(r => setTimeout(r, ms))\n\n/** convert Pascal case to snake case */\nexport const snake = str => str[0].toLowerCase() + str.slice(1, str.length).replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);\n\n/** convert snake case to pascal case */\nexport const pascal = str => str[0].toUpperCase() + str.slice(1, str.length).replace(/_([a-z])/g, letter => `${letter[1].toUpperCase()}`);\n\n\n/**\n * Checks if obj is a Hash or list of hashes and tries to convert it a B64 or list of B64\n */\nexport function anyToB64(obj: any): any {\n /** Check if it's a hash */\n if (obj instanceof Uint8Array) {\n return encodeHashToBase64(obj);\n } else {\n /** Check if it's an array of hashes */\n if (Array.isArray(obj)) {\n const isUint8Array =\n obj.length > 0 &&\n obj.every((value) => {\n return value instanceof Uint8Array;\n });\n if (isUint8Array) {\n let result = [];\n for (const cur of obj) {\n result.push(encodeHashToBase64(cur));\n }\n return result;\n }\n }\n }\n return obj;\n}\n\n/** -- Pretty print -- */\n\nconst zeroPad = (num: number, places: number) => String(num).padStart(places, '0')\n\nexport function prettyDuration(date: Date): string {\n return date.getSeconds() + \".\" + zeroPad(date.getMilliseconds(), 3)\n}\n\n/** */\nexport function prettyDate(date: Date): string {\n return \"\"\n + zeroPad(date.getHours(), 2)\n + \":\" + zeroPad(date.getMinutes(), 2)\n + \":\" + zeroPad(date.getSeconds(), 2)\n + \".\" + zeroPad(date.getMilliseconds(), 3);\n}\n\n\nexport function prettySignalLogs(signalLogs: SignalLog[]) {\n return signalLogs.map((log) => {\n const dnaHash = encodeHashToBase64(str2CellId(log.cellId)[0]).slice(-8);\n return {timestamp: prettyDate(new Date(log.ts)), dnaHash, zome: log.zome_name, type: log.type, payload: log.payload};\n })\n}\n\n\n/** */\nexport function printAppInfo(appInfo: AppInfo): string {\n let print = `Happ \"${appInfo.installed_app_id}\" info: (status: ${JSON.stringify(appInfo.status)})`;\n for (const [roleName, cellInfos] of Object.entries(appInfo.cell_info)) {\n for (const cellInfo of Object.values(cellInfos)) {\n if (CellType.Stem in cellInfo) {\n const stem = intoStem(cellInfo)!;\n print += `\\n - ${roleName}.${stem.name? stem.name : \"unnamed\"}: ${encodeHashToBase64(stem.dna)} (stem)`;\n continue;\n }\n if (CellType.Provisioned in cellInfo) {\n const cell = cellInfo.provisioned;\n print += `\\n - ${roleName}: ${cell.name} | ${encodeHashToBase64(cell.cell_id[0])}`;\n continue;\n }\n if (CellType.Cloned in cellInfo) {\n const cell = cellInfo.cloned;\n print += `\\n - ${roleName}.${cell.clone_id}: ${cell.name} | ${encodeHashToBase64(cell.cell_id[0])}`;\n continue;\n }\n }\n }\n return print;\n}\n\n\n/** */\nexport function printCellsForRole(baseRoleName: BaseRoleName, cells: CellsForRole): string {\n let print = `CellsForRole \"${baseRoleName}\": (${encodeHashToBase64(cells.provisioned.cell_id[1])})\\n`;\n print += ` - Provisioned: ${cells.provisioned.name} | ${encodeHashToBase64(cells.provisioned.cell_id[0])}\\n`;\n print += ` - Clones : ${Object.values(cells.clones).length}\\n`;\n for (const [cloneId, clone] of Object.entries(cells.clones)) {\n print += ` - (${clone.enabled? \"enabled\" : \"disabled\"})${cloneId}: ${clone.name} | ${encodeHashToBase64(clone.cell_id[0])}\\n`;\n }\n return print;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAOA,MAAM;AACN,MAAM,UAAU,cAAc,CAAC,KAAiB,EAAE,MAAkB;IAClE,OAAO,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AACjG,CAAC;AAED,MAAM;AACN,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,KAAa;IACxD,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACjF,CAAC;AAED,OAAO;AACP,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAExE,wCAAwC;AACxC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAEpI,wCAAwC;AACxC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAG1I,MAAM;AACN,MAAM,UAAU,iBAAiB,CAAC,QAAa,EAAE,KAAa;IAC5D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;KACtB;IACD,MAAM,KAAK,CAAC,qBAAqB,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import {CellId} from \"@holochain/client\";\n\n\nexport declare type Dictionary<T> = {\n [key: string]: T;\n};\n\n/** */\nexport function areArraysEqual(first: Uint8Array, second: Uint8Array) {\n return first.length === second.length && first.every((value, index) => value === second[index])\n}\n\n/** */\nexport function areCellsEqual(cellA: CellId, cellB: CellId) {\n return areArraysEqual(cellA[0], cellB[0]) && areArraysEqual(cellA[1], cellB[1])\n}\n\n/** */\nexport const delay = (ms: number) => new Promise(r => setTimeout(r, ms))\n\n/** convert Pascal case to snake case */\nexport const snake = str => str[0].toLowerCase() + str.slice(1, str.length).replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);\n\n/** convert snake case to pascal case */\nexport const pascal = str => str[0].toUpperCase() + str.slice(1, str.length).replace(/_([a-z])/g, letter => `${letter[1].toUpperCase()}`);\n\n\n/** */\nexport function getVariantByIndex(enumType: any, index: number): string {\n const keys = Object.keys(enumType);\n if (index >= 0 && index < keys.length) {\n const key = keys[index];\n return enumType[key];\n }\n throw Error(\"Out of bounds index\");\n}\n"]}
@@ -0,0 +1,114 @@
1
+ import { AgentPubKey, EntryHash, ActionHash, Timestamp, AppEntryDef, Link } from '@holochain/client';
2
+ export interface CastTipInput {
3
+ tip: TipProtocol;
4
+ peers: AgentPubKey[];
5
+ }
6
+ /** Bool: True if state change just happened (real-time) */
7
+ export declare enum StateChangeType {
8
+ Create = "Create",
9
+ Update = "Update",
10
+ Delete = "Delete"
11
+ }
12
+ export type StateChangeVariantCreate = {
13
+ Create: boolean;
14
+ };
15
+ export type StateChangeVariantUpdate = {
16
+ Update: boolean;
17
+ };
18
+ export type StateChangeVariantDelete = {
19
+ Delete: boolean;
20
+ };
21
+ export type StateChange = StateChangeVariantCreate | StateChangeVariantUpdate | StateChangeVariantDelete;
22
+ export interface LinkPulse {
23
+ link: Link;
24
+ state: StateChange;
25
+ }
26
+ export interface EntryPulse {
27
+ ah: ActionHash;
28
+ state: StateChange;
29
+ ts: Timestamp;
30
+ author: AgentPubKey;
31
+ eh: EntryHash;
32
+ def: AppEntryDef;
33
+ bytes: Uint8Array;
34
+ }
35
+ /** */
36
+ export interface ZomeSignal {
37
+ from: AgentPubKey;
38
+ pulses: ZomeSignalProtocol[];
39
+ }
40
+ /** */
41
+ export declare enum ZomeSignalProtocolType {
42
+ System = "System",
43
+ Entry = "Entry",
44
+ Link = "Link",
45
+ Tip = "Tip"
46
+ }
47
+ export type ZomeSignalProtocolVariantSystem = {
48
+ System: SystemSignalProtocol;
49
+ };
50
+ export type ZomeSignalProtocolVariantEntry = {
51
+ Entry: EntryPulse;
52
+ };
53
+ export type ZomeSignalProtocolVariantLink = {
54
+ Link: LinkPulse;
55
+ };
56
+ export type ZomeSignalProtocolVariantTip = {
57
+ Tip: TipProtocol;
58
+ };
59
+ export type ZomeSignalProtocol = ZomeSignalProtocolVariantSystem | ZomeSignalProtocolVariantEntry | ZomeSignalProtocolVariantLink | ZomeSignalProtocolVariantTip;
60
+ /** Protocol for notifying the ViewModel (UI) of system level events */
61
+ export type SystemSignalProtocolVariantPostCommitNewStart = {
62
+ type: "PostCommitNewStart";
63
+ app_entry_type: string;
64
+ };
65
+ export type SystemSignalProtocolVariantPostCommitNewEnd = {
66
+ type: "PostCommitNewEnd";
67
+ app_entry_type: string;
68
+ succeeded: boolean;
69
+ };
70
+ export type SystemSignalProtocolVariantPostCommitDeleteStart = {
71
+ type: "PostCommitDeleteStart";
72
+ app_entry_type: string;
73
+ };
74
+ export type SystemSignalProtocolVariantPostCommitDeleteEnd = {
75
+ type: "PostCommitDeleteEnd";
76
+ app_entry_type: string;
77
+ succeeded: boolean;
78
+ };
79
+ export type SystemSignalProtocolVariantSelfCallStart = {
80
+ type: "SelfCallStart";
81
+ zome_name: string;
82
+ fn_name: string;
83
+ };
84
+ export type SystemSignalProtocolVariantSelfCallEnd = {
85
+ type: "SelfCallEnd";
86
+ zome_name: string;
87
+ fn_name: string;
88
+ succeeded: boolean;
89
+ };
90
+ export type SystemSignalProtocol = SystemSignalProtocolVariantPostCommitNewStart | SystemSignalProtocolVariantPostCommitNewEnd | SystemSignalProtocolVariantPostCommitDeleteStart | SystemSignalProtocolVariantPostCommitDeleteEnd | SystemSignalProtocolVariantSelfCallStart | SystemSignalProtocolVariantSelfCallEnd;
91
+ /** Used by UI ONLY. That's why we use B64 here. */
92
+ export declare enum TipProtocolType {
93
+ Ping = "Ping",
94
+ Pong = "Pong",
95
+ Entry = "Entry",
96
+ Link = "Link",
97
+ App = "App"
98
+ }
99
+ export type TipProtocolVariantPing = {
100
+ Ping: AgentPubKey;
101
+ };
102
+ export type TipProtocolVariantPong = {
103
+ Pong: AgentPubKey;
104
+ };
105
+ export type TipProtocolVariantEntry = {
106
+ Entry: EntryPulse;
107
+ };
108
+ export type TipProtocolVariantLink = {
109
+ Link: LinkPulse;
110
+ };
111
+ export type TipProtocolVariantApp = {
112
+ App: Uint8Array;
113
+ };
114
+ export type TipProtocol = TipProtocolVariantPing | TipProtocolVariantPong | TipProtocolVariantEntry | TipProtocolVariantLink | TipProtocolVariantApp;
@@ -0,0 +1,26 @@
1
+ /* This file is generated by zits. Do not edit manually */
2
+ /** Bool: True if state change just happened (real-time) */
3
+ export var StateChangeType;
4
+ (function (StateChangeType) {
5
+ StateChangeType["Create"] = "Create";
6
+ StateChangeType["Update"] = "Update";
7
+ StateChangeType["Delete"] = "Delete";
8
+ })(StateChangeType || (StateChangeType = {}));
9
+ /** */
10
+ export var ZomeSignalProtocolType;
11
+ (function (ZomeSignalProtocolType) {
12
+ ZomeSignalProtocolType["System"] = "System";
13
+ ZomeSignalProtocolType["Entry"] = "Entry";
14
+ ZomeSignalProtocolType["Link"] = "Link";
15
+ ZomeSignalProtocolType["Tip"] = "Tip";
16
+ })(ZomeSignalProtocolType || (ZomeSignalProtocolType = {}));
17
+ /** Used by UI ONLY. That's why we use B64 here. */
18
+ export var TipProtocolType;
19
+ (function (TipProtocolType) {
20
+ TipProtocolType["Ping"] = "Ping";
21
+ TipProtocolType["Pong"] = "Pong";
22
+ TipProtocolType["Entry"] = "Entry";
23
+ TipProtocolType["Link"] = "Link";
24
+ TipProtocolType["App"] = "App";
25
+ })(TipProtocolType || (TipProtocolType = {}));
26
+ //# sourceMappingURL=zomeSignals.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zomeSignals.types.js","sourceRoot":"","sources":["../src/zomeSignals.types.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAwJ1D,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\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-qc/cell-proxy",
3
- "version": "0.24.7",
3
+ "version": "0.25.1",
4
4
  "description": "Proxy classes and helpers for managing a Holochain AppWebsocket",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",