nemar-cli 0.8.14-dev.833 → 0.8.14-dev.836
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/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -95,7 +95,7 @@ ${W.dim(`eta: ${D.eta}`)}`:"";process.stderr.write(`${F}
|
|
|
95
95
|
${$} ${D.message}
|
|
96
96
|
${J}${Q}
|
|
97
97
|
${F}
|
|
98
|
-
`)}var Vf=!1;var RW=I(()=>{xD()});var Uf;var Zf=I(()=>{Uf={name:"nemar-cli",version:"0.8.14-dev.833",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit",prepublishOnly:"bun run build","docs:generate":"bun run scripts/generate-docs.ts","docs:serve":"mkdocs serve","docs:build":"mkdocs build",prepare:"husky",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://nemar-cli.pages.dev",engines:{bun:">=1.0.0"},files:["dist","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1","fuse.js":"^7.1.0",inquirer:"^9.2.15",ora:"^8.0.1",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},devDependencies:{"@biomejs/biome":"1.9.4","@types/bcryptjs":"^3.0.0","@types/bun":"latest","@types/inquirer":"^9.0.7",bcryptjs:"^3.0.3",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var _4;var sJ=I(()=>{Zf();_4=Uf.version});function w0(D){if(D instanceof Error)return D.message;return String(D)}function Lf(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(OW)return CW;return JD().apiUrl||CW}async function u(D,F={},$=!1){let J=`${Lf()}${D}`,Q={"Content-Type":"application/json","X-CLI-Version":_4,...F.headers};if($){let X=JD();if(!X.apiKey&&$===!0)throw new b(401,"Not authenticated. Run 'nemar auth login' first.");if(X.apiKey)Q.Authorization=`Bearer ${X.apiKey}`}let Y;try{Y=await fetch(J,{...F,headers:Q})}catch(X){throw new b(0,`Network error: Could not connect to ${Lf()}`,{originalError:X instanceof Error?X.message:String(X)})}let B;try{B=await Y.json()}catch{throw new b(Y.status,`Invalid response from server (status ${Y.status})`)}if(!Y.ok){if(Y.status===503&&(B.mode==="read-only"||B.mode==="full")){let X=typeof B.message==="string"?B.message:"NEMAR is in maintenance mode. Please retry shortly.",G=typeof B.eta==="string"?B.eta:null,H=new tJ(B.mode,X,G,B.details);throw oJ(H),H}throw new b(Y.status,B.error||B.message||"Request failed",B.details,typeof B.step==="string"?B.step:void 0)}return B}async function Mf(D){return u(`/auth/check-username?username=${encodeURIComponent(D)}`)}async function Nf(D){return u(`/auth/check-github?username=${encodeURIComponent(D)}`)}async function Rf(D){return u("/auth/signup",{method:"POST",body:JSON.stringify(D)})}async function Cf(D){return u("/auth/login",{method:"POST",body:JSON.stringify({api_key:D})})}async function Of(D){return u("/auth/resend-verification",{method:"POST",body:JSON.stringify({email:D})})}async function wf(D,F){return u("/auth/retrieve-key",{method:"POST",body:JSON.stringify({email:D,password:F})})}async function jf(D){return u("/auth/request-key-regeneration",{method:"POST",body:JSON.stringify({email:D})})}async function eJ(){return u("/users/me",{},!0)}async function Tf(D,F){let $=new URLSearchParams;if(D)$.set("status",D);if(F)$.set("role",F);let J=$.toString()?`?${$.toString()}`:"";return u(`/admin/users${J}`,{},!0)}async function Pf(D){return u(`/admin/approve/${D}`,{method:"POST"},!0)}async function If(D){return u(`/admin/revoke/${D}`,{method:"POST"},!0)}async function Sf(D,F){return u(`/admin/users/${D}/role`,{method:"POST",body:JSON.stringify({role:F})},!0)}async function wW(D,F){return u(`/admin/datasets/${D}/visibility`,{method:"PATCH",body:JSON.stringify({visibility:F})},!0)}async function kf(D){return u(`/datasets/${D}/publish`,{method:"POST"},!0)}async function vf(D){return u(`/admin/datasets/${D}/ci`,{},!0)}async function f4(D,F){let $=F?.validate===!1?"?validate=false":"";return u(`/admin/datasets/${D}/ci${$}`,{method:"POST"},!0)}async function jW(D){return u(`/admin/datasets/${D}/ci/sync`,{method:"POST"},!0)}async function DQ(D){return u(`/datasets/${D}/ci/status`,{},!0)}async function yf(D){return u(`/datasets/${D}/manifest`,{},!0)}async function FQ(D,F){return u(`/datasets/${D}/manifest/${F}`,{},!0)}function xf(D){let F=D;if(!F.status)F.status="active";else if(!["active","archived","deleted"].includes(F.status))throw Error(`Invalid dataset status: ${F.status}`);if(!F.visibility)F.visibility="private";else if(!["public","private"].includes(F.visibility))throw Error(`Invalid dataset visibility: ${F.visibility}`);return F}async function S9(D={}){let F=new URLSearchParams;if(D.mine)F.set("mine","true");if(D.search)F.set("search",D.search);if(D.modality)F.set("modality",D.modality);if(D.author)F.set("author",D.author);if(D.task)F.set("task",D.task);if(D.hasDoi)F.set("has_doi","true");if(D.recent)F.set("recent",String(D.recent));if(D.sort)F.set("sort",D.sort);if(D.limit!=null)F.set("limit",String(D.limit));if(D.offset!=null)F.set("offset",String(D.offset));if(D.owner)F.set("owner",D.owner);let $=F.toString()?`?${F.toString()}`:"",J=await u(`/datasets${$}`,{},D.mine?!0:"optional");return J.datasets=J.datasets.map(xf),J}async function _f(D){return u(`/datasets/resolve/${D}`,{},"optional")}async function ff(D,F={}){let $=new URLSearchParams({q:D});if(F.modality)$.set("modality",F.modality);if(F.limit)$.set("limit",String(F.limit));return u(`/datasets/search?${$.toString()}`,{},"optional")}async function uD(D){let F=await u(`/datasets/${D}`,{},"optional");return xf(F.dataset)}async function gf(D){return u(`/datasets/${D}/versions`,{},!0)}async function $Q(D){return u("/datasets",{method:"POST",body:JSON.stringify(D)},!0)}async function JQ(D){return u(`/datasets/${D}/finalize`,{method:"POST"},!0)}async function C8(D,F){return u(`/datasets/${D}/upload-credentials`,{method:"POST",body:JSON.stringify({duration_seconds:F})},!0)}async function QQ(D,F){return u(`/datasets/${D}/download-credentials`,{method:"POST",body:JSON.stringify({duration_seconds:F})},!0)}async function hf(D,F){return u(`/admin/datasets/${D}/doi/concept`,{method:"POST",body:JSON.stringify(F)},!0)}async function k9(D){return u(`/admin/datasets/${D}/doi`,{},!0)}async function TW(D,F){return u(`/admin/datasets/${D}/doi/update`,{method:"POST",body:JSON.stringify(F)},!0)}async function PW(D){return u(`/datasets/${D}/request-access`,{method:"POST"},!0)}async function bf(D,F){return u(`/datasets/${D}/invite`,{method:"POST",body:JSON.stringify({username:F})},!0)}async function uf(D){return u(`/datasets/${D}/collaborators`,{},!0)}async function mf(D){return u("/sandbox/complete",{method:"POST",body:JSON.stringify({dataset_id:D})},!0)}async function lf(){return u("/sandbox/reset",{method:"POST"},!0)}async function pf(){return u("/sandbox/status",{},!0)}async function YQ(D){return u(`/datasets/${D}/publish/request`,{method:"POST"},!0)}async function df(D){return u(`/datasets/${D}/publish/status`,{},!0)}async function cf(D){return u(`/datasets/${D}/publish/resend`,{method:"POST"},!0)}async function nf(D){let F=D?`?status=${D}`:"";return u(`/admin/publish/requests${F}`,{},!0)}async function af(D,F){return u(`/admin/publish/${D}/deny`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:F})},!0)}function oz0(D,F=[]){if(D){let $=I9.indexOf(D);if($>=0)return $+1}return Math.min(F.length+1,I9.length)}function sz0(D){if(!(D instanceof b))return!1;if(D.statusCode===0)return!0;if(D.statusCode===429)return!0;if(D.statusCode>=500&&D.statusCode<600)return!0;if(D.statusCode===403&&/repository has been locked/i.test(D.message))return!0;return!1}async function BQ(D,F=!1,$=!1,J=!1,Q,Y){let G,H,q=0,K=!1,V,E=F,Z=[],L;function A(M,N,w,P){if(!Y)return;Y({step:M,stepIndex:oz0(M,N),stepTotal:I9.length,s3LockLocked:w,s3LockTotal:P,s3LockResumed:M==="s3_lock"&&K?!0:void 0})}for(let M=1;M<=5;M++)try{let N,w=!0;do{if(N=await u(`/admin/publish/${D}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({resume:w?E:!0,sandbox:$,s3_lock_continuation_token:G,s3_lock_total:H,skip_ci_check:J})},!0),w=!1,N.step_results)Z.push(...N.step_results);if(N.s3_lock_total!==void 0)H=N.s3_lock_total;if(N.s3_lock_batch_count!==void 0)q+=N.s3_lock_batch_count;let P=N.step??N.step_results?.[N.step_results.length-1]?.step;if(P&&(P!==V||P==="s3_lock"))A(P,N.steps_completed??[],P==="s3_lock"?q:void 0,P==="s3_lock"?H:void 0),V=P;if(N.hasMore&&N.s3_lock_continuation_token!==void 0)G=N.s3_lock_continuation_token;else break}while(N.hasMore);if(Z.length>0)N.step_results=Af(Z);return N}catch(N){if(L=N,M===5||!sz0(N)){if(N instanceof b&&Z.length>0)N.stepResults=Af(Z);throw N}let P=N;if(Q?.({attempt:M,maxAttempts:5,delayMs:1e4,step:P.step,error:P.message}),await new Promise((C)=>setTimeout(C,1e4)),E=!0,G!==void 0)K=!0}throw L}function Af(D){let F=new Map;for(let $ of D)F.set($.step,$);return Array.from(F.values())}async function of(D,F){return u(`/admin/datasets/${D}/enrichment`,{method:"POST",body:JSON.stringify(F)},!0)}async function sf(D){return u(`/admin/datasets/${D}/files`,{},!0)}async function rf(D){let F,$=0,J=[],Q=!0;while(Q){let Y=await u(`/admin/datasets/${D}/s3-lock`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({continuation_token:F})},!0);if($+=Y.locked,Y.failed?.length)J.push(...Y.failed);if(Q=Y.hasMore,F=Y.continuation_token,Q&&!F)throw new b(500,"S3 lock paginated response missing continuation_token; aborting to avoid infinite loop")}return{locked:$,failed:J}}async function tf(D){return u(`/admin/datasets/${D}/reset`,{method:"POST"},!0)}async function ef(D,F=!1){return u(`/admin/datasets/${D}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({force:F})},!0)}async function Dg(D){return u("/admin/datasets/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataset_ids:D})},!0)}async function Fg(D){return u("/admin/datasets/import",{method:"POST",body:JSON.stringify(D)},!0)}async function $g(D){return u(`/admin/datasets/${D}/sync`,{method:"POST"},!0)}async function Jg(){return u("/admin/sync/status",{},!0)}async function Qg(D,F){return u(`/admin/datasets/${D}/reindex`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F??{})},!0)}async function Yg(D,F){return u("/admin/datasets/reindex/bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filter:D,...F??{}})},!0)}async function Bg(){return u("/admin/email-preferences",{},!0)}async function Xg(D){return u("/admin/email-preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)},!0)}async function Gg(){return u("/notices",{},"optional")}async function Wg(){return u("/admin/notices",{},!0)}async function Hg(D){return u("/admin/notices",{method:"POST",body:JSON.stringify(D)},!0)}async function qg(D){return u(`/admin/notices/${D}`,{method:"DELETE"},!0)}async function IW(D){return u("/admin/notify",{method:"POST",body:JSON.stringify(D)},!0)}var CW="https://nemar-api-dev.sccn-org.workers.dev",rJ,b,tJ,OW,I9;var i8=I(()=>{x4();RW();sJ();rJ=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/;b=class b extends Error{statusCode;details;step;constructor(D,F,$,J){super(F);this.statusCode=D;this.details=$;this.step=J;this.name="ApiError"}};tJ=class tJ extends b{mode;eta;constructor(D,F,$,J){super(503,F,J);this.mode=D;this.eta=$;this.name="MaintenanceError"}};OW=CW.includes("workers.dev");I9=["ci_check","enrichment_check","repo_public","s3_public_read","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","generate_archive","sync_nemar","notify_user"]});function zg(D){SW=D}function kW(){return SW}function v9(D){if(SW)process.stderr.write(`${D}
|
|
98
|
+
`)}var Vf=!1;var RW=I(()=>{xD()});var Uf;var Zf=I(()=>{Uf={name:"nemar-cli",version:"0.8.14-dev.836",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit",prepublishOnly:"bun run build","docs:generate":"bun run scripts/generate-docs.ts","docs:serve":"mkdocs serve","docs:build":"mkdocs build",prepare:"husky",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://nemar-cli.pages.dev",engines:{bun:">=1.0.0"},files:["dist","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1","fuse.js":"^7.1.0",inquirer:"^9.2.15",ora:"^8.0.1",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},devDependencies:{"@biomejs/biome":"1.9.4","@types/bcryptjs":"^3.0.0","@types/bun":"latest","@types/inquirer":"^9.0.7",bcryptjs:"^3.0.3",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var _4;var sJ=I(()=>{Zf();_4=Uf.version});function w0(D){if(D instanceof Error)return D.message;return String(D)}function Lf(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(OW)return CW;return JD().apiUrl||CW}async function u(D,F={},$=!1){let J=`${Lf()}${D}`,Q={"Content-Type":"application/json","X-CLI-Version":_4,...F.headers};if($){let X=JD();if(!X.apiKey&&$===!0)throw new b(401,"Not authenticated. Run 'nemar auth login' first.");if(X.apiKey)Q.Authorization=`Bearer ${X.apiKey}`}let Y;try{Y=await fetch(J,{...F,headers:Q})}catch(X){throw new b(0,`Network error: Could not connect to ${Lf()}`,{originalError:X instanceof Error?X.message:String(X)})}let B;try{B=await Y.json()}catch{throw new b(Y.status,`Invalid response from server (status ${Y.status})`)}if(!Y.ok){if(Y.status===503&&(B.mode==="read-only"||B.mode==="full")){let X=typeof B.message==="string"?B.message:"NEMAR is in maintenance mode. Please retry shortly.",G=typeof B.eta==="string"?B.eta:null,H=new tJ(B.mode,X,G,B.details);throw oJ(H),H}throw new b(Y.status,B.error||B.message||"Request failed",B.details,typeof B.step==="string"?B.step:void 0)}return B}async function Mf(D){return u(`/auth/check-username?username=${encodeURIComponent(D)}`)}async function Nf(D){return u(`/auth/check-github?username=${encodeURIComponent(D)}`)}async function Rf(D){return u("/auth/signup",{method:"POST",body:JSON.stringify(D)})}async function Cf(D){return u("/auth/login",{method:"POST",body:JSON.stringify({api_key:D})})}async function Of(D){return u("/auth/resend-verification",{method:"POST",body:JSON.stringify({email:D})})}async function wf(D,F){return u("/auth/retrieve-key",{method:"POST",body:JSON.stringify({email:D,password:F})})}async function jf(D){return u("/auth/request-key-regeneration",{method:"POST",body:JSON.stringify({email:D})})}async function eJ(){return u("/users/me",{},!0)}async function Tf(D,F){let $=new URLSearchParams;if(D)$.set("status",D);if(F)$.set("role",F);let J=$.toString()?`?${$.toString()}`:"";return u(`/admin/users${J}`,{},!0)}async function Pf(D){return u(`/admin/approve/${D}`,{method:"POST"},!0)}async function If(D){return u(`/admin/revoke/${D}`,{method:"POST"},!0)}async function Sf(D,F){return u(`/admin/users/${D}/role`,{method:"POST",body:JSON.stringify({role:F})},!0)}async function wW(D,F){return u(`/admin/datasets/${D}/visibility`,{method:"PATCH",body:JSON.stringify({visibility:F})},!0)}async function kf(D){return u(`/datasets/${D}/publish`,{method:"POST"},!0)}async function vf(D){return u(`/admin/datasets/${D}/ci`,{},!0)}async function f4(D,F){let $=F?.validate===!1?"?validate=false":"";return u(`/admin/datasets/${D}/ci${$}`,{method:"POST"},!0)}async function jW(D){return u(`/admin/datasets/${D}/ci/sync`,{method:"POST"},!0)}async function DQ(D){return u(`/datasets/${D}/ci/status`,{},!0)}async function yf(D){return u(`/datasets/${D}/manifest`,{},!0)}async function FQ(D,F){return u(`/datasets/${D}/manifest/${F}`,{},!0)}function xf(D){let F=D;if(!F.status)F.status="active";else if(!["active","archived","deleted"].includes(F.status))throw Error(`Invalid dataset status: ${F.status}`);if(!F.visibility)F.visibility="private";else if(!["public","private"].includes(F.visibility))throw Error(`Invalid dataset visibility: ${F.visibility}`);return F}async function S9(D={}){let F=new URLSearchParams;if(D.mine)F.set("mine","true");if(D.search)F.set("search",D.search);if(D.modality)F.set("modality",D.modality);if(D.author)F.set("author",D.author);if(D.task)F.set("task",D.task);if(D.hasDoi)F.set("has_doi","true");if(D.recent)F.set("recent",String(D.recent));if(D.sort)F.set("sort",D.sort);if(D.limit!=null)F.set("limit",String(D.limit));if(D.offset!=null)F.set("offset",String(D.offset));if(D.owner)F.set("owner",D.owner);let $=F.toString()?`?${F.toString()}`:"",J=await u(`/datasets${$}`,{},D.mine?!0:"optional");return J.datasets=J.datasets.map(xf),J}async function _f(D){return u(`/datasets/resolve/${D}`,{},"optional")}async function ff(D,F={}){let $=new URLSearchParams({q:D});if(F.modality)$.set("modality",F.modality);if(F.limit)$.set("limit",String(F.limit));return u(`/datasets/search?${$.toString()}`,{},"optional")}async function uD(D){let F=await u(`/datasets/${D}`,{},"optional");return xf(F.dataset)}async function gf(D){return u(`/datasets/${D}/versions`,{},!0)}async function $Q(D){return u("/datasets",{method:"POST",body:JSON.stringify(D)},!0)}async function JQ(D){return u(`/datasets/${D}/finalize`,{method:"POST"},!0)}async function C8(D,F){return u(`/datasets/${D}/upload-credentials`,{method:"POST",body:JSON.stringify({duration_seconds:F})},!0)}async function QQ(D,F){return u(`/datasets/${D}/download-credentials`,{method:"POST",body:JSON.stringify({duration_seconds:F})},!0)}async function hf(D,F){return u(`/admin/datasets/${D}/doi/concept`,{method:"POST",body:JSON.stringify(F)},!0)}async function k9(D){return u(`/admin/datasets/${D}/doi`,{},!0)}async function TW(D,F){return u(`/admin/datasets/${D}/doi/update`,{method:"POST",body:JSON.stringify(F)},!0)}async function PW(D){return u(`/datasets/${D}/request-access`,{method:"POST"},!0)}async function bf(D,F){return u(`/datasets/${D}/invite`,{method:"POST",body:JSON.stringify({username:F})},!0)}async function uf(D){return u(`/datasets/${D}/collaborators`,{},!0)}async function mf(D){return u("/sandbox/complete",{method:"POST",body:JSON.stringify({dataset_id:D})},!0)}async function lf(){return u("/sandbox/reset",{method:"POST"},!0)}async function pf(){return u("/sandbox/status",{},!0)}async function YQ(D){return u(`/datasets/${D}/publish/request`,{method:"POST"},!0)}async function df(D){return u(`/datasets/${D}/publish/status`,{},!0)}async function cf(D){return u(`/datasets/${D}/publish/resend`,{method:"POST"},!0)}async function nf(D){let F=D?`?status=${D}`:"";return u(`/admin/publish/requests${F}`,{},!0)}async function af(D,F){return u(`/admin/publish/${D}/deny`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:F})},!0)}function oz0(D,F=[]){if(D){let $=I9.indexOf(D);if($>=0)return $+1}return Math.min(F.length+1,I9.length)}function sz0(D){if(!(D instanceof b))return!1;if(D.statusCode===0)return!0;if(D.statusCode===429)return!0;if(D.statusCode>=500&&D.statusCode<600)return!0;if(D.statusCode===403&&/repository has been locked/i.test(D.message))return!0;return!1}async function BQ(D,F=!1,$=!1,J=!1,Q,Y){let G,H,q=0,K=!1,V,E=F,Z=[],L;function A(M,N,w,P){if(!Y)return;Y({step:M,stepIndex:oz0(M,N),stepTotal:I9.length,s3LockLocked:w,s3LockTotal:P,s3LockResumed:M==="s3_lock"&&K?!0:void 0})}for(let M=1;M<=5;M++)try{let N,w=!0;do{if(N=await u(`/admin/publish/${D}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({resume:w?E:!0,sandbox:$,s3_lock_continuation_token:G,s3_lock_total:H,skip_ci_check:J})},!0),w=!1,N.step_results)Z.push(...N.step_results);if(N.s3_lock_total!==void 0)H=N.s3_lock_total;if(N.s3_lock_batch_count!==void 0)q+=N.s3_lock_batch_count;let P=N.step??N.step_results?.[N.step_results.length-1]?.step;if(P&&(P!==V||P==="s3_lock"))A(P,N.steps_completed??[],P==="s3_lock"?q:void 0,P==="s3_lock"?H:void 0),V=P;if(N.hasMore&&N.s3_lock_continuation_token!==void 0)G=N.s3_lock_continuation_token;else break}while(N.hasMore);if(Z.length>0)N.step_results=Af(Z);return N}catch(N){if(L=N,M===5||!sz0(N)){if(N instanceof b&&Z.length>0)N.stepResults=Af(Z);throw N}let P=N;if(Q?.({attempt:M,maxAttempts:5,delayMs:1e4,step:P.step,error:P.message}),await new Promise((C)=>setTimeout(C,1e4)),E=!0,G!==void 0)K=!0}throw L}function Af(D){let F=new Map;for(let $ of D)F.set($.step,$);return Array.from(F.values())}async function of(D,F){return u(`/admin/datasets/${D}/enrichment`,{method:"POST",body:JSON.stringify(F)},!0)}async function sf(D){return u(`/admin/datasets/${D}/files`,{},!0)}async function rf(D){let F,$=0,J=[],Q=!0;while(Q){let Y=await u(`/admin/datasets/${D}/s3-lock`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({continuation_token:F})},!0);if($+=Y.locked,Y.failed?.length)J.push(...Y.failed);if(Q=Y.hasMore,F=Y.continuation_token,Q&&!F)throw new b(500,"S3 lock paginated response missing continuation_token; aborting to avoid infinite loop")}return{locked:$,failed:J}}async function tf(D){return u(`/admin/datasets/${D}/reset`,{method:"POST"},!0)}async function ef(D,F=!1){return u(`/admin/datasets/${D}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({force:F})},!0)}async function Dg(D){return u("/admin/datasets/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataset_ids:D})},!0)}async function Fg(D){return u("/admin/datasets/import",{method:"POST",body:JSON.stringify(D)},!0)}async function $g(D){return u(`/admin/datasets/${D}/sync`,{method:"POST"},!0)}async function Jg(){return u("/admin/sync/status",{},!0)}async function Qg(D,F){return u(`/admin/datasets/${D}/reindex`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F??{})},!0)}async function Yg(D,F){return u("/admin/datasets/reindex/bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filter:D,...F??{}})},!0)}async function Bg(){return u("/admin/email-preferences",{},!0)}async function Xg(D){return u("/admin/email-preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)},!0)}async function Gg(){return u("/notices",{},"optional")}async function Wg(){return u("/admin/notices",{},!0)}async function Hg(D){return u("/admin/notices",{method:"POST",body:JSON.stringify(D)},!0)}async function qg(D){return u(`/admin/notices/${D}`,{method:"DELETE"},!0)}async function IW(D){return u("/admin/notify",{method:"POST",body:JSON.stringify(D)},!0)}var CW="https://nemar-api-dev.sccn-org.workers.dev",rJ,b,tJ,OW,I9;var i8=I(()=>{x4();RW();sJ();rJ=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/;b=class b extends Error{statusCode;details;step;constructor(D,F,$,J){super(F);this.statusCode=D;this.details=$;this.step=J;this.name="ApiError"}};tJ=class tJ extends b{mode;eta;constructor(D,F,$,J){super(503,F,J);this.mode=D;this.eta=$;this.name="MaintenanceError"}};OW=CW.includes("workers.dev");I9=["ci_check","enrichment_check","repo_public","s3_public_read","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","generate_archive","sync_nemar","notify_user"]});function zg(D){SW=D}function kW(){return SW}function v9(D){if(SW)process.stderr.write(`${D}
|
|
99
99
|
`)}var SW=!1;function XD(D){if(D===0)return"0 B";let F=["B","KB","MB","GB","TB"],$=Math.min(Math.floor(Math.log(D)/Math.log(1024)),F.length-1);return`${(D/1024**$).toFixed($===0?0:1)} ${F[$]}`}function Eg(D){return`${XD(D)}/s`}function rz0(D){if(D<60)return`${Math.round(D)}s`;if(D<3600)return`${Math.floor(D/60)}m ${Math.round(D%60)}s`;return`${Math.floor(D/3600)}h ${Math.floor(D%3600/60)}m`}function tz0(D,F=20){let $=Math.round(D/100*F),J=F-$;return`[${"=".repeat($)}${" ".repeat(J)}]`}class XQ{filesCompleted=0;filesTotal;bytesTotal=0;inFlight=new Map;currentFile="";startTime;lastUpdateTime;lastBytesTransferred=0;totalBytesTransferred=0;speedSamples=[];lastRenderedLine="";constructor(D=0,F=0){this.filesTotal=D,this.bytesTotal=F,this.startTime=Date.now(),this.lastUpdateTime=this.startTime}inFlightBytes(){let D=0;for(let F of this.inFlight.values())D+=F.transferred;return D}processLine(D){let F=D.file??D.action?.file;if(D.ok===!0||D.success===!0){this.filesCompleted++;let $=F??this.currentFile,J=$?this.inFlight.get($):void 0,Q=J?J.total||J.transferred:0;if(this.totalBytesTransferred+=Q,$)this.inFlight.delete($);this.render();return}if(D["byte-progress"]!==void 0){let $=F??this.currentFile;if(!$)return;this.currentFile=$;let J=this.inFlight.get($)??{transferred:0,total:0};if(J.transferred=D["byte-progress"]??J.transferred,D["total-size"]!==void 0)J.total=D["total-size"];this.inFlight.set($,J);let Q=Date.now(),Y=(Q-this.lastUpdateTime)/1000;if(Y>0.5){let B=this.totalBytesTransferred+this.inFlightBytes(),G=(B-this.lastBytesTransferred)/Y;if(G>0){if(this.speedSamples.push(G),this.speedSamples.length>5)this.speedSamples.shift()}this.lastBytesTransferred=B,this.lastUpdateTime=Q}this.render()}}incrementFilesCompleted(){this.filesCompleted++}setFilesTotal(D){this.filesTotal=D}setBytesTotal(D){this.bytesTotal=D}getPercent(){let D=this.totalBytesTransferred+this.inFlightBytes();if(this.bytesTotal>0)return Math.min(100,Math.round(D/this.bytesTotal*100));if(this.filesTotal>0)return Math.min(100,Math.round(this.filesCompleted/this.filesTotal*100));return null}getProgress(){return{filesCompleted:this.filesCompleted,filesTotal:this.filesTotal,bytesTransferred:this.totalBytesTransferred+this.inFlightBytes(),bytesTotal:this.bytesTotal,currentFile:this.currentFile||void 0}}render(){let D=this.speedSamples.length>0?this.speedSamples.reduce((B,X)=>B+X,0)/this.speedSamples.length:0,F=this.totalBytesTransferred+this.inFlightBytes(),$=0,J=!1;if(this.bytesTotal>0)$=Math.min(100,Math.round(F/this.bytesTotal*100)),J=!0;else if(this.filesTotal>0)$=Math.min(100,Math.round(this.filesCompleted/this.filesTotal*100)),J=!0;let Q=this.filesTotal>0?`${this.filesCompleted}/${this.filesTotal} files`:`${this.filesCompleted} files`,Y;if(J)Y=`${tz0($)} ${$}% ${Q}`;else Y=Q;if(F>0){let B=this.bytesTotal>0?`${XD(F)}/${XD(this.bytesTotal)}`:XD(F);Y+=` | ${B}`}if(D>0)Y+=` | ${Eg(D)}`;if(D>0){let B=0;if(this.bytesTotal>0)B=Math.max(0,this.bytesTotal-F);else for(let X of this.inFlight.values())if(X.total>X.transferred)B+=X.total-X.transferred;if(B>0){let X=B/D;if(X>0)Y+=` | ETA ${rz0(X)}`}}if(Y!==this.lastRenderedLine)process.stderr.write(`\r${W.cyan(Y)}${" ".repeat(10)}`),this.lastRenderedLine=Y}finish(D){let F=(Date.now()-this.startTime)/1000;if(process.stderr.write(`\r${" ".repeat(this.lastRenderedLine.length+15)}\r`),D>0){let $=F>0?`${Eg(this.totalBytesTransferred/F)}`:"",J=[`${D} file${D!==1?"s":""} downloaded`,this.totalBytesTransferred>0?XD(this.totalBytesTransferred):"",$].filter(Boolean).join(" | ");process.stderr.write(`${W.green(J)}
|
|
100
100
|
`)}}}var vW=I(()=>{xD()});var Tg={};c4(Tg,{verifyGitHubAuth:()=>x9,toS3Credentials:()=>RD,switchBranch:()=>GE0,setKeyPresent:()=>jg,selectAnnexS3Remote:()=>uW,saveDataset:()=>o8,runCommand:()=>S,resolveUpstreamRef:()=>aW,readRemoteHeadDatasetVersion:()=>iW,readLocalDatasetVersion:()=>nW,pushToGitHub:()=>o1,pushBranch:()=>PF,markInheritedOpenNeuroRemotesIgnored:()=>bW,listDatasetVersions:()=>lW,isWorkingTreeDirty:()=>oW,isGitAnnexDataset:()=>w1,isDataladDataset:()=>zE0,initOrEnableSpecialRemote:()=>Cg,initDataset:()=>n6,gitMergeFastForward:()=>rW,gitFetchOrigin:()=>sW,gitAnnexAdd:()=>i6,getVersionCommit:()=>pW,getRemoteUuid:()=>FH,getLocalDatasetInfo:()=>mW,getKeyHashDirs:()=>qE0,getKeyHashDir:()=>wg,getDatasetStats:()=>YE0,getDatasetIdFromRemote:()=>r8,getDatasetData:()=>HQ,getCurrentBranch:()=>s8,getAnnexWhereisAll:()=>DH,getAnnexS3Remotes:()=>f9,formatBytes:()=>XD,ensureLocalMainBranch:()=>g9,ensureGitAnnexInitialized:()=>gW,enableS3Remote:()=>h4,dropUnusedAnnexObjects:()=>tW,dropFiles:()=>hW,createRevertBranch:()=>dW,createDataladDataset:()=>KE0,countPendingDownload:()=>WQ,copyToAnnexRemote:()=>w8,configureS3Remote:()=>O8,configureLargefiles:()=>g4,configureGitHubRemote:()=>a8,commitRevert:()=>cW,collectFileManifest:()=>eW,cloneDataset:()=>s1,clearAnnexCredentials:()=>kD,checkPrerequisites:()=>y9,checkGitHubSSH:()=>Ag,checkGitAnnexInstalled:()=>fW,checkDownloadPrerequisites:()=>TF,checkAWSCredentials:()=>$E0,batchSetKeysPresent:()=>$H,annexRemoteExists:()=>Rg,acceptGitHubInvitation:()=>_9,NEMAR_S3_REMOTE_NAME:()=>GQ,ANNEX_REMOTE_EXISTS_RE:()=>Ng});import{existsSync as xW,readFileSync as ez0,statSync as DE0}from"fs";import{join as _W}from"path";var{spawn:Lg}=globalThis.Bun;async function S(D,F={}){let $=Lg({cmd:D,cwd:F.cwd,stdout:"pipe",stderr:"pipe",env:{...process.env,GIT_TERMINAL_PROMPT:"0",...F.env}}),J=!1,Q;if(F.timeout)Q=setTimeout(()=>{J=!0,$.kill()},F.timeout);if(kW()){let G=F.cwd?` (cwd=${F.cwd})`:"";v9(W.dim(`$ ${D.join(" ")}${G}`))}let Y=await new Response($.stdout).text(),B=await new Response($.stderr).text(),X=await $.exited;if(Q)clearTimeout(Q);if(kW()){if(Y.trim())v9(W.dim(Y.trimEnd()));if(B.trim())v9(W.yellow(B.trimEnd()));v9(W.dim(`(exit ${X})`))}if(J)return{stdout:Y,stderr:B||`Command timed out after ${Math.round(F.timeout/1000)}s`,exitCode:X??1};return{stdout:Y,stderr:B,exitCode:X}}function Vg(D){return D.split(".").map((F)=>{let $=Number.parseInt(F.replace(/[^0-9]/g,""),10);return Number.isNaN($)?0:$})}function FE0(D,F){let $=Vg(D),J=Vg(F);for(let Q=0;Q<Math.max($.length,J.length);Q++){let Y=$[Q]||0,B=J[Q]||0;if(Y>B)return!0;if(Y<B)return!1}return!0}async function fW(){try{let{stdout:F,exitCode:$,stderr:J}=await S(["git-annex","version"]);if($!==0)return console.warn("git-annex version returned non-zero exit code:",$),console.warn("stderr:",J),{installed:!1,minVersion:"10.0",error:`Version check failed: ${J.trim()}`};let Q=F.match(/version:\s*(\d+\.\d+)/),Y=Q?Q[1]:void 0;if(!Y)console.warn("Could not parse git-annex version from output:",F);return{installed:!0,version:Y,minVersion:"10.0",compatible:Y?FE0(Y,"10.0"):void 0}}catch(F){let $=F instanceof Error?F.message:String(F);if($.includes("ENOENT")||$.includes("not found"))return console.info("git-annex not found in PATH"),{installed:!1,minVersion:"10.0"};return console.error("Error checking git-annex installation:",$),{installed:!1,minVersion:"10.0",error:$}}}async function Ag(){if(process.env.GH_TOKEN)return{accessible:!0,username:"token-auth",useHttps:!0};try{let{stdout:D,stderr:F}=await S(["ssh","-T","-o","BatchMode=yes","-o","StrictHostKeyChecking=accept-new","-o","ConnectTimeout=10","git@github.com"]),$=D+F,J=$.match(/Hi ([^!]+)!/);if(J)return{accessible:!0,username:J[1]};if($.includes("Permission denied"))return{accessible:!1};return{accessible:$.includes("successfully authenticated")}}catch(D){let F=D instanceof Error?D.message:String(D);if(F.includes("ENOENT")||F.includes("not found"))console.info("SSH command not found");else console.error("Error checking GitHub SSH access:",F);return{accessible:!1}}}async function $E0(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY)return{configured:!0,source:"environment"};try{let{stdout:D,exitCode:F}=await S(["aws","configure","get","aws_access_key_id"]);if(F===0&&D.trim())return{configured:!0,source:"aws-cli"}}catch(D){let F=D instanceof Error?D.message:String(D);if(F.includes("ENOENT")||F.includes("not found"))console.info("AWS CLI not found in PATH");else console.error("Error checking AWS credentials:",F)}return{configured:!1}}function Mg(){let D=process.platform;if(D==="darwin")return"brew install git-annex";if(D==="linux")return"apt install git-annex (Debian/Ubuntu)";return"See https://git-annex.branchable.com/install/"}async function y9(){let[D,F]=await Promise.all([fW(),Ag()]),$=[];if(!D.installed)$.push(`git-annex is not installed. Install: ${Mg()}`);else if(D.compatible===!1)$.push(`git-annex version ${D.version} is too old. Required: >= ${D.minVersion}`);if(!F.accessible){if(!(await Og()).token)$.push("GitHub authentication not configured. Run 'gh auth login' to authenticate.")}return{gitAnnex:D,githubSSH:F,allPassed:$.length===0,errors:$}}async function w1(D){if(!xW(_W(D,".git")))return!1;try{let{exitCode:F}=await S(["git","annex","info"],{cwd:D});return F===0}catch(F){let $=F instanceof Error?F.message:String(F);if(!$.includes("ENOENT")&&!$.includes("not found"))console.error(`Error checking if ${D} is a git-annex dataset:`,$);return!1}}async function n6(D,F={}){if(!F.force&&await w1(D))return{success:!0};try{let $={};if(F.author)$.GIT_AUTHOR_NAME=F.author.name,$.GIT_AUTHOR_EMAIL=F.author.email,$.GIT_COMMITTER_NAME=F.author.name,$.GIT_COMMITTER_EMAIL=F.author.email;let{stderr:J,exitCode:Q}=await S(["git","init","-b","main",D],{...Object.keys($).length>0?{env:$}:{}});if(Q!==0)return{success:!1,error:J.trim()||"Failed to initialize git repository"};let Y=Object.keys($).length>0?{env:$}:{},{stderr:B,exitCode:X}=await S(["git","annex","init"],{cwd:D,...Y});if(X!==0)return{success:!1,error:B.trim()||"Failed to initialize git-annex"};let{stderr:G,exitCode:H}=await S(["git","commit","--allow-empty","-m","Initialize dataset"],{cwd:D,...Y});if(H!==0)return{success:!1,error:G.trim()||"Failed to create initial commit"};let{stderr:q,exitCode:K}=await S(["git","annex","adjust","--unlock"],{cwd:D,...Y});if(K!==0)return{success:!1,error:q.trim()||"Failed to switch to unlocked mode"};return{success:!0}}catch($){return{success:!1,error:$.message}}}async function gW(D){try{let{exitCode:F,stderr:$}=await S(["git","annex","info"],{cwd:D});if(F===0)return{success:!0};if($.includes("First run: git-annex init")){let{stderr:J,exitCode:Q}=await S(["git","annex","init"],{cwd:D});if(Q!==0)return{success:!1,error:J.trim()||"Failed to initialize git-annex"};return{success:!0}}return{success:!1,error:$.trim()||"Failed to check git-annex status"}}catch(F){return{success:!1,error:F.message}}}async function g4(D,F){let $=["*.edf","*.bdf","*.set","*.fif","*.vhdr","*.eeg","*.cnt","*.fdt"],J=["*.tsv","*.json","*.md","*.txt","*.yml","*.yaml","README*","LICENSE*","CHANGES*",".bidsignore",".gitignore"],Q=$.map((G)=>`include=${G}`).join(" or "),Y=J.map((G)=>`exclude=${G}`).join(" and "),B=`(${Q} or largerthan=100kb) and ${Y}`,X=F||B;try{let{stderr:G,exitCode:H}=await S(["git","annex","config","--set","annex.largefiles",X],{cwd:D});if(H!==0)return{success:!1,error:G.trim()||"Failed to configure largefiles"};return{success:!0}}catch(G){return{success:!1,error:G.message}}}async function i6(D,F="."){try{let{stderr:$,exitCode:J}=await S(["git","annex","add",F],{cwd:D});if(J!==0)return{success:!1,error:$.trim()||"Failed to add files to git-annex"};return{success:!0}}catch($){return{success:!1,error:$.message}}}function RD(D){return{accessKeyId:D.access_key_id,secretAccessKey:D.secret_access_key,sessionToken:D.session_token}}function yW(D){let F=[/^\(merging .* into .*\.\.\.\)$/,/^\(recording state in git\.\.\.\)$/,/^\(scanning for /,/^\(checking /];return D.split(`
|
|
101
101
|
`).filter(($)=>{let J=$.trim();if(!J)return!1;if(J.includes("setting annex-ignore"))return!1;if(F.some((Q)=>Q.test(J)))return!1;return!0}).join(`
|
|
@@ -744,7 +744,7 @@ Status Flow:
|
|
|
744
744
|
Examples:
|
|
745
745
|
$ nemar dataset publish request nm000104
|
|
746
746
|
$ nemar dataset publish status nm000104 # Check request status`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=O(`Requesting publication for ${D}...`).start();try{let $=await YQ(D);F.succeed($.message),console.log(W.dim(`
|
|
747
|
-
Admins have been notified. Use 'nemar dataset publish status' to check progress.`))}catch($){if($ instanceof b){if(F.fail($.message),console.log(W.dim(` ${$.message}`)),$.statusCode===409)console.log(W.dim(" Use 'nemar dataset publish resend' to remind admins."));else if($.statusCode===403)console.log(W.dim(" Only the dataset owner can request publication."))}else{F.fail("Failed to request publication");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}}});CQ.command("status").description("Check publication status of a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
|
|
747
|
+
Admins have been notified. Use 'nemar dataset publish status' to check progress.`))}catch($){if($ instanceof b){if(F.fail($.message),console.log(W.dim(` ${$.message}`)),$.statusCode===409)console.log(W.dim(" Use 'nemar dataset publish resend' to remind admins."));else if($.statusCode===403)console.log(W.dim(" Only the dataset owner can request publication."))}else{F.fail("Failed to request publication");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}process.exit(1)}});CQ.command("status").description("Check publication status of a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
|
|
748
748
|
Description:
|
|
749
749
|
Check the status of your publication request and see progress through
|
|
750
750
|
the approval workflow.
|
|
@@ -776,7 +776,7 @@ Examples:
|
|
|
776
776
|
${W.cyan("Publication Status:")} ${D}
|
|
777
777
|
`);let Q={published:W.green,denied:W.red,approving:W.yellow}[$.status]||W.dim;if(console.log(` Status: ${Q($.status)}`),$.requested_at)console.log(` Requested: ${W.dim($.requested_at)}`);if($.requested_by)console.log(` Requested by: ${W.dim($.requested_by)}`);if($.status==="denied"&&$.denied_reason)console.log(`
|
|
778
778
|
${W.red("Reason:")} ${$.denied_reason}`);if($.status==="approving"){let Y=I9,B=$.steps_completed||[],X=Y.length;console.log(`
|
|
779
|
-
Steps:`),Y.forEach((G,H)=>{let q=B.includes(G),K=$.current_step===G,V=q?W.green("[x]"):K?W.yellow("[>]"):W.dim("[ ]"),E=G.replace(/_/g," "),Z=`[${String(H+1).padStart(2," ")}/${X}]`;console.log(` ${V} ${W.dim(Z)} ${E}${K&&$.last_error?W.red(` (error: ${$.last_error})`):""}`)})}if($.status==="published"&&$.approved_at)console.log(` Published: ${W.dim($.approved_at)}`);console.log()}catch($){if($ instanceof b)F.fail($.message),console.log(W.dim(` ${$.message}`));else{F.fail("Failed to check publication status");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}}});CQ.command("resend").description("Resend publication request notification to admins").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
|
|
779
|
+
Steps:`),Y.forEach((G,H)=>{let q=B.includes(G),K=$.current_step===G,V=q?W.green("[x]"):K?W.yellow("[>]"):W.dim("[ ]"),E=G.replace(/_/g," "),Z=`[${String(H+1).padStart(2," ")}/${X}]`;console.log(` ${V} ${W.dim(Z)} ${E}${K&&$.last_error?W.red(` (error: ${$.last_error})`):""}`)})}if($.status==="published"&&$.approved_at)console.log(` Published: ${W.dim($.approved_at)}`);console.log()}catch($){if($ instanceof b)F.fail($.message),console.log(W.dim(` ${$.message}`));else{F.fail("Failed to check publication status");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}process.exit(1)}});CQ.command("resend").description("Resend publication request notification to admins").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
|
|
780
780
|
Description:
|
|
781
781
|
Resend the publication request notification email to all NEMAR admins.
|
|
782
782
|
Use this if admins haven't responded to your original request.
|
|
@@ -790,7 +790,7 @@ When to Use:
|
|
|
790
790
|
- Your request status is still "requested"
|
|
791
791
|
|
|
792
792
|
Examples:
|
|
793
|
-
$ nemar dataset publish resend nm000104`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=O(`Resending notification for ${D}...`).start();try{let $=await cf(D);F.succeed($.message)}catch($){if($ instanceof b){if(F.fail($.message),console.log(W.dim(` ${$.message}`)),$.statusCode===404)console.log(W.dim(" Publication request not found for this dataset."))}else{F.fail("Failed to resend notification");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}}});FD.addCommand(CQ);FD.command("clone").description("Clone a dataset from NEMAR").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("-o, --output <path>","Output directory (default: ./<dataset-id>)").addHelpText("after",`
|
|
793
|
+
$ nemar dataset publish resend nm000104`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=O(`Resending notification for ${D}...`).start();try{let $=await cf(D);F.succeed($.message)}catch($){if($ instanceof b){if(F.fail($.message),console.log(W.dim(` ${$.message}`)),$.statusCode===404)console.log(W.dim(" Publication request not found for this dataset."))}else{F.fail("Failed to resend notification");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}process.exit(1)}});FD.addCommand(CQ);FD.command("clone").description("Clone a dataset from NEMAR").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("-o, --output <path>","Output directory (default: ./<dataset-id>)").addHelpText("after",`
|
|
794
794
|
Description:
|
|
795
795
|
Clone a NEMAR dataset repository with git-annex initialized.
|
|
796
796
|
Data files are not downloaded; use 'nemar dataset get' afterward.
|
package/package.json
CHANGED