@holochain/client 0.3.2 → 0.4.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.
Files changed (130) hide show
  1. package/README.md +9 -9
  2. package/lib/api/admin/index.d.ts +2 -0
  3. package/lib/api/admin/index.js +3 -0
  4. package/lib/api/admin/index.js.map +1 -0
  5. package/{lib.es/api/admin.d.ts → lib/api/admin/types.d.ts} +71 -4
  6. package/{lib.es/api/admin.js → lib/api/admin/types.js} +1 -1
  7. package/lib/api/admin/types.js.map +1 -0
  8. package/lib/{websocket/admin.d.ts → api/admin/websocket.d.ts} +3 -3
  9. package/lib/api/admin/websocket.js +107 -0
  10. package/lib/api/admin/websocket.js.map +1 -0
  11. package/lib/api/app/index.d.ts +2 -0
  12. package/lib/api/app/index.js +3 -0
  13. package/lib/api/app/index.js.map +1 -0
  14. package/lib/api/{app.d.ts → app/types.d.ts} +4 -4
  15. package/lib/api/app/types.js +2 -0
  16. package/lib/api/app/types.js.map +1 -0
  17. package/{lib.es/websocket/app.d.ts → lib/api/app/websocket.d.ts} +6 -5
  18. package/{lib.es/websocket/app.js → lib/api/app/websocket.js} +14 -11
  19. package/lib/api/app/websocket.js.map +1 -0
  20. package/lib/{websocket → api}/client.d.ts +2 -2
  21. package/{lib.es/websocket → lib/api}/client.js +12 -8
  22. package/lib/api/client.js.map +1 -0
  23. package/lib/api/common.d.ts +9 -6
  24. package/lib/api/common.js +26 -6
  25. package/lib/api/common.js.map +1 -1
  26. package/lib/api/index.d.ts +2 -0
  27. package/lib/api/index.js +3 -0
  28. package/lib/api/index.js.map +1 -0
  29. package/lib/bundle.d.ts +6 -0
  30. package/lib/bundle.js +32 -0
  31. package/lib/bundle.js.map +1 -0
  32. package/lib/environments/launcher.d.ts +1 -1
  33. package/lib/environments/launcher.js +7 -12
  34. package/lib/environments/launcher.js.map +1 -1
  35. package/{lib.es/types → lib/hdk}/capabilities.d.ts +1 -1
  36. package/{lib.es/types → lib/hdk}/capabilities.js +0 -0
  37. package/{lib.es/types → lib/hdk}/capabilities.js.map +1 -1
  38. package/lib/{types → hdk}/dht-ops.d.ts +3 -3
  39. package/{lib.es/types → lib/hdk}/dht-ops.js +0 -0
  40. package/lib/hdk/dht-ops.js.map +1 -0
  41. package/lib/{types → hdk}/entry.d.ts +2 -2
  42. package/{lib.es/types → lib/hdk}/entry.js +0 -0
  43. package/{lib.es/types → lib/hdk}/entry.js.map +1 -1
  44. package/{lib.es/types → lib/hdk}/header.d.ts +2 -3
  45. package/{lib.es/types → lib/hdk}/header.js +0 -0
  46. package/lib/hdk/header.js.map +1 -0
  47. package/lib/hdk/index.d.ts +4 -0
  48. package/lib/hdk/index.js +5 -0
  49. package/lib/hdk/index.js.map +1 -0
  50. package/lib/index.d.ts +4 -6
  51. package/lib/index.js +4 -18
  52. package/lib/index.js.map +1 -1
  53. package/{lib.es/types/common.d.ts → lib/types.d.ts} +0 -0
  54. package/lib/types.js +2 -0
  55. package/lib/types.js.map +1 -0
  56. package/package.json +29 -24
  57. package/lib/api/admin.d.ts +0 -224
  58. package/lib/api/admin.js +0 -12
  59. package/lib/api/admin.js.map +0 -1
  60. package/lib/api/app.js +0 -3
  61. package/lib/api/app.js.map +0 -1
  62. package/lib/api/state-dump.d.ts +0 -36
  63. package/lib/api/state-dump.js +0 -3
  64. package/lib/api/state-dump.js.map +0 -1
  65. package/lib/api/types.d.ts +0 -39
  66. package/lib/api/types.js +0 -8
  67. package/lib/api/types.js.map +0 -1
  68. package/lib/types/capabilities.d.ts +0 -30
  69. package/lib/types/capabilities.js +0 -3
  70. package/lib/types/capabilities.js.map +0 -1
  71. package/lib/types/common.d.ts +0 -22
  72. package/lib/types/common.js +0 -3
  73. package/lib/types/common.js.map +0 -1
  74. package/lib/types/dht-ops.js +0 -42
  75. package/lib/types/dht-ops.js.map +0 -1
  76. package/lib/types/entry.js +0 -3
  77. package/lib/types/entry.js.map +0 -1
  78. package/lib/types/header.d.ts +0 -108
  79. package/lib/types/header.js +0 -17
  80. package/lib/types/header.js.map +0 -1
  81. package/lib/types/index.d.ts +0 -5
  82. package/lib/types/index.js +0 -18
  83. package/lib/types/index.js.map +0 -1
  84. package/lib/websocket/admin.js +0 -127
  85. package/lib/websocket/admin.js.map +0 -1
  86. package/lib/websocket/app.d.ts +0 -13
  87. package/lib/websocket/app.js +0 -70
  88. package/lib/websocket/app.js.map +0 -1
  89. package/lib/websocket/client.js +0 -129
  90. package/lib/websocket/client.js.map +0 -1
  91. package/lib/websocket/common.d.ts +0 -3
  92. package/lib/websocket/common.js +0 -34
  93. package/lib/websocket/common.js.map +0 -1
  94. package/lib.es/api/admin.js.map +0 -1
  95. package/lib.es/api/app.d.ts +0 -32
  96. package/lib.es/api/app.js +0 -2
  97. package/lib.es/api/app.js.map +0 -1
  98. package/lib.es/api/common.d.ts +0 -16
  99. package/lib.es/api/common.js +0 -17
  100. package/lib.es/api/common.js.map +0 -1
  101. package/lib.es/api/state-dump.d.ts +0 -36
  102. package/lib.es/api/state-dump.js +0 -2
  103. package/lib.es/api/state-dump.js.map +0 -1
  104. package/lib.es/api/types.d.ts +0 -39
  105. package/lib.es/api/types.js +0 -4
  106. package/lib.es/api/types.js.map +0 -1
  107. package/lib.es/environments/launcher.d.ts +0 -8
  108. package/lib.es/environments/launcher.js +0 -35
  109. package/lib.es/environments/launcher.js.map +0 -1
  110. package/lib.es/index.d.ts +0 -6
  111. package/lib.es/index.js +0 -7
  112. package/lib.es/index.js.map +0 -1
  113. package/lib.es/types/common.js +0 -2
  114. package/lib.es/types/common.js.map +0 -1
  115. package/lib.es/types/dht-ops.d.ts +0 -45
  116. package/lib.es/types/dht-ops.js.map +0 -1
  117. package/lib.es/types/entry.d.ts +0 -16
  118. package/lib.es/types/header.js.map +0 -1
  119. package/lib.es/types/index.d.ts +0 -5
  120. package/lib.es/types/index.js +0 -6
  121. package/lib.es/types/index.js.map +0 -1
  122. package/lib.es/websocket/admin.d.ts +0 -47
  123. package/lib.es/websocket/admin.js +0 -104
  124. package/lib.es/websocket/admin.js.map +0 -1
  125. package/lib.es/websocket/app.js.map +0 -1
  126. package/lib.es/websocket/client.d.ts +0 -25
  127. package/lib.es/websocket/client.js.map +0 -1
  128. package/lib.es/websocket/common.d.ts +0 -3
  129. package/lib.es/websocket/common.js +0 -29
  130. package/lib.es/websocket/common.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { InstalledAppId } from "../types/common";
