@ddd-qc/cell-proxy 0.26.10 → 0.27.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/dist/types.js CHANGED
@@ -1,4 +1,5 @@
1
- import { AgentId, dec64, DnaId, enc64 } from "./hash";
1
+ import { HoloHash, } from "@holochain/client";
2
+ import { AgentId, DnaId } from "./hash";
2
3
  /** Signal types */
3
4
  export var SignalType;
4
5
  (function (SignalType) {
@@ -8,8 +9,8 @@ export var SignalType;
8
9
  })(SignalType || (SignalType = {}));
9
10
  /** */
10
11
  export function flattenCells(cells) {
11
- let res = Object.entries(cells.clones).map(([cloneId, clone]) => clone.cell_id);
12
- res.push(cells.provisioned.cell_id);
12
+ let res = Object.entries(cells.clones).map(([cloneId, clone]) => CellAddress.from(clone.cell_id));
13
+ res.push(CellAddress.from(cells.provisioned.cell_id));
13
14
  return res;
14
15
  }
15
16
  /** type for string "<baseRoleName>.<cloneIndex>" */
@@ -26,26 +27,33 @@ export function destructureCloneId(cloneId) {
26
27
  }
27
28
  return [subs[0], Number(subs[1])];
28
29
  }
29
- /** */
30
- export function decomposeCellId(cellId) {
31
- return [new DnaId(cellId[0]), new AgentId(cellId[1])];
32
- }
33
30
  const CELL_ID_SEPARATOR = "||";
