xjs-node 2.0.0 → 2.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -201
- package/build/func/u-file.d.ts +44 -0
- package/build/func/u-file.js +171 -0
- package/build/func/u.d.ts +3 -0
- package/build/func/u.js +51 -0
- package/build/index.d.ts +5 -0
- package/build/index.js +23 -0
- package/build/prcs/http/http-resolver-context.d.ts +59 -0
- package/build/prcs/http/http-resolver-context.js +337 -0
- package/build/prcs/http/http-resolver.d.ts +50 -0
- package/build/prcs/http/http-resolver.js +53 -0
- package/build/prcs/http/i-http-client.d.ts +88 -0
- package/build/prcs/http/i-http-client.js +2 -0
- package/package.json +16 -12
- package/dist/index.js +0 -1
- package/dist/types.d.ts +0 -260
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xjs-node",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1-alpha.1",
|
|
4
4
|
"description": "library modules for nodejs + typescript that bundled general-purpose implementations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,30 +8,34 @@
|
|
|
8
8
|
},
|
|
9
9
|
"keywords": [
|
|
10
10
|
"nodejs",
|
|
11
|
+
"javascript",
|
|
11
12
|
"typescript",
|
|
12
13
|
"utility"
|
|
13
14
|
],
|
|
14
15
|
"scripts": {
|
|
15
|
-
"build": "
|
|
16
|
-
"
|
|
17
|
-
"test": "tsc -p ./tsconfig-test.json && node ./compiled/test/test.js"
|
|
16
|
+
"build": "rm -rdf ./build && tsc",
|
|
17
|
+
"test": "tsx ./src/test/test.ts"
|
|
18
18
|
},
|
|
19
19
|
"author": "begyyal",
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"files": [
|
|
22
|
-
"
|
|
23
|
-
"!/
|
|
22
|
+
"build",
|
|
23
|
+
"!/build/test*"
|
|
24
24
|
],
|
|
25
|
-
"main": "./
|
|
26
|
-
"types": "./
|
|
25
|
+
"main": "./build/index",
|
|
26
|
+
"types": "./build/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": [
|
|
29
|
+
"./build/index",
|
|
30
|
+
"./build/index.d.ts"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
27
33
|
"devDependencies": {
|
|
28
34
|
"@types/node": "^24.2.1",
|
|
29
35
|
"tsx": "^4.20.3",
|
|
30
|
-
"typescript": "^5.8.3"
|
|
31
|
-
"webpack": "^5.101.0",
|
|
32
|
-
"webpack-cli": "^6.0.1"
|
|
36
|
+
"typescript": "^5.8.3"
|
|
33
37
|
},
|
|
34
38
|
"dependencies": {
|
|
35
|
-
"xjs-common": "^11.0.
|
|
39
|
+
"xjs-common": "^11.0.1-alpha.3"
|
|
36
40
|
}
|
|
37
41
|
}
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["xjs-node"]=t():e["xjs-node"]=t()}(this,()=>{return e={16:e=>{"use strict";e.exports=require("url")},106:e=>{"use strict";e.exports=require("zlib")},203:e=>{"use strict";e.exports=require("stream")},251:function(e){var t;t=()=>(()=>{"use strict";var e,t,r,n,o={d:(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{DType:()=>b,Gender:()=>r,HttpMethod:()=>n,TimeUnit:()=>t,Type:()=>e,UArray:()=>_,UHttp:()=>x,UObj:()=>j,UString:()=>v,UType:()=>w,XjsErr:()=>u,array2map:()=>p,bitor:()=>y,delay:()=>d,getJSTDate:()=>f,int2array:()=>h,resolveCcy:()=>a,retry:()=>m,s_ccy:()=>c,transaction:()=>P}),function(e){e.string="string",e.number="number",e.bigint="bigint",e.boolean="boolean",e.symbol="symbol",e.object="object",e[void 0]="undefined",e.null="null"}(e||(e={})),function(e){e[e.Year=1]="Year",e[e.Month=2]="Month",e[e.Day=3]="Day",e[e.Hour=4]="Hour",e[e.Min=5]="Min",e[e.Sec=6]="Sec",e[e.Msec=7]="Msec"}(t||(t={})),function(e){e[e.Male=0]="Male",e[e.Female=1]="Female"}(r||(r={})),function(e){e.Get="GET",e.Put="PUT",e.Post="POST",e.Delete="DELETE",e.Patch="PATCH",e.Connect="CONNECT"}(n||(n={}));const s={jpy:{crossUsd:"usd/jpy"},usd:{crossUsd:null},gbp:{crossUsd:"gbp/usd"},eur:{crossUsd:"eur/usd"},cad:{crossUsd:"cad/usd"},aud:{crossUsd:"aud/usd"}},c=(Object.entries(s).forEach(e=>{e[1].symbol=e[0],s[e[0]]=Object.freeze(e[1])}),Object.freeze(s));function a(e){const t=Object.keys(c).find(t=>e?.toLowerCase()==t);return t&&c[t]}class u extends Error{code;origin;constructor(e,t,r){super(`[XJS] ${t}`),this.code=e,this.origin=r}}const l=10;function f(e){return new Date((e?e.getTime():Date.now())+324e5)}function d(e){return new Promise(t=>setTimeout(t,1e3*e))}function h(e){const t=Number(e);if(Number.isNaN(t))throw new u(l,"size of the argument is not number.");return Array.from(Array(t).keys())}function p(e,t){const r=new Map;for(const n of e){const e=t(n);r.has(e)?r.get(e).push(n):r.set(e,[n])}return r}function y(...e){return e.reduce((e,t)=>e|t)}function m(e,t){const r=t?.logger??console,n=t?.count??1,o=e=>!(t?.errorCriterion&&!t.errorCriterion(e)||(r.warn(e),0)),i=r=>{if(r<0)throw new u(l,"failure exceeds retryable count.");let s=null;const c=()=>{try{s=e()}catch(e){if(!o(e))throw e;s=i(r-1)}return s instanceof Promise?new Promise((e,t)=>s.then(e).catch(n=>{o(n)?e(i(r-1)):t(n)})):s};return r<n&&t?.intervalPredicate&&(s=t?.intervalPredicate()),s instanceof Promise?s.then(()=>c()):c()};return i(n)}const g=Symbol.for("xjs:typeMap");var b,w,j,v,_,x;!function(t){function r(e,t,r){n(e,t,e=>{if(e.t)throw new u(30,"decorator to express type is duplicate.");e.t=r})}function n(e,t,r){const n=e[g]?Object.assign({},e[g]):{};n[t]??={t:null,req:!1,rec:!1,ary:null};const o=n[t];r(o);let i=null,s=null;if(o.t&&o.rec&&(i="type",s="recursive flag"),o.t&&o.ary&&(i="type",s="array"),o.ary&&o.rec&&(i="array",s="recursive flag"),i&&s)throw new u(30,`decorator to express ${i} and ${s} are exclusive.`);Object.defineProperty(e,g,{value:n,configurable:!0})}t.string=function(t,n){r(t,n,e.string)},t.number=function(t,n){r(t,n,e.number)},t.boolean=function(t,n){r(t,n,e.boolean)},t.required=function(e,t){n(e,t,e=>e.req=!0)},t.array=function(e={}){return(t,r)=>n(t,r,t=>t.ary=e)},t.recursive=function(e,t){n(e,t,e=>e.rec=!0)},t.keep=function(e,t){n(e,t,e=>{})}}(b||(b={})),function(t){function r(t){return null===t||typeof t===e.undefined}function n(e){return e[g]?Object.entries(e[g]).flatMap(t=>o(t[0],e[t[0]],t[1])):[]}function o(e,t,i){return r(t)?i.req?[e]:[]:i.t&&typeof t!==i.t?[e]:i.ary?Array.isArray(t)?t.flatMap(t=>o(e,t,i.ary)):[e]:i.rec?n(t).flatMap(t=>`${e}.${t}`):[]}t.isDefined=function(t){return typeof t!==e.undefined},t.isEmpty=r,t.isString=function(t){return typeof t===e.string},t.isNumber=function(t){return typeof t===e.number},t.isBigint=function(t){return typeof t===e.bigint},t.isBoolean=function(t){return typeof t===e.boolean},t.isSymbol=function(t){return typeof t===e.symbol},t.isObject=function(t){return typeof t===e.object},t.isArray=function(e,t){return Array.isArray(e)&&(!t||e.every(e=>typeof e===t))},t.validate=n,t.takeAsArray=function(e){return Array.isArray(e)?e:[e]}}(w||(w={})),function(e){e.assignProperties=function e(t,r,n,o){for(const i of n??Object.keys(r))w.isDefined(r[i])&&(o&&w.isObject(t[i])&&w.isObject(r[i])&&t[i]?.[g]?e(t[i],r[i],null,!0):t[i]=r[i]);return t},e.crop=function e(t,r,n){if(!r&&!t[g])return{};const o=r??Object.keys(t[g]);return Object.keys(t).filter(i=>(!r&&t[g]?.[i]?.rec&&t[i]&&e(t[i]),!!n===o.includes(i))).forEach(e=>delete t[e]),t}}(j||(j={})),function(e){function r(e,t){const r=e.toString().split("."),n=r[0].split("").reverse().join("");let o="";const i=Math.ceil(n.length/3);for(let e=0;e<i;e++)o+=e===i-1?n.substring(3*e):n.substring(3*e,3*(e+1))+",";const s=t+o.split("").reverse().join("");return 1===r.length?s:s+"."+r[1]}e.eq=function(e,t){return w.isString(e)&&w.isString(t)?e.trim()===t.trim():e===t},e.repeat=function(e,t){return h(t).map(t=>e).join("")},e.simpleTime=function(e){const r=(e?.date??new Date).toISOString().split(".")[0].replace(/[-T:]/g,"");return e?.unit===t.Msec?r:r.substring(0,14-2*(6-(e?.unit??t.Sec)))},e.generateRandomString=function(e){return h(e).map(e=>{let t=Math.floor(62*Math.random());const r=t-52;return r>=0?r.toString():(t>26&&(t+=6),String.fromCharCode(t+65))}).join("")},e.idx2az=function(e){let t="",r=e;for(;r>=0;)t=String.fromCharCode(r%26+97)+t,r=Math.floor(r/26)-1;return t.toUpperCase()},e.az2idx=function(e){if(!e?.match(/^[a-zA-Z]+$/))throw new u(20,"the parameter isn't az(AZ) format.");return e.toLowerCase().split("").map(e=>e.charCodeAt(0)-97).reverse().map((e,t)=>(e+1)*26**t).reduce((e,t)=>e+t)-1},e.asJpy=function(e){return w.isEmpty(e)?"":r(Math.floor(e),"¥")},e.asUsd=function(e){return w.isEmpty(e)?"":r(Number(e.toFixed(2)),"$")},e.asPercentage=function(e){if(w.isEmpty(e))return"";let t=(100*e).toFixed(2);for(;t.endsWith("0");)t=t.substring(0,t.length-1);return t.endsWith(".")&&(t=t.substring(0,t.length-1)),t+"%"},e.is_yyyy=function(e){return!!e?.match(/^[1-9]\d{3}$/)},e.is_yyyyMM=function(e){return!!e?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])$/)},e.is_yyyyMMdd=function(e){return!!e?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])$/)},e.is_yyyyMMddhh=function(e){return!!e?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])([01]\d|2[0-3])$/)},e.is_yyyyMMddhhmm=function(e){return!!e?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])([01]\d|2[0-3])[0-5]\d$/)},e.is_yyyyMMddhhmmss=function(e){return!!e?.match(/^[1-9]\d{3}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|[3][0-1])([01]\d|2[0-3])[0-5]\d[0-5]\d$/)}}(v||(v={})),function(e){function t(e,t=!0){const r=Math.floor(e.length*Math.random()),n=e[r];return t&&e.splice(r,1),n}e.eq=function(e,t,r={}){const{sort:n,useStrictEqual:o}=Object.assign({sort:!0,useStrictEqual:!0},r);if(e&&!t||!e&&t)return!1;if(!e)return!0;if(e.length!==t.length)return!1;const i=n?[...e].sort():e,s=n?[...t].sort():t;return i.every((e,t)=>o?e===s[t]:e==s[t])},e.distinct=function(e,t){if(!e||0===e.length)return[];if(t?.k)return Array.from(p(e,e=>e[t.k]).values()).map(e=>t?.takeLast?e.pop():e.shift());const r=t?.takeLast?[...e].reverse():[...e],n=t?.predicate??((e,t)=>e==t),o=[r.shift()];return r.forEach(e=>o.some(t=>n(e,t))?{}:o.push(e)),o},e.chop=function(e,t){return[...Array(Math.ceil(e.length/t)).keys()].map(r=>{let n=(r+1)*t;return n>e.length&&(n=e.length),e.slice(r*t,n)})},e.remove=function(e,t){const r=e.indexOf(t);-1!==r&&e.splice(r,1)},e.randomPick=t,e.shuffle=function(e){const r=[...e];return h(e.length).map(e=>t(r))},e.takeOut=function(e,t){const r=[];for(let n=e.length-1;n>=0;n--)t(e[n],n)&&(r.unshift(e[n]),e.splice(n,1));return r}}(_||(_={})),function(e){function t(e){return Math.floor(e/100)}e.isHttpSuccess=function(e){return 2===t(e)},e.statusCategoryOf=t,e.concatParamsWithEncoding=function(e,t){if(!t||0===Object.keys(t).length)return e;const r=Object.entries(t).flatMap(e=>Array.isArray(e[1])?e[1].map(t=>[e[0],t]):[e]);let n=e?e+"?":"";for(var o of r)n+=o[0]+"="+encodeURIComponent(o[1])+"&";return n.substring(0,n.length-1)},e.normalizeHeaders=function(e){return e?Object.entries(e).reduce((e,t)=>(e[t[0].toLowerCase()]=t[1],e),{}):{}}}(x||(x={}));const O=100;function P(e){let t=0;const r=e?.timeoutSec??30;return(e,n,o)=>{const i=o.value;o.value=async function(...e){const n=Date.now()+1e3*r;for(;t>0;){if(n<=Date.now())throw new u(O,"An exclusive process to execute was already running by other request.");await d(1)}try{t++;const r=i.apply(this,e);return r instanceof Promise?await r:r}finally{t--}}}}return i})(),e.exports=t()},278:e=>{"use strict";e.exports=require("net")},290:e=>{"use strict";e.exports=require("async_hooks")},317:e=>{"use strict";e.exports=require("child_process")},582:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.UFile=void 0;const c=r(317),a=s(r(896)),u=r(251),l=r(827),f=1040;var d;!function(e){function t(e){return!!e&&a.existsSync((0,l.joinPath)(e))}e.mkdir=function(e){const t=(0,l.joinPath)(e),r=a.existsSync(t);if(r){if(!a.statSync(t).isDirectory())throw new u.XjsErr(f,"Already exists a file (not directory) on the path.")}else a.mkdirSync(t,{recursive:!0});return!r},e.write=function(e,t){a.writeFileSync((0,l.joinPath)(e),t)},e.rm=function(e){const t=(0,l.joinPath)(e);a.existsSync(t)&&a.rmSync(t,{recursive:!0})},e.exists=t,e.status=function(e){const t=(0,l.joinPath)(e);return a.existsSync(t)?a.statSync(t):null},e.read=function(e,t){const r=(0,l.joinPath)(e);if(!a.existsSync(r))throw new u.XjsErr(f,`No file found => ${r}`);return a.readFileSync(r,t)},e.cp=function(e,t){const r=(0,l.joinPath)(e),n=(0,l.joinPath)(t);if(!a.existsSync(r))throw new u.XjsErr(f,`No file found => ${r}`);a.copyFileSync(r,n)},e.mv=function(e,t){const r=(0,l.joinPath)(e),n=(0,l.joinPath)(t);if(!a.existsSync(r))throw new u.XjsErr(f,`No file found => ${r}`);a.renameSync(r,n)},e.ls=function(e){const t=(0,l.joinPath)(e);if(!t||!a.statSync(t).isDirectory())throw new u.XjsErr(f,"Specified path for ls is not directory.");return a.readdirSync(t)},e.reserveFilePath=function(e,t){const r=(0,l.joinPath)(e);if(!r||!a.statSync(r).isDirectory())throw new u.XjsErr(f,"Specified directory path is not directory.");if(!t||t.match(/[\\/:*?"<>|]/))throw new u.XjsErr(f,"Specified filename is invalid due to empty or including disallowed characters.");let n=(0,l.joinPath)(r,t),o=1;for(;a.existsSync(n);)n=(0,l.joinPath)(r,`${t}.${o++}`);return n},e.unzip=function(e,r){if(!t(e))throw new u.XjsErr(f,"There is no file on the zip path.");if(r&&!t(r))throw new u.XjsErr(f,"The destination directory is not found.");let n="unzip",o=null,i=!0;r&&(o=`-d "${r}"`);const s=()=>{try{(0,c.execSync)(`${n} --help`,{stdio:"ignore"})}catch{i=!1}};if(s(),"win32"===process.platform)i||(n="tar",o="-xf",i=!0,r&&(o=`-C "${r}" ${o}`),s());else if("linux"!==process.platform)throw new u.XjsErr(f,"The os running on is not supported for xjs unzip.");if(!i)throw new u.XjsErr(f,`"${n}" command is not installed.`);try{(0,c.execSync)([n,o,`"${e}"`].filter(e=>e).join(" "),{stdio:"ignore"})}catch(e){throw new u.XjsErr(f,"Something went wrong at unzip.",e)}}}(d||(t.UFile=d={}))},611:e=>{"use strict";e.exports=require("http")},692:e=>{"use strict";e.exports=require("https")},756:e=>{"use strict";e.exports=require("tls")},794:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpResolver=void 0;const n=r(251),o=r(868);t.HttpResolver=class{_baseCmv;_l;constructor(e=138,t=console){this._baseCmv=e,this._l=t}newContext(e){return new o.HttpResolverContext(this.fixCmv(),e,this._l)}async get(e,t){let r=t?.redirectAsNewRequest&&-1;const o=()=>{const e=Object.assign({},t);return r&&Object.assign(e,{outerRedirectCount:++r}),e};try{return await this.newContext(t).get(e,o())}catch(e){if(e instanceof n.XjsErr&&-1===e.code)return await this.newContext(t).get(e.message,o());throw e}}async post(e,t,r){return await this.newContext(r).post(e,t,r)}fixCmv(){return this._baseCmv-Math.floor(5*Math.random())}}},827:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.checkPortAvailability=function(e){return new Promise(t=>{const n=r(278).createServer();n.once("error",()=>t(!1)).once("listening",()=>{n.close(),t(!0)}).listen(e)})},t.joinPath=function(...e){return c.join(...e.flatMap(a.UType.takeAsArray))};const c=s(r(928)),a=r(251)},868:function(e,t,r){"use strict";var n,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&o(t,e,r[s]);return i(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.HttpResolverContext=t.s_clientMode=void 0;const c=s(r(756)),a=s(r(106)),u=s(r(896)),l=s(r(928)),f=r(16),d=r(692),h=r(611),p=r(290),y=r(582),m=r(827),g=r(251),b=r(203);t.s_clientMode={nodejs:{id:0,cipherOrder:null},chrome:{id:1,cipherOrder:[2,0,1]},firefox:{id:2,cipherOrder:[2,1,0]}};const w=1200,j=new Map([[t.s_clientMode.firefox,e=>({accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.5","sec-fetch-dest":"document","sec-fetch-mode":"navigate","sec-fetch-site":"none","sec-fetch-user":"?1","upgrade-insecure-requests":"1","user-agent":`Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:${e}.0) Gecko/20100101 Firefox/${e}.0`})],[t.s_clientMode.chrome,e=>{const t={accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.9","sec-ch-ua":e<130?`"Not/A)Brand";v="8", "Chromium";v="${e}", "Google Chrome";v="${e}"`:`"Chromium";v="${e}", "Not:A-Brand";v="24", "Google Chrome";v="${e}"`,"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"document","sec-fetch-mode":"navigate","sec-fetch-site":"none","sec-fetch-user":"?1","upgrade-insecure-requests":"1","user-agent":`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${e}.0.0.0 Safari/537.36`};return e>=124&&(t.priority="u=0, i"),t}]]);t.HttpResolverContext=class{cmv;_l;_als=new p.AsyncLocalStorage;_mode;_ciphers;_proxyConfig;_chHeaders;_cookies;get clientMode(){return Object.keys(t.s_clientMode).find((e,t)=>t===this._mode.id)}constructor(e,r,n=console){this.cmv=e,this._l=n,this._mode=r?.mode??g.UArray.randomPick([t.s_clientMode.chrome,t.s_clientMode.firefox]),this._proxyConfig=r?.proxy,this._mode.id>0&&(this._ciphers=this.createCiphers(this._mode),this._chHeaders=j.get(this._mode)(this.cmv))}async get(e,t){const r=new f.URL(e),n=this._proxyConfig&&await this.createProxyAgent(r),o={redirectCount:t?.outerRedirectCount??0,proxyAgent:n};return Object.assign(o,t),await this._als.run(o,this.getIn,r).finally(()=>n?.destroy())}async post(e,t,r){const n=new f.URL(e),o=this._proxyConfig&&await this.createProxyAgent(n),i={redirectCount:0,proxyAgent:o};return Object.assign(i,r),await this._als.run(i,this.postIn,n,t).finally(()=>o?.destroy())}createProxyAgent(e){const t=this._proxyConfig;return new Promise((r,n)=>{const o={};t.auth&&(o["proxy-authorization"]=`Basic ${Buffer.from(t.auth.name+":"+t.auth.pass).toString("base64")}`);const i=(0,h.request)({host:t.server,port:t.port,method:g.HttpMethod.Connect,path:`${e.hostname}:443`,headers:o}).on("connect",(e,t)=>{200===e.statusCode?r(new d.Agent({socket:t,keepAlive:!0})):n(new g.XjsErr(w,"Could not connect to proxy."))});i.on("error",n),i.on("timeout",()=>{i.destroy(),n(new g.XjsErr(w,"The http request timeout, maybe server did not respond."))}),i.end()})}getIn=async e=>{const t={},r=this._als.getStore();return t.method=g.HttpMethod.Get,t.headers=g.UHttp.normalizeHeaders(r.headers),await this.reqHttps(e,t)};postIn=async(e,t)=>{const r={},n=this._als.getStore();r.method=g.HttpMethod.Post,r.headers=g.UHttp.normalizeHeaders(n.headers);let o=t;return o instanceof b.Stream?r.headers["content-type"]??="application/octet-stream":g.UType.isObject(t)&&(o=JSON.stringify(t),r.headers["content-length"]=o.length,r.headers["content-type"]="application/json"),await this.reqHttps(e,r,o)};reqHttps(e,t,r){const n=this._als.getStore();return t.timeout=n.timeout??0,t.protocol=e.protocol,t.host=e.host,t.path=n.ignoreQuery||!e.search?e.pathname:`${e.pathname}${e.search}`,t.agent=n.proxyAgent,this._mode.id>0&&(t.ciphers=this._ciphers,t.headers=t.headers?Object.assign(t.headers,this._chHeaders):this._chHeaders),this._cookies&&this.setCookies(t.headers),new Promise((e,o)=>{const i=(0,d.request)(t,r=>this.processResponse(e,o,n,t.host,r));i.on("error",o),i.on("timeout",()=>{i.destroy(),o(new g.XjsErr(w,"The http request timeout, maybe server did not respond."))}),r instanceof b.Stream?r.pipe(i,{end:!0}):(r&&i.write(r),i.end())})}processResponse(e,t,r,n,o){o.headers["set-cookie"]&&this.storeCookies(o.headers["set-cookie"]);const i=g.UHttp.statusCategoryOf(o.statusCode);if(3===i)return void this.handleRedirect(o,n).then(e).catch(t).finally(()=>o.destroy());if(o.headers["content-disposition"]?.trim().startsWith("attachment"))try{const n=this.resolveDownloadPath(r.downloadPath,o.headers["content-disposition"]),i=u.createWriteStream(n);return o.pipe(i),i.on("finish",()=>i.close()),i.on("close",()=>e({headers:o.headers})),void i.on("error",t)}catch(e){e instanceof g.XjsErr?t(e):(this.error(e),t(new g.XjsErr(w,"Failed to download a file.")))}const s=[],c=o.headers["content-encoding"]?.toLocaleLowerCase();o.on("data",e=>s.push(e)),o.on("end",()=>{try{let n=Buffer.concat(s);"gzip"==c?n=a.gunzipSync(n):"br"==c&&(n=a.brotliDecompressSync(n));const u="buffer"===r.responseType?n:n.toString("utf8");2!==i?(g.UType.isString(u)&&u.trim()&&this.warn(u),t(new g.XjsErr(w,`Https received a error status ${o.statusCode}`))):e({payload:u,headers:o.headers})}catch(e){t(e)}})}resolveDownloadPath(e,t){const r=e=>{const r=t.split(";").find(e=>e.trim().startsWith("filename"))?.replace(/^\s+filename\s+=/,"").trim()??y.UFile.reserveFilePath(e,`xjs-download_${g.UString.simpleTime()}`);return(0,m.joinPath)(e,r)};if(e){const t=y.UFile.status(e);if(!t||t.isFile()){if(!y.UFile.exists(l.dirname(e)))throw new g.XjsErr(w,"Directory of the download file was not found.");return e}if(t.isDirectory()){if(!y.UFile.exists(e))throw new g.XjsErr(w,"Directory of the download path was not found.");return r(e)}}return r("./")}async handleRedirect(e,t){const r=this._als.getStore();if(!e.headers.location)throw new g.XjsErr(w,"Received http redirection, but no location header found.");if(r.redirectCount++>5)throw new g.XjsErr(w,"Count of http redirection exceeds limit.");this.log(`Redirect to ${e.headers.location}. (count is ${r.redirectCount})`);const n=e.headers.location.startsWith("http")?e.headers.location:`https://${t}${e.headers.location}`;if(r.outerRedirectCount)throw new g.XjsErr(-1,n);const o=new f.URL(n);return r.proxyAgent&&(r.proxyAgent?.destroy(),r.proxyAgent=await this.createProxyAgent(o)),await this.getIn(o)}createCiphers(e){const t=c.DEFAULT_CIPHERS.split(":");return[t[e.cipherOrder[0]],t[e.cipherOrder[1]],t[e.cipherOrder[2]],...g.UArray.shuffle(t.slice(3))].join(":")}setCookies(e){const t=this._cookies.expires;t&&new Date(t).getTime()<=Date.now()?(this._cookies=null,this.log("Cookies was cleared due to an expiraion.")):e.cookie=Object.keys(this._cookies).filter(e=>!["expires","max-age"].includes(e)).map(e=>`${e}=${this._cookies[e]};`).join(" ")}storeCookies(e){this._cookies??={},e.filter(e=>e).flatMap(e=>e.split(";")).map(e=>{const t=e.indexOf("=");return-1!==t&&[e.substring(0,t).toLowerCase().trim(),e.substring(t+1)]}).filter(e=>e&&e[0]&&!["secure","path","domain","samesite"].includes(e[0])).forEach(e=>this._cookies[e[0]]=e[1]),this.log("Store cookies from set-cookie headers."),this.log(JSON.stringify(this._cookies))}log(e){this._l.log(`[http-resolver] ${e}`)}warn(e){this._l.warn(`[http-resolver] ${e}`)}error(e){this._l.error(`[http-resolver] ${e}`)}}},896:e=>{"use strict";e.exports=require("fs")},921:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.s_clientMode=t.HttpResolver=void 0,o(r(827),t),o(r(582),t);var i=r(794);Object.defineProperty(t,"HttpResolver",{enumerable:!0,get:function(){return i.HttpResolver}});var s=r(868);Object.defineProperty(t,"s_clientMode",{enumerable:!0,get:function(){return s.s_clientMode}})},928:e=>{"use strict";e.exports=require("path")}},t={},function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}(921);var e,t});
|
package/dist/types.d.ts
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
declare module "func/u" {
|
|
2
|
-
import { MaybeArray } from "xjs-common";
|
|
3
|
-
export function checkPortAvailability(port: number): Promise<boolean>;
|
|
4
|
-
export function joinPath(...p: MaybeArray<string>[]): string;
|
|
5
|
-
}
|
|
6
|
-
declare module "func/u-file" {
|
|
7
|
-
import { MaybeArray } from "xjs-common";
|
|
8
|
-
interface FileStatus {
|
|
9
|
-
isFile(): boolean;
|
|
10
|
-
isDirectory(): boolean;
|
|
11
|
-
isBlockDevice(): boolean;
|
|
12
|
-
isCharacterDevice(): boolean;
|
|
13
|
-
isSymbolicLink(): boolean;
|
|
14
|
-
isFIFO(): boolean;
|
|
15
|
-
isSocket(): boolean;
|
|
16
|
-
}
|
|
17
|
-
export namespace UFile {
|
|
18
|
-
function mkdir(p: MaybeArray<string>): boolean;
|
|
19
|
-
function write(p: MaybeArray<string>, c: string): void;
|
|
20
|
-
/**
|
|
21
|
-
* remove a file. no error if the file to be removed doesn't exist.
|
|
22
|
-
*/
|
|
23
|
-
function rm(p: MaybeArray<string>): void;
|
|
24
|
-
function exists(p: MaybeArray<string>): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* return a file status. if the file of the status doesn't exist, this returns `null`.
|
|
27
|
-
*/
|
|
28
|
-
function status(p: MaybeArray<string>): FileStatus;
|
|
29
|
-
function read(p: MaybeArray<string>): Buffer;
|
|
30
|
-
function read(p: MaybeArray<string>, encoding: BufferEncoding): string;
|
|
31
|
-
function cp(from: MaybeArray<string>, to: MaybeArray<string>): void;
|
|
32
|
-
function mv(from: MaybeArray<string>, to: MaybeArray<string>): void;
|
|
33
|
-
function ls(p: MaybeArray<string>): string[];
|
|
34
|
-
/**
|
|
35
|
-
* check availability to export a file with specified directory and file name.
|
|
36
|
-
* if it doesn't, retry to check after appending incremental number (e.g. `.1`) to the filename.
|
|
37
|
-
* @param dir destination directory path.
|
|
38
|
-
* @param fname file name wanna export to.
|
|
39
|
-
* @returns exportable file path.
|
|
40
|
-
*/
|
|
41
|
-
function reserveFilePath(dir: MaybeArray<string>, fname: string): string;
|
|
42
|
-
/**
|
|
43
|
-
* decompress zip file. this depends on os enviroment due to using the os command.
|
|
44
|
-
* currently this supports only windows (installed `tar` or `unzip` in gnu compiler) and linux systems (installed `unzip`).
|
|
45
|
-
* @param zipPath zip file to be unzipped.
|
|
46
|
-
* @param destDir directory that the decompress files export to.
|
|
47
|
-
*/
|
|
48
|
-
function unzip(zipPath: MaybeArray<string>, destDir?: MaybeArray<string>): void;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
declare module "prcs/http/i-http-client" {
|
|
52
|
-
import { IncomingHttpHeaders, OutgoingHttpHeaders } from "http";
|
|
53
|
-
import { ClientMode, ProxyConfig } from "prcs/http/http-resolver";
|
|
54
|
-
export interface ClientOption {
|
|
55
|
-
/**
|
|
56
|
-
* {@link s_clientMode} that is imitated. default is random between chrome or firefox.
|
|
57
|
-
*/
|
|
58
|
-
mode?: ClientMode;
|
|
59
|
-
/**
|
|
60
|
-
* proxy configuration.
|
|
61
|
-
*/
|
|
62
|
-
proxy?: ProxyConfig;
|
|
63
|
-
}
|
|
64
|
-
export interface RequestOption {
|
|
65
|
-
headers?: OutgoingHttpHeaders;
|
|
66
|
-
/**
|
|
67
|
-
* if true, query part in the `url` is ignored.
|
|
68
|
-
*/
|
|
69
|
-
ignoreQuery?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* destination directory or file path for download. this is only used when `Content-Disposition` header exists.
|
|
72
|
-
* default is current directory of the process with `filename` of the disposition.
|
|
73
|
-
*/
|
|
74
|
-
downloadPath?: string;
|
|
75
|
-
/**
|
|
76
|
-
* timeout milliseconds to wait for socket inactivity. default is infinity.
|
|
77
|
-
*/
|
|
78
|
-
timeout?: number;
|
|
79
|
-
/**
|
|
80
|
-
* type of response payload. default is string (utf-8).
|
|
81
|
-
*/
|
|
82
|
-
responseType?: "string" | "buffer";
|
|
83
|
-
}
|
|
84
|
-
export interface HttpResponse<T = string | Buffer> {
|
|
85
|
-
/**
|
|
86
|
-
* http headers in the response.
|
|
87
|
-
*/
|
|
88
|
-
headers?: IncomingHttpHeaders;
|
|
89
|
-
/**
|
|
90
|
-
* response payload which has a type depends on {@link RequestOption.responseType}.
|
|
91
|
-
*/
|
|
92
|
-
payload?: T;
|
|
93
|
-
}
|
|
94
|
-
export interface IHttpClient {
|
|
95
|
-
/**
|
|
96
|
-
* request GET to the url with new context.
|
|
97
|
-
* @param url target url. (currently https only)
|
|
98
|
-
* @param op.headers http headers.
|
|
99
|
-
* @param op.mode {@link s_clientMode} that is imitated. default is random between chrome or firefox.
|
|
100
|
-
* @param op.proxy proxy configuration.
|
|
101
|
-
* @param op.ignoreQuery {@link RequestOption.ignoreQuery}
|
|
102
|
-
* @param op.downloadPath {@link RequestOption.downloadPath}
|
|
103
|
-
* @param op.timeout {@link RequestOption.timeout}
|
|
104
|
-
* @param op.responseType {@link RequestOption.responseType}
|
|
105
|
-
* @param op.redirectAsNewRequest handle redirect as new request. this may be efficient when using proxy which is implemented reverse proxy.
|
|
106
|
-
* @returns http response. {@link HttpResponse}
|
|
107
|
-
*/
|
|
108
|
-
get(url: string, op?: RequestOption & ClientOption & {
|
|
109
|
-
redirectAsNewRequest?: boolean;
|
|
110
|
-
responseType: "string";
|
|
111
|
-
}): Promise<HttpResponse<string>>;
|
|
112
|
-
get(url: string, op?: RequestOption & ClientOption & {
|
|
113
|
-
redirectAsNewRequest?: boolean;
|
|
114
|
-
responseType: "buffer";
|
|
115
|
-
}): Promise<HttpResponse<Buffer>>;
|
|
116
|
-
get(url: string, op?: RequestOption & ClientOption & {
|
|
117
|
-
redirectAsNewRequest?: boolean;
|
|
118
|
-
}): Promise<HttpResponse<string>>;
|
|
119
|
-
/**
|
|
120
|
-
* request POST to the url with new context.
|
|
121
|
-
* @param url target url. (currently https only)
|
|
122
|
-
* @param payload request payload. if this is a Stream, pipe will be used, otherwise if an object, this is treated as json.
|
|
123
|
-
* @param op.headers http headers.
|
|
124
|
-
* @param op.mode {@link s_clientMode} that is imitated. default is random between chrome or firefox.
|
|
125
|
-
* @param op.proxy proxy configuration.
|
|
126
|
-
* @param op.ignoreQuery {@link RequestOption.ignoreQuery}
|
|
127
|
-
* @param op.downloadPath {@link RequestOption.downloadPath}
|
|
128
|
-
* @param op.timeout {@link RequestOption.timeout}
|
|
129
|
-
* @param op.responseType {@link RequestOption.responseType}
|
|
130
|
-
* @returns http response. {@link HttpResponse}
|
|
131
|
-
*/
|
|
132
|
-
post(url: string, payload: any, op?: RequestOption & ClientOption & {
|
|
133
|
-
responseType: "string";
|
|
134
|
-
}): Promise<HttpResponse<string>>;
|
|
135
|
-
post(url: string, payload: any, op?: RequestOption & ClientOption & {
|
|
136
|
-
responseType: "buffer";
|
|
137
|
-
}): Promise<HttpResponse<Buffer>>;
|
|
138
|
-
post(url: string, payload: any, op?: RequestOption & ClientOption): Promise<HttpResponse<string>>;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
declare module "prcs/http/http-resolver-context" {
|
|
142
|
-
import { ClientOption, HttpResponse, IHttpClient, RequestOption } from "prcs/http/i-http-client";
|
|
143
|
-
import { Loggable } from "xjs-common";
|
|
144
|
-
export const s_clientMode: {
|
|
145
|
-
nodejs: {
|
|
146
|
-
id: number;
|
|
147
|
-
cipherOrder: any;
|
|
148
|
-
};
|
|
149
|
-
chrome: {
|
|
150
|
-
id: number;
|
|
151
|
-
cipherOrder: number[];
|
|
152
|
-
};
|
|
153
|
-
firefox: {
|
|
154
|
-
id: number;
|
|
155
|
-
cipherOrder: number[];
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
export class HttpResolverContext implements IHttpClient {
|
|
159
|
-
readonly cmv: number;
|
|
160
|
-
private _l;
|
|
161
|
-
private readonly _als;
|
|
162
|
-
private readonly _mode;
|
|
163
|
-
private readonly _ciphers;
|
|
164
|
-
private readonly _proxyConfig?;
|
|
165
|
-
private readonly _chHeaders;
|
|
166
|
-
private _cookies?;
|
|
167
|
-
get clientMode(): string;
|
|
168
|
-
constructor(cmv: number, op?: ClientOption, _l?: Loggable);
|
|
169
|
-
get(url: string, op?: RequestOption & {
|
|
170
|
-
outerRedirectCount?: number;
|
|
171
|
-
responseType: "string";
|
|
172
|
-
}): Promise<HttpResponse<string>>;
|
|
173
|
-
get(url: string, op?: RequestOption & {
|
|
174
|
-
outerRedirectCount?: number;
|
|
175
|
-
responseType: "buffer";
|
|
176
|
-
}): Promise<HttpResponse<Buffer>>;
|
|
177
|
-
get(url: string, op?: RequestOption & {
|
|
178
|
-
outerRedirectCount?: number;
|
|
179
|
-
}): Promise<HttpResponse<string>>;
|
|
180
|
-
post(url: string, payload: any, op?: RequestOption & {
|
|
181
|
-
responseType: "string";
|
|
182
|
-
}): Promise<HttpResponse<string>>;
|
|
183
|
-
post(url: string, payload: any, op?: RequestOption & {
|
|
184
|
-
responseType: "buffer";
|
|
185
|
-
}): Promise<HttpResponse<Buffer>>;
|
|
186
|
-
post(url: string, payload: any, op?: RequestOption): Promise<HttpResponse<string>>;
|
|
187
|
-
private createProxyAgent;
|
|
188
|
-
private getIn;
|
|
189
|
-
private postIn;
|
|
190
|
-
private reqHttps;
|
|
191
|
-
private processResponse;
|
|
192
|
-
private resolveDownloadPath;
|
|
193
|
-
private handleRedirect;
|
|
194
|
-
private createCiphers;
|
|
195
|
-
private setCookies;
|
|
196
|
-
private storeCookies;
|
|
197
|
-
private log;
|
|
198
|
-
private warn;
|
|
199
|
-
private error;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
declare module "prcs/http/http-resolver" {
|
|
203
|
-
import { Loggable } from "xjs-common";
|
|
204
|
-
import { HttpResolverContext } from "prcs/http/http-resolver-context";
|
|
205
|
-
import { ClientOption, HttpResponse, IHttpClient, RequestOption } from "prcs/http/i-http-client";
|
|
206
|
-
export interface ClientMode {
|
|
207
|
-
id: number;
|
|
208
|
-
cipherOrder: number[];
|
|
209
|
-
}
|
|
210
|
-
export interface ProxyConfig {
|
|
211
|
-
server: string;
|
|
212
|
-
port: number;
|
|
213
|
-
auth?: {
|
|
214
|
-
name: string;
|
|
215
|
-
pass: string;
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
export class HttpResolver implements IHttpClient {
|
|
219
|
-
private _baseCmv;
|
|
220
|
-
private _l;
|
|
221
|
-
/**
|
|
222
|
-
* @param _baseCmv chrome major version refered when construct a user agent, and the version will be randomized between `n` to `n-4`.
|
|
223
|
-
* @param _l custom logger. default is `console`.
|
|
224
|
-
*/
|
|
225
|
-
constructor(_baseCmv?: number, _l?: Loggable);
|
|
226
|
-
/**
|
|
227
|
-
* create a http client as new context that keeps some states. (browser type, cookies, ciphers order, etc...)
|
|
228
|
-
* @param op.mode {@link s_clientMode} that is imitated. default is random between chrome or firefox.
|
|
229
|
-
* @param op.proxy proxy configuration.
|
|
230
|
-
* @returns a http client as new context.
|
|
231
|
-
*/
|
|
232
|
-
newContext(op?: ClientOption): HttpResolverContext;
|
|
233
|
-
get(url: string, op?: RequestOption & ClientOption & {
|
|
234
|
-
redirectAsNewRequest?: boolean;
|
|
235
|
-
responseType: "string";
|
|
236
|
-
}): Promise<HttpResponse<string>>;
|
|
237
|
-
get(url: string, op?: RequestOption & ClientOption & {
|
|
238
|
-
redirectAsNewRequest?: boolean;
|
|
239
|
-
responseType: "buffer";
|
|
240
|
-
}): Promise<HttpResponse<Buffer>>;
|
|
241
|
-
get(url: string, op?: RequestOption & ClientOption & {
|
|
242
|
-
redirectAsNewRequest?: boolean;
|
|
243
|
-
}): Promise<HttpResponse<string>>;
|
|
244
|
-
post(url: string, payload: any, op?: RequestOption & ClientOption & {
|
|
245
|
-
responseType: "string";
|
|
246
|
-
}): Promise<HttpResponse<string>>;
|
|
247
|
-
post(url: string, payload: any, op?: RequestOption & ClientOption & {
|
|
248
|
-
responseType: "buffer";
|
|
249
|
-
}): Promise<HttpResponse<Buffer>>;
|
|
250
|
-
post(url: string, payload: any, op?: RequestOption & ClientOption): Promise<HttpResponse<string>>;
|
|
251
|
-
private fixCmv;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
declare module "xjs-node" {
|
|
255
|
-
export * from "func/u";
|
|
256
|
-
export * from "func/u-file";
|
|
257
|
-
export { HttpResolver, ClientMode } from "prcs/http/http-resolver";
|
|
258
|
-
export { s_clientMode } from "prcs/http/http-resolver-context";
|
|
259
|
-
export { IHttpClient, HttpResponse } from "prcs/http/i-http-client";
|
|
260
|
-
}
|