@holochain/hc-spin 0.300.2-dev.5 → 0.300.2-dev.6
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/cli.js +0 -0
- package/dist/main/index.js +38 -72
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
File without changes
|
package/dist/main/index.js
CHANGED
|
@@ -751,17 +751,30 @@ var CellProvisioningStrategy;
|
|
|
751
751
|
})(CellProvisioningStrategy || (CellProvisioningStrategy = {}));
|
|
752
752
|
var AppStatusFilter;
|
|
753
753
|
(function(AppStatusFilter2) {
|
|
754
|
-
AppStatusFilter2["Enabled"] = "
|
|
755
|
-
AppStatusFilter2["Disabled"] = "
|
|
756
|
-
AppStatusFilter2["Running"] = "
|
|
757
|
-
AppStatusFilter2["Stopped"] = "
|
|
758
|
-
AppStatusFilter2["Paused"] = "
|
|
754
|
+
AppStatusFilter2["Enabled"] = "Enabled";
|
|
755
|
+
AppStatusFilter2["Disabled"] = "Disabled";
|
|
756
|
+
AppStatusFilter2["Running"] = "Running";
|
|
757
|
+
AppStatusFilter2["Stopped"] = "Stopped";
|
|
758
|
+
AppStatusFilter2["Paused"] = "Paused";
|
|
759
759
|
})(AppStatusFilter || (AppStatusFilter = {}));
|
|
760
760
|
const __HC_LAUNCHER_ENV__ = "__HC_LAUNCHER_ENV__";
|
|
761
761
|
const __HC_ZOME_CALL_SIGNER__ = "__HC_ZOME_CALL_SIGNER__";
|
|
762
762
|
const isLauncher = () => globalThis.window && __HC_LAUNCHER_ENV__ in globalThis.window;
|
|
763
763
|
const getLauncherEnvironment = () => isLauncher() ? globalThis.window[__HC_LAUNCHER_ENV__] : void 0;
|
|
764
764
|
const getHostZomeCallSigner = () => globalThis.window && globalThis.window[__HC_ZOME_CALL_SIGNER__];
|
|
765
|
+
var ActionType;
|
|
766
|
+
(function(ActionType2) {
|
|
767
|
+
ActionType2["Dna"] = "Dna";
|
|
768
|
+
ActionType2["AgentValidationPkg"] = "AgentValidationPkg";
|
|
769
|
+
ActionType2["InitZomesComplete"] = "InitZomesComplete";
|
|
770
|
+
ActionType2["CreateLink"] = "CreateLink";
|
|
771
|
+
ActionType2["DeleteLink"] = "DeleteLink";
|
|
772
|
+
ActionType2["OpenChain"] = "OpenChain";
|
|
773
|
+
ActionType2["CloseChain"] = "CloseChain";
|
|
774
|
+
ActionType2["Create"] = "Create";
|
|
775
|
+
ActionType2["Update"] = "Update";
|
|
776
|
+
ActionType2["Delete"] = "Delete";
|
|
777
|
+
})(ActionType || (ActionType = {}));
|
|
765
778
|
var GrantedFunctionsType;
|
|
766
779
|
(function(GrantedFunctionsType2) {
|
|
767
780
|
GrantedFunctionsType2["All"] = "All";
|
|
@@ -773,6 +786,18 @@ var CapAccessType;
|
|
|
773
786
|
CapAccessType2["Transferable"] = "Transferable";
|
|
774
787
|
CapAccessType2["Assigned"] = "Assigned";
|
|
775
788
|
})(CapAccessType || (CapAccessType = {}));
|
|
789
|
+
var DhtOpType;
|
|
790
|
+
(function(DhtOpType2) {
|
|
791
|
+
DhtOpType2["StoreRecord"] = "StoreRecord";
|
|
792
|
+
DhtOpType2["StoreEntry"] = "StoreEntry";
|
|
793
|
+
DhtOpType2["RegisterAgentActivity"] = "RegisterAgentActivity";
|
|
794
|
+
DhtOpType2["RegisterUpdatedContent"] = "RegisterUpdatedContent";
|
|
795
|
+
DhtOpType2["RegisterUpdatedRecord"] = "RegisterUpdatedRecord";
|
|
796
|
+
DhtOpType2["RegisterDeletedBy"] = "RegisterDeletedBy";
|
|
797
|
+
DhtOpType2["RegisterDeletedEntryAction"] = "RegisterDeletedEntryAction";
|
|
798
|
+
DhtOpType2["RegisterAddLink"] = "RegisterAddLink";
|
|
799
|
+
DhtOpType2["RegisterRemoveLink"] = "RegisterRemoveLink";
|
|
800
|
+
})(DhtOpType || (DhtOpType = {}));
|
|
776
801
|
const anyMap = /* @__PURE__ */ new WeakMap();
|
|
777
802
|
const eventsMap = /* @__PURE__ */ new WeakMap();
|
|
778
803
|
const producersMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -4967,7 +4992,7 @@ const ERROR_TYPE = "error";
|
|
|
4967
4992
|
const DEFAULT_TIMEOUT = 6e4;
|
|
4968
4993
|
const requesterTransformer = (requester, tag, transform = identityTransformer) => async (req, timeout2) => {
|
|
4969
4994
|
const transformedInput = await transform.input(req);
|
|
4970
|
-
const input = { type:
|
|
4995
|
+
const input = { type: tag, data: transformedInput };
|
|
4971
4996
|
const response = await requester(input, timeout2);
|
|
4972
4997
|
return transform.output(response.data);
|
|
4973
4998
|
};
|
|
@@ -4983,13 +5008,13 @@ class HolochainError extends Error {
|
|
|
4983
5008
|
this.message = message;
|
|
4984
5009
|
}
|
|
4985
5010
|
}
|
|
4986
|
-
const catchError = (
|
|
4987
|
-
if (
|
|
4988
|
-
const errorName =
|
|
4989
|
-
const error = new HolochainError(errorName,
|
|
5011
|
+
const catchError = (response) => {
|
|
5012
|
+
if (response.type === ERROR_TYPE) {
|
|
5013
|
+
const errorName = response.data.type;
|
|
5014
|
+
const error = new HolochainError(errorName, response.data.data);
|
|
4990
5015
|
return Promise.reject(error);
|
|
4991
5016
|
} else {
|
|
4992
|
-
return Promise.resolve(
|
|
5017
|
+
return Promise.resolve(response);
|
|
4993
5018
|
}
|
|
4994
5019
|
};
|
|
4995
5020
|
const promiseTimeout = (promise2, tag, ms) => {
|
|
@@ -12829,7 +12854,7 @@ class AdminWebsocket {
|
|
|
12829
12854
|
/**
|
|
12830
12855
|
* List all installed apps.
|
|
12831
12856
|
*/
|
|
12832
|
-
listApps = this._requester("list_apps"
|
|
12857
|
+
listApps = this._requester("list_apps");
|
|
12833
12858
|
/**
|
|
12834
12859
|
* List all attached app interfaces.
|
|
12835
12860
|
*/
|
|
@@ -12890,75 +12915,16 @@ class AdminWebsocket {
|
|
|
12890
12915
|
*/
|
|
12891
12916
|
authorizeSigningCredentials = async (cellId, functions) => {
|
|
12892
12917
|
const [keyPair, signingKey] = await generateSigningKeyPair();
|
|
12893
|
-
const capSecret = await this.grantSigningKey(cellId, functions ||
|
|
12918
|
+
const capSecret = await this.grantSigningKey(cellId, functions || GrantedFunctionsType.All, signingKey);
|
|
12894
12919
|
setSigningCredentials(cellId, { capSecret, keyPair, signingKey });
|
|
12895
12920
|
};
|
|
12896
12921
|
}
|
|
12897
|
-
const listAppsTransform = {
|
|
12898
|
-
input: (req) => {
|
|
12899
|
-
const args = {};
|
|
12900
|
-
if (req.status_filter) {
|
|
12901
|
-
args.status_filter = getAppStatusInApiForm(req.status_filter);
|
|
12902
|
-
}
|
|
12903
|
-
return args;
|
|
12904
|
-
},
|
|
12905
|
-
output: (res) => res
|
|
12906
|
-
};
|
|
12907
12922
|
const dumpStateTransform = {
|
|
12908
12923
|
input: (req) => req,
|
|
12909
12924
|
output: (res) => {
|
|
12910
12925
|
return JSON.parse(res);
|
|
12911
12926
|
}
|
|
12912
12927
|
};
|
|
12913
|
-
function getAppStatusInApiForm(status_filter) {
|
|
12914
|
-
switch (status_filter) {
|
|
12915
|
-
case AppStatusFilter.Running:
|
|
12916
|
-
return {
|
|
12917
|
-
Running: null
|
|
12918
|
-
};
|
|
12919
|
-
case AppStatusFilter.Enabled:
|
|
12920
|
-
return {
|
|
12921
|
-
Enabled: null
|
|
12922
|
-
};
|
|
12923
|
-
case AppStatusFilter.Paused:
|
|
12924
|
-
return {
|
|
12925
|
-
Paused: null
|
|
12926
|
-
};
|
|
12927
|
-
case AppStatusFilter.Disabled:
|
|
12928
|
-
return {
|
|
12929
|
-
Disabled: null
|
|
12930
|
-
};
|
|
12931
|
-
case AppStatusFilter.Stopped:
|
|
12932
|
-
return {
|
|
12933
|
-
Stopped: null
|
|
12934
|
-
};
|
|
12935
|
-
}
|
|
12936
|
-
}
|
|
12937
|
-
var ActionType;
|
|
12938
|
-
(function(ActionType2) {
|
|
12939
|
-
ActionType2["Dna"] = "Dna";
|
|
12940
|
-
ActionType2["AgentValidationPkg"] = "AgentValidationPkg";
|
|
12941
|
-
ActionType2["InitZomesComplete"] = "InitZomesComplete";
|
|
12942
|
-
ActionType2["CreateLink"] = "CreateLink";
|
|
12943
|
-
ActionType2["DeleteLink"] = "DeleteLink";
|
|
12944
|
-
ActionType2["OpenChain"] = "OpenChain";
|
|
12945
|
-
ActionType2["CloseChain"] = "CloseChain";
|
|
12946
|
-
ActionType2["Create"] = "Create";
|
|
12947
|
-
ActionType2["Update"] = "Update";
|
|
12948
|
-
ActionType2["Delete"] = "Delete";
|
|
12949
|
-
})(ActionType || (ActionType = {}));
|
|
12950
|
-
var DhtOpType;
|
|
12951
|
-
(function(DhtOpType2) {
|
|
12952
|
-
DhtOpType2["StoreRecord"] = "StoreRecord";
|
|
12953
|
-
DhtOpType2["StoreEntry"] = "StoreEntry";
|
|
12954
|
-
DhtOpType2["RegisterAgentActivity"] = "RegisterAgentActivity";
|
|
12955
|
-
DhtOpType2["RegisterUpdatedContent"] = "RegisterUpdatedContent";
|
|
12956
|
-
DhtOpType2["RegisterUpdatedRecord"] = "RegisterUpdatedRecord";
|
|
12957
|
-
DhtOpType2["RegisterDeletedBy"] = "RegisterDeletedBy";
|
|
12958
|
-
DhtOpType2["RegisterDeletedEntryAction"] = "RegisterDeletedEntryAction";
|
|
12959
|
-
DhtOpType2["RegisterAddLink"] = "RegisterAddLink";
|
|
12960
|
-
DhtOpType2["RegisterRemoveLink"] = "RegisterRemoveLink";
|
|
12961
|
-
})(DhtOpType || (DhtOpType = {}));
|
|
12962
12928
|
function validateCliArgs(cliArgs, cliOpts, appDataRootDir) {
|
|
12963
12929
|
if (cliArgs.length !== 1) {
|
|
12964
12930
|
throw new Error(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holochain/hc-spin",
|
|
3
|
-
"version": "0.300.2-dev.
|
|
3
|
+
"version": "0.300.2-dev.6",
|
|
4
4
|
"holochainVersion": "0.3.0-beta-dev.44",
|
|
5
5
|
"description": "CLI to run Holochain aps during development.",
|
|
6
6
|
"author": "matthme",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@electron-toolkit/preload": "^3.0.0",
|
|
37
37
|
"@electron-toolkit/utils": "^3.0.0",
|
|
38
|
-
"@holochain/client": "0.17.0-
|
|
38
|
+
"@holochain/client": "0.17.0-rc.0",
|
|
39
39
|
"@holochain/hc-spin-rust-utils": "^0.300.1",
|
|
40
40
|
"@msgpack/msgpack": "^2.8.0",
|
|
41
41
|
"bufferutil": "4.0.8",
|