Home
Sort by
last modified time
|
relevance
|
path
Repository(s)
applications
arkcompiler
base
build
commonlibrary
developtools
device
docs
domains
drivers
foundation
ide
interface
kernel
napi_generator
productdefine
test
third_party
vendor
select all
invert selection
clear
Full Search
Search through all text tokens(words,strings,identifiers,numbers) in index.
Definition
Only finds symbol definitions(where e.g a variable(function,...) is defined).
Symbol
Only finds symbol(e.g. methods classes,function,variables).
File Path
Path of the source file(use "/").If you want just exact path,enclose it in "".Source files end with: .jar/.bz2/.a/.h/.java...
History
History log comments.
Type
Any
Bzip(2)
C
Clojure
C#
C++
ELF
Erlang
Image file
Fortran
Golang
GZIP
Haskell
Jar
Java
Java class
JavaScript
Lisp
Lua
Pascal
Perl
PHP
Plain Text
PL/SQL
Python
Rust
Scala
Shell script
SQL
Tar
Tcl
Troff
UUEncoded
Visual Basic
XML
Zip
Type of analyzer used to filter file types include with selected(e.g. just C sources).
Help
Searched
refs:COLLECT
(Results
1 - 3
of
3
) sorted by relevance
/interface/sdk_c/build-tools/capi_parser/src/bin/
H
A
D
config.py
23
COLLECT
= 'collect'
variable in ToolNameType
51
if tool_name == ToolNameType["
COLLECT
"].value:
/interface/sdk-js/build-tools/dts_parser/build_package/
H
A
D
JS_API_COUNT.js
74
const n=r(79896),i=r(70857),a=r(16928),o=r(76982),s={fs:n.constants,os:i.constants},c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",l=/XXXXXX/,u=3,d=(s.O_CREAT||s.fs.O_CREAT)|(s.O_EXCL||s.fs.O_EXCL)|(s.O_RDWR||s.fs.O_RDWR),p="win32"===i.platform(),f=s.EBADF||s.os.errno.EBADF,m=s.ENOENT||s.os.errno.ENOENT,g=[],_=n.rmdirSync.bind(n);let h=!1;function y(e,t){return n.rm(e,{recursive:!0},t)}function v(e){return n.rmSync(e,{recursive:!0})}function b(e,t){const r=A(e,t),i=r[0],a=r[1];try{P(i)}catch(e){return a(e)}let o=i.tries;!function e(){try{const t=N(i);n.stat(t,(function(r){if(!r)return o-- >0?e():a(new Error("Could not get a unique tmp filename, max tries reached "+t));a(null,t)}))}catch(e){a(e)}}()}function k(e){const t=A(e)[0];P(t);let r=t.tries;do{const e=N(t);try{n.statSync(e)}catch(t){return e}}while(r-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function x(e,t){const r=function(e){if(e&&!O(e))return t(e);t()};0<=e[0]?n.close(e[0],(function(){n.unlink(e[1],r)})):n.unlink(e[1],r)}function S(e){let t=null;try{0<=e[0]&&n.closeSync(e[0])}catch(e){if(!(r=e,R(r,-f,"EBADF")||O(e)))throw e}finally{try{n.unlinkSync(e[1])}catch(e){O(e)||(t=e)}}var r;if(null!==t)throw t}function w(e,t,r,n){const i=E(S,[t,e],n),a=E(x,[t,e],n,i);return r.keep||g.unshift(i),n?i:a}function D(e,t,r){const i=t.unsafeCleanup?y:n.rmdir.bind(n),a=E(t.unsafeCleanup?v:_,e,r),o=E(i,e,r,a);return t.keep||g.unshift(a),r?a:o}function E(e,t,r,n){let i=!1;return function a(o){if(!i){const s=n||a,c=g.indexOf(s);return c>=0&&g.splice(c,1),i=!0,r||e===_||e===v?e(t):e(t,o||function(){})}}}function T(e){let t=[],r=null;try{r=o.randomBytes(e)}catch(t){r=o.pseudoRandomBytes(e)}for(var n=0;n<e;n++)t.push(c[r[n]%c.length]);return t.join("")}function C(e){return void 0===e}function A(e,t){if("function"==typeof e)return[{},e];if(C(e))return[{},t];const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=e[t];return[r,t]}function N(e){const t=e.tmpdir;if(!C(e.name))return a.join(t,e.dir,e.name);if(!C(e.template))return a.join(t,e.dir,e.template).replace(l,T(6));const r=[e.prefix?e.prefix:"tmp","-",process.pid,"-",T(12),e.postfix?"-"+e.postfix:""].join("");return a.join(t,e.dir,r)}function P(e){e.tmpdir=M(e);const t=e.tmpdir;if(C(e.name)||F(e.name,"name",t),C(e.dir)||F(e.dir,"dir",t),!C(e.template)&&(F(e.template,"template",t),!e.template.match(l)))throw new Error(`Invalid template, found "${e.template}".`);if(!C(e.tries)&&isNaN(e.tries)||e.tries<0)throw new Error(`Invalid tries, found "${e.tries}".`);var r;e.tries=C(e.name)?e.tries||u:1,e.keep=!!e.keep,e.detachDescriptor=!!e.detachDescriptor,e.discardDescriptor=!!e.discardDescriptor,e.unsafeCleanup=!!e.unsafeCleanup,e.dir=C(e.dir)?"":a.relative(t,I(e.dir,t)),e.template=C(e.template)?void 0:a.relative(t,I(e.template,t)),e.template=null===(r=e.template)||C(r)||!r.trim()?void 0:a.relative(e.dir,e.template),e.name=C(e.name)?void 0:e.name,e.prefix=C(e.prefix)?"":e.prefix,e.postfix=C(e.postfix)?"":e.postfix}function I(e,t){return e.startsWith(t)?a.resolve(e):a.resolve(a.join(t,e))}function F(e,t,r){if("name"===t){if(a.isAbsolute(e))throw new Error(`${t} option must not contain an absolute path, found "${e}".`);let r=a.basename(e);if(".."===r||"."===r||r!==e)throw new Error(`${t} option must not contain a path, found "${e}".`)}else{if(a.isAbsolute(e)&&!e.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${e}".`);let n=I(e,r);if(!n.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${n}".`)}}function O(e){return R(e,-m,"ENOENT")}function R(e,t,r){return p?e.code===r:e.code===r&&e.errno===t}function M(e){return a.resolve(e&&e.tmpdir||i.tmpdir())}process.addListener("exit",(function(){if(h)for(;g.length;)try{g[0]()}catch(e){}})),Object.defineProperty(e.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return M()}}),e.exports.dir=function(e,t){const r=A(e,t),i=r[0],a=r[1];b(i,(function(e,t){if(e)return a(e);n.mkdir(t,i.mode||448,(function(e){if(e)return a(e);a(null,t,D(t,i,!1))}))}))},e.exports.dirSync=function(e){const t=A(e)[0],r=k(t);return n.mkdirSync(r,t.mode||448),{name:r,removeCallback:D(r,t,!0)}},e.exports.file=function(e,t){const r=A(e,t),i=r[0],a=r[1];b(i,(function(e,t){if(e)return a(e);n.open(t,d,i.mode||384,(function(e,r){if(e)return a(e);if(i.discardDescriptor)return n.close(r,(function(e){return a(e,t,void 0,w(t,-1,i,!1))}));{const e=i.discardDescriptor||i.detachDescriptor;a(null,t,r,w(t,e?-1:r,i,!1))}}))}))},e.exports.fileSync=function(e){const t=A(e)[0],r=t.discardDescriptor||t.detachDescriptor,i=k(t);var a=n.openSync(i,d,t.mode||384);return t.discardDescriptor&&(n.closeSync(a),a=void 0),{name:i,fd:a,removeCallback:w(i,r?-1:a,t,!0)}},e.exports.tmpName=b,e.exports.tmpNameSync=k,e.exports.setGracefulCleanup=function(){h=!0}},36623:e=>{function t(e){if(!(this instanceof t))return new t(e);this.value=e}function r(e,t,r){var i=[],a=[],o=!0;return function e(s){var c=r?n(s):s,l={},u={node:c,node_:s,path:[].concat(i),parent:a.slice(-1)[0],key:i.slice(-1)[0],isRoot:0===i.length,level:i.length,circular:null,update:function(e){u.isRoot||(u.parent.node[u.key]=e),u.node=e},delete:function(){delete u.parent.node[u.key]},remove:function(){Array.isArray(u.parent.node)?u.parent.node.splice(u.key,1):delete u.parent.node[u.key]},before:function(e){l.before=e},after:function(e){l.after=e},pre:function(e){l.pre=e},post:function(e){l.post=e},stop:function(){o=!1}};if(!o)return u;if("object"==typeof c&&null!==c){u.isLeaf=0==Object.keys(c).length;for(var d=0;d<a.length;d++)if(a[d].node_===s){u.circular=a[d];break}}else u.isLeaf=!0;u.notLeaf=!u.isLeaf,u.notRoot=!u.isRoot;var p=t.call(u,u.node);if(void 0!==p&&u.update&&u.update(p),l.before&&l.before.call(u,u.node),"object"==typeof u.node&&null!==u.node&&!u.circular){a.push(u);var f=Object.keys(u.node);f.forEach((function(t,n){i.push(t),l.pre&&l.pre.call(u,u.node[t],t);var a=e(u.node[t]);r&&Object.hasOwnProperty.call(u.node,t)&&(u.node[t]=a.node),a.isLast=n==f.length-1,a.isFirst=0==n,l.post&&l.post.call(u,a),i.pop()})),a.pop()}return l.after&&l.after.call(u,u.node),u}(e).node}function n(e){var t;return"object"==typeof e&&null!==e?(t=Array.isArray(e)?[]:e instanceof Date?new Date(e):e instanceof Boolean?new Boolean(e):e instanceof Number?new Number(e):e instanceof String?new String(e):Object.create(Object.getPrototypeOf(e)),Object.keys(e).forEach((function(r){t[r]=e[r]})),t):e}e.exports=t,t.prototype.get=function(e){for(var t=this.value,r=0;r<e.length;r++){var n=e[r];if(!Object.hasOwnProperty.call(t,n)){t=void 0;break}t=t[n]}return t},t.prototype.set=function(e,t){for(var r=this.value,n=0;n<e.length-1;n++){var i=e[n];Object.hasOwnProperty.call(r,i)||(r[i]={}),r=r[i]}return r[e[n]]=t,t},t.prototype.map=function(e){return r(this.value,e,!0)},t.prototype.forEach=function(e){return this.value=r(this.value,e,!1),this.value},t.prototype.reduce=function(e,t){var r=1===arguments.length,n=r?this.value:t;return this.forEach((function(t){this.isRoot&&r||(n=e.call(this,n,t))})),n},t.prototype.deepEqual=function(e){if(1!==arguments.length)throw new Error("deepEqual requires exactly one object to compare against");var r=!0,n=e;return this.forEach((function(i){var a=function(){r=!1}.bind(this);if(!this.isRoot){if("object"!=typeof n)return a();n=n[this.key]}var o=n;this.post((function(){n=o}));var s=function(e){return Object.prototype.toString.call(e)};if(this.circular)t(e).get(this.circular.path)!==o&&a();else if(typeof o!=typeof i)a();else if(null===o||null===i||void 0===o||void 0===i)o!==i&&a();else if(o.__proto__!==i.__proto__)a();else if(o===i);else if("function"==typeof o)o instanceof RegExp?o.toString()!=i.toString()&&a():o!==i&&a();else if("object"==typeof o)if("[object Arguments]"===s(i)||"[object Arguments]"===s(o))s(o)!==s(i)&&a();else if(o instanceof Date||i instanceof Date)o instanceof Date&&i instanceof Date&&o.getTime()===i.getTime()||a();else{var c=Object.keys(o),l=Object.keys(i);if(c.length!==l.length)return a();for(var u=0;u<c.length;u++){var d=c[u];Object.hasOwnProperty.call(i,d)||a()}}})),r},t.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},t.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},t.prototype.clone=function(){var e=[],t=[];return function r(i){for(var a=0;a<e.length;a++)if(e[a]===i)return t[a];if("object"==typeof i&&null!==i){var o=n(i);return e.push(i),t.push(o),Object.keys(i).forEach((function(e){o[e]=r(i[e])})),e.pop(),t.pop(),o}return i}(this.value)},Object.keys(t.prototype).forEach((function(e){t[e]=function(r){var n=[].slice.call(arguments,1),i=t(r);return i[e].apply(i,n)}}))},77926:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.toolNameMethod=t.joinNewMessage=t.joinOldMessage=t.Plugin=t.formatSet=t.formatType=t.toolNameSet=t.toolNameType=void 0;const i=n(r(16928)),a=n(r(79896)),o=r(35317),s=r(27944),c=r(40745),l=r(4e3),u=r(30871),d=r(26499),p=r(40149),f=r(20043),m=r(40744),g=r(8136),_=r(12587),h=r(87191),y=r(80879),v=r(22127);var b,k;!function(e){e.
COLLECT
="collect",e.CHECK="check",e.CHECKONLINE="checkOnline",e.DIFF="diff",e.LABELDETECTION="detection",e.COUNT="count"}(b=t.toolNameType||(t.toolNameType={})),t.toolNameSet=new Set(s.EnumUtils.enum2arr(b)),function(e){e.NULL="",e.JSON="json",e.EXCEL="excel",e.CHANGELOG="changelog"}(k=t.formatType||(t.formatType={})),t.formatSet=new Set(s.EnumUtils.enum2arr(k)),t.Plugin={pluginOptions:{name:"parser",version:"0.1.0",description:"Compare the parser the SDKS",commands:[{isRequiredOption:!0,options:[`-N,--tool-name <${[...t.toolNameSet]}>`,"tool name ","checkOnline"]},{isRequiredOption:!1,options:["-C,--collect-path <string>","collect api path","./api"]},{isRequiredOption:!1,options:["-F,--collect-file <string>","collect api file array",""]},{isRequiredOption:!1,options:["--path <string>","check api path, split with comma",""]},{isRequiredOption:!1,options:["--checker <string>","check api rule, split with comma","all"]},{isRequiredOption:!1,options:["--excel <string>","check api excel","false"]},{isRequiredOption:!1,options:["--old <string>","diff old sdk path","./api"]},{isRequiredOption:!1,options:["--new <string>","diff new sdk path","./api"]},{isRequiredOption:!1,options:["--old-version <string>","old sdk version","0"]},{isRequiredOption:!1,options:["--new-version <string>","new sdk version","0"]},{isRequiredOption:!1,options:["--output <string>","output file path","./"]},{isRequiredOption:!1,options:[`--format <${[...t.formatSet]}>`,"output file format","json"]},{isRequiredOption:!1,options:["--changelogUrl <string>","changelog url",""]}]},start:async function(e){const r=e.toolName,n=t.toolNameMethod.get(r);if(!n)return void l.LogUtil.i("CommandArgs","tool-name may use error name or don't have function,tool-name can use 'collect' or 'diff'");const i={toolName:r,collectPath:e.collectPath,collectFile:e.collectFile,path:e.path,checker:e.checker,old:e.old,new:e.new,oldVersion:e.oldVersion,newVersion:e.newVersion,output:e.output,format:e.format,changelogUrl:e.changelogUrl,excel:e.excel},a=n(i);!function(e,t,r){const n=t.format;let i=`${t.toolName}_${t.oldVersion}_${t.newVersion}.json`;if(!n)return;t.toolName===b.COUNT&&(i="api_kit_js.json");switch(n){case k.JSON:f.WriterHelper.JSONReporter(String(e[0]),t.output,i);break;case k.EXCEL:f.WriterHelper.ExcelReporter(e,t.output,`${t.toolName}.xlsx`,r);break;case k.CHANGELOG:f.WriterHelper.JSONReporter(String(e[0]),t.output,`${t.toolName}.json`)}}(a.data,i,a.callback)},stop:function(){l.LogUtil.i("commander","elapsed time: "+(Date.now()-x))}};let x=Date.now();function S(e,t){const r=new Set,n=y.FunctionUtils.readKitFile(),i=n.subsystemMap,a=n.kitNameMap;t.name="JsApi",t.views=[{xSplit:1}],t.getRow(1).values=["模块名","类名","方法名","函数","类型","起始版本","废弃版本","syscap","错误码","是否为系统API","模型限制","权限","是否支持跨平台","是否支持卡片应用","是否为高阶API","装饰器","kit","文件路径","子系统"];let o=2;e.forEach((e=>{const n=`${e.getHierarchicalRelations()},${e.getDefinedText()}`;r.has(n)||(t.getRow(o).values=[e.getPackageName(),e.getParentModuleName(),e.getApiName(),e.getDefinedText(),e.getApiType(),"-1"===e.getSince()?"":e.getSince(),"-1"===e.getDeprecatedVersion()?"":e.getDeprecatedVersion(),e.getSyscap(),"-1"===e.getErrorCodes().join()?"":e.getErrorCodes().join(),e.getApiLevel(),e.getModelLimitation(),e.getPermission(),e.getIsCrossPlatForm(),e.getIsForm(),e.getIsAutomicService(),e.getDecorators()?.join(),""===e.getKitInfo()?a.get(e.getFilePath().replace(/\\/g,"/")):e.getKitInfo(),e.getFilePath(),i.get(e.getFilePath().replace(/\\/g,"/"))],o++,r.add(n))}))}function w(e,t){t.name="api数量",t.views=[{xSplit:1}],t.getRow(1).values=["子系统","kit","文件","api数量"],e.forEach(((e,r)=>{t.getRow(r+g.NumberConstant.LINE_IN_EXCEL).values=[e.getsubSystem(),e.getKitName(),e.getFilePath(),e.getApiNumber()]}))}function D(e,t,r){t.name="api差异",t.views=[{xSplit:1}],t.getRow(1).values=["操作标记","差异项-旧版本","差异项-新版本","d.ts文件","归属子系统","kit"],e.forEach(((e,r)=>{const n=e.getNewDtsName()?e.getNewDtsName():e.getOldDtsName();t.getRow(r+g.NumberConstant.LINE_IN_EXCEL).values=[p.diffTypeMap.get(e.getDiffType()),E(e),T(e),n.replace(/\\/g,"/"),h.SyscapProcessorHelper.matchSubsystem(e),h.SyscapProcessorHelper.getSingleKitInfo(e)]})),f.WriterHelper.MarkdownReporter.writeInMarkdown(e,r)}function E(e){if(e.getDiffMessage()===p.diffTypeMap.get(p.ApiDiffType.ADD))return"NA";let t="";const r=e.getOldHierarchicalRelations(),n=e.getParentModuleName(r);return t="-1"!==e.getOldDescription()&&e.getOldDescription()?e.getOldDescription():"NA",e.getDiffType()===p.ApiDiffType.KIT_CHANGE?`${t}`:`类名:${n};\nAPI声明:${e.getOldApiDefinedText()}\n差异内容:${t}`}function T(e){if(e.getDiffMessage()===p.diffTypeMap.get(p.ApiDiffType.REDUCE))return"NA";let t="";const r=e.getNewHierarchicalRelations(),n=e.getParentModuleName(r);return t="-1"!==e.getNewDescription()&&e.getNewDescription()?e.getNewDescription():"NA",e.getDiffType()===p.ApiDiffType.KIT_CHANGE?`${t}`:`类名:${n};\nAPI声明:${e.getNewApiDefinedText()}\n差异内容:${t}`}t.joinOldMessage=E,t.joinNewMessage=T,t.toolNameMethod=new Map([[b.
COLLECT
,function(e){const t=i.default.resolve(c.FileUtils.getBaseDirName(),e.collectPath);let r,n="";""!== (…)
[all...]
/interface/sdk-js/build-tools/dts_parser/package/
H
A
D
JS_API_CHECK.js
82
const n=r(79896),i=r(70857),a=r(16928),o=r(76982),s={fs:n.constants,os:i.constants},c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",l=/XXXXXX/,u=3,d=(s.O_CREAT||s.fs.O_CREAT)|(s.O_EXCL||s.fs.O_EXCL)|(s.O_RDWR||s.fs.O_RDWR),p="win32"===i.platform(),f=s.EBADF||s.os.errno.EBADF,m=s.ENOENT||s.os.errno.ENOENT,g=[],_=n.rmdirSync.bind(n);let h=!1;function y(e,t){return n.rm(e,{recursive:!0},t)}function v(e){return n.rmSync(e,{recursive:!0})}function b(e,t){const r=A(e,t),i=r[0],a=r[1];try{P(i)}catch(e){return a(e)}let o=i.tries;!function e(){try{const t=N(i);n.stat(t,(function(r){if(!r)return o-- >0?e():a(new Error("Could not get a unique tmp filename, max tries reached "+t));a(null,t)}))}catch(e){a(e)}}()}function k(e){const t=A(e)[0];P(t);let r=t.tries;do{const e=N(t);try{n.statSync(e)}catch(t){return e}}while(r-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function x(e,t){const r=function(e){if(e&&!O(e))return t(e);t()};0<=e[0]?n.close(e[0],(function(){n.unlink(e[1],r)})):n.unlink(e[1],r)}function E(e){let t=null;try{0<=e[0]&&n.closeSync(e[0])}catch(e){if(!(r=e,R(r,-f,"EBADF")||O(e)))throw e}finally{try{n.unlinkSync(e[1])}catch(e){O(e)||(t=e)}}var r;if(null!==t)throw t}function S(e,t,r,n){const i=w(E,[t,e],n),a=w(x,[t,e],n,i);return r.keep||g.unshift(i),n?i:a}function D(e,t,r){const i=t.unsafeCleanup?y:n.rmdir.bind(n),a=w(t.unsafeCleanup?v:_,e,r),o=w(i,e,r,a);return t.keep||g.unshift(a),r?a:o}function w(e,t,r,n){let i=!1;return function a(o){if(!i){const s=n||a,c=g.indexOf(s);return c>=0&&g.splice(c,1),i=!0,r||e===_||e===v?e(t):e(t,o||function(){})}}}function T(e){let t=[],r=null;try{r=o.randomBytes(e)}catch(t){r=o.pseudoRandomBytes(e)}for(var n=0;n<e;n++)t.push(c[r[n]%c.length]);return t.join("")}function C(e){return void 0===e}function A(e,t){if("function"==typeof e)return[{},e];if(C(e))return[{},t];const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=e[t];return[r,t]}function N(e){const t=e.tmpdir;if(!C(e.name))return a.join(t,e.dir,e.name);if(!C(e.template))return a.join(t,e.dir,e.template).replace(l,T(6));const r=[e.prefix?e.prefix:"tmp","-",process.pid,"-",T(12),e.postfix?"-"+e.postfix:""].join("");return a.join(t,e.dir,r)}function P(e){e.tmpdir=M(e);const t=e.tmpdir;if(C(e.name)||F(e.name,"name",t),C(e.dir)||F(e.dir,"dir",t),!C(e.template)&&(F(e.template,"template",t),!e.template.match(l)))throw new Error(`Invalid template, found "${e.template}".`);if(!C(e.tries)&&isNaN(e.tries)||e.tries<0)throw new Error(`Invalid tries, found "${e.tries}".`);var r;e.tries=C(e.name)?e.tries||u:1,e.keep=!!e.keep,e.detachDescriptor=!!e.detachDescriptor,e.discardDescriptor=!!e.discardDescriptor,e.unsafeCleanup=!!e.unsafeCleanup,e.dir=C(e.dir)?"":a.relative(t,I(e.dir,t)),e.template=C(e.template)?void 0:a.relative(t,I(e.template,t)),e.template=null===(r=e.template)||C(r)||!r.trim()?void 0:a.relative(e.dir,e.template),e.name=C(e.name)?void 0:e.name,e.prefix=C(e.prefix)?"":e.prefix,e.postfix=C(e.postfix)?"":e.postfix}function I(e,t){return e.startsWith(t)?a.resolve(e):a.resolve(a.join(t,e))}function F(e,t,r){if("name"===t){if(a.isAbsolute(e))throw new Error(`${t} option must not contain an absolute path, found "${e}".`);let r=a.basename(e);if(".."===r||"."===r||r!==e)throw new Error(`${t} option must not contain a path, found "${e}".`)}else{if(a.isAbsolute(e)&&!e.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${e}".`);let n=I(e,r);if(!n.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${n}".`)}}function O(e){return R(e,-m,"ENOENT")}function R(e,t,r){return p?e.code===r:e.code===r&&e.errno===t}function M(e){return a.resolve(e&&e.tmpdir||i.tmpdir())}process.addListener("exit",(function(){if(h)for(;g.length;)try{g[0]()}catch(e){}})),Object.defineProperty(e.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return M()}}),e.exports.dir=function(e,t){const r=A(e,t),i=r[0],a=r[1];b(i,(function(e,t){if(e)return a(e);n.mkdir(t,i.mode||448,(function(e){if(e)return a(e);a(null,t,D(t,i,!1))}))}))},e.exports.dirSync=function(e){const t=A(e)[0],r=k(t);return n.mkdirSync(r,t.mode||448),{name:r,removeCallback:D(r,t,!0)}},e.exports.file=function(e,t){const r=A(e,t),i=r[0],a=r[1];b(i,(function(e,t){if(e)return a(e);n.open(t,d,i.mode||384,(function(e,r){if(e)return a(e);if(i.discardDescriptor)return n.close(r,(function(e){return a(e,t,void 0,S(t,-1,i,!1))}));{const e=i.discardDescriptor||i.detachDescriptor;a(null,t,r,S(t,e?-1:r,i,!1))}}))}))},e.exports.fileSync=function(e){const t=A(e)[0],r=t.discardDescriptor||t.detachDescriptor,i=k(t);var a=n.openSync(i,d,t.mode||384);return t.discardDescriptor&&(n.closeSync(a),a=void 0),{name:i,fd:a,removeCallback:S(i,r?-1:a,t,!0)}},e.exports.tmpName=b,e.exports.tmpNameSync=k,e.exports.setGracefulCleanup=function(){h=!0}},36623:e=>{function t(e){if(!(this instanceof t))return new t(e);this.value=e}function r(e,t,r){var i=[],a=[],o=!0;return function e(s){var c=r?n(s):s,l={},u={node:c,node_:s,path:[].concat(i),parent:a.slice(-1)[0],key:i.slice(-1)[0],isRoot:0===i.length,level:i.length,circular:null,update:function(e){u.isRoot||(u.parent.node[u.key]=e),u.node=e},delete:function(){delete u.parent.node[u.key]},remove:function(){Array.isArray(u.parent.node)?u.parent.node.splice(u.key,1):delete u.parent.node[u.key]},before:function(e){l.before=e},after:function(e){l.after=e},pre:function(e){l.pre=e},post:function(e){l.post=e},stop:function(){o=!1}};if(!o)return u;if("object"==typeof c&&null!==c){u.isLeaf=0==Object.keys(c).length;for(var d=0;d<a.length;d++)if(a[d].node_===s){u.circular=a[d];break}}else u.isLeaf=!0;u.notLeaf=!u.isLeaf,u.notRoot=!u.isRoot;var p=t.call(u,u.node);if(void 0!==p&&u.update&&u.update(p),l.before&&l.before.call(u,u.node),"object"==typeof u.node&&null!==u.node&&!u.circular){a.push(u);var f=Object.keys(u.node);f.forEach((function(t,n){i.push(t),l.pre&&l.pre.call(u,u.node[t],t);var a=e(u.node[t]);r&&Object.hasOwnProperty.call(u.node,t)&&(u.node[t]=a.node),a.isLast=n==f.length-1,a.isFirst=0==n,l.post&&l.post.call(u,a),i.pop()})),a.pop()}return l.after&&l.after.call(u,u.node),u}(e).node}function n(e){var t;return"object"==typeof e&&null!==e?(t=Array.isArray(e)?[]:e instanceof Date?new Date(e):e instanceof Boolean?new Boolean(e):e instanceof Number?new Number(e):e instanceof String?new String(e):Object.create(Object.getPrototypeOf(e)),Object.keys(e).forEach((function(r){t[r]=e[r]})),t):e}e.exports=t,t.prototype.get=function(e){for(var t=this.value,r=0;r<e.length;r++){var n=e[r];if(!Object.hasOwnProperty.call(t,n)){t=void 0;break}t=t[n]}return t},t.prototype.set=function(e,t){for(var r=this.value,n=0;n<e.length-1;n++){var i=e[n];Object.hasOwnProperty.call(r,i)||(r[i]={}),r=r[i]}return r[e[n]]=t,t},t.prototype.map=function(e){return r(this.value,e,!0)},t.prototype.forEach=function(e){return this.value=r(this.value,e,!1),this.value},t.prototype.reduce=function(e,t){var r=1===arguments.length,n=r?this.value:t;return this.forEach((function(t){this.isRoot&&r||(n=e.call(this,n,t))})),n},t.prototype.deepEqual=function(e){if(1!==arguments.length)throw new Error("deepEqual requires exactly one object to compare against");var r=!0,n=e;return this.forEach((function(i){var a=function(){r=!1}.bind(this);if(!this.isRoot){if("object"!=typeof n)return a();n=n[this.key]}var o=n;this.post((function(){n=o}));var s=function(e){return Object.prototype.toString.call(e)};if(this.circular)t(e).get(this.circular.path)!==o&&a();else if(typeof o!=typeof i)a();else if(null===o||null===i||void 0===o||void 0===i)o!==i&&a();else if(o.__proto__!==i.__proto__)a();else if(o===i);else if("function"==typeof o)o instanceof RegExp?o.toString()!=i.toString()&&a():o!==i&&a();else if("object"==typeof o)if("[object Arguments]"===s(i)||"[object Arguments]"===s(o))s(o)!==s(i)&&a();else if(o instanceof Date||i instanceof Date)o instanceof Date&&i instanceof Date&&o.getTime()===i.getTime()||a();else{var c=Object.keys(o),l=Object.keys(i);if(c.length!==l.length)return a();for(var u=0;u<c.length;u++){var d=c[u];Object.hasOwnProperty.call(i,d)||a()}}})),r},t.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},t.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},t.prototype.clone=function(){var e=[],t=[];return function r(i){for(var a=0;a<e.length;a++)if(e[a]===i)return t[a];if("object"==typeof i&&null!==i){var o=n(i);return e.push(i),t.push(o),Object.keys(i).forEach((function(e){o[e]=r(i[e])})),e.pop(),t.pop(),o}return i}(this.value)},Object.keys(t.prototype).forEach((function(e){t[e]=function(r){var n=[].slice.call(arguments,1),i=t(r);return i[e].apply(i,n)}}))},77926:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.toolNameMethod=t.joinNewMessage=t.joinOldMessage=t.Plugin=t.formatSet=t.formatType=t.toolNameSet=t.toolNameType=void 0;const i=n(r(16928)),a=n(r(79896)),o=r(35317),s=r(27944),c=r(40745),l=r(4e3),u=r(30871),d=r(17858),p=r(26499),f=r(40149),m=r(20043),g=r(40744),_=r(8136),h=r(12587),y=r(87191),v=r(22127),b=r(93333),k=r(80879),x=r(44791);var E,S;!function(e){e.
COLLECT
="collect",e.CHECK="check",e.CHECKONLINE="checkOnline",e.APICHANGECHECK="apiChangeCheck",e.DIFF="diff",e.LABELDETECTION="detection",e.COUNT="count"}(E=t.toolNameType||(t.toolNameType={})),t.toolNameSet=new Set(s.EnumUtils.enum2arr(E)),function(e){e.NULL="",e.JSON="json",e.EXCEL="excel",e.CHANGELOG="changelog"}(S=t.formatType||(t.formatType={})),t.formatSet=new Set(s.EnumUtils.enum2arr(S)),t.Plugin={pluginOptions:{name:"parser",version:"0.1.0",description:"Compare the parser the SDKS",commands:[{isRequiredOption:!0,options:[`-N,--tool-name <${[...t.toolNameSet]}>`,"tool name ","checkOnline"]},{isRequiredOption:!1,options:["-C,--collect-path <string>","collect api path","./api"]},{isRequiredOption:!1,options:["-F,--collect-file <string>","collect api file array",""]},{isRequiredOption:!1,options:["-L,--check-labels <string>","detection check labels",""]},{isRequiredOption:!1,options:["--isOH <string>","detection check labels",""]},{isRequiredOption:!1,options:["--path <string>","check api path, split with comma",""]},{isRequiredOption:!1,options:["--checker <string>","check api rule, split with comma","all"]},{isRequiredOption:!1,options:["--prId <string>","check api prId",""]},{isRequiredOption:!1,options:["--excel <string>","check api excel","false"]},{isRequiredOption:!1,options:["--old <string>","diff old sdk path","./api"]},{isRequiredOption:!1,options:["--new <string>","diff new sdk path","./api"]},{isRequiredOption:!1,options:["--old-version <string>","old sdk version","0"]},{isRequiredOption:!1,options:["--new-version <string>","new sdk version","0"]},{isRequiredOption:!1,options:["--output <string>","output file path","./"]},{isRequiredOption:!1,options:[`--format <${[...t.formatSet]}>`,"output file format","json"]},{isRequiredOption:!1,options:["--changelogUrl <string>","changelog url",""]},{isRequiredOption:!1,options:["--all <boolean>","is all sheet",""]}]},start:async function(e){const r=e.toolName,n=t.toolNameMethod.get(r);if(!n)return void l.LogUtil.i("CommandArgs","tool-name may use error name or don't have function,tool-name can use 'collect' or 'diff'");const i={toolName:r,collectPath:e.collectPath,collectFile:e.collectFile,checkLabels:e.checkLabels,isOH:e.isOH,path:e.path,checker:e.checker,prId:e.prId,old:e.old,new:e.new,oldVersion:e.oldVersion,newVersion:e.newVersion,output:e.output,format:e.format,changelogUrl:e.changelogUrl,excel:e.excel,all:e.all},a=n(i);!function(e,t,r){const n=t.format;let i=`${t.toolName}_${t.oldVersion}_${t.newVersion}.json`;if(!n)return;t.toolName===E.COUNT&&(i="api_kit_js.json");switch(n){case S.JSON:m.WriterHelper.JSONReporter(String(e[0]),t.output,i);break;case S.EXCEL:m.WriterHelper.ExcelReporter(e,t.output,`${t.toolName}.xlsx`,r,t);break;case S.CHANGELOG:m.WriterHelper.JSONReporter(String(e[0]),t.output,`${t.toolName}.json`)}}(a.data,i,a.callback)},stop:function(){l.LogUtil.i("commander","elapsed time: "+(Date.now()-D))}};let D=Date.now();function w(e,t,r,n){const i=t.addWorksheet(),a=new Set,o=k.FunctionUtils.readKitFile();i.name="JsApi",i.views=[{xSplit:1}],i.getRow(1).values=["模块名","类名","方法名","函数","类型","起始版本","废弃版本","syscap","错误码","是否为系统API","模型限制","权限","是否支持跨平台","是否支持卡片应用","是否为高阶API","装饰器","kit","文件路径","子系统","父节点类型","父节点API是否可选"];let s=2;e.forEach((e=>{const t=`${e.getHierarchicalRelations()},${e.getDefinedText()}`;a.has(t)||(i.getRow(s).values=[e.getPackageName(),e.getParentModuleName(),e.getApiName(),e.getDefinedText(),e.getApiType(),"-1"===e.getSince()?"":e.getSince(),"-1"===e.getDeprecatedVersion()?"":e.getDeprecatedVersion(),e.getSyscap(),"-1"===e.getErrorCodes().join()?"":e.getErrorCodes().join(),e.getApiLevel(),e.getModelLimitation(),e.getPermission(),e.getIsCrossPlatForm(),e.getIsForm(),e.getIsAutomicService(),e.getDecorators()?.join(),""===e.getKitInfo()?o.kitNameMap.get(e.getFilePath().replace(/\\/g,"/").replace("api/","")):e.getKitInfo(),e.getFilePath(),o.subsystemMap.get(e.getFilePath().replace(/\\/g,"/").replace("api/","")),e.getParentApiType(),e.getIsOptional()],s++,a.add(t))})),n?.all&&function(e,t){const r=t.addWorksheet(),n=new Set,i=k.FunctionUtils.readKitFile();r.name="JsApi定制版本",r.views=[{xSplit:1}],r.getRow(1).values=["模块名","类名","方法名","函数","类型","起始版本","废弃版本","syscap","错误码","是否为系统API","模型限制","权限","是否支持跨平台","是否支持卡片应用","是否为高阶API","装饰器","kit","文件路径","子系统","接口全路径"];let a=2;e.forEach((e=>{const t=`${e.getHierarchicalRelations()},${e.getDefinedText()}`;n.has(t)||(r.getRow(a).values=[e.getPackageName(),e.getParentModuleName(),e.getApiName(),e.getDefinedText(),e.getApiType(),"-1"===e.getSince()?"":e.getSince(),"-1"===e.getDeprecatedVersion()?"":e.getDeprecatedVersion(),e.getSyscap(),"-1"===e.getErrorCodes().join()?"":e.getErrorCodes().join(),e.getApiLevel(),e.getModelLimitation(),e.getPermission(),e.getIsCrossPlatForm(),e.getIsForm(),e.getIsAutomicService(),e.getDecorators()?.join(),""===e.getKitInfo()?i.kitNameMap.get(e.getFilePath().replace(/\\/g,"/").replace("api/","")):e.getKitInfo(),e.getFilePath(),i.subsystemMap.get(e.getFilePath().replace(/\\/g,"/").replace("api/","")),e.getHierarchicalRelations().replace(/\//g,"#").replace("api\\","")],a++,n.add(t))}))}(e,t)}function T(e,t){const r=t.addWorksheet();r.name="api数量",r.views=[{xSplit:1}],r.getRow(1).values=["子系统","kit","文件","api数量"],e.forEach(((e,t)=>{r.getRow(t+_.NumberConstant.LINE_IN_EXCEL).values=[e.getsubSystem(),e.getKitName(),e.getFilePath(),e.getApiNumber()]}))}function C(e,t,r,n){const i=new Set,a=k.FunctionUtils.readKitFile(),o=t.addWorksheet("api差异");o.views=[{xSplit:2}],o.getRow(1).values=["操作标记","差异项-旧版本","差异项-新版本","d.ts文件","归属子系统","kit","是否为系统API"],e.forEach(((e,t)=>{i.add(I(e));const r=e.getNewDtsName()?e.getNewDtsName():e.getOldDtsName();o.getRow(t+_.NumberConstant.LINE_IN_EXCEL).values=[f.diffTypeMap.get(e.getDiffType()),F(e),O(e),r.replace(/\\/g,"/"),a.subsystemMap.get(r.replace(/\\/g,"/").replace("api/","")),""===y.SyscapProcessorHelper.getSingleKitInfo(e)?a.kitNameMap.get(r.replace(/\\/g,"/").replace("api/","")):y.SyscapProcessorHelper.getSingleKitInfo(e),e.getIsSystemapi()]})),m.WriterHelper.MarkdownReporter.writeInMarkdown(e,r),n?.all&&function(e,t,r,n){const i=t.addWorksheet("api变更数量统计");i.views=[{xSplit:2}],i.getRow(1).values=["api名称","kit名称","归属子系统","是否是api","api类型","操作标记","变更类型","兼容性","变更次数","差异项-旧版本","差异项-新版本","兼容性列表","接口全路径","是否为系统API","是否为同名API"];let a=[];e.forEach((e=>{let t="";const i=new f.DiffNumberInfo;r.forEach((r=>{const a=r.getNewDtsName()?r.getNewDtsName():r.getOldDtsName(),o=""===y.SyscapProcessorHelper.getSingleKitInfo(r)?n.kitNameMap.get(a.replace(/\\/g,"/").replace("api/","")):y.SyscapProcessorHelper.getSingleKitInfo(r);e===I(r)&&(t=P(r),i.setAllDiffType(r.getDiffMessage()).setAllChangeType(f.apiChangeMap.get(r.getDiffType())).setOldDiffMessage(r.getOldDescription()).setNewDiffMessage(r.getNewDescription()).setAllCompatible(r.getIsCompatible()).setIsApi(!f.isNotApiSet.has(r.getApiType())).setKitName(o).setSubsystem(n.subsystemMap.get(a.replace(/\\/g,"/").replace("api/",""))).setApiName(r.getApiType()===x.ApiType.SOURCE_FILE?"SOURCEFILE":P(r)).setApiRelation(I(r).replace(/\,/g,"#").replace("api\\","")).setIsSystemapi(r.getIsSystemapi()).setApiType(r.getApiType()).setIsSameNameFunction(r.getIsSameNameFunction()))})),a.push(i)})),a=function(e,t){return t}(0,a),a.forEach(((e,t)=>{i.getRow(t+_.NumberConstant.LINE_IN_EXCEL).values=[e.getApiName(),e.getKitName(),e.getSubsystem(),e.getIsApi(),e.getApiType(),e.getAllDiffType().join(" #&# "),e.getAllChangeType().join(" #&# "),A(e),N(e),e.getOldDiffMessage().join(" #&# "),e.getNewDiffMessage().join(" #&# "),e.getAllCompatible().join(" #&# "),e.getApiRelation(),e.getIsSystemapi(),e.getIsSameNameFunction()]}))}(i,t,e,a)}function A(e){const t=new Set(e.getAllCompatible());let r=0,n=0;return 2===t.size?(r=1,n=1):t.has(!0)?r=1:t.has(!1)&&(n=1),`{\n "兼容性":${r},\n "非兼容性":${n}\n }`}function N(e){const t=new Set(e.getAllChangeType());let r=0,n=0,i=0,a=0,o=0,s=0;return t.has("API修改(原型修改)")&&s++,t.has("API修改(约束变化)")&&o++,(t.has("API修改(原型修改)")||t.has("API修改(约束变化)"))&&a++,t.has("API废弃")&&i++,t.has("API新增")&&r++,t.has("API删除")&&n++,`{\n "API新增": ${r},\n "API删除": ${n},\n "API废弃": ${i},\n "API修改": ${a},\n "API修改(原型修改)": ${s},\n "API修改(约束变化)": ${o}\n }`}function P(e){return""!==e.getNewApiName()?e.getNewApiName():e.getOldApiName()}function I(e){const t=e.getNewHierarchicalRelations();return t.length>0?t.join():e.getOldHierarchicalRelations().join()}function F(e){if(e.getDiffMessage()===f.diffTypeMap.get(f.ApiDiffType.ADD))return"NA";let t="";const r=e.getOldHierarchicalRelations(),n=e.getParentModuleName(r);return t="-1"!==e.getOldDescription()&&e.getOldDescription()?e.getOldDescription():"NA",e.getDiffType()===f.ApiDiffType.KIT_CHANGE?`${t}`:`类名:${n};\nAPI声明:${e.getOldApiDefinedText()}\n差异内容:${t}`}function O(e){if(e.getDiffMessage()===f.diffTypeMap.get(f.ApiDiffType.REDUCE))return"NA";let t="";const r=e.getNewHierarchicalRelations(),n=e.getParentModuleName(r);return t="-1"!==e.getNewDescription()&&e.getNewDescription()?e.getNewDescription():"NA",e.getDiffType()===f.ApiDiffType.KIT_CHANGE?`${t}`:`类名:${n};\nAPI声明:${e.getNewApiDefinedText()}\n差异内容:${t}`}t.joinOldMessage=F,t.joinNewMessage=O,t.toolNameMethod=new Map([[E.
COLLECT
,function(e){const t=i.default.resolve(c.FileUtils.getBaseDirName(),e.collectPath);let r,n="";""!== (…)
[all...]
Completed in 75 milliseconds