@holochain/client 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ import { AppApi, AppInfoRequest, AppInfoResponse, AppSignalCb, CallZomeRequestGe
5
5
  export declare class AppWebsocket implements AppApi {
6
6
  client: WsClient;
7
7
  defaultTimeout: number;
8
- protected overrideInstalledAppId?: InstalledAppId;
8
+ overrideInstalledAppId?: InstalledAppId;
9
9
  constructor(client: WsClient, defaultTimeout?: number, overrideInstalledAppId?: InstalledAppId);
10
10
  static connect(url: string, defaultTimeout?: number, signalCb?: AppSignalCb): Promise<AppWebsocket>;
11
11
  _requester: <ReqO, ReqI, ResI, ResO>(tag: string, transformer?: Transformer<ReqO, ReqI, ResI, ResO> | undefined) => (req: ReqO, timeout?: number | undefined) => Promise<ResO>;
@@ -39,7 +39,7 @@ export class AppWebsocket {
39
39
  return new AppWebsocket(wsClient, defaultTimeout, env ? env.INSTALLED_APP_ID : undefined);
40
40
  }
41
41
  _requester = (tag, transformer) => requesterTransformer((req, timeout) => promiseTimeout(this.client.request(req), tag, timeout || this.defaultTimeout).then(catchError), tag, transformer);
42
- appInfo = this._requester("app_info", appInfoTransform(this.overrideInstalledAppId));
42
+ appInfo = this._requester("app_info", appInfoTransform(this));
43
43
  callZome = this._requester("zome_call", callZomeTransform);
44
44
  }
45
45
  const callZomeTransform = {
@@ -53,11 +53,11 @@ const callZomeTransform = {
53
53
  return decode(res);
54
54
  },
55
55
  };
56
- const appInfoTransform = (overrideInstalledAppId) => ({
56
+ const appInfoTransform = (appWs) => ({
57
57
  input: (req) => {
58
- if (overrideInstalledAppId) {
58
+ if (appWs.overrideInstalledAppId) {
59
59
  return {
60
- installed_app_id: overrideInstalledAppId,
60
+ installed_app_id: appWs.overrideInstalledAppId,
61
61
  };
62
62
  }
63
63
  return req;
@@ -1 +1 @@
1
- {"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/api/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,CAAC,CACvB,CAAC;IACF,QAAQ,GAGJ,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;CACrD;AAED,MAAM,iBAAiB,GAKnB;IACF,KAAK,EAAE,CACL,GAAgC,EACI,EAAE;QACtC,OAAO;YACL,GAAG,GAAG;YACN,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;SAC7B,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,CACN,GAAwC,EACV,EAAE;QAChC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;CACF,CAAC;AAEF,MAAM,gBAAgB,GAAG,CACvB,KAAmB,EAMnB,EAAE,CAAC,CAAC;IACJ,KAAK,EAAE,CAAC,GAAmB,EAAkB,EAAE;QAC7C,IAAI,KAAK,CAAC,sBAAsB,EAAE;YAChC,OAAO;gBACL,gBAAgB,EAAE,KAAK,CAAC,sBAAsB;aAC/C,CAAC;SACH;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM,EAAE,CAAC,GAAoB,EAAmB,EAAE;QAChD,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { ActionHash, AgentPubKey, EntryHash, Signature, Timestamp } from "../types";
2
+ import { EntryType } from "./entry";
3
+ export interface CounterSigningSessionData {
4
+ preflight_request: PreflightRequest;
5
+ responses: Array<[CountersigningAgentState, Signature]>;
6
+ }
7
+ export interface PreflightRequest {
8
+ app_entry_hash: EntryHash;
9
+ signing_agents: CounterSigningAgents;
10
+ enzyme_index: number | undefined;
11
+ session_times: CounterSigningSessionTimes;
12
+ action_base: ActionBase;
13
+ preflight_bytes: PreflightBytes;
14
+ }
15
+ export interface CounterSigningSessionTimes {
16
+ start: Timestamp;
17
+ end: Timestamp;
18
+ }
19
+ export declare type ActionBase = {
20
+ Create: CreateBase;
21
+ } | {
22
+ Update: UpdateBase;
23
+ };
24
+ export interface CreateBase {
25
+ entry_type: EntryType;
26
+ }
27
+ export interface UpdateBase {
28
+ original_action_address: ActionHash;
29
+ original_entry_address: EntryHash;
30
+ entry_type: EntryType;
31
+ }
32
+ export declare type CounterSigningAgents = Array<[AgentPubKey, Array<Role>]>;
33
+ export declare type PreflightBytes = Uint8Array;
34
+ export declare type Role = number;
35
+ export interface CountersigningAgentState {
36
+ agent_index: number;
37
+ chain_top: ActionHash;
38
+ action_seq: number;
39
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=countersigning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countersigning.js","sourceRoot":"","sources":["../../src/hdk/countersigning.ts"],"names":[],"mappings":""}
@@ -1,5 +1,6 @@
1
1
  import { CapClaim, ZomeCallCapGrant } from "./capabilities.js";
2
2
  import { AgentPubKey } from "../types.js";
3
+ import { CounterSigningSessionData } from "./countersigning.js";
3
4
  export declare type EntryVisibility = "Public" | "Private";
4
5
  export declare type AppEntryType = {
5
6
  id: number;
@@ -13,4 +14,4 @@ export interface EntryContent<E extends string, C> {
13
14
  entry_type: E;
14
15
  entry: C;
15
16
  }
16
- export declare type Entry = EntryContent<"Agent", AgentPubKey> | EntryContent<"App", any> | EntryContent<"CapGrant", ZomeCallCapGrant> | EntryContent<"CapClaim", CapClaim>;
17
+ export declare type Entry = EntryContent<"Agent", AgentPubKey> | EntryContent<"App", Uint8Array> | EntryContent<"CounterSign", [CounterSigningSessionData, Uint8Array]> | EntryContent<"CapGrant", ZomeCallCapGrant> | EntryContent<"CapClaim", CapClaim>;
@@ -1,12 +1,11 @@
1
1
  import { SignedActionHashed } from "./action.js";
2
+ import { Entry } from "./entry.js";
2
3
  export declare type Record = {
3
4
  signed_action: SignedActionHashed;
4
5
  entry: RecordEntry;
5
6
  };
6
7
  export declare type RecordEntry = {
7
- Present: {
8
- entry: Uint8Array;
9
- };
8
+ Present: Entry;
10
9
  } | {
11
10
  Hidden: void;
12
11
  } | {
package/lib/types.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare type KitsuneAgent = Uint8Array;
8
8
  export declare type KitsuneSpace = Uint8Array;
9
9
  export declare type InstalledAppId = string;
10
10
  export declare type Signature = Uint8Array;
11
- export declare type CellId = [HoloHash, AgentPubKey];
11
+ export declare type CellId = [DnaHash, AgentPubKey];
12
12
  export declare type DnaProperties = any;
13
13
  export declare type RoleId = string;
14
14
  export declare type InstalledCell = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holochain/client",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "A JavaScript client for the Holochain Conductor API",
5
5
  "author": "Holochain Foundation <info@holochain.org> (http://holochain.org)",
6
6
  "license": "CAL-1.0",