stock-sdk 2.2.2 → 2.4.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/README.md +7 -2
- package/dist/{adapters-BiH4keVd.d.cts → adapters-CZUNRbxi.d.cts} +29 -1
- package/dist/{adapters-BiH4keVd.d.ts → adapters-CZUNRbxi.d.ts} +29 -1
- package/dist/cache.cjs +1 -1
- package/dist/cache.d.cts +35 -3
- package/dist/cache.d.ts +35 -3
- package/dist/cache.js +1 -1
- package/dist/chip-BbA23rr1.d.cts +113 -0
- package/dist/chip-BbA23rr1.d.ts +113 -0
- package/dist/chunk-46ECBWOQ.cjs +1 -0
- package/dist/chunk-4RN7AVFQ.js +1 -0
- package/dist/chunk-6FZNYDNN.cjs +1 -0
- package/dist/chunk-6MCPZDKN.cjs +1 -0
- package/dist/chunk-H5FDXQRK.js +1 -0
- package/dist/chunk-HKREKO2F.js +1 -0
- package/dist/chunk-LDYRNH4X.cjs +1 -0
- package/dist/chunk-OPCBE3NR.js +1 -0
- package/dist/chunk-R7M3BHS4.cjs +1 -0
- package/dist/chunk-SMCYQ6NL.js +1 -0
- package/dist/chunk-USZUOBM2.cjs +1 -0
- package/dist/chunk-VKXPLWPL.js +1 -0
- package/dist/chunk-W625VPPB.js +1 -0
- package/dist/chunk-WJOFTWZL.cjs +1 -0
- package/dist/cli.cjs +16 -16
- package/dist/cli.js +16 -16
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +24 -7
- package/dist/index.d.ts +24 -7
- package/dist/index.js +1 -1
- package/dist/indicators.cjs +1 -1
- package/dist/indicators.d.cts +1 -0
- package/dist/indicators.d.ts +1 -0
- package/dist/indicators.js +1 -1
- package/dist/mcp.cjs +83 -5
- package/dist/mcp.d.cts +29 -2
- package/dist/mcp.d.ts +29 -2
- package/dist/mcp.js +83 -5
- package/dist/screener.cjs +1 -1
- package/dist/screener.d.cts +51 -16
- package/dist/screener.d.ts +51 -16
- package/dist/screener.js +1 -1
- package/dist/{sdk-CmYFd7V2.d.ts → sdk-DGgSDZRx.d.ts} +200 -21
- package/dist/{sdk-BOfyUDzu.d.cts → sdk-RzQ-drS4.d.cts} +200 -21
- package/dist/signals.d.cts +3 -42
- package/dist/signals.d.ts +3 -42
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.d.cts +2 -2
- package/dist/symbols.d.ts +2 -2
- package/dist/symbols.js +1 -1
- package/dist/types-7n5rSHbd.d.cts +42 -0
- package/dist/types-7n5rSHbd.d.ts +42 -0
- package/package.json +2 -1
- package/dist/chunk-3VUFYFFD.js +0 -1
- package/dist/chunk-6ZSZEHZW.js +0 -1
- package/dist/chunk-C4CA7QBB.cjs +0 -1
- package/dist/chunk-DU7MCVLJ.js +0 -1
- package/dist/chunk-EDUJJOAJ.js +0 -1
- package/dist/chunk-F3KZXCVO.js +0 -1
- package/dist/chunk-JP3ZPNWP.cjs +0 -1
- package/dist/chunk-KKGWFS2M.cjs +0 -1
- package/dist/chunk-LCX5Q36O.js +0 -1
- package/dist/chunk-T5CH7H3X.cjs +0 -1
- package/dist/chunk-TVIEKKDQ.cjs +0 -1
- package/dist/chunk-USK6JHLG.cjs +0 -1
- package/dist/chunk-WCBK5KYA.cjs +0 -1
- package/dist/chunk-ZZ2IBUMV.js +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as
|
|
3
|
-
${n.hint}`:"";return{text:`stock-sdk: ${
|
|
2
|
+
import{a as T,b as D,c as $,d as q,e as K,f as L,g as U,h as x,i as F,k as V,l as C,m as g}from"./chunk-HKREKO2F.js";import{t as j}from"./chunk-H5FDXQRK.js";import"./chunk-W625VPPB.js";import{d as M,f as O,g as b,i as I}from"./chunk-4RN7AVFQ.js";import"./chunk-LAT6L2TO.js";import"./chunk-SMCYQ6NL.js";import{f as N,k as w}from"./chunk-UBIQBXQ7.js";import"./chunk-WOT6VMZA.js";var p=class extends Error{constructor(t,e){super(t),this.name="CliUsageError",this.hint=e}},bn={INVALID_ARGUMENT:2,INVALID_SYMBOL:2,NOT_FOUND:2,NETWORK_ERROR:3,TIMEOUT:3,ABORTED:3,UPSTREAM_ERROR:4,UPSTREAM_EMPTY:4,PARSE_ERROR:4,HTTP_ERROR:4,RATE_LIMITED:5,CIRCUIT_OPEN:5};function G(n){if(n instanceof p)return 2;let t=w(n);return bn[t]??1}function H(n,t){let e=n instanceof Error?n.message:String(n);if(n instanceof p){if(t==="json")return{text:JSON.stringify({error:{code:"USAGE",message:e}})};let r=n.hint?`
|
|
3
|
+
${n.hint}`:"";return{text:`stock-sdk: ${e}${r}`}}let o=w(n);return t==="json"?{text:JSON.stringify({error:{code:o,message:e}})}:{text:`stock-sdk: ${o}: ${e}`}}var Cn={start:"startDate",end:"endDate"},En=new Set(["format","f","pretty","quiet","q","help","h","version","V","timeout"]),An=new Set(["limit"]);function W(n){return En.has(n)||An.has(n)}function Pn(n,t){let e={},o=new Map;for(let r of n.options??[])o.set(r.flag,r);for(let[r,s]of Object.entries(t)){if(W(r))continue;let c=o.get(r);if(!c){if(s===!0)continue;e[Cn[r]??r]=s;continue}e[c.field??c.flag]=vn(c,s)}for(let r of n.options??[]){let s=r.field??r.flag;e[s]===void 0&&r.default!==void 0&&(e[s]=r.default)}return e}function vn(n,t){switch(n.type){case"boolean":return t===!0||t==="true";case"number":return Number(S(t));case"number[]":return E(t);case"enum":case"string":{let e=S(t),o=typeof e=="boolean"?e:String(e);if(n.upper&&typeof o=="string"&&(o=o.toUpperCase()),n.type==="enum"&&n.enum&&typeof o=="string"&&!n.enum.includes(o))throw new p(`--${n.flag} \u975E\u6CD5\u503C\u300C${o}\u300D`,`\u53EF\u9009: ${n.enum.join(" / ")}`);return n.map&&typeof o=="string"&&o in n.map&&(o=n.map[o]),o}default:return t}}function S(n){return Array.isArray(n)?n[n.length-1]:n}function E(n){return(Array.isArray(n)?n.join(","):String(n)).split(",").map(e=>e.trim()).filter(e=>e.length>0).map(e=>Number(e)).filter(e=>Number.isInteger(e)&&e>0)}function J(n,t){let e=n.positional??[],o=[],r=0;for(let s of e){if(s.variadic){let d=t.slice(r);if(s.required&&d.length===0)throw new p(`\u7F3A\u5C11\u53C2\u6570 <${s.name}>`);for(let i of d)o.push(z(s,i));return o}let c=t[r];if(c===void 0){if(s.required)throw new p(`\u7F3A\u5C11\u53C2\u6570 <${s.name}>`);o.push(void 0)}else o.push(z(s,c));r++}return o}function z(n,t){let e=t;if(n.upper&&(e=e.toUpperCase()),n.enum&&!n.enum.includes(e))throw new p(`<${n.name}> \u975E\u6CD5\u503C\u300C${t}\u300D`,`\u53EF\u9009: ${n.enum.join(" / ")}`);return e}function m(n,t,e){let o=T(n,t);if(!o)throw new p(`\u672A\u77E5\u547D\u4EE4: ${t.join(" ")}`);return Promise.resolve(o.fn.apply(o.parent,e))}function _n(n,t){let e=new Map;for(let r of n.options??[])e.set(r.flag,r);let o=e.size>0;for(let[r,s]of Object.entries(t)){if(W(r))continue;let c=e.get(r);if(!c){if(o)throw new p(`\u672A\u77E5\u9009\u9879 --${r}`,`\u8FD0\u884C \`stock-sdk ${n.path.join(" ")} --help\` \u67E5\u770B\u53EF\u7528\u9009\u9879`);continue}if(s===!0&&c.type!=="boolean"&&c.type!=="number[]")throw new p(`--${r} \u7F3A\u5C11\u503C`);if(c.type!=="number[]"){let d=S(s);if(c.upper&&typeof d=="string"&&(d=d.toUpperCase()),d!==s&&(t[r]=d),c.type==="enum"&&c.enum){let i=typeof d=="string"?d:String(d);if(!c.enum.includes(i))throw new p(`--${r} \u975E\u6CD5\u503C\u300C${i}\u300D`,`\u53EF\u9009: ${c.enum.join(" / ")}`)}if(c.type==="number"&&d!==!0&&Number.isNaN(Number(d)))throw new p(`--${r} \u9700\u8981\u6570\u503C\uFF0C\u5F97\u5230\u300C${String(d)}\u300D`)}}for(let r of n.options??[])if(r.required&&t[r.flag]===void 0)throw new p(`\u7F3A\u5C11\u5FC5\u586B\u9009\u9879 --${r.flag}`,r.desc)}function Rn(n,t){let e=n.positional??[];for(let o=0;o<e.length;o++){let r=e[o],s=t[o];if(s===void 0||!r.enum)continue;let c=r.upper?s.toUpperCase():s;if(!r.enum.includes(c))throw new p(`<${r.name}> \u975E\u6CD5\u503C\u300C${s}\u300D`,`\u53EF\u9009: ${r.enum.join(" / ")}`)}}function Nn(n,t){let e=t.limit;if(e===void 0||e===!0||!Array.isArray(n))return n;let o=Number(S(e));return!Number.isNaN(o)&&o>=1?n.slice(0,o):n}function Y(n,t,e){_n(t,e.options),Rn(t,e.positional);let o=t.invoke?t.invoke(n,e):Mn(n,t,e);return Promise.resolve(o).then(r=>Nn(r,e.options))}function Mn(n,t,e){let o=Pn(t,e.options);switch(t.argShape){case"none":return m(n,t.path,[]);case"codes[]":return B(e.positional,t),m(n,t.path,[e.positional]);case"codes+options":return B(e.positional,t),m(n,t.path,[e.positional,o]);case"symbol+options":{let r=J(t,e.positional);return m(n,t.path,[...r,o])}case"options":return m(n,t.path,[o]);case"positional":return m(n,t.path,J(t,e.positional));default:throw new p(`\u4E0D\u652F\u6301\u7684\u547D\u4EE4\u5F62\u6001: ${t.argShape}`)}}function B(n,t){if(n.length===0)throw new p(`\u547D\u4EE4 "${t.path.join(" ")}" \u9700\u8981\u81F3\u5C11\u4E00\u4E2A\u4EE3\u7801\u53C2\u6570`)}function nn(n,t,e){if(t==="json")return e?JSON.stringify(n,null,2):JSON.stringify(n);let o=In(n);return o.length===0?"":t==="csv"?$n(o):Tn(o)}function tn(n){return n==null||Array.isArray(n)&&n.length===0}function In(n){return Array.isArray(n)?n.map(t=>Q(t)?t:{value:t}):Q(n)?[n]:n==null?[]:[{value:n}]}function Q(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function en(n){let t=[],e=new Set;for(let o of n)for(let r of Object.keys(o))e.has(r)||(e.add(r),t.push(r));return t}function on(n){return n==null?"":typeof n=="object"?JSON.stringify(n):String(n)}function A(n){let t=0;for(let e of n){let o=e.codePointAt(0)??0;t+=jn(o)?2:1}return t}function jn(n){return n>=4352&&n<=4447||n>=11904&&n<=42191||n>=44032&&n<=55203||n>=63744&&n<=64255||n>=65072&&n<=65103||n>=65280&&n<=65376||n>=65504&&n<=65510||n>=131072&&n<=262141}function X(n,t,e){let o=Math.max(0,t-A(n)),r=" ".repeat(o);return e?r+n:n+r}function Tn(n){let t=en(n),e=n.map(i=>t.map(a=>on(i[a]))),o=t.map((i,a)=>e.every(u=>u[a]===""||Dn(u[a]))),r=t.map((i,a)=>Math.max(A(i),...e.map(u=>A(u[a])))),s=t.map((i,a)=>X(i,r[a],o[a])).join(" "),c=r.map(i=>"-".repeat(i)).join(" "),d=e.map(i=>i.map((a,u)=>X(a,r[u],o[u])).join(" ")).join(`
|
|
4
4
|
`);return[s,c,d].join(`
|
|
5
|
-
`)}function
|
|
6
|
-
`)}function
|
|
7
|
-
`)}return i}},{path:["kline","cn"],alias:["kline"],summary:"K\u7EBF(--market a/hk/us\uFF1B--limit \u622A\u65AD)",argShape:"symbol+options",positional:P,options:[
|
|
8
|
-
`)}function
|
|
9
|
-
`)}function
|
|
10
|
-
`)});function
|
|
11
|
-
`),1}}async function
|
|
12
|
-
`),0;if(
|
|
13
|
-
`),0;if(
|
|
5
|
+
`)}function Dn(n){return n!==""&&!Number.isNaN(Number(n))}function $n(n){let t=en(n),e=[t.map(Z).join(",")];for(let o of n)e.push(t.map(r=>Z(on(o[r]))).join(","));return e.join(`
|
|
6
|
+
`)}function Z(n){return/[",\n\r]/.test(n)?`"${n.replace(/"/g,'""')}"`:n}function h(n){let t={flag:n.flag,type:n.type,desc:n.desc};return n.field!==void 0&&(t.field=n.field),n.enum&&(t.enum=n.enum),n.required&&(t.required=!0),n.upper&&(t.upper=!0),n.map&&(t.map=n.map),t}function qn(n){let t={name:n.name};return n.required&&(t.required=!0),n.variadic&&(t.variadic=!0),n.enum&&(t.enum=n.enum),n.upper&&(t.upper=!0),t}function rn(n,t){let e=(n.params??[]).filter(o=>o.cli!==!1).map(h);return{path:n.path,summary:n.summary,argShape:n.argShape,positional:n.positional?.map(qn),options:e.length>0?e:void 0,invoke:t}}var Kn=h(K),Ln=h(L),sn=h(q),an=h(U),un=h(x),Un=h(F),P=[{name:"symbol",required:!0}],xn=[{name:"code",required:!0}],ln={"kline.withIndicators":(n,t)=>hn(n,t),"northbound.minute":(n,t)=>m(n,["northbound","minute"],[fn(t)]),"northbound.history":(n,t)=>{let e={};return t.options.start!==void 0&&(e.startDate=t.options.start),t.options.end!==void 0&&(e.endDate=t.options.end),m(n,["northbound","history"],[fn(t),e])}};{let n=new Set(g.map(t=>t.path.join(".")));for(let t of Object.keys(ln))if(!n.has(t))throw new Error(`CLI_INVOKE_OVERRIDES \u5F15\u7528\u4E86 spec \u4E2D\u4E0D\u5B58\u5728\u7684\u65B9\u6CD5\u8DEF\u5F84: ${t}`)}var k=g.map(n=>rn(n,ln[n.path.join(".")]));function Fn(n){return k.find(t=>t.path.join(".")===n)?.options??[]}var Vn=Fn("kline.withIndicators"),pn={flag:"market",type:"enum",enum:["a","hk","us"],desc:"\u5E02\u573A a/hk/us(\u9ED8\u8BA4\u6309\u4EE3\u7801\u81EA\u52A8\u8BC6\u522B)"},Gn={flag:"market",type:"enum",enum:["a","hk","us","fund"],desc:"\u5E02\u573A a/hk/us/fund(\u9ED8\u8BA4\u6309\u4EE3\u7801\u81EA\u52A8\u8BC6\u522B\uFF1B\u57FA\u91D1\u987B\u663E\u5F0F --market fund)"},v={flag:"limit",type:"number",desc:"\u53EA\u53D6\u524D N \u6761(CLI \u8F93\u51FA\u5C42\u88C1\u526A)"};function cn(n){let t=b(n);if(t==="GLOBAL")throw new p(`\u6682\u4E0D\u652F\u6301\u81EA\u52A8\u8DEF\u7531 GLOBAL \u5E02\u573A\u7B26\u53F7: ${n}`,"\u6D77\u5916\u7279\u6B8A\u6307\u6570\u6682\u65E0\u6B63\u5F0F K \u7EBF\u5165\u53E3,\u53EF\u7528 raw-secid \u76F4\u901A: stock-sdk kline 100.GDAXI --market us");return t==="HK"?"hk":t==="US"?"us":"a"}function Hn(n){return n==="hk"?"HK":n==="us"?"US":"CN"}function dn(n){if(n!==void 0){if(n==="a"||n==="hk"||n==="us")return n;throw new p("--market \u975E\u6CD5\u503C","\u53EF\u9009: a / hk / us")}}function Jn(n){if(n!==void 0){if(n==="a"||n==="hk"||n==="us"||n==="fund")return n;throw new p("--market \u975E\u6CD5\u503C","\u53EF\u9009: a / hk / us / fund")}}function fn(n){let t=n.options.direction??n.positional[0];if(t!==void 0){if(t==="north"||t==="south")return t;throw new p("direction \u975E\u6CD5\u503C","\u53EF\u9009: north / south")}}function mn(n){let t={};return n.options.period!==void 0&&(t.period=n.options.period),n.options.adjust!==void 0&&(t.adjust=n.options.adjust==="none"?"":n.options.adjust),n.options.start!==void 0&&(t.startDate=n.options.start),n.options.end!==void 0&&(t.endDate=n.options.end),t}function zn(n){let t={};for(let e of V){let o=n[e];if(o===void 0)continue;if(o===!0){t[e]={};continue}let r=E(o);r.length>0&&(t[e]={periods:r})}for(let e of C){let o=n[e];o!==void 0&&(o===!0||o==="true"||o==="1"||o==="yes")&&(t[e]=!0)}return t}function hn(n,t){let e=_(t,"indicators"),o={};return t.options.period!==void 0&&(o.period=t.options.period),t.options.adjust!==void 0&&(o.adjust=t.options.adjust==="none"?"":t.options.adjust),t.options.start!==void 0&&(o.startDate=t.options.start),t.options.end!==void 0&&(o.endDate=t.options.end),t.options.market!==void 0&&(o.market=t.options.market),o.indicators=zn(t.options),m(n,["kline","withIndicators"],[e,o])}var y=[{path:["quotes","cnSimple"],alias:["quote"],summary:"\u884C\u60C5(\u81EA\u52A8\u8BC6\u522B\u5E02\u573A\uFF1B--full \u5168\u91CF\u4E94\u6863\uFF1B--market \u5F3A\u5236\u5E02\u573A)",argShape:"codes[]",positional:[{name:"code",required:!0,variadic:!0}],options:[Gn,{flag:"full",type:"boolean",desc:"A\u80A1\u5168\u91CF\u4E94\u6863\u884C\u60C5"}],invoke:async(n,t)=>{let e=t.positional;if(e.length===0)throw new p("\u7F3A\u5C11\u80A1\u7968\u4EE3\u7801","\u7528\u6CD5: stock-sdk quote <code...>");let o=Jn(t.options.market),r=t.options.full===!0,s={a:[],hk:[],us:[],fund:[]};for(let u of e){if(o==="fund"){s.fund.push(u);continue}let f=o??"a";try{let l=o?O(u,{market:Hn(o)}):O(u);o||(f=l.market==="HK"?"hk":l.market==="US"?"us":"a");let R=l.assetType==="index"?M(l.code):void 0;if(R&&!R.tencent)throw new p(`\u7279\u6B8A\u6307\u6570 ${l.code} \u65E0\u884C\u60C5\u63A5\u53E3`,`\u884C\u60C5\u6E90(\u817E\u8BAF)\u4E0D\u8986\u76D6\u8BE5\u7279\u6B8A\u6307\u6570;K \u7EBF\u8BF7\u7528: stock-sdk kline ${l.code}`);s[f].push(f==="a"?I(l):l.code)}catch(l){if(l instanceof p||o&&l instanceof N&&b(u)!==void 0)throw l;s[f].push(u)}}let c=[];s.a.length&&c.push(Promise.resolve(r?n.quotes.cn(s.a):n.quotes.cnSimple(s.a))),s.hk.length&&c.push(Promise.resolve(n.quotes.hk(s.hk))),s.us.length&&c.push(Promise.resolve(n.quotes.us(s.us))),s.fund.length&&c.push(Promise.resolve(n.quotes.fund(s.fund)));let d=await Promise.allSettled(c),i=[],a=[];for(let u of d)u.status==="fulfilled"?i.push(...u.value):a.push(u.reason);if(i.length===0&&a.length>0)throw a[0];if(a.length>0){let u=a.map(f=>f instanceof Error?f.message:String(f)).join("; ");process.stderr.write(`stock-sdk: \u90E8\u5206\u5E02\u573A\u884C\u60C5\u67E5\u8BE2\u5931\u8D25: ${u}
|
|
7
|
+
`)}return i}},{path:["kline","cn"],alias:["kline"],summary:"K\u7EBF(--market a/hk/us\uFF1B--limit \u622A\u65AD)",argShape:"symbol+options",positional:P,options:[Kn,sn,an,un,pn,v],invoke:async(n,t)=>{let e=_(t,"kline"),o=dn(t.options.market)??cn(e),r=mn(t);return m(n,["kline",o==="hk"?"hk":o==="us"?"us":"cn"],[e,r])}},{path:["kline","cnMinute"],alias:["minute"],summary:"\u5206\u949FK\u7EBF/\u5206\u65F6(--period 1/5/15/30/60\uFF1B--market\uFF1B\u6E2F/\u7F8E --ndays)",argShape:"symbol+options",positional:P,options:[Ln,sn,an,un,pn,v,Un],invoke:async(n,t)=>{let e=_(t,"minute"),o=dn(t.options.market)??cn(e),r=mn(t),s=o==="hk"?"hkMinute":o==="us"?"usMinute":"cnMinute";if(t.options.ndays!==void 0){if(s==="cnMinute")throw new p("--ndays \u4EC5\u652F\u6301\u6E2F/\u7F8E\u80A1\u5206\u65F6","\u793A\u4F8B: stock-sdk minute 00700 --ndays 5");r.ndays=Number(t.options.ndays)}return m(n,["kline",s],[e,r])}},{path:["kline","withIndicators"],alias:["indicators"],summary:"\u5E26\u6307\u6807K\u7EBF(--ma 5,10,20 --macd --kdj --rsi --boll ...\uFF1B--market)",argShape:"symbol+options",positional:P,options:Vn,invoke:hn},{path:["search"],alias:["search"],summary:"\u641C\u7D22\u80A1\u7968/\u6307\u6570/\u57FA\u91D1(--limit \u622A\u65AD)",argShape:"positional",positional:[{name:"keyword",required:!0}],options:[v],invoke:async(n,t)=>{let e=t.positional[0];if(!e)throw new p("\u7F3A\u5C11\u641C\u7D22\u5173\u952E\u8BCD","\u7528\u6CD5: stock-sdk search <keyword>");return n.search(e)}},{path:["quotes","timeline"],alias:["timeline"],summary:"\u5F53\u65E5\u5206\u65F6",argShape:"positional",positional:xn,invoke:async(n,t)=>{let e=t.positional[0];if(!e)throw new p("\u7F3A\u5C11\u80A1\u7968\u4EE3\u7801","\u7528\u6CD5: stock-sdk timeline <code>");return n.quotes.timeline(e)}},{path:["codes","cn"],alias:["codes"],summary:"\u4EE3\u7801\u5217\u8868(market: a/hk/us/fund\uFF1B--simple\uFF1B--board sh/sz/bj/kc/cy)",argShape:"positional",positional:[{name:"market",required:!0,enum:["a","hk","us","fund"]}],options:[{flag:"simple",type:"boolean",desc:"\u53BB\u524D\u7F00"},{flag:"board",field:"market",type:"string",desc:"\u677F\u5757 sh/sz/bj/kc/cy(\u4EC5A\u80A1)"}],invoke:async(n,t)=>{let e=t.positional[0],o={};if(t.options.simple===!0&&(o.simple=!0),t.options.board!==void 0){if(e!=="a")throw new p("--board \u4EC5\u652F\u6301 A \u80A1(market=a)","\u53EF\u9009: sh / sz / bj / kc / cy");o.market=t.options.board}switch(e){case"a":return m(n,["codes","cn"],[o]);case"us":return m(n,["codes","us"],[o]);case"hk":return n.codes.hk();case"fund":return n.codes.fund();default:throw new p(`\u672A\u77E5\u5E02\u573A: ${e}`,"\u53EF\u9009: a / hk / us / fund")}}},{path:["calendar","marketStatus"],alias:["status"],summary:"\u5E02\u573A\u72B6\u6001(a/hk/us\uFF0C\u9ED8\u8BA4 a)",argShape:"positional",positional:[{name:"market",upper:!0,enum:D}],invoke:async(n,t)=>{let e=t.positional[0],o=e?e.toUpperCase():"A";return n.calendar.marketStatus(o)}},{path:["marketEvent","ztPool"],alias:["ztpool"],summary:"\u6DA8\u505C\u80A1\u6C60 zt/yesterday/strong/sub_new/broken/dt(--date)",argShape:"positional",positional:[{name:"type",enum:$}],options:[{flag:"date",type:"string",desc:"\u4EA4\u6613\u65E5 YYYYMMDD"}],invoke:async(n,t)=>{let e=t.positional[0],o=t.options.date;return n.marketEvent.ztPool(e,o)}},{path:["call"],alias:["call"],summary:"\u539F\u59CB\u76F4\u901A\uFF1A\u8C03\u7528\u4EFB\u610F\u547D\u540D\u7A7A\u95F4\u65B9\u6CD5\uFF08--args \u4F20 JSON \u5B9E\u53C2\u6570\u7EC4\uFF09",argShape:"positional",positional:[{name:"method",required:!0}],options:[{flag:"args",type:"string",desc:`JSON \u5B9E\u53C2\u6570\u7EC4\uFF0C\u5982 '[["sh600519"]]'`}],invoke:(n,t)=>{let e=t.positional[0];if(!e)throw new p("call \u7F3A\u5C11\u65B9\u6CD5\u8DEF\u5F84","\u7528\u6CD5: stock-sdk call <ns.method> --args '[...]'");let o=[],r=t.options.args;if(typeof r=="string")try{let c=JSON.parse(r);o=Array.isArray(c)?c:[c]}catch{throw new p("--args \u4E0D\u662F\u5408\u6CD5 JSON",`\u793A\u4F8B: --args '[["sh600519"]]'`)}if(!new Set(Wn()).has(e))throw new p(`\u672A\u77E5\u65B9\u6CD5: ${e}`,"\u5F62\u5982 quotes.cn / kline.cn(\u4EC5\u547D\u540D\u7A7A\u95F4\u65B9\u6CD5,\u89C1 stock-sdk --help)");return m(n,e.split("."),o)}}],kn="mcp",Bn=[...y,...k];function Wn(){return g.map(n=>n.path.join("."))}function _(n,t){let e=n.positional[0];if(!e)throw new p("\u7F3A\u5C11\u4EE3\u7801\u53C2\u6570",`\u7528\u6CD5: stock-sdk ${t} <symbol>`);return e}function gn(){let n=new Set(["help","h","version","V","quiet","q","pretty"]);for(let t of Bn)for(let e of t.options??[])e.type==="boolean"&&n.add(e.flag);for(let t of C)n.add(t);return n}function Sn(n){if(n.length===0)return null;for(let e=Math.min(3,n.length);e>=2;e--){let o=n.slice(0,e).join("."),r=k.find(s=>s.path.join(".")===o);if(r)return{spec:r,rest:n.slice(e)}}for(let e of y)if(e.alias?.includes(n[0]))return{spec:e,rest:n.slice(1)};let t=k.find(e=>e.path.join(".")===n[0]);return t?{spec:t,rest:n.slice(1)}:null}function yn(){let n=["stock-sdk \u2014\u2014 \u80A1\u7968\u884C\u60C5\u547D\u4EE4\u884C\uFF08\u57FA\u4E8E stock-sdk v2 \u547D\u540D\u7A7A\u95F4 API\uFF09","","\u7528\u6CD5:"," stock-sdk <command> [args] [--flags]"," stock-sdk <namespace> <method> [args] [--flags] # \u76F4\u8FBE\u4EFB\u610F\u547D\u540D\u7A7A\u95F4\u65B9\u6CD5","","\u5E38\u7528\u547D\u4EE4:"];for(let e of y){let o=e.alias?.[0]??e.path.join(" ");n.push(` ${o.padEnd(12)} ${e.summary}`)}n.push(" mcp \u542F\u52A8 MCP server (stdio)"),n.push(""),n.push("\u547D\u540D\u7A7A\u95F4\uFF08stock-sdk <ns> <method> ...\uFF09:");let t=[...new Set(k.map(e=>e.path[0]))];return n.push(" "+t.join(" / ")),n.push(""),n.push("\u5168\u5C40\u9009\u9879:"),n.push(" -f, --format json|table|csv \u8F93\u51FA\u683C\u5F0F (\u9ED8\u8BA4 json)"),n.push(" --pretty JSON \u7F29\u8FDB\u7F8E\u5316"),n.push(" --timeout <ms> \u8BF7\u6C42\u8D85\u65F6"),n.push(" -q, --quiet \u9759\u9ED8(\u53EA\u8F93\u51FA\u6570\u636E)"),n.push(" -h, --help \u663E\u793A\u5E2E\u52A9"),n.push(" -V, --version \u663E\u793A\u7248\u672C"),n.push(""),n.push("\u793A\u4F8B:"),n.push(" stock-sdk quote 600519 000858 00700"),n.push(" stock-sdk kline 600519 --period weekly --adjust hfq --limit 30"),n.push(" stock-sdk indicators 600519 --ma 5,10,20 --macd"),n.push(" stock-sdk board industry list --format table"),n.push(" stock-sdk options etf dailyKline 10004336"),n.push(""),n.push("\u8FD0\u884C `stock-sdk <command> --help` \u67E5\u770B\u5355\u6761\u547D\u4EE4\u7528\u6CD5\u3002"),n.join(`
|
|
8
|
+
`)}function wn(n){let t=n.alias?.[0]??n.path.join(" "),e=[`${t} \u2014\u2014 ${n.summary}`,""],o=(n.positional??[]).map(r=>{let s=r.required?`<${r.name}>`:`[${r.name}]`;return r.variadic?`${s}...`:s}).join(" ");if(e.push(`\u7528\u6CD5: stock-sdk ${t}${o?" "+o:""} [--flags]`),n.options?.length){e.push(""),e.push("\u9009\u9879:");for(let r of n.options){let s=r.enum?` (${r.enum.join("/")})`:"";e.push(` --${r.flag.padEnd(12)} ${r.desc}${s}`)}}return e.join(`
|
|
9
|
+
`)}function On(n,t=new Set){let e=[],o={},r=!1,s=(i,a)=>{let u=o[i];if(u===void 0){o[i]=a;return}if(typeof a!="string"){o[i]=a;return}Array.isArray(u)?u.push(a):typeof u=="string"?o[i]=[u,a]:o[i]=a},c=i=>i!==void 0&&(i==="-"||!i.startsWith("-")||/^-\d/.test(i)),d=(i,a)=>{if(t.has(i))return s(i,!0),a;let u=n[a+1];return c(u)?(s(i,u),a+1):(s(i,!0),a)};for(let i=0;i<n.length;i++){let a=n[i];if(r){e.push(a);continue}if(a==="--"){r=!0;continue}if(a.startsWith("--")&&a.length>2){let u=a.slice(2),f=u.indexOf("=");f>=0?s(u.slice(0,f),u.slice(f+1)):i=d(u,i)}else if(a.startsWith("-")&&a.length>1&&!Yn(a)){let u=a.slice(1),f=u.indexOf("=");f>=0?s(u.slice(0,f),u.slice(f+1)):i=d(u,i)}else e.push(a)}return{positional:e,options:o}}function Yn(n){return/^-\d/.test(n)}var Qn=gn();process.stdout.on("error",n=>{n.code==="EPIPE"&&process.exit(0),process.stderr.write(`stock-sdk: stdout error: ${n.message}
|
|
10
|
+
`)});function Xn(){return"2.4.0"}function Zn(n){let t=n.format??n.f,e=t==="table"||t==="csv"?t:"json",o;if(typeof n.timeout=="string"||typeof n.timeout=="number"){let r=Number(n.timeout);!Number.isNaN(r)&&r>0&&(o=r)}return{format:e,pretty:n.pretty===!0,quiet:n.quiet===!0||n.q===!0,help:n.help===!0||n.h===!0,version:n.version===!0||n.V===!0,timeout:o}}async function nt(){try{return(await import("./mcp.js")).startMcpServer(),0}catch(n){let t=n instanceof Error?n.message:String(n);return process.stderr.write(`stock-sdk: \u65E0\u6CD5\u542F\u52A8 MCP server: ${t}
|
|
11
|
+
`),1}}async function tt(n){let t="json";try{let e=On(n,Qn),o=Zn(e.options);if(t=o.format,o.version)return process.stdout.write(Xn()+`
|
|
12
|
+
`),0;if(e.positional.length===0)return process.stdout.write(yn()+`
|
|
13
|
+
`),0;if(e.positional[0]===kn)return o.help?(process.stdout.write(`stock-sdk mcp \u2014\u2014 \u542F\u52A8 MCP server (stdio transport)
|
|
14
14
|
|
|
15
15
|
\u7528\u6CD5: stock-sdk mcp
|
|
16
16
|
\u73AF\u5883\u53D8\u91CF: STOCK_SDK_MCP_TOOLS=core|full|<\u9017\u53F7\u5206\u9694\u5DE5\u5177\u540D>\uFF08\u9ED8\u8BA4 core\uFF09
|
|
17
|
-
`),0):await
|
|
18
|
-
`),0;let s=new
|
|
19
|
-
`);let i=
|
|
20
|
-
`),0}catch(
|
|
21
|
-
`),
|
|
17
|
+
`),0):await nt();let r=Sn(e.positional);if(!r)throw new p(`\u672A\u77E5\u547D\u4EE4 "${e.positional.join(" ")}"`,"\u8FD0\u884C `stock-sdk --help` \u67E5\u770B\u53EF\u7528\u547D\u4EE4");if(o.help)return process.stdout.write(wn(r.spec)+`
|
|
18
|
+
`),0;let s=new j(o.timeout!==void 0?{timeout:o.timeout}:{}),c={positional:r.rest,options:e.options},d=await Y(s,r.spec,c);tn(d)&&!o.quiet&&process.stderr.write(`stock-sdk: \u65E0\u6570\u636E
|
|
19
|
+
`);let i=nn(d,o.format,o.pretty);return i.length>0&&process.stdout.write(i+`
|
|
20
|
+
`),0}catch(e){let o=H(e,t);return process.stderr.write(o.text+`
|
|
21
|
+
`),G(e)}}tt(process.argv.slice(2)).then(n=>{process.exitCode=n},n=>{let t=n instanceof Error?n.message:String(n);process.stderr.write(`stock-sdk: ${t}
|
|
22
22
|
`),process.exitCode=1});
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkLDYRNH4Xcjs = require('./chunk-LDYRNH4X.cjs');var _chunk6FZNYDNNcjs = require('./chunk-6FZNYDNN.cjs');var _chunk46ECBWOQcjs = require('./chunk-46ECBWOQ.cjs');var _chunkR7M3BHS4cjs = require('./chunk-R7M3BHS4.cjs');var _chunkUSZUOBM2cjs = require('./chunk-USZUOBM2.cjs');var _chunkSR7FGCVZcjs = require('./chunk-SR7FGCVZ.cjs');var _chunk6MCPZDKNcjs = require('./chunk-6MCPZDKN.cjs');var _chunk4Q7UQ5Q3cjs = require('./chunk-4Q7UQ5Q3.cjs');require('./chunk-4VDLQK6F.cjs');var de={0:"sz",1:"sh",100:"global",105:"us",116:"hk"},he={sh:"CN",sz:"CN",hk:"HK",us:"US"},ke={IXIC:".IXIC",NDX:".NDX",NDX100:".NDX"},Se={IXIC:"NDX",NDX:"NDX",NDX100:"NDX"};function ye(t){return t==="sh"||t==="sz"||t==="hk"||t==="us"||t==="global"}function Oe(t){switch(t.market){case"CN":return t.exchange==="SSE"?"sh":t.exchange==="SZSE"?"sz":"unknown";case"HK":return"hk";case"US":return"us";case"GLOBAL":return"global";default:return"unknown"}}function fe(t){let e=t.code.trim(),o=t.market.trim().toLowerCase(),n=_nullishCoalesce(de[t.market], () => (o)),s=ye(n)?n:void 0;if(s==="global")return{code:e.replace(/^\d{3}\./,"").toUpperCase(),market:"global"};try{let r=_chunkUSZUOBM2cjs.f.call(void 0, e,s?{market:he[s]}:void 0);if(r.assetType!=="stock")return{code:e,market:"unknown"};let a=_nullishCoalesce(s, () => (Oe(r)));return a==="unknown"?{code:e,market:"unknown"}:{code:r.market==="US"?r.code.toUpperCase():r.code,market:a}}catch (e2){return{code:e,market:"unknown"}}}function Ce(t,e){return e==="sh"&&t.startsWith("000")||e==="sz"&&t.startsWith("399")}function Me(t){let{code:e,market:o}=t;return(o==="sh"||o==="sz")&&Ce(e,o)?`https://quote.eastmoney.com/zs${e}.html`:o==="sh"||o==="sz"?`https://quote.eastmoney.com/${o}${e}.html`:o==="hk"?`https://quote.eastmoney.com/hk/${e}.html`:o==="us"?`https://quote.eastmoney.com/us/${e}.html`:o==="global"?`https://quote.eastmoney.com/gb/zs${_nullishCoalesce(Se[e], () => (e))}.html`:`https://so.eastmoney.com/web/s?keyword=${encodeURIComponent(e)}`}function ge(t){let{code:e,market:o}=t;return o==="sh"||o==="sz"?`https://xueqiu.com/S/${o.toUpperCase()}${e}`:o==="hk"?`https://xueqiu.com/S/${e}`:o==="us"?`https://xueqiu.com/S/${e}`:o==="global"?`https://xueqiu.com/S/${_nullishCoalesce(ke[e], () => (e))}`:`https://xueqiu.com/k?q=${encodeURIComponent(e)}`}function Re(t){let e=fe(t);return[{name:"\u4E1C\u65B9\u8D22\u5BCC",url:Me(e)},{name:"\u96EA\u7403",url:ge(e)}]}exports.BROWSER_JSVARS_MUTEX_KEY = _chunk46ECBWOQcjs.j; exports.FundService = _chunk46ECBWOQcjs.s; exports.HttpError = _chunk4Q7UQ5Q3cjs.b; exports.INDICATOR_REGISTRY = _chunkR7M3BHS4cjs.t; exports.MARKET_TZ = _chunk46ECBWOQcjs.m; exports.MemoryCache = _chunk6MCPZDKNcjs.a; exports.MemoryCacheStore = _chunk6FZNYDNNcjs.a; exports.SdkError = _chunk4Q7UQ5Q3cjs.a; exports.StockSDK = _chunk46ECBWOQcjs.t; exports.TradingCalendarService = _chunk46ECBWOQcjs.r; exports.addIndicators = _chunkR7M3BHS4cjs.x; exports.asyncPool = _chunk46ECBWOQcjs.f; exports.backtest = _chunkLDYRNH4Xcjs.b; exports.buildIndicatorContext = _chunkR7M3BHS4cjs.s; exports.buildTimeMeta = _chunk46ECBWOQcjs.o; exports.buildTimeMetaFromDateAndTime = _chunk46ECBWOQcjs.p; exports.cacheThrough = _chunk6FZNYDNNcjs.b; exports.calcATR = _chunkR7M3BHS4cjs.l; exports.calcBIAS = _chunkR7M3BHS4cjs.j; exports.calcBOLL = _chunkR7M3BHS4cjs.f; exports.calcCCI = _chunkR7M3BHS4cjs.k; exports.calcChipDistribution = _chunkR7M3BHS4cjs.r; exports.calcDMI = _chunkR7M3BHS4cjs.o; exports.calcEMA = _chunkR7M3BHS4cjs.b; exports.calcKC = _chunkR7M3BHS4cjs.q; exports.calcKDJ = _chunkR7M3BHS4cjs.g; exports.calcMA = _chunkR7M3BHS4cjs.d; exports.calcMACD = _chunkR7M3BHS4cjs.e; exports.calcOBV = _chunkR7M3BHS4cjs.m; exports.calcROC = _chunkR7M3BHS4cjs.n; exports.calcRSI = _chunkR7M3BHS4cjs.h; exports.calcSAR = _chunkR7M3BHS4cjs.p; exports.calcSMA = _chunkR7M3BHS4cjs.a; exports.calcSignals = _chunkSR7FGCVZcjs.a; exports.calcWMA = _chunkR7M3BHS4cjs.c; exports.calcWR = _chunkR7M3BHS4cjs.i; exports.chunkArray = _chunk46ECBWOQcjs.e; exports.clearClientScopedCaches = _chunk6MCPZDKNcjs.f; exports.configureSharedCache = _chunk6MCPZDKNcjs.c; exports.createCacheKey = _chunk6MCPZDKNcjs.g; exports.decodeGBK = _chunk46ECBWOQcjs.a; exports.default = _chunk46ECBWOQcjs.u; exports.estimateIndicatorLookback = _chunkR7M3BHS4cjs.w; exports.extractJsonFromJsonp = _chunk46ECBWOQcjs.g; exports.fetchJsVars = _chunk46ECBWOQcjs.k; exports.formatInTz = _chunk46ECBWOQcjs.q; exports.generateSearchExternalLinks = Re; exports.getEnabledIndicatorKeys = _chunkR7M3BHS4cjs.v; exports.getSdkErrorCode = _chunk4Q7UQ5Q3cjs.k; exports.getSharedCache = _chunk6MCPZDKNcjs.b; exports.jsonpRequest = _chunk46ECBWOQcjs.h; exports.normalizeSymbol = _chunkUSZUOBM2cjs.f; exports.parseJsVars = _chunk46ECBWOQcjs.l; exports.parseMarketTime = _chunk46ECBWOQcjs.n; exports.parseResponse = _chunk46ECBWOQcjs.b; exports.safeNumber = _chunk46ECBWOQcjs.c; exports.safeNumberOrNull = _chunk46ECBWOQcjs.d; exports.screen = _chunkLDYRNH4Xcjs.a; exports.toEastmoneySecid = _chunkUSZUOBM2cjs.j; exports.toTencentSymbol = _chunkUSZUOBM2cjs.i; exports.withScriptMutex = _chunk46ECBWOQcjs.i;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { a as RequestClient, b as SearchResult, E as ExternalLink } from './sdk-
|
|
2
|
-
export { A as AShareMarket,
|
|
1
|
+
import { a as RequestClient, b as SearchResult, E as ExternalLink } from './sdk-RzQ-drS4.cjs';
|
|
2
|
+
export { A as AShareMarket, aT as BlockTradeDailyStatItem, D as BlockTradeDateOptions, aS as BlockTradeDetailItem, aR as BlockTradeMarketStatItem, aK as BoardChangeItem, am as CFFEXOptionQuote, x as CFFEXOptionQuotesOptions, aI as ChangeTypeCount, C as ChipDistributionRequestOptions, ad as ComexInventory, w as ComexInventoryOptions, a2 as ConceptBoard, a4 as ConceptBoardConstituent, a5 as ConceptBoardKline, q as ConceptBoardKlineOptions, a7 as ConceptBoardMinuteKline, r as ConceptBoardMinuteKlineOptions, a6 as ConceptBoardMinuteTimeline, a3 as ConceptBoardSpot, ap as DividendDetail, aP as DragonTigerBranchItem, J as DragonTigerDateOptions, aM as DragonTigerDetailItem, aO as DragonTigerInstitutionItem, aL as DragonTigerPeriod, aQ as DragonTigerSeatItem, aN as DragonTigerStockStatItem, al as ETFOptionCate, ak as ETFOptionExpireDay, aj as ETFOptionMonth, K as FullQuote, b6 as FundAssetAllocation, b5 as FundBondHolding, bc as FundBuySedemption, aZ as FundDividend, aY as FundDividendListOptions, a_ as FundDividendListResult, aW as FundDividendRank, b1 as FundEstimate, O as FundFlow, y as FundFlowOptions, ar as FundFlowRankItem, z as FundFlowRankOptions, ba as FundHolderStructure, b4 as FundHolding, b8 as FundManager, b0 as FundNavHistory, a$ as FundNavPoint, b9 as FundPerformanceEvaluation, b7 as FundPositionPoint, i as FundProfile, W as FundQuote, b3 as FundRankHistory, b2 as FundRankPoint, bf as FundSameType, be as FundSameTypePeer, bb as FundScaleChange, F as FundService, aX as FundSortDirection, bd as FundStageReturns, a8 as FuturesExchange, ac as FuturesInventory, v as FuturesInventoryOptions, ab as FuturesInventorySymbol, a9 as FuturesKline, s as FuturesKlineOptions, d as GetAShareCodeListOptions, G as GetAllAShareQuotesOptions, f as GetAllUSQuotesOptions, bk as GetHotThemesOptions, bm as GetThemeFundsOptions, bj as GetThemeListOptions, e as GetUSCodeListOptions, u as GlobalFuturesKlineOptions, aa as GlobalFuturesQuote, t as GlobalFuturesSpotOptions, k as HKKlineOptions, l as HKMinuteKlineOptions, Q as HKQuote, H as HistoryKlineOptions, bp as HotThemesResult, ae as IndexOptionProduct, aH as IndividualChangesDay, aJ as IndividualChangesHistory, c as IndividualChangesHistoryOptions, I as IndividualChangesOptions, aG as IndividualStockChangeItem, Y as IndustryBoard, _ as IndustryBoardConstituent, $ as IndustryBoardKline, o as IndustryBoardKlineOptions, a1 as IndustryBoardMinuteKline, p as IndustryBoardMinuteKlineOptions, a0 as IndustryBoardMinuteTimeline, Z as IndustryBoardSpot, aU as MarginAccountItem, aV as MarginTargetItem, at as MarketFundFlow, g as MarketStatus, M as MarketType, j as MinuteKlineOptions, au as NorthboundDirection, ay as NorthboundFlowSummary, aA as NorthboundHistoryItem, B as NorthboundHistoryOptions, az as NorthboundHoldingRankItem, N as NorthboundHoldingRankOptions, aB as NorthboundIndividualItem, av as NorthboundMarket, ax as NorthboundMinuteItem, aw as NorthboundRankPeriod, ah as OptionKline, an as OptionLHBItem, ai as OptionMinute, af as OptionTQuote, ag as OptionTQuoteResult, P as PanelLargeOrder, X as Quote, R as RequestClientOptions, ao as SearchResultType, as as SectorFundFlowItem, L as SimpleQuote, aF as StockChangeItem, aE as StockChangeType, aq as StockFundFlowDaily, S as StockSDK, h as SupportedMarket, bi as ThemeCategory, bn as ThemeFund, bq as ThemeFundItem, br as ThemeFundItemList, bo as ThemeFundListResult, bh as ThemeFundOrder, bl as ThemeFundRankSort, bg as ThemeFundSort, T as TradingCalendarService, m as USKlineOptions, U as USMarket, n as USMinuteKlineOptions, V as USQuote, aD as ZTPoolItem, aC as ZTPoolType, S as default } from './sdk-RzQ-drS4.cjs';
|
|
3
3
|
export { H as HttpError, P as ProviderName, a as ProviderRequestPolicy, b as RequestError, R as RetryOptions, S as SdkError, g as getSdkErrorCode } from './index-mlzPfoON.cjs';
|
|
4
|
-
export { CacheOptions, CacheStore, MaybePromise, MemoryCache, MemoryCacheStore, cacheThrough, createCacheKey, getSharedCache } from './cache.cjs';
|
|
4
|
+
export { CacheOptions, CacheStore, MaybePromise, MemoryCache, MemoryCacheStore, cacheThrough, clearClientScopedCaches, configureSharedCache, createCacheKey, getSharedCache } from './cache.cjs';
|
|
5
5
|
export { e as ATROptions, A as AnyHistoryKline, d as BIASOptions, B as BOLLOptions, C as CCIOptions, D as DMIOptions, i as DMIResult, w as HKHistoryKline, x as HKMinuteKline, y as HKMinuteTimeline, H as HistoryKline, I as IndicatorOptions, k as KCOptions, l as KCResult, c as KDJOptions, K as KlineWithIndicators, b as MACDOptions, M as MAOptions, m as MARKET_TZ, n as MarketTz, t as MinuteKline, s as MinuteTimeline, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, R as RSIOptions, S as SAROptions, j as SARResult, T as TimeMeta, u as TodayTimeline, v as TodayTimelineResponse, U as USHistoryKline, z as USMinuteKline, E as USMinuteTimeline, W as WROptions, a as addIndicators, o as buildTimeMeta, q as buildTimeMetaFromDateAndTime, r as formatInTz, p as parseMarketTime } from './addIndicators-_V3HEi0q.cjs';
|
|
6
|
+
export { A as AssetType, E as Exchange, M as Market, N as NormalizedSymbol, a as SymbolInput, S as SymbolRef, n as normalizeSymbol, b as toEastmoneySecid, t as toTencentSymbol } from './adapters-CZUNRbxi.cjs';
|
|
6
7
|
export { INDICATOR_REGISTRY, IndicatorKey, buildIndicatorContext, calcATR, calcBIAS, calcBOLL, calcCCI, calcDMI, calcEMA, calcKC, calcKDJ, calcMA, calcMACD, calcOBV, calcROC, calcRSI, calcSAR, calcSMA, calcWMA, calcWR, estimateIndicatorLookback, getEnabledIndicatorKeys } from './indicators.cjs';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
8
|
+
export { d as ChipDistributionItem, b as ChipDistributionOptions, a as ChipHistogram, C as ChipKlineLike, c as calcChipDistribution } from './chip-BbA23rr1.cjs';
|
|
9
|
+
export { calcSignals } from './signals.cjs';
|
|
9
10
|
export { BacktestOptions, BacktestReport, ScreenerBuilder, Strategy, StrategySignal, Trade, backtest, screen } from './screener.cjs';
|
|
11
|
+
export { a as Signal, S as SignalOptions, b as SignalType } from './types-7n5rSHbd.cjs';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* 响应解析器
|
|
@@ -99,13 +101,16 @@ declare function jsonpRequest<T = unknown>(url: string, options?: JsonpOptions):
|
|
|
99
101
|
*/
|
|
100
102
|
|
|
101
103
|
/**
|
|
102
|
-
*
|
|
104
|
+
* 浏览器端 fetchJsVars 默认共享的 mutex 键。
|
|
103
105
|
*
|
|
104
106
|
* 用全局键(而非按变量名集合算 key)的原因:不同接口的变量名集合常有交集
|
|
105
107
|
* (如 pingzhongdata 的 `fS_code` / `fS_name` 同时被多个接口写入)。按集合
|
|
106
108
|
* 分组的 key 会让"集合不同但有交集"的并发请求互相覆盖全局变量。
|
|
107
109
|
*
|
|
108
|
-
*
|
|
110
|
+
* 代价:默认下任意两个浏览器 fetchJsVars 调用都串行。变量集合与基金系
|
|
111
|
+
* **确定不相交**的数据源(如 smartbox 的 `v_hint`)可用 `options.mutexKey`
|
|
112
|
+
* 声明专属队列,避免被基金大文件下载排队拖慢(R7-5)——同 key 仍串行,
|
|
113
|
+
* 保住自身并发安全。
|
|
109
114
|
*
|
|
110
115
|
* Node 端不走 mutex,不受影响。
|
|
111
116
|
*/
|
|
@@ -115,6 +120,11 @@ interface FetchJsVarsOptions {
|
|
|
115
120
|
timeout?: number;
|
|
116
121
|
/** 额外的 fetch headers(仅 Node 端裸 fetch 路径生效;client 路径请通过 client 配置) */
|
|
117
122
|
headers?: Record<string, string>;
|
|
123
|
+
/**
|
|
124
|
+
* 浏览器端注入互斥队列的 key,默认 {@link BROWSER_JSVARS_MUTEX_KEY}(全局串行)。
|
|
125
|
+
* 仅当变量名集合与其它数据源**确定不相交**时才可指定专属 key。
|
|
126
|
+
*/
|
|
127
|
+
mutexKey?: string;
|
|
118
128
|
/**
|
|
119
129
|
* 可选的 SDK 请求客户端。
|
|
120
130
|
* - 传入:Node 端走 `client.get<string>(url, { responseType: 'text' })`,享受 SDK 重试 /
|
|
@@ -198,6 +208,13 @@ interface DatacenterQuery {
|
|
|
198
208
|
* 命中此上限时会在 console 输出 warning 提示,避免数据被静默截断。
|
|
199
209
|
*/
|
|
200
210
|
maxPages?: number;
|
|
211
|
+
/**
|
|
212
|
+
* 翻页并发波次大小(R7-14),默认 3;设 1 退化为严格串行。
|
|
213
|
+
*
|
|
214
|
+
* ⚠️ 默认部署没有 RateLimiter(仅用户显式配置时创建),并发请求直接
|
|
215
|
+
* 打上游,故默认值保守;配置了限速的用户墙钟收益受限速地板约束。
|
|
216
|
+
*/
|
|
217
|
+
concurrency?: number;
|
|
201
218
|
/** 额外的 quoteColumns 参数(用于行情字段聚合) */
|
|
202
219
|
quoteColumns?: string;
|
|
203
220
|
/** 额外的 quoteType 参数 */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { a as RequestClient, b as SearchResult, E as ExternalLink } from './sdk-
|
|
2
|
-
export { A as AShareMarket,
|
|
1
|
+
import { a as RequestClient, b as SearchResult, E as ExternalLink } from './sdk-DGgSDZRx.js';
|
|
2
|
+
export { A as AShareMarket, aT as BlockTradeDailyStatItem, D as BlockTradeDateOptions, aS as BlockTradeDetailItem, aR as BlockTradeMarketStatItem, aK as BoardChangeItem, am as CFFEXOptionQuote, x as CFFEXOptionQuotesOptions, aI as ChangeTypeCount, C as ChipDistributionRequestOptions, ad as ComexInventory, w as ComexInventoryOptions, a2 as ConceptBoard, a4 as ConceptBoardConstituent, a5 as ConceptBoardKline, q as ConceptBoardKlineOptions, a7 as ConceptBoardMinuteKline, r as ConceptBoardMinuteKlineOptions, a6 as ConceptBoardMinuteTimeline, a3 as ConceptBoardSpot, ap as DividendDetail, aP as DragonTigerBranchItem, J as DragonTigerDateOptions, aM as DragonTigerDetailItem, aO as DragonTigerInstitutionItem, aL as DragonTigerPeriod, aQ as DragonTigerSeatItem, aN as DragonTigerStockStatItem, al as ETFOptionCate, ak as ETFOptionExpireDay, aj as ETFOptionMonth, K as FullQuote, b6 as FundAssetAllocation, b5 as FundBondHolding, bc as FundBuySedemption, aZ as FundDividend, aY as FundDividendListOptions, a_ as FundDividendListResult, aW as FundDividendRank, b1 as FundEstimate, O as FundFlow, y as FundFlowOptions, ar as FundFlowRankItem, z as FundFlowRankOptions, ba as FundHolderStructure, b4 as FundHolding, b8 as FundManager, b0 as FundNavHistory, a$ as FundNavPoint, b9 as FundPerformanceEvaluation, b7 as FundPositionPoint, i as FundProfile, W as FundQuote, b3 as FundRankHistory, b2 as FundRankPoint, bf as FundSameType, be as FundSameTypePeer, bb as FundScaleChange, F as FundService, aX as FundSortDirection, bd as FundStageReturns, a8 as FuturesExchange, ac as FuturesInventory, v as FuturesInventoryOptions, ab as FuturesInventorySymbol, a9 as FuturesKline, s as FuturesKlineOptions, d as GetAShareCodeListOptions, G as GetAllAShareQuotesOptions, f as GetAllUSQuotesOptions, bk as GetHotThemesOptions, bm as GetThemeFundsOptions, bj as GetThemeListOptions, e as GetUSCodeListOptions, u as GlobalFuturesKlineOptions, aa as GlobalFuturesQuote, t as GlobalFuturesSpotOptions, k as HKKlineOptions, l as HKMinuteKlineOptions, Q as HKQuote, H as HistoryKlineOptions, bp as HotThemesResult, ae as IndexOptionProduct, aH as IndividualChangesDay, aJ as IndividualChangesHistory, c as IndividualChangesHistoryOptions, I as IndividualChangesOptions, aG as IndividualStockChangeItem, Y as IndustryBoard, _ as IndustryBoardConstituent, $ as IndustryBoardKline, o as IndustryBoardKlineOptions, a1 as IndustryBoardMinuteKline, p as IndustryBoardMinuteKlineOptions, a0 as IndustryBoardMinuteTimeline, Z as IndustryBoardSpot, aU as MarginAccountItem, aV as MarginTargetItem, at as MarketFundFlow, g as MarketStatus, M as MarketType, j as MinuteKlineOptions, au as NorthboundDirection, ay as NorthboundFlowSummary, aA as NorthboundHistoryItem, B as NorthboundHistoryOptions, az as NorthboundHoldingRankItem, N as NorthboundHoldingRankOptions, aB as NorthboundIndividualItem, av as NorthboundMarket, ax as NorthboundMinuteItem, aw as NorthboundRankPeriod, ah as OptionKline, an as OptionLHBItem, ai as OptionMinute, af as OptionTQuote, ag as OptionTQuoteResult, P as PanelLargeOrder, X as Quote, R as RequestClientOptions, ao as SearchResultType, as as SectorFundFlowItem, L as SimpleQuote, aF as StockChangeItem, aE as StockChangeType, aq as StockFundFlowDaily, S as StockSDK, h as SupportedMarket, bi as ThemeCategory, bn as ThemeFund, bq as ThemeFundItem, br as ThemeFundItemList, bo as ThemeFundListResult, bh as ThemeFundOrder, bl as ThemeFundRankSort, bg as ThemeFundSort, T as TradingCalendarService, m as USKlineOptions, U as USMarket, n as USMinuteKlineOptions, V as USQuote, aD as ZTPoolItem, aC as ZTPoolType, S as default } from './sdk-DGgSDZRx.js';
|
|
3
3
|
export { H as HttpError, P as ProviderName, a as ProviderRequestPolicy, b as RequestError, R as RetryOptions, S as SdkError, g as getSdkErrorCode } from './index-mlzPfoON.js';
|
|
4
|
-
export { CacheOptions, CacheStore, MaybePromise, MemoryCache, MemoryCacheStore, cacheThrough, createCacheKey, getSharedCache } from './cache.js';
|
|
4
|
+
export { CacheOptions, CacheStore, MaybePromise, MemoryCache, MemoryCacheStore, cacheThrough, clearClientScopedCaches, configureSharedCache, createCacheKey, getSharedCache } from './cache.js';
|
|
5
5
|
export { e as ATROptions, A as AnyHistoryKline, d as BIASOptions, B as BOLLOptions, C as CCIOptions, D as DMIOptions, i as DMIResult, w as HKHistoryKline, x as HKMinuteKline, y as HKMinuteTimeline, H as HistoryKline, I as IndicatorOptions, k as KCOptions, l as KCResult, c as KDJOptions, K as KlineWithIndicators, b as MACDOptions, M as MAOptions, m as MARKET_TZ, n as MarketTz, t as MinuteKline, s as MinuteTimeline, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, R as RSIOptions, S as SAROptions, j as SARResult, T as TimeMeta, u as TodayTimeline, v as TodayTimelineResponse, U as USHistoryKline, z as USMinuteKline, E as USMinuteTimeline, W as WROptions, a as addIndicators, o as buildTimeMeta, q as buildTimeMetaFromDateAndTime, r as formatInTz, p as parseMarketTime } from './addIndicators-_V3HEi0q.js';
|
|
6
|
+
export { A as AssetType, E as Exchange, M as Market, N as NormalizedSymbol, a as SymbolInput, S as SymbolRef, n as normalizeSymbol, b as toEastmoneySecid, t as toTencentSymbol } from './adapters-CZUNRbxi.js';
|
|
6
7
|
export { INDICATOR_REGISTRY, IndicatorKey, buildIndicatorContext, calcATR, calcBIAS, calcBOLL, calcCCI, calcDMI, calcEMA, calcKC, calcKDJ, calcMA, calcMACD, calcOBV, calcROC, calcRSI, calcSAR, calcSMA, calcWMA, calcWR, estimateIndicatorLookback, getEnabledIndicatorKeys } from './indicators.js';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
8
|
+
export { d as ChipDistributionItem, b as ChipDistributionOptions, a as ChipHistogram, C as ChipKlineLike, c as calcChipDistribution } from './chip-BbA23rr1.js';
|
|
9
|
+
export { calcSignals } from './signals.js';
|
|
9
10
|
export { BacktestOptions, BacktestReport, ScreenerBuilder, Strategy, StrategySignal, Trade, backtest, screen } from './screener.js';
|
|
11
|
+
export { a as Signal, S as SignalOptions, b as SignalType } from './types-7n5rSHbd.js';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* 响应解析器
|
|
@@ -99,13 +101,16 @@ declare function jsonpRequest<T = unknown>(url: string, options?: JsonpOptions):
|
|
|
99
101
|
*/
|
|
100
102
|
|
|
101
103
|
/**
|
|
102
|
-
*
|
|
104
|
+
* 浏览器端 fetchJsVars 默认共享的 mutex 键。
|
|
103
105
|
*
|
|
104
106
|
* 用全局键(而非按变量名集合算 key)的原因:不同接口的变量名集合常有交集
|
|
105
107
|
* (如 pingzhongdata 的 `fS_code` / `fS_name` 同时被多个接口写入)。按集合
|
|
106
108
|
* 分组的 key 会让"集合不同但有交集"的并发请求互相覆盖全局变量。
|
|
107
109
|
*
|
|
108
|
-
*
|
|
110
|
+
* 代价:默认下任意两个浏览器 fetchJsVars 调用都串行。变量集合与基金系
|
|
111
|
+
* **确定不相交**的数据源(如 smartbox 的 `v_hint`)可用 `options.mutexKey`
|
|
112
|
+
* 声明专属队列,避免被基金大文件下载排队拖慢(R7-5)——同 key 仍串行,
|
|
113
|
+
* 保住自身并发安全。
|
|
109
114
|
*
|
|
110
115
|
* Node 端不走 mutex,不受影响。
|
|
111
116
|
*/
|
|
@@ -115,6 +120,11 @@ interface FetchJsVarsOptions {
|
|
|
115
120
|
timeout?: number;
|
|
116
121
|
/** 额外的 fetch headers(仅 Node 端裸 fetch 路径生效;client 路径请通过 client 配置) */
|
|
117
122
|
headers?: Record<string, string>;
|
|
123
|
+
/**
|
|
124
|
+
* 浏览器端注入互斥队列的 key,默认 {@link BROWSER_JSVARS_MUTEX_KEY}(全局串行)。
|
|
125
|
+
* 仅当变量名集合与其它数据源**确定不相交**时才可指定专属 key。
|
|
126
|
+
*/
|
|
127
|
+
mutexKey?: string;
|
|
118
128
|
/**
|
|
119
129
|
* 可选的 SDK 请求客户端。
|
|
120
130
|
* - 传入:Node 端走 `client.get<string>(url, { responseType: 'text' })`,享受 SDK 重试 /
|
|
@@ -198,6 +208,13 @@ interface DatacenterQuery {
|
|
|
198
208
|
* 命中此上限时会在 console 输出 warning 提示,避免数据被静默截断。
|
|
199
209
|
*/
|
|
200
210
|
maxPages?: number;
|
|
211
|
+
/**
|
|
212
|
+
* 翻页并发波次大小(R7-14),默认 3;设 1 退化为严格串行。
|
|
213
|
+
*
|
|
214
|
+
* ⚠️ 默认部署没有 RateLimiter(仅用户显式配置时创建),并发请求直接
|
|
215
|
+
* 打上游,故默认值保守;配置了限速的用户墙钟收益受限速地板约束。
|
|
216
|
+
*/
|
|
217
|
+
concurrency?: number;
|
|
201
218
|
/** 额外的 quoteColumns 参数(用于行情字段聚合) */
|
|
202
219
|
quoteColumns?: string;
|
|
203
220
|
/** 额外的 quoteType 参数 */
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as pe,b as ue}from"./chunk-OPCBE3NR.js";import{a as le,b as me}from"./chunk-VKXPLWPL.js";import{a as c,b as p,c as u,d as l,e as k,f as S,g,h as R,i as x,j as I,k as b,l as T,m as A,n as K,o as N,p as E,q as D,r as se,s as ie,t as ae,u as ce}from"./chunk-H5FDXQRK.js";import{a as B,b as q,c as U,d as X,e as w,f as F,g as _,h as $,i as G,j as H,k as J,l as P,m as V,n as W,o as v,p as Q,q as Y,r as Z,s as j,t as ee,v as te,w as oe,x as re}from"./chunk-W625VPPB.js";import{f as i,i as L,j as z}from"./chunk-4RN7AVFQ.js";import{a as ne}from"./chunk-LAT6L2TO.js";import{a as y,b as O,c as f,f as C,g as M}from"./chunk-SMCYQ6NL.js";import{a as m,b as d,k as h}from"./chunk-UBIQBXQ7.js";import"./chunk-WOT6VMZA.js";var de={0:"sz",1:"sh",100:"global",105:"us",116:"hk"},he={sh:"CN",sz:"CN",hk:"HK",us:"US"},ke={IXIC:".IXIC",NDX:".NDX",NDX100:".NDX"},Se={IXIC:"NDX",NDX:"NDX",NDX100:"NDX"};function ye(t){return t==="sh"||t==="sz"||t==="hk"||t==="us"||t==="global"}function Oe(t){switch(t.market){case"CN":return t.exchange==="SSE"?"sh":t.exchange==="SZSE"?"sz":"unknown";case"HK":return"hk";case"US":return"us";case"GLOBAL":return"global";default:return"unknown"}}function fe(t){let e=t.code.trim(),o=t.market.trim().toLowerCase(),n=de[t.market]??o,s=ye(n)?n:void 0;if(s==="global")return{code:e.replace(/^\d{3}\./,"").toUpperCase(),market:"global"};try{let r=i(e,s?{market:he[s]}:void 0);if(r.assetType!=="stock")return{code:e,market:"unknown"};let a=s??Oe(r);return a==="unknown"?{code:e,market:"unknown"}:{code:r.market==="US"?r.code.toUpperCase():r.code,market:a}}catch{return{code:e,market:"unknown"}}}function Ce(t,e){return e==="sh"&&t.startsWith("000")||e==="sz"&&t.startsWith("399")}function Me(t){let{code:e,market:o}=t;return(o==="sh"||o==="sz")&&Ce(e,o)?`https://quote.eastmoney.com/zs${e}.html`:o==="sh"||o==="sz"?`https://quote.eastmoney.com/${o}${e}.html`:o==="hk"?`https://quote.eastmoney.com/hk/${e}.html`:o==="us"?`https://quote.eastmoney.com/us/${e}.html`:o==="global"?`https://quote.eastmoney.com/gb/zs${Se[e]??e}.html`:`https://so.eastmoney.com/web/s?keyword=${encodeURIComponent(e)}`}function ge(t){let{code:e,market:o}=t;return o==="sh"||o==="sz"?`https://xueqiu.com/S/${o.toUpperCase()}${e}`:o==="hk"?`https://xueqiu.com/S/${e}`:o==="us"?`https://xueqiu.com/S/${e}`:o==="global"?`https://xueqiu.com/S/${ke[e]??e}`:`https://xueqiu.com/k?q=${encodeURIComponent(e)}`}function Re(t){let e=fe(t);return[{name:"\u4E1C\u65B9\u8D22\u5BCC",url:Me(e)},{name:"\u96EA\u7403",url:ge(e)}]}export{I as BROWSER_JSVARS_MUTEX_KEY,ie as FundService,d as HttpError,ee as INDICATOR_REGISTRY,A as MARKET_TZ,y as MemoryCache,le as MemoryCacheStore,m as SdkError,ae as StockSDK,se as TradingCalendarService,re as addIndicators,S as asyncPool,ue as backtest,j as buildIndicatorContext,N as buildTimeMeta,E as buildTimeMetaFromDateAndTime,me as cacheThrough,P as calcATR,H as calcBIAS,F as calcBOLL,J as calcCCI,Z as calcChipDistribution,v as calcDMI,q as calcEMA,Y as calcKC,_ as calcKDJ,X as calcMA,w as calcMACD,V as calcOBV,W as calcROC,$ as calcRSI,Q as calcSAR,B as calcSMA,ne as calcSignals,U as calcWMA,G as calcWR,k as chunkArray,C as clearClientScopedCaches,f as configureSharedCache,M as createCacheKey,c as decodeGBK,ce as default,oe as estimateIndicatorLookback,g as extractJsonFromJsonp,b as fetchJsVars,D as formatInTz,Re as generateSearchExternalLinks,te as getEnabledIndicatorKeys,h as getSdkErrorCode,O as getSharedCache,R as jsonpRequest,i as normalizeSymbol,T as parseJsVars,K as parseMarketTime,p as parseResponse,u as safeNumber,l as safeNumberOrNull,pe as screen,z as toEastmoneySecid,L as toTencentSymbol,x as withScriptMutex};
|
package/dist/indicators.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkR7M3BHS4cjs = require('./chunk-R7M3BHS4.cjs');require('./chunk-4VDLQK6F.cjs');exports.INDICATOR_REGISTRY = _chunkR7M3BHS4cjs.t; exports.addIndicators = _chunkR7M3BHS4cjs.x; exports.buildIndicatorContext = _chunkR7M3BHS4cjs.s; exports.calcATR = _chunkR7M3BHS4cjs.l; exports.calcBIAS = _chunkR7M3BHS4cjs.j; exports.calcBOLL = _chunkR7M3BHS4cjs.f; exports.calcCCI = _chunkR7M3BHS4cjs.k; exports.calcChipDistribution = _chunkR7M3BHS4cjs.r; exports.calcDMI = _chunkR7M3BHS4cjs.o; exports.calcEMA = _chunkR7M3BHS4cjs.b; exports.calcKC = _chunkR7M3BHS4cjs.q; exports.calcKDJ = _chunkR7M3BHS4cjs.g; exports.calcMA = _chunkR7M3BHS4cjs.d; exports.calcMACD = _chunkR7M3BHS4cjs.e; exports.calcOBV = _chunkR7M3BHS4cjs.m; exports.calcROC = _chunkR7M3BHS4cjs.n; exports.calcRSI = _chunkR7M3BHS4cjs.h; exports.calcSAR = _chunkR7M3BHS4cjs.p; exports.calcSMA = _chunkR7M3BHS4cjs.a; exports.calcWMA = _chunkR7M3BHS4cjs.c; exports.calcWR = _chunkR7M3BHS4cjs.i; exports.estimateIndicatorLookback = _chunkR7M3BHS4cjs.w; exports.getEnabledIndicatorKeys = _chunkR7M3BHS4cjs.v; exports.hasCumulativeIndicator = _chunkR7M3BHS4cjs.u;
|
package/dist/indicators.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { M as MAOptions, F as MAResult, b as MACDOptions, G as MACDResult, B as BOLLOptions, J as BOLLResult, L as OHLCV, c as KDJOptions, N as KDJResult, R as RSIOptions, P as RSIResult, W as WROptions, Q as WRResult, d as BIASOptions, V as BIASResult, C as CCIOptions, X as CCIResult, e as ATROptions, Y as ATRResult, I as IndicatorOptions, Z as PeriodsShorthand, A as AnyHistoryKline } from './addIndicators-_V3HEi0q.cjs';
|
|
2
2
|
export { D as DMIOptions, i as DMIResult, k as KCOptions, l as KCResult, K as KlineWithIndicators, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, S as SAROptions, j as SARResult, a as addIndicators } from './addIndicators-_V3HEi0q.cjs';
|
|
3
|
+
export { d as ChipDistributionItem, b as ChipDistributionOptions, a as ChipHistogram, C as ChipKlineLike, c as calcChipDistribution } from './chip-BbA23rr1.cjs';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* 计算简单移动平均线 SMA
|
package/dist/indicators.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { M as MAOptions, F as MAResult, b as MACDOptions, G as MACDResult, B as BOLLOptions, J as BOLLResult, L as OHLCV, c as KDJOptions, N as KDJResult, R as RSIOptions, P as RSIResult, W as WROptions, Q as WRResult, d as BIASOptions, V as BIASResult, C as CCIOptions, X as CCIResult, e as ATROptions, Y as ATRResult, I as IndicatorOptions, Z as PeriodsShorthand, A as AnyHistoryKline } from './addIndicators-_V3HEi0q.js';
|
|
2
2
|
export { D as DMIOptions, i as DMIResult, k as KCOptions, l as KCResult, K as KlineWithIndicators, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, S as SAROptions, j as SARResult, a as addIndicators } from './addIndicators-_V3HEi0q.js';
|
|
3
|
+
export { d as ChipDistributionItem, b as ChipDistributionOptions, a as ChipHistogram, C as ChipKlineLike, c as calcChipDistribution } from './chip-BbA23rr1.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* 计算简单移动平均线 SMA
|
package/dist/indicators.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}from"./chunk-W625VPPB.js";import"./chunk-WOT6VMZA.js";export{t as INDICATOR_REGISTRY,x as addIndicators,s as buildIndicatorContext,l as calcATR,j as calcBIAS,f as calcBOLL,k as calcCCI,r as calcChipDistribution,o as calcDMI,b as calcEMA,q as calcKC,g as calcKDJ,d as calcMA,e as calcMACD,m as calcOBV,n as calcROC,h as calcRSI,p as calcSAR,a as calcSMA,c as calcWMA,i as calcWR,w as estimateIndicatorLookback,v as getEnabledIndicatorKeys,u as hasCumulativeIndicator};
|