1
+ import { InstalledAppId } from "../types.js";
2
2
  export declare const LAUNCHER_ENV_URL = "/.launcher-env.json";
3
3
  export interface LauncherEnvironment {
4
4
  APP_INTERFACE_PORT: number;
@@ -1,14 +1,8 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getLauncherEnvironment = exports.LAUNCHER_ENV_URL = void 0;
7
- const cross_fetch_1 = __importDefault(require("cross-fetch"));
1
+ import fetch from "cross-fetch";
8
2
  // This is coupled with https://github.com/holochain/launcher/blob/develop/src-tauri/src/uis/caddy.rs#L13
9
- exports.LAUNCHER_ENV_URL = "/.launcher-env.json";
3
+ export const LAUNCHER_ENV_URL = "/.launcher-env.json";
10
4
  async function fetchLauncherEnvironment() {
11
- const env = await (0, cross_fetch_1.default)(exports.LAUNCHER_ENV_URL);
5
+ const env = await fetch(LAUNCHER_ENV_URL);
12
6
  if (env.ok) {
13
7
  const launcherEnvironment = await env.json();
14
8
  return launcherEnvironment;
@@ -25,12 +19,14 @@ async function fetchLauncherEnvironment() {
25
19
  }
26
20
  }
27
21
  const isBrowser = typeof window !== "undefined";
28
- const isJest = typeof process !== "undefined" && process.env && process.env.JEST_WORKER_ID !== undefined;
22
+ const isJest = typeof process !== "undefined" &&
23
+ process.env &&
24
+ process.env.JEST_WORKER_ID !== undefined;
29
25
  let promise;
30
26
  if (isBrowser && !isJest) {
31
27
  promise = fetchLauncherEnvironment().catch(console.error);
32
28
  }
33
- async function getLauncherEnvironment() {
29
+ export async function getLauncherEnvironment() {
34
30
  if (isBrowser) {
35
31
  return promise;
36
32
  }
@@ -38,5 +34,4 @@ async function getLauncherEnvironment() {
38
34
  return undefined;
39
35
  }
40
36
  }
41
- exports.getLauncherEnvironment = getLauncherEnvironment;
42
37
  //# sourceMappingURL=launcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../src/environments/launcher.ts"],"names":[],"mappings":";;;;;;AACA,8DAA+B;AAE/B,yGAAyG;AAC5F,QAAA,gBAAgB,GAAG,qBAAqB,CAAA;AAQrD,KAAK,UAAU,wBAAwB;IAGrC,MAAM,GAAG,GAAG,MAAM,IAAA,qBAAK,EAAC,wBAAgB,CAAC,CAAA;IAEzC,IAAI,GAAG,CAAC,EAAE,EAAE;QACV,MAAM,mBAAmB,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;QAC5C,OAAO,mBAAmB,CAAA;KAC3B;SAAM;QACL,yCAAyC;QACzC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;YACtB,OAAO,CAAC,IAAI,CACV,uSAAuS,CACxS,CAAA;YACD,OAAO,SAAS,CAAA;SACjB;aAAM;YACL,MAAM,IAAI,KAAK,CACb,mDAAmD,GAAG,CAAC,UAAU,EAAE,CACpE,CAAA;SACF;KACF;AACH,CAAC;AAED,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,CAAA;AAC/C,MAAM,MAAM,GACV,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS,CAAA;AAE3F,IAAI,OAAqB,CAAA;AAEzB,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE;IACxB,OAAO,GAAG,wBAAwB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;CAC1D;AAEM,KAAK,UAAU,sBAAsB;IAG1C,IAAI,SAAS,EAAE;QACb,OAAO,OAAO,CAAA;KACf;SAAM;QACL,OAAO,SAAS,CAAA;KACjB;AACH,CAAC;AARD,wDAQC"}
1
+ {"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../src/environments/launcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,yGAAyG;AACzG,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAQtD,KAAK,UAAU,wBAAwB;IAGrC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAE1C,IAAI,GAAG,CAAC,EAAE,EAAE;QACV,MAAM,mBAAmB,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC7C,OAAO,mBAAmB,CAAC;KAC5B;SAAM;QACL,yCAAyC;QACzC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;YACtB,OAAO,CAAC,IAAI,CACV,uSAAuS,CACxS,CAAC;YACF,OAAO,SAAS,CAAC;SAClB;aAAM;YACL,MAAM,IAAI,KAAK,CACb,mDAAmD,GAAG,CAAC,UAAU,EAAE,CACpE,CAAC;SACH;KACF;AACH,CAAC;AAED,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;AAChD,MAAM,MAAM,GACV,OAAO,OAAO,KAAK,WAAW;IAC9B,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC;AAE3C,IAAI,OAAqB,CAAC;AAE1B,IAAI,SAAS,IAAI,CAAC,MAAM,EAAE;IACxB,OAAO,GAAG,wBAAwB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;CAC3D;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAG1C,IAAI,SAAS,EAAE;QACb,OAAO,OAAO,CAAC;KAChB;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { AgentPubKey } from "./common";
1
+ import { AgentPubKey } from "../types.js";
2
2
  export declare type CapSecret = Uint8Array;
3
3
  export interface CapClaim {
4
4
  tag: string;
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/types/capabilities.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/hdk/capabilities.ts"],"names":[],"mappings":""}
@@ -1,6 +1,6 @@
1
- import { CreateLink, Delete, DeleteLink, Header, NewEntryHeader, Update } from "./header";
2
- import { Entry } from "./entry";
3
- import { Signature } from "./common";
1
+ import { Signature } from "../types.js";
2
+ import { Entry } from "./entry.js";
3
+ import { CreateLink, Delete, DeleteLink, Header, NewEntryHeader, Update } from "./header.js";
4
4
  export declare enum DhtOpType {
5
5
  StoreElement = "StoreElement",
6
6
  StoreEntry = "StoreEntry",
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dht-ops.js","sourceRoot":"","sources":["../../src/hdk/dht-ops.ts"],"names":[],"mappings":"AAWA,iFAAiF;AAEjF,MAAM,CAAN,IAAY,SAUX;AAVD,WAAY,SAAS;IACnB,0CAA6B,CAAA;IAC7B,sCAAyB,CAAA;IACzB,4DAA+C,CAAA;IAC/C,8DAAiD,CAAA;IACjD,8DAAiD,CAAA;IACjD,oDAAuC,CAAA;IACvC,sEAAyD,CAAA;IACzD,gDAAmC,CAAA;IACnC,sDAAyC,CAAA;AAC3C,CAAC,EAVW,SAAS,KAAT,SAAS,QAUpB;AAyBD,MAAM,UAAU,YAAY,CAAC,EAAS;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAc,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAS;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvC,IAAI,MAAM,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;SAC5B;QACH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,GAAG,MAAM,CAAC,UAAU,CAAC;SACtB,CAAC;KACH;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAS;IACrC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,EAAS;IACzC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC"}
@@ -1,5 +1,5 @@
1
- import { CapClaim, ZomeCallCapGrant } from "./capabilities";
2
- import { AgentPubKey } from "./common";
1
+ import { CapClaim, ZomeCallCapGrant } from "./capabilities.js";
2
+ import { AgentPubKey } from "../types.js";
3
3
  export declare type EntryVisibility = "Public" | "Private";
4
4
  export declare type AppEntryType = {
5
5
  id: number;
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/types/entry.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/hdk/entry.ts"],"names":[],"mappings":""}
@@ -1,6 +1,5 @@
1
- import { AgentPubKey, DnaHash, EntryHash, HeaderHash, Signature } from "./common";
2
- import { EntryType } from "./entry";
3
- import { HoloHashed, Timestamp } from "./common";
1
+ import { AgentPubKey, DnaHash, EntryHash, HeaderHash, HoloHashed, Signature, Timestamp } from "../types.js";
2
+ import { EntryType } from "./entry.js";
4
3
  export interface SignedHeaderHashed<H extends Header = Header> {
5
4
  header: HoloHashed<H>;
6
5
  signature: Signature;
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/hdk/header.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAN,IAAY,UAWX;AAXD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,uDAAyC,CAAA;IACzC,qDAAuC,CAAA;IACvC,uCAAyB,CAAA;IACzB,uCAAyB,CAAA;IACzB,qCAAuB,CAAA;IACvB,uCAAyB,CAAA;IACzB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACnB,CAAC,EAXW,UAAU,KAAV,UAAU,QAWrB"}
@@ -0,0 +1,4 @@
1
+ export * from "./capabilities.js";
2
+ export * from "./dht-ops.js";
3
+ export * from "./entry.js";
4
+ export * from "./header.js";
@@ -0,0 +1,5 @@
1
+ export * from "./capabilities.js";
2
+ export * from "./dht-ops.js";
3
+ export * from "./entry.js";
4
+ export * from "./header.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hdk/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- export * from './api/admin';
2
- export * from './api/app';
3
- export * from './api/types';
4
- export * from './websocket/admin';
5
- export * from './websocket/app';
6
- export * from './types';
1
+ export * from "./api/index.js";
2
+ export * from "./hdk/index.js";
3
+ export * from "./bundle.js";
4
+ export * from "./types.js";
package/lib/index.js CHANGED
@@ -1,19 +1,5 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./api/admin"), exports);
14
- __exportStar(require("./api/app"), exports);
15
- __exportStar(require("./api/types"), exports);
16
- __exportStar(require("./websocket/admin"), exports);
17
- __exportStar(require("./websocket/app"), exports);
18
- __exportStar(require("./types"), exports);
1
+ export * from "./api/index.js";
2
+ export * from "./hdk/index.js";
3
+ export * from "./bundle.js";
4
+ export * from "./types.js";
19
5
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA2B;AAC3B,4CAAyB;AACzB,8CAA2B;AAC3B,oDAAiC;AACjC,kDAA+B;AAC/B,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
File without changes
package/lib/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@holochain/client",
3
- "version": "0.3.2",
4
- "description": "A Nodejs client for the Holochain conductor API",
3
+ "version": "0.4.1",
4
+ "description": "A JavaScript client for the Holochain Conductor API",
5
5
  "author": "Holochain Foundation <info@holochain.org> (http://holochain.org)",
6
- "license": "CAL 1.0",
6
+ "license": "CAL-1.0",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/holochain/holochain-client-js.git"
@@ -17,36 +17,41 @@
17
17
  "url": "https://github.com/holochain/holochain-client-js/issues"
18
18
  },
19
19
  "homepage": "https://github.com/holochain/holochain-client-js#readme",
20
-
20
+ "engines": {
21
+ "node": "^14.13.1 || >=16.0.0 || >=18.0.0"
22
+ },
23
+ "type": "module",
24
+ "exports": {
25
+ ".": "./lib/index.js"
26
+ },
27
+ "types": "lib/index.d.ts",
21
28
  "files": [
22
- "lib",
23
- "lib.es"
29
+ "lib"
24
30
  ],
25
- "main": "lib/index.js",
26
- "module": "lib.es/index.js",
27
- "types": "lib/index.d.ts",
28
-
29
31
  "scripts": {
30
- "lint": "eslint src/**/*.ts test/**/*.ts --fix",
31
- "test": "RUST_LOG=error RUST_BACKTRACE=1 ts-node test",
32
- "build": "rimraf ./lib ./lib.es .tsbuildinfo && tsc -b"
32
+ "lint": "eslint --fix --ext .ts src test .eslintrc.cjs",
33
+ "test": "RUST_LOG=error RUST_BACKTRACE=1 node --loader ts-node/esm test/index.ts",
34
+ "build": "rimraf ./lib && tsc -p tsconfig.build.json"
33
35
  },
34
-
35
36
  "dependencies": {
36
- "@msgpack/msgpack": "^2.7.1",
37
- "cross-fetch": "^3.1.4",
38
- "isomorphic-ws": "^4.0.1"
37
+ "@msgpack/msgpack": "^2.7.2",
38
+ "cross-fetch": "^3.1.5",
39
+ "eslint-config-prettier": "^8.5.0",
40
+ "eslint-plugin-prettier": "^4.0.0",
41
+ "eslint-plugin-tsdoc": "^0.2.16",
42
+ "isomorphic-ws": "^4.0.1",
43
+ "prettier": "^2.6.2"
39
44
  },
40
45
  "devDependencies": {
41
46
  "@types/js-yaml": "^3.12.7",
42
47
  "@types/tape": "^4.13.2",
43
- "@typescript-eslint/eslint-plugin": "^5.9.0",
44
- "@typescript-eslint/parser": "^5.9.0",
45
- "eslint": "^8.6.0",
48
+ "@typescript-eslint/eslint-plugin": "^5.27.0",
49
+ "@typescript-eslint/parser": "^5.27.0",
50
+ "eslint": "^8.16.0",
46
51
  "js-yaml": "^3.14.1",
47
52
  "rimraf": "^3.0.2",
48
- "tape": "^5.4.0",
49
- "ts-node": "^10.4.0",
50
- "typescript": "^4.5.4"
53
+ "tape": "^5.5.3",
54
+ "ts-node": "^10.8.1",
55
+ "typescript": "^4.7.2"
51
56
  }
52
- }
57
+ }
@@ -1,224 +0,0 @@
1
- /// <reference types="node" />
2
- import { Requester } from "./common";
3
- import { HoloHash, AgentPubKey, DnaProperties, InstalledAppId, CellId, RoleId } from "../types/common";
4
- import { InstalledAppInfo, MembraneProof } from "./types";
5
- import { FullStateDump } from "./state-dump";
6
- export declare type AttachAppInterfaceRequest = {
7
- port: number;
8
- };
9
- export declare type AttachAppInterfaceResponse = {
10
- port: number;
11
- };
12
- export declare type ActivateAppRequest = EnableAppRequest;
13
- export declare type ActivateAppResponse = EnableAppResponse;
14
- export declare type DeactivateAppRequest = {
15
- installed_app_id: InstalledAppId;
16
- };
17
- export declare type DeactivateAppResponse = null;
18
- export declare type EnableAppRequest = {
19
- installed_app_id: InstalledAppId;
20
- };
21
- export declare type EnableAppResponse = {
22
- app: InstalledAppInfo;
23
- errors: Array<[CellId, string]>;
24
- };
25
- export declare type DisableAppRequest = {
26
- installed_app_id: InstalledAppId;
27
- };
28
- export declare type DisableAppResponse = null;
29
- export declare type StartAppRequest = {
30
- installed_app_id: InstalledAppId;
31
- };
32
- export declare type StartAppResponse = boolean;
33
- export declare type DumpStateRequest = {
34
- cell_id: CellId;
35
- };
36
- export declare type DumpStateResponse = any;
37
- export declare type DumpFullStateRequest = {
38
- cell_id: CellId;
39
- dht_ops_cursor: number | undefined;
40
- };
41
- export declare type DumpFullStateResponse = FullStateDump;
42
- export declare type GenerateAgentPubKeyRequest = void;
43
- export declare type GenerateAgentPubKeyResponse = AgentPubKey;
44
- export declare type RegisterDnaRequest = {
45
- uid?: string;
46
- properties?: DnaProperties;
47
- } & DnaSource;
48
- export declare type RegisterDnaResponse = HoloHash;
49
- export declare type InstallAppRequest = {
50
- installed_app_id: InstalledAppId;
51
- agent_key: AgentPubKey;
52
- dnas: Array<InstallAppDnaPayload>;
53
- };
54
- export declare type InstallAppResponse = InstalledAppInfo;
55
- export declare type UninstallAppRequest = {
56
- installed_app_id: InstalledAppId;
57
- };
58
- export declare type UninstallAppResponse = null;
59
- export declare type CreateCloneCellRequest = {
60
- properties?: DnaProperties;
61
- dna_hash: HoloHash;
62
- agent_key: AgentPubKey;
63
- installed_app_id: InstalledAppId;
64
- role_id: RoleId;
65
- membrane_proof?: MembraneProof;
66
- };
67
- export declare type CreateCloneCellResponse = CellId;
68
- export declare type ResourceBytes = Buffer;
69
- export declare type ResourceMap = {
70
- [key: string]: ResourceBytes;
71
- };
72
- export declare type CellProvisioning = {
73
- create: {
74
- deferred: boolean;
75
- };
76
- } | {
77
- create_clone: {
78
- deferred: boolean;
79
- };
80
- } | {
81
- use_existing: {
82
- deferred: boolean;
83
- };
84
- } | {
85
- create_if_no_exists: {
86
- deferred: boolean;
87
- };
88
- } | {
89
- disabled: Record<string, never>;
90
- };
91
- export declare type HoloHashB64 = string;
92
- export declare type DnaVersionSpec = Array<HoloHashB64>;
93
- export declare type DnaVersionFlexible = {
94
- singleton: HoloHashB64;
95
- } | {
96
- multiple: DnaVersionSpec;
97
- };
98
- export declare type AppRoleDnaManifest = {
99
- location?: Location;
100
- properties?: DnaProperties;
101
- uid?: string;
102
- version?: DnaVersionFlexible;
103
- };
104
- export declare type AppRoleManifest = {
105
- id: RoleId;
106
- provisioning?: CellProvisioning;
107
- dna: AppRoleDnaManifest;
108
- };
109
- export declare type AppManifest = {
110
- manifest_version: string;
111
- name: string;
112
- description?: string;
113
- roles: Array<AppRoleManifest>;
114
- };
115
- export declare type AppBundle = {
116
- manifest: AppManifest;
117
- resources: ResourceMap;
118
- };
119
- export declare type AppBundleSource = {
120
- bundle: AppBundle;
121
- } | {
122
- path: string;
123
- };
124
- export declare type Uid = string;
125
- export declare type InstallAppBundleRequest = {
126
- agent_key: AgentPubKey;
127
- installed_app_id?: InstalledAppId;
128
- membrane_proofs: {
129
- [key: string]: MembraneProof;
130
- };
131
- uid?: Uid;
132
- } & AppBundleSource;
133
- export declare type InstallAppBundleResponse = InstalledAppInfo;
134
- export declare type ListDnasRequest = void;
135
- export declare type ListDnasResponse = Array<string>;
136
- export declare type ListCellIdsRequest = void;
137
- export declare type ListCellIdsResponse = Array<CellId>;
138
- export declare type ListActiveAppsRequest = void;
139
- export declare type ListActiveAppsResponse = Array<InstalledAppId>;
140
- export declare enum AppStatusFilter {
141
- Enabled = "enabled",
142
- Disabled = "disabled",
143
- Running = "running",
144
- Stopped = "stopped",
145
- Paused = "paused"
146
- }
147
- export declare type ListAppsRequest = {
148
- status_filter?: AppStatusFilter;
149
- };
150
- export declare type ListAppsResponse = Array<InstalledAppInfo>;
151
- export declare type ListAppInterfacesRequest = void;
152
- export declare type ListAppInterfacesResponse = Array<number>;
153
- export declare type AgentInfoSigned = any;
154
- export declare type RequestAgentInfoRequest = {
155
- cell_id: CellId | null;
156
- };
157
- export declare type RequestAgentInfoResponse = Array<AgentInfoSigned>;
158
- export declare type AddAgentInfoRequest = {
159
- agent_infos: Array<AgentInfoSigned>;
160
- };
161
- export declare type AddAgentInfoResponse = any;
162
- export interface AdminApi {
163
- attachAppInterface: Requester<AttachAppInterfaceRequest, AttachAppInterfaceResponse>;
164
- activateApp: Requester<ActivateAppRequest, ActivateAppResponse>;
165
- deactivateApp: Requester<DeactivateAppRequest, DeactivateAppResponse>;
166
- enableApp: Requester<EnableAppRequest, EnableAppResponse>;
167
- disableApp: Requester<DisableAppRequest, DisableAppResponse>;
168
- startApp: Requester<StartAppRequest, StartAppResponse>;
169
- dumpState: Requester<DumpStateRequest, DumpStateResponse>;
170
- dumpFullState: Requester<DumpFullStateRequest, DumpFullStateResponse>;
171
- generateAgentPubKey: Requester<GenerateAgentPubKeyRequest, GenerateAgentPubKeyResponse>;
172
- registerDna: Requester<RegisterDnaRequest, RegisterDnaResponse>;
173
- installApp: Requester<InstallAppRequest, InstallAppResponse>;
174
- uninstallApp: Requester<UninstallAppRequest, UninstallAppResponse>;
175
- createCloneCell: Requester<CreateCloneCellRequest, CreateCloneCellResponse>;
176
- installAppBundle: Requester<InstallAppBundleRequest, InstallAppBundleResponse>;
177
- listDnas: Requester<ListDnasRequest, ListDnasResponse>;
178
- listCellIds: Requester<ListCellIdsRequest, ListCellIdsResponse>;
179
- listActiveApps: Requester<ListActiveAppsRequest, ListActiveAppsResponse>;
180
- listApps: Requester<ListAppsRequest, ListAppsResponse>;
181
- listAppInterfaces: Requester<ListAppInterfacesRequest, ListAppInterfacesResponse>;
182
- requestAgentInfo: Requester<RequestAgentInfoRequest, RequestAgentInfoResponse>;
183
- addAgentInfo: Requester<AddAgentInfoRequest, AddAgentInfoResponse>;
184
- }
185
- export declare type InstallAppDnaPayload = {
186
- hash: HoloHash;
187
- role_id: RoleId;
188
- membrane_proof?: MembraneProof;
189
- };
190
- export declare type ZomeLocation = {
191
- bundled: string;
192
- } | {
193
- path: string;
194
- } | {
195
- url: string;
196
- };
197
- export declare type ZomeManifest = {
198
- name: string;
199
- hash?: string;
200
- } & ZomeLocation;
201
- export declare type DnaManifest = {
202
- manifest_version: string;
203
- name: string;
204
- uid?: string;
205
- properties?: DnaProperties;
206
- zomes: Array<ZomeManifest>;
207
- };
208
- export declare type DnaBundle = {
209
- manifest: DnaManifest;
210
- resources: ResourceMap;
211
- };
212
- export declare type DnaSource = {
213
- hash: HoloHash;
214
- } | {
215
- path: string;
216
- } | {
217
- bundle: DnaBundle;
218
- };
219
- export declare type Zomes = Array<[string, {
220
- wasm_hash: Array<HoloHash>;
221
- }]>;
222
- export declare type WasmCode = [HoloHash, {
223
- code: Array<number>;
224
- }];
package/lib/api/admin.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppStatusFilter = void 0;
4
- var AppStatusFilter;
5
- (function (AppStatusFilter) {
6
- AppStatusFilter["Enabled"] = "enabled";
7
- AppStatusFilter["Disabled"] = "disabled";
8
- AppStatusFilter["Running"] = "running";
9
- AppStatusFilter["Stopped"] = "stopped";
10
- AppStatusFilter["Paused"] = "paused";
11
- })(AppStatusFilter = exports.AppStatusFilter || (exports.AppStatusFilter = {}));
12
- //# sourceMappingURL=admin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/api/admin.ts"],"names":[],"mappings":";;;AAsLA,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;AACnB,CAAC,EANW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAM1B"}
package/lib/api/app.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/api/app.ts"],"names":[],"mappings":""}
@@ -1,36 +0,0 @@
1
- import { AgentPubKey, DnaHash, HeaderHash, KitsuneAgent, KitsuneSpace, Signature } from "../types/common";
2
- import { DhtOp } from "../types/dht-ops";
3
- import { Entry } from "../types/entry";
4
- import { Header } from "../types/header";
5
- export interface AgentInfoDump {
6
- kitsune_agent: KitsuneAgent;
7
- kitsune_space: KitsuneSpace;
8
- dump: string;
9
- }
10
- export interface P2pAgentsDump {
11
- this_agent_info: AgentInfoDump | undefined;
12
- this_dna: [DnaHash, KitsuneSpace] | undefined;
13
- this_agent: [AgentPubKey, KitsuneAgent] | undefined;
14
- peers: Array<AgentInfoDump>;
15
- }
16
- export interface FullIntegrationStateDump {
17
- validation_limbo: Array<DhtOp>;
18
- integration_limbo: Array<DhtOp>;
19
- integrated: Array<DhtOp>;
20
- dht_ops_cursor: number;
21
- }
22
- export interface SourceChainJsonElement {
23
- signature: Signature;
24
- header_address: HeaderHash;
25
- header: Header;
26
- entry: Entry | undefined;
27
- }
28
- export interface SourceChainJsonDump {
29
- elements: Array<SourceChainJsonElement>;
30
- published_ops_count: number;
31
- }
32
- export interface FullStateDump {
33
- peer_dump: P2pAgentsDump;
34
- source_chain_dump: SourceChainJsonDump;
35
- integration_dump: FullIntegrationStateDump;
36
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=state-dump.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state-dump.js","sourceRoot":"","sources":["../../src/api/state-dump.ts"],"names":[],"mappings":""}
@@ -1,39 +0,0 @@
1
- /// <reference types="node" />
2
- import { InstalledAppId, InstalledCell } from "../types/common";
3
- export declare type DeactivationReason = {
4
- never_activated: null;
5
- } | {
6
- normal: null;
7
- } | {
8
- quarantined: {
9
- error: string;
10
- };
11
- };
12
- export declare type PausedAppReason = {
13
- error: string;
14
- };
15
- export declare type DisabledAppReason = {
16
- never_started: null;
17
- } | {
18
- user: null;
19
- } | {
20
- error: string;
21
- };
22
- export declare type InstalledAppInfoStatus = {
23
- paused: {
24
- reason: PausedAppReason;
25
- };
26
- } | {
27
- disabled: {
28
- reason: DisabledAppReason;
29
- };
30
- } | {
31
- running: null;
32
- };
33
- export declare type InstalledAppInfo = {
34
- installed_app_id: InstalledAppId;
35
- cell_data: Array<InstalledCell>;
36
- status: InstalledAppInfoStatus;
37
- };
38
- export declare type MembraneProof = Buffer;
39
- export declare const fakeAgentPubKey: () => Buffer;
package/lib/api/types.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fakeAgentPubKey = void 0;
4
- const fakeAgentPubKey = () => Buffer.from([0x84, 0x20, 0x24].concat("000000000000000000000000000000000000"
5
- .split("")
6
- .map((x) => parseInt(x, 10))));
7
- exports.fakeAgentPubKey = fakeAgentPubKey;
8
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":";;;AAqCO,MAAM,eAAe,GAAG,GAAG,EAAE,CAClC,MAAM,CAAC,IAAI,CACT,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,MAAM,CACvB,sCAAsC;KACnC,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAC/B,CACF,CAAA;AAPU,QAAA,eAAe,mBAOzB"}
@@ -1,30 +0,0 @@
1
- import { AgentPubKey } from "./common";
2
- export declare type CapSecret = Uint8Array;
3
- export interface CapClaim {
4
- tag: string;
5
- grantor: AgentPubKey;
6
- secret: CapSecret;
7
- }
8
- export interface ZomeCallCapGrant {
9
- tag: string;
10
- access: CapAccess;
11
- functions: Array<{
12
- zome: string;
13
- fn_name: string;
14
- }>;
15
- }
16
- export declare type CapAccess = "Unrestricted" | {
17
- Transferable: {
18
- secret: CapSecret;
19
- };
20
- } | {
21
- Assigned: {
22
- secret: CapSecret;
23
- assignees: AgentPubKey[];
24
- };
25
- };
26
- export declare type CapGrant = {
27
- ChainAuthor: AgentPubKey;
28
- } | {
29
- RemoteAgent: ZomeCallCapGrant;
30
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=capabilities.js.map