34
- export function CellIdStr(dna_or_cell_id, key) {
35
- if (Array.isArray(dna_or_cell_id)) {
36
- return "" + enc64(dna_or_cell_id[0]) + CELL_ID_SEPARATOR + enc64(dna_or_cell_id[1]);
31
+ export class CellAddress {
32
+ constructor(dnaId, agentId) {
33
+ this.dnaId = dnaId;
34
+ this.agentId = agentId;
37
35
  }
38
- if (!key) {
39
- throw Error("CellIdStr() failed. AgentPubKey not provided");
36
+ static from(id_or_str) {
37
+ if (typeof id_or_str == 'string') {
38
+ const subs = id_or_str.split(CELL_ID_SEPARATOR);
39
+ if (subs.length != 2) {
40
+ throw Error("CellAddress.from() failed. Bad input string format");
41
+ }
42
+ return new CellAddress(new DnaId(subs[0]), new AgentId(subs[1]));
43
+ }
44
+ return new CellAddress(new DnaId(id_or_str[0]), new AgentId(id_or_str[1]));
40
45
  }
41
- return "" + dna_or_cell_id.b64 + CELL_ID_SEPARATOR + key.b64;
42
- }
43
- /** */
44
- export function str2CellId(str) {
45
- const subs = str.split(CELL_ID_SEPARATOR);
46
- if (subs.length != 2) {
47
- throw Error("str2CellId() failed. Bad input string format");
46
+ intoId() {
47
+ return [new HoloHash(this.dnaId.hash), new HoloHash(this.agentId.hash)];
48
+ }
49
+ // Don't autoconvert to string as this can lead to confusions. Have convert to string be explicit
50
+ toString() { throw Error("Implicit conversion of HolochainId to string"); }
51
+ get str() {
52
+ return "" + this.dnaId.b64 + CELL_ID_SEPARATOR + this.agentId.b64;
53
+ }
54
+ /** */
55
+ equals(other) {
56
+ return this.str == other.str;
48
57
  }
49
- return [dec64(subs[0]), dec64(subs[1])];
50
58
  }
51
59
  //# 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":"AAKA,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,QAAQ,CAAC;AAIpD,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;AAwDD,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,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G,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\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/** ---- */\n\nexport type BaseRoleName = string;\nexport type CloneIndex = number;\n\nexport type ZomeIndex = number;\n\nexport type EntryDef = {\n id: { App: string } | { CapClaim: null } | { CapGrant: null },\n visibility: \"Public\" | \"Private\",\n requiredValidations: number,\n cacheAtAgentActivity: boolean,\n}\n\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 -- */\n\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"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAE0D,QAAQ,GACx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AL,KAAK,CAAO;QAAkB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IAE9E,MAAM,CAAC,IAAI,CAAC,SAA6B;QACvC,IAAI,OAAO,SAAS,IAAI,QAAQ,EAAE;YAChC,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;YAChD,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;gBACpB,MAAM,KAAK,CAAC,oDAAoD,CAAC,CAAC;aACnE;YACD,OAAO,IAAI,WAAW,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAClE;QACD,OAAO,IAAI,WAAW,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,MAAM;QACJ,OAAO,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IACzE,CAAC;IAED,iGAAiG;IACjG,QAAQ,KAAY,MAAM,KAAK,CAAC,8CAA8C,CAAC,CAAA,CAAA,CAAC;IAGhF,IAAI,GAAG;QACL,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;IACpE,CAAC;IAED,MAAM;IACN,MAAM,CAAC,KAAkB;QACvB,OAAO,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC;IAC/B,CAAC;CACF","sourcesContent":["import {\n CellId,\n RoleName, ClonedCell, ProvisionedCell, ZomeName, FunctionName, HoloHash,\n} from \"@holochain/client\";\nimport {Dictionary} from \"./utils\";\nimport {AgentId, DnaId} from \"./hash\";\nimport {SystemSignalProtocol} from \"./zomeSignals.types\";\n\n\nexport type AnyCell = ProvisionedCell | ClonedCell;\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/** ---- */\n\nexport type BaseRoleName = string;\nexport type CloneIndex = number;\n\nexport type ZomeIndex = number;\n\nexport type EntryDef = {\n id: { App: string } | { CapClaim: null } | { CapGrant: null },\n visibility: \"Public\" | \"Private\",\n requiredValidations: number,\n cacheAtAgentActivity: boolean,\n}\n\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): CellAddress[] {\n let res: CellAddress[] = Object.entries(cells.clones).map(([cloneId, clone]) => CellAddress.from(clone.cell_id));\n res.push(CellAddress.from(cells.provisioned.cell_id));\n return res;\n}\n\n\n/** -- CloneId -- */\n\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/** -- CellAddress -- */\n\nexport type CellIdStr = string;\n\nconst CELL_ID_SEPARATOR = \"||\"\n\n\nexport class CellAddress {\n constructor(public readonly dnaId: DnaId, public readonly agentId: AgentId) {}\n\n static from(id_or_str: CellId | CellIdStr): CellAddress {\n if (typeof id_or_str == 'string') {\n const subs = id_or_str.split(CELL_ID_SEPARATOR);\n if (subs.length != 2) {\n throw Error(\"CellAddress.from() failed. Bad input string format\");\n }\n return new CellAddress(new DnaId(subs[0]), new AgentId(subs[1]));\n }\n return new CellAddress(new DnaId(id_or_str[0]), new AgentId(id_or_str[1]));\n }\n\n intoId(): CellId {\n return [new HoloHash(this.dnaId.hash), new HoloHash(this.agentId.hash)]\n }\n\n // Don't autoconvert to string as this can lead to confusions. Have convert to string be explicit\n toString(): string {throw Error(\"Implicit conversion of HolochainId to string\")}\n\n\n get str(): CellIdStr {\n return \"\" + this.dnaId.b64 + CELL_ID_SEPARATOR + this.agentId.b64;\n }\n\n /** */\n equals(other: CellAddress): boolean {\n return this.str == other.str;\n }\n}\n\n\n"]}
package/dist/utils.d.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { CellId } from "@holochain/client";
2
1
  export declare type Dictionary<T> = {
3
2
  [key: string]: T;
4
3
  };
5
4
  /** */
6
- export declare function areArraysEqual(first: Uint8Array, second: Uint8Array): boolean;
5
+ export declare function assertIsDefined<T>(value: T | undefined): asserts value is T;
6
+ /** */
7
+ export declare function assertAllDefined(...args: any[]): void;
7
8
  /** */
8
- export declare function areCellsEqual(cellA: CellId, cellB: CellId): boolean;
9
+ export declare function areArraysEqual(first: Uint8Array, second: Uint8Array): boolean;
9
10
  /** */
10
11
  export declare const delay: (ms: number) => Promise<unknown>;
11
12
  /** convert Pascal case to snake case */
package/dist/utils.js CHANGED
@@ -1,10 +1,20 @@
1
1
  /** */
2
- export function areArraysEqual(first, second) {
3
- return first.length === second.length && first.every((value, index) => value === second[index]);
2
+ export function assertIsDefined(value) {
3
+ if (value === undefined) {
4
+ throw new Error('Value is undefined');
5
+ }
4
6
  }
5
7
  /** */
6
- export function areCellsEqual(cellA, cellB) {
7
- return areArraysEqual(cellA[0], cellB[0]) && areArraysEqual(cellA[1], cellB[1]);
8
+ export function assertAllDefined(...args) {
9
+ for (const arg of args) {
10
+ if (arg === undefined) {
11
+ throw new Error('One or more arguments are undefined');
12
+ }
13
+ }
14
+ }
15
+ /** */
16
+ export function areArraysEqual(first, second) {
17
+ return first.length === second.length && first.every((value, index) => value === second[index]);
8
18
  }
9
19
  /** */
10
20
  export const delay = (ms) => new Promise(r => setTimeout(r, ms));
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
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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Aa;IAC1E,IAAI,QAAQ,GAAG,QAAoB,CAAC;IACpC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC5B,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,qCAAqC;KAC1G;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;YACzB,OAAO,CAAC,CAAC;SACV;KACF;IACD,MAAM,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACjC,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/** enumType = enum or Object.values(enum) */\nexport function getVariantByIndex(enumType: Object | string[], index: number): string {\n let keys = enumType as string[];\n if (!Array.isArray(enumType)) {\n keys = Object.keys(enumType);\n }\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\n\n/** enumType = enum or Object.values(enum) */\nexport function getIndexByVariant(enumType: Object | string[], value: string): number {\n let variants = enumType as string[];\n if (!Array.isArray(enumType)) {\n variants = Object.keys(enumType).filter(key => isNaN(Number(key))); // Filter out numeric keys if present\n }\n for (let i = 0; i < variants.length; i++) {\n if (variants[i] === value) {\n return i;\n }\n }\n throw Error(\"Unknown variant\");\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAOA,MAAM;AACN,MAAM,UAAU,eAAe,CAAI,KAAoB;IACrD,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;KACvC;AACH,CAAC;AAGD,MAAM;AACN,MAAM,UAAU,gBAAgB,CAAC,GAAG,IAAW;IAC7C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,GAAG,KAAK,SAAS,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;SACxD;KACF;AACH,CAAC;AAGD,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;AAGD,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,G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qC;KAC1G;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;YACzB,OAAO,CAAC,CAAC;SACV;KACF;IACD,MAAM,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACjC,CAAC","sourcesContent":["\n\nexport declare type Dictionary<T> = {\n [key: string]: T;\n};\n\n\n/** */\nexport function assertIsDefined<T>(value: T | undefined): asserts value is T {\n if (value === undefined) {\n throw new Error('Value is undefined');\n }\n}\n\n\n/** */\nexport function assertAllDefined(...args: any[]): void {\n for (const arg of args) {\n if (arg === undefined) {\n throw new Error('One or more arguments are undefined');\n }\n }\n}\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\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/** enumType = enum or Object.values(enum) */\nexport function getVariantByIndex(enumType: Object | string[], index: number): string {\n let keys = enumType as string[];\n if (!Array.isArray(enumType)) {\n keys = Object.keys(enumType);\n }\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\n\n/** enumType = enum or Object.values(enum) */\nexport function getIndexByVariant(enumType: Object | string[], value: string): number {\n let variants = enumType as string[];\n if (!Array.isArray(enumType)) {\n variants = Object.keys(enumType).filter(key => isNaN(Number(key))); // Filter out numeric keys if present\n }\n for (let i = 0; i < variants.length; i++) {\n if (variants[i] === value) {\n return i;\n }\n }\n throw Error(\"Unknown variant\");\n}\n"]}
@@ -1,7 +1,10 @@
1
- import { AgentPubKey, EntryHash, ActionHash, Timestamp, AppEntryDef, Link } from '@holochain/client';
1
+ import { Timestamp, AppEntryDef, Link } from '@holochain/client';
2
+ type AgentArray = Uint8Array;
3
+ type EntryArray = Uint8Array;
4
+ type ActionArray = Uint8Array;
2
5
  export interface CastTipInput {
3
6
  tip: TipProtocol;
4
- peers: AgentPubKey[];
7
+ peers: AgentArray[];
5
8
  }
6
9
  /** Bool: True if state change just happened (real-time) */
7
10
  export declare enum StateChangeType {
@@ -24,17 +27,17 @@ export interface LinkPulse {
24
27
  state: StateChange;
25
28
  }
26
29
  export interface EntryPulse {
27
- ah: ActionHash;
30
+ ah: ActionArray;
28
31
  state: StateChange;
29
32
  ts: Timestamp;
30
- author: AgentPubKey;
31
- eh: EntryHash;
33
+ author: AgentArray;
34
+ eh: EntryArray;
32
35
  def: AppEntryDef;
33
36
  bytes: Uint8Array;
34
37
  }
35
38
  /** */
36
39
  export interface ZomeSignal {
37
- from: AgentPubKey;
40
+ from: AgentArray;
38
41
  pulses: ZomeSignalProtocol[];
39
42
  }
40
43
  /** */
@@ -97,10 +100,10 @@ export declare enum TipProtocolType {
97
100
  App = "App"
98
101
  }
99
102
  export type TipProtocolVariantPing = {
100
- Ping: AgentPubKey;
103
+ Ping: AgentArray;
101
104
  };
102
105
  export type TipProtocolVariantPong = {
103
- Pong: AgentPubKey;
106
+ Pong: AgentArray;
104
107
  };
105
108
  export type TipProtocolVariantEntry = {
106
109
  Entry: EntryPulse;
@@ -112,3 +115,4 @@ export type TipProtocolVariantApp = {
112
115
  App: Uint8Array;
113
116
  };
114
117
  export type TipProtocol = TipProtocolVariantPing | TipProtocolVariantPong | TipProtocolVariantEntry | TipProtocolVariantLink | TipProtocolVariantApp;
118
+ export {};
@@ -1 +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"]}
1
+ {"version":3,"file":"zomeSignals.types.js","sourceRoot":"","sources":["../src/zomeSignals.types.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAiK1D,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 */\n//HoloHash,\n//AgentPubKey,\n//DnaHash,\n//WasmHash,\n//EntryHash,\n//ActionHash,\n//AnyDhtHash,\n//ExternalHash,\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\n\n/// Simple Hashes\ntype AgentArray = Uint8Array;\ntype DnaArray = Uint8Array;\ntype WasmArray = Uint8Array;\ntype EntryArray = Uint8Array;\ntype ActionArray = Uint8Array;\ntype AnyDhtArray = Uint8Array;\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: AgentArray[]\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: ActionArray\n state: StateChange\n ts: Timestamp\n author: AgentArray\n eh: EntryArray\n def: AppEntryDef\n bytes: Uint8Array\n}\n\n/** */\nexport interface ZomeSignal {\n from: AgentArray\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: AgentArray}\nexport type TipProtocolVariantPong = {Pong: AgentArray}\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.26.10",
3
+ "version": "0.27.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",
@@ -28,7 +28,10 @@
28
28
  "typescript": "~5.2.0"
29
29
  },
30
30
  "dependencies": {
31
- "@holochain/client": "^0.18.0-dev.4",
31
+ "@holochain/client": "^0.18.0-dev.9",
32
+ "@bitgo/blake2b": "^3.2.4",
33
+ "js-base64": "^3.7.5",
34
+ "@msgpack/msgpack": "^2.7.2",
32
35
  "async-mutex": "0.4.0"
33
36
  }
34
37
  }