@genobank/biofs 3.21.0 → 3.22.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.
- package/CHANGELOG.md +4 -0
- package/dist/commands/imaging/package.d.ts +64 -0
- package/dist/commands/imaging/package.d.ts.map +1 -0
- package/dist/commands/imaging/package.js +235 -0
- package/dist/commands/imaging/package.js.map +1 -0
- package/dist/commands/inventory-delegate/index.d.ts +28 -0
- package/dist/commands/inventory-delegate/index.d.ts.map +1 -0
- package/dist/commands/inventory-delegate/index.js +171 -0
- package/dist/commands/inventory-delegate/index.js.map +1 -0
- package/dist/commands/inventory-list/index.d.ts +33 -0
- package/dist/commands/inventory-list/index.d.ts.map +1 -0
- package/dist/commands/inventory-list/index.js +74 -0
- package/dist/commands/inventory-list/index.js.map +1 -0
- package/dist/commands/inventory-register/index.d.ts +8 -0
- package/dist/commands/inventory-register/index.d.ts.map +1 -0
- package/dist/commands/inventory-register/index.js +57 -0
- package/dist/commands/inventory-register/index.js.map +1 -0
- package/dist/commands/job-view/index.d.ts +15 -0
- package/dist/commands/job-view/index.d.ts.map +1 -0
- package/dist/commands/job-view/index.js +88 -0
- package/dist/commands/job-view/index.js.map +1 -0
- package/dist/commands/neoantigen-pipeline/index.d.ts +35 -1
- package/dist/commands/neoantigen-pipeline/index.d.ts.map +1 -1
- package/dist/commands/neoantigen-pipeline/index.js +107 -1
- package/dist/commands/neoantigen-pipeline/index.js.map +1 -1
- package/dist/commands/parabricks/index.d.ts +83 -0
- package/dist/commands/parabricks/index.d.ts.map +1 -0
- package/dist/commands/parabricks/index.js +340 -0
- package/dist/commands/parabricks/index.js.map +1 -0
- package/dist/commands/parabricks/registry.json +15100 -0
- package/dist/commands/whoami.d.ts +1 -0
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +20 -0
- package/dist/commands/whoami.js.map +1 -1
- package/dist/index.js +169 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/utils/node_roles.d.ts +16 -0
- package/dist/lib/utils/node_roles.d.ts.map +1 -0
- package/dist/lib/utils/node_roles.js +34 -0
- package/dist/lib/utils/node_roles.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who am I to the node, and what to do when it says no. Pure helpers, no I/O, so they are unit tested.
|
|
3
|
+
*
|
|
4
|
+
* The node answers 403 in two ways when a wallet that is not a node operator tries an operator action:
|
|
5
|
+
* "node operators only" (operator routes such as inventory-register)
|
|
6
|
+
* "signature does not match wallet" (a job asserting another wallet with --owner)
|
|
7
|
+
* Both mean the same thing for the user: sign as the node operator, for example with BIOFS_PROFILE=operator.
|
|
8
|
+
*/
|
|
9
|
+
export interface NodeRoles {
|
|
10
|
+
wallet: string;
|
|
11
|
+
node_admin: boolean;
|
|
12
|
+
admin_hint?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function nodeErrorMessage(status: number, error: string | undefined, owner?: string): string;
|
|
15
|
+
export declare function rolesText(r: NodeRoles, profile: string): string[];
|
|
16
|
+
//# sourceMappingURL=node_roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_roles.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/node_roles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CASlG;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAUjE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Who am I to the node, and what to do when it says no. Pure helpers, no I/O, so they are unit tested.
|
|
4
|
+
*
|
|
5
|
+
* The node answers 403 in two ways when a wallet that is not a node operator tries an operator action:
|
|
6
|
+
* "node operators only" (operator routes such as inventory-register)
|
|
7
|
+
* "signature does not match wallet" (a job asserting another wallet with --owner)
|
|
8
|
+
* Both mean the same thing for the user: sign as the node operator, for example with BIOFS_PROFILE=operator.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.nodeErrorMessage = nodeErrorMessage;
|
|
12
|
+
exports.rolesText = rolesText;
|
|
13
|
+
function nodeErrorMessage(status, error, owner) {
|
|
14
|
+
const e = String(error || 'unknown');
|
|
15
|
+
if (status === 403 && /node operators only/i.test(e)) {
|
|
16
|
+
return '403: this wallet is not a node operator. Sign as the node operator, for example: BIOFS_PROFILE=operator biofs <same command>. Check with: biofs whoami --roles';
|
|
17
|
+
}
|
|
18
|
+
if (status === 403 && /signature does not match wallet/i.test(e) && owner) {
|
|
19
|
+
return `403: this wallet is not a node operator, so it cannot run a job for ${owner}. Sign as the node operator, for example: BIOFS_PROFILE=operator biofs <same command> --owner ${owner}. Check with: biofs whoami --roles`;
|
|
20
|
+
}
|
|
21
|
+
return `${status}: ${e}`;
|
|
22
|
+
}
|
|
23
|
+
function rolesText(r, profile) {
|
|
24
|
+
const lines = [
|
|
25
|
+
`Signer wallet : ${r.wallet}`,
|
|
26
|
+
`Profile : ${profile}`,
|
|
27
|
+
`Node operator : ${r.node_admin ? 'YES (may run jobs for a data owner with --owner, and use operator verbs such as inventory-register)' : 'NO'}`,
|
|
28
|
+
];
|
|
29
|
+
if (!r.node_admin) {
|
|
30
|
+
lines.push(`Fix : sign as the node operator${r.admin_hint ? ` (${r.admin_hint})` : ''}, for example: BIOFS_PROFILE=operator biofs <command>`);
|
|
31
|
+
}
|
|
32
|
+
return lines;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=node_roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_roles.js","sourceRoot":"","sources":["../../../src/lib/utils/node_roles.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAQH,4CASC;AAED,8BAUC;AArBD,SAAgB,gBAAgB,CAAC,MAAc,EAAE,KAAyB,EAAE,KAAc;IACxF,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,OAAO,gKAAgK,CAAC;IAC1K,CAAC;IACD,IAAI,MAAM,KAAK,GAAG,IAAI,kCAAkC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC;QAC1E,OAAO,uEAAuE,KAAK,iGAAiG,KAAK,oCAAoC,CAAC;IAChO,CAAC;IACD,OAAO,GAAG,MAAM,KAAK,CAAC,EAAE,CAAC;AAC3B,CAAC;AAED,SAAgB,SAAS,CAAC,CAAY,EAAE,OAAe;IACrD,MAAM,KAAK,GAAG;QACZ,mBAAmB,CAAC,CAAC,MAAM,EAAE;QAC7B,mBAAmB,OAAO,EAAE;QAC5B,mBAAmB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,qGAAqG,CAAC,CAAC,CAAC,IAAI,EAAE;KACjJ,CAAC;IACF,IAAI,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,uDAAuD,CAAC,CAAC;IAC1J,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genobank/biofs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.0",
|
|
4
4
|
"description": "BioFS - GenoBank.io BioNFT-Gated Filesystem CLI with Sequentia Protocol (BioCIDRegistry, ConsentManager, BioPIL) - 97% cost savings vs Story Protocol",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://genobank.app/biofs",
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "tsc && mkdir -p dist/lib/bionft && cp src/lib/bionft/BioAssetVault.abi.json src/lib/bionft/BioNFTCredentials.abi.json dist/lib/bionft/ && mkdir -p dist/abi && cp -R src/abi/. dist/abi/ && node validate-commands.mjs",
|
|
26
|
+
"build": "tsc && mkdir -p dist/lib/bionft && cp src/lib/bionft/BioAssetVault.abi.json src/lib/bionft/BioNFTCredentials.abi.json dist/lib/bionft/ && mkdir -p dist/abi && cp -R src/abi/. dist/abi/ && mkdir -p dist/commands/parabricks && cp src/commands/parabricks/registry.json dist/commands/parabricks/registry.json && node validate-commands.mjs",
|
|
27
27
|
"dev": "ts-node src/index.ts",
|
|
28
28
|
"test": "jest",
|
|
29
29
|
"validate": "node validate-commands.mjs"
|