Classify the tool registry so read-only MCP can reach read-only tools
The read-only MCP tool refused the whole `seal-use tool <name>` area, because the 98-entry internal tool registry had no read/write classification. Now it does: SEAL_READ_ONLY_TOOLS (66) and SEAL_MUTATING_TOOLS (32), exported from src/domains/seal/tools.ts, with the policy delegating `tool` to them. The two sets are exhaustive by construction — a test asserts they partition sealTools exactly — so a newly added tool fails the suite until it is classified, rather than silently defaulting into one bucket. Classifying by inspection was not enough. Cross-checking mechanically (every exported function in src/domains/seal that performs a mutating HTTP call, mapped to the tools that invoke it) caught a real mistake shipped in #115: `analytics analyze` was allow-listed as read-only, but it calls seal_insight_record_analyze, which issues a POST and starts an analysis server-side. Removed from the CLI allow-list; a comment records why it is absent, since the name reads like a query. `approval-runs pick` went the other way into read-only: it dispatches to seal_approval_run_pick, which is a query over approval runs rather than a local-state mutation. Read-only means: reads tenant state, or writes only a local file. Anything that creates, updates, deletes, publishes, pushes, replays, uploads, activates or mints a credential counts as mutating. `seal_webhook_material_pack` is mutating because push mode sends the pack even though preview mode does not; `seal_approval_runs_export` and `seal_insight_export` are read-only because they only write a local workbook.
This commit is contained in:
1 parent
81504df98d
commit
11b8cfce39
7 files changed
+278
-115
No files matched your search
@@ -17,6 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Added a regression test that boots the packaged `dist/mcp/server.js` over stdio and completes a handshake. The existing tests exercise source rather than the shipped artifact, which is why this went unnoticed.
|
||||
|
||||
### Changed
|
||||
- **Read-Only Coverage for `seal-use tool <name>`, and a Misclassification Fixed**: the 98-entry internal tool registry now carries an exhaustive read/write classification (`SEAL_READ_ONLY_TOOLS` / `SEAL_MUTATING_TOOLS` in `src/domains/seal/tools.ts`), so the read-only MCP tool reaches read-only registry tools (66 of them) instead of refusing the whole `tool` area. A test asserts the two sets partition the registry exactly, so a newly added tool fails the suite until it is classified rather than silently defaulting.
|
||||
- This caught a mistake shipped in #115: `analytics analyze` was allow-listed as read-only, but it calls `seal_insight_record_analyze`, which issues a **POST** and starts an analysis server-side. Removed. The classification was cross-checked mechanically — every exported function in `src/domains/seal` that performs a mutating HTTP call was mapped to the tools invoking it — rather than by trusting tool names.
|
||||
- `approval-runs pick` moved the other way, into read-only: it is a query, not a local-state mutation.
|
||||
- **MCP TypeScript SDK v1 to v2**: the monolithic `@modelcontextprotocol/sdk` package has been split into scoped packages. Migrated the server to `@modelcontextprotocol/server` and the tests to `@modelcontextprotocol/client`, both at v2.
|
||||
- Replaced the low-level `Server` + `setRequestHandler` usage with the high-level `McpServer` + `registerTool`, and the hand-written JSON Schema literal with a Zod `z.strictObject` schema (which still emits `additionalProperties: false`).
|
||||
- Added tool metadata clients could not previously see: a `title` and `annotations` (`readOnlyHint: false`, `destructiveHint: true`, `idempotentHint: false`, `openWorldHint: true`). `seal_cli` is a passthrough that can reach mutating verbs, so it must not be advertised as safe to auto-run or safe to retry; the description now names the command families that need user confirmation.
|
||||
|
||||
Vendored
+110
-110
@@ -1,7 +1,7 @@
|
||||
import{createRequire as Ag0}from"node:module";var Lg0=Object.create;var{getPrototypeOf:Fg0,defineProperty:xT,getOwnPropertyNames:wg0}=Object;var Mg0=Object.prototype.hasOwnProperty;function Og0($){return this[$]}var Ng0,Dg0,J6=($,Y,z)=>{var U=$!=null&&typeof $==="object";if(U){var Q=Y?Ng0??=new WeakMap:Dg0??=new WeakMap,J=Q.get($);if(J)return J}z=$!=null?Lg0(Fg0($)):{};let I=Y||!$||!$.__esModule?xT(z,"default",{value:$,enumerable:!0}):z;for(let K of wg0($))if(!Mg0.call(I,K))xT(I,K,{get:Og0.bind($,K),enumerable:!0});if(U)Q.set($,I);return I};var E=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports);var Bg0=($)=>$;function Pg0($,Y){this[$]=Bg0.bind(null,Y)}var x8=($,Y)=>{for(var z in Y)xT($,z,{get:Y[z],enumerable:!0,configurable:!0,set:Pg0.bind(Y,z)})};var o=($,Y)=>()=>($&&(Y=$($=0)),Y);var I0=Ag0(import.meta.url);var Tg0,Sq,jg0,Eg0,Cg0,Rg0,R0=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports),Ao=($,Y)=>{let z={};for(var U in $)Sq(z,U,{get:$[U],enumerable:!0});if(Y)Sq(z,Symbol.toStringTag,{value:"Module"});return z},_g0=($,Y,z,U)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(var Q=Eg0(Y),J=0,I=Q.length,K;J<I;J++)if(K=Q[J],!Rg0.call($,K)&&K!==z)Sq($,K,{get:((G)=>Y[G]).bind(null,K),enumerable:!(U=jg0(Y,K))||U.enumerable})}return $},gq=($,Y,z)=>(z=$!=null?Tg0(Cg0($)):{},_g0(Y||!$||!$.__esModule?Sq(z,"default",{value:$,enumerable:!0}):z,$));var fT=o(()=>{Tg0=Object.create,Sq=Object.defineProperty,jg0=Object.getOwnPropertyDescriptor,Eg0=Object.getOwnPropertyNames,Cg0=Object.getPrototypeOf,Rg0=Object.prototype.hasOwnProperty});function jo($){return typeof $==="string"&&To.has($.replace(/#$/,""))}function Eo($,Y){if(!("$schema"in $)||typeof $.$schema!=="string")return"2020-12";let z=$.$schema.replace(/#$/,"");if(vg0.has(z))return"2020-12";if(To.has(z))return"2019-09";if(hg0.has(z)||Sg0.has(z))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${$.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${Y}`)}var vg0,To,hg0,Sg0;var uT=o(()=>{vg0=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),To=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),hg0=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),Sg0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"])});function W0($,Y,z){function U(K,G){if(!K._zod)Object.defineProperty(K,"_zod",{value:{def:G,constr:I,traits:new Set},enumerable:!1});if(K._zod.traits.has($))return;K._zod.traits.add($),Y(K,G);let W=I.prototype,H=Object.keys(W);for(let X=0;X<H.length;X++){let Z=H[X];if(!(Z in K))K[Z]=W[Z].bind(K)}}let Q=z?.Parent??Object;class J extends Q{}Object.defineProperty(J,"name",{value:$});function I(K){var G;let W=z?.Parent?new J:this;U(W,K),(G=W._zod).deferred??(G.deferred=[]);for(let H of W._zod.deferred)H();return W}return Object.defineProperty(I,"init",{value:U}),Object.defineProperty(I,Symbol.hasInstance,{value:(K)=>{if(z?.Parent&&K instanceof z.Parent)return!0;return K?._zod?.traits?.has($)}}),Object.defineProperty(I,"name",{value:$}),I}function a4($){if($)Object.assign(NY,$);return NY}var Co,pK,bT,x5,DY,NY;var BY=o(()=>{pK=Object.freeze({status:"aborted"});bT=Symbol("zod_brand");x5=class x5 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};DY=class DY extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(Co=globalThis).__zod_globalConfig??(Co.__zod_globalConfig={});NY=globalThis.__zod_globalConfig});var y0={};x8(y0,{unwrapMessage:()=>dK,uint8ArrayToHex:()=>Qy0,uint8ArrayToBase64url:()=>zy0,uint8ArrayToBase64:()=>vo,stringifyPrimitive:()=>v0,slugify:()=>nT,shallowClone:()=>dT,safeExtend:()=>sg0,required:()=>eg0,randomString:()=>ng0,propertyKeyTypes:()=>oK,promiseAllObject:()=>cg0,primitiveTypes:()=>mT,prefixIssues:()=>f8,pick:()=>lg0,partial:()=>tg0,parsedType:()=>S0,optionalKeys:()=>lT,omit:()=>og0,objectClone:()=>ug0,numKeys:()=>pg0,nullish:()=>Q3,normalizeParams:()=>x0,mergeDefs:()=>b9,merge:()=>ag0,jsonStringifyReplacer:()=>fU,joinValues:()=>N0,issue:()=>bU,isPlainObject:()=>I3,isObject:()=>PY,hexToUint8Array:()=>Uy0,getSizableOrigin:()=>rK,getParsedType:()=>dg0,getLengthableOrigin:()=>sK,getEnumValues:()=>mK,getElementAtPath:()=>ig0,floatSafeRemainder:()=>cT,finalizeIssue:()=>B8,extend:()=>rg0,explicitlyAborted:()=>sT,escapeRegex:()=>N$,esc:()=>yq,defineLazy:()=>T1,createTransparentProxy:()=>mg0,cloneDef:()=>bg0,clone:()=>D8,cleanRegex:()=>lK,cleanEnum:()=>$y0,captureStackTrace:()=>kq,cached:()=>uU,base64urlToUint8Array:()=>Yy0,base64ToUint8Array:()=>_o,assignProp:()=>J3,assertNotEqual:()=>yg0,assertNever:()=>xg0,assertIs:()=>kg0,assertEqual:()=>gg0,assert:()=>fg0,allowsEval:()=>pT,aborted:()=>K3,NUMBER_FORMAT_RANGES:()=>oT,Class:()=>hoLine truncated
|
||||
`)}var So=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,fU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},aK,u8;var eT=o(()=>{BY();$1();aK=W0("$ZodError",So),u8=W0("$ZodError",So,{Parent:Error})});var iU=($)=>(Y,z,U,Q)=>{let J=U?{...U,async:!1}:{async:!1},I=Y._zod.run({value:z,issues:[]},J);if(I instanceof Promise)throw new x5;if(I.issues.length){let K=new(Q?.Err??$)(I.issues.map((G)=>B8(G,J,a4())));throw kq(K,Q?.callee),K}return I.value},xq,cU=($)=>async(Y,z,U,Q)=>{let J=U?{...U,async:!0}:{async:!0},I=Y._zod.run({value:z,issues:[]},J);if(I instanceof Promise)I=await I;if(I.issues.length){let K=new(Q?.Err??$)(I.issues.map((G)=>B8(G,J,a4())));throw kq(K,Q?.callee),K}return I.value},fq,nU=($)=>(Y,z,U)=>{let Q=U?{...U,async:!1}:{async:!1},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)throw new x5;return J.issues.length?{success:!1,error:new($??aK)(J.issues.map((I)=>B8(I,Q,a4())))}:{success:!0,data:J.value}},$j,pU=($)=>async(Y,z,U)=>{let Q=U?{...U,async:!0}:{async:!0},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((I)=>B8(I,Q,a4())))}:{success:!0,data:J.value}},Yj,uq=($)=>(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return iU($)(Y,z,Q)},Iy0,bq=($)=>(Y,z,U)=>{return iU($)(Y,z,U)},Ky0,iq=($)=>async(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return cU($)(Y,z,Q)},Gy0,cq=($)=>async(Y,z,U)=>{return cU($)(Y,z,U)},Wy0,nq=($)=>(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return nU($)(Y,z,Q)},Hy0,pq=($)=>(Y,z,U)=>{return nU($)(Y,z,U)},Xy0,dq=($)=>async(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return pU($)(Y,z,Q)},Zy0,mq=($)=>async(Y,z,U)=>{return pU($)(Y,z,U)},qy0;var zj=o(()=>{BY();eT();$1();xq=iU(u8),fq=cU(u8),$j=nU(u8),Yj=pU(u8),Iy0=uq(u8),Ky0=bq(u8),Gy0=iq(u8),Wy0=cq(u8),Hy0=nq(u8),Xy0=pq(u8),Zy0=dq(u8),qy0=mq(u8)});var Y$={};x8(Y$,{xid:()=>Ij,uuid7:()=>wy0,uuid6:()=>Fy0,uuid4:()=>Ly0,uuid:()=>AY,uppercase:()=>vj,unicodeEmail:()=>yo,undefined:()=>Rj,ulid:()=>Jj,time:()=>Bj,string:()=>Aj,sha512_hex:()=>fy0,sha512_base64url:()=>by0,sha512_base64:()=>uy0,sha384_hex:()=>yy0,sha384_base64url:()=>xy0,sha384_base64:()=>ky0,sha256_hex:()=>hy0,sha256_base64url:()=>gy0,sha256_base64:()=>Sy0,sha1_hex:()=>Ry0,sha1_base64url:()=>vy0,sha1_base64:()=>_y0,rfc5322Email:()=>Oy0,number:()=>$G,null:()=>Cj,nanoid:()=>Gj,md5_hex:()=>jy0,md5_base64url:()=>Cy0,md5_base64:()=>Ey0,mac:()=>Lj,lowercase:()=>_j,ksuid:()=>Kj,ipv6:()=>Vj,ipv4:()=>qj,integer:()=>jj,idnEmail:()=>Ny0,httpProtocol:()=>Oj,html5Email:()=>My0,hostname:()=>Py0,hex:()=>Ty0,guid:()=>Hj,extendedDuration:()=>Vy0,emoji:()=>Zj,email:()=>Xj,e164:()=>Nj,duration:()=>Wj,domain:()=>Ay0,datetime:()=>Pj,date:()=>Dj,cuid2:()=>Qj,cuid:()=>Uj,cidrv6:()=>wj,cidrv4:()=>Fj,browserEmail:()=>Dy0,boolean:()=>Ej,bigint:()=>Tj,base64url:()=>lq,base64:()=>Mj});function Zj(){return new RegExp(By0,"u")}function xo($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Bj($){return new RegExp(`^${xo($)}$`)}function Pj($){let Y=xo({precision:$.precision}),z=["Z"];if($.local)z.push("");if($.offset)z.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let U=`${Y}(?:${z.join("|")})`;return new RegExp(`^${ko}T(?:${U})$`)}function YG($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function zG($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Uj,Qj,Jj,Ij,Kj,Gj,Wj,Vy0,Hj,AY=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Ly0,Fy0,wy0,Xj,My0,Oy0,yo,Ny0,Dy0,By0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",qj,Vj,Lj=($)=>{let Y=N$($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},Fj,wj,Mj,lq,Py0,Ay0,Oj,Nj,ko="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Dj,Aj=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},Tj,jj,$G,Ej,Cj,Rj,_j,vj,Ty0,jy0,Ey0,Cy0,Ry0,_y0,vy0,hy0,Sy0,gy0,yy0,ky0,xy0,fy0,uy0,by0;var oq=o(()=>{$1();Uj=/^[cC][0-9a-z]{6,}$/,Qj=/^[0-9a-z]+$/,Jj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ij=/^[0-9a-vA-V]{20}$/,Kj=/^[A-Za-z0-9]{27}$/,Gj=/^[a-zA-Z0-9_-]{21}$/,Wj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\dLine truncated
|
||||
import{createRequire as Tg0}from"node:module";var Fg0=Object.create;var{getPrototypeOf:wg0,defineProperty:xT,getOwnPropertyNames:Mg0}=Object;var Og0=Object.prototype.hasOwnProperty;function Ng0($){return this[$]}var Dg0,Bg0,J6=($,Y,z)=>{var U=$!=null&&typeof $==="object";if(U){var Q=Y?Dg0??=new WeakMap:Bg0??=new WeakMap,J=Q.get($);if(J)return J}z=$!=null?Fg0(wg0($)):{};let I=Y||!$||!$.__esModule?xT(z,"default",{value:$,enumerable:!0}):z;for(let K of Mg0($))if(!Og0.call(I,K))xT(I,K,{get:Ng0.bind($,K),enumerable:!0});if(U)Q.set($,I);return I};var E=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports);var Pg0=($)=>$;function Ag0($,Y){this[$]=Pg0.bind(null,Y)}var x8=($,Y)=>{for(var z in Y)xT($,z,{get:Y[z],enumerable:!0,configurable:!0,set:Ag0.bind(Y,z)})};var o=($,Y)=>()=>($&&(Y=$($=0)),Y);var I0=Tg0(import.meta.url);var jg0,gq,Eg0,Cg0,Rg0,_g0,R0=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports),Ao=($,Y)=>{let z={};for(var U in $)gq(z,U,{get:$[U],enumerable:!0});if(Y)gq(z,Symbol.toStringTag,{value:"Module"});return z},vg0=($,Y,z,U)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(var Q=Cg0(Y),J=0,I=Q.length,K;J<I;J++)if(K=Q[J],!_g0.call($,K)&&K!==z)gq($,K,{get:((G)=>Y[G]).bind(null,K),enumerable:!(U=Eg0(Y,K))||U.enumerable})}return $},yq=($,Y,z)=>(z=$!=null?jg0(Rg0($)):{},vg0(Y||!$||!$.__esModule?gq(z,"default",{value:$,enumerable:!0}):z,$));var fT=o(()=>{jg0=Object.create,gq=Object.defineProperty,Eg0=Object.getOwnPropertyDescriptor,Cg0=Object.getOwnPropertyNames,Rg0=Object.getPrototypeOf,_g0=Object.prototype.hasOwnProperty});function jo($){return typeof $==="string"&&To.has($.replace(/#$/,""))}function Eo($,Y){if(!("$schema"in $)||typeof $.$schema!=="string")return"2020-12";let z=$.$schema.replace(/#$/,"");if(hg0.has(z))return"2020-12";if(To.has(z))return"2019-09";if(Sg0.has(z)||gg0.has(z))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${$.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${Y}`)}var hg0,To,Sg0,gg0;var uT=o(()=>{hg0=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),To=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Sg0=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),gg0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"])});function W0($,Y,z){function U(K,G){if(!K._zod)Object.defineProperty(K,"_zod",{value:{def:G,constr:I,traits:new Set},enumerable:!1});if(K._zod.traits.has($))return;K._zod.traits.add($),Y(K,G);let W=I.prototype,H=Object.keys(W);for(let X=0;X<H.length;X++){let Z=H[X];if(!(Z in K))K[Z]=W[Z].bind(K)}}let Q=z?.Parent??Object;class J extends Q{}Object.defineProperty(J,"name",{value:$});function I(K){var G;let W=z?.Parent?new J:this;U(W,K),(G=W._zod).deferred??(G.deferred=[]);for(let H of W._zod.deferred)H();return W}return Object.defineProperty(I,"init",{value:U}),Object.defineProperty(I,Symbol.hasInstance,{value:(K)=>{if(z?.Parent&&K instanceof z.Parent)return!0;return K?._zod?.traits?.has($)}}),Object.defineProperty(I,"name",{value:$}),I}function a4($){if($)Object.assign(NY,$);return NY}var Co,pK,bT,x5,DY,NY;var BY=o(()=>{pK=Object.freeze({status:"aborted"});bT=Symbol("zod_brand");x5=class x5 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};DY=class DY extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(Co=globalThis).__zod_globalConfig??(Co.__zod_globalConfig={});NY=globalThis.__zod_globalConfig});var y0={};x8(y0,{unwrapMessage:()=>dK,uint8ArrayToHex:()=>Jy0,uint8ArrayToBase64url:()=>Uy0,uint8ArrayToBase64:()=>vo,stringifyPrimitive:()=>v0,slugify:()=>nT,shallowClone:()=>dT,safeExtend:()=>ag0,required:()=>$y0,randomString:()=>pg0,propertyKeyTypes:()=>oK,promiseAllObject:()=>ng0,primitiveTypes:()=>mT,prefixIssues:()=>f8,pick:()=>og0,partial:()=>eg0,parsedType:()=>S0,optionalKeys:()=>lT,omit:()=>rg0,objectClone:()=>bg0,numKeys:()=>dg0,nullish:()=>Q3,normalizeParams:()=>x0,mergeDefs:()=>b9,merge:()=>tg0,jsonStringifyReplacer:()=>fU,joinValues:()=>N0,issue:()=>bU,isPlainObject:()=>I3,isObject:()=>PY,hexToUint8Array:()=>Qy0,getSizableOrigin:()=>rK,getParsedType:()=>mg0,getLengthableOrigin:()=>sK,getEnumValues:()=>mK,getElementAtPath:()=>cg0,floatSafeRemainder:()=>cT,finalizeIssue:()=>B8,extend:()=>sg0,explicitlyAborted:()=>sT,escapeRegex:()=>N$,esc:()=>kq,defineLazy:()=>T1,createTransparentProxy:()=>lg0,cloneDef:()=>ig0,clone:()=>D8,cleanRegex:()=>lK,cleanEnum:()=>Yy0,captureStackTrace:()=>xq,cached:()=>uU,base64urlToUint8Array:()=>zy0,base64ToUint8Array:()=>_o,assignProp:()=>J3,assertNotEqual:()=>kg0,assertNever:()=>fg0,assertIs:()=>xg0,assertEqual:()=>yg0,assert:()=>ug0,allowsEval:()=>pT,aborted:()=>K3,NUMBER_FORMAT_RANGES:()=>oT,Class:()=>hoLine truncated
|
||||
`)}var So=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,fU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},aK,u8;var eT=o(()=>{BY();$1();aK=W0("$ZodError",So),u8=W0("$ZodError",So,{Parent:Error})});var iU=($)=>(Y,z,U,Q)=>{let J=U?{...U,async:!1}:{async:!1},I=Y._zod.run({value:z,issues:[]},J);if(I instanceof Promise)throw new x5;if(I.issues.length){let K=new(Q?.Err??$)(I.issues.map((G)=>B8(G,J,a4())));throw xq(K,Q?.callee),K}return I.value},fq,cU=($)=>async(Y,z,U,Q)=>{let J=U?{...U,async:!0}:{async:!0},I=Y._zod.run({value:z,issues:[]},J);if(I instanceof Promise)I=await I;if(I.issues.length){let K=new(Q?.Err??$)(I.issues.map((G)=>B8(G,J,a4())));throw xq(K,Q?.callee),K}return I.value},uq,nU=($)=>(Y,z,U)=>{let Q=U?{...U,async:!1}:{async:!1},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)throw new x5;return J.issues.length?{success:!1,error:new($??aK)(J.issues.map((I)=>B8(I,Q,a4())))}:{success:!0,data:J.value}},$j,pU=($)=>async(Y,z,U)=>{let Q=U?{...U,async:!0}:{async:!0},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((I)=>B8(I,Q,a4())))}:{success:!0,data:J.value}},Yj,bq=($)=>(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return iU($)(Y,z,Q)},Ky0,iq=($)=>(Y,z,U)=>{return iU($)(Y,z,U)},Gy0,cq=($)=>async(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return cU($)(Y,z,Q)},Wy0,nq=($)=>async(Y,z,U)=>{return cU($)(Y,z,U)},Hy0,pq=($)=>(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return nU($)(Y,z,Q)},Xy0,dq=($)=>(Y,z,U)=>{return nU($)(Y,z,U)},Zy0,mq=($)=>async(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return pU($)(Y,z,Q)},qy0,lq=($)=>async(Y,z,U)=>{return pU($)(Y,z,U)},Vy0;var zj=o(()=>{BY();eT();$1();fq=iU(u8),uq=cU(u8),$j=nU(u8),Yj=pU(u8),Ky0=bq(u8),Gy0=iq(u8),Wy0=cq(u8),Hy0=nq(u8),Xy0=pq(u8),Zy0=dq(u8),qy0=mq(u8),Vy0=lq(u8)});var Y$={};x8(Y$,{xid:()=>Ij,uuid7:()=>My0,uuid6:()=>wy0,uuid4:()=>Fy0,uuid:()=>AY,uppercase:()=>vj,unicodeEmail:()=>yo,undefined:()=>Rj,ulid:()=>Jj,time:()=>Bj,string:()=>Aj,sha512_hex:()=>uy0,sha512_base64url:()=>iy0,sha512_base64:()=>by0,sha384_hex:()=>ky0,sha384_base64url:()=>fy0,sha384_base64:()=>xy0,sha256_hex:()=>Sy0,sha256_base64url:()=>yy0,sha256_base64:()=>gy0,sha1_hex:()=>_y0,sha1_base64url:()=>hy0,sha1_base64:()=>vy0,rfc5322Email:()=>Ny0,number:()=>$G,null:()=>Cj,nanoid:()=>Gj,md5_hex:()=>Ey0,md5_base64url:()=>Ry0,md5_base64:()=>Cy0,mac:()=>Lj,lowercase:()=>_j,ksuid:()=>Kj,ipv6:()=>Vj,ipv4:()=>qj,integer:()=>jj,idnEmail:()=>Dy0,httpProtocol:()=>Oj,html5Email:()=>Oy0,hostname:()=>Ay0,hex:()=>jy0,guid:()=>Hj,extendedDuration:()=>Ly0,emoji:()=>Zj,email:()=>Xj,e164:()=>Nj,duration:()=>Wj,domain:()=>Ty0,datetime:()=>Pj,date:()=>Dj,cuid2:()=>Qj,cuid:()=>Uj,cidrv6:()=>wj,cidrv4:()=>Fj,browserEmail:()=>By0,boolean:()=>Ej,bigint:()=>Tj,base64url:()=>oq,base64:()=>Mj});function Zj(){return new RegExp(Py0,"u")}function xo($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Bj($){return new RegExp(`^${xo($)}$`)}function Pj($){let Y=xo({precision:$.precision}),z=["Z"];if($.local)z.push("");if($.offset)z.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let U=`${Y}(?:${z.join("|")})`;return new RegExp(`^${ko}T(?:${U})$`)}function YG($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function zG($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Uj,Qj,Jj,Ij,Kj,Gj,Wj,Ly0,Hj,AY=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Fy0,wy0,My0,Xj,Oy0,Ny0,yo,Dy0,By0,Py0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",qj,Vj,Lj=($)=>{let Y=N$($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},Fj,wj,Mj,oq,Ay0,Ty0,Oj,Nj,ko="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Dj,Aj=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},Tj,jj,$G,Ej,Cj,Rj,_j,vj,jy0,Ey0,Cy0,Ry0,_y0,vy0,hy0,Sy0,gy0,yy0,ky0,xy0,fy0,uy0,by0,iy0;var rq=o(()=>{$1();Uj=/^[cC][0-9a-z]{6,}$/,Qj=/^[0-9a-z]+$/,Jj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ij=/^[0-9a-vA-V]{20}$/,Kj=/^[A-Za-z0-9]{27}$/,Gj=/^[a-zA-Z0-9_-]{21}$/,Wj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\dLine truncated
|
||||
`).filter((J)=>J),U=Math.min(...z.map((J)=>J.length-J.trimStart().length)),Q=z.map((J)=>J.slice(U)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of Q)this.content.push(J)}compile(){let $=Function,Y=this?.args,U=[...(this?.content??[""]).map((Q)=>` ${Q}`)];return new $(...Y,U.join(`
|
||||
`))}}var sj;var aj=o(()=>{sj={major:4,minor:4,patch:3}});function OE($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function zr($){if(!lq.test($))return!1;let Y=$.replace(/[-_]/g,(U)=>U==="-"?"+":"/"),z=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return OE(z)}function Ur($,Y=null){try{let z=$.split(".");if(z.length!==3)return!1;let[U]=z;if(!U)return!1;let Q=JSON.parse(atob(U));if("typ"in Q&&Q?.typ!=="JWT")return!1;if(!Q.alg)return!1;if(Y&&(!("alg"in Q)||Q.alg!==Y))return!1;return!0}catch{return!1}}function io($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function zV($,Y,z,U,Q,J){let I=z in U;if($.issues.length){if(Q&&J&&!I)return;Y.issues.push(...f8(z,$.issues))}if(!I&&!Q){if(!$.issues.length)Y.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[z]});return}if($.value===void 0){if(I)Y.value[z]=void 0}else Y.value[z]=$.value}function Qr($){let Y=Object.keys($.shape);for(let U of Y)if(!$.shape?.[U]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${U}": expected a Zod schema`);let z=lT($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(z)}}function Jr($,Y,z,U,Q,J){let I=[],K=Q.keySet,G=Q.catchall._zod,W=G.def.type,H=G.optin==="optional",X=G.optout==="optional";for(let Z in Y){if(Z==="__proto__")continue;if(K.has(Z))continue;if(W==="never"){I.push(Z);continue}let q=G.run({value:Y[Z],issues:[]},U);if(q instanceof Promise)$.push(q.then((V)=>zV(V,z,Z,Y,H,X)));else zV(q,z,Z,Y,H,X)}if(I.length)z.issues.push({code:"unrecognized_keys",keys:I,input:Y,inst:J});if(!$.length)return z;return Promise.all($).then(()=>{return z})}function co($,Y,z,U){for(let J of $)if(J.issues.length===0)return Y.value=J.value,Y;let Q=$.filter((J)=>!K3(J));if(Q.length===1)return Y.value=Q[0].value,Q[0];return Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((J)=>J.issues.map((I)=>B8(I,U,a4())))}),Y}function no($,Y,z,U){let Q=$.filter((J)=>J.issues.length===0);if(Q.length===1)return Y.value=Q[0].value,Y;if(Q.length===0)Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((J)=>J.issues.map((I)=>B8(I,U,a4())))});else Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:[],inclusive:!1});return Y}function tj($,Y){if($===Y)return{valid:!0,data:$};if($ instanceof Date&&Y instanceof Date&&+$===+Y)return{valid:!0,data:$};if(I3($)&&I3(Y)){let z=Object.keys(Y),U=Object.keys($).filter((J)=>z.indexOf(J)!==-1),Q={...$,...Y};for(let J of U){let I=tj($[J],Y[J]);if(!I.valid)return{valid:!1,mergeErrorPath:[J,...I.mergeErrorPath]};Q[J]=I.data}return{valid:!0,data:Q}}if(Array.isArray($)&&Array.isArray(Y)){if($.length!==Y.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let U=0;U<$.length;U++){let Q=$[U],J=Y[U],I=tj(Q,J);if(!I.valid)return{valid:!1,mergeErrorPath:[U,...I.mergeErrorPath]};z.push(I.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function po($,Y,z){let U=new Map,Q;for(let K of Y.issues)if(K.code==="unrecognized_keys"){Q??(Q=K);for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).l=!0}}else $.issues.push(K);for(let K of z.issues)if(K.code==="unrecognized_keys")for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).r=!0}else $.issues.push(K);let J=[...U].filter(([,K])=>K.l&&K.r).map(([K])=>K);if(J.length&&Q)$.issues.push({...Q,keys:J});if(K3($))return $;let I=tj(Y.value,z.value);if(!I.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(I.mergeErrorPath)}`);return $.value=I.data,$}function mo($,Y){for(let z=$.length-1;z>=0;z--)if($[z]._zod[Y]!=="optional")return z+1;return 0}function lo($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function oo($,Y,z,U,Q){for(let J=0;J<z.length;J++){let I=$[J],K=J<U.length;if(I.issues.length){if(!K&&J>=Q){Y.value.length=J;break}Y.issues.push(...f8(J,I.issues))}Y.value[J]=I.value}for(let J=Y.value.length-1;J>=U.length;J--)if(z[J]._zod.optout==="optional"&&Y.value[J]===void 0)Y.value.length=J;else break;return Y}function ro($,Y,z,U,Q,J,I){if($.issues.length)if(oK.has(typeof U))z.issues.push(...f8(U,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:Q,inst:J,issues:$.issues.map((K)=>B8(K,I,a4()))});if(Y.issues.length)if(oK.has(typeof U))z.issues.push(...f8(U,Y.issues));else z.issues.push({origin:"map",code:"invalid_element",input:Q,inst:J,key:U,issues:Y.issues.map((K)=>B8(K,I,a4()))});z.value.set($.value,Y.value)}function so($,Y){if($.issues.length)Y.issues.push(...$.issues);Y.value.add($.value)}function ao($,Y){if(Y===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function to($,Y){if($.value===void 0)$.value=Y.defaultValue;return $}function eo($,Y){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:Y});return $}function eq($,Y,z){if($.issues.length)return $.aborted=!0,$;return Y._zod.run({value:$.value,issues:$.issues,fa
Line truncated
|
||||
`))}}var sj;var aj=o(()=>{sj={major:4,minor:4,patch:3}});function OE($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function zr($){if(!oq.test($))return!1;let Y=$.replace(/[-_]/g,(U)=>U==="-"?"+":"/"),z=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return OE(z)}function Ur($,Y=null){try{let z=$.split(".");if(z.length!==3)return!1;let[U]=z;if(!U)return!1;let Q=JSON.parse(atob(U));if("typ"in Q&&Q?.typ!=="JWT")return!1;if(!Q.alg)return!1;if(Y&&(!("alg"in Q)||Q.alg!==Y))return!1;return!0}catch{return!1}}function io($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function UV($,Y,z,U,Q,J){let I=z in U;if($.issues.length){if(Q&&J&&!I)return;Y.issues.push(...f8(z,$.issues))}if(!I&&!Q){if(!$.issues.length)Y.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[z]});return}if($.value===void 0){if(I)Y.value[z]=void 0}else Y.value[z]=$.value}function Qr($){let Y=Object.keys($.shape);for(let U of Y)if(!$.shape?.[U]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${U}": expected a Zod schema`);let z=lT($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(z)}}function Jr($,Y,z,U,Q,J){let I=[],K=Q.keySet,G=Q.catchall._zod,W=G.def.type,H=G.optin==="optional",X=G.optout==="optional";for(let Z in Y){if(Z==="__proto__")continue;if(K.has(Z))continue;if(W==="never"){I.push(Z);continue}let q=G.run({value:Y[Z],issues:[]},U);if(q instanceof Promise)$.push(q.then((V)=>UV(V,z,Z,Y,H,X)));else UV(q,z,Z,Y,H,X)}if(I.length)z.issues.push({code:"unrecognized_keys",keys:I,input:Y,inst:J});if(!$.length)return z;return Promise.all($).then(()=>{return z})}function co($,Y,z,U){for(let J of $)if(J.issues.length===0)return Y.value=J.value,Y;let Q=$.filter((J)=>!K3(J));if(Q.length===1)return Y.value=Q[0].value,Q[0];return Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((J)=>J.issues.map((I)=>B8(I,U,a4())))}),Y}function no($,Y,z,U){let Q=$.filter((J)=>J.issues.length===0);if(Q.length===1)return Y.value=Q[0].value,Y;if(Q.length===0)Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((J)=>J.issues.map((I)=>B8(I,U,a4())))});else Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:[],inclusive:!1});return Y}function tj($,Y){if($===Y)return{valid:!0,data:$};if($ instanceof Date&&Y instanceof Date&&+$===+Y)return{valid:!0,data:$};if(I3($)&&I3(Y)){let z=Object.keys(Y),U=Object.keys($).filter((J)=>z.indexOf(J)!==-1),Q={...$,...Y};for(let J of U){let I=tj($[J],Y[J]);if(!I.valid)return{valid:!1,mergeErrorPath:[J,...I.mergeErrorPath]};Q[J]=I.data}return{valid:!0,data:Q}}if(Array.isArray($)&&Array.isArray(Y)){if($.length!==Y.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let U=0;U<$.length;U++){let Q=$[U],J=Y[U],I=tj(Q,J);if(!I.valid)return{valid:!1,mergeErrorPath:[U,...I.mergeErrorPath]};z.push(I.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function po($,Y,z){let U=new Map,Q;for(let K of Y.issues)if(K.code==="unrecognized_keys"){Q??(Q=K);for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).l=!0}}else $.issues.push(K);for(let K of z.issues)if(K.code==="unrecognized_keys")for(let G of K.keys){if(!U.has(G))U.set(G,{});U.get(G).r=!0}else $.issues.push(K);let J=[...U].filter(([,K])=>K.l&&K.r).map(([K])=>K);if(J.length&&Q)$.issues.push({...Q,keys:J});if(K3($))return $;let I=tj(Y.value,z.value);if(!I.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(I.mergeErrorPath)}`);return $.value=I.data,$}function mo($,Y){for(let z=$.length-1;z>=0;z--)if($[z]._zod[Y]!=="optional")return z+1;return 0}function lo($,Y,z){if($.issues.length)Y.issues.push(...f8(z,$.issues));Y.value[z]=$.value}function oo($,Y,z,U,Q){for(let J=0;J<z.length;J++){let I=$[J],K=J<U.length;if(I.issues.length){if(!K&&J>=Q){Y.value.length=J;break}Y.issues.push(...f8(J,I.issues))}Y.value[J]=I.value}for(let J=Y.value.length-1;J>=U.length;J--)if(z[J]._zod.optout==="optional"&&Y.value[J]===void 0)Y.value.length=J;else break;return Y}function ro($,Y,z,U,Q,J,I){if($.issues.length)if(oK.has(typeof U))z.issues.push(...f8(U,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:Q,inst:J,issues:$.issues.map((K)=>B8(K,I,a4()))});if(Y.issues.length)if(oK.has(typeof U))z.issues.push(...f8(U,Y.issues));else z.issues.push({origin:"map",code:"invalid_element",input:Q,inst:J,key:U,issues:Y.issues.map((K)=>B8(K,I,a4()))});z.value.set($.value,Y.value)}function so($,Y){if($.issues.length)Y.issues.push(...$.issues);Y.value.add($.value)}function ao($,Y){if(Y===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function to($,Y){if($.value===void 0)$.value=Y.defaultValue;return $}function eo($,Y){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:Y});return $}function $V($,Y,z){if($.issues.length)return $.aborted=!0,$;return Y._zod.run({value:$.value,issues:$.issues,fa
Line truncated
|
||||
if (${N}.issues.length) {
|
||||
if (${A} in input) {
|
||||
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
|
||||
@@ -60,66 +60,66 @@ import{createRequire as Ag0}from"node:module";var Lg0=Object.create;var{getProto
|
||||
newResult[${A}] = ${N}.value;
|
||||
}
|
||||
|
||||
`)}q.write("payload.value = newResult;"),q.write("return payload;");let O=q.compile();return(D,N)=>O(Z,D,N)},J,I=PY,K=!NY.jitless,W=K&&pT.value,H=Y.catchall,X;$._zod.parse=(Z,q)=>{X??(X=U.value);let V=Z.value;if(!I(V))return Z.issues.push({expected:"object",code:"invalid_type",input:V,inst:$}),Z;if(K&&W&&q?.async===!1&&q.jitless!==!0){if(!J)J=Q(Y.shape);if(Z=J(Z,q),!H)return Z;return Jr([],V,Z,q,X,$)}return z(Z,q)}});QG=W0("$ZodUnion",($,Y)=>{q1.init($,Y),T1($._zod,"optin",()=>Y.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),T1($._zod,"optout",()=>Y.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),T1($._zod,"values",()=>{if(Y.options.every((U)=>U._zod.values))return new Set(Y.options.flatMap((U)=>Array.from(U._zod.values)));return}),T1($._zod,"pattern",()=>{if(Y.options.every((U)=>U._zod.pattern)){let U=Y.options.map((Q)=>Q._zod.pattern);return new RegExp(`^(${U.map((Q)=>lK(Q.source)).join("|")})$`)}return});let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,Q)=>{if(z)return z(U,Q);let J=!1,I=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},Q);if(G instanceof Promise)I.push(G),J=!0;else{if(G.issues.length===0)return G;I.push(G)}}if(!J)return co(I,U,$,Q);return Promise.all(I).then((K)=>{return co(K,U,$,Q)})}});xE=W0("$ZodXor",($,Y)=>{QG.init($,Y),Y.inclusive=!1;let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,Q)=>{if(z)return z(U,Q);let J=!1,I=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},Q);if(G instanceof Promise)I.push(G),J=!0;else I.push(G)}if(!J)return no(I,U,$,Q);return Promise.all(I).then((K)=>{return no(K,U,$,Q)})}}),fE=W0("$ZodDiscriminatedUnion",($,Y)=>{Y.inclusive=!1,QG.init($,Y);let z=$._zod.parse;T1($._zod,"propValues",()=>{let Q={};for(let J of Y.options){let I=J._zod.propValues;if(!I||Object.keys(I).length===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(J)}"`);for(let[K,G]of Object.entries(I)){if(!Q[K])Q[K]=new Set;for(let W of G)Q[K].add(W)}}return Q});let U=uU(()=>{let Q=Y.options,J=new Map;for(let I of Q){let K=I._zod.propValues?.[Y.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(I)}"`);for(let G of K){if(J.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);J.set(G,I)}}return J});$._zod.parse=(Q,J)=>{let I=Q.value;if(!PY(I))return Q.issues.push({code:"invalid_type",expected:"object",input:I,inst:$}),Q;let K=U.value.get(I?.[Y.discriminator]);if(K)return K._zod.run(Q,J);if(Y.unionFallback||J.direction==="backward")return z(Q,J);return Q.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:Y.discriminator,options:Array.from(U.value.keys()),input:I,path:[Y.discriminator],inst:$}),Q}}),uE=W0("$ZodIntersection",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let Q=z.value,J=Y.left._zod.run({value:Q,issues:[]},U),I=Y.right._zod.run({value:Q,issues:[]},U);if(J instanceof Promise||I instanceof Promise)return Promise.all([J,I]).then(([G,W])=>{return po(z,G,W)});return po(z,J,I)}});JV=W0("$ZodTuple",($,Y)=>{q1.init($,Y);let z=Y.items;$._zod.parse=(U,Q)=>{let J=U.value;if(!Array.isArray(J))return U.issues.push({input:J,inst:$,expected:"tuple",code:"invalid_type"}),U;U.value=[];let I=[],K=mo(z,"optin"),G=mo(z,"optout");if(!Y.rest){if(J.length<K)return U.issues.push({code:"too_small",minimum:K,inclusive:!0,input:J,inst:$,origin:"array"}),U;if(J.length>z.length)U.issues.push({code:"too_big",maximum:z.length,inclusive:!0,input:J,inst:$,origin:"array"})}let W=Array(z.length);for(let H=0;H<z.length;H++){let X=z[H]._zod.run({value:J[H],issues:[]},Q);if(X instanceof Promise)I.push(X.then((Z)=>{W[H]=Z}));else W[H]=X}if(Y.rest){let H=z.length-1,X=J.slice(z.length);for(let Z of X){H++;let q=Y.rest._zod.run({value:Z,issues:[]},Q);if(q instanceof Promise)I.push(q.then((V)=>lo(V,U,H)));else lo(q,U,H)}}if(I.length)return Promise.all(I).then(()=>oo(W,U,z,J,G));return oo(W,U,z,J,G)}});bE=W0("$ZodRecord",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let Q=z.value;if(!I3(Q))return z.issues.push({expected:"record",code:"invalid_type",input:Q,inst:$}),z;let J=[],I=Y.keyType._zod.values;if(I){z.value={};let K=new Set;for(let W of I)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){K.add(typeof W==="number"?W.toString():W);let H=Y.keyType._zod.run({value:W,issues:[]},U);if(H instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(H.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:H.issues.map((q)=>B8(q,U,a4())),input:W,path:[W],inst:$});continue}let X=H.value,Z=Y.valueType._zod.run({value:Q[W],issues:[]},U);if(Z instanceof Promise)J.push(Z.then((q)=>{if(q.issues.length)z.issues.push(...f8(W,q.issues));z.value[X]=q.value}));else{if(Z.issues.length)z.issues.push(...f8(W,Z.issues));z.value[X]=Z.value}}let G;for(let W in Q)if(!K.has(W))G=G??[],G.push(W);if(G&&G.length>0)z.issues.push({code:"unrec
Line truncated
|
||||
`)}q.write("payload.value = newResult;"),q.write("return payload;");let O=q.compile();return(D,N)=>O(Z,D,N)},J,I=PY,K=!NY.jitless,W=K&&pT.value,H=Y.catchall,X;$._zod.parse=(Z,q)=>{X??(X=U.value);let V=Z.value;if(!I(V))return Z.issues.push({expected:"object",code:"invalid_type",input:V,inst:$}),Z;if(K&&W&&q?.async===!1&&q.jitless!==!0){if(!J)J=Q(Y.shape);if(Z=J(Z,q),!H)return Z;return Jr([],V,Z,q,X,$)}return z(Z,q)}});QG=W0("$ZodUnion",($,Y)=>{q1.init($,Y),T1($._zod,"optin",()=>Y.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),T1($._zod,"optout",()=>Y.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),T1($._zod,"values",()=>{if(Y.options.every((U)=>U._zod.values))return new Set(Y.options.flatMap((U)=>Array.from(U._zod.values)));return}),T1($._zod,"pattern",()=>{if(Y.options.every((U)=>U._zod.pattern)){let U=Y.options.map((Q)=>Q._zod.pattern);return new RegExp(`^(${U.map((Q)=>lK(Q.source)).join("|")})$`)}return});let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,Q)=>{if(z)return z(U,Q);let J=!1,I=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},Q);if(G instanceof Promise)I.push(G),J=!0;else{if(G.issues.length===0)return G;I.push(G)}}if(!J)return co(I,U,$,Q);return Promise.all(I).then((K)=>{return co(K,U,$,Q)})}});xE=W0("$ZodXor",($,Y)=>{QG.init($,Y),Y.inclusive=!1;let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,Q)=>{if(z)return z(U,Q);let J=!1,I=[];for(let K of Y.options){let G=K._zod.run({value:U.value,issues:[]},Q);if(G instanceof Promise)I.push(G),J=!0;else I.push(G)}if(!J)return no(I,U,$,Q);return Promise.all(I).then((K)=>{return no(K,U,$,Q)})}}),fE=W0("$ZodDiscriminatedUnion",($,Y)=>{Y.inclusive=!1,QG.init($,Y);let z=$._zod.parse;T1($._zod,"propValues",()=>{let Q={};for(let J of Y.options){let I=J._zod.propValues;if(!I||Object.keys(I).length===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(J)}"`);for(let[K,G]of Object.entries(I)){if(!Q[K])Q[K]=new Set;for(let W of G)Q[K].add(W)}}return Q});let U=uU(()=>{let Q=Y.options,J=new Map;for(let I of Q){let K=I._zod.propValues?.[Y.discriminator];if(!K||K.size===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(I)}"`);for(let G of K){if(J.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);J.set(G,I)}}return J});$._zod.parse=(Q,J)=>{let I=Q.value;if(!PY(I))return Q.issues.push({code:"invalid_type",expected:"object",input:I,inst:$}),Q;let K=U.value.get(I?.[Y.discriminator]);if(K)return K._zod.run(Q,J);if(Y.unionFallback||J.direction==="backward")return z(Q,J);return Q.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:Y.discriminator,options:Array.from(U.value.keys()),input:I,path:[Y.discriminator],inst:$}),Q}}),uE=W0("$ZodIntersection",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let Q=z.value,J=Y.left._zod.run({value:Q,issues:[]},U),I=Y.right._zod.run({value:Q,issues:[]},U);if(J instanceof Promise||I instanceof Promise)return Promise.all([J,I]).then(([G,W])=>{return po(z,G,W)});return po(z,J,I)}});IV=W0("$ZodTuple",($,Y)=>{q1.init($,Y);let z=Y.items;$._zod.parse=(U,Q)=>{let J=U.value;if(!Array.isArray(J))return U.issues.push({input:J,inst:$,expected:"tuple",code:"invalid_type"}),U;U.value=[];let I=[],K=mo(z,"optin"),G=mo(z,"optout");if(!Y.rest){if(J.length<K)return U.issues.push({code:"too_small",minimum:K,inclusive:!0,input:J,inst:$,origin:"array"}),U;if(J.length>z.length)U.issues.push({code:"too_big",maximum:z.length,inclusive:!0,input:J,inst:$,origin:"array"})}let W=Array(z.length);for(let H=0;H<z.length;H++){let X=z[H]._zod.run({value:J[H],issues:[]},Q);if(X instanceof Promise)I.push(X.then((Z)=>{W[H]=Z}));else W[H]=X}if(Y.rest){let H=z.length-1,X=J.slice(z.length);for(let Z of X){H++;let q=Y.rest._zod.run({value:Z,issues:[]},Q);if(q instanceof Promise)I.push(q.then((V)=>lo(V,U,H)));else lo(q,U,H)}}if(I.length)return Promise.all(I).then(()=>oo(W,U,z,J,G));return oo(W,U,z,J,G)}});bE=W0("$ZodRecord",($,Y)=>{q1.init($,Y),$._zod.parse=(z,U)=>{let Q=z.value;if(!I3(Q))return z.issues.push({expected:"record",code:"invalid_type",input:Q,inst:$}),z;let J=[],I=Y.keyType._zod.values;if(I){z.value={};let K=new Set;for(let W of I)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){K.add(typeof W==="number"?W.toString():W);let H=Y.keyType._zod.run({value:W,issues:[]},U);if(H instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(H.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:H.issues.map((q)=>B8(q,U,a4())),input:W,path:[W],inst:$});continue}let X=H.value,Z=Y.valueType._zod.run({value:Q[W],issues:[]},U);if(Z instanceof Promise)J.push(Z.then((q)=>{if(q.issues.length)z.issues.push(...f8(W,q.issues));z.value[X]=q.value}));else{if(Z.issues.length)z.issues.push(...f8(W,Z.issues));z.value[X]=Z.value}}let G;for(let W in Q)if(!K.has(W))G=G??[],G.push(W);if(G&&G.length>0)z.issues.push({code:"unrec
Line truncated
|
||||
|
||||
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let I of $.seen.entries()){let K=I[1];if(Y===I[0]){J(I);continue}if($.external){let W=$.external.registry.get(I[0])?.id;if(Y!==I[0]&&W){J(I);continue}}if($.metadataRegistry.get(I[0])?.id){J(I);continue}if(K.cycle){J(I);continue}if(K.count>1){if($.reused==="ref"){J(I);continue}}}}function Z3($,Y){let z=$.seen.get(Y);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(K)=>{let G=$.seen.get(K);if(G.ref===null)return;let W=G.def??G.schema,H={...W},X=G.ref;if(G.ref=null,X){U(X);let q=$.seen.get(X),V=q.schema;if(V.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(V);else Object.assign(W,V);if(Object.assign(W,H),K._zod.parent===X)for(let M in W){if(M==="$ref"||M==="allOf")continue;if(!(M in H))delete W[M]}if(V.$ref&&q.def)for(let M in W){if(M==="$ref"||M==="allOf")continue;if(M in q.def&&JSON.stringify(W[M])===JSON.stringify(q.def[M]))delete W[M]}}let Z=K._zod.parent;if(Z&&Z!==X){U(Z);let q=$.seen.get(Z);if(q?.schema.$ref){if(W.$ref=q.schema.$ref,q.def)for(let V in W){if(V==="$ref"||V==="allOf")continue;if(V in q.def&&JSON.stringify(W[V])===JSON.stringify(q.def[V]))delete W[V]}}}$.override({zodSchema:K,jsonSchema:W,path:G.path??[]})};for(let K of[...$.seen.entries()].reverse())U(K[0]);let Q={};if($.target==="draft-2020-12")Q.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")Q.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")Q.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let K=$.external.registry.get(Y)?.id;if(!K)throw Error("Schema is missing an `id` property");Q.$id=$.external.uri(K)}Object.assign(Q,z.def??z.schema);let J=$.metadataRegistry.get(Y)?.id;if(J!==void 0&&Q.id===J)delete Q.id;let I=$.external?.defs??{};for(let K of $.seen.entries()){let G=K[1];if(G.def&&G.defId){if(G.def.id===G.defId)delete G.def.id;I[G.defId]=G.def}}if($.external);else if(Object.keys(I).length>0)if($.target==="draft-2020-12")Q.$defs=I;else Q.definitions=I;try{let K=JSON.parse(JSON.stringify(Q));return Object.defineProperty(K,"~standard",{value:{...Y["~standard"],jsonSchema:{input:IQ(Y,"input",$.processors),output:IQ(Y,"output",$.processors)}},enumerable:!1,writable:!1}),K}catch(K){throw Error("Error converting schema to JSON.")}}function A8($,Y){let z=Y??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return A8(U.element,z);if(U.type==="set")return A8(U.valueType,z);if(U.type==="lazy")return A8(U.getter(),z);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return A8(U.innerType,z);if(U.type==="intersection")return A8(U.left,z)||A8(U.right,z);if(U.type==="record"||U.type==="map")return A8(U.keyType,z)||A8(U.valueType,z);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return A8(U.in,z)||A8(U.out,z)}if(U.type==="object"){for(let Q in U.shape)if(A8(U.shape[Q],z))return!0;return!1}if(U.type==="union"){for(let Q of U.options)if(A8(Q,z))return!0;return!1}if(U.type==="tuple"){for(let Q of U.items)if(A8(Q,z))return!0;if(U.rest&&A8(U.rest,z))return!0;return!1}return!1}var sR=($,Y={})=>(z)=>{let U=H3({...z,processors:Y});return I4($,U),X3(U,$),Z3(U,$)},IQ=($,Y,z={})=>(U)=>{let{libraryOptions:Q,target:J}=U??{},I=H3({...Q??{},target:J,io:Y,processors:z});return I4($,I),X3(I,$),Z3(I,$)};var VG=o(()=>{XG()});function RY($,Y){if("_idmap"in $){let U=$,Q=H3({...Y,processors:gV}),J={};for(let G of U._idmap.entries()){let[W,H]=G;I4(H,Q)}let I={},K={registry:U,uri:Y?.uri,defs:J};Q.external=K;for(let G of U._idmap.entries()){let[W,H]=G;X3(Q,H),I[W]=Z3(Q,H)}if(Object.keys(J).length>0){let G=Q.target==="draft-2020-12"?"$defs":"definitions";I.__shared={[G]:J}}return{schemas:I}}let z=H3({...Y,processors:gV});return I4($,z),X3(z,$),Z3(z,$)}var Gx0,aR=($,Y,z,U)=>{let Q=z;Q.type="string";let{minimum:J,maximum:I,format:K,patterns:G,contentEncoding:W}=$._zod.bag;if(typeof J==="number")Q.minLength=J;if(typeof I==="number")Q.maxLength=I;if(K){if(Q.format=Gx0[K]??K,Q.format==="")delete Q.format;if(K==="time")delete Q.format}if(W)Q.contentEncoding=W;if(G&&G.size>0){let H=[...G];if(H.length===1)Q.pattern=H[0].source;else if(H.length>1)Q.allOf=[...H.map((X)=>({...Y.target==="draft-07"||Y.target==="draft-04"||Y.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}},tR=($,Y,z,U)=>{let Q=z,{minimum:J,maximum:I,format:K,multipleOf:G,exclusiveMaximum:W,exclusiveMinimum:H}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))Q.type="integer";else Q.type="number";let X=typeof H==="number"&&H>=(J??Number.NEGATIVE_INFINITY),Z=typeof W==="number"&&W<=(I??Number.POSITIVE_INFINITY),q=Y.target==="draft-04"||Y.target==="openapi-3.0";if(X)if(q)Q.minimum=H,Q.exclusiveMinimum=!0;else Q.exclusiveMinimuLine truncated
|
||||
`}function cf0($){let Y=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))Y.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))Y.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))Y.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))Y.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!if0.test($)){let z=[...$].filter((U)=>!/[A-Za-z0-9._-]/.test(U)).filter((U,Q,J)=>J.indexOf(U)===Q);return Y.push(`Tool name contains invalid characters: ${z.map((U)=>`"${U}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:Y}}return{isValid:!0,warnings:Y}}function nf0($,Y){if(Y.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let z of Y)console.warn(` - ${z}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function lh($){let Y=cf0($);return nf0($,Y.warnings),Y.isValid}function pf0($){return typeof $==="object"&&$!==null&&"_zod"in $}function df0($){return typeof $==="object"&&$!==null&&!("_zod"in $)&&"_def"in $&&typeof $._def?.typeName==="string"}function mf0($){if(typeof $!=="object"||$===null)return!1;if(RQ($))return!1;let Y=Object.getPrototypeOf($);if(Y!==Object.prototype&&Y!==null)return!1;return Object.values($).every((z)=>pf0(z))}function Nw($){if($===void 0)return;if(mf0($))return z0($);if(typeof $==="object"&&$!==null&&!RQ($)&&Object.values($).some((Y)=>df0(Y)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!RQ($))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return $}var Dh,Ax0,B1,V1,Tx0,ea="2026-07-28",T3,zt,Cx0,Rx0,_x0,Jt,It,hx0,Qw,Bx1,Px1,ia,Rh,fx0,ux0,EQ,n0,J1,qw,Wt,vQ,Vw,cx0=0,nx0="private",px0,tx0,Iw,Sh,Zt,Ax1,Tx1,Qf0,Jf0,gh,Kw,WW="2026-07-28",Lt,Gf0,D$=($)=>yG.safeParse($).success,j3=($)=>kG.safeParse($).success,KW=($)=>FQ.safeParse($).success,Mw=($)=>wQ.safeParse($).success,o9=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)&&$.resultType==="input_required",ma="x-mcp-header",Wf0,Hf0,Xf0,Zf0,Hw=-32020,jx1,qf0,la=!1,Ph="draft-2020-12",Ff0,Df0,Bf0,oa,Pf0,Rf0,Mt=250,_f0,vf0,Bt,Pt,hf0,Sf0,Tt=60000,yf0,kf0,xf0,jt,nh,bf0,Ex1,Et=10485760,dh=class{_buffer;_maxBufferSize;constructor($){this._maxBufferSize=$?.maxBufferSize??Et}append($){if((this._buffer?.length??0)+$.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){while(this._buffer){let $=this._buffer.indexOf(`
|
||||
`);if($===-1)return null;let Y=this._buffer.toString("utf8",0,$).replace(/\r$/,"");this._buffer=this._buffer.subarray($+1);try{return Ct(Y)}catch(z){if(z instanceof SyntaxError)continue;throw z}}return null}clear(){this._buffer=void 0}},if0;var Dw=o(()=>{fT();uT();fa();bv();Dh=Symbol.for("mcp.sdk.errorBrands");Ax0=class $ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](Y){return CQ(this,Y)}static isInstance(Y){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return CQ(this,Y)}constructor(Y,z,U){super(z);this.code=Y,this.errorUri=U,this.name="OAuthError",Th(this,new.target)}toResponseObject(){let Y={error:this.code,error_description:this.message};if(this.errorUri)Y.error_uri=this.errorUri;return Y}static fromResponse(Y){return new $(Y.error,Y.error_description??Y.error,Y.error_uri)}},B1=function($){return $.NotConnected="NOT_CONNECTED",$.AlreadyConnected="ALREADY_CONNECTED",$.NotInitialized="NOT_INITIALIZED",$.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",$.RequestTimeout="REQUEST_TIMEOUT",$.ConnectionClosed="CONNECTION_CLOSED",$.SendFailed="SEND_FAILED",$.InvalidResult="INVALID_RESULT",$.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",$.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",$.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",$.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",$.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",$.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",$.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",$.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",$.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",$.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",$.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",$}({}),V1=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance]($){return CQ(this,$)}static isInstance($){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return CQ(this,$)}constructor($,Y,z){super(Y);this.code=$,this.data=z,this.name="SdkError",Th(this,new.target)}},Tx0=class extends V1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor($,Y,z){super($,Y,z);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};T3=[ea];zt=["task","inputRequests","requestState"];Rx0=new Set(["const","enum","default","examples"]),_x0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);Jt={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},It={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},hx0={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};Bx1=Object.keys(Jt),Px1=Object.keys(It);ia={ok:!1,reason:"not-in-era"};Rh={era:"2025-11-25",hasRequestMethod:Kt,hasNotificationMethod:Gt,validateRequest:($,Y)=>Jw(yx0($),Y),validateResult:($,Y)=>Jw(gx0($),Y),validateNotification:($,Y)=>Jw(kx0($),Y),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ia,validateInputResponse:()=>ia,samplingResultVariant:($,Y)=>{let z=Ut();return Jw($?z.CreateMessageResultWithToolsSchema:z.CreateMessageResultSchema,Y)},outboundEnvelope:($)=>{return},validateEnvelopeMeta:($)=>[],projectCallToolResult($,Y){let z=Yt($),U=z.structuredContent;if(U===void 0)return z;let Q=typeof U!=="object"||U===null||Array.isArray(U),J=Y!==void 0&&Qt(Y);if(!Q&&!J)return z;return{...z,structuredContent:{result:U}}},decodeResult($,Y){if(Bh(Y)&&"resultType"in Y){let z={...Y};return delete z.resultType,{kind:"complete",result:na(z)}}return{kind:"complete",result:na(Y)}},encodeResult($,Y){if($!=="tools/list")return Y;l
Line truncated
|
||||
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let I of $.seen.entries()){let K=I[1];if(Y===I[0]){J(I);continue}if($.external){let W=$.external.registry.get(I[0])?.id;if(Y!==I[0]&&W){J(I);continue}}if($.metadataRegistry.get(I[0])?.id){J(I);continue}if(K.cycle){J(I);continue}if(K.count>1){if($.reused==="ref"){J(I);continue}}}}function Z3($,Y){let z=$.seen.get(Y);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(K)=>{let G=$.seen.get(K);if(G.ref===null)return;let W=G.def??G.schema,H={...W},X=G.ref;if(G.ref=null,X){U(X);let q=$.seen.get(X),V=q.schema;if(V.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(V);else Object.assign(W,V);if(Object.assign(W,H),K._zod.parent===X)for(let M in W){if(M==="$ref"||M==="allOf")continue;if(!(M in H))delete W[M]}if(V.$ref&&q.def)for(let M in W){if(M==="$ref"||M==="allOf")continue;if(M in q.def&&JSON.stringify(W[M])===JSON.stringify(q.def[M]))delete W[M]}}let Z=K._zod.parent;if(Z&&Z!==X){U(Z);let q=$.seen.get(Z);if(q?.schema.$ref){if(W.$ref=q.schema.$ref,q.def)for(let V in W){if(V==="$ref"||V==="allOf")continue;if(V in q.def&&JSON.stringify(W[V])===JSON.stringify(q.def[V]))delete W[V]}}}$.override({zodSchema:K,jsonSchema:W,path:G.path??[]})};for(let K of[...$.seen.entries()].reverse())U(K[0]);let Q={};if($.target==="draft-2020-12")Q.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")Q.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")Q.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let K=$.external.registry.get(Y)?.id;if(!K)throw Error("Schema is missing an `id` property");Q.$id=$.external.uri(K)}Object.assign(Q,z.def??z.schema);let J=$.metadataRegistry.get(Y)?.id;if(J!==void 0&&Q.id===J)delete Q.id;let I=$.external?.defs??{};for(let K of $.seen.entries()){let G=K[1];if(G.def&&G.defId){if(G.def.id===G.defId)delete G.def.id;I[G.defId]=G.def}}if($.external);else if(Object.keys(I).length>0)if($.target==="draft-2020-12")Q.$defs=I;else Q.definitions=I;try{let K=JSON.parse(JSON.stringify(Q));return Object.defineProperty(K,"~standard",{value:{...Y["~standard"],jsonSchema:{input:IQ(Y,"input",$.processors),output:IQ(Y,"output",$.processors)}},enumerable:!1,writable:!1}),K}catch(K){throw Error("Error converting schema to JSON.")}}function A8($,Y){let z=Y??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return A8(U.element,z);if(U.type==="set")return A8(U.valueType,z);if(U.type==="lazy")return A8(U.getter(),z);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return A8(U.innerType,z);if(U.type==="intersection")return A8(U.left,z)||A8(U.right,z);if(U.type==="record"||U.type==="map")return A8(U.keyType,z)||A8(U.valueType,z);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return A8(U.in,z)||A8(U.out,z)}if(U.type==="object"){for(let Q in U.shape)if(A8(U.shape[Q],z))return!0;return!1}if(U.type==="union"){for(let Q of U.options)if(A8(Q,z))return!0;return!1}if(U.type==="tuple"){for(let Q of U.items)if(A8(Q,z))return!0;if(U.rest&&A8(U.rest,z))return!0;return!1}return!1}var sR=($,Y={})=>(z)=>{let U=H3({...z,processors:Y});return I4($,U),X3(U,$),Z3(U,$)},IQ=($,Y,z={})=>(U)=>{let{libraryOptions:Q,target:J}=U??{},I=H3({...Q??{},target:J,io:Y,processors:z});return I4($,I),X3(I,$),Z3(I,$)};var VG=o(()=>{XG()});function RY($,Y){if("_idmap"in $){let U=$,Q=H3({...Y,processors:yV}),J={};for(let G of U._idmap.entries()){let[W,H]=G;I4(H,Q)}let I={},K={registry:U,uri:Y?.uri,defs:J};Q.external=K;for(let G of U._idmap.entries()){let[W,H]=G;X3(Q,H),I[W]=Z3(Q,H)}if(Object.keys(J).length>0){let G=Q.target==="draft-2020-12"?"$defs":"definitions";I.__shared={[G]:J}}return{schemas:I}}let z=H3({...Y,processors:yV});return I4($,z),X3(z,$),Z3(z,$)}var Wx0,aR=($,Y,z,U)=>{let Q=z;Q.type="string";let{minimum:J,maximum:I,format:K,patterns:G,contentEncoding:W}=$._zod.bag;if(typeof J==="number")Q.minLength=J;if(typeof I==="number")Q.maxLength=I;if(K){if(Q.format=Wx0[K]??K,Q.format==="")delete Q.format;if(K==="time")delete Q.format}if(W)Q.contentEncoding=W;if(G&&G.size>0){let H=[...G];if(H.length===1)Q.pattern=H[0].source;else if(H.length>1)Q.allOf=[...H.map((X)=>({...Y.target==="draft-07"||Y.target==="draft-04"||Y.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}},tR=($,Y,z,U)=>{let Q=z,{minimum:J,maximum:I,format:K,multipleOf:G,exclusiveMaximum:W,exclusiveMinimum:H}=$._zod.bag;if(typeof K==="string"&&K.includes("int"))Q.type="integer";else Q.type="number";let X=typeof H==="number"&&H>=(J??Number.NEGATIVE_INFINITY),Z=typeof W==="number"&&W<=(I??Number.POSITIVE_INFINITY),q=Y.target==="draft-04"||Y.target==="openapi-3.0";if(X)if(q)Q.minimum=H,Q.exclusiveMinimum=!0;else Q.exclusiveMinimuLine truncated
|
||||
`}function nf0($){let Y=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))Y.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))Y.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))Y.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))Y.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!cf0.test($)){let z=[...$].filter((U)=>!/[A-Za-z0-9._-]/.test(U)).filter((U,Q,J)=>J.indexOf(U)===Q);return Y.push(`Tool name contains invalid characters: ${z.map((U)=>`"${U}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:Y}}return{isValid:!0,warnings:Y}}function pf0($,Y){if(Y.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let z of Y)console.warn(` - ${z}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function lh($){let Y=nf0($);return pf0($,Y.warnings),Y.isValid}function df0($){return typeof $==="object"&&$!==null&&"_zod"in $}function mf0($){return typeof $==="object"&&$!==null&&!("_zod"in $)&&"_def"in $&&typeof $._def?.typeName==="string"}function lf0($){if(typeof $!=="object"||$===null)return!1;if(RQ($))return!1;let Y=Object.getPrototypeOf($);if(Y!==Object.prototype&&Y!==null)return!1;return Object.values($).every((z)=>df0(z))}function Dw($){if($===void 0)return;if(lf0($))return z0($);if(typeof $==="object"&&$!==null&&!RQ($)&&Object.values($).some((Y)=>mf0(Y)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!RQ($))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return $}var Dh,Tx0,B1,V1,jx0,ea="2026-07-28",T3,zt,Rx0,_x0,vx0,Jt,It,Sx0,Jw,Ax1,Tx1,ia,Rh,ux0,bx0,EQ,n0,J1,Vw,Wt,vQ,Lw,nx0=0,px0="private",dx0,ex0,Kw,Sh,Zt,jx1,Ex1,Jf0,If0,gh,Gw,WW="2026-07-28",Lt,Wf0,D$=($)=>yG.safeParse($).success,j3=($)=>kG.safeParse($).success,KW=($)=>FQ.safeParse($).success,Ow=($)=>wQ.safeParse($).success,o9=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)&&$.resultType==="input_required",ma="x-mcp-header",Hf0,Xf0,Zf0,qf0,Xw=-32020,Cx1,Vf0,la=!1,Ph="draft-2020-12",wf0,Bf0,Pf0,oa,Af0,_f0,Mt=250,vf0,hf0,Bt,Pt,Sf0,gf0,Tt=60000,kf0,xf0,ff0,jt,nh,if0,Rx1,Et=10485760,dh=class{_buffer;_maxBufferSize;constructor($){this._maxBufferSize=$?.maxBufferSize??Et}append($){if((this._buffer?.length??0)+$.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){while(this._buffer){let $=this._buffer.indexOf(`
|
||||
`);if($===-1)return null;let Y=this._buffer.toString("utf8",0,$).replace(/\r$/,"");this._buffer=this._buffer.subarray($+1);try{return Ct(Y)}catch(z){if(z instanceof SyntaxError)continue;throw z}}return null}clear(){this._buffer=void 0}},cf0;var Bw=o(()=>{fT();uT();fa();bv();Dh=Symbol.for("mcp.sdk.errorBrands");Tx0=class $ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](Y){return CQ(this,Y)}static isInstance(Y){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return CQ(this,Y)}constructor(Y,z,U){super(z);this.code=Y,this.errorUri=U,this.name="OAuthError",Th(this,new.target)}toResponseObject(){let Y={error:this.code,error_description:this.message};if(this.errorUri)Y.error_uri=this.errorUri;return Y}static fromResponse(Y){return new $(Y.error,Y.error_description??Y.error,Y.error_uri)}},B1=function($){return $.NotConnected="NOT_CONNECTED",$.AlreadyConnected="ALREADY_CONNECTED",$.NotInitialized="NOT_INITIALIZED",$.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",$.RequestTimeout="REQUEST_TIMEOUT",$.ConnectionClosed="CONNECTION_CLOSED",$.SendFailed="SEND_FAILED",$.InvalidResult="INVALID_RESULT",$.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",$.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",$.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",$.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",$.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",$.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",$.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",$.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",$.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",$.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",$.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",$}({}),V1=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance]($){return CQ(this,$)}static isInstance($){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return CQ(this,$)}constructor($,Y,z){super(Y);this.code=$,this.data=z,this.name="SdkError",Th(this,new.target)}},jx0=class extends V1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor($,Y,z){super($,Y,z);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};T3=[ea];zt=["task","inputRequests","requestState"];_x0=new Set(["const","enum","default","examples"]),vx0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);Jt={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},It={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Sx0={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};Ax1=Object.keys(Jt),Tx1=Object.keys(It);ia={ok:!1,reason:"not-in-era"};Rh={era:"2025-11-25",hasRequestMethod:Kt,hasNotificationMethod:Gt,validateRequest:($,Y)=>Iw(kx0($),Y),validateResult:($,Y)=>Iw(yx0($),Y),validateNotification:($,Y)=>Iw(xx0($),Y),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ia,validateInputResponse:()=>ia,samplingResultVariant:($,Y)=>{let z=Ut();return Iw($?z.CreateMessageResultWithToolsSchema:z.CreateMessageResultSchema,Y)},outboundEnvelope:($)=>{return},validateEnvelopeMeta:($)=>[],projectCallToolResult($,Y){let z=Yt($),U=z.structuredContent;if(U===void 0)return z;let Q=typeof U!=="object"||U===null||Array.isArray(U),J=Y!==void 0&&Qt(Y);if(!Q&&!J)return z;return{...z,structuredContent:{result:U}}},decodeResult($,Y){if(Bh(Y)&&"resultType"in Y){let z={...Y};return delete z.resultType,{kind:"complete",result:na(z)}}return{kind:"complete",result:na(Y)}},encodeResult($,Y){if($!=="tools/list")return Y;l
Line truncated
|
||||
* content-type
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/bf0=R0(($)=>{var Y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,z=/\\([\u000b\u0020-\u00ff])/g,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;$.parse=Q;function Q(K){if(!K)throw TypeError("argument string is required");var G=typeof K==="object"?J(K):K;if(typeof G!=="string")throw TypeError("argument string is required to be a string");var W=G.indexOf(";"),H=W!==-1?G.slice(0,W).trim():G.trim();if(!U.test(H))throw TypeError("invalid media type");var X=new I(H.toLowerCase());if(W!==-1){var Z,q,V;Y.lastIndex=W;while(q=Y.exec(G)){if(q.index!==W)throw TypeError("invalid parameter format");if(W+=q[0].length,Z=q[1].toLowerCase(),V=q[2],V.charCodeAt(0)===34){if(V=V.slice(1,-1),V.indexOf("\\")!==-1)V=V.replace(z,"$1")}X.parameters[Z]=V}if(W!==G.length)throw TypeError("invalid parameter format")}return X}function J(K){var G;if(typeof K.getHeader==="function")G=K.getHeader("content-type");else if(typeof K.headers==="object")G=K.headers&&K.headers["content-type"];if(typeof G!=="string")throw TypeError("content-type header is missing from object");return G}function I(K){this.parameters=Object.create(null),this.type=K}}),Ex1=gq(bf0(),1);if0=/^[A-Za-z0-9._-]{1,128}$/});function oh($){let Y=new $({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Gb0(Y),Y}var Bw,Rt,L1,v1,U5,Aw,lf0,_t,vt,Pw,of0,Q5,rf0,sf0,ht,af0,Tw,hQ,XW,SQ,jw,tf0,St,ef0,$u0,Yu0,rh,zu0,sh,gt,Uu0,Qu0,Ju0,Iu0,Ku0,Gu0,Wu0,Hu0,ah,Xu0,Zu0,qu0,yt,kt,xt,Vu0,Lu0,Fu0,th,wu0,ft,Mu0,Ou0,Nu0,Du0,Bu0,Pu0,Au0,Tu0,ut,ju0,bt,it,ct,Eu0,eh,Cu0,nt,pt,dt,Ru0,_u0,mt,vu0,hu0,Su0,lt,gu0,yu0,ot,ku0,xu0,fu0,uu0,bu0,iu0,cu0,nu0,pu0,du0,mu0,lu0,ou0,ru0,su0,au0,tu0,eu0,$b0,Yb0,zb0,Ub0,Qb0,rt,Jb0,Ib0,Kb0,Gb0,Ew=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor($){this._userAjv=$!==void 0,this._ajv=$}get ajv(){return this._ajv??=oh(Ib0.Ajv2020)}_engineFor($){if(this._userAjv)return this.ajv;let Y=Eo($,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(Y==="2020-12")return this.ajv;if(Y==="2019-09")return this._ajv2019??=oh(Jb0.Ajv2019);return this._ajvDraft7??=oh(rt.Ajv)}getValidator($){let Y=this._engineFor($),z="$id"in $&&typeof $.$id==="string"?Y.getSchema($.$id)??Y.compile($):Y.compile($);return(U)=>{return z(U)?{valid:!0,data:U,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:Y.errorsText(z.errors)}}}},ux1;var st=o(()=>{fT();uT();Bw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.regexpCode=$.getEsmExportName=$.getProperty=$.safeStringify=$.stringify=$.strConcat=$.addCodeArg=$.str=$._=$.nil=$._Code=$.Name=$.IDENTIFIER=$._CodeOrName=void 0;var Y=class{};$._CodeOrName=Y,$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var z=class extends Y{constructor(w){super();if(!$.IDENTIFIER.test(w))throw Error("CodeGen: name must be a valid identifier");this.str=w}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};$.Name=z;var U=class extends Y{constructor(w){super();this._items=typeof w==="string"?[w]:w}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let w=this._items[0];return w===""||w==='""'}get str(){var w;return(w=this._str)!==null&&w!==void 0?w:this._str=this._items.reduce((O,D)=>`${O}${D}`,"")}get names(){var w;return(w=this._names)!==null&&w!==void 0?w:this._names=this._items.reduce((O,D)=>{if(D instanceof z)O[D.str]=(O[D.str]||0)+1;return O},{})}};$._Code=U,$.nil=new U("");function Q(w,...O){let D=[w[0]],N=0;while(N<O.length)K(D,O[N]),D.push(w[++N]);return new U(D)}$._=Q;let J=new U("+");function I(w,...O){let D=[q(w[0])],N=0;while(N<O.length)D.push(J),K(D,O[N]),D.push(J,q(w[++N]));return G(D),new U(D)}$.str=I;function K(w,O){if(O instanceof U)w.push(...O._items);else if(O instanceof z)w.push(O);else w.push(X(O))}$.addCodeArg=K;function G(w){let O=1;while(O<w.length-1){if(w[O]===J){let D=W(w[O-1],w[O+1]);if(D!==void 0){w.splice(O-1,3,D);continue}w[O++]="+"}O++}}function W(w,O){if(O==='""')return w;if(w==='""')return O;if(typeof w=="string"){if(O instanceof z||w[w.length-1]!=='"')return;if(typeof O!="string")return`${w.slice(0,-1)}${O}"`;if(O[0]==='"')return w.slice(0,-1)+O.slice(1);return}if(typeof O=="string"&&O[0]==='"'&&!(w instanceof z))return`"${w}${O.slice(1)}`}function H(w,O){return O.emptyStr()?w:w.emptyStr()?O:I`${w}${O}`}$.strConcat=H;function X(w){return typeof w=="number"||typeof w=="boolean"||w===null?w:q(Array.isArray(w)?w.join(","):w)}function Z(w){return new U(q(w))}$.stringify=Z;function q(w){return JSON.stringify(w).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}$.safeStringify=q;function V(w){return typeof w=="string"&&$.IDENTIFIER.test(w)?new U(`.${w}`):Q`[${w}]`}$.getProperty=V;function F(w){if(typeof w=="string"&&$.IDENTIFIER.test(w))return new U(`${w}`);throw Error(`CodeGen: invalid export name: ${w}, use explicit $id name mapping`)}$.getEsmExportName=F;function M(w){return new U(w.toStringLine truncated
|
||||
`:""},this._extScope=y,this._scope=new z.Scope({parent:y}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(y){return this._scope.name(y)}scopeName(y){return this._extScope.name(y)}scopeValue(y,s){let Y0=this._extScope.value(y,s);return(this._values[Y0.prefix]||(this._values[Y0.prefix]=new Set)).add(Y0),Y0}getScopeValue(y,s){return this._extScope.getValue(y,s)}scopeRefs(y){return this._extScope.scopeRefs(y,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(y,s,Y0,M0){let E0=this._scope.toName(s);if(Y0!==void 0&&M0)this._constants[E0.str]=Y0;return this._leafNode(new I(y,E0,Y0)),E0}const(y,s,Y0){return this._def(z.varKinds.const,y,s,Y0)}let(y,s,Y0){return this._def(z.varKinds.let,y,s,Y0)}var(y,s,Y0){return this._def(z.varKinds.var,y,s,Y0)}assign(y,s,Y0){return this._leafNode(new K(y,s,Y0))}add(y,s){return this._leafNode(new G(y,$.operators.ADD,s))}code(y){if(typeof y=="function")y();else if(y!==Y.nil)this._leafNode(new Z(y));return this}object(...y){let s=["{"];for(let[Y0,M0]of y){if(s.length>1)s.push(",");if(s.push(Y0),Y0!==M0||this.opts.es5)s.push(":"),(0,Y.addCodeArg)(s,M0)}return s.push("}"),new Y._Code(s)}if(y,s,Y0){if(this._blockNode(new w(y)),s&&Y0)this.code(s).else().code(Y0).endIf();else if(s)this.code(s).endIf();else if(Y0)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(y){return this._elseNode(new w(y))}else(){return this._elseNode(new M)}endIf(){return this._endBlockNode(w,M)}_for(y,s){if(this._blockNode(y),s)this.code(s).endFor();return this}for(y,s){return this._for(new D(y),s)}forRange(y,s,Y0,M0,E0=this.opts.es5?z.varKinds.var:z.varKinds.let){let G0=this._scope.toName(y);return this._for(new N(E0,G0,s,Y0),()=>M0(G0))}forOf(y,s,Y0,M0=z.varKinds.const){let E0=this._scope.toName(y);if(this.opts.es5){let G0=s instanceof Y.Name?s:this.var("_arr",s);return this.forRange("_i",0,Y._`${G0}.length`,(T0)=>{this.var(E0,Y._`${G0}[${T0}]`),Y0(E0)})}return this._for(new A("of",M0,E0,s),()=>Y0(E0))}forIn(y,s,Y0,M0=this.opts.es5?z.varKinds.var:z.varKinds.const){if(this.opts.ownProperties)return this.forOf(y,Y._`Object.keys(${s})`,Y0);let E0=this._scope.toName(y);return this._for(new A("in",M0,E0,s),()=>Y0(E0))}endFor(){return this._endBlockNode(O)}label(y){return this._leafNode(new W(y))}break(y){return this._leafNode(new H(y))}return(y){let s=new B;if(this._blockNode(s),this.code(y),s.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(B)}try(y,s,Y0){if(!s&&!Y0)throw Error('CodeGen: "try" without "catch" and "finally"');let M0=new j;if(this._blockNode(M0),this.code(y),s){let E0=this.name("e");this._currNode=M0.catch=new C(E0),s(E0)}if(Y0)this._currNode=M0.finally=new b,this.code(Y0);return this._endBlockNode(C,b)}throw(y){return this._leafNode(new X(y))}block(y,s){if(this._blockStarts.push(this._nodes.length),y)this.code(y).endBlock(s);return this}endBlock(y){let s=this._blockStarts.pop();if(s===void 0)throw Error("CodeGen: not in self-balancing block");let Y0=this._nodes.length-s;if(Y0<0||y!==void 0&&Y0!==y)throw Error(`CodeGen: wrong number of nodes: ${Y0} vs ${y} expected`);return this._nodes.length=s,this}func(y,s=Y.nil,Y0,M0){if(this._blockNode(new T(y,s,Y0)),M0)this.code(M0).endFunc();return this}endFunc(){return this._endBlockNode(T)}optimize(y=1){while(y-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(y){return this._currNode.nodes.push(y),this}_blockNode(y){this._currNode.nodes.push(y),this._nodes.push(y)}_endBlockNode(y,s){let Y0=this._currNode;if(Y0 instanceof y||s&&Y0 instanceof s)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${s?`${y.kind}/${s.kind}`:y.kind}"`)}_elseNode(y){let s=this._currNode;if(!(s instanceof w))throw Error('CodeGen: "else" without "if"');return this._currNode=s.else=y,this}get _root(){return this._nodes[0]}get _currNode(){let y=this._nodes;return y[y.length-1]}set _currNode(y){let s=this._nodes;s[s.length-1]=y}};$.CodeGen=k;function h(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)+(s[Y0]||0);return y}function i(y,s){return s instanceof Y._CodeOrName?h(y,s.names):y}function c(y,s,Y0){if(y instanceof Y.Name)return M0(y);if(!E0(y))return y;return new Y._Code(y._items.reduce((G0,T0)=>{if(T0 instanceof Y.Name)T0=M0(T0);if(T0 instanceof Y._Code)G0.push(...T0._items);else G0.push(T0);return G0},[]));function M0(G0){let T0=Y0[G0.str];if(T0===void 0||s[G0.str]!==1)return G0;return delete s[G0.str],T0}function E0(G0){return G0 instanceof Y._Code&&G0._items.some((T0)=>T0 instanceof Y.Name&&s[T0.str]===1&&Y0[T0.str]!==void 0)}}function U0(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)-(s[Y0]||0)}function x(y){return typeof y=="boolean"||typeof y=="number"||y===null?!y:Y._`!${e(y)}`}$.not=x;let d=p($.operators.AND);function t(...y){return y.reduce(d)}$.and=t;let $0=p($.operators.OR);function g(...y){return y.reduce($0)}$.or=g;function p(y){return(s,Y0)=>s===Y.nil?Y0:Y0===Y.nil?s:Y._`${e(s)} ${y} ${e(Y0)}`}function
Line truncated
|
||||
*/if0=R0(($)=>{var Y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,z=/\\([\u000b\u0020-\u00ff])/g,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;$.parse=Q;function Q(K){if(!K)throw TypeError("argument string is required");var G=typeof K==="object"?J(K):K;if(typeof G!=="string")throw TypeError("argument string is required to be a string");var W=G.indexOf(";"),H=W!==-1?G.slice(0,W).trim():G.trim();if(!U.test(H))throw TypeError("invalid media type");var X=new I(H.toLowerCase());if(W!==-1){var Z,q,V;Y.lastIndex=W;while(q=Y.exec(G)){if(q.index!==W)throw TypeError("invalid parameter format");if(W+=q[0].length,Z=q[1].toLowerCase(),V=q[2],V.charCodeAt(0)===34){if(V=V.slice(1,-1),V.indexOf("\\")!==-1)V=V.replace(z,"$1")}X.parameters[Z]=V}if(W!==G.length)throw TypeError("invalid parameter format")}return X}function J(K){var G;if(typeof K.getHeader==="function")G=K.getHeader("content-type");else if(typeof K.headers==="object")G=K.headers&&K.headers["content-type"];if(typeof G!=="string")throw TypeError("content-type header is missing from object");return G}function I(K){this.parameters=Object.create(null),this.type=K}}),Rx1=yq(if0(),1);cf0=/^[A-Za-z0-9._-]{1,128}$/});function oh($){let Y=new $({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Wb0(Y),Y}var Pw,Rt,L1,v1,U5,Tw,of0,_t,vt,Aw,rf0,Q5,sf0,af0,ht,tf0,jw,hQ,XW,SQ,Ew,ef0,St,$u0,Yu0,zu0,rh,Uu0,sh,gt,Qu0,Ju0,Iu0,Ku0,Gu0,Wu0,Hu0,Xu0,ah,Zu0,qu0,Vu0,yt,kt,xt,Lu0,Fu0,wu0,th,Mu0,ft,Ou0,Nu0,Du0,Bu0,Pu0,Au0,Tu0,ju0,ut,Eu0,bt,it,ct,Cu0,eh,Ru0,nt,pt,dt,_u0,vu0,mt,hu0,Su0,gu0,lt,yu0,ku0,ot,xu0,fu0,uu0,bu0,iu0,cu0,nu0,pu0,du0,mu0,lu0,ou0,ru0,su0,au0,tu0,eu0,$b0,Yb0,zb0,Ub0,Qb0,Jb0,rt,Ib0,Kb0,Gb0,Wb0,Cw=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor($){this._userAjv=$!==void 0,this._ajv=$}get ajv(){return this._ajv??=oh(Kb0.Ajv2020)}_engineFor($){if(this._userAjv)return this.ajv;let Y=Eo($,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(Y==="2020-12")return this.ajv;if(Y==="2019-09")return this._ajv2019??=oh(Ib0.Ajv2019);return this._ajvDraft7??=oh(rt.Ajv)}getValidator($){let Y=this._engineFor($),z="$id"in $&&typeof $.$id==="string"?Y.getSchema($.$id)??Y.compile($):Y.compile($);return(U)=>{return z(U)?{valid:!0,data:U,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:Y.errorsText(z.errors)}}}},ix1;var st=o(()=>{fT();uT();Pw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.regexpCode=$.getEsmExportName=$.getProperty=$.safeStringify=$.stringify=$.strConcat=$.addCodeArg=$.str=$._=$.nil=$._Code=$.Name=$.IDENTIFIER=$._CodeOrName=void 0;var Y=class{};$._CodeOrName=Y,$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var z=class extends Y{constructor(w){super();if(!$.IDENTIFIER.test(w))throw Error("CodeGen: name must be a valid identifier");this.str=w}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};$.Name=z;var U=class extends Y{constructor(w){super();this._items=typeof w==="string"?[w]:w}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let w=this._items[0];return w===""||w==='""'}get str(){var w;return(w=this._str)!==null&&w!==void 0?w:this._str=this._items.reduce((O,D)=>`${O}${D}`,"")}get names(){var w;return(w=this._names)!==null&&w!==void 0?w:this._names=this._items.reduce((O,D)=>{if(D instanceof z)O[D.str]=(O[D.str]||0)+1;return O},{})}};$._Code=U,$.nil=new U("");function Q(w,...O){let D=[w[0]],N=0;while(N<O.length)K(D,O[N]),D.push(w[++N]);return new U(D)}$._=Q;let J=new U("+");function I(w,...O){let D=[q(w[0])],N=0;while(N<O.length)D.push(J),K(D,O[N]),D.push(J,q(w[++N]));return G(D),new U(D)}$.str=I;function K(w,O){if(O instanceof U)w.push(...O._items);else if(O instanceof z)w.push(O);else w.push(X(O))}$.addCodeArg=K;function G(w){let O=1;while(O<w.length-1){if(w[O]===J){let D=W(w[O-1],w[O+1]);if(D!==void 0){w.splice(O-1,3,D);continue}w[O++]="+"}O++}}function W(w,O){if(O==='""')return w;if(w==='""')return O;if(typeof w=="string"){if(O instanceof z||w[w.length-1]!=='"')return;if(typeof O!="string")return`${w.slice(0,-1)}${O}"`;if(O[0]==='"')return w.slice(0,-1)+O.slice(1);return}if(typeof O=="string"&&O[0]==='"'&&!(w instanceof z))return`"${w}${O.slice(1)}`}function H(w,O){return O.emptyStr()?w:w.emptyStr()?O:I`${w}${O}`}$.strConcat=H;function X(w){return typeof w=="number"||typeof w=="boolean"||w===null?w:q(Array.isArray(w)?w.join(","):w)}function Z(w){return new U(q(w))}$.stringify=Z;function q(w){return JSON.stringify(w).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}$.safeStringify=q;function V(w){return typeof w=="string"&&$.IDENTIFIER.test(w)?new U(`.${w}`):Q`[${w}]`}$.getProperty=V;function F(w){if(typeof w=="string"&&$.IDENTIFIER.test(w))return new U(`${w}`);throw Error(`CodeGen: invalid export name: ${w}, use explicit $id name mapping`)}$.getEsmExportName=F;function M(w){return new U(w.toStringLine truncated
|
||||
`:""},this._extScope=y,this._scope=new z.Scope({parent:y}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(y){return this._scope.name(y)}scopeName(y){return this._extScope.name(y)}scopeValue(y,s){let Y0=this._extScope.value(y,s);return(this._values[Y0.prefix]||(this._values[Y0.prefix]=new Set)).add(Y0),Y0}getScopeValue(y,s){return this._extScope.getValue(y,s)}scopeRefs(y){return this._extScope.scopeRefs(y,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(y,s,Y0,M0){let E0=this._scope.toName(s);if(Y0!==void 0&&M0)this._constants[E0.str]=Y0;return this._leafNode(new I(y,E0,Y0)),E0}const(y,s,Y0){return this._def(z.varKinds.const,y,s,Y0)}let(y,s,Y0){return this._def(z.varKinds.let,y,s,Y0)}var(y,s,Y0){return this._def(z.varKinds.var,y,s,Y0)}assign(y,s,Y0){return this._leafNode(new K(y,s,Y0))}add(y,s){return this._leafNode(new G(y,$.operators.ADD,s))}code(y){if(typeof y=="function")y();else if(y!==Y.nil)this._leafNode(new Z(y));return this}object(...y){let s=["{"];for(let[Y0,M0]of y){if(s.length>1)s.push(",");if(s.push(Y0),Y0!==M0||this.opts.es5)s.push(":"),(0,Y.addCodeArg)(s,M0)}return s.push("}"),new Y._Code(s)}if(y,s,Y0){if(this._blockNode(new w(y)),s&&Y0)this.code(s).else().code(Y0).endIf();else if(s)this.code(s).endIf();else if(Y0)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(y){return this._elseNode(new w(y))}else(){return this._elseNode(new M)}endIf(){return this._endBlockNode(w,M)}_for(y,s){if(this._blockNode(y),s)this.code(s).endFor();return this}for(y,s){return this._for(new D(y),s)}forRange(y,s,Y0,M0,E0=this.opts.es5?z.varKinds.var:z.varKinds.let){let G0=this._scope.toName(y);return this._for(new N(E0,G0,s,Y0),()=>M0(G0))}forOf(y,s,Y0,M0=z.varKinds.const){let E0=this._scope.toName(y);if(this.opts.es5){let G0=s instanceof Y.Name?s:this.var("_arr",s);return this.forRange("_i",0,Y._`${G0}.length`,(T0)=>{this.var(E0,Y._`${G0}[${T0}]`),Y0(E0)})}return this._for(new A("of",M0,E0,s),()=>Y0(E0))}forIn(y,s,Y0,M0=this.opts.es5?z.varKinds.var:z.varKinds.const){if(this.opts.ownProperties)return this.forOf(y,Y._`Object.keys(${s})`,Y0);let E0=this._scope.toName(y);return this._for(new A("in",M0,E0,s),()=>Y0(E0))}endFor(){return this._endBlockNode(O)}label(y){return this._leafNode(new W(y))}break(y){return this._leafNode(new H(y))}return(y){let s=new B;if(this._blockNode(s),this.code(y),s.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(B)}try(y,s,Y0){if(!s&&!Y0)throw Error('CodeGen: "try" without "catch" and "finally"');let M0=new j;if(this._blockNode(M0),this.code(y),s){let E0=this.name("e");this._currNode=M0.catch=new C(E0),s(E0)}if(Y0)this._currNode=M0.finally=new b,this.code(Y0);return this._endBlockNode(C,b)}throw(y){return this._leafNode(new X(y))}block(y,s){if(this._blockStarts.push(this._nodes.length),y)this.code(y).endBlock(s);return this}endBlock(y){let s=this._blockStarts.pop();if(s===void 0)throw Error("CodeGen: not in self-balancing block");let Y0=this._nodes.length-s;if(Y0<0||y!==void 0&&Y0!==y)throw Error(`CodeGen: wrong number of nodes: ${Y0} vs ${y} expected`);return this._nodes.length=s,this}func(y,s=Y.nil,Y0,M0){if(this._blockNode(new T(y,s,Y0)),M0)this.code(M0).endFunc();return this}endFunc(){return this._endBlockNode(T)}optimize(y=1){while(y-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(y){return this._currNode.nodes.push(y),this}_blockNode(y){this._currNode.nodes.push(y),this._nodes.push(y)}_endBlockNode(y,s){let Y0=this._currNode;if(Y0 instanceof y||s&&Y0 instanceof s)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${s?`${y.kind}/${s.kind}`:y.kind}"`)}_elseNode(y){let s=this._currNode;if(!(s instanceof w))throw Error('CodeGen: "else" without "if"');return this._currNode=s.else=y,this}get _root(){return this._nodes[0]}get _currNode(){let y=this._nodes;return y[y.length-1]}set _currNode(y){let s=this._nodes;s[s.length-1]=y}};$.CodeGen=k;function h(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)+(s[Y0]||0);return y}function i(y,s){return s instanceof Y._CodeOrName?h(y,s.names):y}function c(y,s,Y0){if(y instanceof Y.Name)return M0(y);if(!E0(y))return y;return new Y._Code(y._items.reduce((G0,T0)=>{if(T0 instanceof Y.Name)T0=M0(T0);if(T0 instanceof Y._Code)G0.push(...T0._items);else G0.push(T0);return G0},[]));function M0(G0){let T0=Y0[G0.str];if(T0===void 0||s[G0.str]!==1)return G0;return delete s[G0.str],T0}function E0(G0){return G0 instanceof Y._Code&&G0._items.some((T0)=>T0 instanceof Y.Name&&s[T0.str]===1&&Y0[T0.str]!==void 0)}}function U0(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)-(s[Y0]||0)}function x(y){return typeof y=="boolean"||typeof y=="number"||y===null?!y:Y._`!${e(y)}`}$.not=x;let d=p($.operators.AND);function t(...y){return y.reduce(d)}$.and=t;let $0=p($.operators.OR);function g(...y){return y.reduce($0)}$.or=g;function p(y){return(s,Y0)=>s===Y.nil?Y0:Y0===Y.nil?s:Y._`${e(s)} ${y} ${e(Y0)}`}function
Line truncated
|
||||
|| (${C} == "string" && ${B} && ${B} == +${B})`).assign(b,Q._`+${B}`);return;case"integer":T.elseIf(Q._`${C} === "boolean" || ${B} === null
|
||||
|| (${C} === "string" && ${B} && ${B} == +${B} && !(${B} % 1))`).assign(b,Q._`+${B}`);return;case"boolean":T.elseIf(Q._`${B} === "false" || ${B} === 0 || ${B} === null`).assign(b,!1).elseIf(Q._`${B} === "true" || ${B} === 1`).assign(b,!0);return;case"null":T.elseIf(Q._`${B} === "" || ${B} === 0 || ${B} === false`),T.assign(b,null);return;case"array":T.elseIf(Q._`${C} === "string" || ${C} === "number"
|
||||
|| ${C} === "boolean" || ${B} === null`).assign(b,Q._`[${B}]`)}}}function q({gen:D,parentData:N,parentDataProperty:A},T){D.if(Q._`${N} !== undefined`,()=>D.assign(Q._`${N}[${A}]`,T))}function V(D,N,A,T=I.Correct){let B=T===I.Correct?Q.operators.EQ:Q.operators.NEQ,j;switch(D){case"null":return Q._`${N} ${B} null`;case"array":j=Q._`Array.isArray(${N})`;break;case"object":j=Q._`${N} && typeof ${N} == "object" && !Array.isArray(${N})`;break;case"integer":j=C(Q._`!(${N} % 1) && !isNaN(${N})`);break;case"number":j=C();break;default:return Q._`typeof ${N} ${B} ${D}`}return T===I.Correct?j:(0,Q.not)(j);function C(b=Q.nil){return(0,Q.and)(Q._`typeof ${N} == "number"`,b,A?Q._`isFinite(${N})`:Q.nil)}}$.checkDataType=V;function F(D,N,A,T){if(D.length===1)return V(D[0],N,A,T);let B,j=(0,J.toHash)(D);if(j.array&&j.object){let C=Q._`typeof ${N} != "object"`;B=j.null?C:Q._`!${N} || ${C}`,delete j.null,delete j.array,delete j.object}else B=Q.nil;if(j.number)delete j.integer;for(let C in j)B=(0,Q.and)(B,V(C,N,A,T));return B}$.checkDataTypes=F;let M={message:({schema:D})=>`must be ${D}`,params:({schema:D,schemaValue:N})=>typeof D=="string"?Q._`{type: ${D}}`:Q._`{type: ${N}}`};function w(D){let N=O(D);(0,U.reportError)(N,M)}$.reportTypeError=w;function O(D){let{gen:N,data:A,schema:T}=D,B=(0,J.schemaRefOrVal)(D,T,"type");return{gen:N,keyword:"type",data:A,schema:T.type,schemaCode:B,schemaValue:B,parentSchema:T,params:{},it:D}}}),of0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=L1(),z=v1();function U(J,I){let{properties:K,items:G}=J.schema;if(I==="object"&&K)for(let W in K)Q(J,W,K[W].default);else if(I==="array"&&Array.isArray(G))G.forEach((W,H)=>Q(J,H,W.default))}$.assignDefaults=U;function Q(J,I,K){let{gen:G,compositeRule:W,data:H,opts:X}=J;if(K===void 0)return;let Z=Y._`${H}${(0,Y.getProperty)(I)}`;if(W){(0,z.checkStrictMode)(J,`default is ignored for: ${Z}`);return}let q=Y._`${Z} === undefined`;if(X.useDefaults==="empty")q=Y._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,Y._`${Z} = ${(0,Y.stringify)(K)}`)}}),Q5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=L1(),z=v1(),U=U5(),Q=v1();function J(D,N){let{gen:A,data:T,it:B}=D;A.if(X(A,T,N,B.opts.ownProperties),()=>{D.setParams({missingProperty:Y._`${N}`},!0),D.error()})}$.checkReportMissingProp=J;function I({gen:D,data:N,it:{opts:A}},T,B){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(D,N,j,A.ownProperties),Y._`${B} = ${j}`)))}$.checkMissingProp=I;function K(D,N){D.setParams({missingProperty:N},!0),D.error()}$.reportMissingProp=K;function G(D){return D.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function W(D,N,A){return Y._`${G(D)}.call(${N}, ${A})`}$.isOwnProperty=W;function H(D,N,A,T){let B=Y._`${N}${(0,Y.getProperty)(A)} !== undefined`;return T?Y._`${B} && ${W(D,N,A)}`:B}$.propertyInData=H;function X(D,N,A,T){let B=Y._`${N}${(0,Y.getProperty)(A)} === undefined`;return T?(0,Y.or)(B,(0,Y.not)(W(D,N,A))):B}$.noPropertyInData=X;function Z(D){return D?Object.keys(D).filter((N)=>N!=="__proto__"):[]}$.allSchemaProperties=Z;function q(D,N){return Z(N).filter((A)=>!(0,z.alwaysValidSchema)(D,N[A]))}$.schemaProperties=q;function V({schemaCode:D,data:N,it:{gen:A,topSchemaRef:T,schemaPath:B,errorPath:j},it:C},b,k,h){let i=h?Y._`${D}, ${N}, ${T}${B}`:N,c=[[U.default.instancePath,(0,Y.strConcat)(U.default.instancePath,j)],[U.default.parentData,C.parentData],[U.default.parentDataProperty,C.parentDataProperty],[U.default.rootData,U.default.rootData]];if(C.opts.dynamicRef)c.push([U.default.dynamicAnchors,U.default.dynamicAnchors]);let U0=Y._`${i}, ${A.object(...c)}`;return k!==Y.nil?Y._`${b}.call(${k}, ${U0})`:Y._`${b}(${U0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function M({gen:D,it:{opts:N}},A){let T=N.unicodeRegExp?"u":"",{regExp:B}=N.code,j=B(A,T);return D.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${B.code==="new RegExp"?F:(0,Q.useFunc)(D,B)}(${A}, ${T})`})}$.usePattern=M;function w(D){let{gen:N,data:A,keyword:T,it:B}=D,j=N.name("valid");if(B.allErrors){let b=N.let("valid",!0);return C(()=>N.assign(b,!1)),b}return N.var(j,!0),C(()=>N.break()),j;function C(b){let k=N.const("len",Y._`${A}.length`);N.forRange("i",0,k,(h)=>{D.subschema({keyword:T,dataProp:h,dataPropType:z.Type.Num},j),N.if((0,Y.not)(j),b)})}}$.validateArray=w;function O(D){let{gen:N,schema:A,keyword:T,it:B}=D;if(!Array.isArray(A))throw Error("ajv implementation error");if(A.some((b)=>(0,z.alwaysValidSchema)(B,b))&&!B.opts.unevaluated)return;let j=N.let("valid",!1),C=N.name("_valid");N.block(()=>A.forEach((b,k)=>{let h=D.subschema({keyword:T,schemaProp:k,compositeRule:!0},C);if(N.assign(j,Y._`${j} || ${C}`),!D.mergeValidEvaluated(h,C)
Line truncated
|
||||
|| ${C} === "boolean" || ${B} === null`).assign(b,Q._`[${B}]`)}}}function q({gen:D,parentData:N,parentDataProperty:A},T){D.if(Q._`${N} !== undefined`,()=>D.assign(Q._`${N}[${A}]`,T))}function V(D,N,A,T=I.Correct){let B=T===I.Correct?Q.operators.EQ:Q.operators.NEQ,j;switch(D){case"null":return Q._`${N} ${B} null`;case"array":j=Q._`Array.isArray(${N})`;break;case"object":j=Q._`${N} && typeof ${N} == "object" && !Array.isArray(${N})`;break;case"integer":j=C(Q._`!(${N} % 1) && !isNaN(${N})`);break;case"number":j=C();break;default:return Q._`typeof ${N} ${B} ${D}`}return T===I.Correct?j:(0,Q.not)(j);function C(b=Q.nil){return(0,Q.and)(Q._`typeof ${N} == "number"`,b,A?Q._`isFinite(${N})`:Q.nil)}}$.checkDataType=V;function F(D,N,A,T){if(D.length===1)return V(D[0],N,A,T);let B,j=(0,J.toHash)(D);if(j.array&&j.object){let C=Q._`typeof ${N} != "object"`;B=j.null?C:Q._`!${N} || ${C}`,delete j.null,delete j.array,delete j.object}else B=Q.nil;if(j.number)delete j.integer;for(let C in j)B=(0,Q.and)(B,V(C,N,A,T));return B}$.checkDataTypes=F;let M={message:({schema:D})=>`must be ${D}`,params:({schema:D,schemaValue:N})=>typeof D=="string"?Q._`{type: ${D}}`:Q._`{type: ${N}}`};function w(D){let N=O(D);(0,U.reportError)(N,M)}$.reportTypeError=w;function O(D){let{gen:N,data:A,schema:T}=D,B=(0,J.schemaRefOrVal)(D,T,"type");return{gen:N,keyword:"type",data:A,schema:T.type,schemaCode:B,schemaValue:B,parentSchema:T,params:{},it:D}}}),rf0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=L1(),z=v1();function U(J,I){let{properties:K,items:G}=J.schema;if(I==="object"&&K)for(let W in K)Q(J,W,K[W].default);else if(I==="array"&&Array.isArray(G))G.forEach((W,H)=>Q(J,H,W.default))}$.assignDefaults=U;function Q(J,I,K){let{gen:G,compositeRule:W,data:H,opts:X}=J;if(K===void 0)return;let Z=Y._`${H}${(0,Y.getProperty)(I)}`;if(W){(0,z.checkStrictMode)(J,`default is ignored for: ${Z}`);return}let q=Y._`${Z} === undefined`;if(X.useDefaults==="empty")q=Y._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,Y._`${Z} = ${(0,Y.stringify)(K)}`)}}),Q5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=L1(),z=v1(),U=U5(),Q=v1();function J(D,N){let{gen:A,data:T,it:B}=D;A.if(X(A,T,N,B.opts.ownProperties),()=>{D.setParams({missingProperty:Y._`${N}`},!0),D.error()})}$.checkReportMissingProp=J;function I({gen:D,data:N,it:{opts:A}},T,B){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(D,N,j,A.ownProperties),Y._`${B} = ${j}`)))}$.checkMissingProp=I;function K(D,N){D.setParams({missingProperty:N},!0),D.error()}$.reportMissingProp=K;function G(D){return D.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function W(D,N,A){return Y._`${G(D)}.call(${N}, ${A})`}$.isOwnProperty=W;function H(D,N,A,T){let B=Y._`${N}${(0,Y.getProperty)(A)} !== undefined`;return T?Y._`${B} && ${W(D,N,A)}`:B}$.propertyInData=H;function X(D,N,A,T){let B=Y._`${N}${(0,Y.getProperty)(A)} === undefined`;return T?(0,Y.or)(B,(0,Y.not)(W(D,N,A))):B}$.noPropertyInData=X;function Z(D){return D?Object.keys(D).filter((N)=>N!=="__proto__"):[]}$.allSchemaProperties=Z;function q(D,N){return Z(N).filter((A)=>!(0,z.alwaysValidSchema)(D,N[A]))}$.schemaProperties=q;function V({schemaCode:D,data:N,it:{gen:A,topSchemaRef:T,schemaPath:B,errorPath:j},it:C},b,k,h){let i=h?Y._`${D}, ${N}, ${T}${B}`:N,c=[[U.default.instancePath,(0,Y.strConcat)(U.default.instancePath,j)],[U.default.parentData,C.parentData],[U.default.parentDataProperty,C.parentDataProperty],[U.default.rootData,U.default.rootData]];if(C.opts.dynamicRef)c.push([U.default.dynamicAnchors,U.default.dynamicAnchors]);let U0=Y._`${i}, ${A.object(...c)}`;return k!==Y.nil?Y._`${b}.call(${k}, ${U0})`:Y._`${b}(${U0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function M({gen:D,it:{opts:N}},A){let T=N.unicodeRegExp?"u":"",{regExp:B}=N.code,j=B(A,T);return D.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${B.code==="new RegExp"?F:(0,Q.useFunc)(D,B)}(${A}, ${T})`})}$.usePattern=M;function w(D){let{gen:N,data:A,keyword:T,it:B}=D,j=N.name("valid");if(B.allErrors){let b=N.let("valid",!0);return C(()=>N.assign(b,!1)),b}return N.var(j,!0),C(()=>N.break()),j;function C(b){let k=N.const("len",Y._`${A}.length`);N.forRange("i",0,k,(h)=>{D.subschema({keyword:T,dataProp:h,dataPropType:z.Type.Num},j),N.if((0,Y.not)(j),b)})}}$.validateArray=w;function O(D){let{gen:N,schema:A,keyword:T,it:B}=D;if(!Array.isArray(A))throw Error("ajv implementation error");if(A.some((b)=>(0,z.alwaysValidSchema)(B,b))&&!B.opts.unevaluated)return;let j=N.let("valid",!1),C=N.name("_valid");N.block(()=>A.forEach((b,k)=>{let h=D.subschema({keyword:T,schemaProp:k,compositeRule:!0},C);if(N.assign(j,Y._`${j} || ${C}`),!D.mergeValidEvaluated(h,C)
Line truncated
|
||||
missingProperty: ${X},
|
||||
depsCount: ${W},
|
||||
deps: ${H}}`};let Q={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[W,H]=J(G);I(G,W),K(G,H)}};function J({schema:G}){let W={},H={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?W:H;Z[X]=G[X]}return[W,H]}function I(G,W=G.schema){let{gen:H,data:X,it:Z}=G;if(Object.keys(W).length===0)return;let q=H.let("missing");for(let V in W){let F=W[V];if(F.length===0)continue;let M=(0,U.propertyInData)(H,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)H.if(M,()=>{for(let w of F)(0,U.checkReportMissingProp)(G,w)});else H.if(Y._`${M} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.reportMissingProp)(G,q),H.else()}}$.validatePropertyDeps=I;function K(G,W=G.schema){let{gen:H,data:X,keyword:Z,it:q}=G,V=H.name("valid");for(let F in W){if((0,z.alwaysValidSchema)(q,W[F]))continue;H.if((0,U.propertyInData)(H,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>H.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=Q}),wu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:Q})=>Y._`{propertyName: ${Q.propertyName}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q;if((0,z.alwaysValidSchema)(G,I))return;let W=J.name("valid");J.forIn("key",K,(H)=>{Q.setParams({propertyName:H}),Q.subschema({keyword:"propertyNames",data:H,dataTypes:["string"],propertyName:H,compositeRule:!0},W),J.if((0,Y.not)(W),()=>{if(Q.error(!0),!G.allErrors)J.break()})}),Q.ok(W)}};$.default=U}),ft=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),z=L1(),U=U5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:I})=>z._`{additionalProperty: ${I.additionalProperty}}`},code(I){let{gen:K,schema:G,parentSchema:W,data:H,errsCount:X,it:Z}=I;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,Q.alwaysValidSchema)(Z,G))return;let F=(0,Y.allSchemaProperties)(W.properties),M=(0,Y.allSchemaProperties)(W.patternProperties);w(),I.ok(z._`${X} === ${U.default.errors}`);function w(){K.forIn("key",H,(T)=>{if(!F.length&&!M.length)N(T);else K.if(O(T),()=>N(T))})}function O(T){let B;if(F.length>8){let j=(0,Q.schemaRefOrVal)(Z,W.properties,"properties");B=(0,Y.isOwnProperty)(K,j,T)}else if(F.length)B=(0,z.or)(...F.map((j)=>z._`${T} === ${j}`));else B=z.nil;if(M.length)B=(0,z.or)(B,...M.map((j)=>z._`${(0,Y.usePattern)(I,j)}.test(${T})`));return(0,z.not)(B)}function D(T){K.code(z._`delete ${H}[${T}]`)}function N(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){D(T);return}if(G===!1){if(I.setParams({additionalProperty:T}),I.error(),!q)K.break();return}if(typeof G=="object"&&!(0,Q.alwaysValidSchema)(Z,G)){let B=K.name("valid");if(V.removeAdditional==="failing")A(T,B,!1),K.if((0,z.not)(B),()=>{I.reset(),D(T)});else if(A(T,B),!q)K.if((0,z.not)(B),()=>K.break())}}function A(T,B,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:Q.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});I.subschema(C,B)}}};$.default=J}),Mu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=hQ(),z=Q5(),U=v1(),Q=ft(),J={keyword:"properties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,parentSchema:W,data:H,it:X}=I;if(X.opts.removeAdditional==="all"&&W.additionalProperties===void 0)Q.default.code(new Y.KeywordCxt(X,Q.default,"additionalProperties"));let Z=(0,z.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(K,(0,U.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,U.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))M(w);else{if(K.if((0,z.propertyInData)(K,H,w,X.opts.ownProperties)),M(w),!X.allErrors)K.else().var(V,!0);K.endIf()}I.it.definedProperties.add(w),I.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){I.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=J}),Ou0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),z=L1(),U=v1(),Q=v1(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,data:W,parentSchema:H,it:X}=I,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((A)=>(0,U.alwaysValidSchema)(X,G[A]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&H.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,Q.evaluatedPropsToName)(K,X.props);let{props:w}=X;O();function O(){for(let A of q){if(F)D(A);if(X.allErrors)
Line truncated
|
||||
\x00`,k+=O4(j,2),k+=K.magic,k+=O4(M,2),k+=O4(w,2),k+=O4(B.crc32,4),k+=O4(B.compressedSize,4),k+=O4(B.uncompressedSize,4),k+=O4(W.length,2),k+=O4(O.length,2);var h=HO.LOCAL_FILE_HEADER+k+W+O,i=HO.CENTRAL_FILE_HEADER+O4(b,2)+k+O4(Z.length,2)+"\x00\x00\x00\x00"+O4(C,4)+O4(U,4)+W+O+Z;return{fileRecord:h,dirRecord:i}},Bo0=function($,Y,z,U,Q){var J="",I=VJ.transformTo("string",Q(U));return J=HO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+O4($,2)+O4($,2)+O4(Y,4)+O4(z,4)+O4(I.length,2)+I,J},Po0=function($){var Y="";return Y=HO.DATA_DESCRIPTOR+O4($.crc32,4)+O4($.compressedSize,4)+O4($.uncompressedSize,4),Y};function X5($,Y,z,U){LJ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=z,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}VJ.inherits(X5,LJ);X5.prototype.push=function($){var Y=$.meta.percent||0,z=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,LJ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(Y+100*(z-U-1))/z:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var z=L50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,z=L50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),Y)this.push({data:Po0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y<this.dirRecords.length;Y++)this.push({data:this.dirRecords[Y],meta:{percent:100}});var z=this.bytesWritten-$,U=Bo0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};X5.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};X5.prototype.registerPrevious=function($){this._sources.push($);var Y=this;return $.on("data",function(z){Y.processChunk(z)}),$.on("end",function(){if(Y.closedSource(Y.previous.streamInfo),Y._sources.length)Y.prepareNextSource();else Y.end()}),$.on("error",function(z){Y.error(z)}),this};X5.prototype.resume=function(){if(!LJ.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};X5.prototype.error=function($){var Y=this._sources;if(!LJ.prototype.error.call(this,$))return!1;for(var z=0;z<Y.length;z++)try{Y[z].error($)}catch(U){}return!0};X5.prototype.lock=function(){LJ.prototype.lock.call(this);var $=this._sources;for(var Y=0;Y<$.length;Y++)$[Y].lock()};F50.exports=X5});var M50=E((Eo0)=>{var Ao0=vy(),To0=w50(),jo0=function($,Y){var z=$||Y,U=Ao0[z];if(!U)throw Error(z+" is not a valid compression method !");return U};Eo0.generateWorker=function($,Y,z){var U=new To0(Y.streamFiles,z,Y.platform,Y.encodeFileName),Q=0;try{$.forEach(function(J,I){Q++;var K=jo0(I.options.compression,Y.compression),G=I.options.compressionOptions||Y.compressionOptions||{},W=I.dir,H=I.date;I._compressWorker(K,G).withStreamInfo("file",{name:J,dir:W,date:H,comment:I.comment||"",unixPermissions:I.unixPermissions,dosPermissions:I.dosPermissions}).pipe(U)}),U.entriesCount=Q}catch(J){U.error(J)}return U}});var N50=E((Rn1,O50)=>{var Ro0=c4(),XO=I$();function qH($,Y){XO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}Ro0.inherits(qH,XO);qH.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(z){Y.push({data:z,meta:{percent:0}})}).on("error",function(z){if(Y.isPaused)this.generatedError=z;else Y.error(z)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};qH.prototype.pause=function(){if(!XO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};qH.prototype.resume=function(){if(!XO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};O50.exports=qH});var _50=E((_n1,R50)=>{var _o0=QJ(),VH=c4(),A50=I$(),vo0=xg(),T50=fg(),D50=mM(),ho0=B80(),So0=M50(),B50=mW(),go0=N50(),j50=function($,Y,z){var U=VH.getTypeOf(Y),Q,J=VH.extend(z||{},T50);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermission
Line truncated
|
||||
`)}openNode($,Y){let z=this.tos,U=this._xml;if(z&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),Vk(U,Y),this.leaf=!0,this.open=!0}addAttribute($,Y){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(Y!==void 0)N70(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Vk(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(O70.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),Y=this._xml;if(this.leaf)Y.push("/>");else Y.push("</"),Y.push($),Y.push(">");this.open=!1,this.leaf=!1}leafNode($,Y,z){if(this.openNode($,Y),z!==void 0)this.writeText(z);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}Lk.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};D70.exports=Lk});var Fk=E((Ta0)=>{var B70=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Aa0($){if(typeof $==="string")return $;if(B70)return B70.decode($);return $.toString()}Ta0.bufferToString=Aa0});var E70=E((A70)=>{Object.defineProperty(A70,"__esModule",{value:!0});A70.CHAR=`
|
||||
deps: ${H}}`};let Q={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[W,H]=J(G);I(G,W),K(G,H)}};function J({schema:G}){let W={},H={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?W:H;Z[X]=G[X]}return[W,H]}function I(G,W=G.schema){let{gen:H,data:X,it:Z}=G;if(Object.keys(W).length===0)return;let q=H.let("missing");for(let V in W){let F=W[V];if(F.length===0)continue;let M=(0,U.propertyInData)(H,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)H.if(M,()=>{for(let w of F)(0,U.checkReportMissingProp)(G,w)});else H.if(Y._`${M} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.reportMissingProp)(G,q),H.else()}}$.validatePropertyDeps=I;function K(G,W=G.schema){let{gen:H,data:X,keyword:Z,it:q}=G,V=H.name("valid");for(let F in W){if((0,z.alwaysValidSchema)(q,W[F]))continue;H.if((0,U.propertyInData)(H,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>H.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=K,$.default=Q}),Mu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=L1(),z=v1(),U={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:Q})=>Y._`{propertyName: ${Q.propertyName}}`},code(Q){let{gen:J,schema:I,data:K,it:G}=Q;if((0,z.alwaysValidSchema)(G,I))return;let W=J.name("valid");J.forIn("key",K,(H)=>{Q.setParams({propertyName:H}),Q.subschema({keyword:"propertyNames",data:H,dataTypes:["string"],propertyName:H,compositeRule:!0},W),J.if((0,Y.not)(W),()=>{if(Q.error(!0),!G.allErrors)J.break()})}),Q.ok(W)}};$.default=U}),ft=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),z=L1(),U=U5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:I})=>z._`{additionalProperty: ${I.additionalProperty}}`},code(I){let{gen:K,schema:G,parentSchema:W,data:H,errsCount:X,it:Z}=I;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,Q.alwaysValidSchema)(Z,G))return;let F=(0,Y.allSchemaProperties)(W.properties),M=(0,Y.allSchemaProperties)(W.patternProperties);w(),I.ok(z._`${X} === ${U.default.errors}`);function w(){K.forIn("key",H,(T)=>{if(!F.length&&!M.length)N(T);else K.if(O(T),()=>N(T))})}function O(T){let B;if(F.length>8){let j=(0,Q.schemaRefOrVal)(Z,W.properties,"properties");B=(0,Y.isOwnProperty)(K,j,T)}else if(F.length)B=(0,z.or)(...F.map((j)=>z._`${T} === ${j}`));else B=z.nil;if(M.length)B=(0,z.or)(B,...M.map((j)=>z._`${(0,Y.usePattern)(I,j)}.test(${T})`));return(0,z.not)(B)}function D(T){K.code(z._`delete ${H}[${T}]`)}function N(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){D(T);return}if(G===!1){if(I.setParams({additionalProperty:T}),I.error(),!q)K.break();return}if(typeof G=="object"&&!(0,Q.alwaysValidSchema)(Z,G)){let B=K.name("valid");if(V.removeAdditional==="failing")A(T,B,!1),K.if((0,z.not)(B),()=>{I.reset(),D(T)});else if(A(T,B),!q)K.if((0,z.not)(B),()=>K.break())}}function A(T,B,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:Q.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});I.subschema(C,B)}}};$.default=J}),Ou0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=hQ(),z=Q5(),U=v1(),Q=ft(),J={keyword:"properties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,parentSchema:W,data:H,it:X}=I;if(X.opts.removeAdditional==="all"&&W.additionalProperties===void 0)Q.default.code(new Y.KeywordCxt(X,Q.default,"additionalProperties"));let Z=(0,z.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(K,(0,U.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,U.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=K.name("valid");for(let w of q){if(F(w))M(w);else{if(K.if((0,z.propertyInData)(K,H,w,X.opts.ownProperties)),M(w),!X.allErrors)K.else().var(V,!0);K.endIf()}I.it.definedProperties.add(w),I.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){I.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=J}),Nu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),z=L1(),U=v1(),Q=v1(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(I){let{gen:K,schema:G,data:W,parentSchema:H,it:X}=I,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((A)=>(0,U.alwaysValidSchema)(X,G[A]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&H.properties,M=K.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,Q.evaluatedPropsToName)(K,X.props);let{props:w}=X;O();function O(){for(let A of q){if(F)D(A);if(X.allErrors)
Line truncated
|
||||
\x00`,k+=O4(j,2),k+=K.magic,k+=O4(M,2),k+=O4(w,2),k+=O4(B.crc32,4),k+=O4(B.compressedSize,4),k+=O4(B.uncompressedSize,4),k+=O4(W.length,2),k+=O4(O.length,2);var h=XO.LOCAL_FILE_HEADER+k+W+O,i=XO.CENTRAL_FILE_HEADER+O4(b,2)+k+O4(Z.length,2)+"\x00\x00\x00\x00"+O4(C,4)+O4(U,4)+W+O+Z;return{fileRecord:h,dirRecord:i}},Po0=function($,Y,z,U,Q){var J="",I=VJ.transformTo("string",Q(U));return J=XO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+O4($,2)+O4($,2)+O4(Y,4)+O4(z,4)+O4(I.length,2)+I,J},Ao0=function($){var Y="";return Y=XO.DATA_DESCRIPTOR+O4($.crc32,4)+O4($.compressedSize,4)+O4($.uncompressedSize,4),Y};function X5($,Y,z,U){LJ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=z,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}VJ.inherits(X5,LJ);X5.prototype.push=function($){var Y=$.meta.percent||0,z=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,LJ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(Y+100*(z-U-1))/z:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var z=L50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,z=L50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),Y)this.push({data:Ao0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y<this.dirRecords.length;Y++)this.push({data:this.dirRecords[Y],meta:{percent:100}});var z=this.bytesWritten-$,U=Po0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};X5.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};X5.prototype.registerPrevious=function($){this._sources.push($);var Y=this;return $.on("data",function(z){Y.processChunk(z)}),$.on("end",function(){if(Y.closedSource(Y.previous.streamInfo),Y._sources.length)Y.prepareNextSource();else Y.end()}),$.on("error",function(z){Y.error(z)}),this};X5.prototype.resume=function(){if(!LJ.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};X5.prototype.error=function($){var Y=this._sources;if(!LJ.prototype.error.call(this,$))return!1;for(var z=0;z<Y.length;z++)try{Y[z].error($)}catch(U){}return!0};X5.prototype.lock=function(){LJ.prototype.lock.call(this);var $=this._sources;for(var Y=0;Y<$.length;Y++)$[Y].lock()};F50.exports=X5});var M50=E((Co0)=>{var To0=vy(),jo0=w50(),Eo0=function($,Y){var z=$||Y,U=To0[z];if(!U)throw Error(z+" is not a valid compression method !");return U};Co0.generateWorker=function($,Y,z){var U=new jo0(Y.streamFiles,z,Y.platform,Y.encodeFileName),Q=0;try{$.forEach(function(J,I){Q++;var K=Eo0(I.options.compression,Y.compression),G=I.options.compressionOptions||Y.compressionOptions||{},W=I.dir,H=I.date;I._compressWorker(K,G).withStreamInfo("file",{name:J,dir:W,date:H,comment:I.comment||"",unixPermissions:I.unixPermissions,dosPermissions:I.dosPermissions}).pipe(U)}),U.entriesCount=Q}catch(J){U.error(J)}return U}});var N50=E((vn1,O50)=>{var _o0=c4(),ZO=I$();function qH($,Y){ZO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}_o0.inherits(qH,ZO);qH.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(z){Y.push({data:z,meta:{percent:0}})}).on("error",function(z){if(Y.isPaused)this.generatedError=z;else Y.error(z)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};qH.prototype.pause=function(){if(!ZO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};qH.prototype.resume=function(){if(!ZO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};O50.exports=qH});var _50=E((hn1,R50)=>{var vo0=QJ(),VH=c4(),A50=I$(),ho0=xg(),T50=fg(),D50=lM(),So0=B80(),go0=M50(),B50=mW(),yo0=N50(),j50=function($,Y,z){var U=VH.getTypeOf(Y),Q,J=VH.extend(z||{},T50);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermission
Line truncated
|
||||
`)}openNode($,Y){let z=this.tos,U=this._xml;if(z&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),Vk(U,Y),this.leaf=!0,this.open=!0}addAttribute($,Y){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(Y!==void 0)N70(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Vk(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(O70.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),Y=this._xml;if(this.leaf)Y.push("/>");else Y.push("</"),Y.push($),Y.push(">");this.open=!1,this.leaf=!1}leafNode($,Y,z){if(this.openNode($,Y),z!==void 0)this.writeText(z);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}Lk.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};D70.exports=Lk});var Fk=E((ja0)=>{var B70=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Ta0($){if(typeof $==="string")return $;if(B70)return B70.decode($);return $.toString()}ja0.bufferToString=Ta0});var E70=E((A70)=>{Object.defineProperty(A70,"__esModule",{value:!0});A70.CHAR=`
|
||||
\r --�\uD800\uDC00-\uDBFF\uDFFF`;A70.S=` \r
|
||||
`;A70.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";A70.NAME_CHAR="-"+A70.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";A70.CHAR_RE=new RegExp("^["+A70.CHAR+"]$","u");A70.S_RE=new RegExp("^["+A70.S+"]+$","u");A70.NAME_START_CHAR_RE=new RegExp("^["+A70.NAME_START_CHAR+"]$","u");A70.NAME_CHAR_RE=new RegExp("^["+A70.NAME_CHAR+"]$","u");A70.NAME_RE=new RegExp("^["+A70.NAME_START_CHAR+"]["+A70.NAME_CHAR+"]*$","u");A70.NMTOKEN_RE=new RegExp("^["+A70.NAME_CHAR+"]+$","u");var wk=9,Mk=10,Ok=13,Nk=32;A70.S_LIST=[Nk,Mk,Ok,wk];function Ea0($){return $>=Nk&&$<=55295||$===Mk||$===Ok||$===wk||$>=57344&&$<=65533||$>=65536&&$<=1114111}A70.isChar=Ea0;function Ca0($){return $===Nk||$===Mk||$===Ok||$===wk}A70.isS=Ca0;function P70($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}A70.isNameStartChar=P70;function Ra0($){return P70($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}A70.isNameChar=Ra0});var x70=E((S70)=>{Object.defineProperty(S70,"__esModule",{value:!0});S70.CHAR="\x01--�\uD800\uDC00-\uDBFF\uDFFF";S70.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F--";S70.S=` \r
|
||||
`;S70.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";S70.NAME_CHAR="-"+S70.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";S70.CHAR_RE=new RegExp("^["+S70.CHAR+"]$","u");S70.RESTRICTED_CHAR_RE=new RegExp("^["+S70.RESTRICTED_CHAR+"]$","u");S70.S_RE=new RegExp("^["+S70.S+"]+$","u");S70.NAME_START_CHAR_RE=new RegExp("^["+S70.NAME_START_CHAR+"]$","u");S70.NAME_CHAR_RE=new RegExp("^["+S70.NAME_CHAR+"]$","u");S70.NAME_RE=new RegExp("^["+S70.NAME_START_CHAR+"]["+S70.NAME_CHAR+"]*$","u");S70.NMTOKEN_RE=new RegExp("^["+S70.NAME_CHAR+"]+$","u");var C70=9,R70=10,_70=13,v70=32;S70.S_LIST=[v70,R70,_70,C70];function ia0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}S70.isChar=ia0;function ca0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}S70.isRestrictedChar=ca0;function na0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}S70.isCharAndNotRestricted=na0;function pa0($){return $===v70||$===R70||$===_70||$===C70}S70.isS=pa0;function h70($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}S70.isNameStartChar=h70;function da0($){return h70($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}S70.isNameChar=da0});var b70=E((u70)=>{Object.defineProperty(u70,"__esModule",{value:!0});u70.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";u70.NC_NAME_CHAR="-"+u70.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";u70.NC_NAME_START_CHAR_RE=new RegExp("^["+u70.NC_NAME_START_CHAR+"]$","u");u70.NC_NAME_CHAR_RE=new RegExp("^["+u70.NC_NAME_CHAR+"]$","u");u70.NC_NAME_RE=new RegExp("^["+u70.NC_NAME_START_CHAR+"]["+u70.NC_NAME_CHAR+"]*$","u");function f70($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}u70.isNCNameStartChar=f70;function It0($){return f70($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}u70.isNCNameChar=It0});var G30=E((K30)=>{Object.defineProperty(K30,"__esModule",{value:!0});var EJ=E70(),Zt0=x70(),gk=b70(),p8=EJ.isS,qt0=EJ.isChar,EH=EJ.isNameStartChar,i70=EJ.isNameChar,Y30=EJ.S_LIST,Vt0=EJ.NAME_RE,Lt0=Zt0.isChar,Ft0=gk.isNCNameStartChar,wt0=gk.isNCNameChar,Mt0=gk.NC_NAME_RE,bO="http://www.w3.org/XML/1998/namespace",jJ="http://www.w3.org/2000/xmlns/",Ot0={__proto__:null,xml:bO,xmlns:jJ},Nt0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},k4=-1,Q9=-2,c70=0,Dt0=1,Bk=2,Bt0=3,PJ=4,Pt0=5,At0=6,Tt0=7,Pk=8,jt0=9,Et0=10,Ct0=11,Rt0=12,C8=13,yO=14,Ak=15,_t0=16,Tk=17,vt0=18,ht0=19,jk=20,St0=21,gt0=22,yt0=23,n70=24,Ek=25,kO=26,p70=27,kt0=28,xt0=29,d70=30,ft0=31,ut0=32,Iz=33,bt0=34,Ck=35,CH=36,Rk=37,it0=38,m70=39,l70=40,ct0=41,o70=42,nt0=43,pt0=44,_k=9,q5=10,vk=13,r70=32,s70=33,z30=34,RH=38,U30=39,xO=45,fO=47,dt0=59,r3=60,AJ=61,A6=62,l6=63,Q30=91,TJ=93,a70=133,t70=8232,uO=($)=>$===z30||$===U30,J30=[z30,U30],mt0=[...J30,Q30,A6],lt0=[...J30,r3,TJ],ot0=[AJ,l6,...Y30],rt0=[...Y30,A6,RH,r3];function Sk($,Y,z){switch(Y){case"xml":if(z!==bO)$.fail(`xml prefix must be bound to ${bO}.`);break;case"xmlns":if(z!==jJ)$.fail(`xmlns prefix must be bound to ${jJ}.`);break;default:}switch(z){case jJ:$.fail(Y===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${jJ}.`);break;case bO:switch(Y){case"xml":break;case"":$.fail(`the default namespace may not be set to ${z}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function st0($,Y){for(let z of Object.keys(Y))Sk($,z,Y[z])}var at0=($)=>Mt0.test($),tt0=($)=>Vt0.test($),Kz=0,e70=1,hk=2;K30.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var $30={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class I30{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let Y=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,Y){this.nameStartCheck=Ft0,this.nameCheck=wt0,this.isName=at0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Ot0);let z=this.opt.additionalNamesp
Line truncated
|
||||
`;A70.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";A70.NAME_CHAR="-"+A70.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";A70.CHAR_RE=new RegExp("^["+A70.CHAR+"]$","u");A70.S_RE=new RegExp("^["+A70.S+"]+$","u");A70.NAME_START_CHAR_RE=new RegExp("^["+A70.NAME_START_CHAR+"]$","u");A70.NAME_CHAR_RE=new RegExp("^["+A70.NAME_CHAR+"]$","u");A70.NAME_RE=new RegExp("^["+A70.NAME_START_CHAR+"]["+A70.NAME_CHAR+"]*$","u");A70.NMTOKEN_RE=new RegExp("^["+A70.NAME_CHAR+"]+$","u");var wk=9,Mk=10,Ok=13,Nk=32;A70.S_LIST=[Nk,Mk,Ok,wk];function Ca0($){return $>=Nk&&$<=55295||$===Mk||$===Ok||$===wk||$>=57344&&$<=65533||$>=65536&&$<=1114111}A70.isChar=Ca0;function Ra0($){return $===Nk||$===Mk||$===Ok||$===wk}A70.isS=Ra0;function P70($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}A70.isNameStartChar=P70;function _a0($){return P70($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}A70.isNameChar=_a0});var x70=E((S70)=>{Object.defineProperty(S70,"__esModule",{value:!0});S70.CHAR="\x01--�\uD800\uDC00-\uDBFF\uDFFF";S70.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F--";S70.S=` \r
|
||||
`;S70.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";S70.NAME_CHAR="-"+S70.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";S70.CHAR_RE=new RegExp("^["+S70.CHAR+"]$","u");S70.RESTRICTED_CHAR_RE=new RegExp("^["+S70.RESTRICTED_CHAR+"]$","u");S70.S_RE=new RegExp("^["+S70.S+"]+$","u");S70.NAME_START_CHAR_RE=new RegExp("^["+S70.NAME_START_CHAR+"]$","u");S70.NAME_CHAR_RE=new RegExp("^["+S70.NAME_CHAR+"]$","u");S70.NAME_RE=new RegExp("^["+S70.NAME_START_CHAR+"]["+S70.NAME_CHAR+"]*$","u");S70.NMTOKEN_RE=new RegExp("^["+S70.NAME_CHAR+"]+$","u");var C70=9,R70=10,_70=13,v70=32;S70.S_LIST=[v70,R70,_70,C70];function ca0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}S70.isChar=ca0;function na0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}S70.isRestrictedChar=na0;function pa0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}S70.isCharAndNotRestricted=pa0;function da0($){return $===v70||$===R70||$===_70||$===C70}S70.isS=da0;function h70($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}S70.isNameStartChar=h70;function ma0($){return h70($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}S70.isNameChar=ma0});var b70=E((u70)=>{Object.defineProperty(u70,"__esModule",{value:!0});u70.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";u70.NC_NAME_CHAR="-"+u70.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";u70.NC_NAME_START_CHAR_RE=new RegExp("^["+u70.NC_NAME_START_CHAR+"]$","u");u70.NC_NAME_CHAR_RE=new RegExp("^["+u70.NC_NAME_CHAR+"]$","u");u70.NC_NAME_RE=new RegExp("^["+u70.NC_NAME_START_CHAR+"]["+u70.NC_NAME_CHAR+"]*$","u");function f70($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}u70.isNCNameStartChar=f70;function Kt0($){return f70($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}u70.isNCNameChar=Kt0});var G30=E((K30)=>{Object.defineProperty(K30,"__esModule",{value:!0});var EJ=E70(),qt0=x70(),gk=b70(),p8=EJ.isS,Vt0=EJ.isChar,EH=EJ.isNameStartChar,i70=EJ.isNameChar,Y30=EJ.S_LIST,Lt0=EJ.NAME_RE,Ft0=qt0.isChar,wt0=gk.isNCNameStartChar,Mt0=gk.isNCNameChar,Ot0=gk.NC_NAME_RE,iO="http://www.w3.org/XML/1998/namespace",jJ="http://www.w3.org/2000/xmlns/",Nt0={__proto__:null,xml:iO,xmlns:jJ},Dt0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},k4=-1,Q9=-2,c70=0,Bt0=1,Bk=2,Pt0=3,PJ=4,At0=5,Tt0=6,jt0=7,Pk=8,Et0=9,Ct0=10,Rt0=11,_t0=12,C8=13,kO=14,Ak=15,vt0=16,Tk=17,ht0=18,St0=19,jk=20,gt0=21,yt0=22,kt0=23,n70=24,Ek=25,xO=26,p70=27,xt0=28,ft0=29,d70=30,ut0=31,bt0=32,Iz=33,it0=34,Ck=35,CH=36,Rk=37,ct0=38,m70=39,l70=40,nt0=41,o70=42,pt0=43,dt0=44,_k=9,q5=10,vk=13,r70=32,s70=33,z30=34,RH=38,U30=39,fO=45,uO=47,mt0=59,r3=60,AJ=61,A6=62,l6=63,Q30=91,TJ=93,a70=133,t70=8232,bO=($)=>$===z30||$===U30,J30=[z30,U30],lt0=[...J30,Q30,A6],ot0=[...J30,r3,TJ],rt0=[AJ,l6,...Y30],st0=[...Y30,A6,RH,r3];function Sk($,Y,z){switch(Y){case"xml":if(z!==iO)$.fail(`xml prefix must be bound to ${iO}.`);break;case"xmlns":if(z!==jJ)$.fail(`xmlns prefix must be bound to ${jJ}.`);break;default:}switch(z){case jJ:$.fail(Y===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${jJ}.`);break;case iO:switch(Y){case"xml":break;case"":$.fail(`the default namespace may not be set to ${z}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function at0($,Y){for(let z of Object.keys(Y))Sk($,z,Y[z])}var tt0=($)=>Ot0.test($),et0=($)=>Lt0.test($),Kz=0,e70=1,hk=2;K30.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var $30={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class I30{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let Y=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,Y){this.nameStartCheck=wt0,this.nameCheck=Mt0,this.isName=tt0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Nt0);let z=this.opt.additionalNamesp
Line truncated
|
||||
`,Y=this.i}}captureToChar($){let{i:Y}=this,{chunk:z}=this;while(!0){let U=this.getCode();switch(U){case Q9:this.text+=`${z.slice(Y,this.prevI)}
|
||||
`,Y=this.i,U=q5;break;case k4:return this.text+=z.slice(Y),!1;default:}if(U===$)return this.text+=z.slice(Y,this.prevI),!0}}captureNameChars(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCode();if(z===k4)return this.name+=$.slice(Y),k4;if(!i70(z))return this.name+=$.slice(Y,this.prevI),z===Q9?q5:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===k4||!p8($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=qt0,this.getCode=this.getCode10;else this.isChar=Lt0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Dt0}sBeginWhitespace(){let $=this.i,Y=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(Y){case r3:if(this.state=Ak,this.text.length!==0)throw Error("no-empty text at start");break;case k4:break;default:this.unget(),this.state=C8,this.xmlDeclPossible=!1}}sDoctype(){var $;let Y=this.captureTo(mt0);switch(Y){case A6:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8,this.doctype=!0;break}case k4:break;default:if(this.text+=String.fromCodePoint(Y),Y===Q30)this.state=PJ;else if(uO(Y))this.state=Bt0,this.q=Y}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Bk}sDTD(){let $=this.captureTo(lt0);if($===k4)return;if(this.text+=String.fromCodePoint($),$===TJ)this.state=Bk;else if($===r3)this.state=At0;else if(uO($))this.state=Pt0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=PJ,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case s70:this.state=Tt0,this.openWakaBang="";break;case l6:this.state=Ct0;break;default:this.state=PJ}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),Y=this.openWakaBang+=$;if(this.text+=$,Y!=="-")this.state=Y==="--"?Pk:PJ,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(xO))this.text+="-",this.state=jt0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===xO?Et0:Pk}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===A6)this.state=PJ;else this.fail("malformed comment."),this.state=Pk}sDTDPI(){if(this.captureToChar(l6))this.text+="?",this.state=Rt0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===A6)this.state=PJ}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:Y}=this;$:while(!0)switch(this.getCode()){case Q9:this.entity+=`${Y.slice($,this.prevI)}
|
||||
`,$=this.i;break;case dt0:{let{entityReturnState:z}=this,U=this.entity+Y.slice($,this.prevI);this.state=z;let Q;if(U==="")this.fail("empty entity name."),Q="&;";else Q=this.parseEntity(U),this.entity="";if(z!==C8||this.textHandler!==void 0)this.text+=Q;break $}case k4:this.entity+=Y.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(EH($))this.state=bt0,this.unget(),this.xmlDeclPossible=!1;else switch($){case fO:this.state=nt0,this.xmlDeclPossible=!1;break;case s70:this.state=_t0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case l6:this.state=yt0;break;default:this.fail("disallowed character in tag name"),this.state=C8,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=jk,this.openWakaBang="";break;case"--":this.state=Tk,this.openWakaBang="";break;case"DOCTYPE":if(this.state=Bk,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(xO))this.state=vt0}sCommentEnding(){var $;let Y=this.getCodeNorm();if(Y===xO)this.state=ht0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(Y)}`,this.state=Tk}sCommentEnded(){let $=this.getCodeNorm();if($!==A6)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=Tk;else this.state=C8}sCData(){if(this.captureToChar(TJ))this.state=St0}sCDataEnding(){let $=this.getCodeNorm();if($===TJ)this.state=gt0;else this.text+=`]${String.fromCodePoint($)}`,this.state=jk}sCDataEnding2(){var $;let Y=this.getCodeNorm();switch(Y){case A6:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8;break}case TJ:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(Y)}`,this.state=jk}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=n70;else if($===l6||p8($))this.fail("processing instruction without a target."),this.state=$===l6?kO:Ek;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=n70}sPIRest(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCodeNorm();if(z===k4){this.piTarget+=$.slice(Y);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(Y,this.prevI);let U=z===l6;if(U||p8(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?Iz:p70}else this.state=U?kO:Ek;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===l6)this.state=kO;else if(!p8($))this.text=String.fromCodePoint($)}else if(this.captureToChar(l6))this.state=kO}sPIEnding(){var $;let Y=this.getCodeNorm();if(Y===A6){let{piTarget:z}=this;if(z.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:z,body:this.text}),this.piTarget=this.text="",this.state=C8}else if(Y===l6)this.text+="?";else this.text+=`?${String.fromCodePoint(Y)}`,this.state=Ek;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===l6){this.state=Iz;return}if($!==k4)this.state=kt0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(ot0);if($===l6){this.state=Iz,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p8($)||$===AJ))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===AJ?d70:xt0}sXMLDeclEq(){let $=this.getCodeNorm();if($===l6){this.state=Iz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if($!==AJ)this.fail("value required.");this.state=d70}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===l6){this.state=Iz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if(!uO($))this.fail("value must be quoted."),this.q=r70;else this.q=$;this.state=ft0}sXMLDeclValue(){let $=this.captureTo([this.q,l6]);if($===l6){this.state=Iz,this.text="",this.fail("XML declaration is incomplete.");return}if($===k4)return;let Y=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=Y;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver
Line truncated
|
||||
`;$=this.i,Y=Kz;break;case k4:if(U!==void 0)this.text+=z.slice($);break $;default:Y=Kz}this.forbiddenState=Y}handleTextOutsideRoot(){let{i:$}=this,{chunk:Y,textHandler:z}=this,U=!1;$:while(!0){let Q=this.getCode();switch(Q){case r3:{if(this.state=Ak,z!==void 0){let{text:J}=this,I=Y.slice($,this.prevI);if(J.length!==0)z(J+I),this.text="";else if(I.length!==0)z(I)}break $}case RH:if(this.state=yO,this.entityReturnState=C8,z!==void 0)this.text+=Y.slice($,this.prevI);U=!0;break $;case Q9:if(z!==void 0)this.text+=`${Y.slice($,this.prevI)}
|
||||
`;$=this.i;break;case k4:if(z!==void 0)this.text+=Y.slice($);break $;default:if(!p8(Q))U=!0}}if(!U)return;if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0}pushAttribNS($,Y){var z;let{prefix:U,local:Q}=this.qname($),J={name:$,prefix:U,local:Q,value:Y};if(this.attribList.push(J),(z=this.attributeHandler)===null||z===void 0||z.call(this,J),U==="xmlns"){let I=Y.trim();if(this.currentXMLVersion==="1.0"&&I==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[Q]=I,Sk(this,Q,I)}else if($==="xmlns"){let I=Y.trim();this.topNS[""]=I,Sk(this,"",I)}}pushAttribPlain($,Y){var z;let U={name:$,value:Y};this.attribList.push(U),(z=this.attributeHandler)===null||z===void 0||z.call(this,U)}end(){var $,Y;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let Q=z.pop();this.fail(`unclosed tag: ${Q.name}`)}if(this.state!==c70&&this.state!==C8)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(Y=this.endHandler)===null||Y===void 0||Y.call(this),this._init(),this}resolve($){var Y,z;let U=this.topNS[$];if(U!==void 0)return U;let{tags:Q}=this;for(let J=Q.length-1;J>=0;J--)if(U=Q[J].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(z=(Y=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(Y,$)}qname($){let Y=$.indexOf(":");if(Y===-1)return{prefix:"",local:$};let z=$.slice(Y+1),U=$.slice(0,Y);if(U===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:z}}processAttribsNS(){var $;let{attribList:Y}=this,z=this.tag;{let{prefix:J,local:I}=this.qname(z.name);z.prefix=J,z.local=I;let K=z.uri=($=this.resolve(J))!==null&&$!==void 0?$:"";if(J!==""){if(J==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(K==="")this.fail(`unbound namespace prefix: ${JSON.stringify(J)}.`),z.uri=J}}if(Y.length===0)return;let{attributes:U}=z,Q=new Set;for(let J of Y){let{name:I,prefix:K,local:G}=J,W,H;if(K==="")W=I==="xmlns"?jJ:"",H=I;else{if(W=this.resolve(K),W===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(K)}.`),W=K;H=`{${W}}${G}`}if(Q.has(H))this.fail(`duplicate attribute: ${H}.`);Q.add(H),J.uri=W,U[I]=J}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,Y=this.tag.attributes;for(let{name:z,value:U}of $){if(Y[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);Y[z]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:Y}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),Y.push(z),this.state=C8,this.name=""}openSelfClosingTag(){var $,Y,z;this.processAttribs();let{tags:U}=this,Q=this.tag;if(Q.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,Q),(Y=this.closeTagHandler)===null||Y===void 0||Y.call(this,Q),(this.tag=(z=U[U.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=C8,this.name=""}closeTag(){let{tags:$,name:Y}=this;if(this.state=C8,this.name="",Y===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,U=$.length;while(U-- >0){let Q=this.tag=$.pop();if(this.topNS=Q.ns,z===null||z===void 0||z(Q),Q.name===Y)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${Y}.`),this.text+=`</${Y}>`}parseEntity($){if($[0]!=="#"){let z=this.ENTITIES[$];if(z!==void 0)return z;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let Y=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))Y=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))Y=parseInt($.slice(1),10);if(!this.isChar(Y))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(Y)}}K30.SaxesParser=I30});var _H=E((qp1,W30)=>{var{SaxesParser:Ye0}=G30(),{PassThrough:ze0}=E8(),{bufferToString:Ue0}=Fk();W30.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new ze0);let Y=new Ye0,z;Y.on("error",(Q)=>{z=Q});let U=[];Y.on("opentag",(Q)=>U.push({eventType:"opentag",value:Q})),Y.on("text",(Q)=>U.push({eventType:"text",value:Q})),Y.on("closetag",(Q)=>U.push({eventType:"closetag",value:Q}));for await(let Q of $){if(Y.write(Ue0(Q)),z)throw z;yield U,U=[]}}});var g0=E((Vp1,H30)=>{var Qe0=_H(),Je0=m6();class CJ{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,Y){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof CJ)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let Y of $)for(let{eventType:z,value:U}of Y)if(z==="opentag")this.parseOpen(U);else if(z==="text")this.parseText(U);else if(z==="closetag"){if(!this.parseClose(U.name))return thLine truncated
|
||||
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
|
||||
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((Y=$.writeHeaders)!==null&&Y!==void 0?Y:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}bJ0.FormatterOptions=uJ0});var ON=E((um1,dJ0)=>{var L$1="[object AsyncFunction]",F$1="[object Function]",w$1="[object GeneratorFunction]",M$1="[object Null]",O$1="[object Proxy]",N$1="[object Undefined]",D$1=typeof global=="object"&&global&&global.Object===Object&&global,B$1=typeof self=="object"&&self&&self.Object===Object&&self,P$1=D$1||B$1||Function("return this")(),nJ0=Object.prototype,A$1=nJ0.hasOwnProperty,pJ0=nJ0.toString,cJ0=P$1.Symbol,Vz=cJ0?cJ0.toStringTag:void 0;function T$1($){if($==null)return $===void 0?N$1:M$1;return Vz&&Vz in Object($)?j$1($):E$1($)}function j$1($){var Y=A$1.call($,Vz),z=$[Vz];try{$[Vz]=void 0;var U=!0}catch(J){}var Q=pJ0.call($);if(U)if(Y)$[Vz]=z;else delete $[Vz];return Q}function E$1($){return pJ0.call($)}function C$1($){if(!R$1($))return!1;var Y=T$1($);return Y==F$1||Y==w$1||Y==L$1||Y==O$1}function R$1($){var Y=typeof $;return $!=null&&(Y=="object"||Y=="function")}dJ0.exports=C$1});var jI0=E((NN,fJ)=>{var _$1=200,Uf="__lodash_hash_undefined__",CN=1,UI0=2,QI0=9007199254740991,DN="[object Arguments]",sx="[object Array]",v$1="[object AsyncFunction]",JI0="[object Boolean]",II0="[object Date]",KI0="[object Error]",GI0="[object Function]",h$1="[object GeneratorFunction]",BN="[object Map]",WI0="[object Number]",S$1="[object Null]",xJ="[object Object]",mJ0="[object Promise]",g$1="[object Proxy]",HI0="[object RegExp]",PN="[object Set]",XI0="[object String]",y$1="[object Symbol]",k$1="[object Undefined]",ax="[object WeakMap]",ZI0="[object ArrayBuffer]",AN="[object DataView]",x$1="[object Float32Array]",f$1="[object Float64Array]",u$1="[object Int8Array]",b$1="[object Int16Array]",i$1="[object Int32Array]",c$1="[object Uint8Array]",n$1="[object Uint8ClampedArray]",p$1="[object Uint16Array]",d$1="[object Uint32Array]",m$1=/[\\^$.*+?()[\]{}|]/g,l$1=/^\[object .+?Constructor\]$/,o$1=/^(?:0|[1-9]\d*)$/,A4={};A4[x$1]=A4[f$1]=A4[u$1]=A4[b$1]=A4[i$1]=A4[c$1]=A4[n$1]=A4[p$1]=A4[d$1]=!0;A4[DN]=A4[sx]=A4[ZI0]=A4[JI0]=A4[AN]=A4[II0]=A4[KI0]=A4[GI0]=A4[BN]=A4[WI0]=A4[xJ]=A4[HI0]=A4[PN]=A4[XI0]=A4[ax]=!1;var qI0=typeof global=="object"&&global&&global.Object===Object&&global,r$1=typeof self=="object"&&self&&self.Object===Object&&self,X7=qI0||r$1||Function("return this")(),VI0=typeof NN=="object"&&NN&&!NN.nodeType&&NN,lJ0=VI0&&typeof fJ=="object"&&fJ&&!fJ.nodeType&&fJ,LI0=lJ0&&lJ0.exports===VI0,lx=LI0&&qI0.process,oJ0=function(){try{return lx&&lx.binding&&lx.binding("util")}catch($){}}(),rJ0=oJ0&&oJ0.isTypedArray;function s$1($,Y){var z=-1,U=$==null?0:$.length,Q=0,J=[];while(++z<U){var I=$[z];if(Y(I,z,$))J[Q++]=I}return J}function a$1($,Y){var z=-1,U=Y.length,Q=$.length;while(++z<U)$[Q+z]=Y[z];return $}function t$1($,Y){var z=-1,U=$==null?0:$.length;while(++z<U)if(Y($[z],z,$))return!0;return!1}function e$1($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}function $51($){return function(Y){return $(Y)}}function Y51($,Y){return $.has(Y)}function z51($,Y){return $==null?void 0:$[Y]}function U51($){var Y=-1,z=Array($.size);return $.forEach(function(U,Q){z[++Y]=[Q,U]}),z}function Q51($,Y){return function(z){return $(Y(z))}}function J51($){var Y=-1,z=Array($.size);return $.forEach(function(U){z[++Y]=U}),z}var I51=Array.prototype,K51=Function.prototype,RN=Object.prototype,ox=X7["__core-js_shared__"],FI0=K51.toString,I9=RN.hasOwnProperty,sJ0=function(){var $=/[^.]+$/.exec(ox&&ox.keys&&ox.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),wI0=RN.toString,G51=RegExp("^"+FI0.call(I9).replace(m$1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),aJ0=LI0?X7.Buffer:void 0,TN=X7.Symbol,tJ0=X7.Uint8Array,MI0=RN.propertyIsEnumerable,W51=I51.splice,Lz=TN?TN.toStringTag:void 0,eJ0=Object.getOwnPropertySymbols,H51=aJ0?aJ0.isBuffer:void 0,X51=Q51(Object.keys,Object),tx=uJ(X7,"DataView"),xH=uJ(X7,"Map"),ex=uJ(X7,"Promise"),$f=uJ(X7,"Set"),Yf=uJ(X7,"WeakMap"),fH=uJ(Object,"create"),Z51=Mz(tx),q51=Mz(xH),V51=Mz(ex),L51=Mz($f),F51=Mz(Yf),$I0=TN?TN.prototype:void 0,rx=$I0?$I0.valueOf:void 0;function Fz($){var Y=-1,z=$==null?0:$.length;this.clear();while(++Y<z){var U=$[Y];this.set(U[0],U[1])}}function w51(){this.__data__=fH?fH(null):{},this.size=0}function M51($){var Y=this.has($)&&delete this.__data__[$];return this.size-=Y?1:0,Y}function O51($){var Y=this.__data
Line truncated
|
||||
]`;this.ESCAPE_REGEXP=new RegExp(Y)}set headers($){this._headers=$}shouldQuote($,Y){let z=Y?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(T91.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,Y,z){let U=`${j91.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:Q}=this;if(Q.quote!==""){if(U.indexOf(Q.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,Q.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(Y,z))return this.quoteField(U);return U}quoteField($){let{quote:Y}=this.formatterOptions;return`${Y}${$}${Y}`}}bJ.FieldFormatter=yI0});var Gf=E((kI0)=>{Object.defineProperty(kI0,"__esModule",{value:!0});kI0.isSyncTransform=void 0;kI0.isSyncTransform=($)=>$.length===1});var uI0=E((iJ)=>{var fI0=iJ&&iJ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(iJ,"__esModule",{value:!0});iJ.RowFormatter=void 0;var C91=fI0(ON()),R91=fI0(jI0()),_91=Kf(),v91=Gf();class Oz{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new _91.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(Oz.isRowHashArray($))return $.map((Y)=>Y[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(v91.isSyncTransform($))return(Y,z)=>{let U=null;try{U=$(Y)}catch(Q){return z(Q)}return z(null,U)};return(Y,z)=>{$(Y,z)}}set rowTransform($){if(!C91.default($))throw TypeError("The transform should be a function");this._rowTransform=Oz.createTransform($)}format($,Y){this.callTransformer($,(z,U)=>{if(z)return Y(z);if(!$)return Y(null);let Q=[];if(U){let{shouldFormatColumns:J,headers:I}=this.checkHeaders(U);if(this.shouldWriteHeaders&&I&&!this.hasWrittenHeaders)Q.push(this.formatColumns(I,!0)),this.hasWrittenHeaders=!0;if(J){let K=this.gatherColumns(U);Q.push(this.formatColumns(K,!1))}}return Y(null,Q)})}finish($){let Y=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));Y.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)Y.push(this.formatterOptions.rowDelimiter);return $(null,Y)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let Y=Oz.gatherHeaders($);if(this.headers=Y,this.fieldFormatter.headers=Y,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!R91.default(Y,$),headers:Y}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((Y)=>$[Y]);if(Oz.isRowHashArray($))return this.headers.map((Y,z)=>{let U=$[z];if(U)return U[1];return""});if(Oz.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((Y,z)=>$[z])}callTransformer($,Y){if(!this._rowTransform)return Y(null,$);return this._rowTransform($,Y)}formatColumns($,Y){let z=$.map((Q,J)=>this.fieldFormatter.format(Q,J,Y)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,z].join("");return z}}iJ.RowFormatter=Oz});var bI0=E((hN)=>{Object.defineProperty(hN,"__esModule",{value:!0});hN.FieldFormatter=hN.RowFormatter=void 0;var h91=uI0();Object.defineProperty(hN,"RowFormatter",{enumerable:!0,get:function(){return h91.RowFormatter}});var S91=Kf();Object.defineProperty(hN,"FieldFormatter",{enumerable:!0,get:function(){return S91.FieldFormatter}})});var Wf=E((cI0)=>{Object.defineProperty(cI0,"__esModule",{value:!0});cI0.CsvFormatterStream=void 0;var y91=I0("stream"),k91=bI0();class iI0 extends y91.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new k91.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,Y,z){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(Q,J)=>{if(Q)return U=!0,z(Q);if(J)J.forEach((I)=>{this.push(Buffer.from(I,"utf8"))});return U=!0,z()})}catch(Q){if(U)throw Q;z(Q)}}_flush($){this.rowFormatter.finish((Y,z)=>{if(Y)return $(Y);if(z)z.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}cI0.CsvFormatterStream=iI0});var dI0=E((s1)=>{var pI0=s1&&s1.__createBinding||(Object.create?function($,Y,z,U){if(U===void 0)U=z;Object.defineProperty($,U,{enumerable:!0,get:function(){return Y[z]}})}:function($,Y,z,U){if(U===void 0)U=z;$[U]=Y[z]}),x91=s1&&s1.__setModuleDefault||(Object.create?function($,Y){O
Line truncated
|
||||
`,Y=this.i,U=q5;break;case k4:return this.text+=z.slice(Y),!1;default:}if(U===$)return this.text+=z.slice(Y,this.prevI),!0}}captureNameChars(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCode();if(z===k4)return this.name+=$.slice(Y),k4;if(!i70(z))return this.name+=$.slice(Y,this.prevI),z===Q9?q5:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===k4||!p8($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=Vt0,this.getCode=this.getCode10;else this.isChar=Ft0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Bt0}sBeginWhitespace(){let $=this.i,Y=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(Y){case r3:if(this.state=Ak,this.text.length!==0)throw Error("no-empty text at start");break;case k4:break;default:this.unget(),this.state=C8,this.xmlDeclPossible=!1}}sDoctype(){var $;let Y=this.captureTo(lt0);switch(Y){case A6:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8,this.doctype=!0;break}case k4:break;default:if(this.text+=String.fromCodePoint(Y),Y===Q30)this.state=PJ;else if(bO(Y))this.state=Pt0,this.q=Y}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=Bk}sDTD(){let $=this.captureTo(ot0);if($===k4)return;if(this.text+=String.fromCodePoint($),$===TJ)this.state=Bk;else if($===r3)this.state=Tt0;else if(bO($))this.state=At0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=PJ,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case s70:this.state=jt0,this.openWakaBang="";break;case l6:this.state=Rt0;break;default:this.state=PJ}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),Y=this.openWakaBang+=$;if(this.text+=$,Y!=="-")this.state=Y==="--"?Pk:PJ,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(fO))this.text+="-",this.state=Et0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===fO?Ct0:Pk}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===A6)this.state=PJ;else this.fail("malformed comment."),this.state=Pk}sDTDPI(){if(this.captureToChar(l6))this.text+="?",this.state=_t0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===A6)this.state=PJ}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:Y}=this;$:while(!0)switch(this.getCode()){case Q9:this.entity+=`${Y.slice($,this.prevI)}
|
||||
`,$=this.i;break;case mt0:{let{entityReturnState:z}=this,U=this.entity+Y.slice($,this.prevI);this.state=z;let Q;if(U==="")this.fail("empty entity name."),Q="&;";else Q=this.parseEntity(U),this.entity="";if(z!==C8||this.textHandler!==void 0)this.text+=Q;break $}case k4:this.entity+=Y.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(EH($))this.state=it0,this.unget(),this.xmlDeclPossible=!1;else switch($){case uO:this.state=pt0,this.xmlDeclPossible=!1;break;case s70:this.state=vt0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case l6:this.state=kt0;break;default:this.fail("disallowed character in tag name"),this.state=C8,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=jk,this.openWakaBang="";break;case"--":this.state=Tk,this.openWakaBang="";break;case"DOCTYPE":if(this.state=Bk,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(fO))this.state=ht0}sCommentEnding(){var $;let Y=this.getCodeNorm();if(Y===fO)this.state=St0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(Y)}`,this.state=Tk}sCommentEnded(){let $=this.getCodeNorm();if($!==A6)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=Tk;else this.state=C8}sCData(){if(this.captureToChar(TJ))this.state=gt0}sCDataEnding(){let $=this.getCodeNorm();if($===TJ)this.state=yt0;else this.text+=`]${String.fromCodePoint($)}`,this.state=jk}sCDataEnding2(){var $;let Y=this.getCodeNorm();switch(Y){case A6:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8;break}case TJ:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(Y)}`,this.state=jk}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=n70;else if($===l6||p8($))this.fail("processing instruction without a target."),this.state=$===l6?xO:Ek;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=n70}sPIRest(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCodeNorm();if(z===k4){this.piTarget+=$.slice(Y);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(Y,this.prevI);let U=z===l6;if(U||p8(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?Iz:p70}else this.state=U?xO:Ek;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===l6)this.state=xO;else if(!p8($))this.text=String.fromCodePoint($)}else if(this.captureToChar(l6))this.state=xO}sPIEnding(){var $;let Y=this.getCodeNorm();if(Y===A6){let{piTarget:z}=this;if(z.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:z,body:this.text}),this.piTarget=this.text="",this.state=C8}else if(Y===l6)this.text+="?";else this.text+=`?${String.fromCodePoint(Y)}`,this.state=Ek;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===l6){this.state=Iz;return}if($!==k4)this.state=xt0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(rt0);if($===l6){this.state=Iz,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p8($)||$===AJ))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===AJ?d70:ft0}sXMLDeclEq(){let $=this.getCodeNorm();if($===l6){this.state=Iz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if($!==AJ)this.fail("value required.");this.state=d70}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===l6){this.state=Iz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if(!bO($))this.fail("value must be quoted."),this.q=r70;else this.q=$;this.state=ut0}sXMLDeclValue(){let $=this.captureTo([this.q,l6]);if($===l6){this.state=Iz,this.text="",this.fail("XML declaration is incomplete.");return}if($===k4)return;let Y=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=Y;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver
Line truncated
|
||||
`;$=this.i,Y=Kz;break;case k4:if(U!==void 0)this.text+=z.slice($);break $;default:Y=Kz}this.forbiddenState=Y}handleTextOutsideRoot(){let{i:$}=this,{chunk:Y,textHandler:z}=this,U=!1;$:while(!0){let Q=this.getCode();switch(Q){case r3:{if(this.state=Ak,z!==void 0){let{text:J}=this,I=Y.slice($,this.prevI);if(J.length!==0)z(J+I),this.text="";else if(I.length!==0)z(I)}break $}case RH:if(this.state=kO,this.entityReturnState=C8,z!==void 0)this.text+=Y.slice($,this.prevI);U=!0;break $;case Q9:if(z!==void 0)this.text+=`${Y.slice($,this.prevI)}
|
||||
`;$=this.i;break;case k4:if(z!==void 0)this.text+=Y.slice($);break $;default:if(!p8(Q))U=!0}}if(!U)return;if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0}pushAttribNS($,Y){var z;let{prefix:U,local:Q}=this.qname($),J={name:$,prefix:U,local:Q,value:Y};if(this.attribList.push(J),(z=this.attributeHandler)===null||z===void 0||z.call(this,J),U==="xmlns"){let I=Y.trim();if(this.currentXMLVersion==="1.0"&&I==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[Q]=I,Sk(this,Q,I)}else if($==="xmlns"){let I=Y.trim();this.topNS[""]=I,Sk(this,"",I)}}pushAttribPlain($,Y){var z;let U={name:$,value:Y};this.attribList.push(U),(z=this.attributeHandler)===null||z===void 0||z.call(this,U)}end(){var $,Y;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let Q=z.pop();this.fail(`unclosed tag: ${Q.name}`)}if(this.state!==c70&&this.state!==C8)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(Y=this.endHandler)===null||Y===void 0||Y.call(this),this._init(),this}resolve($){var Y,z;let U=this.topNS[$];if(U!==void 0)return U;let{tags:Q}=this;for(let J=Q.length-1;J>=0;J--)if(U=Q[J].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(z=(Y=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(Y,$)}qname($){let Y=$.indexOf(":");if(Y===-1)return{prefix:"",local:$};let z=$.slice(Y+1),U=$.slice(0,Y);if(U===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:z}}processAttribsNS(){var $;let{attribList:Y}=this,z=this.tag;{let{prefix:J,local:I}=this.qname(z.name);z.prefix=J,z.local=I;let K=z.uri=($=this.resolve(J))!==null&&$!==void 0?$:"";if(J!==""){if(J==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(K==="")this.fail(`unbound namespace prefix: ${JSON.stringify(J)}.`),z.uri=J}}if(Y.length===0)return;let{attributes:U}=z,Q=new Set;for(let J of Y){let{name:I,prefix:K,local:G}=J,W,H;if(K==="")W=I==="xmlns"?jJ:"",H=I;else{if(W=this.resolve(K),W===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(K)}.`),W=K;H=`{${W}}${G}`}if(Q.has(H))this.fail(`duplicate attribute: ${H}.`);Q.add(H),J.uri=W,U[I]=J}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,Y=this.tag.attributes;for(let{name:z,value:U}of $){if(Y[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);Y[z]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:Y}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),Y.push(z),this.state=C8,this.name=""}openSelfClosingTag(){var $,Y,z;this.processAttribs();let{tags:U}=this,Q=this.tag;if(Q.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,Q),(Y=this.closeTagHandler)===null||Y===void 0||Y.call(this,Q),(this.tag=(z=U[U.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=C8,this.name=""}closeTag(){let{tags:$,name:Y}=this;if(this.state=C8,this.name="",Y===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,U=$.length;while(U-- >0){let Q=this.tag=$.pop();if(this.topNS=Q.ns,z===null||z===void 0||z(Q),Q.name===Y)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${Y}.`),this.text+=`</${Y}>`}parseEntity($){if($[0]!=="#"){let z=this.ENTITIES[$];if(z!==void 0)return z;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let Y=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))Y=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))Y=parseInt($.slice(1),10);if(!this.isChar(Y))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(Y)}}K30.SaxesParser=I30});var _H=E((Lp1,W30)=>{var{SaxesParser:ze0}=G30(),{PassThrough:Ue0}=E8(),{bufferToString:Qe0}=Fk();W30.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new Ue0);let Y=new ze0,z;Y.on("error",(Q)=>{z=Q});let U=[];Y.on("opentag",(Q)=>U.push({eventType:"opentag",value:Q})),Y.on("text",(Q)=>U.push({eventType:"text",value:Q})),Y.on("closetag",(Q)=>U.push({eventType:"closetag",value:Q}));for await(let Q of $){if(Y.write(Qe0(Q)),z)throw z;yield U,U=[]}}});var g0=E((Fp1,H30)=>{var Je0=_H(),Ie0=m6();class CJ{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,Y){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof CJ)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let Y of $)for(let{eventType:z,value:U}of Y)if(z==="opentag")this.parseOpen(U);else if(z==="text")this.parseText(U);else if(z==="closetag"){if(!this.parseClose(U.name))return thLine truncated
|
||||
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
|
||||
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((Y=$.writeHeaders)!==null&&Y!==void 0?Y:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}bJ0.FormatterOptions=uJ0});var NN=E((im1,dJ0)=>{var F$1="[object AsyncFunction]",w$1="[object Function]",M$1="[object GeneratorFunction]",O$1="[object Null]",N$1="[object Proxy]",D$1="[object Undefined]",B$1=typeof global=="object"&&global&&global.Object===Object&&global,P$1=typeof self=="object"&&self&&self.Object===Object&&self,A$1=B$1||P$1||Function("return this")(),nJ0=Object.prototype,T$1=nJ0.hasOwnProperty,pJ0=nJ0.toString,cJ0=A$1.Symbol,Vz=cJ0?cJ0.toStringTag:void 0;function j$1($){if($==null)return $===void 0?D$1:O$1;return Vz&&Vz in Object($)?E$1($):C$1($)}function E$1($){var Y=T$1.call($,Vz),z=$[Vz];try{$[Vz]=void 0;var U=!0}catch(J){}var Q=pJ0.call($);if(U)if(Y)$[Vz]=z;else delete $[Vz];return Q}function C$1($){return pJ0.call($)}function R$1($){if(!_$1($))return!1;var Y=j$1($);return Y==w$1||Y==M$1||Y==F$1||Y==N$1}function _$1($){var Y=typeof $;return $!=null&&(Y=="object"||Y=="function")}dJ0.exports=R$1});var jI0=E((DN,fJ)=>{var v$1=200,Uf="__lodash_hash_undefined__",RN=1,UI0=2,QI0=9007199254740991,BN="[object Arguments]",sx="[object Array]",h$1="[object AsyncFunction]",JI0="[object Boolean]",II0="[object Date]",KI0="[object Error]",GI0="[object Function]",S$1="[object GeneratorFunction]",PN="[object Map]",WI0="[object Number]",g$1="[object Null]",xJ="[object Object]",mJ0="[object Promise]",y$1="[object Proxy]",HI0="[object RegExp]",AN="[object Set]",XI0="[object String]",k$1="[object Symbol]",x$1="[object Undefined]",ax="[object WeakMap]",ZI0="[object ArrayBuffer]",TN="[object DataView]",f$1="[object Float32Array]",u$1="[object Float64Array]",b$1="[object Int8Array]",i$1="[object Int16Array]",c$1="[object Int32Array]",n$1="[object Uint8Array]",p$1="[object Uint8ClampedArray]",d$1="[object Uint16Array]",m$1="[object Uint32Array]",l$1=/[\\^$.*+?()[\]{}|]/g,o$1=/^\[object .+?Constructor\]$/,r$1=/^(?:0|[1-9]\d*)$/,A4={};A4[f$1]=A4[u$1]=A4[b$1]=A4[i$1]=A4[c$1]=A4[n$1]=A4[p$1]=A4[d$1]=A4[m$1]=!0;A4[BN]=A4[sx]=A4[ZI0]=A4[JI0]=A4[TN]=A4[II0]=A4[KI0]=A4[GI0]=A4[PN]=A4[WI0]=A4[xJ]=A4[HI0]=A4[AN]=A4[XI0]=A4[ax]=!1;var qI0=typeof global=="object"&&global&&global.Object===Object&&global,s$1=typeof self=="object"&&self&&self.Object===Object&&self,X7=qI0||s$1||Function("return this")(),VI0=typeof DN=="object"&&DN&&!DN.nodeType&&DN,lJ0=VI0&&typeof fJ=="object"&&fJ&&!fJ.nodeType&&fJ,LI0=lJ0&&lJ0.exports===VI0,lx=LI0&&qI0.process,oJ0=function(){try{return lx&&lx.binding&&lx.binding("util")}catch($){}}(),rJ0=oJ0&&oJ0.isTypedArray;function a$1($,Y){var z=-1,U=$==null?0:$.length,Q=0,J=[];while(++z<U){var I=$[z];if(Y(I,z,$))J[Q++]=I}return J}function t$1($,Y){var z=-1,U=Y.length,Q=$.length;while(++z<U)$[Q+z]=Y[z];return $}function e$1($,Y){var z=-1,U=$==null?0:$.length;while(++z<U)if(Y($[z],z,$))return!0;return!1}function $51($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}function Y51($){return function(Y){return $(Y)}}function z51($,Y){return $.has(Y)}function U51($,Y){return $==null?void 0:$[Y]}function Q51($){var Y=-1,z=Array($.size);return $.forEach(function(U,Q){z[++Y]=[Q,U]}),z}function J51($,Y){return function(z){return $(Y(z))}}function I51($){var Y=-1,z=Array($.size);return $.forEach(function(U){z[++Y]=U}),z}var K51=Array.prototype,G51=Function.prototype,_N=Object.prototype,ox=X7["__core-js_shared__"],FI0=G51.toString,I9=_N.hasOwnProperty,sJ0=function(){var $=/[^.]+$/.exec(ox&&ox.keys&&ox.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),wI0=_N.toString,W51=RegExp("^"+FI0.call(I9).replace(l$1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),aJ0=LI0?X7.Buffer:void 0,jN=X7.Symbol,tJ0=X7.Uint8Array,MI0=_N.propertyIsEnumerable,H51=K51.splice,Lz=jN?jN.toStringTag:void 0,eJ0=Object.getOwnPropertySymbols,X51=aJ0?aJ0.isBuffer:void 0,Z51=J51(Object.keys,Object),tx=uJ(X7,"DataView"),xH=uJ(X7,"Map"),ex=uJ(X7,"Promise"),$f=uJ(X7,"Set"),Yf=uJ(X7,"WeakMap"),fH=uJ(Object,"create"),q51=Mz(tx),V51=Mz(xH),L51=Mz(ex),F51=Mz($f),w51=Mz(Yf),$I0=jN?jN.prototype:void 0,rx=$I0?$I0.valueOf:void 0;function Fz($){var Y=-1,z=$==null?0:$.length;this.clear();while(++Y<z){var U=$[Y];this.set(U[0],U[1])}}function M51(){this.__data__=fH?fH(null):{},this.size=0}function O51($){var Y=this.has($)&&delete this.__data__[$];return this.size-=Y?1:0,Y}function N51($){var Y=this.__data
Line truncated
|
||||
]`;this.ESCAPE_REGEXP=new RegExp(Y)}set headers($){this._headers=$}shouldQuote($,Y){let z=Y?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(j91.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,Y,z){let U=`${E91.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:Q}=this;if(Q.quote!==""){if(U.indexOf(Q.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,Q.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(Y,z))return this.quoteField(U);return U}quoteField($){let{quote:Y}=this.formatterOptions;return`${Y}${$}${Y}`}}bJ.FieldFormatter=yI0});var Gf=E((kI0)=>{Object.defineProperty(kI0,"__esModule",{value:!0});kI0.isSyncTransform=void 0;kI0.isSyncTransform=($)=>$.length===1});var uI0=E((iJ)=>{var fI0=iJ&&iJ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(iJ,"__esModule",{value:!0});iJ.RowFormatter=void 0;var R91=fI0(NN()),_91=fI0(jI0()),v91=Kf(),h91=Gf();class Oz{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new v91.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(Oz.isRowHashArray($))return $.map((Y)=>Y[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(h91.isSyncTransform($))return(Y,z)=>{let U=null;try{U=$(Y)}catch(Q){return z(Q)}return z(null,U)};return(Y,z)=>{$(Y,z)}}set rowTransform($){if(!R91.default($))throw TypeError("The transform should be a function");this._rowTransform=Oz.createTransform($)}format($,Y){this.callTransformer($,(z,U)=>{if(z)return Y(z);if(!$)return Y(null);let Q=[];if(U){let{shouldFormatColumns:J,headers:I}=this.checkHeaders(U);if(this.shouldWriteHeaders&&I&&!this.hasWrittenHeaders)Q.push(this.formatColumns(I,!0)),this.hasWrittenHeaders=!0;if(J){let K=this.gatherColumns(U);Q.push(this.formatColumns(K,!1))}}return Y(null,Q)})}finish($){let Y=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));Y.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)Y.push(this.formatterOptions.rowDelimiter);return $(null,Y)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let Y=Oz.gatherHeaders($);if(this.headers=Y,this.fieldFormatter.headers=Y,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!_91.default(Y,$),headers:Y}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((Y)=>$[Y]);if(Oz.isRowHashArray($))return this.headers.map((Y,z)=>{let U=$[z];if(U)return U[1];return""});if(Oz.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((Y,z)=>$[z])}callTransformer($,Y){if(!this._rowTransform)return Y(null,$);return this._rowTransform($,Y)}formatColumns($,Y){let z=$.map((Q,J)=>this.fieldFormatter.format(Q,J,Y)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,z].join("");return z}}iJ.RowFormatter=Oz});var bI0=E((SN)=>{Object.defineProperty(SN,"__esModule",{value:!0});SN.FieldFormatter=SN.RowFormatter=void 0;var S91=uI0();Object.defineProperty(SN,"RowFormatter",{enumerable:!0,get:function(){return S91.RowFormatter}});var g91=Kf();Object.defineProperty(SN,"FieldFormatter",{enumerable:!0,get:function(){return g91.FieldFormatter}})});var Wf=E((cI0)=>{Object.defineProperty(cI0,"__esModule",{value:!0});cI0.CsvFormatterStream=void 0;var k91=I0("stream"),x91=bI0();class iI0 extends k91.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new x91.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,Y,z){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(Q,J)=>{if(Q)return U=!0,z(Q);if(J)J.forEach((I)=>{this.push(Buffer.from(I,"utf8"))});return U=!0,z()})}catch(Q){if(U)throw Q;z(Q)}}_flush($){this.rowFormatter.finish((Y,z)=>{if(Y)return $(Y);if(z)z.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}cI0.CsvFormatterStream=iI0});var dI0=E((s1)=>{var pI0=s1&&s1.__createBinding||(Object.create?function($,Y,z,U){if(U===void 0)U=z;Object.defineProperty($,U,{enumerable:!0,get:function(){return Y[z]}})}:function($,Y,z,U){if(U===void 0)U=z;$[U]=Y[z]}),f91=s1&&s1.__setModuleDefault||(Object.create?function($,Y){O
Line truncated
|
||||
`||Y===`\r
|
||||
`}static isTokenCarriageReturn($,Y){return $.token===Y.carriageReturn}static isTokenComment($,Y){return Y.supportsComments&&!!$&&$.token===Y.comment}static isTokenEscapeCharacter($,Y){return $.token===Y.escapeChar}static isTokenQuote($,Y){return $.token===Y.quote}static isTokenDelimiter($,Y){return $.token===Y.delimiter}}mK0.Token=dK0});var Sf=E((sK0)=>{Object.defineProperty(sK0,"__esModule",{value:!0});sK0.Scanner=void 0;var oK0=I2(),d21=/((?:\r\n)|\n|\r)/;class rK0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,Y=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(Y)===-1)return null;let z=Y.exec($);if(z==null)return null;let U=z[1],Q=this.cursor+(z.index||0);return new oK0.Token({token:U,startCursor:Q,endCursor:Q+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:Y}=this;if(Y<=$)return null;return new oK0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=d21.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}sK0.Scanner=rK0});var YD=E((eK0)=>{Object.defineProperty(eK0,"__esModule",{value:!0});eK0.ColumnFormatter=void 0;class tK0{constructor($){if($.trim)this.format=(Y)=>Y.trim();else if($.ltrim)this.format=(Y)=>Y.trimLeft();else if($.rtrim)this.format=(Y)=>Y.trimRight();else this.format=(Y)=>Y}}eK0.ColumnFormatter=tK0});var gf=E((UG0)=>{Object.defineProperty(UG0,"__esModule",{value:!0});UG0.NonQuotedColumnParser=void 0;var m21=YD(),YG0=I2();class zG0{constructor($){this.parserOptions=$,this.columnFormatter=new m21.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:Y}=this,z=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(YG0.Token.isTokenDelimiter(U,Y)||YG0.Token.isTokenRowDelimiter(U))break;z.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(z.join(""))}}UG0.NonQuotedColumnParser=zG0});var yf=E((IG0)=>{Object.defineProperty(IG0,"__esModule",{value:!0});IG0.QuotedColumnParser=void 0;var l21=YD(),tJ=I2();class JG0{constructor($){this.parserOptions=$,this.columnFormatter=new l21.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let Y=$.cursor,{foundClosingQuote:z,col:U}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(Y),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),U}gatherDataBetweenQuotes($){let{parserOptions:Y}=this,z=!1,U=!1,Q=[],J=$.nextCharacterToken;for(;!U&&J!==null;J=$.nextCharacterToken){let I=tJ.Token.isTokenQuote(J,Y);if(!z&&I)z=!0;else if(z)if(tJ.Token.isTokenEscapeCharacter(J,Y)){$.advancePastToken(J);let K=$.nextCharacterToken;if(K!==null&&(tJ.Token.isTokenQuote(K,Y)||tJ.Token.isTokenEscapeCharacter(K,Y)))Q.push(K.token),J=K;else if(I)U=!0;else Q.push(J.token)}else if(I)U=!0;else Q.push(J.token);$.advancePastToken(J)}return{col:this.columnFormatter.format(Q.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:Y}=this,{nextNonSpaceToken:z}=$;if(z){let U=tJ.Token.isTokenDelimiter(z,Y),Q=tJ.Token.isTokenRowDelimiter(z);if(!(U||Q)){let J=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${Y.escapedDelimiter}' OR new line got: '${z.token}'. at '${J}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}IG0.QuotedColumnParser=JG0});var XG0=E((WG0)=>{Object.defineProperty(WG0,"__esModule",{value:!0});WG0.ColumnParser=void 0;var o21=gf(),r21=yf(),s21=I2();class GG0{constructor($){this.parserOptions=$,this.quotedColumnParser=new r21.QuotedColumnParser($),this.nonQuotedColumnParser=new o21.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:Y}=$;if(Y!==null&&s21.Token.isTokenQuote(Y,this.parserOptions))return $.advanceToToken(Y),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}WG0.ColumnParser=GG0});var kf=E((eJ)=>{Object.defineProperty(eJ,"__esModule",{value:!0});eJ.ColumnFormatter=eJ.QuotedColumnParser=eJ.NonQuotedColumnParser=eJ.ColumnParser=void 0;var a21=XG0();Object.defineProperty(eJ,"ColumnParser",{enumerable:!0,get:function(){return a21.ColumnParser}});var t21=gf();Object.defineProperty(eJ,"NonQuotedColumnParser",{enumerable:!0,get:function(){return t21.NonQuotedColumnParser}});var e21=yf();Object.defineProperty(eJ,"QuotedColumnParser",{enumerable:!0,get:function(){re
Line truncated
|
||||
%s`,T,T,q,U);let B=q.type==="*"?tf:q.type==="?"?Yu:"\\"+q.type;Q=!0,U=U.slice(0,q.reStart)+B+"\\("+T}if(D(),J)U+="\\\\";let N=pY1[U.charAt(0)];for(let T=K.length-1;T>-1;T--){let B=K[T],j=U.slice(0,B.reStart),C=U.slice(B.reStart,B.reEnd-8),b=U.slice(B.reEnd),k=U.slice(B.reEnd-8,B.reEnd)+b,h=j.split(")").length,i=j.split("(").length-h,c=b;for(let x=0;x<i;x++)c=c.replace(/\)[+*?]?/,"");b=c;let U0=b===""&&Y!==ef?"(?:$|\\/)":"";U=j+C+b+U0+k}if(U!==""&&Q)U="(?=.)"+U;if(N)U=w()+U;if(Y===ef)return[U,Q];if(z.nocase&&!Q)Q=$.toUpperCase()!==$.toLowerCase();if(!Q)return mY1($);let A=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",A),{_glob:$,_src:U})}catch(T){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let Y=this.options,z=Y.noglobstar?tf:Y.dot?cY1:nY1,U=Y.nocase?"i":"",Q=$.map((J)=>{return J=J.map((I)=>typeof I==="string"?oY1(I):I===R8?R8:I._src).reduce((I,K)=>{if(!(I[I.length-1]===R8&&K===R8))I.push(K);return I},[]),J.forEach((I,K)=>{if(I!==R8||J[K-1]===R8)return;if(K===0)if(J.length>1)J[K+1]="(?:\\/|"+z+"\\/)?"+J[K+1];else J[K]=z;else if(K===J.length-1)J[K-1]+="(?:\\/|"+z+")?";else J[K-1]+="(?:\\/|\\/"+z+"\\/)"+J[K+1],J[K+1]=R8}),J.filter((I)=>I!==R8).join("/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,U)}catch(J){this.regexp=!1}return this.regexp}match($,Y=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&Y)return!0;let z=this.options;if($u.sep!=="/")$=$.split($u.sep).join("/");$=$.split(QW0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let Q;for(let J=$.length-1;J>=0;J--)if(Q=$[J],Q)break;for(let J=0;J<U.length;J++){let I=U[J],K=$;if(z.matchBase&&I.length===1)K=[Q];if(this.matchOne(K,I,Y)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return W$.defaults($).Minimatch}}W$.Minimatch=mH});var ZW0=E((ol1,XW0)=>{XW0.exports=HW0;var Qu=I0("fs"),{EventEmitter:sY1}=I0("events"),{Minimatch:Uu}=KW0(),{resolve:aY1}=I0("path");function tY1($,Y){return new Promise((z,U)=>{Qu.readdir($,{withFileTypes:!0},(Q,J)=>{if(Q)switch(Q.code){case"ENOTDIR":if(Y)U(Q);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:U(Q);break}else z(J)})})}function GW0($,Y){return new Promise((z,U)=>{(Y?Qu.stat:Qu.lstat)($,(J,I)=>{if(J)switch(J.code){case"ENOENT":if(Y)z(GW0($,!1));else z(null);break;default:z(null);break}else z(I)})})}async function*WW0($,Y,z,U,Q,J){let I=await tY1(Y+$,J);for(let K of I){let G=K.name;if(G===void 0)G=K,U=!0;let W=$+"/"+G,H=W.slice(1),X=Y+"/"+H,Z=null;if(U||z)Z=await GW0(X,z);if(!Z&&K.name!==void 0)Z=K;if(Z===null)Z={isDirectory:()=>!1};if(Z.isDirectory()){if(!Q(H))yield{relative:H,absolute:X,stats:Z},yield*WW0(W,Y,z,U,Q,!1)}else yield{relative:H,absolute:X,stats:Z}}}async function*eY1($,Y,z,U){yield*WW0("",$,Y,z,U,!0)}function $z1($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class Ju extends sY1{constructor($,Y,z){super();if(typeof Y==="function")z=Y,Y=null;if(this.options=$z1(Y||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((Q)=>new Uu(Q,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((Q)=>new Uu(Q,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((Q)=>new Uu(Q,{dot:!0}))}if(this.iterator=eY1(aY1($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,z)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>z(U)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((Y)=>Y.match($))}_fileMatches($,Y){let z=$+(Y?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(z)))&&!this.ignoreMatchers.some((U)=>U.match(z))&&(!this.options.nodir||!Y)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let Y=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,Y)){let z=$.value.relative,U=$.value.absolute;if(this.options.mark&&Y)z+="/",U+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:U,stat:$.value.stats});else this.emit("match",{relative:z
Line truncated
|
||||
`}static isTokenCarriageReturn($,Y){return $.token===Y.carriageReturn}static isTokenComment($,Y){return Y.supportsComments&&!!$&&$.token===Y.comment}static isTokenEscapeCharacter($,Y){return $.token===Y.escapeChar}static isTokenQuote($,Y){return $.token===Y.quote}static isTokenDelimiter($,Y){return $.token===Y.delimiter}}mK0.Token=dK0});var Sf=E((sK0)=>{Object.defineProperty(sK0,"__esModule",{value:!0});sK0.Scanner=void 0;var oK0=I2(),m21=/((?:\r\n)|\n|\r)/;class rK0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,Y=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(Y)===-1)return null;let z=Y.exec($);if(z==null)return null;let U=z[1],Q=this.cursor+(z.index||0);return new oK0.Token({token:U,startCursor:Q,endCursor:Q+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:Y}=this;if(Y<=$)return null;return new oK0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=m21.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}sK0.Scanner=rK0});var zD=E((eK0)=>{Object.defineProperty(eK0,"__esModule",{value:!0});eK0.ColumnFormatter=void 0;class tK0{constructor($){if($.trim)this.format=(Y)=>Y.trim();else if($.ltrim)this.format=(Y)=>Y.trimLeft();else if($.rtrim)this.format=(Y)=>Y.trimRight();else this.format=(Y)=>Y}}eK0.ColumnFormatter=tK0});var gf=E((UG0)=>{Object.defineProperty(UG0,"__esModule",{value:!0});UG0.NonQuotedColumnParser=void 0;var l21=zD(),YG0=I2();class zG0{constructor($){this.parserOptions=$,this.columnFormatter=new l21.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:Y}=this,z=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(YG0.Token.isTokenDelimiter(U,Y)||YG0.Token.isTokenRowDelimiter(U))break;z.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(z.join(""))}}UG0.NonQuotedColumnParser=zG0});var yf=E((IG0)=>{Object.defineProperty(IG0,"__esModule",{value:!0});IG0.QuotedColumnParser=void 0;var o21=zD(),tJ=I2();class JG0{constructor($){this.parserOptions=$,this.columnFormatter=new o21.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let Y=$.cursor,{foundClosingQuote:z,col:U}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(Y),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),U}gatherDataBetweenQuotes($){let{parserOptions:Y}=this,z=!1,U=!1,Q=[],J=$.nextCharacterToken;for(;!U&&J!==null;J=$.nextCharacterToken){let I=tJ.Token.isTokenQuote(J,Y);if(!z&&I)z=!0;else if(z)if(tJ.Token.isTokenEscapeCharacter(J,Y)){$.advancePastToken(J);let K=$.nextCharacterToken;if(K!==null&&(tJ.Token.isTokenQuote(K,Y)||tJ.Token.isTokenEscapeCharacter(K,Y)))Q.push(K.token),J=K;else if(I)U=!0;else Q.push(J.token)}else if(I)U=!0;else Q.push(J.token);$.advancePastToken(J)}return{col:this.columnFormatter.format(Q.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:Y}=this,{nextNonSpaceToken:z}=$;if(z){let U=tJ.Token.isTokenDelimiter(z,Y),Q=tJ.Token.isTokenRowDelimiter(z);if(!(U||Q)){let J=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${Y.escapedDelimiter}' OR new line got: '${z.token}'. at '${J}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}IG0.QuotedColumnParser=JG0});var XG0=E((WG0)=>{Object.defineProperty(WG0,"__esModule",{value:!0});WG0.ColumnParser=void 0;var r21=gf(),s21=yf(),a21=I2();class GG0{constructor($){this.parserOptions=$,this.quotedColumnParser=new s21.QuotedColumnParser($),this.nonQuotedColumnParser=new r21.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:Y}=$;if(Y!==null&&a21.Token.isTokenQuote(Y,this.parserOptions))return $.advanceToToken(Y),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}WG0.ColumnParser=GG0});var kf=E((eJ)=>{Object.defineProperty(eJ,"__esModule",{value:!0});eJ.ColumnFormatter=eJ.QuotedColumnParser=eJ.NonQuotedColumnParser=eJ.ColumnParser=void 0;var t21=XG0();Object.defineProperty(eJ,"ColumnParser",{enumerable:!0,get:function(){return t21.ColumnParser}});var e21=gf();Object.defineProperty(eJ,"NonQuotedColumnParser",{enumerable:!0,get:function(){return e21.NonQuotedColumnParser}});var $Y1=yf();Object.defineProperty(eJ,"QuotedColumnParser",{enumerable:!0,get:function(){re
Line truncated
|
||||
%s`,T,T,q,U);let B=q.type==="*"?tf:q.type==="?"?Yu:"\\"+q.type;Q=!0,U=U.slice(0,q.reStart)+B+"\\("+T}if(D(),J)U+="\\\\";let N=dY1[U.charAt(0)];for(let T=K.length-1;T>-1;T--){let B=K[T],j=U.slice(0,B.reStart),C=U.slice(B.reStart,B.reEnd-8),b=U.slice(B.reEnd),k=U.slice(B.reEnd-8,B.reEnd)+b,h=j.split(")").length,i=j.split("(").length-h,c=b;for(let x=0;x<i;x++)c=c.replace(/\)[+*?]?/,"");b=c;let U0=b===""&&Y!==ef?"(?:$|\\/)":"";U=j+C+b+U0+k}if(U!==""&&Q)U="(?=.)"+U;if(N)U=w()+U;if(Y===ef)return[U,Q];if(z.nocase&&!Q)Q=$.toUpperCase()!==$.toLowerCase();if(!Q)return lY1($);let A=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",A),{_glob:$,_src:U})}catch(T){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let Y=this.options,z=Y.noglobstar?tf:Y.dot?nY1:pY1,U=Y.nocase?"i":"",Q=$.map((J)=>{return J=J.map((I)=>typeof I==="string"?rY1(I):I===R8?R8:I._src).reduce((I,K)=>{if(!(I[I.length-1]===R8&&K===R8))I.push(K);return I},[]),J.forEach((I,K)=>{if(I!==R8||J[K-1]===R8)return;if(K===0)if(J.length>1)J[K+1]="(?:\\/|"+z+"\\/)?"+J[K+1];else J[K]=z;else if(K===J.length-1)J[K-1]+="(?:\\/|"+z+")?";else J[K-1]+="(?:\\/|\\/"+z+"\\/)"+J[K+1],J[K+1]=R8}),J.filter((I)=>I!==R8).join("/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,U)}catch(J){this.regexp=!1}return this.regexp}match($,Y=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&Y)return!0;let z=this.options;if($u.sep!=="/")$=$.split($u.sep).join("/");$=$.split(QW0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let Q;for(let J=$.length-1;J>=0;J--)if(Q=$[J],Q)break;for(let J=0;J<U.length;J++){let I=U[J],K=$;if(z.matchBase&&I.length===1)K=[Q];if(this.matchOne(K,I,Y)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return W$.defaults($).Minimatch}}W$.Minimatch=mH});var ZW0=E((sl1,XW0)=>{XW0.exports=HW0;var Qu=I0("fs"),{EventEmitter:aY1}=I0("events"),{Minimatch:Uu}=KW0(),{resolve:tY1}=I0("path");function eY1($,Y){return new Promise((z,U)=>{Qu.readdir($,{withFileTypes:!0},(Q,J)=>{if(Q)switch(Q.code){case"ENOTDIR":if(Y)U(Q);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:U(Q);break}else z(J)})})}function GW0($,Y){return new Promise((z,U)=>{(Y?Qu.stat:Qu.lstat)($,(J,I)=>{if(J)switch(J.code){case"ENOENT":if(Y)z(GW0($,!1));else z(null);break;default:z(null);break}else z(I)})})}async function*WW0($,Y,z,U,Q,J){let I=await eY1(Y+$,J);for(let K of I){let G=K.name;if(G===void 0)G=K,U=!0;let W=$+"/"+G,H=W.slice(1),X=Y+"/"+H,Z=null;if(U||z)Z=await GW0(X,z);if(!Z&&K.name!==void 0)Z=K;if(Z===null)Z={isDirectory:()=>!1};if(Z.isDirectory()){if(!Q(H))yield{relative:H,absolute:X,stats:Z},yield*WW0(W,Y,z,U,Q,!1)}else yield{relative:H,absolute:X,stats:Z}}}async function*$z1($,Y,z,U){yield*WW0("",$,Y,z,U,!0)}function Yz1($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class Ju extends aY1{constructor($,Y,z){super();if(typeof Y==="function")z=Y,Y=null;if(this.options=Yz1(Y||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((Q)=>new Uu(Q,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((Q)=>new Uu(Q,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((Q)=>new Uu(Q,{dot:!0}))}if(this.iterator=$z1(tY1($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,z)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>z(U)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((Y)=>Y.match($))}_fileMatches($,Y){let z=$+(Y?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(z)))&&!this.ignoreMatchers.some((U)=>U.match(z))&&(!this.options.nodir||!Y)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let Y=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,Y)){let z=$.value.relative,U=$.value.absolute;if(this.options.mark&&Y)z+="/",U+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:U,stat:$.value.stats});else this.emit("match",{relative:z
Line truncated
|
||||
`,m);m=w0===-1?f.length:w0}else if(K0!==-1&&f[m]==="/"&&f[m+1]==="*"){let w0=f.indexOf("*/",m);if(w0!==-1)m=w0+2,K0=f.indexOf("*/",m);else n+=f[m],m++}else n+=f[m],m++;return n}function i0(f){let n=u0(f.toString()),m=n.match(a);if(!m)m=n.match(H0);if(!m)throw Error(`could not parse args in autoInject
|
||||
Source:
|
||||
`+n);let[,K0]=m;return K0.replace(/\s/g,"").split(L0).map((w0)=>w0.replace(f0,"").trim())}function D1(f,n){var m={};return Object.keys(f).forEach((K0)=>{var w0=f[K0],D0,A0=q(w0),j0=!A0&&w0.length===1||A0&&w0.length===0;if(Array.isArray(w0))D0=[...w0],w0=D0.pop(),m[K0]=D0.concat(D0.length>0?h0:w0);else if(j0)m[K0]=w0;else{if(D0=i0(w0),w0.length===0&&!A0&&D0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!A0)D0.pop();m[K0]=D0.concat(h0)}function h0(z1,x1){var m1=D0.map((i1)=>z1[i1]);m1.push(x1),M(w0)(...m1)}}),Y1(m,n)}class k1{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){if(f.prev)f.prev.next=f.next;else this.head=f.next;if(f.next)f.next.prev=f.prev;else this.tail=f.prev;return f.prev=f.next=null,this.length-=1,f}empty(){while(this.head)this.shift();return this}insertAfter(f,n){if(n.prev=f,n.next=f.next,f.next)f.next.prev=n;else this.tail=n;f.next=n,this.length+=1}insertBefore(f,n){if(n.prev=f.prev,n.next=f,f.prev)f.prev.next=n;else this.head=n;f.prev=n,this.length+=1}unshift(f){if(this.head)this.insertBefore(this.head,f);else u1(this,f)}push(f){if(this.tail)this.insertAfter(this.tail,f);else u1(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var f=this.head;while(f)yield f.data,f=f.next}remove(f){var n=this.head;while(n){var{next:m}=n;if(f(n))this.removeLink(n);n=m}return this}}function u1(f,n){f.length=1,f.head=f.tail=n}function b1(f,n,m){if(n==null)n=1;else if(n===0)throw RangeError("Concurrency must not be zero");var K0=M(f),w0=0,D0=[];let A0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function j0(G1,e0){A0[G1].push(e0)}function h0(G1,e0){let W1=(...c1)=>{z1(G1,W1),e0(...c1)};A0[G1].push(W1)}function z1(G1,e0){if(!G1)return Object.keys(A0).forEach((W1)=>A0[W1]=[]);if(!e0)return A0[G1]=[];A0[G1]=A0[G1].filter((W1)=>W1!==e0)}function x1(G1,...e0){A0[G1].forEach((W1)=>W1(...e0))}var m1=!1;function i1(G1,e0,W1,c1){if(c1!=null&&typeof c1!=="function")throw Error("task callback must be a function");l1.started=!0;var g4,v6;function O$(OY,...nK){if(OY)return W1?v6(OY):g4();if(nK.length<=1)return g4(nK[0]);g4(nK)}var xU=l1._createTaskItem(G1,W1?O$:c1||O$);if(e0)l1._tasks.unshift(xU);else l1._tasks.push(xU);if(!m1)m1=!0,W(()=>{m1=!1,l1.process()});if(W1||!c1)return new Promise((OY,nK)=>{g4=OY,v6=nK})}function M$(G1){return function(e0,...W1){w0-=1;for(var c1=0,g4=G1.length;c1<g4;c1++){var v6=G1[c1],O$=D0.indexOf(v6);if(O$===0)D0.shift();else if(O$>0)D0.splice(O$,1);if(v6.callback(e0,...W1),e0!=null)x1("error",e0,v6.data)}if(w0<=l1.concurrency-l1.buffer)x1("unsaturated");if(l1.idle())x1("drain");l1.process()}}function kU(G1){if(G1.length===0&&l1.idle())return W(()=>x1("drain")),!0;return!1}let MY=(G1)=>(e0)=>{if(!e0)return new Promise((W1,c1)=>{h0(G1,(g4,v6)=>{if(g4)return c1(g4);W1(v6)})});z1(G1),j0(G1,e0)};var cK=!1,l1={_tasks:new k1,_createTaskItem(G1,e0){return{data:G1,callback:e0}},*[Symbol.iterator](){yield*l1._tasks[Symbol.iterator]()},concurrency:n,payload:m,buffer:n/4,started:!1,paused:!1,push(G1,e0){if(Array.isArray(G1)){if(kU(G1))return;return G1.map((W1)=>i1(W1,!1,!1,e0))}return i1(G1,!1,!1,e0)},pushAsync(G1,e0){if(Array.isArray(G1)){if(kU(G1))return;return G1.map((W1)=>i1(W1,!1,!0,e0))}return i1(G1,!1,!0,e0)},kill(){z1(),l1._tasks.empty()},unshift(G1,e0){if(Array.isArray(G1)){if(kU(G1))return;return G1.map((W1)=>i1(W1,!0,!1,e0))}return i1(G1,!0,!1,e0)},unshiftAsync(G1,e0){if(Array.isArray(G1)){if(kU(G1))return;return G1.map((W1)=>i1(W1,!0,!0,e0))}return i1(G1,!0,!0,e0)},remove(G1){l1._tasks.remove(G1)},process(){if(cK)return;cK=!0;while(!l1.paused&&w0<l1.concurrency&&l1._tasks.length){var G1=[],e0=[],W1=l1._tasks.length;if(l1.payload)W1=Math.min(W1,l1.payload);for(var c1=0;c1<W1;c1++){var g4=l1._tasks.shift();G1.push(g4),D0.push(g4),e0.push(g4.data)}if(w0+=1,l1._tasks.length===0)x1("empty");if(w0===l1.concurrency)x1("saturated");var v6=h(M$(G1));K0(e0,v6)}cK=!1},length(){return l1._tasks.length},running(){return w0},workersList(){return D0},idle(){return l1._tasks.length+w0===0},pause(){l1.paused=!0},resume(){if(l1.paused===!1)return;l1.paused=!1,W(l1.process)}};return Object.defineProperties(l1,{saturated:{writable:!1,value:MY("saturated")},unsaturated:{writable:!1,value:MY("unsaturated")},empty:{writable:!1,value:MY("empty")},drain:{writable:!1,value:MY("drain")},error:{writable:!1,value:MY("error")}}),l1}function B0(f,n){return b1(f,1,n)}function Q0(f,n,m){return b1(f,n,m)}function P(f,n,m,K0){K0=T(K0);var w0=M(m);return Y0(f,(D0,A0,j0)=>{w0(n,D0,(h0,z1)=>{n=z1,j0(h0)})},(D0)=>K0(D0,n))}var v=w(P,4);function u(...f){var n=f.map(M);return function(...m){var K0=this,w0=m[m.length-1];if(typeof w0=="function")m.pop();else w0=b0();return v(n,m,(D0,A0,j0)=>{A0.apply(K0,D0.concat((h0,...z1)=>{j0(h0,z1)}))},(D0,A0)=>w0(D0,...A0)),w0[T0]}}function r(...f){return u(...f.reverse())}function X0(f,n,m,K0){return D(c(n),f,m,K0)}var J
Line truncated
|
||||
GFS4: `),console.error($)};if(!p4[r6]){if(Ku=global[r6]||[],BW0(p4,Ku),p4.close=function($){function Y(z,U){return $.call(p4,z,function(Q){if(!Q)DW0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(Y,XD,{value:$}),Y}(p4.close),p4.closeSync=function($){function Y(z){$.apply(p4,arguments),DW0()}return Object.defineProperty(Y,XD,{value:$}),Y}(p4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Pz(p4[r6]),I0("assert").equal(p4[r6].length,0)})}var Ku;if(!global[r6])BW0(global,p4[r6]);Hu.exports=Gu(Wz1(p4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!p4.__patched)Hu.exports=Gu(p4),p4.__patched=!0;function Gu($){Kz1($),$.gracefulify=Gu,$.createReadStream=A,$.createWriteStream=T;var Y=$.readFile;$.readFile=z;function z(C,b,k){if(typeof b==="function")k=b,b=null;return h(C,b,k);function h(i,c,U0,x){return Y(i,c,function(d){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))zI([h,[i,c,U0],d,x||Date.now(),Date.now()]);else if(typeof U0==="function")U0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=Q;function Q(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return U(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zI([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var J=$.appendFile;if(J)$.appendFile=I;function I(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return J(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zI([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var K=$.copyFile;if(K)$.copyFile=G;function G(C,b,k,h){if(typeof k==="function")h=k,k=0;return i(C,b,k,h);function i(c,U0,x,d,t){return K(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zI([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var W=$.readdir;$.readdir=X;var H=/^v[0-5]\./;function X(C,b,k){if(typeof b==="function")k=b,b=null;var h=H.test(process.version)?function(U0,x,d,t){return W(U0,i(U0,x,d,t))}:function(U0,x,d,t){return W(U0,x,i(U0,x,d,t))};return h(C,b,k);function i(c,U0,x,d){return function(t,$0){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))zI([h,[c,U0,x],t,d||Date.now(),Date.now()]);else{if($0&&$0.sort)$0.sort();if(typeof x==="function")x.call(this,t,$0)}}}}if(process.version.substr(0,4)==="v0.8"){var Z=Gz1($);w=Z.ReadStream,D=Z.WriteStream}var q=$.ReadStream;if(q)w.prototype=Object.create(q.prototype),w.prototype.open=O;var V=$.WriteStream;if(V)D.prototype=Object.create(V.prototype),D.prototype.open=N;Object.defineProperty($,"ReadStream",{get:function(){return w},set:function(C){w=C},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return D},set:function(C){D=C},enumerable:!0,configurable:!0});var F=w;Object.defineProperty($,"FileReadStream",{get:function(){return F},set:function(C){F=C},enumerable:!0,configurable:!0});var M=D;Object.defineProperty($,"FileWriteStream",{get:function(){return M},set:function(C){M=C},enumerable:!0,configurable:!0});function w(C,b){if(this instanceof w)return q.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function O(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b){if(C.autoClose)C.destroy();C.emit("error",b)}else C.fd=k,C.emit("open",k),C.read()})}function D(C,b){if(this instanceof D)return V.apply(this,arguments),this;else return D.apply(Object.create(D.prototype),arguments)}function N(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b)C.destroy(),C.emit("error",b);else C.fd=k,C.emit("open",k)})}function A(C,b){return new $.ReadStream(C,b)}function T(C,b){return new $.WriteStream(C,b)}var B=$.open;$.open=j;function j(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return B(c,U0,x,function($0,g){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zI([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}return $}function zI($){Pz("ENQUEUE",$[0].name,$[1]),p4[r6].push($),Wu()}var HD;function DW0(){var $=Date.now();for(var Y=0;Y<p4[r6].length;++Y)if(p4[r6][Y].length>2)p4[r6][Y][3]=$,p4[r6][Y][4]=$;Wu()}function Wu(){if(clearTimeout(HD),HD=void 0,p4[r6].length===0)return;var $=p4[r6].shift(),Y=$[0],z=$[1],U=$[2],Q=$[3],J=$[4];if(Q===void 0)Pz("RETRY",Y.name,z),Y.apply(null,z);else if(Date.now()-Q>=60000){Pz("TIMEOUT",Y.name,z);var I=z.pop();if(typeof I==="function")I.call(null,U)}else{var K=Date.now()-J,G=Math.max(J-Q,1),W=Math.min(G*1.2,100);if(K>=W)Pz("RETRY",Y.name,z),Y.apply(null,z.concat([Q]));else p4[r6].push($)}if(HD===void 0)HD=setTimeout(Wu,0)}});var AW0=E((el1,Xu)=>{function Xz1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var PW0=K6().Buffer,lH=I0("util");function Zz1($,Y,z){$.copy(Y,z)}Xu.exports=function(){function $(){Xz1(this,$),this.h
Line truncated
|
||||
`+n);let[,K0]=m;return K0.replace(/\s/g,"").split(L0).map((w0)=>w0.replace(f0,"").trim())}function D1(f,n){var m={};return Object.keys(f).forEach((K0)=>{var w0=f[K0],D0,A0=q(w0),j0=!A0&&w0.length===1||A0&&w0.length===0;if(Array.isArray(w0))D0=[...w0],w0=D0.pop(),m[K0]=D0.concat(D0.length>0?h0:w0);else if(j0)m[K0]=w0;else{if(D0=i0(w0),w0.length===0&&!A0&&D0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!A0)D0.pop();m[K0]=D0.concat(h0)}function h0(z1,x1){var m1=D0.map((i1)=>z1[i1]);m1.push(x1),M(w0)(...m1)}}),Y1(m,n)}class k1{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){if(f.prev)f.prev.next=f.next;else this.head=f.next;if(f.next)f.next.prev=f.prev;else this.tail=f.prev;return f.prev=f.next=null,this.length-=1,f}empty(){while(this.head)this.shift();return this}insertAfter(f,n){if(n.prev=f,n.next=f.next,f.next)f.next.prev=n;else this.tail=n;f.next=n,this.length+=1}insertBefore(f,n){if(n.prev=f.prev,n.next=f,f.prev)f.prev.next=n;else this.head=n;f.prev=n,this.length+=1}unshift(f){if(this.head)this.insertBefore(this.head,f);else u1(this,f)}push(f){if(this.tail)this.insertAfter(this.tail,f);else u1(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var f=this.head;while(f)yield f.data,f=f.next}remove(f){var n=this.head;while(n){var{next:m}=n;if(f(n))this.removeLink(n);n=m}return this}}function u1(f,n){f.length=1,f.head=f.tail=n}function b1(f,n,m){if(n==null)n=1;else if(n===0)throw RangeError("Concurrency must not be zero");var K0=M(f),w0=0,D0=[];let A0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function j0(G1,e0){A0[G1].push(e0)}function h0(G1,e0){let W1=(...c1)=>{z1(G1,W1),e0(...c1)};A0[G1].push(W1)}function z1(G1,e0){if(!G1)return Object.keys(A0).forEach((W1)=>A0[W1]=[]);if(!e0)return A0[G1]=[];A0[G1]=A0[G1].filter((W1)=>W1!==e0)}function x1(G1,...e0){A0[G1].forEach((W1)=>W1(...e0))}var m1=!1;function i1(G1,e0,W1,c1){if(c1!=null&&typeof c1!=="function")throw Error("task callback must be a function");l1.started=!0;var g4,v6;function O$(OY,...nK){if(OY)return W1?v6(OY):g4();if(nK.length<=1)return g4(nK[0]);g4(nK)}var xU=l1._createTaskItem(G1,W1?O$:c1||O$);if(e0)l1._tasks.unshift(xU);else l1._tasks.push(xU);if(!m1)m1=!0,W(()=>{m1=!1,l1.process()});if(W1||!c1)return new Promise((OY,nK)=>{g4=OY,v6=nK})}function M$(G1){return function(e0,...W1){w0-=1;for(var c1=0,g4=G1.length;c1<g4;c1++){var v6=G1[c1],O$=D0.indexOf(v6);if(O$===0)D0.shift();else if(O$>0)D0.splice(O$,1);if(v6.callback(e0,...W1),e0!=null)x1("error",e0,v6.data)}if(w0<=l1.concurrency-l1.buffer)x1("unsaturated");if(l1.idle())x1("drain");l1.process()}}function kU(G1){if(G1.length===0&&l1.idle())return W(()=>x1("drain")),!0;return!1}let MY=(G1)=>(e0)=>{if(!e0)return new Promise((W1,c1)=>{h0(G1,(g4,v6)=>{if(g4)return c1(g4);W1(v6)})});z1(G1),j0(G1,e0)};var cK=!1,l1={_tasks:new k1,_createTaskItem(G1,e0){return{data:G1,callback:e0}},*[Symbol.iterator](){yield*l1._tasks[Symbol.iterator]()},concurrency:n,payload:m,buffer:n/4,started:!1,paused:!1,push(G1,e0){if(Array.isArray(G1)){if(kU(G1))return;return G1.map((W1)=>i1(W1,!1,!1,e0))}return i1(G1,!1,!1,e0)},pushAsync(G1,e0){if(Array.isArray(G1)){if(kU(G1))return;return G1.map((W1)=>i1(W1,!1,!0,e0))}return i1(G1,!1,!0,e0)},kill(){z1(),l1._tasks.empty()},unshift(G1,e0){if(Array.isArray(G1)){if(kU(G1))return;return G1.map((W1)=>i1(W1,!0,!1,e0))}return i1(G1,!0,!1,e0)},unshiftAsync(G1,e0){if(Array.isArray(G1)){if(kU(G1))return;return G1.map((W1)=>i1(W1,!0,!0,e0))}return i1(G1,!0,!0,e0)},remove(G1){l1._tasks.remove(G1)},process(){if(cK)return;cK=!0;while(!l1.paused&&w0<l1.concurrency&&l1._tasks.length){var G1=[],e0=[],W1=l1._tasks.length;if(l1.payload)W1=Math.min(W1,l1.payload);for(var c1=0;c1<W1;c1++){var g4=l1._tasks.shift();G1.push(g4),D0.push(g4),e0.push(g4.data)}if(w0+=1,l1._tasks.length===0)x1("empty");if(w0===l1.concurrency)x1("saturated");var v6=h(M$(G1));K0(e0,v6)}cK=!1},length(){return l1._tasks.length},running(){return w0},workersList(){return D0},idle(){return l1._tasks.length+w0===0},pause(){l1.paused=!0},resume(){if(l1.paused===!1)return;l1.paused=!1,W(l1.process)}};return Object.defineProperties(l1,{saturated:{writable:!1,value:MY("saturated")},unsaturated:{writable:!1,value:MY("unsaturated")},empty:{writable:!1,value:MY("empty")},drain:{writable:!1,value:MY("drain")},error:{writable:!1,value:MY("error")}}),l1}function B0(f,n){return b1(f,1,n)}function Q0(f,n,m){return b1(f,n,m)}function P(f,n,m,K0){K0=T(K0);var w0=M(m);return Y0(f,(D0,A0,j0)=>{w0(n,D0,(h0,z1)=>{n=z1,j0(h0)})},(D0)=>K0(D0,n))}var v=w(P,4);function u(...f){var n=f.map(M);return function(...m){var K0=this,w0=m[m.length-1];if(typeof w0=="function")m.pop();else w0=b0();return v(n,m,(D0,A0,j0)=>{A0.apply(K0,D0.concat((h0,...z1)=>{j0(h0,z1)}))},(D0,A0)=>w0(D0,...A0)),w0[T0]}}function r(...f){return u(...f.reverse())}function X0(f,n,m,K0){return D(c(n),f,m,K0)}var J
Line truncated
|
||||
GFS4: `),console.error($)};if(!p4[r6]){if(Ku=global[r6]||[],BW0(p4,Ku),p4.close=function($){function Y(z,U){return $.call(p4,z,function(Q){if(!Q)DW0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(Y,ZD,{value:$}),Y}(p4.close),p4.closeSync=function($){function Y(z){$.apply(p4,arguments),DW0()}return Object.defineProperty(Y,ZD,{value:$}),Y}(p4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Pz(p4[r6]),I0("assert").equal(p4[r6].length,0)})}var Ku;if(!global[r6])BW0(global,p4[r6]);Hu.exports=Gu(Hz1(p4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!p4.__patched)Hu.exports=Gu(p4),p4.__patched=!0;function Gu($){Gz1($),$.gracefulify=Gu,$.createReadStream=A,$.createWriteStream=T;var Y=$.readFile;$.readFile=z;function z(C,b,k){if(typeof b==="function")k=b,b=null;return h(C,b,k);function h(i,c,U0,x){return Y(i,c,function(d){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))zI([h,[i,c,U0],d,x||Date.now(),Date.now()]);else if(typeof U0==="function")U0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=Q;function Q(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return U(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zI([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var J=$.appendFile;if(J)$.appendFile=I;function I(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return J(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zI([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var K=$.copyFile;if(K)$.copyFile=G;function G(C,b,k,h){if(typeof k==="function")h=k,k=0;return i(C,b,k,h);function i(c,U0,x,d,t){return K(c,U0,x,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zI([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var W=$.readdir;$.readdir=X;var H=/^v[0-5]\./;function X(C,b,k){if(typeof b==="function")k=b,b=null;var h=H.test(process.version)?function(U0,x,d,t){return W(U0,i(U0,x,d,t))}:function(U0,x,d,t){return W(U0,x,i(U0,x,d,t))};return h(C,b,k);function i(c,U0,x,d){return function(t,$0){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))zI([h,[c,U0,x],t,d||Date.now(),Date.now()]);else{if($0&&$0.sort)$0.sort();if(typeof x==="function")x.call(this,t,$0)}}}}if(process.version.substr(0,4)==="v0.8"){var Z=Wz1($);w=Z.ReadStream,D=Z.WriteStream}var q=$.ReadStream;if(q)w.prototype=Object.create(q.prototype),w.prototype.open=O;var V=$.WriteStream;if(V)D.prototype=Object.create(V.prototype),D.prototype.open=N;Object.defineProperty($,"ReadStream",{get:function(){return w},set:function(C){w=C},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return D},set:function(C){D=C},enumerable:!0,configurable:!0});var F=w;Object.defineProperty($,"FileReadStream",{get:function(){return F},set:function(C){F=C},enumerable:!0,configurable:!0});var M=D;Object.defineProperty($,"FileWriteStream",{get:function(){return M},set:function(C){M=C},enumerable:!0,configurable:!0});function w(C,b){if(this instanceof w)return q.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function O(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b){if(C.autoClose)C.destroy();C.emit("error",b)}else C.fd=k,C.emit("open",k),C.read()})}function D(C,b){if(this instanceof D)return V.apply(this,arguments),this;else return D.apply(Object.create(D.prototype),arguments)}function N(){var C=this;j(C.path,C.flags,C.mode,function(b,k){if(b)C.destroy(),C.emit("error",b);else C.fd=k,C.emit("open",k)})}function A(C,b){return new $.ReadStream(C,b)}function T(C,b){return new $.WriteStream(C,b)}var B=$.open;$.open=j;function j(C,b,k,h){if(typeof k==="function")h=k,k=null;return i(C,b,k,h);function i(c,U0,x,d,t){return B(c,U0,x,function($0,g){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))zI([i,[c,U0,x,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}return $}function zI($){Pz("ENQUEUE",$[0].name,$[1]),p4[r6].push($),Wu()}var XD;function DW0(){var $=Date.now();for(var Y=0;Y<p4[r6].length;++Y)if(p4[r6][Y].length>2)p4[r6][Y][3]=$,p4[r6][Y][4]=$;Wu()}function Wu(){if(clearTimeout(XD),XD=void 0,p4[r6].length===0)return;var $=p4[r6].shift(),Y=$[0],z=$[1],U=$[2],Q=$[3],J=$[4];if(Q===void 0)Pz("RETRY",Y.name,z),Y.apply(null,z);else if(Date.now()-Q>=60000){Pz("TIMEOUT",Y.name,z);var I=z.pop();if(typeof I==="function")I.call(null,U)}else{var K=Date.now()-J,G=Math.max(J-Q,1),W=Math.min(G*1.2,100);if(K>=W)Pz("RETRY",Y.name,z),Y.apply(null,z.concat([Q]));else p4[r6].push($)}if(XD===void 0)XD=setTimeout(Wu,0)}});var AW0=E((Yo1,Xu)=>{function Zz1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var PW0=K6().Buffer,lH=I0("util");function qz1($,Y,z){$.copy(Y,z)}Xu.exports=function(){function $(){Zz1(this,$),this.h
Line truncated
|
||||
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
||||
*
|
||||
* Copyright (c) 2014-2018, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/HH0.exports=function($,Y){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var U="";if(z>4&&$[3]==="\\"){var Q=$[2];if((Q==="?"||Q===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var J=$.split(/[/\\]+/);if(Y!==!1&&J[J.length-1]==="")J.pop();return U+J.join("/")}});var _u=E((Xo1,wH0)=>{var ZH0=9007199254740991,MU1="[object Arguments]",OU1="[object Function]",NU1="[object GeneratorFunction]",DU1=/^(?:0|[1-9]\d*)$/;function qH0($,Y,z){switch(z.length){case 0:return $.call(Y);case 1:return $.call(Y,z[0]);case 2:return $.call(Y,z[0],z[1]);case 3:return $.call(Y,z[0],z[1],z[2])}return $.apply(Y,z)}function BU1($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}var zX=Object.prototype,UX=zX.hasOwnProperty,VH0=zX.toString,PU1=zX.propertyIsEnumerable,XH0=Math.max;function AU1($,Y){var z=gU1($)||SU1($)?BU1($.length,String):[],U=z.length,Q=!!U;for(var J in $)if((Y||UX.call($,J))&&!(Q&&(J=="length"||FH0(J,U))))z.push(J);return z}function TU1($,Y,z,U){if($===void 0||Eu($,zX[z])&&!UX.call(U,z))return Y;return $}function jU1($,Y,z){var U=$[Y];if(!(UX.call($,Y)&&Eu(U,z))||z===void 0&&!(Y in $))$[Y]=z}function EU1($){if(!Ru($))return hU1($);var Y=vU1($),z=[];for(var U in $)if(!(U=="constructor"&&(Y||!UX.call($,U))))z.push(U);return z}function LH0($,Y){return Y=XH0(Y===void 0?$.length-1:Y,0),function(){var z=arguments,U=-1,Q=XH0(z.length-Y,0),J=Array(Q);while(++U<Q)J[U]=z[Y+U];U=-1;var I=Array(Y+1);while(++U<Y)I[U]=z[U];return I[Y]=J,qH0($,this,I)}}function CU1($,Y,z,U){z||(z={});var Q=-1,J=Y.length;while(++Q<J){var I=Y[Q],K=U?U(z[I],$[I],I,z,$):void 0;jU1(z,I,K===void 0?$[I]:K)}return z}function RU1($){return LH0(function(Y,z){var U=-1,Q=z.length,J=Q>1?z[Q-1]:void 0,I=Q>2?z[2]:void 0;if(J=$.length>3&&typeof J=="function"?(Q--,J):void 0,I&&_U1(z[0],z[1],I))J=Q<3?void 0:J,Q=1;Y=Object(Y);while(++U<Q){var K=z[U];if(K)$(Y,K,U,J)}return Y})}function FH0($,Y){return Y=Y==null?ZH0:Y,!!Y&&(typeof $=="number"||DU1.test($))&&($>-1&&$%1==0&&$<Y)}function _U1($,Y,z){if(!Ru(z))return!1;var U=typeof Y;if(U=="number"?Cu(z)&&FH0(Y,z.length):U=="string"&&(Y in z))return Eu(z[Y],$);return!1}function vU1($){var Y=$&&$.constructor,z=typeof Y=="function"&&Y.prototype||zX;return $===z}function hU1($){var Y=[];if($!=null)for(var z in Object($))Y.push(z);return Y}function Eu($,Y){return $===Y||$!==$&&Y!==Y}function SU1($){return yU1($)&&UX.call($,"callee")&&(!PU1.call($,"callee")||VH0.call($)==MU1)}var gU1=Array.isArray;function Cu($){return $!=null&&xU1($.length)&&!kU1($)}function yU1($){return fU1($)&&Cu($)}function kU1($){var Y=Ru($)?VH0.call($):"";return Y==OU1||Y==NU1}function xU1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=ZH0}function Ru($){var Y=typeof $;return!!$&&(Y=="object"||Y=="function")}function fU1($){return!!$&&typeof $=="object"}var uU1=RU1(function($,Y,z,U){CU1(Y,iU1(Y),$,U)}),bU1=LH0(function($){return $.push(void 0,TU1),qH0(uU1,void 0,$)});function iU1($){return Cu($)?AU1($,!0):EU1($)}wH0.exports=bU1});var OH0=E((Zo1,vu)=>{function cU1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var MH0=K6().Buffer,QX=I0("util");function nU1($,Y,z){$.copy(Y,z)}vu.exports=function(){function $(){cU1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,Q=""+U.data;while(U=U.next)Q+=z+U.data;return Q},$.prototype.concat=function(z){if(this.length===0)return MH0.alloc(0);var U=MH0.allocUnsafe(z>>>0),Q=this.head,J=0;while(Q)nU1(Q.data,U,J),J+=Q.data.length,Q=Q.next;return U},$}();if(QX&&QX.inspect&&QX.inspect.custom)vu.exports.prototype[QX.inspect.custom]=function(){var $=QX.inspect({length:this.length});return this.constructor.name+" "+$}});var hu=E((qo1,NH0)=>{var AD=I6();function pU1($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(U||Q){if(Y)Y($);else if($){if(!this._writableState)AD.nextTick(TD,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,AD.nextTick(TD,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!Y&&J){if(!z._writableState)AD.nextTick(TD,z,J);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,AD.nextTick(TD,z,J)}else if(Y)Y(J)}),this}function dU1(){if(this._readableState)this._readabl
Line truncated
|
||||
%s`,A,A,O,U);var T=O.type==="*"?Fb:O.type==="?"?Lb:"\\"+O.type;Q=!0,U=U.slice(0,O.reStart)+T+"\\("+A}if(V(),J)U+="\\\\";var B=!1;switch(U.charAt(0)){case"[":case".":case"(":B=!0}for(var j=K.length-1;j>-1;j--){var C=K[j],b=U.slice(0,C.reStart),k=U.slice(C.reStart,C.reEnd-8),h=U.slice(C.reEnd-8,C.reEnd),i=U.slice(C.reEnd);h+=i;var c=b.split("(").length-1,U0=i;for(F=0;F<c;F++)U0=U0.replace(/\)[+*?]?/,"");i=U0;var x="";if(i===""&&Y!==iD)x="$";var d=b+k+i+x+h;U=d}if(U!==""&&Q)U="(?=.)"+U;if(B)U=Z+U;if(Y===iD)return[U,Q];if(!Q)return HG1($);var t=z.nocase?"i":"";try{var $0=new RegExp("^"+U+"$",t)}catch(g){return new RegExp("$.")}return $0._glob=$,$0._src=U,$0}H$.makeRe=function($,Y){return new L6($,Y||{}).makeRe()};L6.prototype.makeRe=WG1;function WG1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var Y=this.options,z=Y.noglobstar?Fb:Y.dot?YG1:zG1,U=Y.nocase?"i":"",Q=$.map(function(J){return J.map(function(I){return I===hz?z:typeof I==="string"?XG1(I):I._src}).join("\\/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,U)}catch(J){this.regexp=!1}return this.regexp}H$.match=function($,Y,z){z=z||{};var U=new L6(Y,z);if($=$.filter(function(Q){return U.match(Q)}),U.options.nonull&&!$.length)$.push(Y);return $};L6.prototype.match=function(Y,z){if(typeof z>"u")z=this.partial;if(this.debug("match",Y,this.pattern),this.comment)return!1;if(this.empty)return Y==="";if(Y==="/"&&z)return!0;var U=this.options;if(FX.sep!=="/")Y=Y.split(FX.sep).join("/");Y=Y.split(eX0),this.debug(this.pattern,"split",Y);var Q=this.set;this.debug(this.pattern,"set",Q);var J,I;for(I=Y.length-1;I>=0;I--)if(J=Y[I],J)break;for(I=0;I<Q.length;I++){var K=Q[I],G=Y;if(U.matchBase&&K.length===1)G=[J];var W=this.matchOne(G,K,z);if(W){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};L6.prototype.matchOne=function($,Y,z){if(Y.indexOf(hz)!==-1)return this._matchGlobstar($,Y,z,0,0);return this._matchOne($,Y,z,0,0)};L6.prototype._matchGlobstar=function($,Y,z,U,Q){var J,I=-1;for(J=Q;J<Y.length;J++)if(Y[J]===hz){I=J;break}var K=-1;for(J=Y.length-1;J>=0;J--)if(Y[J]===hz){K=J;break}var G=Y.slice(Q,I),W=z?Y.slice(I+1):Y.slice(I+1,K),H=z?[]:Y.slice(K+1);if(G.length){var X=$.slice(U,U+G.length);if(!this._matchOne(X,G,z,0,0))return!1;U+=G.length}var Z=0;if(H.length){if(H.length+U>$.length)return!1;var q=$.length-H.length;if(this._matchOne($,H,z,q,0))Z=H.length;else{if($[$.length-1]!==""||U+H.length===$.length)return!1;if(q--,!this._matchOne($,H,z,q,0))return!1;Z=H.length+1}}if(!W.length){var V=!!Z;for(J=U;J<$.length-Z;J++){var F=String($[J]);if(V=!0,F==="."||F===".."||!this.options.dot&&F.charAt(0)===".")return!1}return z||V}var M=[[[],0]],w=M[0],O=0,D=[0];for(var N=0;N<W.length;N++){var A=W[N];if(A===hz)D.push(O),w=[[],0],M.push(w);else w[0].push(A),O++}var T=M.length-1,B=$.length-Z;for(var j=0;j<M.length;j++)M[j][1]=B-(D[T--]+M[j][0].length);return!!this._matchGlobStarBodySections($,M,U,0,z,0,!!Z)};L6.prototype._matchGlobStarBodySections=function($,Y,z,U,Q,J,I){var K=Y[U];if(!K){for(var G=z;G<$.length;G++){I=!0;var W=$[G];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1}return I}var H=K[0],X=K[1];while(z<=X){var Z=this._matchOne($.slice(0,z+H.length),H,Q,z,0);if(Z&&J<this.maxGlobstarRecursion){var q=this._matchGlobStarBodySections($,Y,z+H.length,U+1,Q,J+1,I);if(q!==!1)return q}var W=$[z];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1;z++}return Q||null};L6.prototype._matchOne=function($,Y,z,U,Q){var J,I,K,G;for(J=U,I=Q,K=$.length,G=Y.length;J<K&&I<G;J++,I++){this.debug("matchOne loop");var W=Y[I],H=$[J];if(this.debug(Y,W,H),W===!1||W===hz)return!1;var X;if(typeof W==="string")X=H===W,this.debug("string match",W,H,X);else X=H.match(W),this.debug("pattern match",W,H,X);if(!X)return!1}if(J===K&&I===G)return!0;else if(J===K)return z;else if(I===G)return J===K-1&&$[J]==="";throw Error("wtf?")};function HG1($){return $.replace(/\\(.)/g,"$1")}function XG1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var dD=E((So1,pD)=>{function zZ0($){return $.charAt(0)==="/"}function UZ0($){var Y=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=Y.exec($),U=z[1]||"",Q=Boolean(U&&U.charAt(1)!==":");return Boolean(z[2]||Q)}pD.exports=process.platform==="win32"?UZ0:zZ0;pD.exports.posix=zZ0;pD.exports.win32=UZ0});var Mb=E((DG1)=>{DG1.setopts=wG1;DG1.ownProp=QZ0;DG1.makeAbs=wX;DG1.finish=MG1;DG1.mark=OG1;DG1.isIgnored=IZ0;DG1.childrenIgnored=NG1;function QZ0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}var ZG1=I0("fs"),LI=I0("path"),qG1=nD(),JZ0=dD(),wb=qG1.Minimatch;function VG1($,Y){return $.localeCompare(Y,"en")}function LG1($,Y){if($.ignore=Y.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(FG1)}function FG1($){var Y=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");Y=new wb(z,{dot:!0})}return{ma
Line truncated
|
||||
*/HH0.exports=function($,Y){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var U="";if(z>4&&$[3]==="\\"){var Q=$[2];if((Q==="?"||Q===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var J=$.split(/[/\\]+/);if(Y!==!1&&J[J.length-1]==="")J.pop();return U+J.join("/")}});var _u=E((qo1,wH0)=>{var ZH0=9007199254740991,OU1="[object Arguments]",NU1="[object Function]",DU1="[object GeneratorFunction]",BU1=/^(?:0|[1-9]\d*)$/;function qH0($,Y,z){switch(z.length){case 0:return $.call(Y);case 1:return $.call(Y,z[0]);case 2:return $.call(Y,z[0],z[1]);case 3:return $.call(Y,z[0],z[1],z[2])}return $.apply(Y,z)}function PU1($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}var zX=Object.prototype,UX=zX.hasOwnProperty,VH0=zX.toString,AU1=zX.propertyIsEnumerable,XH0=Math.max;function TU1($,Y){var z=yU1($)||gU1($)?PU1($.length,String):[],U=z.length,Q=!!U;for(var J in $)if((Y||UX.call($,J))&&!(Q&&(J=="length"||FH0(J,U))))z.push(J);return z}function jU1($,Y,z,U){if($===void 0||Eu($,zX[z])&&!UX.call(U,z))return Y;return $}function EU1($,Y,z){var U=$[Y];if(!(UX.call($,Y)&&Eu(U,z))||z===void 0&&!(Y in $))$[Y]=z}function CU1($){if(!Ru($))return SU1($);var Y=hU1($),z=[];for(var U in $)if(!(U=="constructor"&&(Y||!UX.call($,U))))z.push(U);return z}function LH0($,Y){return Y=XH0(Y===void 0?$.length-1:Y,0),function(){var z=arguments,U=-1,Q=XH0(z.length-Y,0),J=Array(Q);while(++U<Q)J[U]=z[Y+U];U=-1;var I=Array(Y+1);while(++U<Y)I[U]=z[U];return I[Y]=J,qH0($,this,I)}}function RU1($,Y,z,U){z||(z={});var Q=-1,J=Y.length;while(++Q<J){var I=Y[Q],K=U?U(z[I],$[I],I,z,$):void 0;EU1(z,I,K===void 0?$[I]:K)}return z}function _U1($){return LH0(function(Y,z){var U=-1,Q=z.length,J=Q>1?z[Q-1]:void 0,I=Q>2?z[2]:void 0;if(J=$.length>3&&typeof J=="function"?(Q--,J):void 0,I&&vU1(z[0],z[1],I))J=Q<3?void 0:J,Q=1;Y=Object(Y);while(++U<Q){var K=z[U];if(K)$(Y,K,U,J)}return Y})}function FH0($,Y){return Y=Y==null?ZH0:Y,!!Y&&(typeof $=="number"||BU1.test($))&&($>-1&&$%1==0&&$<Y)}function vU1($,Y,z){if(!Ru(z))return!1;var U=typeof Y;if(U=="number"?Cu(z)&&FH0(Y,z.length):U=="string"&&(Y in z))return Eu(z[Y],$);return!1}function hU1($){var Y=$&&$.constructor,z=typeof Y=="function"&&Y.prototype||zX;return $===z}function SU1($){var Y=[];if($!=null)for(var z in Object($))Y.push(z);return Y}function Eu($,Y){return $===Y||$!==$&&Y!==Y}function gU1($){return kU1($)&&UX.call($,"callee")&&(!AU1.call($,"callee")||VH0.call($)==OU1)}var yU1=Array.isArray;function Cu($){return $!=null&&fU1($.length)&&!xU1($)}function kU1($){return uU1($)&&Cu($)}function xU1($){var Y=Ru($)?VH0.call($):"";return Y==NU1||Y==DU1}function fU1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=ZH0}function Ru($){var Y=typeof $;return!!$&&(Y=="object"||Y=="function")}function uU1($){return!!$&&typeof $=="object"}var bU1=_U1(function($,Y,z,U){RU1(Y,cU1(Y),$,U)}),iU1=LH0(function($){return $.push(void 0,jU1),qH0(bU1,void 0,$)});function cU1($){return Cu($)?TU1($,!0):CU1($)}wH0.exports=iU1});var OH0=E((Vo1,vu)=>{function nU1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var MH0=K6().Buffer,QX=I0("util");function pU1($,Y,z){$.copy(Y,z)}vu.exports=function(){function $(){nU1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,Q=""+U.data;while(U=U.next)Q+=z+U.data;return Q},$.prototype.concat=function(z){if(this.length===0)return MH0.alloc(0);var U=MH0.allocUnsafe(z>>>0),Q=this.head,J=0;while(Q)pU1(Q.data,U,J),J+=Q.data.length,Q=Q.next;return U},$}();if(QX&&QX.inspect&&QX.inspect.custom)vu.exports.prototype[QX.inspect.custom]=function(){var $=QX.inspect({length:this.length});return this.constructor.name+" "+$}});var hu=E((Lo1,NH0)=>{var TD=I6();function dU1($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(U||Q){if(Y)Y($);else if($){if(!this._writableState)TD.nextTick(jD,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,TD.nextTick(jD,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!Y&&J){if(!z._writableState)TD.nextTick(jD,z,J);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,TD.nextTick(jD,z,J)}else if(Y)Y(J)}),this}function mU1(){if(this._readableState)this._readabl
Line truncated
|
||||
%s`,A,A,O,U);var T=O.type==="*"?Fb:O.type==="?"?Lb:"\\"+O.type;Q=!0,U=U.slice(0,O.reStart)+T+"\\("+A}if(V(),J)U+="\\\\";var B=!1;switch(U.charAt(0)){case"[":case".":case"(":B=!0}for(var j=K.length-1;j>-1;j--){var C=K[j],b=U.slice(0,C.reStart),k=U.slice(C.reStart,C.reEnd-8),h=U.slice(C.reEnd-8,C.reEnd),i=U.slice(C.reEnd);h+=i;var c=b.split("(").length-1,U0=i;for(F=0;F<c;F++)U0=U0.replace(/\)[+*?]?/,"");i=U0;var x="";if(i===""&&Y!==cD)x="$";var d=b+k+i+x+h;U=d}if(U!==""&&Q)U="(?=.)"+U;if(B)U=Z+U;if(Y===cD)return[U,Q];if(!Q)return XG1($);var t=z.nocase?"i":"";try{var $0=new RegExp("^"+U+"$",t)}catch(g){return new RegExp("$.")}return $0._glob=$,$0._src=U,$0}H$.makeRe=function($,Y){return new L6($,Y||{}).makeRe()};L6.prototype.makeRe=HG1;function HG1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var Y=this.options,z=Y.noglobstar?Fb:Y.dot?zG1:UG1,U=Y.nocase?"i":"",Q=$.map(function(J){return J.map(function(I){return I===hz?z:typeof I==="string"?ZG1(I):I._src}).join("\\/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,U)}catch(J){this.regexp=!1}return this.regexp}H$.match=function($,Y,z){z=z||{};var U=new L6(Y,z);if($=$.filter(function(Q){return U.match(Q)}),U.options.nonull&&!$.length)$.push(Y);return $};L6.prototype.match=function(Y,z){if(typeof z>"u")z=this.partial;if(this.debug("match",Y,this.pattern),this.comment)return!1;if(this.empty)return Y==="";if(Y==="/"&&z)return!0;var U=this.options;if(FX.sep!=="/")Y=Y.split(FX.sep).join("/");Y=Y.split(eX0),this.debug(this.pattern,"split",Y);var Q=this.set;this.debug(this.pattern,"set",Q);var J,I;for(I=Y.length-1;I>=0;I--)if(J=Y[I],J)break;for(I=0;I<Q.length;I++){var K=Q[I],G=Y;if(U.matchBase&&K.length===1)G=[J];var W=this.matchOne(G,K,z);if(W){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};L6.prototype.matchOne=function($,Y,z){if(Y.indexOf(hz)!==-1)return this._matchGlobstar($,Y,z,0,0);return this._matchOne($,Y,z,0,0)};L6.prototype._matchGlobstar=function($,Y,z,U,Q){var J,I=-1;for(J=Q;J<Y.length;J++)if(Y[J]===hz){I=J;break}var K=-1;for(J=Y.length-1;J>=0;J--)if(Y[J]===hz){K=J;break}var G=Y.slice(Q,I),W=z?Y.slice(I+1):Y.slice(I+1,K),H=z?[]:Y.slice(K+1);if(G.length){var X=$.slice(U,U+G.length);if(!this._matchOne(X,G,z,0,0))return!1;U+=G.length}var Z=0;if(H.length){if(H.length+U>$.length)return!1;var q=$.length-H.length;if(this._matchOne($,H,z,q,0))Z=H.length;else{if($[$.length-1]!==""||U+H.length===$.length)return!1;if(q--,!this._matchOne($,H,z,q,0))return!1;Z=H.length+1}}if(!W.length){var V=!!Z;for(J=U;J<$.length-Z;J++){var F=String($[J]);if(V=!0,F==="."||F===".."||!this.options.dot&&F.charAt(0)===".")return!1}return z||V}var M=[[[],0]],w=M[0],O=0,D=[0];for(var N=0;N<W.length;N++){var A=W[N];if(A===hz)D.push(O),w=[[],0],M.push(w);else w[0].push(A),O++}var T=M.length-1,B=$.length-Z;for(var j=0;j<M.length;j++)M[j][1]=B-(D[T--]+M[j][0].length);return!!this._matchGlobStarBodySections($,M,U,0,z,0,!!Z)};L6.prototype._matchGlobStarBodySections=function($,Y,z,U,Q,J,I){var K=Y[U];if(!K){for(var G=z;G<$.length;G++){I=!0;var W=$[G];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1}return I}var H=K[0],X=K[1];while(z<=X){var Z=this._matchOne($.slice(0,z+H.length),H,Q,z,0);if(Z&&J<this.maxGlobstarRecursion){var q=this._matchGlobStarBodySections($,Y,z+H.length,U+1,Q,J+1,I);if(q!==!1)return q}var W=$[z];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1;z++}return Q||null};L6.prototype._matchOne=function($,Y,z,U,Q){var J,I,K,G;for(J=U,I=Q,K=$.length,G=Y.length;J<K&&I<G;J++,I++){this.debug("matchOne loop");var W=Y[I],H=$[J];if(this.debug(Y,W,H),W===!1||W===hz)return!1;var X;if(typeof W==="string")X=H===W,this.debug("string match",W,H,X);else X=H.match(W),this.debug("pattern match",W,H,X);if(!X)return!1}if(J===K&&I===G)return!0;else if(J===K)return z;else if(I===G)return J===K-1&&$[J]==="";throw Error("wtf?")};function XG1($){return $.replace(/\\(.)/g,"$1")}function ZG1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var mD=E((yo1,dD)=>{function zZ0($){return $.charAt(0)==="/"}function UZ0($){var Y=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=Y.exec($),U=z[1]||"",Q=Boolean(U&&U.charAt(1)!==":");return Boolean(z[2]||Q)}dD.exports=process.platform==="win32"?UZ0:zZ0;dD.exports.posix=zZ0;dD.exports.win32=UZ0});var Mb=E((BG1)=>{BG1.setopts=MG1;BG1.ownProp=QZ0;BG1.makeAbs=wX;BG1.finish=OG1;BG1.mark=NG1;BG1.isIgnored=IZ0;BG1.childrenIgnored=DG1;function QZ0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}var qG1=I0("fs"),LI=I0("path"),VG1=pD(),JZ0=mD(),wb=VG1.Minimatch;function LG1($,Y){return $.localeCompare(Y,"en")}function FG1($,Y){if($.ignore=Y.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(wG1)}function wG1($){var Y=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");Y=new wb(z,{dot:!0})}return{ma
Line truncated
|
||||
See: https://github.com/isaacs/node-glob/issues/167`);return new T6($,Y).found}function T6($,Y){if(!$)throw Error("must provide pattern");if(typeof Y==="function"||arguments.length===3)throw TypeError(`callback provided to sync glob
|
||||
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))return new T6($,Y);if(_G1(this,$,Y),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var U=0;U<z;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}T6.prototype._finish=function(){if(GZ0.ok(this instanceof T6),this.realpath){var $=this;this.matches.forEach(function(Y,z){var U=$.matches[z]=Object.create(null);for(var Q in Y)try{Q=$._makeAbs(Q);var J=RG1.realpathSync(Q,$.realpathCache);U[J]=!0}catch(I){if(I.syscall==="stat")U[$._makeAbs(Q)]=!0;else throw I}})}Sz.finish(this)};T6.prototype._process=function($,Y,z){GZ0.ok(this instanceof T6);var U=0;while(typeof $[U]==="string")U++;var Q;switch(U){case $.length:this._processSimple($.join("/"),Y);return;case 0:Q=null;break;default:Q=$.slice(0,U).join("/");break}var J=$.slice(U),I;if(Q===null)I=".";else if(mD(Q)||mD($.map(function(W){return typeof W==="string"?W:"[*]"}).join("/"))){if(!Q||!mD(Q))Q="/"+Q;I=Q}else I=Q;var K=this._makeAbs(I);if(vG1(this,I))return;var G=J[0]===KZ0.GLOBSTAR;if(G)this._processGlobStar(Q,I,K,J,Y,z);else this._processReaddir(Q,I,K,J,Y,z)};T6.prototype._processReaddir=function($,Y,z,U,Q,J){var I=this._readdir(z,J);if(!I)return;var K=U[0],G=!!this.minimatch.negate,W=K._glob,H=this.dot||W.charAt(0)===".",X=[];for(var Z=0;Z<I.length;Z++){var q=I[Z];if(q.charAt(0)!=="."||H){var V;if(G&&!$)V=!q.match(K);else V=q.match(K);if(V)X.push(q)}}var F=X.length;if(F===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[Q])this.matches[Q]=Object.create(null);for(var Z=0;Z<F;Z++){var q=X[Z];if($)if($.slice(-1)!=="/")q=$+"/"+q;else q=$+q;if(q.charAt(0)==="/"&&!this.nomount)q=Ob.join(this.root,q);this._emitMatch(Q,q)}return}U.shift();for(var Z=0;Z<F;Z++){var q=X[Z],M;if($)M=[$,q];else M=[q];this._process(M.concat(U),Q,J)}};T6.prototype._emitMatch=function($,Y){if(hG1(this,Y))return;var z=this._makeAbs(Y);if(this.mark)Y=this._mark(Y);if(this.absolute)Y=z;if(this.matches[$][Y])return;if(this.nodir){var U=this.cache[z];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][Y]=!0,this.stat)this._stat(Y)};T6.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var Y,z,U;try{z=this.fs.lstatSync($)}catch(J){if(J.code==="ENOENT")return null}var Q=z&&z.isSymbolicLink();if(this.symlinks[$]=Q,!Q&&z&&!z.isDirectory())this.cache[$]="FILE";else Y=this._readdir($,!1);return Y};T6.prototype._readdir=function($,Y){var z;if(Y&&!Nb(this.symlinks,$))return this._readdirInGlobStar($);if(Nb(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(Q){return this._readdirError($,Q),null}};T6.prototype._readdirEntries=function($,Y){if(!this.mark&&!this.stat)for(var z=0;z<Y.length;z++){var U=Y[z];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=Y,Y};T6.prototype._readdirError=function($,Y){switch(Y.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var U=Error(Y.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=Y.code,U}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw Y;if(!this.silent)console.error("glob error",Y);break}};T6.prototype._processGlobStar=function($,Y,z,U,Q,J){var I=this._readdir(z,J);if(!I)return;var K=U.slice(1),G=$?[$]:[],W=G.concat(K);this._process(W,Q,!1);var H=I.length,X=this.symlinks[z];if(X&&J)return;for(var Z=0;Z<H;Z++){var q=I[Z];if(q.charAt(0)==="."&&!this.dot)continue;var V=G.concat(I[Z],K);this._process(V,Q,!0);var F=G.concat(I[Z],U);this._process(F,Q,!0)}};T6.prototype._processSimple=function($,Y){var z=this._stat($);if(!this.matches[Y])this.matches[Y]=Object.create(null);if(!z)return;if($&&mD($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=Ob.join(this.root,$);else if($=Ob.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(Y,$)};T6.prototype._stat=function($){var Y=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&Nb(this.cache,Y)){var I=this.cache[Y];if(Array.isArray(I))I="DIR";if(!z||I==="DIR")return I;if(z&&I==="FILE")return!1}var U,Q=this.statCache[Y];if(!Q){var J;try{J=this.fs.lstatSync(Y)}catch(K){if(K&&(K.code==="ENOENT"||K.code==="ENOTDIR"))return this.statCache[Y]=!1,!1}if(J&&J.isSymbolicLink())try{Q=this.fs.statSync(Y)}catch(K){Q=J}else Q=J}this.statCache[Y]=Q;var I=!0;if(Q)I=Q.isDirectory()?"DIR":"FILE";if(this.cache[Y]=this.cache[Y]||I,z&&I==="FILE")return!1;return I};T6.prototype._mark=function($){return Sz.mark(this,$)};T6.prototype._makeAbs=function($){return Sz.makeAbs(this,$)}});var Db=E((uo1,qZ0)=>{qZ0.exports=ZZ0;function ZZ0($,Y){if($&&Y)return ZZ0($)(Y);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){z[U]=$[U]}),z;f
Line truncated
|
||||
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))return new T6($,Y);if(vG1(this,$,Y),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var U=0;U<z;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}T6.prototype._finish=function(){if(GZ0.ok(this instanceof T6),this.realpath){var $=this;this.matches.forEach(function(Y,z){var U=$.matches[z]=Object.create(null);for(var Q in Y)try{Q=$._makeAbs(Q);var J=_G1.realpathSync(Q,$.realpathCache);U[J]=!0}catch(I){if(I.syscall==="stat")U[$._makeAbs(Q)]=!0;else throw I}})}Sz.finish(this)};T6.prototype._process=function($,Y,z){GZ0.ok(this instanceof T6);var U=0;while(typeof $[U]==="string")U++;var Q;switch(U){case $.length:this._processSimple($.join("/"),Y);return;case 0:Q=null;break;default:Q=$.slice(0,U).join("/");break}var J=$.slice(U),I;if(Q===null)I=".";else if(lD(Q)||lD($.map(function(W){return typeof W==="string"?W:"[*]"}).join("/"))){if(!Q||!lD(Q))Q="/"+Q;I=Q}else I=Q;var K=this._makeAbs(I);if(hG1(this,I))return;var G=J[0]===KZ0.GLOBSTAR;if(G)this._processGlobStar(Q,I,K,J,Y,z);else this._processReaddir(Q,I,K,J,Y,z)};T6.prototype._processReaddir=function($,Y,z,U,Q,J){var I=this._readdir(z,J);if(!I)return;var K=U[0],G=!!this.minimatch.negate,W=K._glob,H=this.dot||W.charAt(0)===".",X=[];for(var Z=0;Z<I.length;Z++){var q=I[Z];if(q.charAt(0)!=="."||H){var V;if(G&&!$)V=!q.match(K);else V=q.match(K);if(V)X.push(q)}}var F=X.length;if(F===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[Q])this.matches[Q]=Object.create(null);for(var Z=0;Z<F;Z++){var q=X[Z];if($)if($.slice(-1)!=="/")q=$+"/"+q;else q=$+q;if(q.charAt(0)==="/"&&!this.nomount)q=Ob.join(this.root,q);this._emitMatch(Q,q)}return}U.shift();for(var Z=0;Z<F;Z++){var q=X[Z],M;if($)M=[$,q];else M=[q];this._process(M.concat(U),Q,J)}};T6.prototype._emitMatch=function($,Y){if(SG1(this,Y))return;var z=this._makeAbs(Y);if(this.mark)Y=this._mark(Y);if(this.absolute)Y=z;if(this.matches[$][Y])return;if(this.nodir){var U=this.cache[z];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][Y]=!0,this.stat)this._stat(Y)};T6.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var Y,z,U;try{z=this.fs.lstatSync($)}catch(J){if(J.code==="ENOENT")return null}var Q=z&&z.isSymbolicLink();if(this.symlinks[$]=Q,!Q&&z&&!z.isDirectory())this.cache[$]="FILE";else Y=this._readdir($,!1);return Y};T6.prototype._readdir=function($,Y){var z;if(Y&&!Nb(this.symlinks,$))return this._readdirInGlobStar($);if(Nb(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(Q){return this._readdirError($,Q),null}};T6.prototype._readdirEntries=function($,Y){if(!this.mark&&!this.stat)for(var z=0;z<Y.length;z++){var U=Y[z];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=Y,Y};T6.prototype._readdirError=function($,Y){switch(Y.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var U=Error(Y.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=Y.code,U}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw Y;if(!this.silent)console.error("glob error",Y);break}};T6.prototype._processGlobStar=function($,Y,z,U,Q,J){var I=this._readdir(z,J);if(!I)return;var K=U.slice(1),G=$?[$]:[],W=G.concat(K);this._process(W,Q,!1);var H=I.length,X=this.symlinks[z];if(X&&J)return;for(var Z=0;Z<H;Z++){var q=I[Z];if(q.charAt(0)==="."&&!this.dot)continue;var V=G.concat(I[Z],K);this._process(V,Q,!0);var F=G.concat(I[Z],U);this._process(F,Q,!0)}};T6.prototype._processSimple=function($,Y){var z=this._stat($);if(!this.matches[Y])this.matches[Y]=Object.create(null);if(!z)return;if($&&lD($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=Ob.join(this.root,$);else if($=Ob.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(Y,$)};T6.prototype._stat=function($){var Y=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&Nb(this.cache,Y)){var I=this.cache[Y];if(Array.isArray(I))I="DIR";if(!z||I==="DIR")return I;if(z&&I==="FILE")return!1}var U,Q=this.statCache[Y];if(!Q){var J;try{J=this.fs.lstatSync(Y)}catch(K){if(K&&(K.code==="ENOENT"||K.code==="ENOTDIR"))return this.statCache[Y]=!1,!1}if(J&&J.isSymbolicLink())try{Q=this.fs.statSync(Y)}catch(K){Q=J}else Q=J}this.statCache[Y]=Q;var I=!0;if(Q)I=Q.isDirectory()?"DIR":"FILE";if(this.cache[Y]=this.cache[Y]||I,z&&I==="FILE")return!1;return I};T6.prototype._mark=function($){return Sz.mark(this,$)};T6.prototype._makeAbs=function($){return Sz.makeAbs(this,$)}});var Db=E((io1,qZ0)=>{qZ0.exports=ZZ0;function ZZ0($,Y){if($&&Y)return ZZ0($)(Y);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){z[U]=$[U]}),z;f
Line truncated
|
||||
`);if($.linkname)Y+=Oi(" linkpath="+$.linkname+`
|
||||
`);var z=$.pax;if(z)for(var U in z)Y+=Oi(" "+U+"="+z[U]+`
|
||||
`);return Buffer.from(Y)};cX1.decodePax=function($){var Y={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var U=parseInt($.slice(0,z).toString(),10);if(!U)return Y;var Q=$.slice(z+1,U-1).toString(),J=Q.indexOf("=");if(J===-1)return Y;Y[Q.slice(0,J)]=Q.slice(J+1),$=$.slice(U)}return Y};cX1.encode=function($){var Y=vX1(512),z=$.name,U="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var Q=z.indexOf("/");if(Q===-1)return null;U+=U?"/"+z.slice(0,Q):z.slice(0,Q),z=z.slice(Q+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(Y.write(z),Y.write(D2($.mode&xX1,6),100),Y.write(D2($.uid,6),108),Y.write(D2($.gid,6),116),Y.write(D2($.size,11),124),Y.write(D2($.mtime.getTime()/1000|0,11),136),Y[156]=EV0+bX1($.type),$.linkname)Y.write($.linkname,157);if(CV0.copy(Y,SX),gX1.copy(Y,Ni),$.uname)Y.write($.uname,265);if($.gname)Y.write($.gname,297);if(Y.write(D2($.devmajor||0,6),329),Y.write(D2($.devminor||0,6),337),U)Y.write(U,345);return Y.write(D2(_V0(Y),6),148),Y};cX1.decode=function($,Y,z){var U=$[156]===0?0:$[156]-EV0,Q=AI($,0,100,Y),J=B2($,100,8),I=B2($,108,8),K=B2($,116,8),G=B2($,124,12),W=B2($,136,12),H=uX1(U),X=$[157]===0?null:AI($,157,100,Y),Z=AI($,265,32),q=AI($,297,32),V=B2($,329,8),F=B2($,337,8),M=_V0($);if(M===256)return null;if(M!==B2($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(CV0.compare($,SX,SX+6)===0){if($[345])Q=AI($,345,155,Y)+"/"+Q}else if(yX1.compare($,SX,SX+6)===0&&kX1.compare($,Ni,Ni+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(U===0&&Q&&Q[Q.length-1]==="/")U=5;return{name:Q,mode:J,uid:I,gid:K,size:G,mtime:new Date(1000*W),type:H,linkname:X,uname:Z,gname:q,devmajor:V,devminor:F}}});var xV0=E((Sr1,kV0)=>{var hV0=I0("util"),oX1=jV0(),gX=Di(),SV0=E8().Writable,gV0=E8().PassThrough,yV0=function(){},vV0=function($){return $&=511,$&&512-$},rX1=function($,Y){var z=new ZB($,Y);return z.end(),z},sX1=function($,Y){if(Y.path)$.name=Y.path;if(Y.linkpath)$.linkname=Y.linkpath;if(Y.size)$.size=parseInt(Y.size,10);return $.pax=Y,$},ZB=function($,Y){this._parent=$,this.offset=Y,gV0.call(this,{autoDestroy:!1})};hV0.inherits(ZB,gV0);ZB.prototype.destroy=function($){this._parent.destroy($)};var B7=function($){if(!(this instanceof B7))return new B7($);SV0.call(this,$),$=$||{},this._offset=0,this._buffer=oX1(),this._missing=0,this._partial=!1,this._onparse=yV0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var Y=this,z=Y._buffer,U=function(){Y._continue()},Q=function(Z){if(Y._locked=!1,Z)return Y.destroy(Z);if(!Y._stream)U()},J=function(){Y._stream=null;var Z=vV0(Y._header.size);if(Z)Y._parse(Z,I);else Y._parse(512,X);if(!Y._locked)U()},I=function(){Y._buffer.consume(vV0(Y._header.size)),Y._parse(512,X),U()},K=function(){var Z=Y._header.size;Y._paxGlobal=gX.decodePax(z.slice(0,Z)),z.consume(Z),J()},G=function(){var Z=Y._header.size;if(Y._pax=gX.decodePax(z.slice(0,Z)),Y._paxGlobal)Y._pax=Object.assign({},Y._paxGlobal,Y._pax);z.consume(Z),J()},W=function(){var Z=Y._header.size;this._gnuLongPath=gX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),J()},H=function(){var Z=Y._header.size;this._gnuLongLinkPath=gX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),J()},X=function(){var Z=Y._offset,q;try{q=Y._header=gX.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(V){Y.emit("error",V)}if(z.consume(512),!q){Y._parse(512,X),U();return}if(q.type==="gnu-long-path"){Y._parse(q.size,W),U();return}if(q.type==="gnu-long-link-path"){Y._parse(q.size,H),U();return}if(q.type==="pax-global-header"){Y._parse(q.size,K),U();return}if(q.type==="pax-header"){Y._parse(q.size,G),U();return}if(Y._gnuLongPath)q.name=Y._gnuLongPath,Y._gnuLongPath=null;if(Y._gnuLongLinkPath)q.linkname=Y._gnuLongLinkPath,Y._gnuLongLinkPath=null;if(Y._pax)Y._header=q=sX1(q,Y._pax),Y._pax=null;if(Y._locked=!0,!q.size||q.type==="directory"){Y._parse(512,X),Y.emit("entry",q,rX1(Y,Z),Q);return}Y._stream=new ZB(Y,Z),Y.emit("entry",q,Y._stream,Q),Y._parse(q.size,J),U()};this._onheader=X,this._parse(512,X)};hV0.inherits(B7,SV0);B7.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};B7.prototype._parse=function($,Y){if(this._destroyed)return;if(this._offset+=$,this._missing=$,Y===this._onheader)this._partial=!1;this._onparse=Y};B7.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=yV0,this._overflow)this._write(this._overflow,void 0,$);else $()};B7.prototype._write=function($,Y,z){if(this._destroyed)return;var U=this._stream,Q=this._buffer,J=this._missing;if($.length)this._partial=!0;if($.length<J)
Line truncated
|
||||
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let Y=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${LZ1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${$.Target}"/>`);return Y}_writeClose(){this.stream.write("</Relationships>")}}WL0.exports=GL0});var LL0=E((nr1,VL0)=>{var XL0=m6(),ZL0=e3(),wZ1=i4(),MZ1=gx(),OZ1=kx();class qL0{constructor($,Y,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=Y}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:ZL0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let Y={Type:ZL0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(Y)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,Y){let z=new MZ1,U=new XL0;z.render(U,$),this.commentsStream.write(U.xml);let Q=new OZ1,J=new XL0;Q.render(J,$,Y),this.vmlStream.write(J.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((Y)=>{Y.refAddress=wZ1.decodeAddress(Y.ref)}),$.forEach((Y)=>{this._writeComment(Y,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}VL0.exports=qL0});var DL0=E((pr1,NL0)=>{var NZ1=Y6(),DZ1=e3(),Ai=i4(),FL0=eS(),wL0=e9(),BZ1=qk(),ML0=wM(),Ti=OM(),PZ1=HL0(),AZ1=LL0(),TZ1=aS(),y6=new BZ1,ji=s3(),jZ1=Gx(),EZ1=Wx(),CZ1=Hx(),RZ1=Qx(),_Z1=zx(),vZ1=Jx(),hZ1=Xx(),SZ1=Zx(),gZ1=qx(),yZ1=Vx(),kZ1=Lx(),xZ1=Fx(),fZ1=Dx(),uZ1=Mx(),bZ1=wx(),k6={dataValidations:new jZ1,sheetProperties:new EZ1,sheetFormatProperties:new CZ1,columns:new ji({tag:"cols",length:!1,childXform:new RZ1}),row:new _Z1,hyperlinks:new ji({tag:"hyperlinks",length:!1,childXform:new vZ1}),sheetViews:new ji({tag:"sheetViews",length:!1,childXform:new hZ1}),sheetProtection:new SZ1,pageMargins:new gZ1,pageSeteup:new yZ1,autoFilter:new kZ1,picture:new xZ1,conditionalFormattings:new fZ1,headerFooter:new uZ1,rowBreaks:new bZ1};class OL0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new PZ1($),this._sheetCommentsWriter=new AZ1(this,this._sheetRelsWriter,$),this._dimensions=new wL0,this._rowZero=1,this.committed=!1,this.dataValidations=new TZ1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get
Line truncated
|
||||
`);return Buffer.from(Y)};nX1.decodePax=function($){var Y={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var U=parseInt($.slice(0,z).toString(),10);if(!U)return Y;var Q=$.slice(z+1,U-1).toString(),J=Q.indexOf("=");if(J===-1)return Y;Y[Q.slice(0,J)]=Q.slice(J+1),$=$.slice(U)}return Y};nX1.encode=function($){var Y=hX1(512),z=$.name,U="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var Q=z.indexOf("/");if(Q===-1)return null;U+=U?"/"+z.slice(0,Q):z.slice(0,Q),z=z.slice(Q+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(Y.write(z),Y.write(D2($.mode&fX1,6),100),Y.write(D2($.uid,6),108),Y.write(D2($.gid,6),116),Y.write(D2($.size,11),124),Y.write(D2($.mtime.getTime()/1000|0,11),136),Y[156]=EV0+iX1($.type),$.linkname)Y.write($.linkname,157);if(CV0.copy(Y,SX),yX1.copy(Y,Ni),$.uname)Y.write($.uname,265);if($.gname)Y.write($.gname,297);if(Y.write(D2($.devmajor||0,6),329),Y.write(D2($.devminor||0,6),337),U)Y.write(U,345);return Y.write(D2(_V0(Y),6),148),Y};nX1.decode=function($,Y,z){var U=$[156]===0?0:$[156]-EV0,Q=AI($,0,100,Y),J=B2($,100,8),I=B2($,108,8),K=B2($,116,8),G=B2($,124,12),W=B2($,136,12),H=bX1(U),X=$[157]===0?null:AI($,157,100,Y),Z=AI($,265,32),q=AI($,297,32),V=B2($,329,8),F=B2($,337,8),M=_V0($);if(M===256)return null;if(M!==B2($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(CV0.compare($,SX,SX+6)===0){if($[345])Q=AI($,345,155,Y)+"/"+Q}else if(kX1.compare($,SX,SX+6)===0&&xX1.compare($,Ni,Ni+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(U===0&&Q&&Q[Q.length-1]==="/")U=5;return{name:Q,mode:J,uid:I,gid:K,size:G,mtime:new Date(1000*W),type:H,linkname:X,uname:Z,gname:q,devmajor:V,devminor:F}}});var xV0=E((yr1,kV0)=>{var hV0=I0("util"),rX1=jV0(),gX=Di(),SV0=E8().Writable,gV0=E8().PassThrough,yV0=function(){},vV0=function($){return $&=511,$&&512-$},sX1=function($,Y){var z=new qB($,Y);return z.end(),z},aX1=function($,Y){if(Y.path)$.name=Y.path;if(Y.linkpath)$.linkname=Y.linkpath;if(Y.size)$.size=parseInt(Y.size,10);return $.pax=Y,$},qB=function($,Y){this._parent=$,this.offset=Y,gV0.call(this,{autoDestroy:!1})};hV0.inherits(qB,gV0);qB.prototype.destroy=function($){this._parent.destroy($)};var B7=function($){if(!(this instanceof B7))return new B7($);SV0.call(this,$),$=$||{},this._offset=0,this._buffer=rX1(),this._missing=0,this._partial=!1,this._onparse=yV0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var Y=this,z=Y._buffer,U=function(){Y._continue()},Q=function(Z){if(Y._locked=!1,Z)return Y.destroy(Z);if(!Y._stream)U()},J=function(){Y._stream=null;var Z=vV0(Y._header.size);if(Z)Y._parse(Z,I);else Y._parse(512,X);if(!Y._locked)U()},I=function(){Y._buffer.consume(vV0(Y._header.size)),Y._parse(512,X),U()},K=function(){var Z=Y._header.size;Y._paxGlobal=gX.decodePax(z.slice(0,Z)),z.consume(Z),J()},G=function(){var Z=Y._header.size;if(Y._pax=gX.decodePax(z.slice(0,Z)),Y._paxGlobal)Y._pax=Object.assign({},Y._paxGlobal,Y._pax);z.consume(Z),J()},W=function(){var Z=Y._header.size;this._gnuLongPath=gX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),J()},H=function(){var Z=Y._header.size;this._gnuLongLinkPath=gX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),J()},X=function(){var Z=Y._offset,q;try{q=Y._header=gX.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(V){Y.emit("error",V)}if(z.consume(512),!q){Y._parse(512,X),U();return}if(q.type==="gnu-long-path"){Y._parse(q.size,W),U();return}if(q.type==="gnu-long-link-path"){Y._parse(q.size,H),U();return}if(q.type==="pax-global-header"){Y._parse(q.size,K),U();return}if(q.type==="pax-header"){Y._parse(q.size,G),U();return}if(Y._gnuLongPath)q.name=Y._gnuLongPath,Y._gnuLongPath=null;if(Y._gnuLongLinkPath)q.linkname=Y._gnuLongLinkPath,Y._gnuLongLinkPath=null;if(Y._pax)Y._header=q=aX1(q,Y._pax),Y._pax=null;if(Y._locked=!0,!q.size||q.type==="directory"){Y._parse(512,X),Y.emit("entry",q,sX1(Y,Z),Q);return}Y._stream=new qB(Y,Z),Y.emit("entry",q,Y._stream,Q),Y._parse(q.size,J),U()};this._onheader=X,this._parse(512,X)};hV0.inherits(B7,SV0);B7.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};B7.prototype._parse=function($,Y){if(this._destroyed)return;if(this._offset+=$,this._missing=$,Y===this._onheader)this._partial=!1;this._onparse=Y};B7.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=yV0,this._overflow)this._write(this._overflow,void 0,$);else $()};B7.prototype._write=function($,Y,z){if(this._destroyed)return;var U=this._stream,Q=this._buffer,J=this._missing;if($.length)this._partial=!0;if($.length<J)
Line truncated
|
||||
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let Y=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${FZ1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${$.Target}"/>`);return Y}_writeClose(){this.stream.write("</Relationships>")}}WL0.exports=GL0});var LL0=E((dr1,VL0)=>{var XL0=m6(),ZL0=e3(),MZ1=i4(),OZ1=gx(),NZ1=kx();class qL0{constructor($,Y,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=Y}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:ZL0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let Y={Type:ZL0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(Y)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,Y){let z=new OZ1,U=new XL0;z.render(U,$),this.commentsStream.write(U.xml);let Q=new NZ1,J=new XL0;Q.render(J,$,Y),this.vmlStream.write(J.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((Y)=>{Y.refAddress=MZ1.decodeAddress(Y.ref)}),$.forEach((Y)=>{this._writeComment(Y,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}VL0.exports=qL0});var DL0=E((mr1,NL0)=>{var DZ1=Y6(),BZ1=e3(),Ai=i4(),FL0=eS(),wL0=e9(),PZ1=qk(),ML0=MM(),Ti=NM(),AZ1=HL0(),TZ1=LL0(),jZ1=aS(),y6=new PZ1,ji=s3(),EZ1=Gx(),CZ1=Wx(),RZ1=Hx(),_Z1=Qx(),vZ1=zx(),hZ1=Jx(),SZ1=Xx(),gZ1=Zx(),yZ1=qx(),kZ1=Vx(),xZ1=Lx(),fZ1=Fx(),uZ1=Dx(),bZ1=Mx(),iZ1=wx(),k6={dataValidations:new EZ1,sheetProperties:new CZ1,sheetFormatProperties:new RZ1,columns:new ji({tag:"cols",length:!1,childXform:new _Z1}),row:new vZ1,hyperlinks:new ji({tag:"hyperlinks",length:!1,childXform:new hZ1}),sheetViews:new ji({tag:"sheetViews",length:!1,childXform:new SZ1}),sheetProtection:new gZ1,pageMargins:new yZ1,pageSeteup:new kZ1,autoFilter:new xZ1,picture:new fZ1,conditionalFormattings:new uZ1,headerFooter:new bZ1,rowBreaks:new iZ1};class OL0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new AZ1($),this._sheetCommentsWriter=new TZ1(this,this._sheetRelsWriter,$),this._dimensions=new wL0,this._rowZero=1,this.committed=!1,this.dataValidations=new jZ1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)},pi=di.getNativePromise();if(di.isNode&&typeof MutationObserver>"u")mi=global.setImmediate,li=process.nextTick,dz=di.isRecentNode?function($){mi.call(global,$)}:function($){li.call(process,$)};else if(typeof pi==="function"&&typeof pi.resolve==="function")oi=pi.resolve(),dz=function($){oi.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))dz=function(){var $=document.createElement("div"),Y={attributes:!0},z=!1,U=document.createElement("div"),Q=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});Q.observe(U,Y);var J=function(){if(z)return;z=!0,U.classList.toggle("foo")};return function(K){var G=new MutationObserver(function(){G.disconnect(),K()});G.observe($,Y),J()}}();else if(typeof setImmediate<"u")dz=function($){setImmediate($)};else if(typeof setTimeout<"u")dz=function($){setTimeout($,0)};else dz=vq1;var mi,li,oi;$F0.exports=dz});var UF0=E((zs1,zF0)=>{function hq1($,Y,z,U,Q){for(var J=0;J<Q;++J)z[J+U]=$[J+Y],$[J+Y]=void 0}function T2($){this._capacity=$,this._length=0,this._front=0}T2.prototype._willBeOverCapacity=function($){return this._capacity<$};T2.prototype._pushOne=function($){var Y=this.length();this._checkCapacity(Y+1);var z=this._front+Y&this._capacity-1;this[z]=$,this._length=Y+1};T2.prototype.push=function($,Y,z){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(Y),this._pushOne(z);return}var Q=this._front+U-3;this._checkCapacity(U);var J=this._capacity-1;this[Q+0&J]=$,this[Q+1&J]=Y,this[Q+2&J]=z,this._length=U};T2.prototype.shift=function(){var $=this._front,Y=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,Y};T2.prototype.length=function(){return this._length};T2.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};T2.prototype._resizeTo=function($){var Y=this._capacity;this._capacity=$;var z=this._front,U=this._length,Q=z+U&Y-1;hq1(this,0,this,Y,Q)};zF0.exports=T2});var HF0=E((Us1,ri)=>{var GF0;try{throw Error()}catch($){GF0=$}var Sq1=YF0(),QF0=UF0(),WF0=F4();function x6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new QF0(16),this._normalQueue=new QF0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=Sq1}x6.prototype.setScheduler=function($){var Y=this._schedule;return this._schedule=$,this._customScheduler=!0,Y};x6.prototype.hasCustomScheduler=function(){return this._customScheduler};x6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};x6.prototype.disableTrampolineIfNecessary=function(){if(WF0.hasDevTools)this._trampolineEnabled=!1};x6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};x6.prototype.fatalError=function($,Y){if(Y)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
|
||||
`)},pi=di.getNativePromise();if(di.isNode&&typeof MutationObserver>"u")mi=global.setImmediate,li=process.nextTick,dz=di.isRecentNode?function($){mi.call(global,$)}:function($){li.call(process,$)};else if(typeof pi==="function"&&typeof pi.resolve==="function")oi=pi.resolve(),dz=function($){oi.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))dz=function(){var $=document.createElement("div"),Y={attributes:!0},z=!1,U=document.createElement("div"),Q=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});Q.observe(U,Y);var J=function(){if(z)return;z=!0,U.classList.toggle("foo")};return function(K){var G=new MutationObserver(function(){G.disconnect(),K()});G.observe($,Y),J()}}();else if(typeof setImmediate<"u")dz=function($){setImmediate($)};else if(typeof setTimeout<"u")dz=function($){setTimeout($,0)};else dz=hq1;var mi,li,oi;$F0.exports=dz});var UF0=E((Qs1,zF0)=>{function Sq1($,Y,z,U,Q){for(var J=0;J<Q;++J)z[J+U]=$[J+Y],$[J+Y]=void 0}function T2($){this._capacity=$,this._length=0,this._front=0}T2.prototype._willBeOverCapacity=function($){return this._capacity<$};T2.prototype._pushOne=function($){var Y=this.length();this._checkCapacity(Y+1);var z=this._front+Y&this._capacity-1;this[z]=$,this._length=Y+1};T2.prototype.push=function($,Y,z){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(Y),this._pushOne(z);return}var Q=this._front+U-3;this._checkCapacity(U);var J=this._capacity-1;this[Q+0&J]=$,this[Q+1&J]=Y,this[Q+2&J]=z,this._length=U};T2.prototype.shift=function(){var $=this._front,Y=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,Y};T2.prototype.length=function(){return this._length};T2.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};T2.prototype._resizeTo=function($){var Y=this._capacity;this._capacity=$;var z=this._front,U=this._length,Q=z+U&Y-1;Sq1(this,0,this,Y,Q)};zF0.exports=T2});var HF0=E((Js1,ri)=>{var GF0;try{throw Error()}catch($){GF0=$}var gq1=YF0(),QF0=UF0(),WF0=F4();function x6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new QF0(16),this._normalQueue=new QF0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=gq1}x6.prototype.setScheduler=function($){var Y=this._schedule;return this._schedule=$,this._customScheduler=!0,Y};x6.prototype.hasCustomScheduler=function(){return this._customScheduler};x6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};x6.prototype.disableTrampolineIfNecessary=function(){if(WF0.hasDevTools)this._trampolineEnabled=!1};x6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};x6.prototype.fatalError=function($,Y){if(Y)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
|
||||
`),process.exit(2);else this.throwLater($)};x6.prototype.throwLater=function($,Y){if(arguments.length===1)Y=$,$=function(){throw Y};if(typeof setTimeout<"u")setTimeout(function(){$(Y)},0);else try{this._schedule(function(){$(Y)})}catch(z){throw Error(`No async scheduler available
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)}};function JF0($,Y,z){this._lateQueue.push($,Y,z),this._queueTick()}function IF0($,Y,z){this._normalQueue.push($,Y,z),this._queueTick()}function KF0($){this._normalQueue._pushOne($),this._queueTick()}if(!WF0.hasDevTools)x6.prototype.invokeLater=JF0,x6.prototype.invoke=IF0,x6.prototype.settlePromises=KF0;else x6.prototype.invokeLater=function($,Y,z){if(this._trampolineEnabled)JF0.call(this,$,Y,z);else this._schedule(function(){setTimeout(function(){$.call(Y,z)},100)})},x6.prototype.invoke=function($,Y,z){if(this._trampolineEnabled)IF0.call(this,$,Y,z);else this._schedule(function(){$.call(Y,z)})},x6.prototype.settlePromises=function($){if(this._trampolineEnabled)KF0.call(this,$);else this._schedule(function(){$._settlePromises()})};x6.prototype._drainQueue=function($){while($.length()>0){var Y=$.shift();if(typeof Y!=="function"){Y._settlePromises();continue}var z=$.shift(),U=$.shift();Y.call(z,U)}};x6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};x6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};x6.prototype._reset=function(){this._isTickUsed=!1};ri.exports=x6;ri.exports.firstLineError=GF0});var A7=E((Qs1,qF0)=>{var ti=pz(),gq1=ti.freeze,XF0=F4(),ZF0=XF0.inherits,RI=XF0.notEnumerableProp;function _I($,Y){function z(U){if(!(this instanceof z))return new z(U);if(RI(this,"message",typeof U==="string"?U:Y),RI(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return ZF0(z,Error),z}var si,ai,yq1=_I("Warning","warning"),kq1=_I("CancellationError","cancellation error"),xq1=_I("TimeoutError","timeout error"),bX=_I("AggregateError","aggregate error");try{si=TypeError,ai=RangeError}catch($){si=_I("TypeError","type error"),ai=_I("RangeError","range error")}var DB="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(mz=0;mz<DB.length;++mz)if(typeof Array.prototype[DB[mz]]==="function")bX.prototype[DB[mz]]=Array.prototype[DB[mz]];var mz;ti.defineProperty(bX.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});bX.prototype.isOperational=!0;var BB=0;bX.prototype.toString=function(){var $=Array(BB*4+1).join(" "),Y=`
|
||||
`)}};function JF0($,Y,z){this._lateQueue.push($,Y,z),this._queueTick()}function IF0($,Y,z){this._normalQueue.push($,Y,z),this._queueTick()}function KF0($){this._normalQueue._pushOne($),this._queueTick()}if(!WF0.hasDevTools)x6.prototype.invokeLater=JF0,x6.prototype.invoke=IF0,x6.prototype.settlePromises=KF0;else x6.prototype.invokeLater=function($,Y,z){if(this._trampolineEnabled)JF0.call(this,$,Y,z);else this._schedule(function(){setTimeout(function(){$.call(Y,z)},100)})},x6.prototype.invoke=function($,Y,z){if(this._trampolineEnabled)IF0.call(this,$,Y,z);else this._schedule(function(){$.call(Y,z)})},x6.prototype.settlePromises=function($){if(this._trampolineEnabled)KF0.call(this,$);else this._schedule(function(){$._settlePromises()})};x6.prototype._drainQueue=function($){while($.length()>0){var Y=$.shift();if(typeof Y!=="function"){Y._settlePromises();continue}var z=$.shift(),U=$.shift();Y.call(z,U)}};x6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};x6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};x6.prototype._reset=function(){this._isTickUsed=!1};ri.exports=x6;ri.exports.firstLineError=GF0});var A7=E((Is1,qF0)=>{var ti=pz(),yq1=ti.freeze,XF0=F4(),ZF0=XF0.inherits,RI=XF0.notEnumerableProp;function _I($,Y){function z(U){if(!(this instanceof z))return new z(U);if(RI(this,"message",typeof U==="string"?U:Y),RI(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return ZF0(z,Error),z}var si,ai,kq1=_I("Warning","warning"),xq1=_I("CancellationError","cancellation error"),fq1=_I("TimeoutError","timeout error"),bX=_I("AggregateError","aggregate error");try{si=TypeError,ai=RangeError}catch($){si=_I("TypeError","type error"),ai=_I("RangeError","range error")}var BB="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(mz=0;mz<BB.length;++mz)if(typeof Array.prototype[BB[mz]]==="function")bX.prototype[BB[mz]]=Array.prototype[BB[mz]];var mz;ti.defineProperty(bX.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});bX.prototype.isOperational=!0;var PB=0;bX.prototype.toString=function(){var $=Array(PB*4+1).join(" "),Y=`
|
||||
`+$+`AggregateError of:
|
||||
`;BB++,$=Array(BB*4+1).join(" ");for(var z=0;z<this.length;++z){var U=this[z]===this?"[Circular AggregateError]":this[z]+"",Q=U.split(`
|
||||
`;PB++,$=Array(PB*4+1).join(" ");for(var z=0;z<this.length;++z){var U=this[z]===this?"[Circular AggregateError]":this[z]+"",Q=U.split(`
|
||||
`);for(var J=0;J<Q.length;++J)Q[J]=$+Q[J];U=Q.join(`
|
||||
`),Y+=U+`
|
||||
`}return BB--,Y};function uX($){if(!(this instanceof uX))return new uX($);if(RI(this,"name","OperationalError"),RI(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)RI(this,"message",$.message),RI(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}ZF0(uX,Error);var lz=Error.__BluebirdErrorTypes__;if(!lz)lz=gq1({CancellationError:kq1,TimeoutError:xq1,OperationalError:uX,RejectionError:uX,AggregateError:bX}),ti.defineProperty(Error,"__BluebirdErrorTypes__",{value:lz,writable:!1,enumerable:!1,configurable:!1});qF0.exports={Error,TypeError:si,RangeError:ai,CancellationError:lz.CancellationError,OperationalError:lz.OperationalError,TimeoutError:lz.TimeoutError,AggregateError:lz.AggregateError,Warning:yq1}});var LF0=E((Js1,VF0)=>{VF0.exports=function($,Y){var z=F4(),U=z.errorObj,Q=z.isObject;function J(X,Z){if(Q(X)){if(X instanceof $)return X;var q=K(X);if(q===U){if(Z)Z._pushContext();var V=$.reject(q.e);if(Z)Z._popContext();return V}else if(typeof q==="function"){if(W(X)){var V=new $(Y);return X._then(V._fulfill,V._reject,void 0,V,null),V}return H(X,q,Z)}}return X}function I(X){return X.then}function K(X){try{return I(X)}catch(Z){return U.e=Z,U}}var G={}.hasOwnProperty;function W(X){try{return G.call(X,"_promise0")}catch(Z){return!1}}function H(X,Z,q){var V=new $(Y),F=V;if(q)q._pushContext();if(V._captureStackTrace(),q)q._popContext();var M=!0,w=z.tryCatch(Z).call(X,O,D);if(M=!1,V&&w===U)V._rejectCallback(w.e,!0,!0),V=null;function O(N){if(!V)return;V._resolveCallback(N),V=null}function D(N){if(!V)return;V._rejectCallback(N,M,!0),V=null}return F}return J}});var wF0=E((Is1,FF0)=>{FF0.exports=function($,Y,z,U,Q){var J=F4(),I=J.isArray;function K(W){switch(W){case-2:return[];case-3:return{}}}function G(W){var H=this._promise=new $(Y);if(W instanceof $)H._propagateFrom(W,3);H._setOnCancel(this),this._values=W,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return J.inherits(G,Q),G.prototype.length=function(){return this._length},G.prototype.promise=function(){return this._promise},G.prototype._init=function W(H,X){var Z=z(this._values,this._promise);if(Z instanceof $){Z=Z._target();var q=Z._bitField;if(this._values=Z,(q&50397184)===0)return this._promise._setAsyncGuaranteed(),Z._then(W,this._reject,void 0,this,X);else if((q&33554432)!==0)Z=Z._value();else if((q&16777216)!==0)return this._reject(Z._reason());else return this._cancel()}if(Z=J.asArray(Z),Z===null){var V=U("expecting an array or an iterable object but got "+J.classString(Z)).reason();this._promise._rejectCallback(V,!1);return}if(Z.length===0){if(X===-5)this._resolveEmptyArray();else this._resolve(K(X));return}this._iterate(Z)},G.prototype._iterate=function(W){var H=this.getActualLength(W.length);this._length=H,this._values=this.shouldCopyValues()?Array(H):this._values;var X=this._promise,Z=!1,q=null;for(var V=0;V<H;++V){var F=z(W[V],X);if(F instanceof $)F=F._target(),q=F._bitField;else q=null;if(Z){if(q!==null)F.suppressUnhandledRejections()}else if(q!==null)if((q&50397184)===0)F._proxy(this,V),this._values[V]=F;else if((q&33554432)!==0)Z=this._promiseFulfilled(F._value(),V);else if((q&16777216)!==0)Z=this._promiseRejected(F._reason(),V);else Z=this._promiseCancelled(V);else Z=this._promiseFulfilled(F,V)}if(!Z)X._setAsyncGuaranteed()},G.prototype._isResolved=function(){return this._values===null},G.prototype._resolve=function(W){this._values=null,this._promise._fulfill(W)},G.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},G.prototype._reject=function(W){this._values=null,this._promise._rejectCallback(W,!1)},G.prototype._promiseFulfilled=function(W,H){this._values[H]=W;var X=++this._totalResolved;if(X>=this._length)return this._resolve(this._values),!0;return!1},G.prototype._promiseCancelled=function(){return this._cancel(),!0},G.prototype._promiseRejected=function(W){return this._totalResolved++,this._reject(W),!0},G.prototype._resultCancelled=function(){if(this._isResolved())return;var W=this._values;if(this._cancel(),W instanceof $)W.cancel();else for(var H=0;H<W.length;++H)if(W[H]instanceof $)W[H].cancel()},G.prototype.shouldCopyValues=function(){return!0},G.prototype.getActualLength=function(W){return W},G}});var OF0=E((Ks1,MF0)=>{MF0.exports=function($){var Y=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(J())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var I=z.pop(),K=I._promiseCreated;return I._promiseCreated=null,K}return null};function Q(){if(Y)return new U}function J(){var I=z.length-1;if(I>=0)return z[I];return}return U.CapturedTrace=null,U.create=Q,U.deactivateLong
Line truncated
|
||||
`}return PB--,Y};function uX($){if(!(this instanceof uX))return new uX($);if(RI(this,"name","OperationalError"),RI(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)RI(this,"message",$.message),RI(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}ZF0(uX,Error);var lz=Error.__BluebirdErrorTypes__;if(!lz)lz=yq1({CancellationError:xq1,TimeoutError:fq1,OperationalError:uX,RejectionError:uX,AggregateError:bX}),ti.defineProperty(Error,"__BluebirdErrorTypes__",{value:lz,writable:!1,enumerable:!1,configurable:!1});qF0.exports={Error,TypeError:si,RangeError:ai,CancellationError:lz.CancellationError,OperationalError:lz.OperationalError,TimeoutError:lz.TimeoutError,AggregateError:lz.AggregateError,Warning:kq1}});var LF0=E((Ks1,VF0)=>{VF0.exports=function($,Y){var z=F4(),U=z.errorObj,Q=z.isObject;function J(X,Z){if(Q(X)){if(X instanceof $)return X;var q=K(X);if(q===U){if(Z)Z._pushContext();var V=$.reject(q.e);if(Z)Z._popContext();return V}else if(typeof q==="function"){if(W(X)){var V=new $(Y);return X._then(V._fulfill,V._reject,void 0,V,null),V}return H(X,q,Z)}}return X}function I(X){return X.then}function K(X){try{return I(X)}catch(Z){return U.e=Z,U}}var G={}.hasOwnProperty;function W(X){try{return G.call(X,"_promise0")}catch(Z){return!1}}function H(X,Z,q){var V=new $(Y),F=V;if(q)q._pushContext();if(V._captureStackTrace(),q)q._popContext();var M=!0,w=z.tryCatch(Z).call(X,O,D);if(M=!1,V&&w===U)V._rejectCallback(w.e,!0,!0),V=null;function O(N){if(!V)return;V._resolveCallback(N),V=null}function D(N){if(!V)return;V._rejectCallback(N,M,!0),V=null}return F}return J}});var wF0=E((Gs1,FF0)=>{FF0.exports=function($,Y,z,U,Q){var J=F4(),I=J.isArray;function K(W){switch(W){case-2:return[];case-3:return{}}}function G(W){var H=this._promise=new $(Y);if(W instanceof $)H._propagateFrom(W,3);H._setOnCancel(this),this._values=W,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return J.inherits(G,Q),G.prototype.length=function(){return this._length},G.prototype.promise=function(){return this._promise},G.prototype._init=function W(H,X){var Z=z(this._values,this._promise);if(Z instanceof $){Z=Z._target();var q=Z._bitField;if(this._values=Z,(q&50397184)===0)return this._promise._setAsyncGuaranteed(),Z._then(W,this._reject,void 0,this,X);else if((q&33554432)!==0)Z=Z._value();else if((q&16777216)!==0)return this._reject(Z._reason());else return this._cancel()}if(Z=J.asArray(Z),Z===null){var V=U("expecting an array or an iterable object but got "+J.classString(Z)).reason();this._promise._rejectCallback(V,!1);return}if(Z.length===0){if(X===-5)this._resolveEmptyArray();else this._resolve(K(X));return}this._iterate(Z)},G.prototype._iterate=function(W){var H=this.getActualLength(W.length);this._length=H,this._values=this.shouldCopyValues()?Array(H):this._values;var X=this._promise,Z=!1,q=null;for(var V=0;V<H;++V){var F=z(W[V],X);if(F instanceof $)F=F._target(),q=F._bitField;else q=null;if(Z){if(q!==null)F.suppressUnhandledRejections()}else if(q!==null)if((q&50397184)===0)F._proxy(this,V),this._values[V]=F;else if((q&33554432)!==0)Z=this._promiseFulfilled(F._value(),V);else if((q&16777216)!==0)Z=this._promiseRejected(F._reason(),V);else Z=this._promiseCancelled(V);else Z=this._promiseFulfilled(F,V)}if(!Z)X._setAsyncGuaranteed()},G.prototype._isResolved=function(){return this._values===null},G.prototype._resolve=function(W){this._values=null,this._promise._fulfill(W)},G.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},G.prototype._reject=function(W){this._values=null,this._promise._rejectCallback(W,!1)},G.prototype._promiseFulfilled=function(W,H){this._values[H]=W;var X=++this._totalResolved;if(X>=this._length)return this._resolve(this._values),!0;return!1},G.prototype._promiseCancelled=function(){return this._cancel(),!0},G.prototype._promiseRejected=function(W){return this._totalResolved++,this._reject(W),!0},G.prototype._resultCancelled=function(){if(this._isResolved())return;var W=this._values;if(this._cancel(),W instanceof $)W.cancel();else for(var H=0;H<W.length;++H)if(W[H]instanceof $)W[H].cancel()},G.prototype.shouldCopyValues=function(){return!0},G.prototype.getActualLength=function(W){return W},G}});var OF0=E((Ws1,MF0)=>{MF0.exports=function($){var Y=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(J())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var I=z.pop(),K=I._promiseCreated;return I._promiseCreated=null,K}return null};function Q(){if(Y)return new U}function J(){var I=z.length-1;if(I>=0)return z[I];return}return U.CapturedTrace=null,U.create=Q,U.deactivateLong
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);if(!B0.longStackTraces&&f0()){var Q0=$.prototype._captureStackTrace,P=$.prototype._attachExtraTrace;B0.longStackTraces=!0,N=function(){if(U.haveItemsQueued()&&!B0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
|
||||
@@ -141,13 +141,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
|
||||
`),r=-1,X0=-1,J0,Z0;for(var O0=0;O0<v.length;++O0){var P0=D1(v[O0]);if(P0){J0=P0.fileName,r=P0.line;break}}for(var O0=0;O0<u.length;++O0){var P0=D1(u[O0]);if(P0){Z0=P0.fileName,X0=P0.line;break}}if(r<0||X0<0||!J0||!Z0||J0!==Z0||r>=X0)return;u0=function(r0){if(W.test(r0))return!0;var I1=D1(r0);if(I1){if(I1.fileName===J0&&(r<=I1.line&&I1.line<=X0))return!0}return!1}}function u1(Q0){this._parent=Q0,this._promisesCreated=0;var P=this._length=1+(Q0===void 0?0:Q0._length);if(b1(this,u1),P>32)this.uncycle()}J.inherits(u1,Error),Y.CapturedTrace=u1,u1.prototype.uncycle=function(){var Q0=this._length;if(Q0<2)return;var P=[],v={};for(var u=0,r=this;r!==void 0;++u)P.push(r),r=r._parent;Q0=this._length=u;for(var u=Q0-1;u>=0;--u){var X0=P[u].stack;if(v[X0]===void 0)v[X0]=u}for(var u=0;u<Q0;++u){var J0=P[u].stack,Z0=v[J0];if(Z0!==void 0&&Z0!==u){if(Z0>0)P[Z0-1]._parent=void 0,P[Z0-1]._length=1;P[u]._parent=void 0,P[u]._length=1;var O0=u>0?P[u-1]:this;if(Z0<Q0-1)O0._parent=P[Z0+1],O0._parent.uncycle(),O0._length=O0._parent._length+1;else O0._parent=void 0,O0._length=1;var P0=O0._length+1;for(var r0=u-2;r0>=0;--r0)P[r0]._length=P0,P0++;return}}},u1.prototype.attachExtraTrace=function(Q0){if(Q0.__stackCleaned__)return;this.uncycle();var P=b0(Q0),v=P.message,u=[P.stack],r=this;while(r!==void 0)u.push(G0(r.stack.split(`
|
||||
`))),r=r._parent;E0(u),M0(u),J.notEnumerableProp(Q0,"stack",Y0(v,u)),J.notEnumerableProp(Q0,"__stackCleaned__",!0)};var b1=function(){var P=/^\s*at\s*/,v=function(J0,Z0){if(typeof J0==="string")return J0;if(Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return H0(Z0)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,Z=P,q=v;var u=Error.captureStackTrace;return u0=function(J0){return W.test(J0)},function(J0,Z0){Error.stackTraceLimit+=6,u(J0,Z0),Error.stackTraceLimit-=6}}var r=Error();if(typeof r.stack==="string"&&r.stack.split(`
|
||||
`)[0].indexOf("stackDetection@")>=0)return Z=/@/,q=v,V=!0,function(Z0){Z0.stack=Error().stack};var X0;try{throw Error()}catch(J0){X0="stack"in J0}if(!("stack"in r)&&X0&&typeof Error.stackTraceLimit==="number")return Z=P,q=v,function(Z0){Error.stackTraceLimit+=6;try{throw Error()}catch(O0){Z0.stack=O0.stack}Error.stackTraceLimit-=6};return q=function(J0,Z0){if(typeof J0==="string")return J0;if((typeof Z0==="object"||typeof Z0==="function")&&Z0.name!==void 0&&Z0.message!==void 0)return Z0.toString();return H0(Z0)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(F=function(Q0){console.warn(Q0)},J.isNode&&process.stderr.isTTY)F=function(Q0,P){var v=P?"\x1B[33m":"\x1B[31m";console.warn(v+Q0+`\x1B[0m
|
||||
`)};else if(!J.isNode&&typeof Error().stack==="string")F=function(Q0,P){console.warn("%c"+Q0,P?"color: darkorange":"color: red")}}var B0={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1};if(O)$.longStackTraces();return{longStackTraces:function(){return B0.longStackTraces},warnings:function(){return B0.warnings},cancellation:function(){return B0.cancellation},monitoring:function(){return B0.monitoring},propagateFromFunction:function(){return t},boundValueFunction:function(){return $0},checkForgottenReturns:e,setBounds:k1,warn:s,deprecated:y,CapturedTrace:u1,fireDomEvent:A,fireGlobalEvent:T}}});var PF0=E((Ws1,BF0)=>{BF0.exports=function($,Y){var z=F4(),U=$.CancellationError,Q=z.errorObj;function J(X,Z,q){this.promise=X,this.type=Z,this.handler=q,this.called=!1,this.cancelPromise=null}J.prototype.isFinallyHandler=function(){return this.type===0};function I(X){this.finallyHandler=X}I.prototype._resultCancelled=function(){K(this.finallyHandler)};function K(X,Z){if(X.cancelPromise!=null){if(arguments.length>1)X.cancelPromise._reject(Z);else X.cancelPromise._cancel();return X.cancelPromise=null,!0}return!1}function G(){return H.call(this,this.promise._target()._settledValue())}function W(X){if(K(this,X))return;return Q.e=X,Q}function H(X){var Z=this.promise,q=this.handler;if(!this.called){this.called=!0;var V=this.isFinallyHandler()?q.call(Z._boundValue()):q.call(Z._boundValue(),X);if(V!==void 0){Z._setReturnedNonUndefined();var F=Y(V,Z);if(F instanceof $){if(this.cancelPromise!=null){if(F._isCancelled()){var M=new U("late cancellation observer");return Z._attachExtraTrace(M),Q.e=M,Q}else if(F.isPending())F._attachCancellationCallback(new I(this))}return F._then(G,W,void 0,this,void 0)}}}if(Z.isRejected())return K(this),Q.e=X,Q;else return K(this),X}return $.prototype._passThrough=function(X,Z,q,V){if(typeof X!=="function")return this.then();return this._then(q,V,void 0,new J(this,Z,X),void 0)},$.prototype.lastly=$.prototype.finally=function(X){return this._passThrough(X,0,H,H)},$.prototype.tap=function(X){return this._passThrough(X,1,H)},J}});var TF0=E((Hs1,AF0)=>{AF0.exports=function($){var Y=F4(),z=pz().keys,U=Y.tryCatch,Q=Y.errorObj;function J(I,K,G){return function(W){var H=G._boundValue();$:for(var X=0;X<I.length;++X){var Z=I[X];if(Z===Error||Z!=null&&Z.prototype instanceof Error){if(W instanceof Z)return U(K).call(H,W)}else if(typeof Z==="function"){var q=U(Z).call(H,W);if(q===Q)return q;else if(q)return U(K).call(H,W)}else if(Y.isObject(W)){var V=z(Z);for(var F=0;F<V.length;++F){var M=V[F];if(Z[M]!=W[M])continue $}return U(K).call(H,W)}}return $}}return J}});var ei=E((Xs1,CF0)=>{var jF0=F4(),fq1=jF0.maybeWrapAsError,uq1=A7(),bq1=uq1.OperationalError,EF0=pz();function iq1($){return $ instanceof Error&&EF0.getPrototypeOf($)===Error.prototype}var cq1=/^(?:name|message|stack|cause)$/;function nq1($){var Y;if(iq1($)){Y=new bq1($),Y.name=$.name,Y.message=$.message,Y.stack=$.stack;var z=EF0.keys($);for(var U=0;U<z.length;++U){var Q=z[U];if(!cq1.test(Q))Y[Q]=$[Q]}return Y}return jF0.markAsOriginatingFromRejection($),$}function pq1($,Y){return function(z,U){if($===null)return;if(z){var Q=nq1(fq1(z));$._attachExtraTrace(Q),$._reject(Q)}else if(!Y)$._fulfill(U);else{var J=arguments.length,I=Array(Math.max(J-1,0));for(var K=1;K<J;++K)I[K-1]=arguments[K];$._fulfill(I)}$=null}}CF0.exports=pq1});var _F0=E((Zs1,RF0)=>{RF0.exports=function($,Y,z,U,Q){var J=F4(),I=J.tryCatch;$.method=function(K){if(typeof K!=="function")throw new $.TypeError("expecting a function but got "+J.classString(K));return function(){var G=new $(Y);G._captureStackTrace(),G._pushContext();var W=I(K).apply(this,arguments),H=G._popContext();return Q.checkForgottenReturns(W,H,"Promise.method",G),G._resolveFromSyncValue(W),G}},$.attempt=$.try=function(K){if(typeof K!=="function")return U("expecting a function but got "+J.classString(K));var G=new $(Y);G._captureStackTrace(),G._pushContext();var W;if(arguments.length>1){Q.deprecated("calling Promise.try with more than 1 argument");var H=arguments[1],X=arguments[2];W=J.isArray(H)?I(K).apply(X,H):I(K).call(X,H)}else W=I(K)();var Z=G._popContext();return Q.checkForgottenReturns(W,Z,"Promise.try",G),G._resolveFromSyncValue(W),G},$.prototype._resolveFromSyncValue=function(K){if(K===J.errorObj)this._rejectCallback(K.e,!1);else this._resolveCallback(K,!0)}}});var hF0=E((qs1,vF0)=>{vF0.exports=function($,Y,z,U){var Q=!1,J=function(W,H){this._reject(H)},I=function(W,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(J,J,null,this,W)},K=function(W,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},G=function(W,H){if(!H.promiseRejectionQueued)this._reject(W)};$.prototype.bind=function(W){if(!Q)Q=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var H=z(W),X=new $(Y);X._propagateFrom(this,1);var Z=this._target();if(X._setBoundTo(H),H instanceof $){var q={promiseRejectionQueued:!1,promise:X,target:Z,bindingPromise:H};Z._then(Y,I,voi
Line truncated
|
||||
`)};else if(!J.isNode&&typeof Error().stack==="string")F=function(Q0,P){console.warn("%c"+Q0,P?"color: darkorange":"color: red")}}var B0={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1};if(O)$.longStackTraces();return{longStackTraces:function(){return B0.longStackTraces},warnings:function(){return B0.warnings},cancellation:function(){return B0.cancellation},monitoring:function(){return B0.monitoring},propagateFromFunction:function(){return t},boundValueFunction:function(){return $0},checkForgottenReturns:e,setBounds:k1,warn:s,deprecated:y,CapturedTrace:u1,fireDomEvent:A,fireGlobalEvent:T}}});var PF0=E((Xs1,BF0)=>{BF0.exports=function($,Y){var z=F4(),U=$.CancellationError,Q=z.errorObj;function J(X,Z,q){this.promise=X,this.type=Z,this.handler=q,this.called=!1,this.cancelPromise=null}J.prototype.isFinallyHandler=function(){return this.type===0};function I(X){this.finallyHandler=X}I.prototype._resultCancelled=function(){K(this.finallyHandler)};function K(X,Z){if(X.cancelPromise!=null){if(arguments.length>1)X.cancelPromise._reject(Z);else X.cancelPromise._cancel();return X.cancelPromise=null,!0}return!1}function G(){return H.call(this,this.promise._target()._settledValue())}function W(X){if(K(this,X))return;return Q.e=X,Q}function H(X){var Z=this.promise,q=this.handler;if(!this.called){this.called=!0;var V=this.isFinallyHandler()?q.call(Z._boundValue()):q.call(Z._boundValue(),X);if(V!==void 0){Z._setReturnedNonUndefined();var F=Y(V,Z);if(F instanceof $){if(this.cancelPromise!=null){if(F._isCancelled()){var M=new U("late cancellation observer");return Z._attachExtraTrace(M),Q.e=M,Q}else if(F.isPending())F._attachCancellationCallback(new I(this))}return F._then(G,W,void 0,this,void 0)}}}if(Z.isRejected())return K(this),Q.e=X,Q;else return K(this),X}return $.prototype._passThrough=function(X,Z,q,V){if(typeof X!=="function")return this.then();return this._then(q,V,void 0,new J(this,Z,X),void 0)},$.prototype.lastly=$.prototype.finally=function(X){return this._passThrough(X,0,H,H)},$.prototype.tap=function(X){return this._passThrough(X,1,H)},J}});var TF0=E((Zs1,AF0)=>{AF0.exports=function($){var Y=F4(),z=pz().keys,U=Y.tryCatch,Q=Y.errorObj;function J(I,K,G){return function(W){var H=G._boundValue();$:for(var X=0;X<I.length;++X){var Z=I[X];if(Z===Error||Z!=null&&Z.prototype instanceof Error){if(W instanceof Z)return U(K).call(H,W)}else if(typeof Z==="function"){var q=U(Z).call(H,W);if(q===Q)return q;else if(q)return U(K).call(H,W)}else if(Y.isObject(W)){var V=z(Z);for(var F=0;F<V.length;++F){var M=V[F];if(Z[M]!=W[M])continue $}return U(K).call(H,W)}}return $}}return J}});var ei=E((qs1,CF0)=>{var jF0=F4(),uq1=jF0.maybeWrapAsError,bq1=A7(),iq1=bq1.OperationalError,EF0=pz();function cq1($){return $ instanceof Error&&EF0.getPrototypeOf($)===Error.prototype}var nq1=/^(?:name|message|stack|cause)$/;function pq1($){var Y;if(cq1($)){Y=new iq1($),Y.name=$.name,Y.message=$.message,Y.stack=$.stack;var z=EF0.keys($);for(var U=0;U<z.length;++U){var Q=z[U];if(!nq1.test(Q))Y[Q]=$[Q]}return Y}return jF0.markAsOriginatingFromRejection($),$}function dq1($,Y){return function(z,U){if($===null)return;if(z){var Q=pq1(uq1(z));$._attachExtraTrace(Q),$._reject(Q)}else if(!Y)$._fulfill(U);else{var J=arguments.length,I=Array(Math.max(J-1,0));for(var K=1;K<J;++K)I[K-1]=arguments[K];$._fulfill(I)}$=null}}CF0.exports=dq1});var _F0=E((Vs1,RF0)=>{RF0.exports=function($,Y,z,U,Q){var J=F4(),I=J.tryCatch;$.method=function(K){if(typeof K!=="function")throw new $.TypeError("expecting a function but got "+J.classString(K));return function(){var G=new $(Y);G._captureStackTrace(),G._pushContext();var W=I(K).apply(this,arguments),H=G._popContext();return Q.checkForgottenReturns(W,H,"Promise.method",G),G._resolveFromSyncValue(W),G}},$.attempt=$.try=function(K){if(typeof K!=="function")return U("expecting a function but got "+J.classString(K));var G=new $(Y);G._captureStackTrace(),G._pushContext();var W;if(arguments.length>1){Q.deprecated("calling Promise.try with more than 1 argument");var H=arguments[1],X=arguments[2];W=J.isArray(H)?I(K).apply(X,H):I(K).call(X,H)}else W=I(K)();var Z=G._popContext();return Q.checkForgottenReturns(W,Z,"Promise.try",G),G._resolveFromSyncValue(W),G},$.prototype._resolveFromSyncValue=function(K){if(K===J.errorObj)this._rejectCallback(K.e,!1);else this._resolveCallback(K,!0)}}});var hF0=E((Ls1,vF0)=>{vF0.exports=function($,Y,z,U){var Q=!1,J=function(W,H){this._reject(H)},I=function(W,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(J,J,null,this,W)},K=function(W,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},G=function(W,H){if(!H.promiseRejectionQueued)this._reject(W)};$.prototype.bind=function(W){if(!Q)Q=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var H=z(W),X=new $(Y);X._propagateFrom(this,1);var Z=this._target();if(X._setBoundTo(H),H instanceof $){var q={promiseRejectionQueued:!1,promise:X,target:Z,bindingPromise:H};Z._then(Y,I,voi
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);return this._settledValue()},U=Y.prototype.error=Y.prototype.reason=function(){if(!this.isRejected())throw TypeError(`cannot get rejection reason of a non-rejected promise
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);return this._settledValue()},Q=Y.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},J=Y.prototype.isRejected=function(){return(this._bitField&16777216)!==0},I=Y.prototype.isPending=function(){return(this._bitField&50397184)===0},K=Y.prototype.isResolved=function(){return(this._bitField&50331648)!==0};Y.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return I.call(this._target())},$.prototype.isRejected=function(){return J.call(this._target())},$.prototype.isFulfilled=function(){return Q.call(this._target())},$.prototype.isResolved=function(){return K.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var G=this._target();return G._unsetRejectionIsUnhandled(),U.call(G)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=Y}});var bF0=E((ws1,uF0)=>{uF0.exports=function($,Y,z,U,Q,J){var I=F4(),K=I.canEvaluate,G=I.tryCatch,W=I.errorObj,H;if(K){var X=function(O){return Function("value","holder",`
|
||||
`);return this._settledValue()},Q=Y.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},J=Y.prototype.isRejected=function(){return(this._bitField&16777216)!==0},I=Y.prototype.isPending=function(){return(this._bitField&50397184)===0},K=Y.prototype.isResolved=function(){return(this._bitField&50331648)!==0};Y.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return I.call(this._target())},$.prototype.isRejected=function(){return J.call(this._target())},$.prototype.isFulfilled=function(){return Q.call(this._target())},$.prototype.isResolved=function(){return K.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var G=this._target();return G._unsetRejectionIsUnhandled(),U.call(G)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=Y}});var bF0=E((Os1,uF0)=>{uF0.exports=function($,Y,z,U,Q,J){var I=F4(),K=I.canEvaluate,G=I.tryCatch,W=I.errorObj,H;if(K){var X=function(O){return Function("value","holder",`
|
||||
'use strict';
|
||||
holder.pIndex = value;
|
||||
holder.checkFulfillment(this);
|
||||
@@ -199,7 +199,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
|
||||
|
||||
return [TheName];
|
||||
}(tryCatch, errorObj, Promise, async);
|
||||
`;return C=C.replace(/\[TheName\]/g,j).replace(/\[TheTotal\]/g,O).replace(/\[ThePassedArguments\]/g,B).replace(/\[TheProperties\]/g,A).replace(/\[CancellationCode\]/g,T),Function("tryCatch","errorObj","Promise","async",C)(G,W,$,Q)},V=[],F=[],M=[];for(var w=0;w<8;++w)V.push(q(w+1)),F.push(X(w+1)),M.push(Z(w+1));H=function(O){this._reject(O)}}$.join=function(){var O=arguments.length-1,D;if(O>0&&typeof arguments[O]==="function"){if(D=arguments[O],O<=8&&K){var c=new $(U);c._captureStackTrace();var N=V[O-1],A=new N(D),T=F;for(var B=0;B<O;++B){var j=z(arguments[B],c);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0)j._then(T[B],H,void 0,c,A),M[B](j,A),A.asyncNeeded=!1;else if((C&33554432)!==0)T[B].call(c,j._value(),A);else if((C&16777216)!==0)c._reject(j._reason());else c._cancel()}else T[B].call(c,j,A)}if(!c._isFateSealed()){if(A.asyncNeeded){var b=J();if(b!==null)A.fn=I.domainBind(b,A.fn)}c._setAsyncGuaranteed(),c._setOnCancel(A)}return c}}var k=arguments.length,h=Array(k);for(var i=0;i<k;++i)h[i]=arguments[i];if(D)h.pop();var c=new Y(h).promise();return D!==void 0?c.spread(D):c}}});var cF0=E((Ms1,iF0)=>{iF0.exports=function($,Y,z,U,Q,J){var I=$._getDomain,K=F4(),G=K.tryCatch,W=K.errorObj,H=$._async;function X(q,V,F,M){this.constructor$(q),this._promise._captureStackTrace();var w=I();this._callback=w===null?V:K.domainBind(w,V),this._preservedValues=M===Q?Array(this.length()):null,this._limit=F,this._inFlight=0,this._queue=[],H.invoke(this._asyncInit,this,void 0)}K.inherits(X,Y),X.prototype._asyncInit=function(){this._init$(void 0,-2)},X.prototype._init=function(){},X.prototype._promiseFulfilled=function(q,V){var F=this._values,M=this.length(),w=this._preservedValues,O=this._limit;if(V<0){if(V=V*-1-1,F[V]=q,O>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(O>=1&&this._inFlight>=O)return F[V]=q,this._queue.push(V),!1;if(w!==null)w[V]=q;var D=this._promise,N=this._callback,A=D._boundValue();D._pushContext();var T=G(N).call(A,q,V,M),B=D._popContext();if(J.checkForgottenReturns(T,B,w!==null?"Promise.filter":"Promise.map",D),T===W)return this._reject(T.e),!0;var j=U(T,this._promise);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0){if(O>=1)this._inFlight++;return F[V]=j,j._proxy(this,(V+1)*-1),!1}else if((C&33554432)!==0)T=j._value();else if((C&16777216)!==0)return this._reject(j._reason()),!0;else return this._cancel(),!0}F[V]=T}var b=++this._totalResolved;if(b>=M){if(w!==null)this._filter(F,w);else this._resolve(F);return!0}return!1},X.prototype._drainQueue=function(){var q=this._queue,V=this._limit,F=this._values;while(q.length>0&&this._inFlight<V){if(this._isResolved())return;var M=q.pop();this._promiseFulfilled(F[M],M)}},X.prototype._filter=function(q,V){var F=V.length,M=Array(F),w=0;for(var O=0;O<F;++O)if(q[O])M[w++]=V[O];M.length=w,this._resolve(M)},X.prototype.preservedValues=function(){return this._preservedValues};function Z(q,V,F,M){if(typeof V!=="function")return z("expecting a function but got "+K.classString(V));var w=0;if(F!==void 0)if(typeof F==="object"&&F!==null){if(typeof F.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+K.classString(F.concurrency)));w=F.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+K.classString(F)));return w=typeof w==="number"&&isFinite(w)&&w>=1?w:0,new X(q,V,w,M).promise()}$.prototype.map=function(q,V){return Z(this,q,V,null)},$.map=function(q,V,F,M){return Z(q,V,F,M)}}});var pF0=E((Os1,nF0)=>{var $c=Object.create;if($c)PB=$c(null),AB=$c(null),PB[" size"]=AB[" size"]=0;var PB,AB;nF0.exports=function($){var Y=F4(),z=Y.canEvaluate,U=Y.isIdentifier,Q,J,I=function(q){return Function("ensureMethod",`
|
||||
`;return C=C.replace(/\[TheName\]/g,j).replace(/\[TheTotal\]/g,O).replace(/\[ThePassedArguments\]/g,B).replace(/\[TheProperties\]/g,A).replace(/\[CancellationCode\]/g,T),Function("tryCatch","errorObj","Promise","async",C)(G,W,$,Q)},V=[],F=[],M=[];for(var w=0;w<8;++w)V.push(q(w+1)),F.push(X(w+1)),M.push(Z(w+1));H=function(O){this._reject(O)}}$.join=function(){var O=arguments.length-1,D;if(O>0&&typeof arguments[O]==="function"){if(D=arguments[O],O<=8&&K){var c=new $(U);c._captureStackTrace();var N=V[O-1],A=new N(D),T=F;for(var B=0;B<O;++B){var j=z(arguments[B],c);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0)j._then(T[B],H,void 0,c,A),M[B](j,A),A.asyncNeeded=!1;else if((C&33554432)!==0)T[B].call(c,j._value(),A);else if((C&16777216)!==0)c._reject(j._reason());else c._cancel()}else T[B].call(c,j,A)}if(!c._isFateSealed()){if(A.asyncNeeded){var b=J();if(b!==null)A.fn=I.domainBind(b,A.fn)}c._setAsyncGuaranteed(),c._setOnCancel(A)}return c}}var k=arguments.length,h=Array(k);for(var i=0;i<k;++i)h[i]=arguments[i];if(D)h.pop();var c=new Y(h).promise();return D!==void 0?c.spread(D):c}}});var cF0=E((Ns1,iF0)=>{iF0.exports=function($,Y,z,U,Q,J){var I=$._getDomain,K=F4(),G=K.tryCatch,W=K.errorObj,H=$._async;function X(q,V,F,M){this.constructor$(q),this._promise._captureStackTrace();var w=I();this._callback=w===null?V:K.domainBind(w,V),this._preservedValues=M===Q?Array(this.length()):null,this._limit=F,this._inFlight=0,this._queue=[],H.invoke(this._asyncInit,this,void 0)}K.inherits(X,Y),X.prototype._asyncInit=function(){this._init$(void 0,-2)},X.prototype._init=function(){},X.prototype._promiseFulfilled=function(q,V){var F=this._values,M=this.length(),w=this._preservedValues,O=this._limit;if(V<0){if(V=V*-1-1,F[V]=q,O>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(O>=1&&this._inFlight>=O)return F[V]=q,this._queue.push(V),!1;if(w!==null)w[V]=q;var D=this._promise,N=this._callback,A=D._boundValue();D._pushContext();var T=G(N).call(A,q,V,M),B=D._popContext();if(J.checkForgottenReturns(T,B,w!==null?"Promise.filter":"Promise.map",D),T===W)return this._reject(T.e),!0;var j=U(T,this._promise);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0){if(O>=1)this._inFlight++;return F[V]=j,j._proxy(this,(V+1)*-1),!1}else if((C&33554432)!==0)T=j._value();else if((C&16777216)!==0)return this._reject(j._reason()),!0;else return this._cancel(),!0}F[V]=T}var b=++this._totalResolved;if(b>=M){if(w!==null)this._filter(F,w);else this._resolve(F);return!0}return!1},X.prototype._drainQueue=function(){var q=this._queue,V=this._limit,F=this._values;while(q.length>0&&this._inFlight<V){if(this._isResolved())return;var M=q.pop();this._promiseFulfilled(F[M],M)}},X.prototype._filter=function(q,V){var F=V.length,M=Array(F),w=0;for(var O=0;O<F;++O)if(q[O])M[w++]=V[O];M.length=w,this._resolve(M)},X.prototype.preservedValues=function(){return this._preservedValues};function Z(q,V,F,M){if(typeof V!=="function")return z("expecting a function but got "+K.classString(V));var w=0;if(F!==void 0)if(typeof F==="object"&&F!==null){if(typeof F.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+K.classString(F.concurrency)));w=F.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+K.classString(F)));return w=typeof w==="number"&&isFinite(w)&&w>=1?w:0,new X(q,V,w,M).promise()}$.prototype.map=function(q,V){return Z(this,q,V,null)},$.map=function(q,V,F,M){return Z(q,V,F,M)}}});var pF0=E((Ds1,nF0)=>{var $c=Object.create;if($c)AB=$c(null),TB=$c(null),AB[" size"]=TB[" size"]=0;var AB,TB;nF0.exports=function($){var Y=F4(),z=Y.canEvaluate,U=Y.isIdentifier,Q,J,I=function(q){return Function("ensureMethod",`
|
||||
return function(obj) {
|
||||
'use strict'
|
||||
var len = this.length;
|
||||
@@ -216,7 +216,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
|
||||
`.replace(/methodName/g,q))(W)},K=function(q){return Function("obj",`
|
||||
'use strict';
|
||||
return obj.propertyName;
|
||||
`.replace("propertyName",q))},G=function(q,V,F){var M=F[q];if(typeof M!=="function"){if(!U(q))return null;if(M=V(q),F[q]=M,F[" size"]++,F[" size"]>512){var w=Object.keys(F);for(var O=0;O<256;++O)delete F[w[O]];F[" size"]=w.length-256}}return M};Q=function(q){return G(q,I,PB)},J=function(q){return G(q,K,AB)};function W(q,V){var F;if(q!=null)F=q[V];if(typeof F!=="function"){var M="Object "+Y.classString(q)+" has no method '"+Y.toString(V)+"'";throw new $.TypeError(M)}return F}function H(q){var V=this.pop(),F=W(q,V);return F.apply(q,this)}$.prototype.call=function(q){var V=arguments.length,F=Array(Math.max(V-1,0));for(var M=1;M<V;++M)F[M-1]=arguments[M];if(z){var w=Q(q);if(w!==null)return this._then(w,void 0,void 0,F,void 0)}return F.push(q),this._then(H,void 0,void 0,F,void 0)};function X(q){return q[this]}function Z(q){var V=+this;if(V<0)V=Math.max(0,V+q.length);return q[V]}$.prototype.get=function(q){var V=typeof q==="number",F;if(!V)if(z){var M=J(q);F=M!==null?M:X}else F=X;else F=Z;return this._then(F,void 0,void 0,q,void 0)}}});var mF0=E((Ns1,dF0)=>{dF0.exports=function($,Y,z,U,Q,J){var I=F4(),K=A7().TypeError,G=F4().inherits,W=I.errorObj,H=I.tryCatch,X={};function Z(D){setTimeout(function(){throw D},0)}function q(D){var N=z(D);if(N!==D&&typeof D._isDisposable==="function"&&typeof D._getDisposer==="function"&&D._isDisposable())N._setDisposable(D._getDisposer());return N}function V(D,N){var A=0,T=D.length,B=new $(Q);function j(){if(A>=T)return B._fulfill();var C=q(D[A++]);if(C instanceof $&&C._isDisposable()){try{C=z(C._getDisposer().tryDispose(N),D.promise)}catch(b){return Z(b)}if(C instanceof $)return C._then(j,Z,null,null,null)}j()}return j(),B}function F(D,N,A){this._data=D,this._promise=N,this._context=A}F.prototype.data=function(){return this._data},F.prototype.promise=function(){return this._promise},F.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return X},F.prototype.tryDispose=function(D){var N=this.resource(),A=this._context;if(A!==void 0)A._pushContext();var T=N!==X?this.doDispose(N,D):null;if(A!==void 0)A._popContext();return this._promise._unsetDisposable(),this._data=null,T},F.isDisposer=function(D){return D!=null&&typeof D.resource==="function"&&typeof D.tryDispose==="function"};function M(D,N,A){this.constructor$(D,N,A)}G(M,F),M.prototype.doDispose=function(D,N){var A=this.data();return A.call(D,D,N)};function w(D){if(F.isDisposer(D))return this.resources[this.index]._setDisposable(D),D.promise();return D}function O(D){this.length=D,this.promise=null,this[D-1]=null}O.prototype._resultCancelled=function(){var D=this.length;for(var N=0;N<D;++N){var A=this[N];if(A instanceof $)A.cancel()}},$.using=function(){var D=arguments.length;if(D<2)return Y("you must pass at least 2 arguments to Promise.using");var N=arguments[D-1];if(typeof N!=="function")return Y("expecting a function but got "+I.classString(N));var A,T=!0;if(D===2&&Array.isArray(arguments[0]))A=arguments[0],D=A.length,T=!1;else A=arguments,D--;var B=new O(D);for(var j=0;j<D;++j){var C=A[j];if(F.isDisposer(C)){var b=C;C=C.promise(),C._setDisposable(b)}else{var k=z(C);if(k instanceof $)C=k._then(w,null,null,{resources:B,index:j},void 0)}B[j]=C}var h=Array(B.length);for(var j=0;j<h.length;++j)h[j]=$.resolve(B[j]).reflect();var i=$.all(h).then(function(U0){for(var x=0;x<U0.length;++x){var d=U0[x];if(d.isRejected())return W.e=d.error(),W;else if(!d.isFulfilled()){i.cancel();return}U0[x]=d.value()}c._pushContext(),N=H(N);var t=T?N.apply(void 0,U0):N(U0),$0=c._popContext();return J.checkForgottenReturns(t,$0,"Promise.using",c),t}),c=i.lastly(function(){var U0=new $.PromiseInspection(i);return V(B,U0)});return B.promise=c,c._setOnCancel(B),c},$.prototype._setDisposable=function(D){this._bitField=this._bitField|131072,this._disposer=D},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(D){if(typeof D==="function")return new M(D,this,U());throw new K}}});var oF0=E((Ds1,lF0)=>{lF0.exports=function($,Y,z){var U=F4(),Q=$.TimeoutError;function J(X){this.handle=X}J.prototype._resultCancelled=function(){clearTimeout(this.handle)};var I=function(X){return K(+this).thenReturn(X)},K=$.delay=function(X,Z){var q,V;if(Z!==void 0){if(q=$.resolve(Z)._then(I,null,null,X,void 0),z.cancellation()&&Z instanceof $)q._setOnCancel(Z)}else{if(q=new $(Y),V=setTimeout(function(){q._fulfill()},+X),z.cancellation())q._setOnCancel(new J(V));q._captureStackTrace()}return q._setAsyncGuaranteed(),q};$.prototype.delay=function(X){return K(X,this)};var G=function(X,Z,q){var V;if(typeof Z!=="string")if(Z instanceof Error)V=Z;else V=new Q("operation timed out");else V=new Q(Z);if(U.markAsOriginatingFromRejection(V),X._attachExtraTrace(V),X._reject(V),q!=null)q.cancel()};function W(X){return clearTimeout(this.handle),X
Line truncated
|
||||
`.replace("propertyName",q))},G=function(q,V,F){var M=F[q];if(typeof M!=="function"){if(!U(q))return null;if(M=V(q),F[q]=M,F[" size"]++,F[" size"]>512){var w=Object.keys(F);for(var O=0;O<256;++O)delete F[w[O]];F[" size"]=w.length-256}}return M};Q=function(q){return G(q,I,AB)},J=function(q){return G(q,K,TB)};function W(q,V){var F;if(q!=null)F=q[V];if(typeof F!=="function"){var M="Object "+Y.classString(q)+" has no method '"+Y.toString(V)+"'";throw new $.TypeError(M)}return F}function H(q){var V=this.pop(),F=W(q,V);return F.apply(q,this)}$.prototype.call=function(q){var V=arguments.length,F=Array(Math.max(V-1,0));for(var M=1;M<V;++M)F[M-1]=arguments[M];if(z){var w=Q(q);if(w!==null)return this._then(w,void 0,void 0,F,void 0)}return F.push(q),this._then(H,void 0,void 0,F,void 0)};function X(q){return q[this]}function Z(q){var V=+this;if(V<0)V=Math.max(0,V+q.length);return q[V]}$.prototype.get=function(q){var V=typeof q==="number",F;if(!V)if(z){var M=J(q);F=M!==null?M:X}else F=X;else F=Z;return this._then(F,void 0,void 0,q,void 0)}}});var mF0=E((Bs1,dF0)=>{dF0.exports=function($,Y,z,U,Q,J){var I=F4(),K=A7().TypeError,G=F4().inherits,W=I.errorObj,H=I.tryCatch,X={};function Z(D){setTimeout(function(){throw D},0)}function q(D){var N=z(D);if(N!==D&&typeof D._isDisposable==="function"&&typeof D._getDisposer==="function"&&D._isDisposable())N._setDisposable(D._getDisposer());return N}function V(D,N){var A=0,T=D.length,B=new $(Q);function j(){if(A>=T)return B._fulfill();var C=q(D[A++]);if(C instanceof $&&C._isDisposable()){try{C=z(C._getDisposer().tryDispose(N),D.promise)}catch(b){return Z(b)}if(C instanceof $)return C._then(j,Z,null,null,null)}j()}return j(),B}function F(D,N,A){this._data=D,this._promise=N,this._context=A}F.prototype.data=function(){return this._data},F.prototype.promise=function(){return this._promise},F.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return X},F.prototype.tryDispose=function(D){var N=this.resource(),A=this._context;if(A!==void 0)A._pushContext();var T=N!==X?this.doDispose(N,D):null;if(A!==void 0)A._popContext();return this._promise._unsetDisposable(),this._data=null,T},F.isDisposer=function(D){return D!=null&&typeof D.resource==="function"&&typeof D.tryDispose==="function"};function M(D,N,A){this.constructor$(D,N,A)}G(M,F),M.prototype.doDispose=function(D,N){var A=this.data();return A.call(D,D,N)};function w(D){if(F.isDisposer(D))return this.resources[this.index]._setDisposable(D),D.promise();return D}function O(D){this.length=D,this.promise=null,this[D-1]=null}O.prototype._resultCancelled=function(){var D=this.length;for(var N=0;N<D;++N){var A=this[N];if(A instanceof $)A.cancel()}},$.using=function(){var D=arguments.length;if(D<2)return Y("you must pass at least 2 arguments to Promise.using");var N=arguments[D-1];if(typeof N!=="function")return Y("expecting a function but got "+I.classString(N));var A,T=!0;if(D===2&&Array.isArray(arguments[0]))A=arguments[0],D=A.length,T=!1;else A=arguments,D--;var B=new O(D);for(var j=0;j<D;++j){var C=A[j];if(F.isDisposer(C)){var b=C;C=C.promise(),C._setDisposable(b)}else{var k=z(C);if(k instanceof $)C=k._then(w,null,null,{resources:B,index:j},void 0)}B[j]=C}var h=Array(B.length);for(var j=0;j<h.length;++j)h[j]=$.resolve(B[j]).reflect();var i=$.all(h).then(function(U0){for(var x=0;x<U0.length;++x){var d=U0[x];if(d.isRejected())return W.e=d.error(),W;else if(!d.isFulfilled()){i.cancel();return}U0[x]=d.value()}c._pushContext(),N=H(N);var t=T?N.apply(void 0,U0):N(U0),$0=c._popContext();return J.checkForgottenReturns(t,$0,"Promise.using",c),t}),c=i.lastly(function(){var U0=new $.PromiseInspection(i);return V(B,U0)});return B.promise=c,c._setOnCancel(B),c},$.prototype._setDisposable=function(D){this._bitField=this._bitField|131072,this._disposer=D},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(D){if(typeof D==="function")return new M(D,this,U());throw new K}}});var oF0=E((Ps1,lF0)=>{lF0.exports=function($,Y,z){var U=F4(),Q=$.TimeoutError;function J(X){this.handle=X}J.prototype._resultCancelled=function(){clearTimeout(this.handle)};var I=function(X){return K(+this).thenReturn(X)},K=$.delay=function(X,Z){var q,V;if(Z!==void 0){if(q=$.resolve(Z)._then(I,null,null,X,void 0),z.cancellation()&&Z instanceof $)q._setOnCancel(Z)}else{if(q=new $(Y),V=setTimeout(function(){q._fulfill()},+X),z.cancellation())q._setOnCancel(new J(V));q._captureStackTrace()}return q._setAsyncGuaranteed(),q};$.prototype.delay=function(X){return K(X,this)};var G=function(X,Z,q){var V;if(typeof Z!=="string")if(Z instanceof Error)V=Z;else V=new Q("operation timed out");else V=new Q(Z);if(U.markAsOriginatingFromRejection(V),X._attachExtraTrace(V),X._reject(V),q!=null)q.cancel()};function W(X){return clearTimeout(this.handle),X
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
|
||||
@@ -229,7 +229,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
|
||||
`);var M=Object(F).yieldHandler,w=q,O=Error().stack;return function(){var D=V.apply(this,arguments),N=new w(void 0,void 0,M,O),A=N.promise();return N._generator=D,N._promiseFulfilled(void 0),A}},$.coroutine.addYieldHandler=function(V){if(typeof V!=="function")throw new K("expecting a function but got "+G.classString(V));X.push(V)},$.spawn=function(V){if(J.deprecated("Promise.spawn()","Promise.coroutine()"),typeof V!=="function")return Y(`generatorFunction must be a function
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var F=new q(V,this),M=F.promise();return F._run($.spawn),M}}});var tF0=E((Ps1,aF0)=>{aF0.exports=function($){var Y=F4(),z=$._async,U=Y.tryCatch,Q=Y.errorObj;function J(G,W){var H=this;if(!Y.isArray(G))return I.call(H,G,W);var X=U(W).apply(H._boundValue(),[null].concat(G));if(X===Q)z.throwLater(X.e)}function I(G,W){var H=this,X=H._boundValue(),Z=G===void 0?U(W).call(X,null):U(W).call(X,null,G);if(Z===Q)z.throwLater(Z.e)}function K(G,W){var H=this;if(!G){var X=Error(G+"");X.cause=G,G=X}var Z=U(W).call(H._boundValue(),G);if(Z===Q)z.throwLater(Z.e)}$.prototype.asCallback=$.prototype.nodeify=function(G,W){if(typeof G=="function"){var H=I;if(W!==void 0&&Object(W).spread)H=J;this._then(H,K,void 0,this,G)}return this}}});var $w0=E((As1,eF0)=>{eF0.exports=function($,Y){var z={},U=F4(),Q=ei(),J=U.withAppended,I=U.maybeWrapAsError,K=U.canEvaluate,G=A7().TypeError,W="Async",H={__isPromisified__:!0},X=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],Z=new RegExp("^(?:"+X.join("|")+")$"),q=function(i){return U.isIdentifier(i)&&i.charAt(0)!=="_"&&i!=="constructor"};function V(i){return!Z.test(i)}function F(i){try{return i.__isPromisified__===!0}catch(c){return!1}}function M(i,c,U0){var x=U.getDataPropertyOrDefault(i,c+U0,H);return x?F(x):!1}function w(i,c,U0){for(var x=0;x<i.length;x+=2){var d=i[x];if(U0.test(d)){var t=d.replace(U0,"");for(var $0=0;$0<i.length;$0+=2)if(i[$0]===t)throw new G(`Cannot promisify an API that has normal methods with '%s'-suffix
|
||||
`);var F=new q(V,this),M=F.promise();return F._run($.spawn),M}}});var tF0=E((Ts1,aF0)=>{aF0.exports=function($){var Y=F4(),z=$._async,U=Y.tryCatch,Q=Y.errorObj;function J(G,W){var H=this;if(!Y.isArray(G))return I.call(H,G,W);var X=U(W).apply(H._boundValue(),[null].concat(G));if(X===Q)z.throwLater(X.e)}function I(G,W){var H=this,X=H._boundValue(),Z=G===void 0?U(W).call(X,null):U(W).call(X,null,G);if(Z===Q)z.throwLater(Z.e)}function K(G,W){var H=this;if(!G){var X=Error(G+"");X.cause=G,G=X}var Z=U(W).call(H._boundValue(),G);if(Z===Q)z.throwLater(Z.e)}$.prototype.asCallback=$.prototype.nodeify=function(G,W){if(typeof G=="function"){var H=I;if(W!==void 0&&Object(W).spread)H=J;this._then(H,K,void 0,this,G)}return this}}});var $w0=E((js1,eF0)=>{eF0.exports=function($,Y){var z={},U=F4(),Q=ei(),J=U.withAppended,I=U.maybeWrapAsError,K=U.canEvaluate,G=A7().TypeError,W="Async",H={__isPromisified__:!0},X=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],Z=new RegExp("^(?:"+X.join("|")+")$"),q=function(i){return U.isIdentifier(i)&&i.charAt(0)!=="_"&&i!=="constructor"};function V(i){return!Z.test(i)}function F(i){try{return i.__isPromisified__===!0}catch(c){return!1}}function M(i,c,U0){var x=U.getDataPropertyOrDefault(i,c+U0,H);return x?F(x):!1}function w(i,c,U0){for(var x=0;x<i.length;x+=2){var d=i[x];if(U0.test(d)){var t=d.replace(U0,"");for(var $0=0;$0<i.length;$0+=2)if(i[$0]===t)throw new G(`Cannot promisify an API that has normal methods with '%s'-suffix
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`.replace("%s",c))}}}function O(i,c,U0,x){var d=U.inheritedDataKeys(i),t=[];for(var $0=0;$0<d.length;++$0){var g=d[$0],p=i[g],e=x===q?!0:q(g,p,i);if(typeof p==="function"&&!F(p)&&!M(i,g,c)&&x(g,p,i,e))t.push(g,p)}return w(t,c,U0),t}var D=function(i){return i.replace(/([$])/,"\\$")},N,A=function(i){var c=[i],U0=Math.max(0,i-1-3);for(var x=i-1;x>=U0;--x)c.push(x);for(var x=i+1;x<=3;++x)c.push(x);return c},T=function(i){return U.filledRange(i,"_arg","")},B=function(i){return U.filledRange(Math.max(i,3),"_arg","")},j=function(i){if(typeof i.length==="number")return Math.max(Math.min(i.length,1024),0);return 0};N=function(i,c,U0,x,d,t){var $0=Math.max(0,j(x)-1),g=A($0),p=typeof i==="string"||c===z;function e(M0){var E0=T(M0).join(", "),G0=M0>0?", ":"",T0;if(p)T0=`ret = callback.call(this, {{args}}, nodeback); break;
|
||||
@@ -273,19 +273,19 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
|
||||
`);c=Object(c);var U0=!!c.multiArgs,x=c.suffix;if(typeof x!=="string")x=W;var d=c.filter;if(typeof d!=="function")d=q;var t=c.promisifier;if(typeof t!=="function")t=b;if(!U.isIdentifier(x))throw RangeError(`suffix must be a valid identifier
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var $0=U.inheritedDataKeys(i);for(var g=0;g<$0.length;++g){var p=i[$0[g]];if($0[g]!=="constructor"&&U.isClass(p))k(p.prototype,x,d,t,U0),k(p,x,d,t,U0)}return k(i,x,d,t,U0)}}});var zw0=E((Ts1,Yw0)=>{Yw0.exports=function($,Y,z,U){var Q=F4(),J=Q.isObject,I=pz(),K;if(typeof Map==="function")K=Map;var G=function(){var Z=0,q=0;function V(F,M){this[Z]=F,this[Z+q]=M,Z++}return function(M){q=M.size,Z=0;var w=Array(M.size*2);return M.forEach(V,w),w}}(),W=function(Z){var q=new K,V=Z.length/2|0;for(var F=0;F<V;++F){var M=Z[V+F],w=Z[F];q.set(M,w)}return q};function H(Z){var q=!1,V;if(K!==void 0&&Z instanceof K)V=G(Z),q=!0;else{var F=I.keys(Z),M=F.length;V=Array(M*2);for(var w=0;w<M;++w){var O=F[w];V[w]=Z[O],V[w+M]=O}}this.constructor$(V),this._isMap=q,this._init$(void 0,-3)}Q.inherits(H,Y),H.prototype._init=function(){},H.prototype._promiseFulfilled=function(Z,q){this._values[q]=Z;var V=++this._totalResolved;if(V>=this._length){var F;if(this._isMap)F=W(this._values);else{F={};var M=this.length();for(var w=0,O=this.length();w<O;++w)F[this._values[w+M]]=this._values[w]}return this._resolve(F),!0}return!1},H.prototype.shouldCopyValues=function(){return!1},H.prototype.getActualLength=function(Z){return Z>>1};function X(Z){var q,V=z(Z);if(!J(V))return U(`cannot await properties of a non-object
|
||||
`);var $0=U.inheritedDataKeys(i);for(var g=0;g<$0.length;++g){var p=i[$0[g]];if($0[g]!=="constructor"&&U.isClass(p))k(p.prototype,x,d,t,U0),k(p,x,d,t,U0)}return k(i,x,d,t,U0)}}});var zw0=E((Es1,Yw0)=>{Yw0.exports=function($,Y,z,U){var Q=F4(),J=Q.isObject,I=pz(),K;if(typeof Map==="function")K=Map;var G=function(){var Z=0,q=0;function V(F,M){this[Z]=F,this[Z+q]=M,Z++}return function(M){q=M.size,Z=0;var w=Array(M.size*2);return M.forEach(V,w),w}}(),W=function(Z){var q=new K,V=Z.length/2|0;for(var F=0;F<V;++F){var M=Z[V+F],w=Z[F];q.set(M,w)}return q};function H(Z){var q=!1,V;if(K!==void 0&&Z instanceof K)V=G(Z),q=!0;else{var F=I.keys(Z),M=F.length;V=Array(M*2);for(var w=0;w<M;++w){var O=F[w];V[w]=Z[O],V[w+M]=O}}this.constructor$(V),this._isMap=q,this._init$(void 0,-3)}Q.inherits(H,Y),H.prototype._init=function(){},H.prototype._promiseFulfilled=function(Z,q){this._values[q]=Z;var V=++this._totalResolved;if(V>=this._length){var F;if(this._isMap)F=W(this._values);else{F={};var M=this.length();for(var w=0,O=this.length();w<O;++w)F[this._values[w+M]]=this._values[w]}return this._resolve(F),!0}return!1},H.prototype.shouldCopyValues=function(){return!1},H.prototype.getActualLength=function(Z){return Z>>1};function X(Z){var q,V=z(Z);if(!J(V))return U(`cannot await properties of a non-object
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);else if(V instanceof $)q=V._then($.props,void 0,void 0,void 0,void 0);else q=new H(V).promise();if(V instanceof $)q._propagateFrom(V,2);return q}$.prototype.props=function(){return X(this)},$.props=function(Z){return X(Z)}}});var Qw0=E((js1,Uw0)=>{Uw0.exports=function($,Y,z,U){var Q=F4(),J=function(K){return K.then(function(G){return I(G,K)})};function I(K,G){var W=z(K);if(W instanceof $)return J(W);else if(K=Q.asArray(K),K===null)return U("expecting an array or an iterable object but got "+Q.classString(K));var H=new $(Y);if(G!==void 0)H._propagateFrom(G,3);var{_fulfill:X,_reject:Z}=H;for(var q=0,V=K.length;q<V;++q){var F=K[q];if(F===void 0&&!(q in K))continue;$.cast(F)._then(X,Z,void 0,H,null)}return H}$.race=function(K){return I(K,void 0)},$.prototype.race=function(){return I(this,void 0)}}});var Iw0=E((Es1,Jw0)=>{Jw0.exports=function($,Y,z,U,Q,J){var I=$._getDomain,K=F4(),G=K.tryCatch;function W(V,F,M,w){this.constructor$(V);var O=I();if(this._fn=O===null?F:K.domainBind(O,F),M!==void 0)M=$.resolve(M),M._attachCancellationCallback(this);if(this._initialValue=M,this._currentCancellable=null,w===Q)this._eachValues=Array(this._length);else if(w===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}K.inherits(W,Y),W.prototype._gotAccum=function(V){if(this._eachValues!==void 0&&this._eachValues!==null&&V!==Q)this._eachValues.push(V)},W.prototype._eachComplete=function(V){if(this._eachValues!==null)this._eachValues.push(V);return this._eachValues},W.prototype._init=function(){},W.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},W.prototype.shouldCopyValues=function(){return!1},W.prototype._resolve=function(V){this._promise._resolveCallback(V),this._values=null},W.prototype._resultCancelled=function(V){if(V===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},W.prototype._iterate=function(V){this._values=V;var F,M,w=V.length;if(this._initialValue!==void 0)F=this._initialValue,M=0;else F=$.resolve(V[0]),M=1;if(this._currentCancellable=F,!F.isRejected())for(;M<w;++M){var O={accum:null,value:V[M],index:M,length:w,array:this};F=F._then(Z,void 0,void 0,O,void 0)}if(this._eachValues!==void 0)F=F._then(this._eachComplete,void 0,void 0,this,void 0);F._then(H,H,void 0,F,this)},$.prototype.reduce=function(V,F){return X(this,V,F,null)},$.reduce=function(V,F,M,w){return X(V,F,M,w)};function H(V,F){if(this.isFulfilled())F._resolve(V);else F._reject(V)}function X(V,F,M,w){if(typeof F!=="function")return z("expecting a function but got "+K.classString(F));var O=new W(V,F,M,w);return O.promise()}function Z(V){this.accum=V,this.array._gotAccum(V);var F=U(this.value,this.array._promise);if(F instanceof $)return this.array._currentCancellable=F,F._then(q,void 0,void 0,this,void 0);else return q.call(this,F)}function q(V){var F=this.array,M=F._promise,w=G(F._fn);M._pushContext();var O;if(F._eachValues!==void 0)O=w.call(M._boundValue(),V,this.index,this.length);else O=w.call(M._boundValue(),this.accum,V,this.index,this.length);if(O instanceof $)F._currentCancellable=O;var D=M._popContext();return J.checkForgottenReturns(O,D,F._eachValues!==void 0?"Promise.each":"Promise.reduce",M),O}}});var Gw0=E((Cs1,Kw0)=>{Kw0.exports=function($,Y,z){var U=$.PromiseInspection,Q=F4();function J(I){this.constructor$(I)}Q.inherits(J,Y),J.prototype._promiseResolved=function(I,K){this._values[I]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},J.prototype._promiseFulfilled=function(I,K){var G=new U;return G._bitField=33554432,G._settledValueField=I,this._promiseResolved(K,G)},J.prototype._promiseRejected=function(I,K){var G=new U;return G._bitField=16777216,G._settledValueField=I,this._promiseResolved(K,G)},$.settle=function(I){return z.deprecated(".settle()",".reflect()"),new J(I).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Hw0=E((Rs1,Ww0)=>{Ww0.exports=function($,Y,z){var U=F4(),Q=A7().RangeError,J=A7().AggregateError,I=U.isArray,K={};function G(H){this.constructor$(H),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(G,Y),G.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var H=I(this._values);if(!this._isResolved()&&H&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},G.prototype.init=function(){this._initialized=!0,this._init()},G.prototype.setUnwrap=function(){this._unwrap=!0},G.prototype.howMany=function(){return this._howMany},G.prototype.setHowMany=function(H){this._howMany=H},G.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()=
Line truncated
|
||||
`);else if(V instanceof $)q=V._then($.props,void 0,void 0,void 0,void 0);else q=new H(V).promise();if(V instanceof $)q._propagateFrom(V,2);return q}$.prototype.props=function(){return X(this)},$.props=function(Z){return X(Z)}}});var Qw0=E((Cs1,Uw0)=>{Uw0.exports=function($,Y,z,U){var Q=F4(),J=function(K){return K.then(function(G){return I(G,K)})};function I(K,G){var W=z(K);if(W instanceof $)return J(W);else if(K=Q.asArray(K),K===null)return U("expecting an array or an iterable object but got "+Q.classString(K));var H=new $(Y);if(G!==void 0)H._propagateFrom(G,3);var{_fulfill:X,_reject:Z}=H;for(var q=0,V=K.length;q<V;++q){var F=K[q];if(F===void 0&&!(q in K))continue;$.cast(F)._then(X,Z,void 0,H,null)}return H}$.race=function(K){return I(K,void 0)},$.prototype.race=function(){return I(this,void 0)}}});var Iw0=E((Rs1,Jw0)=>{Jw0.exports=function($,Y,z,U,Q,J){var I=$._getDomain,K=F4(),G=K.tryCatch;function W(V,F,M,w){this.constructor$(V);var O=I();if(this._fn=O===null?F:K.domainBind(O,F),M!==void 0)M=$.resolve(M),M._attachCancellationCallback(this);if(this._initialValue=M,this._currentCancellable=null,w===Q)this._eachValues=Array(this._length);else if(w===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}K.inherits(W,Y),W.prototype._gotAccum=function(V){if(this._eachValues!==void 0&&this._eachValues!==null&&V!==Q)this._eachValues.push(V)},W.prototype._eachComplete=function(V){if(this._eachValues!==null)this._eachValues.push(V);return this._eachValues},W.prototype._init=function(){},W.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},W.prototype.shouldCopyValues=function(){return!1},W.prototype._resolve=function(V){this._promise._resolveCallback(V),this._values=null},W.prototype._resultCancelled=function(V){if(V===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},W.prototype._iterate=function(V){this._values=V;var F,M,w=V.length;if(this._initialValue!==void 0)F=this._initialValue,M=0;else F=$.resolve(V[0]),M=1;if(this._currentCancellable=F,!F.isRejected())for(;M<w;++M){var O={accum:null,value:V[M],index:M,length:w,array:this};F=F._then(Z,void 0,void 0,O,void 0)}if(this._eachValues!==void 0)F=F._then(this._eachComplete,void 0,void 0,this,void 0);F._then(H,H,void 0,F,this)},$.prototype.reduce=function(V,F){return X(this,V,F,null)},$.reduce=function(V,F,M,w){return X(V,F,M,w)};function H(V,F){if(this.isFulfilled())F._resolve(V);else F._reject(V)}function X(V,F,M,w){if(typeof F!=="function")return z("expecting a function but got "+K.classString(F));var O=new W(V,F,M,w);return O.promise()}function Z(V){this.accum=V,this.array._gotAccum(V);var F=U(this.value,this.array._promise);if(F instanceof $)return this.array._currentCancellable=F,F._then(q,void 0,void 0,this,void 0);else return q.call(this,F)}function q(V){var F=this.array,M=F._promise,w=G(F._fn);M._pushContext();var O;if(F._eachValues!==void 0)O=w.call(M._boundValue(),V,this.index,this.length);else O=w.call(M._boundValue(),this.accum,V,this.index,this.length);if(O instanceof $)F._currentCancellable=O;var D=M._popContext();return J.checkForgottenReturns(O,D,F._eachValues!==void 0?"Promise.each":"Promise.reduce",M),O}}});var Gw0=E((_s1,Kw0)=>{Kw0.exports=function($,Y,z){var U=$.PromiseInspection,Q=F4();function J(I){this.constructor$(I)}Q.inherits(J,Y),J.prototype._promiseResolved=function(I,K){this._values[I]=K;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},J.prototype._promiseFulfilled=function(I,K){var G=new U;return G._bitField=33554432,G._settledValueField=I,this._promiseResolved(K,G)},J.prototype._promiseRejected=function(I,K){var G=new U;return G._bitField=16777216,G._settledValueField=I,this._promiseResolved(K,G)},$.settle=function(I){return z.deprecated(".settle()",".reflect()"),new J(I).promise()},$.prototype.settle=function(){return $.settle(this)}}});var Hw0=E((vs1,Ww0)=>{Ww0.exports=function($,Y,z){var U=F4(),Q=A7().RangeError,J=A7().AggregateError,I=U.isArray,K={};function G(H){this.constructor$(H),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(G,Y),G.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var H=I(this._values);if(!this._isResolved()&&H&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},G.prototype.init=function(){this._initialized=!0,this._init()},G.prototype.setUnwrap=function(){this._unwrap=!0},G.prototype.howMany=function(){return this._howMany},G.prototype.setHowMany=function(H){this._howMany=H},G.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()=
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var Z=new G(H),q=Z.promise();return Z.setHowMany(X),Z.init(),q}$.some=function(H,X){return W(H,X)},$.prototype.some=function(H){return W(this,H)},$._SomePromiseArray=G}});var Zw0=E((_s1,Xw0)=>{Xw0.exports=function($,Y){var z=$.map;$.prototype.filter=function(U,Q){return z(this,U,Q,Y)},$.filter=function(U,Q,J){return z(U,Q,J,Y)}}});var Vw0=E((vs1,qw0)=>{qw0.exports=function($,Y){var{reduce:z,all:U}=$;function Q(){return U(this)}function J(I,K){return z(I,K,Y,Y)}$.prototype.each=function(I){return z(this,I,Y,0)._then(Q,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(I){return z(this,I,Y,Y)},$.each=function(I,K){return z(I,K,Y,0)._then(Q,void 0,void 0,I,void 0)},$.mapSeries=J}});var Fw0=E((hs1,Lw0)=>{Lw0.exports=function($){var Y=$._SomePromiseArray;function z(U){var Q=new Y(U),J=Q.promise();return Q.setHowMany(1),Q.setUnwrap(),Q.init(),J}$.any=function(U){return z(U)},$.prototype.any=function(){return z(this)}}});var ww0=E((Ss1,Yc)=>{Yc.exports=function(){var $=function(){return new X(`circular promise resolution chain
|
||||
`);var Z=new G(H),q=Z.promise();return Z.setHowMany(X),Z.init(),q}$.some=function(H,X){return W(H,X)},$.prototype.some=function(H){return W(this,H)},$._SomePromiseArray=G}});var Zw0=E((hs1,Xw0)=>{Xw0.exports=function($,Y){var z=$.map;$.prototype.filter=function(U,Q){return z(this,U,Q,Y)},$.filter=function(U,Q,J){return z(U,Q,J,Y)}}});var Vw0=E((Ss1,qw0)=>{qw0.exports=function($,Y){var{reduce:z,all:U}=$;function Q(){return U(this)}function J(I,K){return z(I,K,Y,Y)}$.prototype.each=function(I){return z(this,I,Y,0)._then(Q,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(I){return z(this,I,Y,Y)},$.each=function(I,K){return z(I,K,Y,0)._then(Q,void 0,void 0,I,void 0)},$.mapSeries=J}});var Fw0=E((gs1,Lw0)=>{Lw0.exports=function($){var Y=$._SomePromiseArray;function z(U){var Q=new Y(U),J=Q.promise();return Q.setHowMany(1),Q.setUnwrap(),Q.init(),J}$.any=function(U){return z(U)},$.prototype.any=function(){return z(this)}}});var ww0=E((ys1,Yc)=>{Yc.exports=function(){var $=function(){return new X(`circular promise resolution chain
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)},Y=function(){return new h.PromiseInspection(this._target())},z=function(x){return h.reject(new X(x))};function U(){}var Q={},J=F4(),I;if(J.isNode)I=function(){var x=process.domain;if(x===void 0)x=null;return x};else I=function(){return null};J.notEnumerableProp(h,"_getDomain",I);var K=pz(),G=HF0(),W=new G;K.defineProperty(h,"_async",{value:W});var H=A7(),X=h.TypeError=H.TypeError;h.RangeError=H.RangeError;var Z=h.CancellationError=H.CancellationError;h.TimeoutError=H.TimeoutError,h.OperationalError=H.OperationalError,h.RejectionError=H.OperationalError,h.AggregateError=H.AggregateError;var q=function(){},V={},F={},M=LF0()(h,q),w=wF0()(h,q,M,z,U),O=OF0()(h),D=O.create,N=DF0()(h,O),A=N.CapturedTrace,T=PF0()(h,M),B=TF0()(F),j=ei(),C=J.errorObj,b=J.tryCatch;function k(x,d){if(typeof d!=="function")throw new X("expecting a function but got "+J.classString(d));if(x.constructor!==h)throw new X(`the promise constructor cannot be invoked directly
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)}function h(x){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,x!==q)k(this,x),this._resolveFromExecutor(x);this._promiseCreated(),this._fireEvent("promiseCreated",this)}h.prototype.toString=function(){return"[object Promise]"},h.prototype.caught=h.prototype.catch=function(x){var d=arguments.length;if(d>1){var t=Array(d-1),$0=0,g;for(g=0;g<d-1;++g){var p=arguments[g];if(J.isObject(p))t[$0++]=p;else return z("expecting an object but got A catch statement predicate "+J.classString(p))}return t.length=$0,x=arguments[g],this.then(void 0,B(t,x,this))}return this.then(void 0,x)},h.prototype.reflect=function(){return this._then(Y,Y,void 0,this,void 0)},h.prototype.then=function(x,d){if(N.warnings()&&arguments.length>0&&typeof x!=="function"&&typeof d!=="function"){var t=".then() only accepts functions but was passed: "+J.classString(x);if(arguments.length>1)t+=", "+J.classString(d);this._warn(t)}return this._then(x,d,void 0,void 0,void 0)},h.prototype.done=function(x,d){var t=this._then(x,d,void 0,void 0,void 0);t._setIsFinal()},h.prototype.spread=function(x){if(typeof x!=="function")return z("expecting a function but got "+J.classString(x));return this.all()._then(x,void 0,void 0,V,void 0)},h.prototype.toJSON=function(){var x={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())x.fulfillmentValue=this.value(),x.isFulfilled=!0;else if(this.isRejected())x.rejectionReason=this.reason(),x.isRejected=!0;return x},h.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new w(this).promise()},h.prototype.error=function(x){return this.caught(J.originatesFromRejection,x)},h.getNewLibraryCopy=Yc.exports,h.is=function(x){return x instanceof h},h.fromNode=h.fromCallback=function(x){var d=new h(q);d._captureStackTrace();var t=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,$0=b(x)(j(d,t));if($0===C)d._rejectCallback($0.e,!0);if(!d._isFateSealed())d._setAsyncGuaranteed();return d},h.all=function(x){return new w(x).promise()},h.cast=function(x){var d=M(x);if(!(d instanceof h))d=new h(q),d._captureStackTrace(),d._setFulfilled(),d._rejectionHandler0=x;return d},h.resolve=h.fulfilled=h.cast,h.reject=h.rejected=function(x){var d=new h(q);return d._captureStackTrace(),d._rejectCallback(x,!0),d},h.setScheduler=function(x){if(typeof x!=="function")throw new X("expecting a function but got "+J.classString(x));return W.setScheduler(x)},h.prototype._then=function(x,d,t,$0,g){var p=g!==void 0,e=p?g:new h(q),y=this._target(),s=y._bitField;if(!p){if(e._propagateFrom(this,3),e._captureStackTrace(),$0===void 0&&(this._bitField&2097152)!==0)if((s&50397184)!==0)$0=this._boundValue();else $0=y===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,e)}var Y0=I();if((s&50397184)!==0){var M0,E0,G0=y._settlePromiseCtx;if((s&33554432)!==0)E0=y._rejectionHandler0,M0=x;else if((s&16777216)!==0)E0=y._fulfillmentHandler0,M0=d,y._unsetRejectionIsUnhandled();else G0=y._settlePromiseLateCancellationObserver,E0=new Z("late cancellation observer"),y._attachExtraTrace(E0),M0=d;W.invoke(G0,y,{handler:Y0===null?M0:typeof M0==="function"&&J.domainBind(Y0,M0),promise:e,receiver:$0,value:E0})}else y._addCallbacks(x,d,e,$0,Y0);return e},h.prototype._length=function(){return this._bitField&65535},h.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},h.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},h.prototype._setLength=function(x){this._bitField=this._bitField&-65536|x&65535},h.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},h.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},h.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},h.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},h.prototype._isFinal=function(){return(this._bitField&4194304)>0},h.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},h.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},h.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},h.prototype._setAsyncGuaranteed=function(){if(W.hasCustomScheduler())return;this._bitField=this._bitField|134217728},h.prototype._receiverAt=function(x){var d=x===0?this._receiver0:this[x*4-4+3];if(d===Q)return;else if(d===void 0&&this._isBound())return this._boundValue();return d},h.prototype._promiseAt=function(x){return this[x*4-4+2]},h.prototype._fulfillmentHandlerAt=function(x){return this[x*4-4+0]},h.prototype._rejectionHandlerAt=function(x){return this[x*4-4+1]},h.prototype._boundValue=function(){},h.prototype._migrateCallback0=function(x){var{_bitField:d,_fulfillmentHandler
Line truncated
|
||||
`)}function h(x){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,x!==q)k(this,x),this._resolveFromExecutor(x);this._promiseCreated(),this._fireEvent("promiseCreated",this)}h.prototype.toString=function(){return"[object Promise]"},h.prototype.caught=h.prototype.catch=function(x){var d=arguments.length;if(d>1){var t=Array(d-1),$0=0,g;for(g=0;g<d-1;++g){var p=arguments[g];if(J.isObject(p))t[$0++]=p;else return z("expecting an object but got A catch statement predicate "+J.classString(p))}return t.length=$0,x=arguments[g],this.then(void 0,B(t,x,this))}return this.then(void 0,x)},h.prototype.reflect=function(){return this._then(Y,Y,void 0,this,void 0)},h.prototype.then=function(x,d){if(N.warnings()&&arguments.length>0&&typeof x!=="function"&&typeof d!=="function"){var t=".then() only accepts functions but was passed: "+J.classString(x);if(arguments.length>1)t+=", "+J.classString(d);this._warn(t)}return this._then(x,d,void 0,void 0,void 0)},h.prototype.done=function(x,d){var t=this._then(x,d,void 0,void 0,void 0);t._setIsFinal()},h.prototype.spread=function(x){if(typeof x!=="function")return z("expecting a function but got "+J.classString(x));return this.all()._then(x,void 0,void 0,V,void 0)},h.prototype.toJSON=function(){var x={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())x.fulfillmentValue=this.value(),x.isFulfilled=!0;else if(this.isRejected())x.rejectionReason=this.reason(),x.isRejected=!0;return x},h.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new w(this).promise()},h.prototype.error=function(x){return this.caught(J.originatesFromRejection,x)},h.getNewLibraryCopy=Yc.exports,h.is=function(x){return x instanceof h},h.fromNode=h.fromCallback=function(x){var d=new h(q);d._captureStackTrace();var t=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,$0=b(x)(j(d,t));if($0===C)d._rejectCallback($0.e,!0);if(!d._isFateSealed())d._setAsyncGuaranteed();return d},h.all=function(x){return new w(x).promise()},h.cast=function(x){var d=M(x);if(!(d instanceof h))d=new h(q),d._captureStackTrace(),d._setFulfilled(),d._rejectionHandler0=x;return d},h.resolve=h.fulfilled=h.cast,h.reject=h.rejected=function(x){var d=new h(q);return d._captureStackTrace(),d._rejectCallback(x,!0),d},h.setScheduler=function(x){if(typeof x!=="function")throw new X("expecting a function but got "+J.classString(x));return W.setScheduler(x)},h.prototype._then=function(x,d,t,$0,g){var p=g!==void 0,e=p?g:new h(q),y=this._target(),s=y._bitField;if(!p){if(e._propagateFrom(this,3),e._captureStackTrace(),$0===void 0&&(this._bitField&2097152)!==0)if((s&50397184)!==0)$0=this._boundValue();else $0=y===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,e)}var Y0=I();if((s&50397184)!==0){var M0,E0,G0=y._settlePromiseCtx;if((s&33554432)!==0)E0=y._rejectionHandler0,M0=x;else if((s&16777216)!==0)E0=y._fulfillmentHandler0,M0=d,y._unsetRejectionIsUnhandled();else G0=y._settlePromiseLateCancellationObserver,E0=new Z("late cancellation observer"),y._attachExtraTrace(E0),M0=d;W.invoke(G0,y,{handler:Y0===null?M0:typeof M0==="function"&&J.domainBind(Y0,M0),promise:e,receiver:$0,value:E0})}else y._addCallbacks(x,d,e,$0,Y0);return e},h.prototype._length=function(){return this._bitField&65535},h.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},h.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},h.prototype._setLength=function(x){this._bitField=this._bitField&-65536|x&65535},h.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},h.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},h.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},h.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},h.prototype._isFinal=function(){return(this._bitField&4194304)>0},h.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},h.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},h.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},h.prototype._setAsyncGuaranteed=function(){if(W.hasCustomScheduler())return;this._bitField=this._bitField|134217728},h.prototype._receiverAt=function(x){var d=x===0?this._receiver0:this[x*4-4+3];if(d===Q)return;else if(d===void 0&&this._isBound())return this._boundValue();return d},h.prototype._promiseAt=function(x){return this[x*4-4+2]},h.prototype._fulfillmentHandlerAt=function(x){return this[x*4-4+0]},h.prototype._rejectionHandlerAt=function(x){return this[x*4-4+1]},h.prototype._boundValue=function(){},h.prototype._migrateCallback0=function(x){var{_bitField:d,_fulfillmentHandler
Line truncated
|
||||
path = %s
|
||||
syscall = %s
|
||||
fstream_type = %s
|
||||
@@ -295,25 +295,25 @@ fstream_class = %s
|
||||
fstream_stack =
|
||||
%s
|
||||
`,Y||"UNKNOWN",U.stack,U.path,U.syscall,U.fstream_type,U.fstream_path,U.fstream_unc_path,U.fstream_class,U.fstream_stack.join(`
|
||||
`));else z.emit("warn",U)};C2.prototype.info=function($,Y){this.emit("info",$,Y)};C2.prototype.error=function($,Y,z){var U=sM0($,Y,this);if(z)throw U;else this.emit("error",U)};function sM0($,Y,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||Y,$.path=$.path||z.path,$.fstream_type=$.fstream_type||z.type,$.fstream_path=$.fstream_path||z.path,z._path!==z.path)$.fstream_unc_path=$.fstream_unc_path||z._path;if(z.linkpath)$.fstream_linkpath=$.fstream_linkpath||z.linkpath;return $.fstream_class=$.fstream_class||z.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var WZ=E((Wa1,tM0)=>{tM0.exports=PF1;function PF1($){var Y=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&Y.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,Q=Y.length;U<Q;U++){z=Y[U];var J=$[z]||$["is"+z];if(typeof J==="function")J=J.call($);if(J)return $[z]=!0,$.type=z,z}return null}});var ic=E((Ha1,eM0)=>{eM0.exports=HZ;var AF1=l8(),TF1=X1(),bc=ez();TF1(HZ,bc);function HZ($){var Y=this;if(!(Y instanceof HZ))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);bc.call(Y,$)}HZ.prototype._stat=function($){var Y=this;AF1.readlink(Y._path,function(z,U){if(z)return Y.error(z);Y.linkpath=Y.props.linkpath=U,Y.emit("linkpath",U),bc.prototype._stat.call(Y,$)})};HZ.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var nc=E((Xa1,zO0)=>{zO0.exports=F9;var YO0=l8(),jF1=X1(),XZ=I0("path"),cc=ez(),$O0=I0("assert").ok;jF1(F9,cc);function F9($){var Y=this;if(!(Y instanceof F9))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(Y.entries=null,Y._index=-1,Y._paused=!1,Y._length=-1,$.sort)this.sort=$.sort;cc.call(this,$)}F9.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,YO0.readdir($._path,function(Y,z){if(Y)return $.error(Y);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};F9.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var Y=XZ.resolve($._path,$.entries[$._index]);$O0(Y!==$._path),$O0($.entries[$._index]),$._currentEntry=Y,YO0[$.props.follow?"stat":"lstat"](Y,function(z,U){if(z)return $.error(z);var Q=$._proxy||$;U.path=Y,U.basename=XZ.basename(Y),U.dirname=XZ.dirname(Y);var J=$.getChildProps.call(Q,U);J.path=Y,J.basename=XZ.basename(Y),J.dirname=XZ.dirname(Y);var I=cc(J,U);$._currentEntry=I,I.on("pause",function(W){if(!$._paused&&!I._disowned)$.pause(W)}),I.on("resume",function(W){if($._paused&&!I._disowned)$.resume(W)}),I.on("stat",function(W){if($.emit("_entryStat",I,W),I._aborted)return;if(I._paused)I.once("resume",function(){$.emit("entryStat",I,W)});else $.emit("entryStat",I,W)}),I.on("ready",function W(){if($._paused)return I.pause($),$.once("resume",W);if(I.type==="Socket")$.emit("socket",I);else $.emitEntry(I)});var K=!1;I.on("close",G),I.on("disown",G);function G(){if(K)return;if(K=!0,$.emit("childEnd",I),$.emit("entryEnd",I),$._currentEntry=null,!$._paused)$._read()}I.on("error",function(W){if(I._swallowErrors)$.warn(W),I.emit("end"),I.emit("close");else $.emit("error",W)}),["child","childEnd","warn"].forEach(function(W){I.on(W,$.emit.bind($,W))})})};F9.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};F9.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};F9.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._currentEntry&&Y._currentEntry.pause)Y._currentEntry.pause($);Y.emit("pause",$)};F9.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y._paused=!1,Y.emit("resume",$),Y._paused)return;if(Y._currentEntry){if(Y._currentEntry.resume)Y._currentEntry.resume($)}else Y._read()};F9.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var pc=E((Za1,IO0)=>{IO0.exports=$U;var EF1=l8(),CF1=X1(),UO0=ez(),QO0={EOF:!0},JO0={CLOSE:!0};CF1($U,UO0);function $U($){var Y=this;if(!(Y instanceof $U))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);Y._buffer=[],Y._bytesEmitted=0,UO0.call(Y,$)}$U.prototype._getStream=function(){var $=this,Y=$._stream=EF1.createReadStream($._path,$.p
Line truncated
|
||||
`));else z.emit("warn",U)};C2.prototype.info=function($,Y){this.emit("info",$,Y)};C2.prototype.error=function($,Y,z){var U=sM0($,Y,this);if(z)throw U;else this.emit("error",U)};function sM0($,Y,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||Y,$.path=$.path||z.path,$.fstream_type=$.fstream_type||z.type,$.fstream_path=$.fstream_path||z.path,z._path!==z.path)$.fstream_unc_path=$.fstream_unc_path||z._path;if(z.linkpath)$.fstream_linkpath=$.fstream_linkpath||z.linkpath;return $.fstream_class=$.fstream_class||z.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var WZ=E((Xa1,tM0)=>{tM0.exports=AF1;function AF1($){var Y=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&Y.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,Q=Y.length;U<Q;U++){z=Y[U];var J=$[z]||$["is"+z];if(typeof J==="function")J=J.call($);if(J)return $[z]=!0,$.type=z,z}return null}});var ic=E((Za1,eM0)=>{eM0.exports=HZ;var TF1=l8(),jF1=X1(),bc=ez();jF1(HZ,bc);function HZ($){var Y=this;if(!(Y instanceof HZ))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);bc.call(Y,$)}HZ.prototype._stat=function($){var Y=this;TF1.readlink(Y._path,function(z,U){if(z)return Y.error(z);Y.linkpath=Y.props.linkpath=U,Y.emit("linkpath",U),bc.prototype._stat.call(Y,$)})};HZ.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var nc=E((qa1,zO0)=>{zO0.exports=F9;var YO0=l8(),EF1=X1(),XZ=I0("path"),cc=ez(),$O0=I0("assert").ok;EF1(F9,cc);function F9($){var Y=this;if(!(Y instanceof F9))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(Y.entries=null,Y._index=-1,Y._paused=!1,Y._length=-1,$.sort)this.sort=$.sort;cc.call(this,$)}F9.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,YO0.readdir($._path,function(Y,z){if(Y)return $.error(Y);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};F9.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var Y=XZ.resolve($._path,$.entries[$._index]);$O0(Y!==$._path),$O0($.entries[$._index]),$._currentEntry=Y,YO0[$.props.follow?"stat":"lstat"](Y,function(z,U){if(z)return $.error(z);var Q=$._proxy||$;U.path=Y,U.basename=XZ.basename(Y),U.dirname=XZ.dirname(Y);var J=$.getChildProps.call(Q,U);J.path=Y,J.basename=XZ.basename(Y),J.dirname=XZ.dirname(Y);var I=cc(J,U);$._currentEntry=I,I.on("pause",function(W){if(!$._paused&&!I._disowned)$.pause(W)}),I.on("resume",function(W){if($._paused&&!I._disowned)$.resume(W)}),I.on("stat",function(W){if($.emit("_entryStat",I,W),I._aborted)return;if(I._paused)I.once("resume",function(){$.emit("entryStat",I,W)});else $.emit("entryStat",I,W)}),I.on("ready",function W(){if($._paused)return I.pause($),$.once("resume",W);if(I.type==="Socket")$.emit("socket",I);else $.emitEntry(I)});var K=!1;I.on("close",G),I.on("disown",G);function G(){if(K)return;if(K=!0,$.emit("childEnd",I),$.emit("entryEnd",I),$._currentEntry=null,!$._paused)$._read()}I.on("error",function(W){if(I._swallowErrors)$.warn(W),I.emit("end"),I.emit("close");else $.emit("error",W)}),["child","childEnd","warn"].forEach(function(W){I.on(W,$.emit.bind($,W))})})};F9.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};F9.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};F9.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._currentEntry&&Y._currentEntry.pause)Y._currentEntry.pause($);Y.emit("pause",$)};F9.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y._paused=!1,Y.emit("resume",$),Y._paused)return;if(Y._currentEntry){if(Y._currentEntry.resume)Y._currentEntry.resume($)}else Y._read()};F9.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var pc=E((Va1,IO0)=>{IO0.exports=$U;var CF1=l8(),RF1=X1(),UO0=ez(),QO0={EOF:!0},JO0={CLOSE:!0};RF1($U,UO0);function $U($){var Y=this;if(!(Y instanceof $U))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);Y._buffer=[],Y._bytesEmitted=0,UO0.call(Y,$)}$U.prototype._getStream=function(){var $=this,Y=$._stream=CF1.createReadStream($._path,$.p
Line truncated
|
||||
expect: `+$.props.size+`
|
||||
actual: `+$._bytesEmitted)}),Y.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(JO0),$._read();else $.emit("close")}),Y.on("error",function(z){$.emit("error",z)}),$._read()};$U.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var Y=$._buffer;for(var z=0,U=Y.length;z<U;z++){var Q=Y[z];if(Q===QO0)$.emit("end");else if(Q===JO0)$.emit("close");else $.emit("data",Q);if($._paused){$._buffer=Y.slice(z);return}}$._buffer.length=0}};$U.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._stream)Y._stream.pause();Y.emit("pause",$)};$U.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y.emit("resume",$),Y._paused=!1,Y._stream)Y._stream.resume();Y._read()}});var WO0=E((qa1,GO0)=>{GO0.exports=sB;var RF1=X1(),KO0=ez();RF1(sB,KO0);function sB($){var Y=this;if(!(Y instanceof sB))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);KO0.call(Y,$)}sB.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var mc=E((Va1,HO0)=>{HO0.exports=YU;var dc=ez(),_F1=WZ(),vF1=X1(),hF1=l8();vF1(YU,dc);function YU($){var Y=this;if(!(Y instanceof YU))throw Error("ProxyReader must be called as constructor.");Y.props=$,Y._buffer=[],Y.ready=!1,dc.call(Y,$)}YU.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";hF1[z](Y.path,function(U,Q){var J;if(U||!Q)J="File";else J=_F1(Q);Y[J]=!0,Y.type=$.type=J,$._old=Q,$._addProxy(dc(Y,Q))})};YU.prototype._addProxy=function($){var Y=this;if(Y._proxyTarget)return Y.error("proxy already set");Y._proxyTarget=$,$._proxy=Y,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$),$.on("ready",function(){Y.ready=!0,Y.emit("ready")});var z=Y._buffer;Y._buffer.length=0,z.forEach(function(U){$[U[0]].apply($,U[1])})};YU.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};YU.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var ez=E((La1,qO0)=>{qO0.exports=O5;var SF1=l8(),gF1=I0("stream").Stream,yF1=X1(),lc=I0("path"),oc=WZ(),aB=O5.hardLinks={},XO0=rB();yF1(O5,XO0);var ZO0=ic();function O5($,Y){var z=this;if(!(z instanceof O5))return new O5($,Y);if(typeof $==="string")$={path:$};var U,Q;if($.type&&typeof $.type==="function")U=$.type,Q=U;else U=oc($),Q=O5;if(Y&&!U)U=oc(Y),$[U]=!0,$.type=U;switch(U){case"Directory":Q=nc();break;case"Link":case"File":Q=pc();break;case"SymbolicLink":Q=ZO0;break;case"Socket":Q=WO0();break;case null:Q=mc();break}if(!(z instanceof Q))return new Q($);if(XO0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=U,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=lc.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=$.basename=lc.basename(z.path),z.dirname=$.dirname=lc.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=kF1;z._stat(Y)}function kF1($,Y){return $===Y?0:$.toLowerCase()>Y.toLowerCase()?1:$.toLowerCase()<Y.toLowerCase()?-1:$>Y?1:-1}O5.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat";if($)process.nextTick(Q.bind(null,null,$));else SF1[U](Y._path,Q);function Q(J,I){if(J)return Y.error(J);if(Object.keys(I).forEach(function(q){z[q]=I[q]}),Y.size!==void 0&&z.size!==Y.size)return Y.error("incorrect size");Y.size=z.size;var K=oc(z),G=z.hardlinks!==!1;if(G&&K!=="Directory"&&z.nlink&&z.nlink>1){var W=z.dev+":"+z.ino;if(aB[W]===Y._path||!aB[W])aB[W]=Y._path;else K=Y.type=Y.props.type="Link",Y.Link=Y.props.Link=!0,Y.linkpath=Y.props.linkpath=aB[W],Y._stat=Y._read=ZO0.prototype._read}if(Y.type&&Y.type!==K)Y.error("Unexpected type: "+K);if(Y.filter){var H=Y._proxy||Y;if(!Y.filter.call(H,H,z)){if(!Y._disowned)Y.abort(),Y.emit("end"),Y.emit("close");return}}var X=["_stat","stat","ready"],Z=0;(function q(){if(Y._aborted){Y.emit("end"),Y.emit("close");return}if(Y._paused&&Y.type!=="Directory"){Y.once("resume",q);return}var V=X[Z++];if(!V)return Y._read();Y.emit(V,z),q()})()}};O5.prototype.pipe=function($){var Y=this;if(typeof $.add==="function")Y.on("entry",function(z){var U=$.add(z);if(U===!1)Y.pause()});return gF1.prototype.pipe.apply(this,arguments)};O5.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};O5.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};O5.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var tc=E((Fa1,DO0)=>
Line truncated
|
||||
actual: `+$._bytesEmitted)}),Y.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(JO0),$._read();else $.emit("close")}),Y.on("error",function(z){$.emit("error",z)}),$._read()};$U.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var Y=$._buffer;for(var z=0,U=Y.length;z<U;z++){var Q=Y[z];if(Q===QO0)$.emit("end");else if(Q===JO0)$.emit("close");else $.emit("data",Q);if($._paused){$._buffer=Y.slice(z);return}}$._buffer.length=0}};$U.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._stream)Y._stream.pause();Y.emit("pause",$)};$U.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y.emit("resume",$),Y._paused=!1,Y._stream)Y._stream.resume();Y._read()}});var WO0=E((La1,GO0)=>{GO0.exports=aB;var _F1=X1(),KO0=ez();_F1(aB,KO0);function aB($){var Y=this;if(!(Y instanceof aB))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);KO0.call(Y,$)}aB.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var mc=E((Fa1,HO0)=>{HO0.exports=YU;var dc=ez(),vF1=WZ(),hF1=X1(),SF1=l8();hF1(YU,dc);function YU($){var Y=this;if(!(Y instanceof YU))throw Error("ProxyReader must be called as constructor.");Y.props=$,Y._buffer=[],Y.ready=!1,dc.call(Y,$)}YU.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";SF1[z](Y.path,function(U,Q){var J;if(U||!Q)J="File";else J=vF1(Q);Y[J]=!0,Y.type=$.type=J,$._old=Q,$._addProxy(dc(Y,Q))})};YU.prototype._addProxy=function($){var Y=this;if(Y._proxyTarget)return Y.error("proxy already set");Y._proxyTarget=$,$._proxy=Y,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$),$.on("ready",function(){Y.ready=!0,Y.emit("ready")});var z=Y._buffer;Y._buffer.length=0,z.forEach(function(U){$[U[0]].apply($,U[1])})};YU.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};YU.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var ez=E((wa1,qO0)=>{qO0.exports=O5;var gF1=l8(),yF1=I0("stream").Stream,kF1=X1(),lc=I0("path"),oc=WZ(),tB=O5.hardLinks={},XO0=sB();kF1(O5,XO0);var ZO0=ic();function O5($,Y){var z=this;if(!(z instanceof O5))return new O5($,Y);if(typeof $==="string")$={path:$};var U,Q;if($.type&&typeof $.type==="function")U=$.type,Q=U;else U=oc($),Q=O5;if(Y&&!U)U=oc(Y),$[U]=!0,$.type=U;switch(U){case"Directory":Q=nc();break;case"Link":case"File":Q=pc();break;case"SymbolicLink":Q=ZO0;break;case"Socket":Q=WO0();break;case null:Q=mc();break}if(!(z instanceof Q))return new Q($);if(XO0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=U,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=lc.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=$.basename=lc.basename(z.path),z.dirname=$.dirname=lc.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=xF1;z._stat(Y)}function xF1($,Y){return $===Y?0:$.toLowerCase()>Y.toLowerCase()?1:$.toLowerCase()<Y.toLowerCase()?-1:$>Y?1:-1}O5.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat";if($)process.nextTick(Q.bind(null,null,$));else gF1[U](Y._path,Q);function Q(J,I){if(J)return Y.error(J);if(Object.keys(I).forEach(function(q){z[q]=I[q]}),Y.size!==void 0&&z.size!==Y.size)return Y.error("incorrect size");Y.size=z.size;var K=oc(z),G=z.hardlinks!==!1;if(G&&K!=="Directory"&&z.nlink&&z.nlink>1){var W=z.dev+":"+z.ino;if(tB[W]===Y._path||!tB[W])tB[W]=Y._path;else K=Y.type=Y.props.type="Link",Y.Link=Y.props.Link=!0,Y.linkpath=Y.props.linkpath=tB[W],Y._stat=Y._read=ZO0.prototype._read}if(Y.type&&Y.type!==K)Y.error("Unexpected type: "+K);if(Y.filter){var H=Y._proxy||Y;if(!Y.filter.call(H,H,z)){if(!Y._disowned)Y.abort(),Y.emit("end"),Y.emit("close");return}}var X=["_stat","stat","ready"],Z=0;(function q(){if(Y._aborted){Y.emit("end"),Y.emit("close");return}if(Y._paused&&Y.type!=="Directory"){Y.once("resume",q);return}var V=X[Z++];if(!V)return Y._read();Y.emit(V,z),q()})()}};O5.prototype.pipe=function($){var Y=this;if(typeof $.add==="function")Y.on("entry",function(z){var U=$.add(z);if(U===!1)Y.pause()});return yF1.prototype.pipe.apply(this,arguments)};O5.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};O5.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};O5.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var tc=E((Ma1,DO0)=>
Line truncated
|
||||
expect: `+$.size+`
|
||||
actual: `+$._bytesWritten);GP.prototype._finish.call($)}});var Wn=E((ga1,HN0)=>{HN0.exports=S2;var Gn=cI(),Ww1=WZ(),Hw1=X1(),Xw1=IP(),Zw1=I0("fs");Hw1(S2,Gn);function S2($){var Y=this;if(!(Y instanceof S2))throw Error("ProxyWriter must be called as constructor.");Y.props=$,Y._needDrain=!1,Gn.call(Y,$)}S2.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";Zw1[z](Y.path,function(U,Q){var J;if(U||!Q)J="File";else J=Ww1(Q);Y[J]=!0,Y.type=$.type=J,$._old=Q,$._addProxy(Gn(Y,Q))})};S2.prototype._addProxy=function($){var Y=this;if(Y._proxy)return Y.error("proxy already set");Y._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$);var z=Y._buffer;if(z.forEach(function(U){$[U[0]].apply($,U[1])}),Y._buffer.length=0,Y._needsDrain)Y.emit("drain")};S2.prototype.add=function($){if(Xw1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};S2.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};S2.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var cI=E((ya1,ON0)=>{ON0.exports=f$;var x$=l8(),qw1=X1(),Vw1=tc(),Lw1=Un(),LZ=I0("path"),ZN0=process.platform==="win32"?0:process.umask(),qN0=WZ(),VN0=rB();qw1(f$,VN0);f$.dirmode=parseInt("0777",8)&~ZN0;f$.filemode=parseInt("0666",8)&~ZN0;var Fw1=Jn(),ww1=In(),Mw1=Kn(),Ow1=Wn();function f$($,Y){var z=this;if(typeof $==="string")$={path:$};var U=qN0($),Q=f$;switch(U){case"Directory":Q=Fw1;break;case"File":Q=Mw1;break;case"Link":case"SymbolicLink":Q=ww1;break;case null:default:Q=Ow1;break}if(!(z instanceof Q))return new Q($);if(VN0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.type=$.type,z.props=$,z.depth=$.depth||0,z.clobber=$.clobber===!1?$.clobber:!0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=LZ.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=LZ.basename($.path),z.dirname=LZ.dirname($.path),z.linkpath=$.linkpath||null,$.parent=$.root=null,z.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);z.readable=!1,z.writable=!0,z._buffer=[],z.ready=!1,z.filter=typeof $.filter==="function"?$.filter:null,z._stat(Y)}f$.prototype._create=function(){var $=this;x$[$.props.follow?"stat":"lstat"]($._path,function(Y){if(Y)return $.warn("Cannot create "+$._path+`
|
||||
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};f$.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat",Q=Y._proxy||Y;if($)J(null,$);else x$[U](Y._path,J);function J(I,K){if(Y.filter&&!Y.filter.call(Q,Q,K)){Y._aborted=!0,Y.emit("end"),Y.emit("close");return}if(I||!K)return Hn(Y);Y._old=K;var G=qN0(K);if(G!==Y.type||Y.type==="File"&&K.nlink>1)return Vw1(Y._path,function(W){if(W)return Y.error(W);Y._old=null,Hn(Y)});Hn(Y)}};function Hn($){Lw1(LZ.dirname($._path),f$.dirmode,function(Y,z){if(Y)return $.error(Y);return $._madeDir=z,$._create()})}function LN0($,Y,z,U,Q){var J=Y.mode,I=Y.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!x$[I])return Q();if(typeof J!=="number")return Q();var K=z.mode&parseInt("0777",8);if(J=J&parseInt("0777",8),J===K)return Q();x$[I](U,J,Q)}function FN0($,Y,z,U,Q){if(process.platform==="win32")return Q();if(!process.getuid||process.getuid()!==0)return Q();if(typeof Y.uid!=="number"&&typeof Y.gid!=="number")return Q();if(z.uid===Y.uid&&z.gid===Y.gid)return Q();var J=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!x$[J])return Q();if(typeof Y.uid!=="number")Y.uid=z.uid;if(typeof Y.gid!=="number")Y.gid=z.gid;x$[J](U,Y.uid,Y.gid,Q)}function wN0($,Y,z,U,Q){if(!x$.utimes||process.platform==="win32")return Q();var J=Y.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(J==="lutimes"&&!x$[J])J="utimes";if(!x$[J])return Q();var{atime:I,mtime:K}=z,G=Y.atime,W=Y.mtime;if(G===void 0)G=I;if(W===void 0)W=K;if(!XN0(G))G=new Date(G);if(!XN0(W))G=new Date(W);if(G.getTime()===I.getTime()&&W.getTime()===K.getTime())return Q();x$[J](U,G,W,Q)}f$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var Y=0,z=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),J($._old);else{var Q=$.props.follow?"stat":"lstat";x$[Q]($._path,function(K,G){if(K)if(K.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(K);J($._old=G)})}return;function J(K){Y+=3,LN0($,$.props,K,$._path,I("chmod")),FN0($,$.props,K,$._path,I("chown")),wN0($,$.props,K,$._path,I("utimes"))}function I(K){return function(G){if(z)return;if(G)return G.fstream_finish_call=K,$.error(z=G);if(--Y>0)return;if(U)return;if(U=!0,!$._madeDir)return W();else MN0($,$._path,W);function W(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function MN0($,Y,z){var U=$._madeDir,Q=LZ.dirname(Y);Nw1($,Q,function(J){if(J)return z(J);if(Q===U)return z();MN0($,Q,z)})}function Nw1($,Y,z){var U={};Object.keys($.props).forEach(function(K){if(U[K]=$.props[K],K==="mode"&&$.type!=="Directory")U[K]=U[K]|parseInt("0111",8)});var Q=3,J=null;x$.stat(Y,function(K,G){if(K)return z(J=K);LN0($,U,G,Y,I),FN0($,U,G,Y,I),wN0($,U,G,Y,I)});function I(K){if(J)return;if(K)return z(J=K);if(--Q===0)return z()}}f$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};f$.prototype.add=function(){this.error("Can't add to non-Directory type")};f$.prototype.write=function(){return!0};function Dw1($){return Object.prototype.toString.call($)}function XN0($){return typeof $==="object"&&Dw1($)==="[object Date]"}});var Ln=E((Bw1)=>{Bw1.Abstract=rB();Bw1.Reader=ez();Bw1.Writer=cI();Bw1.File={Reader:pc(),Writer:Kn()};Bw1.Dir={Reader:nc(),Writer:Jn()};Bw1.Link={Reader:ic(),Writer:In()};Bw1.Proxy={Reader:mc(),Writer:Wn()};Bw1.Reader.Dir=Bw1.DirReader=Bw1.Dir.Reader;Bw1.Reader.File=Bw1.FileReader=Bw1.File.Reader;Bw1.Reader.Link=Bw1.LinkReader=Bw1.Link.Reader;Bw1.Reader.Proxy=Bw1.ProxyReader=Bw1.Proxy.Reader;Bw1.Writer.Dir=Bw1.DirWriter=Bw1.Dir.Writer;Bw1.Writer.File=Bw1.FileWriter=Bw1.File.Writer;Bw1.Writer.Link=Bw1.LinkWriter=Bw1.Link.Writer;Bw1.Writer.Proxy=Bw1.ProxyWriter=Bw1.Proxy.Writer;Bw1.collect=IP()});var DN0=E((da1,NN0)=>{NN0.exports=_w1;var Tw1=bB(),jw1=Ln().Writer,Fn=I0("path"),Ew1=I0("stream"),Cw1=fc(),Rw1=j2();function _w1($){$.path=Fn.resolve(Fn.normalize($.path));var Y=new Tw1($),z=new Ew1.Writable({objectMode:!0});z._write=function(Q,J,I){if(Q.type=="Directory")return I();var K=Fn.join($.path,Q.path);if(K.indexOf($.path)!=0)return I();let G=$.getWriter?$.getWriter({path:K}):jw1({path:K});Q.pipe(G).on("error",I).on("close",I)};var U=Cw1(Y,z);return Y.once("crx-header",function(Q){U.crxHeader=Q}),Y.pipe(z).on("finish",function(){U.emit("close")}),U.promise=function(){return new Rw1(function(Q,J){U.on("close",Q),U.on("error",J)})},U}});var BN0=E((ma1,WP)=>{var j6=function($){var Y=1e7,z=7,U=9007199254740992,Q=Z(U),J="0123456789abcdefghijklmnopqrstuvwxyz",I=typeof BigInt==="function";function K(P,v,u,r){if(typeof P>"u")return K[0];if(typeof v<"u")return+v===10&&!u?B0(P):f0(P,v,u,r);return B0(P)}function G(P,v){this.value=P,this.sign=v,this.isSmall=!1}G.prototype=Object.create(K.prototype);function W(P){this.value=P,this.sign=P<0,this.isSmall=!0}W.prototype=Object.create(K.prototype);function H(P){
Line truncated
|
||||
actual: `+$._bytesWritten);WP.prototype._finish.call($)}});var Wn=E((ka1,HN0)=>{HN0.exports=S2;var Gn=cI(),Hw1=WZ(),Xw1=X1(),Zw1=KP(),qw1=I0("fs");Xw1(S2,Gn);function S2($){var Y=this;if(!(Y instanceof S2))throw Error("ProxyWriter must be called as constructor.");Y.props=$,Y._needDrain=!1,Gn.call(Y,$)}S2.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";qw1[z](Y.path,function(U,Q){var J;if(U||!Q)J="File";else J=Hw1(Q);Y[J]=!0,Y.type=$.type=J,$._old=Q,$._addProxy(Gn(Y,Q))})};S2.prototype._addProxy=function($){var Y=this;if(Y._proxy)return Y.error("proxy already set");Y._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$);var z=Y._buffer;if(z.forEach(function(U){$[U[0]].apply($,U[1])}),Y._buffer.length=0,Y._needsDrain)Y.emit("drain")};S2.prototype.add=function($){if(Zw1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};S2.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};S2.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var cI=E((xa1,ON0)=>{ON0.exports=f$;var x$=l8(),Vw1=X1(),Lw1=tc(),Fw1=Un(),LZ=I0("path"),ZN0=process.platform==="win32"?0:process.umask(),qN0=WZ(),VN0=sB();Vw1(f$,VN0);f$.dirmode=parseInt("0777",8)&~ZN0;f$.filemode=parseInt("0666",8)&~ZN0;var ww1=Jn(),Mw1=In(),Ow1=Kn(),Nw1=Wn();function f$($,Y){var z=this;if(typeof $==="string")$={path:$};var U=qN0($),Q=f$;switch(U){case"Directory":Q=ww1;break;case"File":Q=Ow1;break;case"Link":case"SymbolicLink":Q=Mw1;break;case null:default:Q=Nw1;break}if(!(z instanceof Q))return new Q($);if(VN0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.type=$.type,z.props=$,z.depth=$.depth||0,z.clobber=$.clobber===!1?$.clobber:!0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=LZ.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=LZ.basename($.path),z.dirname=LZ.dirname($.path),z.linkpath=$.linkpath||null,$.parent=$.root=null,z.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);z.readable=!1,z.writable=!0,z._buffer=[],z.ready=!1,z.filter=typeof $.filter==="function"?$.filter:null,z._stat(Y)}f$.prototype._create=function(){var $=this;x$[$.props.follow?"stat":"lstat"]($._path,function(Y){if(Y)return $.warn("Cannot create "+$._path+`
|
||||
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};f$.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat",Q=Y._proxy||Y;if($)J(null,$);else x$[U](Y._path,J);function J(I,K){if(Y.filter&&!Y.filter.call(Q,Q,K)){Y._aborted=!0,Y.emit("end"),Y.emit("close");return}if(I||!K)return Hn(Y);Y._old=K;var G=qN0(K);if(G!==Y.type||Y.type==="File"&&K.nlink>1)return Lw1(Y._path,function(W){if(W)return Y.error(W);Y._old=null,Hn(Y)});Hn(Y)}};function Hn($){Fw1(LZ.dirname($._path),f$.dirmode,function(Y,z){if(Y)return $.error(Y);return $._madeDir=z,$._create()})}function LN0($,Y,z,U,Q){var J=Y.mode,I=Y.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!x$[I])return Q();if(typeof J!=="number")return Q();var K=z.mode&parseInt("0777",8);if(J=J&parseInt("0777",8),J===K)return Q();x$[I](U,J,Q)}function FN0($,Y,z,U,Q){if(process.platform==="win32")return Q();if(!process.getuid||process.getuid()!==0)return Q();if(typeof Y.uid!=="number"&&typeof Y.gid!=="number")return Q();if(z.uid===Y.uid&&z.gid===Y.gid)return Q();var J=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!x$[J])return Q();if(typeof Y.uid!=="number")Y.uid=z.uid;if(typeof Y.gid!=="number")Y.gid=z.gid;x$[J](U,Y.uid,Y.gid,Q)}function wN0($,Y,z,U,Q){if(!x$.utimes||process.platform==="win32")return Q();var J=Y.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(J==="lutimes"&&!x$[J])J="utimes";if(!x$[J])return Q();var{atime:I,mtime:K}=z,G=Y.atime,W=Y.mtime;if(G===void 0)G=I;if(W===void 0)W=K;if(!XN0(G))G=new Date(G);if(!XN0(W))G=new Date(W);if(G.getTime()===I.getTime()&&W.getTime()===K.getTime())return Q();x$[J](U,G,W,Q)}f$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var Y=0,z=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),J($._old);else{var Q=$.props.follow?"stat":"lstat";x$[Q]($._path,function(K,G){if(K)if(K.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(K);J($._old=G)})}return;function J(K){Y+=3,LN0($,$.props,K,$._path,I("chmod")),FN0($,$.props,K,$._path,I("chown")),wN0($,$.props,K,$._path,I("utimes"))}function I(K){return function(G){if(z)return;if(G)return G.fstream_finish_call=K,$.error(z=G);if(--Y>0)return;if(U)return;if(U=!0,!$._madeDir)return W();else MN0($,$._path,W);function W(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function MN0($,Y,z){var U=$._madeDir,Q=LZ.dirname(Y);Dw1($,Q,function(J){if(J)return z(J);if(Q===U)return z();MN0($,Q,z)})}function Dw1($,Y,z){var U={};Object.keys($.props).forEach(function(K){if(U[K]=$.props[K],K==="mode"&&$.type!=="Directory")U[K]=U[K]|parseInt("0111",8)});var Q=3,J=null;x$.stat(Y,function(K,G){if(K)return z(J=K);LN0($,U,G,Y,I),FN0($,U,G,Y,I),wN0($,U,G,Y,I)});function I(K){if(J)return;if(K)return z(J=K);if(--Q===0)return z()}}f$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};f$.prototype.add=function(){this.error("Can't add to non-Directory type")};f$.prototype.write=function(){return!0};function Bw1($){return Object.prototype.toString.call($)}function XN0($){return typeof $==="object"&&Bw1($)==="[object Date]"}});var Ln=E((Pw1)=>{Pw1.Abstract=sB();Pw1.Reader=ez();Pw1.Writer=cI();Pw1.File={Reader:pc(),Writer:Kn()};Pw1.Dir={Reader:nc(),Writer:Jn()};Pw1.Link={Reader:ic(),Writer:In()};Pw1.Proxy={Reader:mc(),Writer:Wn()};Pw1.Reader.Dir=Pw1.DirReader=Pw1.Dir.Reader;Pw1.Reader.File=Pw1.FileReader=Pw1.File.Reader;Pw1.Reader.Link=Pw1.LinkReader=Pw1.Link.Reader;Pw1.Reader.Proxy=Pw1.ProxyReader=Pw1.Proxy.Reader;Pw1.Writer.Dir=Pw1.DirWriter=Pw1.Dir.Writer;Pw1.Writer.File=Pw1.FileWriter=Pw1.File.Writer;Pw1.Writer.Link=Pw1.LinkWriter=Pw1.Link.Writer;Pw1.Writer.Proxy=Pw1.ProxyWriter=Pw1.Proxy.Writer;Pw1.collect=KP()});var DN0=E((la1,NN0)=>{NN0.exports=vw1;var jw1=iB(),Ew1=Ln().Writer,Fn=I0("path"),Cw1=I0("stream"),Rw1=fc(),_w1=j2();function vw1($){$.path=Fn.resolve(Fn.normalize($.path));var Y=new jw1($),z=new Cw1.Writable({objectMode:!0});z._write=function(Q,J,I){if(Q.type=="Directory")return I();var K=Fn.join($.path,Q.path);if(K.indexOf($.path)!=0)return I();let G=$.getWriter?$.getWriter({path:K}):Ew1({path:K});Q.pipe(G).on("error",I).on("close",I)};var U=Rw1(Y,z);return Y.once("crx-header",function(Q){U.crxHeader=Q}),Y.pipe(z).on("finish",function(){U.emit("close")}),U.promise=function(){return new _w1(function(Q,J){U.on("close",Q),U.on("error",J)})},U}});var BN0=E((oa1,HP)=>{var j6=function($){var Y=1e7,z=7,U=9007199254740992,Q=Z(U),J="0123456789abcdefghijklmnopqrstuvwxyz",I=typeof BigInt==="function";function K(P,v,u,r){if(typeof P>"u")return K[0];if(typeof v<"u")return+v===10&&!u?B0(P):f0(P,v,u,r);return B0(P)}function G(P,v){this.value=P,this.sign=v,this.isSmall=!1}G.prototype=Object.create(K.prototype);function W(P){this.value=P,this.sign=P<0,this.isSmall=!0}W.prototype=Object.create(K.prototype);function H(P){
Line truncated
|
||||
* Tmp
|
||||
*
|
||||
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
||||
*
|
||||
* MIT Licensed
|
||||
*/var q4=I0("fs"),LP=I0("os"),E6=I0("path"),yN0=I0("crypto"),w9={fs:q4.constants,os:LP.constants},uN0=/XXXXXX/,bN0=(w9.O_CREAT||w9.fs.O_CREAT)|(w9.O_EXCL||w9.fs.O_EXCL)|(w9.O_RDWR||w9.fs.O_RDWR),$M1=LP.platform()==="win32",YM1=w9.EBADF||w9.os.errno.EBADF,zM1=w9.ENOENT||w9.os.errno.ENOENT,pI=[],iN0=q4.rmdirSync.bind(q4),cN0=!1;function UM1($,Y){return q4.rm($,{recursive:!0},Y)}function nN0($){return q4.rmSync($,{recursive:!0})}function Dn($,Y){let z=dI($,Y),U=z[0],Q=z[1];qM1(U,function(J,I){if(J)return Q(J);let K=I.tries;(function G(){try{let W=dN0(I);q4.stat(W,function(H){if(!H){if(K-- >0)return G();return Q(Error("Could not get a unique tmp filename, max tries reached "+W))}Q(null,W)})}catch(W){Q(W)}})()})}function Bn($){let Y=dI($),z=Y[0],U=VM1(z),Q=U.tries;do{let J=dN0(U);try{q4.statSync(J)}catch(I){return J}}while(Q-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function QM1($,Y){let z=dI($,Y),U=z[0],Q=z[1];Dn(U,function(I,K){if(I)return Q(I);q4.open(K,bN0,U.mode||384,function(W,H){if(W)return Q(W);if(U.discardDescriptor)return q4.close(H,function(Z){return Q(Z,K,void 0,On(K,-1,U,!1))});else{let X=U.discardDescriptor||U.detachDescriptor;Q(null,K,H,On(K,X?-1:H,U,!1))}})})}function JM1($){let Y=dI($),z=Y[0],U=z.discardDescriptor||z.detachDescriptor,Q=Bn(z),J=q4.openSync(Q,bN0,z.mode||384);if(z.discardDescriptor)q4.closeSync(J),J=void 0;return{name:Q,fd:J,removeCallback:On(Q,U?-1:J,z,!0)}}function IM1($,Y){let z=dI($,Y),U=z[0],Q=z[1];Dn(U,function(I,K){if(I)return Q(I);q4.mkdir(K,U.mode||448,function(W){if(W)return Q(W);Q(null,K,pN0(K,U,!1))})})}function KM1($){let Y=dI($),z=Y[0],U=Bn(z);return q4.mkdirSync(U,z.mode||448),{name:U,removeCallback:pN0(U,z,!0)}}function GM1($,Y){let z=function(U){if(U&&!Nn(U))return Y(U);Y()};if(0<=$[0])q4.close($[0],function(){q4.unlink($[1],z)});else q4.unlink($[1],z)}function WM1($){let Y=null;try{if(0<=$[0])q4.closeSync($[0])}catch(z){if(!LM1(z)&&!Nn(z))throw z}finally{try{q4.unlinkSync($[1])}catch(z){if(!Nn(z))Y=z}}if(Y!==null)throw Y}function On($,Y,z,U){let Q=VP(WM1,[Y,$],U),J=VP(GM1,[Y,$],U,Q);if(!z.keep)pI.unshift(Q);return U?Q:J}function pN0($,Y,z){let U=Y.unsafeCleanup?UM1:q4.rmdir.bind(q4),Q=Y.unsafeCleanup?nN0:iN0,J=VP(Q,$,z),I=VP(U,$,z,J);if(!Y.keep)pI.unshift(J);return z?J:I}function VP($,Y,z,U){let Q=!1;return function J(I){if(!Q){let K=U||J,G=pI.indexOf(K);if(G>=0)pI.splice(G,1);if(Q=!0,z||$===iN0||$===nN0)return $(Y);else return $(Y,I||function(){})}}}function HM1(){if(!cN0)return;while(pI.length)try{pI[0]()}catch($){}}function kN0($){let Y=[],z=null;try{z=yN0.randomBytes($)}catch(U){z=yN0.pseudoRandomBytes($)}for(let U=0;U<$;U++)Y.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[U]%62]);return Y.join("")}function r8($){return typeof $>"u"}function dI($,Y){if(typeof $==="function")return[{},$];if(r8($))return[{},Y];let z={};for(let U of Object.getOwnPropertyNames($))z[U]=$[U];return[z,Y]}function XM1($,Y,z){let U=E6.isAbsolute($)?$:E6.join(Y,$);q4.stat(U,function(Q){if(Q)q4.realpath(E6.dirname(U),function(J,I){if(J)return z(J);z(null,E6.join(I,E6.basename(U)))});else q4.realpath(U,z)})}function ZM1($,Y){let z=E6.isAbsolute($)?$:E6.join(Y,$);try{return q4.statSync(z),q4.realpathSync(z)}catch(U){let Q=q4.realpathSync(E6.dirname(z));return E6.join(Q,E6.basename(z))}}function dN0($){let Y=$.tmpdir;if(!r8($.name))return E6.join(Y,$.dir,$.name);if(!r8($.template))return E6.join(Y,$.dir,$.template).replace(uN0,kN0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",kN0(12),$.postfix?"-"+$.postfix:""].join("");return E6.join(Y,$.dir,z)}function Mn($,Y){if(typeof Y!=="string")throw Error(`${$} option must be a string, got "${typeof Y}".`);if(Y.includes(".."))throw Error("Relative value not allowed");return Y}function mN0($){if(!r8($.name)){let Y=$.name;if(E6.isAbsolute(Y))throw Error(`name option must not contain an absolute path, found "${Y}".`);let z=E6.basename(Y);if(z===".."||z==="."||z!==Y)throw Error(`name option must not contain a path, found "${Y}".`)}if(!r8($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(uN0))throw Error(`Invalid template, found "${$.template}".`)}if(!r8($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=r8($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=r8($.prefix)?"":Mn("prefix",$.prefix),$.postfix=r8($.postfix)?"":Mn("postfix",$.postfix),$.template=r8($.template)?void 0:Mn("template",$.template)}function xN0($,Y,z,U){if(r8(Y))return U(null);XM1(Y,z,function(Q,J){if(Q)return U(Q);let I=E6.relative(z,J);if(I.startsWith("..")||E6.isAbsolute(I))return U(Error(`${$} option must be relative to "${z}", found "${I}".`));U(null,I)})}function fN0($,Y,z){if(r8(Y))return;let U=ZM1(Y,z),Q=E6.relative(z,U);if(Q.startsWith("..")||E6.isAbsolute(Q))thrLine truncated
|
||||
*/var q4=I0("fs"),FP=I0("os"),E6=I0("path"),yN0=I0("crypto"),w9={fs:q4.constants,os:FP.constants},uN0=/XXXXXX/,bN0=(w9.O_CREAT||w9.fs.O_CREAT)|(w9.O_EXCL||w9.fs.O_EXCL)|(w9.O_RDWR||w9.fs.O_RDWR),YM1=FP.platform()==="win32",zM1=w9.EBADF||w9.os.errno.EBADF,UM1=w9.ENOENT||w9.os.errno.ENOENT,pI=[],iN0=q4.rmdirSync.bind(q4),cN0=!1;function QM1($,Y){return q4.rm($,{recursive:!0},Y)}function nN0($){return q4.rmSync($,{recursive:!0})}function Dn($,Y){let z=dI($,Y),U=z[0],Q=z[1];VM1(U,function(J,I){if(J)return Q(J);let K=I.tries;(function G(){try{let W=dN0(I);q4.stat(W,function(H){if(!H){if(K-- >0)return G();return Q(Error("Could not get a unique tmp filename, max tries reached "+W))}Q(null,W)})}catch(W){Q(W)}})()})}function Bn($){let Y=dI($),z=Y[0],U=LM1(z),Q=U.tries;do{let J=dN0(U);try{q4.statSync(J)}catch(I){return J}}while(Q-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function JM1($,Y){let z=dI($,Y),U=z[0],Q=z[1];Dn(U,function(I,K){if(I)return Q(I);q4.open(K,bN0,U.mode||384,function(W,H){if(W)return Q(W);if(U.discardDescriptor)return q4.close(H,function(Z){return Q(Z,K,void 0,On(K,-1,U,!1))});else{let X=U.discardDescriptor||U.detachDescriptor;Q(null,K,H,On(K,X?-1:H,U,!1))}})})}function IM1($){let Y=dI($),z=Y[0],U=z.discardDescriptor||z.detachDescriptor,Q=Bn(z),J=q4.openSync(Q,bN0,z.mode||384);if(z.discardDescriptor)q4.closeSync(J),J=void 0;return{name:Q,fd:J,removeCallback:On(Q,U?-1:J,z,!0)}}function KM1($,Y){let z=dI($,Y),U=z[0],Q=z[1];Dn(U,function(I,K){if(I)return Q(I);q4.mkdir(K,U.mode||448,function(W){if(W)return Q(W);Q(null,K,pN0(K,U,!1))})})}function GM1($){let Y=dI($),z=Y[0],U=Bn(z);return q4.mkdirSync(U,z.mode||448),{name:U,removeCallback:pN0(U,z,!0)}}function WM1($,Y){let z=function(U){if(U&&!Nn(U))return Y(U);Y()};if(0<=$[0])q4.close($[0],function(){q4.unlink($[1],z)});else q4.unlink($[1],z)}function HM1($){let Y=null;try{if(0<=$[0])q4.closeSync($[0])}catch(z){if(!FM1(z)&&!Nn(z))throw z}finally{try{q4.unlinkSync($[1])}catch(z){if(!Nn(z))Y=z}}if(Y!==null)throw Y}function On($,Y,z,U){let Q=LP(HM1,[Y,$],U),J=LP(WM1,[Y,$],U,Q);if(!z.keep)pI.unshift(Q);return U?Q:J}function pN0($,Y,z){let U=Y.unsafeCleanup?QM1:q4.rmdir.bind(q4),Q=Y.unsafeCleanup?nN0:iN0,J=LP(Q,$,z),I=LP(U,$,z,J);if(!Y.keep)pI.unshift(J);return z?J:I}function LP($,Y,z,U){let Q=!1;return function J(I){if(!Q){let K=U||J,G=pI.indexOf(K);if(G>=0)pI.splice(G,1);if(Q=!0,z||$===iN0||$===nN0)return $(Y);else return $(Y,I||function(){})}}}function XM1(){if(!cN0)return;while(pI.length)try{pI[0]()}catch($){}}function kN0($){let Y=[],z=null;try{z=yN0.randomBytes($)}catch(U){z=yN0.pseudoRandomBytes($)}for(let U=0;U<$;U++)Y.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[U]%62]);return Y.join("")}function r8($){return typeof $>"u"}function dI($,Y){if(typeof $==="function")return[{},$];if(r8($))return[{},Y];let z={};for(let U of Object.getOwnPropertyNames($))z[U]=$[U];return[z,Y]}function ZM1($,Y,z){let U=E6.isAbsolute($)?$:E6.join(Y,$);q4.stat(U,function(Q){if(Q)q4.realpath(E6.dirname(U),function(J,I){if(J)return z(J);z(null,E6.join(I,E6.basename(U)))});else q4.realpath(U,z)})}function qM1($,Y){let z=E6.isAbsolute($)?$:E6.join(Y,$);try{return q4.statSync(z),q4.realpathSync(z)}catch(U){let Q=q4.realpathSync(E6.dirname(z));return E6.join(Q,E6.basename(z))}}function dN0($){let Y=$.tmpdir;if(!r8($.name))return E6.join(Y,$.dir,$.name);if(!r8($.template))return E6.join(Y,$.dir,$.template).replace(uN0,kN0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",kN0(12),$.postfix?"-"+$.postfix:""].join("");return E6.join(Y,$.dir,z)}function Mn($,Y){if(typeof Y!=="string")throw Error(`${$} option must be a string, got "${typeof Y}".`);if(Y.includes(".."))throw Error("Relative value not allowed");return Y}function mN0($){if(!r8($.name)){let Y=$.name;if(E6.isAbsolute(Y))throw Error(`name option must not contain an absolute path, found "${Y}".`);let z=E6.basename(Y);if(z===".."||z==="."||z!==Y)throw Error(`name option must not contain a path, found "${Y}".`)}if(!r8($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(uN0))throw Error(`Invalid template, found "${$.template}".`)}if(!r8($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=r8($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=r8($.prefix)?"":Mn("prefix",$.prefix),$.postfix=r8($.postfix)?"":Mn("postfix",$.postfix),$.template=r8($.template)?void 0:Mn("template",$.template)}function xN0($,Y,z,U){if(r8(Y))return U(null);ZM1(Y,z,function(Q,J){if(Q)return U(Q);let I=E6.relative(z,J);if(I.startsWith("..")||E6.isAbsolute(I))return U(Error(`${$} option must be relative to "${z}", found "${I}".`));U(null,I)})}function fN0($,Y,z){if(r8(Y))return;let U=qM1(Y,z),Q=E6.relative(z,U);if(Q.startsWith("..")||E6.isAbsolute(Q))thrLine truncated
|
||||
`)}let U=[];Y.forEach((Q,J)=>{let I=$.length+J+1,K=J===0?"⏳ ":"";U.push(`${K}${I}. ${Q}`)});for(let Q=$.length-1;Q>=0;Q--){let J=Q+1;U.push(`${J}. ${$[Q]}`)}return U.join(`
|
||||
`)}function Sn($,Y,z,U,Q){let J=$?.operator||Y?.operator||z?.operator,I=J?.name||J?.id||z?.operatorName||"",K=($?.nodeName||Y?.fromNodeName||Y?.nodeName||z?.nodeName||"").trim();if(K==="合思审批节点"||K==="外部审批节点"||K.includes("合思审批")||K.includes("外部审批"))K="";if((!K||K==="提交人"||K==="审批节点")&&I&&U){let M=U.find((w)=>w.operator?.name===I&&w.nodeName&&w.nodeName.trim()!=="提交人"&&!w.isEbot&&w.rawAction!=="freeflow.reject");if(M?.nodeName)K=M.nodeName.trim()}let W=$?.comment||Y?.reason||z?.rejectComment||"修改";if(W.includes(":")){let M=W.split(":");if(M.length>1)W=M.slice(1).join(":").trim()}let H=W;if(K&&I)H=`${K}(${I}) ❌: ${W}`;else if(I)H=`${I} ❌: ${W}`;else if(K)H=`${K} ❌: ${W}`;else H=W;let X=$?.rejectTargetNodeName||Y?.targetNodeName||"提交人",Z=$?.rejectTargetOperator?.name||Y?.targetOperator?.name||Q?.submitter?.name,q=Z?`${X}(${Z})`:X,V=$?.resubmitRuleText||Y?.resubmitRuleText||(I?`重新提交后由${I}继续审批`:"重新提交后继续审批");return{comment:`${H}
|
||||
↳ 驳回至: ${q}
|
||||
↳ ${V}`,operator:J}}function RD0($){if(!$)return[];let Y=$.pending||[],z=String($.rawState||"").toUpperCase(),U=String($.state||"").toUpperCase(),Q=[];if(Y.length>0)for(let J of Y){let I=J.approver?.name||J.approver?.id||"待定",K=(J.name||$.currentNode||"").trim(),G=K?`${K}(${I})`:I,H=J.type?.toUpperCase()==="PAYING"||K.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";Q.push(`${G}: ${H}`)}else if($.currentNode?.trim()){let I=$.currentNode.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";Q.push(`${$.currentNode.trim()}: ${I}`)}return Q}function QU($,Y){let z=new Map;if(!$||$.length===0)return z;if(!Y){for(let q of $){let F=(q.result||{}).decision||q.aiDecision||"-";z.set(q.id,{recordId:q.id,sourceDocumentSN:q.sourceDocumentSN,taskMode:q.taskMode,aiDecision:CD0(typeof F==="string"?F:"-"),aiAction:"-",eHumanAction:"-",eHumanComment:"-",auditDrift:!1})}return z}let U=[...$].sort((q,V)=>(Number(q.createdAt)||0)-(Number(V.createdAt)||0)),Q=Y.history||[],J=String(Y.rawState||"").toUpperCase(),I=String(Y.state||"").toUpperCase(),K=J==="DRAFT"||J==="REVOKED"||J==="CANCELED"||J==="CANCELLED"||I==="草稿"||I==="已撤回"||I==="已取消",G=J==="REJECTED"||J==="TERMINATED"||I==="审批驳回"||I==="已驳回",W=!K&&!G&&(J==="PAID"||I==="已支付"||Q.some((q)=>!q.isEbot&&(q.rawAction==="freeflow.pay"||q.action==="支付成功"||q.action==="支付完成"))),H=!K&&!G&&!W&&(J==="PAYING"||I==="支付中"||(Y.pending||[]).some((q)=>q.isCurrent&&(q.type?.toUpperCase()==="PAYING"||q.name?.includes("支付")))||Y.currentNode?.includes("支付")===!0),Z=W||!K&&!G&&!H&&(J==="COMPLETED"||J==="APPROVED"||I==="已完成"||I==="审批通过");for(let q=0;q<U.length;q++){let V=U[q];if(!V)continue;let F=Number(V.createdAt)||0,M=V.document||{},w=V.manualApprovalRecord||V.result?.manualApprovalRecord||M.manualApprovalRecord||{},O=typeof V.sourceExtendData?.nodeId==="string"?String(V.sourceExtendData.nodeId):void 0,D=typeof w.nodeId==="string"?String(w.nodeId):void 0,N=D?decodeURIComponent(D).replace(/^hcnode_/,"").replace(/_r\d+$/,""):void 0,A=O||N,T=A?Q.find((B0)=>B0.nodeId&&(B0.nodeId===A||A.includes(B0.nodeId))):void 0,B=T?.time??F,j=U[q+1],C=j?Number(j.createdAt)||1/0:1/0,b=q===U.length-1,k=Q.find((B0)=>(B0.time??0)>B+5000&&B0.isEbot&&(B0.nodeName?.includes("智能")||B0.nodeName?.includes("AI")||B0.action?.includes("智能")||B0.comment?.includes("AI")||B0.comment?.includes("approval-result"))&&!B0.nodeName?.includes("费用标准检查")&&!B0.nodeName?.includes("标准检查")&&!B0.nodeName?.includes("预算"));if(k){if(b=!1,(k.time??1/0)<C)C=k.time}let h=V.result||{},i=h.decision||V.aiDecision||"-",c=typeof i==="string"?i:"-",U0=c.toUpperCase(),x=U0==="REJECT"||U0==="驳回",d=U0==="APPROVE"||U0==="通过",t=U0==="EXEMPT_APPROVE"||U0==="免审通过"||U0==="备注通过",$0=V.taskMode||V.finalExecutionMode||"",p=String($0).toLowerCase().includes("auto")||V.finalExecutionMode==="automatic"||$0==="automatic"||$0==="fully_automatic",e="-";if(d||t)e="添加评论";else if(x)e=p?"驳回":"添加评论";else if(U0==="REVIEW"||U0==="转交复核")e="转交复核";let y=typeof w.status==="object"&&w.status!==null?String(w.status.type||w.status.label||"").toUpperCase():"",s=typeof w.status==="object"&&w.status!==null?String(w.status.sourceStatus||""):"",Y0=M.manualApprovalStatus||h.manualApprovalStatus||V.manualApprovalStatus,M0=typeof Y0==="string"?Y0.toUpperCase():"",E0=M0==="CANCELLED"||M0==="CANCELED"||M0==="已取消"||M0==="已撤回"||M0==="REVOKED"||y==="CANCELLED"||y==="CANCELED"||s.includes("撤回")||s.includes("取消"),G0=M0==="APPROVED"||M0==="已支付/审批完成"||M0==="已通过"||M0==="已完成"||M0==="已支付"||y==="APPROVED",b0=!(s.includes("补偿")||s.includes("已支付"))&&(M0==="TERMINATED"||M0==="REJECTED"||M0==="REJECT"||M0==="已驳回"||M0==="被驳回"||y==="TERMINATED"||y==="REJECTED"||y==="已驳回"||y==="被驳回"),Y1=T?1000:60000,a=Q.filter((B0)=>{let Q0=B0.time??0;return Q0>=B-Y1&&Q0<C}),H0="-",L0="-",f0=!1,u0,i0,D1=d||t,k1=Q.filter((B0)=>(B0.time??0)>B+5000),u1=k1.some((B0)=>B0.rawAction==="freeflow.retract"||B0.action==="单据撤回"),b1=k1.some((B0)=>B0.rawAction==="freeflow.submit"||B0.action==="提交送审");if(D1&&b&&(u1||b1))f0=!0,u0="AI通过后单据发生撤回/修改重提,后续未经AI复审";if(p&&x)H0="无操作",L0="-";else{let B0=a.filter((v)=>(v.time??0)>=B-1000&&!v.isEbot&&v.rawAction!=="freeflow.submit"&&v.action!=="提交送审"&&!((v.rawAction==="freeflow.comment"||v.action==="发表评论")&&!v.comment)&&!((v.rawAction==="freeflow.print"||v.action==="打印提醒")&&!v.comment)&&!(v.rawAction==="freeflow.carbonCopy"||v.rawAction==="freeflow.cc"||v.action==="抄送通知")),Q0=B0.find((v)=>v.rawAction==="freeflow.retract"||v.action==="单据撤回"),P=B0.find((v)=>v.rawAction==="freeflow.reject"||v.action==="审批驳回");if(!b)if(P||!Y&&b0){H0="审批驳回",f0=!1,u0=void 0;let v=Sn(P,void 0,w,Q,Y);L0=v.commen
Line truncated
|
||||
`,{mode:384}),Y}function on($){let Y=oD0();for(let z of Y){if(!V$(z))continue;for(let U of CP(z).filter((Q)=>Q.endsWith(".json")).filter((Q)=>!Q.startsWith("example."))){let Q=O9(z,U);try{let J=_P(Q,"utf-8"),I=JSON.parse(J);if(I&&typeof I==="object"&&I.id===$)return Q}catch{}}}return}function x2($,Y){let z=on($);if(!z)throw Error(`Enterprise config not found: ${$}`);let Q={...JSON.parse(_P(z,"utf-8")),...Y};for(let I of Object.keys(Y))if(Y[I]===void 0)delete Q[I];let J=pn.parse(Q);return cD0(z,`${JSON.stringify(J,null,2)}
|
||||
`,"utf-8"),J}var mn="SEAL_USE_ENTERPRISES_DIR",nD0="SEAL_HOME_ENTERPRISES_DIR",pD0="SEAL_USE_USER_ENTERPRISES_DIR",dD0="SEAL_HOME_USER_ENTERPRISES_DIR",mD0="SEAL_USE_CONFIG_FILE",lD0="SEAL_HOME_CONFIG_FILE",rI,RP,EP,bD0;var h7=o(()=>{dn();rI=O9(vP(),".config","seal-use","enterprises"),RP=O9(vP(),".config","seal-home","enterprises"),EP=O9(vP(),".config","seal-use","config.json"),bD0=O9(vP(),".config","seal-home","config.json")});function f2($,Y,z=[]){let U=Y.corpId?.trim()||void 0,Q=Y.stateful?Y.defaultCorpId?.trim()||void 0:void 0,J=U??Q;if(J){let K=$.find((H)=>H.id===J);if(K)return K;let G=$.find((H)=>H.id.toLowerCase()===J.toLowerCase());if(G)return G;let W=$.find((H)=>H.name.toLowerCase()===J.toLowerCase());if(W)return W;throw Error(`No enterprise config found for ${J}`)}if(!Y.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let I=$[0];if(I)return I;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(z.length?z.join(", "):"the configured enterprise directories"))}import{existsSync as rn,mkdirSync as oO1,readFileSync as rO1,renameSync as sO1,unlinkSync as aO1,writeFileSync as tO1}from"node:fs";import{homedir as eO1}from"node:os";import{dirname as $N1,join as YN1}from"node:path";function an(){let $=process.env[zN1]?.trim();if($)return $;return UN1}function rD0($=new Date){return $.toISOString().slice(0,10)}function sD0($=sn,Y=new Date){let z=Y.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function aD0($=an()){if(!rn($))return{};try{let Y=rO1($,"utf-8"),z=JSON.parse(Y);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function QN1($,Y){let z={};for(let[U,Q]of Object.entries($)){if(!Q||typeof Q!=="object")continue;let J={},I=!1;for(let[K,G]of Object.entries(Q))if(typeof G==="number"&&G>0&&K>=Y)J[K]=G,I=!0;if(I)z[U]=J}return z}function JN1($,Y=an()){let z=$N1(Y);if(!rn(z))oO1(z,{recursive:!0,mode:448});let U=`${Y}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{tO1(U,JSON.stringify($,null,2),"utf-8"),sO1(U,Y)}catch(Q){try{if(rn(U))aO1(U)}catch{}throw Q}}function tD0($,Y=new Date){if(!$||typeof $!=="string")return;try{let z=an(),U=aD0(z),Q=rD0(Y),J=sD0(sn,Y),I=QN1(U,J);I[$]=I[$]||{},I[$][Q]=(I[$][Q]??0)+1,JN1(I,z)}catch{}}function IN1($,Y=sn,z=new Date){let U=new Map;try{let Q=aD0(),J=sD0(Y,z),I=rD0(z),K=$??Object.keys(Q);for(let G of K){let W=Q[G];if(!W){U.set(G,0);continue}let H=0;for(let[X,Z]of Object.entries(W))if(X>=J&&X<=I&&typeof Z==="number")H+=Z;U.set(G,H)}}catch{if($)for(let Q of $)U.set(Q,0)}return U}function eD0($,Y,z){let U=z??IN1($.map((Q)=>Q.id));return[...$].sort((Q,J)=>{if(Y){if(Q.id===Y&&J.id!==Y)return-1;if(J.id===Y&&Q.id!==Y)return 1}let I=U.get(Q.id)??0,K=U.get(J.id)??0;if(I!==K)return K-I;let G=Q.name??Q.id,W=J.name??J.id,H=G.localeCompare(W,"zh-CN");if(H!==0)return H;return Q.id.localeCompare(J.id)})}var zN1="SEAL_USE_USAGE_FILE",UN1,sn=7;var tn=o(()=>{UN1=YN1(eO1(),".config","seal-use","usage.json")});function KN1($,Y){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>Y?z:z.toLowerCase())}function GN1($,Y){return Y?$:$.toLowerCase()}function WN1($,Y,z,U){let Q=GN1($,U),J=Y.filter((I)=>Q.includes(I));if(z==="all"&&J.length!==Y.length)return[];return J}function HN1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function XN1($,Y){if(Y.fields&&!Y.fields.has($.field))return[];let z=HN1($.value),U=[];return z.forEach((Q,J)=>{let I=WN1(Q,Y.keywords,Y.matchMode,Y.caseSensitive);if(I.length===0)return;let K=Math.max(0,J-Y.contextLines),G=Math.min(z.length,J+Y.contextLines+1),W={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:J+1,matchedKeywords:I,matchedText:hP(Q,Y.maxChars),context:{before:Y.snippetOnly?[]:z.slice(K,J).map((H)=>hP(H,Y.maxChars)),line:hP(Q,Y.maxChars),after:Y.snippetOnly?[]:z.slice(J+1,G).map((H)=>hP(H,Y.maxChars))},metadata:$.metadata};if(Y.snippetOnly)W.context={before:[],line:W.context.line,after:[]};U.push(W)}),U}function hP($,Y){if(!Y||$.length<=Y)return $;return`${$.slice(0,Math.max(0,Y))}...`}function ZN1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function YB0($){return $.rules.flatMap((Y,z)=>{let U=`${$.id}:${Y.description.slice(0,32)}`,Q={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:Y.scope,strictness:Y.strictness,code:"code"in Y?Y.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:U,title:`${$.versionName} / ${Y.scope}`,field:"history.description",
Line truncated
|
||||
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==U.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:U}}async function Yp($,Y,z){let U=Y.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",Q=await J$($,U);if(z||Q.length>0)return IB0(Q,z,Y.id);if(Y.environment==="test"||Y.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${Y.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let J=(Y.seal.url??Y.source?.sealUrl??`https://${Y.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await KM($,J,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${J}/api/v1/integrations/webhook/replay-mock-callback`},Y.seal.endpoints.approvalStylePreferences)}throw new w4(`当前租户「${Y.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${Y.id}`)}async function sI($){let{query:Y,sourceClient:z,targetClient:U,sourceCorp:Q,targetCorp:J,webhookSelector:I,snPrefix:K,snSuffix:G,docIdPrefix:W,docIdSuffix:H,dryRun:X,fetchFn:Z=fetch}=$,q=[];if(Y.recordId){let A=await G4(z,Y.recordId);q.push(A)}else if(Y.recordIds&&Y.recordIds.length>0)for(let A of Y.recordIds)q.push(await G4(z,A));else if(Y.sn){let A=await b4(z,{sourceDocumentSN:Y.sn,limit:1});if(!A.records.length)throw Error(`在企业「${Q.name}」中未找到单据编号为「${Y.sn}」的审批记录。`);q.push(A.records[0])}else if(Y.sns&&Y.sns.length>0)for(let A of Y.sns){let T=await b4(z,{sourceDocumentSN:A,limit:1});if(!T.records.length)throw Error(`在企业「${Q.name}」中未找到单据编号为「${A}」的审批记录。`);q.push(T.records[0])}else if(Y.limit!==void 0){let A=await b4(z,{limit:Y.limit,status:Y.status,startDate:Y.startDate,endDate:Y.endDate});if(!A.records.length)throw Error(`在企业「${Q.name}」中未检索到符合条件的审批记录。`);q=A.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let V=q.map((A)=>({run:A,doc:en(A,{snPrefix:K,snSuffix:G,docIdPrefix:W,docIdSuffix:H})}));if(X){let A={id:"preview-webhook",name:I??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${J.seal.url}/api/v1/integrations/webhook/preview`};try{let j=await J$(U,J.seal.endpoints.approvalStylePreferences);if(j.length>0){let C=IB0(j,I,J.id);A={id:C.id,name:C.name,mode:C.mode,incomingDocumentWebhookUrl:C.incomingDocumentWebhook.url}}}catch{}let T=V.map(({run:j,doc:C})=>({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},document:C,success:!0})),B=T.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:A,totalCount:T.length,successCount:T.length,failureCount:0,originalRecord:B?T[0].originalRecord:void 0,document:B?T[0].document:void 0,records:T}}let F=await Yp(U,J,I),M={id:F.id,name:F.name,mode:F.mode,incomingDocumentWebhookUrl:F.incomingDocumentWebhook.url},w=[],O=0,D=0;for(let{run:A,doc:T}of V){console.error(`[webhook-replay] 正在向 Webhook 通道「${F.name}」推送单据: ${T.documentSN}...`);try{let B=await $p(F.incomingDocumentWebhook.url,F.secret,T,Z,B6(J.seal));w.push({originalRecord:{id:A.id,sourceSystem:A.sourceSystem,sourceDocumentSN:A.sourceDocumentSN,sourceDocumentId:A.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},pushResult:B,success:!0}),O+=1}catch(B){let j=B instanceof Error?B.message:String(B);w.push({originalRecord:{id:A.id,sourceSystem:A.sourceSystem,sourceDocumentSN:A.sourceDocumentSN,sourceDocumentId:A.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},error:j,success:!1}),D+=1}}let N=w.length===1;return{success:D===0,dryRun:!1,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:M,totalCount:w.length,successCount:O,failureCount:D,originalRecord:N?w[0].originalRecord:void 0,replayedDocument:N?w[0].replayedDocument:void 0,pushResult:N?w[0].pushResult:void 0,records:w}}var BN1;var CZ=o(()=>{SP();L$();X6();BN1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var KB0,Se1,AN1,ge1;var GB0=o(()=>{B$();KB0=L.object({level:L.enum(["error","warning","info"]),code:L.string(),message:L.string(),snippet:L.string().optional(),suggestion:L.string().optional()}),Se1=L.object({score:L.number().min(0).max(100),passed:L.boolean(),issues:L.array(KB0)}),AN1=L.object({ruleId:L.string
Line truncated
|
||||
↳ ${V}`,operator:J}}function RD0($){if(!$)return[];let Y=$.pending||[],z=String($.rawState||"").toUpperCase(),U=String($.state||"").toUpperCase(),Q=[];if(Y.length>0)for(let J of Y){let I=J.approver?.name||J.approver?.id||"待定",K=(J.name||$.currentNode||"").trim(),G=K?`${K}(${I})`:I,H=J.type?.toUpperCase()==="PAYING"||K.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";Q.push(`${G}: ${H}`)}else if($.currentNode?.trim()){let I=$.currentNode.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";Q.push(`${$.currentNode.trim()}: ${I}`)}return Q}function QU($,Y){let z=new Map;if(!$||$.length===0)return z;if(!Y){for(let q of $){let F=(q.result||{}).decision||q.aiDecision||"-";z.set(q.id,{recordId:q.id,sourceDocumentSN:q.sourceDocumentSN,taskMode:q.taskMode,aiDecision:CD0(typeof F==="string"?F:"-"),aiAction:"-",eHumanAction:"-",eHumanComment:"-",auditDrift:!1})}return z}let U=[...$].sort((q,V)=>(Number(q.createdAt)||0)-(Number(V.createdAt)||0)),Q=Y.history||[],J=String(Y.rawState||"").toUpperCase(),I=String(Y.state||"").toUpperCase(),K=J==="DRAFT"||J==="REVOKED"||J==="CANCELED"||J==="CANCELLED"||I==="草稿"||I==="已撤回"||I==="已取消",G=J==="REJECTED"||J==="TERMINATED"||I==="审批驳回"||I==="已驳回",W=!K&&!G&&(J==="PAID"||I==="已支付"||Q.some((q)=>!q.isEbot&&(q.rawAction==="freeflow.pay"||q.action==="支付成功"||q.action==="支付完成"))),H=!K&&!G&&!W&&(J==="PAYING"||I==="支付中"||(Y.pending||[]).some((q)=>q.isCurrent&&(q.type?.toUpperCase()==="PAYING"||q.name?.includes("支付")))||Y.currentNode?.includes("支付")===!0),Z=W||!K&&!G&&!H&&(J==="COMPLETED"||J==="APPROVED"||I==="已完成"||I==="审批通过");for(let q=0;q<U.length;q++){let V=U[q];if(!V)continue;let F=Number(V.createdAt)||0,M=V.document||{},w=V.manualApprovalRecord||V.result?.manualApprovalRecord||M.manualApprovalRecord||{},O=typeof V.sourceExtendData?.nodeId==="string"?String(V.sourceExtendData.nodeId):void 0,D=typeof w.nodeId==="string"?String(w.nodeId):void 0,N=D?decodeURIComponent(D).replace(/^hcnode_/,"").replace(/_r\d+$/,""):void 0,A=O||N,T=A?Q.find((B0)=>B0.nodeId&&(B0.nodeId===A||A.includes(B0.nodeId))):void 0,B=T?.time??F,j=U[q+1],C=j?Number(j.createdAt)||1/0:1/0,b=q===U.length-1,k=Q.find((B0)=>(B0.time??0)>B+5000&&B0.isEbot&&(B0.nodeName?.includes("智能")||B0.nodeName?.includes("AI")||B0.action?.includes("智能")||B0.comment?.includes("AI")||B0.comment?.includes("approval-result"))&&!B0.nodeName?.includes("费用标准检查")&&!B0.nodeName?.includes("标准检查")&&!B0.nodeName?.includes("预算"));if(k){if(b=!1,(k.time??1/0)<C)C=k.time}let h=V.result||{},i=h.decision||V.aiDecision||"-",c=typeof i==="string"?i:"-",U0=c.toUpperCase(),x=U0==="REJECT"||U0==="驳回",d=U0==="APPROVE"||U0==="通过",t=U0==="EXEMPT_APPROVE"||U0==="免审通过"||U0==="备注通过",$0=V.taskMode||V.finalExecutionMode||"",p=String($0).toLowerCase().includes("auto")||V.finalExecutionMode==="automatic"||$0==="automatic"||$0==="fully_automatic",e="-";if(d||t)e="添加评论";else if(x)e=p?"驳回":"添加评论";else if(U0==="REVIEW"||U0==="转交复核")e="转交复核";let y=typeof w.status==="object"&&w.status!==null?String(w.status.type||w.status.label||"").toUpperCase():"",s=typeof w.status==="object"&&w.status!==null?String(w.status.sourceStatus||""):"",Y0=M.manualApprovalStatus||h.manualApprovalStatus||V.manualApprovalStatus,M0=typeof Y0==="string"?Y0.toUpperCase():"",E0=M0==="CANCELLED"||M0==="CANCELED"||M0==="已取消"||M0==="已撤回"||M0==="REVOKED"||y==="CANCELLED"||y==="CANCELED"||s.includes("撤回")||s.includes("取消"),G0=M0==="APPROVED"||M0==="已支付/审批完成"||M0==="已通过"||M0==="已完成"||M0==="已支付"||y==="APPROVED",b0=!(s.includes("补偿")||s.includes("已支付"))&&(M0==="TERMINATED"||M0==="REJECTED"||M0==="REJECT"||M0==="已驳回"||M0==="被驳回"||y==="TERMINATED"||y==="REJECTED"||y==="已驳回"||y==="被驳回"),Y1=T?1000:60000,a=Q.filter((B0)=>{let Q0=B0.time??0;return Q0>=B-Y1&&Q0<C}),H0="-",L0="-",f0=!1,u0,i0,D1=d||t,k1=Q.filter((B0)=>(B0.time??0)>B+5000),u1=k1.some((B0)=>B0.rawAction==="freeflow.retract"||B0.action==="单据撤回"),b1=k1.some((B0)=>B0.rawAction==="freeflow.submit"||B0.action==="提交送审");if(D1&&b&&(u1||b1))f0=!0,u0="AI通过后单据发生撤回/修改重提,后续未经AI复审";if(p&&x)H0="无操作",L0="-";else{let B0=a.filter((v)=>(v.time??0)>=B-1000&&!v.isEbot&&v.rawAction!=="freeflow.submit"&&v.action!=="提交送审"&&!((v.rawAction==="freeflow.comment"||v.action==="发表评论")&&!v.comment)&&!((v.rawAction==="freeflow.print"||v.action==="打印提醒")&&!v.comment)&&!(v.rawAction==="freeflow.carbonCopy"||v.rawAction==="freeflow.cc"||v.action==="抄送通知")),Q0=B0.find((v)=>v.rawAction==="freeflow.retract"||v.action==="单据撤回"),P=B0.find((v)=>v.rawAction==="freeflow.reject"||v.action==="审批驳回");if(!b)if(P||!Y&&b0){H0="审批驳回",f0=!1,u0=void 0;let v=Sn(P,void 0,w,Q,Y);L0=v.commen
Line truncated
|
||||
`,{mode:384}),Y}function on($){let Y=oD0();for(let z of Y){if(!V$(z))continue;for(let U of RP(z).filter((Q)=>Q.endsWith(".json")).filter((Q)=>!Q.startsWith("example."))){let Q=O9(z,U);try{let J=vP(Q,"utf-8"),I=JSON.parse(J);if(I&&typeof I==="object"&&I.id===$)return Q}catch{}}}return}function x2($,Y){let z=on($);if(!z)throw Error(`Enterprise config not found: ${$}`);let Q={...JSON.parse(vP(z,"utf-8")),...Y};for(let I of Object.keys(Y))if(Y[I]===void 0)delete Q[I];let J=pn.parse(Q);return cD0(z,`${JSON.stringify(J,null,2)}
|
||||
`,"utf-8"),J}var mn="SEAL_USE_ENTERPRISES_DIR",nD0="SEAL_HOME_ENTERPRISES_DIR",pD0="SEAL_USE_USER_ENTERPRISES_DIR",dD0="SEAL_HOME_USER_ENTERPRISES_DIR",mD0="SEAL_USE_CONFIG_FILE",lD0="SEAL_HOME_CONFIG_FILE",rI,_P,CP,bD0;var h7=o(()=>{dn();rI=O9(hP(),".config","seal-use","enterprises"),_P=O9(hP(),".config","seal-home","enterprises"),CP=O9(hP(),".config","seal-use","config.json"),bD0=O9(hP(),".config","seal-home","config.json")});function f2($,Y,z=[]){let U=Y.corpId?.trim()||void 0,Q=Y.stateful?Y.defaultCorpId?.trim()||void 0:void 0,J=U??Q;if(J){let K=$.find((H)=>H.id===J);if(K)return K;let G=$.find((H)=>H.id.toLowerCase()===J.toLowerCase());if(G)return G;let W=$.find((H)=>H.name.toLowerCase()===J.toLowerCase());if(W)return W;throw Error(`No enterprise config found for ${J}`)}if(!Y.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-home config mode stateful` to enable a default enterprise.");let I=$[0];if(I)return I;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(z.length?z.join(", "):"the configured enterprise directories"))}import{existsSync as rn,mkdirSync as rO1,readFileSync as sO1,renameSync as aO1,unlinkSync as tO1,writeFileSync as eO1}from"node:fs";import{homedir as $N1}from"node:os";import{dirname as YN1,join as zN1}from"node:path";function an(){let $=process.env[UN1]?.trim();if($)return $;return QN1}function rD0($=new Date){return $.toISOString().slice(0,10)}function sD0($=sn,Y=new Date){let z=Y.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function aD0($=an()){if(!rn($))return{};try{let Y=sO1($,"utf-8"),z=JSON.parse(Y);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function JN1($,Y){let z={};for(let[U,Q]of Object.entries($)){if(!Q||typeof Q!=="object")continue;let J={},I=!1;for(let[K,G]of Object.entries(Q))if(typeof G==="number"&&G>0&&K>=Y)J[K]=G,I=!0;if(I)z[U]=J}return z}function IN1($,Y=an()){let z=YN1(Y);if(!rn(z))rO1(z,{recursive:!0,mode:448});let U=`${Y}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{eO1(U,JSON.stringify($,null,2),"utf-8"),aO1(U,Y)}catch(Q){try{if(rn(U))tO1(U)}catch{}throw Q}}function tD0($,Y=new Date){if(!$||typeof $!=="string")return;try{let z=an(),U=aD0(z),Q=rD0(Y),J=sD0(sn,Y),I=JN1(U,J);I[$]=I[$]||{},I[$][Q]=(I[$][Q]??0)+1,IN1(I,z)}catch{}}function KN1($,Y=sn,z=new Date){let U=new Map;try{let Q=aD0(),J=sD0(Y,z),I=rD0(z),K=$??Object.keys(Q);for(let G of K){let W=Q[G];if(!W){U.set(G,0);continue}let H=0;for(let[X,Z]of Object.entries(W))if(X>=J&&X<=I&&typeof Z==="number")H+=Z;U.set(G,H)}}catch{if($)for(let Q of $)U.set(Q,0)}return U}function eD0($,Y,z){let U=z??KN1($.map((Q)=>Q.id));return[...$].sort((Q,J)=>{if(Y){if(Q.id===Y&&J.id!==Y)return-1;if(J.id===Y&&Q.id!==Y)return 1}let I=U.get(Q.id)??0,K=U.get(J.id)??0;if(I!==K)return K-I;let G=Q.name??Q.id,W=J.name??J.id,H=G.localeCompare(W,"zh-CN");if(H!==0)return H;return Q.id.localeCompare(J.id)})}var UN1="SEAL_USE_USAGE_FILE",QN1,sn=7;var tn=o(()=>{QN1=zN1($N1(),".config","seal-use","usage.json")});function GN1($,Y){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>Y?z:z.toLowerCase())}function WN1($,Y){return Y?$:$.toLowerCase()}function HN1($,Y,z,U){let Q=WN1($,U),J=Y.filter((I)=>Q.includes(I));if(z==="all"&&J.length!==Y.length)return[];return J}function XN1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function ZN1($,Y){if(Y.fields&&!Y.fields.has($.field))return[];let z=XN1($.value),U=[];return z.forEach((Q,J)=>{let I=HN1(Q,Y.keywords,Y.matchMode,Y.caseSensitive);if(I.length===0)return;let K=Math.max(0,J-Y.contextLines),G=Math.min(z.length,J+Y.contextLines+1),W={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:J+1,matchedKeywords:I,matchedText:SP(Q,Y.maxChars),context:{before:Y.snippetOnly?[]:z.slice(K,J).map((H)=>SP(H,Y.maxChars)),line:SP(Q,Y.maxChars),after:Y.snippetOnly?[]:z.slice(J+1,G).map((H)=>SP(H,Y.maxChars))},metadata:$.metadata};if(Y.snippetOnly)W.context={before:[],line:W.context.line,after:[]};U.push(W)}),U}function SP($,Y){if(!Y||$.length<=Y)return $;return`${$.slice(0,Math.max(0,Y))}...`}function qN1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function YB0($){return $.rules.flatMap((Y,z)=>{let U=`${$.id}:${Y.description.slice(0,32)}`,Q={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:Y.scope,strictness:Y.strictness,code:"code"in Y?Y.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:U,title:`${$.versionName} / ${Y.scope}`,field:"history.description",
Line truncated
|
||||
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==U.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:U}}async function Yp($,Y,z){let U=Y.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",Q=await J$($,U);if(z||Q.length>0)return IB0(Q,z,Y.id);if(Y.environment==="test"||Y.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${Y.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let J=(Y.seal.url??Y.source?.sealUrl??`https://${Y.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await GM($,J,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${J}/api/v1/integrations/webhook/replay-mock-callback`},Y.seal.endpoints.approvalStylePreferences)}throw new w4(`当前租户「${Y.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${Y.id}`)}async function sI($){let{query:Y,sourceClient:z,targetClient:U,sourceCorp:Q,targetCorp:J,webhookSelector:I,snPrefix:K,snSuffix:G,docIdPrefix:W,docIdSuffix:H,dryRun:X,fetchFn:Z=fetch}=$,q=[];if(Y.recordId){let A=await G4(z,Y.recordId);q.push(A)}else if(Y.recordIds&&Y.recordIds.length>0)for(let A of Y.recordIds)q.push(await G4(z,A));else if(Y.sn){let A=await b4(z,{sourceDocumentSN:Y.sn,limit:1});if(!A.records.length)throw Error(`在企业「${Q.name}」中未找到单据编号为「${Y.sn}」的审批记录。`);q.push(A.records[0])}else if(Y.sns&&Y.sns.length>0)for(let A of Y.sns){let T=await b4(z,{sourceDocumentSN:A,limit:1});if(!T.records.length)throw Error(`在企业「${Q.name}」中未找到单据编号为「${A}」的审批记录。`);q.push(T.records[0])}else if(Y.limit!==void 0){let A=await b4(z,{limit:Y.limit,status:Y.status,startDate:Y.startDate,endDate:Y.endDate});if(!A.records.length)throw Error(`在企业「${Q.name}」中未检索到符合条件的审批记录。`);q=A.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let V=q.map((A)=>({run:A,doc:en(A,{snPrefix:K,snSuffix:G,docIdPrefix:W,docIdSuffix:H})}));if(X){let A={id:"preview-webhook",name:I??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${J.seal.url}/api/v1/integrations/webhook/preview`};try{let j=await J$(U,J.seal.endpoints.approvalStylePreferences);if(j.length>0){let C=IB0(j,I,J.id);A={id:C.id,name:C.name,mode:C.mode,incomingDocumentWebhookUrl:C.incomingDocumentWebhook.url}}}catch{}let T=V.map(({run:j,doc:C})=>({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},document:C,success:!0})),B=T.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:A,totalCount:T.length,successCount:T.length,failureCount:0,originalRecord:B?T[0].originalRecord:void 0,document:B?T[0].document:void 0,records:T}}let F=await Yp(U,J,I),M={id:F.id,name:F.name,mode:F.mode,incomingDocumentWebhookUrl:F.incomingDocumentWebhook.url},w=[],O=0,D=0;for(let{run:A,doc:T}of V){console.error(`[webhook-replay] 正在向 Webhook 通道「${F.name}」推送单据: ${T.documentSN}...`);try{let B=await $p(F.incomingDocumentWebhook.url,F.secret,T,Z,B6(J.seal));w.push({originalRecord:{id:A.id,sourceSystem:A.sourceSystem,sourceDocumentSN:A.sourceDocumentSN,sourceDocumentId:A.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},pushResult:B,success:!0}),O+=1}catch(B){let j=B instanceof Error?B.message:String(B);w.push({originalRecord:{id:A.id,sourceSystem:A.sourceSystem,sourceDocumentSN:A.sourceDocumentSN,sourceDocumentId:A.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},error:j,success:!1}),D+=1}}let N=w.length===1;return{success:D===0,dryRun:!1,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:M,totalCount:w.length,successCount:O,failureCount:D,originalRecord:N?w[0].originalRecord:void 0,replayedDocument:N?w[0].replayedDocument:void 0,pushResult:N?w[0].pushResult:void 0,records:w}}var PN1;var CZ=o(()=>{gP();L$();X6();PN1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var KB0,ye1,TN1,ke1;var GB0=o(()=>{B$();KB0=L.object({level:L.enum(["error","warning","info"]),code:L.string(),message:L.string(),snippet:L.string().optional(),suggestion:L.string().optional()}),ye1=L.object({score:L.number().min(0).max(100),passed:L.boolean(),issues:L.array(KB0)}),TN1=L.object({ruleId:L.string
Line truncated
|
||||
* ==============================================================================
|
||||
* Seal 官方标准规则校验器 (Official Standard Rule Linter)
|
||||
* ==============================================================================
|
||||
@@ -876,62 +876,62 @@ export function lintRule(rule: RuleLintTarget): RuleLintResult {
|
||||
}
|
||||
|
||||
export default lintRule;
|
||||
`}});import{existsSync as KU,mkdirSync as fN1,readFileSync as uN1,readdirSync as qB0,rmSync as bN1,unlinkSync as iN1,writeFileSync as cN1}from"node:fs";import{homedir as nN1}from"node:os";import{isAbsolute as pN1,join as f6,resolve as dN1}from"node:path";import{pathToFileURL as XB0}from"node:url";function VB0($=i$){let Y=[],z=[];try{if(!KU($))fN1($,{recursive:!0});let U=Object.keys(Jp);for(let[J,I]of Object.entries(Jp)){let K=f6($,J),G=!0;if(KU(K))try{if(uN1(K,"utf8")===I)G=!1}catch{G=!0}if(G)cN1(K,I,"utf8");Y.push(J)}let Q=qB0($,{withFileTypes:!0});for(let J of Q)if(!U.includes(J.name)){let I=f6($,J.name);try{if(J.isDirectory())bN1(I,{recursive:!0,force:!0});else iN1(I);z.push(J.name)}catch{}}}catch{}return{synced:Y,pruned:z}}function LB0($={syncOfficial:!0}){if($.syncOfficial!==!1)VB0();let Y=[{name:"builtin",type:"builtin",path:f6(i$,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:f6(i$,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:f6(i$,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],z=[b$,kP];for(let U of z)if(KU(U))try{let Q=qB0(U,{withFileTypes:!0});for(let J of Q){if(J.isDirectory())continue;let I=J.name;if(I.endsWith(".ts")||I.endsWith(".js")||I.endsWith(".mjs")){let K=I.replace(/\.(ts|js|mjs)$/,"");if(!Y.some((G)=>G.name===K))Y.push({name:K,type:"custom",path:f6(U,I),description:`用户自定义规则校验器 (${I})`})}}}catch{}return Y}function lN1($){let Y=($||"").trim();if(!Y||Y==="builtin"||Y==="default"||Y==="official/builtin"||Y==="official/builtin.ts")return{path:f6(i$,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(Y==="strict"||Y==="official/strict"||Y==="official/strict.ts")return{path:f6(i$,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(Y==="hlab"||Y==="hlab-sop"||Y==="hlab-rules"||Y==="hlab-standard"||Y==="official/hlab"||Y==="official/hlab.ts")return{path:f6(i$,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(pN1(Y)||Y.startsWith("./")||Y.startsWith("../")){let U=dN1(Y);if(KU(U))return{path:U};for(let Q of[".ts",".js",".mjs"])if(KU(`${U}${Q}`))return{path:`${U}${Q}`}}let z=[f6(b$,`${Y}.ts`),f6(b$,`${Y}.js`),f6(b$,`${Y}.mjs`),f6(kP,`${Y}.ts`),f6(kP,`${Y}.js`),f6(kP,`${Y}.mjs`)];for(let U of z)if(KU(U))return{path:U};return{}}async function Kp($){VB0();let Y=lN1($??"builtin");if(Y.isOfficial){let U=Y.officialKind==="strict"?WB0:Y.officialKind==="hlab"?HB0:aI,Q=Y.officialKind==="builtin"?"builtin":"official",J=Y.path;if(J&&KU(J))try{let K=await import(XB0(J).href),G=K.default??K.lintRule??K.linter??K.lint;if(typeof G==="function")return{name:Y.officialKind??"builtin",type:Q,filePath:J,linter:ZB0(G,U)}}catch{}return{name:Y.officialKind??"builtin",type:Q,filePath:J,linter:U}}let z=Y.path;if(!z)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aI};try{let Q=await import(XB0(z).href),J=Q.default??Q.lintRule??Q.linter??Q.lint;if(typeof J!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${z}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aI};return{name:$??"custom",type:"custom",filePath:z,linter:ZB0(J,aI)}}catch(U){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${U?.message??U}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aI}}}function ZB0($,Y){return async(z,U)=>{try{let Q=await $(z,U);if(Q&&typeof Q==="object"&&typeof Q.score==="number"&&Array.isArray(Q.issues))return Q;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),Y(z,U)}catch(Q){return console.error("⚠️ [linter] 自定义校验器执行异常:",Q),Y(z,U)}}}var b$,mN1="official",i$,kP;var Gp=o(()=>{zp();Qp();Ip();Up();b$=f6(nN1(),".config","seal-use","linters"),i$=f6(b$,mN1),kP=f6(process.cwd(),"linters")});async function Wp($,Y,z){let U=await Y.linter($,z);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:U.score,passed:U.passed,issues:U.issues,description:$.description}}async function FB0($,Y,z,U){let Q=U?.minScore??0,J=U?.level??"all",I=[],K=0;for(let q of $){let V=await Wp(q,Y,z);K+=V.score;let F=V.issues;if(J==="error")F=V.issues.filter((w)=>w.level==="error");else if(J==="warning")F=V.issues.filter((w)=>w.level==="warning"||w.level==="error");let M=F.every((w)=>w.level!=="error");if(U?.summary){if(F.length>0)I.push({...V,passed:M,issues:F})}else I.push({...V,passed:M,issues:F})}let G=$.length,W=G===0?100:Math.round(K/G),H=I.filter((q)=>q.issues.length>0).length,X=G-Line truncated
|
||||
`}});import{existsSync as KU,mkdirSync as uN1,readFileSync as bN1,readdirSync as qB0,rmSync as iN1,unlinkSync as cN1,writeFileSync as nN1}from"node:fs";import{homedir as pN1}from"node:os";import{isAbsolute as dN1,join as f6,resolve as mN1}from"node:path";import{pathToFileURL as XB0}from"node:url";function VB0($=i$){let Y=[],z=[];try{if(!KU($))uN1($,{recursive:!0});let U=Object.keys(Jp);for(let[J,I]of Object.entries(Jp)){let K=f6($,J),G=!0;if(KU(K))try{if(bN1(K,"utf8")===I)G=!1}catch{G=!0}if(G)nN1(K,I,"utf8");Y.push(J)}let Q=qB0($,{withFileTypes:!0});for(let J of Q)if(!U.includes(J.name)){let I=f6($,J.name);try{if(J.isDirectory())iN1(I,{recursive:!0,force:!0});else cN1(I);z.push(J.name)}catch{}}}catch{}return{synced:Y,pruned:z}}function LB0($={syncOfficial:!0}){if($.syncOfficial!==!1)VB0();let Y=[{name:"builtin",type:"builtin",path:f6(i$,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:f6(i$,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:f6(i$,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],z=[b$,xP];for(let U of z)if(KU(U))try{let Q=qB0(U,{withFileTypes:!0});for(let J of Q){if(J.isDirectory())continue;let I=J.name;if(I.endsWith(".ts")||I.endsWith(".js")||I.endsWith(".mjs")){let K=I.replace(/\.(ts|js|mjs)$/,"");if(!Y.some((G)=>G.name===K))Y.push({name:K,type:"custom",path:f6(U,I),description:`用户自定义规则校验器 (${I})`})}}}catch{}return Y}function oN1($){let Y=($||"").trim();if(!Y||Y==="builtin"||Y==="default"||Y==="official/builtin"||Y==="official/builtin.ts")return{path:f6(i$,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(Y==="strict"||Y==="official/strict"||Y==="official/strict.ts")return{path:f6(i$,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(Y==="hlab"||Y==="hlab-sop"||Y==="hlab-rules"||Y==="hlab-standard"||Y==="official/hlab"||Y==="official/hlab.ts")return{path:f6(i$,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(dN1(Y)||Y.startsWith("./")||Y.startsWith("../")){let U=mN1(Y);if(KU(U))return{path:U};for(let Q of[".ts",".js",".mjs"])if(KU(`${U}${Q}`))return{path:`${U}${Q}`}}let z=[f6(b$,`${Y}.ts`),f6(b$,`${Y}.js`),f6(b$,`${Y}.mjs`),f6(xP,`${Y}.ts`),f6(xP,`${Y}.js`),f6(xP,`${Y}.mjs`)];for(let U of z)if(KU(U))return{path:U};return{}}async function Kp($){VB0();let Y=oN1($??"builtin");if(Y.isOfficial){let U=Y.officialKind==="strict"?WB0:Y.officialKind==="hlab"?HB0:aI,Q=Y.officialKind==="builtin"?"builtin":"official",J=Y.path;if(J&&KU(J))try{let K=await import(XB0(J).href),G=K.default??K.lintRule??K.linter??K.lint;if(typeof G==="function")return{name:Y.officialKind??"builtin",type:Q,filePath:J,linter:ZB0(G,U)}}catch{}return{name:Y.officialKind??"builtin",type:Q,filePath:J,linter:U}}let z=Y.path;if(!z)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aI};try{let Q=await import(XB0(z).href),J=Q.default??Q.lintRule??Q.linter??Q.lint;if(typeof J!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${z}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aI};return{name:$??"custom",type:"custom",filePath:z,linter:ZB0(J,aI)}}catch(U){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${U?.message??U}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:aI}}}function ZB0($,Y){return async(z,U)=>{try{let Q=await $(z,U);if(Q&&typeof Q==="object"&&typeof Q.score==="number"&&Array.isArray(Q.issues))return Q;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),Y(z,U)}catch(Q){return console.error("⚠️ [linter] 自定义校验器执行异常:",Q),Y(z,U)}}}var b$,lN1="official",i$,xP;var Gp=o(()=>{zp();Qp();Ip();Up();b$=f6(pN1(),".config","seal-use","linters"),i$=f6(b$,lN1),xP=f6(process.cwd(),"linters")});async function Wp($,Y,z){let U=await Y.linter($,z);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:U.score,passed:U.passed,issues:U.issues,description:$.description}}async function FB0($,Y,z,U){let Q=U?.minScore??0,J=U?.level??"all",I=[],K=0;for(let q of $){let V=await Wp(q,Y,z);K+=V.score;let F=V.issues;if(J==="error")F=V.issues.filter((w)=>w.level==="error");else if(J==="warning")F=V.issues.filter((w)=>w.level==="warning"||w.level==="error");let M=F.every((w)=>w.level!=="error");if(U?.summary){if(F.length>0)I.push({...V,passed:M,issues:F})}else I.push({...V,passed:M,issues:F})}let G=$.length,W=G===0?100:Math.round(K/G),H=I.filter((q)=>q.issues.length>0).length,X=G-Line truncated
|
||||
`,"utf8"),z}function NB0($){return $.map((Y,z)=>{let U;if(typeof Y.code==="number")U=`#${String(Y.code).padStart(4,"0")}`;else if(typeof Y.code==="string")U=Y.code.startsWith("#")?Y.code:`#${Y.code}`;else U=`#${String(z+1).padStart(4,"0")}`;return{id:Y.id,code:U,name:Y.name,description:Y.description,scope:Y.scope,strictness:Y.strictness}})}var DB0=()=>{};var BB0,D5;var tI=o(()=>{BB0=class BB0 extends Error{errors;warnings;constructor($,Y=[]){super([`webhook 资源包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
|
||||
`));this.errors=$;this.warnings=Y;this.name="ResourcePackValidationError"}};D5=BB0});var jB0=E((G04,TB0)=>{TB0.exports=xP;function xP(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}xP.prototype.go=function($){if(this.pending<this.max)AB0(this,$);else this.waiting.push($)};xP.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};xP.prototype.hold=function(){return PB0(this)};function PB0($){$.pending+=1;var Y=!1;return z;function z(Q){if(Y)throw Error("callback called twice");if(Y=!0,$.error=$.error||Q,$.pending-=1,$.waiting.length>0&&$.pending<$.max)AB0($,$.waiting.shift());else if($.pending===0){var J=$.listeners;$.listeners=[],J.forEach(U)}}function U(Q){Q($.error)}}function AB0($,Y){Y(PB0($))}});var RB0=E((zD1)=>{var Zp=I0("fs"),qp=I0("util"),EB0=I0("stream"),CB0=EB0.Readable,$D1=EB0.PassThrough,YD1=jB0(),fP=I0("events").EventEmitter;zD1.BufferSlicer=$K;zD1.FdSlicer=eI;qp.inherits(eI,fP);function eI($){fP.call(this),this.fd=$,this.pend=new YD1,this.pend.max=1,this.refCount=0}eI.prototype.read=function($,Y,z,U,Q){var J=this;J.pend.go(function(I){Zp.read(J.fd,$,Y,z,U,function(K,G,W){I(),Q(K,G,W)})})};eI.prototype.createReadStream=function($){return new RZ(this,$)};eI.prototype.ref=function(){this.refCount+=1};eI.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;Zp.close($.fd,Y);function Y(z){if(z)$.emit("error",z);else $.emit("close")}};qp.inherits(RZ,CB0);function RZ($,Y){Y=Y||{},CB0.call(this,Y),this.context=$,this.context.ref(),this.start=Y.start||0,this.endOffset=Y.end,this.pos=this.start}RZ.prototype._read=function($){var Y=this,z=Math.min(Y._readableState.highWaterMark,$);if(Y.endOffset!=null)z=Math.min(z,Y.endOffset-Y.pos);if(z<=0){Y.push(null),this._cleanup();return}Y.context.pend.go(function(U){var Q=Buffer.allocUnsafe(z);Zp.read(Y.context.fd,Q,0,z,Y.pos,function(J,I){if(J)Y.destroy(J);else if(I===0)Y.push(null),Y._cleanup();else Y.pos+=I,Y.push(Q.slice(0,I));U()})})};RZ.prototype._destroy=function($,Y){this._cleanup(),Y($)};RZ.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};qp.inherits($K,fP);function $K($){fP.call(this),this.refCount=0,this.buffer=$}$K.prototype.read=function($,Y,z,U,Q){if(!(0<=Y&&Y<=$.length))throw RangeError("offset outside buffer: 0 <= "+Y+" <= "+$.length);if(U<0)throw RangeError("position is negative: "+U);if(Y+z>$.length)z=$.length-Y;if(U+z>this.buffer.length)z=this.buffer.length-U;if(z<=0){setImmediate(function(){Q(null,0)});return}this.buffer.copy($,Y,U,U+z),setImmediate(function(){Q(null,z)})};$K.prototype.createReadStream=function($){$=$||{};var Y=new $D1($);Y.start=$.start||0,Y.endOffset=$.end,Y.pos=Y.endOffset||this.buffer.length;var z=this.buffer.slice(Y.start,Y.pos),U=65536,Q=0;while(!0){var J=Q+U;if(J>=z.length){if(Q<z.length)Y.write(z.slice(Q,z.length));break}Y.write(z.slice(Q,J)),Q=J}return Y.end(),Y};$K.prototype.ref=function(){this.refCount+=1};$K.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var vB0=E((H04,_B0)=>{var JD1=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,
Line truncated
|
||||
`));this.errors=$;this.warnings=Y;this.name="ResourcePackValidationError"}};D5=BB0});var jB0=E((H04,TB0)=>{TB0.exports=fP;function fP(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}fP.prototype.go=function($){if(this.pending<this.max)AB0(this,$);else this.waiting.push($)};fP.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};fP.prototype.hold=function(){return PB0(this)};function PB0($){$.pending+=1;var Y=!1;return z;function z(Q){if(Y)throw Error("callback called twice");if(Y=!0,$.error=$.error||Q,$.pending-=1,$.waiting.length>0&&$.pending<$.max)AB0($,$.waiting.shift());else if($.pending===0){var J=$.listeners;$.listeners=[],J.forEach(U)}}function U(Q){Q($.error)}}function AB0($,Y){Y(PB0($))}});var RB0=E((UD1)=>{var Zp=I0("fs"),qp=I0("util"),EB0=I0("stream"),CB0=EB0.Readable,YD1=EB0.PassThrough,zD1=jB0(),uP=I0("events").EventEmitter;UD1.BufferSlicer=$K;UD1.FdSlicer=eI;qp.inherits(eI,uP);function eI($){uP.call(this),this.fd=$,this.pend=new zD1,this.pend.max=1,this.refCount=0}eI.prototype.read=function($,Y,z,U,Q){var J=this;J.pend.go(function(I){Zp.read(J.fd,$,Y,z,U,function(K,G,W){I(),Q(K,G,W)})})};eI.prototype.createReadStream=function($){return new RZ(this,$)};eI.prototype.ref=function(){this.refCount+=1};eI.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;Zp.close($.fd,Y);function Y(z){if(z)$.emit("error",z);else $.emit("close")}};qp.inherits(RZ,CB0);function RZ($,Y){Y=Y||{},CB0.call(this,Y),this.context=$,this.context.ref(),this.start=Y.start||0,this.endOffset=Y.end,this.pos=this.start}RZ.prototype._read=function($){var Y=this,z=Math.min(Y._readableState.highWaterMark,$);if(Y.endOffset!=null)z=Math.min(z,Y.endOffset-Y.pos);if(z<=0){Y.push(null),this._cleanup();return}Y.context.pend.go(function(U){var Q=Buffer.allocUnsafe(z);Zp.read(Y.context.fd,Q,0,z,Y.pos,function(J,I){if(J)Y.destroy(J);else if(I===0)Y.push(null),Y._cleanup();else Y.pos+=I,Y.push(Q.slice(0,I));U()})})};RZ.prototype._destroy=function($,Y){this._cleanup(),Y($)};RZ.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};qp.inherits($K,uP);function $K($){uP.call(this),this.refCount=0,this.buffer=$}$K.prototype.read=function($,Y,z,U,Q){if(!(0<=Y&&Y<=$.length))throw RangeError("offset outside buffer: 0 <= "+Y+" <= "+$.length);if(U<0)throw RangeError("position is negative: "+U);if(Y+z>$.length)z=$.length-Y;if(U+z>this.buffer.length)z=this.buffer.length-U;if(z<=0){setImmediate(function(){Q(null,0)});return}this.buffer.copy($,Y,U,U+z),setImmediate(function(){Q(null,z)})};$K.prototype.createReadStream=function($){$=$||{};var Y=new YD1($);Y.start=$.start||0,Y.endOffset=$.end,Y.pos=Y.endOffset||this.buffer.length;var z=this.buffer.slice(Y.start,Y.pos),U=65536,Q=0;while(!0){var J=Q+U;if(J>=z.length){if(Q<z.length)Y.write(z.slice(Q,z.length));break}Y.write(z.slice(Q,J)),Q=J}return Y.end(),Y};$K.prototype.ref=function(){this.refCount+=1};$K.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var vB0=E((Z04,_B0)=>{var ID1=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,
Line truncated
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"
¡¢£¤¥¦§¨©ª«¬®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"
ЁЂҐЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"
¡¢£¤¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"
ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€…‘’“”•–— กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"
¡¢£€¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csiLine truncated
|
||||
\v\f\r\x0E\x0F\x10ỨỰỲỶỸÝỴ\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ`},georgianacademy:{type:"_sbcs",chars:"‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:`\x00\x01Ẳ\x03\x04ẴẪ\x07\b
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13Ỷ\x15\x16\x17\x18Ỹ\x1A\x1B\x1C\x1DỴ\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ`},iso646cn:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},iso646jp:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"
ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var WP0=E((UB1)=>{var rp=g7().Buffer;UB1._dbcs=k7;var Y8=-1,GP0=-2,p$=-10,h8=-1000,KK=Array(256),hZ=-1;for(vZ=0;vZ<256;vZ++)KK[vZ]=Y8;var vZ;function k7($,Y){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var z=$.table();this.decodeTables=[],this.decodeTables[0]=KK.slice(0),this.decodeTableSeq=[];for(var U=0;U<z.length;U++)this._addDecodeChunk(z[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var Q=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var J=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var I=this.decodeTables[0];for(var U=129;U<=254;U++){var K=this.decodeTables[h8-I[U]];for(var G=48;G<=57;G++){if(K[G]===Y8)K[G]=h8-Q;else if(K[G]>h8)throw Error("gb18030 decode tables conflict at byte 2");var W=this.decodeTables[h8-K[G]];for(var H=129;H<=254;H++){if(W[H]===Y8)W[H]=h8-J;else if(W[H]===h8-J)continue;else if(W[H]>h8)throw Error("gb18030 decode tables conflict at byte 3");var X=this.decodeTables[h8-W[H]];for(var Z=48;Z<=57;Z++)if(X[Z]===Y8)X[Z]=GP0}}}}this.defaultCharUnicode=Y.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var q={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var V=$.encodeSkipVals[U];if(typeof V==="number")q[V]=!0;else for(var G=V.from;G<=V.to;G++)q[G]=!0}if(this._fillEncodeTable(0,0,q),$.encodeAdd){for(var F in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,F))this._setEncodeChar(F.charCodeAt(0),$.encodeAdd[F])}if(this.defCharSB=this.encodeTable[0][Y.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===Y8)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===Y8)this.defCharSB=63}k7.prototype.encoder=aP;k7.prototype.decoder=sp;k7.prototype._getDecodeTrieNode=function($){var Y=[];for(;$>0;$>>>=8)Y.push($&255);if(Y.length==0)Y.push(0);var z=this.decodeTables[0];for(var U=Y.length-1;U>0;U--){var Q=z[Y[U]];if(Q==Y8)z[Y[U]]=h8-this.decodeTables.length,this.decodeTables.push(z=KK.slice(0));else if(Q<=h8)z=this.decodeTables[h8-Q];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};k7.prototype._addDecodeChunk=function($){var Y=parseInt($[0],16),z=this._getDecodeTrieNode(Y);Y=Y&255;for(var U=1;U<$.length;U++){var Q=$[U];if(typeof Q==="string")for(var J=0;J<Q.length;){var I=Q.charCodeAt(J++);if(I>=55296&&I<56320){var K=Q.charCodeAt(J++);if(K>=56320&&K<57344)z[Y++]=65536+(I-55296)*1024+(K-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(I>4080&&I<=4095){var G=4095-I+2,W=[];for(var H=0;H<G;H++)W.push(Q.charCodeAt(J++));z[Y++]=p$-this.decodeTableSeq.length,this.decodeTableSeq.push(W)}else z[Y++]=I}else if(typeof Q==="number"){var X=z[Y-1]+1;for(var J=0;J<Q;J++)z[Y++]=X++}else throw Error("Incorrect type '"+typeof Q+"' given in "+this.encodingName+" at chunk "+$[0])}if(Y>255)throw Error("Incorrect chunk in "+this.encoLine truncated
|
||||
`;super(Y);this.name="AggregateError",this.errors=$}}MA0.exports={AggregateError:wA0,ArrayIsArray($){return Array.isArray($)},ArrayPrototypeIncludes($,Y){return $.includes(Y)},ArrayPrototypeIndexOf($,Y){return $.indexOf(Y)},ArrayPrototypeJoin($,Y){return $.join(Y)},ArrayPrototypeMap($,Y){return $.map(Y)},ArrayPrototypePop($,Y){return $.pop(Y)},ArrayPrototypePush($,Y){return $.push(Y)},ArrayPrototypeSlice($,Y,z){return $.slice(Y,z)},Error,FunctionPrototypeCall($,Y,...z){return $.call(Y,...z)},FunctionPrototypeSymbolHasInstance($,Y){return Function.prototype[Symbol.hasInstance].call($,Y)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties($,Y){return Object.defineProperties($,Y)},ObjectDefineProperty($,Y,z){return Object.defineProperty($,Y,z)},ObjectGetOwnPropertyDescriptor($,Y){return Object.getOwnPropertyDescriptor($,Y)},ObjectKeys($){return Object.keys($)},ObjectSetPrototypeOf($,Y){return Object.setPrototypeOf($,Y)},Promise,PromisePrototypeCatch($,Y){return $.catch(Y)},PromisePrototypeThen($,Y,z){return $.then(Y,z)},PromiseReject($){return Promise.reject($)},PromiseResolve($){return Promise.resolve($)},ReflectApply:Reflect.apply,RegExpPrototypeTest($,Y){return $.test(Y)},SafeSet:Set,String,StringPrototypeSlice($,Y,z){return $.slice(Y,z)},StringPrototypeToLowerCase($){return $.toLowerCase()},StringPrototypeToUpperCase($){return $.toUpperCase()},StringPrototypeTrim($){return $.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet($,Y,z){return $.set(Y,z)},Boolean,Uint8Array}});var Od=E((V14,OA0)=>{OA0.exports={format($,...Y){return $.replace(/%([sdifj])/g,function(...[z,U]){let Q=Y.shift();if(U==="f")return Q.toFixed(6);else if(U==="j")return JSON.stringify(Q);else if(U==="s"&&typeof Q==="object")return`${Q.constructor!==Object?Q.constructor.name:""} {}`.trim();else return Q.toString()})},inspect($){switch(typeof $){case"string":if($.includes("'")){if(!$.includes('"'))return`"${$}"`;else if(!$.includes("`")&&!$.includes("${"))return`\`${$}\``}return`'${$}'`;case"number":if(isNaN($))return"NaN";else if(Object.is($,-0))return String($);return $;case"bigint":return`${String($)}n`;case"boolean":case"undefined":return String($);case"object":return"{}"}}}});var w8=E((L14,PA0)=>{var{format:sP1,inspect:UA}=Od(),{AggregateError:aP1}=x4(),tP1=globalThis.AggregateError||aP1,eP1=Symbol("kIsNodeError"),$A1=["string","function","number","object","Function","Object","boolean","bigint","symbol"],YA1=/^([A-Z][a-z0-9]*)+$/,QA={};function HU($,Y){if(!$)throw new QA.ERR_INTERNAL_ASSERTION(Y)}function NA0($){let Y="",z=$.length,U=$[0]==="-"?1:0;for(;z>=U+4;z-=3)Y=`_${$.slice(z-3,z)}${Y}`;return`${$.slice(0,z)}${Y}`}function zA1($,Y,z){if(typeof Y==="function")return HU(Y.length<=z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${Y.length}).`),Y(...z);let U=(Y.match(/%[dfijoOs]/g)||[]).length;if(HU(U===z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${U}).`),z.length===0)return Y;return sP1(Y,...z)}function z8($,Y,z){if(!z)z=Error;class U extends z{constructor(...Q){super(zA1($,Y,Q))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(U.prototype,{name:{value:z.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),U.prototype.code=$,U.prototype[eP1]=!0,QA[$]=U}function DA0($){let Y="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:Y}),$}function UA1($,Y){if($&&Y&&$!==Y){if(Array.isArray(Y.errors))return Y.errors.push($),Y;let z=new tP1([Y,$],Y.message);return z.code=Y.code,z}return $||Y}class BA0 extends Error{constructor($="The operation was aborted",Y=void 0){if(Y!==void 0&&typeof Y!=="object")throw new QA.ERR_INVALID_ARG_TYPE("options","Object",Y);super($,Y);this.code="ABORT_ERR",this.name="AbortError"}}z8("ERR_ASSERTION","%s",Error);z8("ERR_INVALID_ARG_TYPE",($,Y,z)=>{if(HU(typeof $==="string","'name' must be a string"),!Array.isArray(Y))Y=[Y];let U="The ";if($.endsWith(" argument"))U+=`${$} `;else U+=`"${$}" ${$.includes(".")?"property":"argument"} `;U+="must be ";let Q=[],J=[],I=[];for(let G of Y)if(HU(typeof G==="string","All expected entries have to be of type string"),$A1.includes(G))Q.push(G.toLowerCase());else if(YA1.test(G))J.push(G);else HU(G!=="object",'The value "object" should be written as "Object"'),I.push(G);if(J.length>0){let G=Q.indexOf("object");if(G!==-1)Q.splice(Q,G,1),J.push("Object")}if(Q.length>0){switch(Q.length){case 1:U+=`of type ${Q[Line truncated
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"
ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var WP0=E((QB1)=>{var rp=g7().Buffer;QB1._dbcs=k7;var Y8=-1,GP0=-2,p$=-10,h8=-1000,KK=Array(256),hZ=-1;for(vZ=0;vZ<256;vZ++)KK[vZ]=Y8;var vZ;function k7($,Y){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var z=$.table();this.decodeTables=[],this.decodeTables[0]=KK.slice(0),this.decodeTableSeq=[];for(var U=0;U<z.length;U++)this._addDecodeChunk(z[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var Q=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var J=this.decodeTables.length;this.decodeTables.push(KK.slice(0));var I=this.decodeTables[0];for(var U=129;U<=254;U++){var K=this.decodeTables[h8-I[U]];for(var G=48;G<=57;G++){if(K[G]===Y8)K[G]=h8-Q;else if(K[G]>h8)throw Error("gb18030 decode tables conflict at byte 2");var W=this.decodeTables[h8-K[G]];for(var H=129;H<=254;H++){if(W[H]===Y8)W[H]=h8-J;else if(W[H]===h8-J)continue;else if(W[H]>h8)throw Error("gb18030 decode tables conflict at byte 3");var X=this.decodeTables[h8-W[H]];for(var Z=48;Z<=57;Z++)if(X[Z]===Y8)X[Z]=GP0}}}}this.defaultCharUnicode=Y.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var q={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var V=$.encodeSkipVals[U];if(typeof V==="number")q[V]=!0;else for(var G=V.from;G<=V.to;G++)q[G]=!0}if(this._fillEncodeTable(0,0,q),$.encodeAdd){for(var F in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,F))this._setEncodeChar(F.charCodeAt(0),$.encodeAdd[F])}if(this.defCharSB=this.encodeTable[0][Y.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===Y8)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===Y8)this.defCharSB=63}k7.prototype.encoder=tP;k7.prototype.decoder=sp;k7.prototype._getDecodeTrieNode=function($){var Y=[];for(;$>0;$>>>=8)Y.push($&255);if(Y.length==0)Y.push(0);var z=this.decodeTables[0];for(var U=Y.length-1;U>0;U--){var Q=z[Y[U]];if(Q==Y8)z[Y[U]]=h8-this.decodeTables.length,this.decodeTables.push(z=KK.slice(0));else if(Q<=h8)z=this.decodeTables[h8-Q];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};k7.prototype._addDecodeChunk=function($){var Y=parseInt($[0],16),z=this._getDecodeTrieNode(Y);Y=Y&255;for(var U=1;U<$.length;U++){var Q=$[U];if(typeof Q==="string")for(var J=0;J<Q.length;){var I=Q.charCodeAt(J++);if(I>=55296&&I<56320){var K=Q.charCodeAt(J++);if(K>=56320&&K<57344)z[Y++]=65536+(I-55296)*1024+(K-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(I>4080&&I<=4095){var G=4095-I+2,W=[];for(var H=0;H<G;H++)W.push(Q.charCodeAt(J++));z[Y++]=p$-this.decodeTableSeq.length,this.decodeTableSeq.push(W)}else z[Y++]=I}else if(typeof Q==="number"){var X=z[Y-1]+1;for(var J=0;J<Q;J++)z[Y++]=X++}else throw Error("Incorrect type '"+typeof Q+"' given in "+this.encodingName+" at chunk "+$[0])}if(Y>255)throw Error("Incorrect chunk in "+this.encoLine truncated
|
||||
`;super(Y);this.name="AggregateError",this.errors=$}}MA0.exports={AggregateError:wA0,ArrayIsArray($){return Array.isArray($)},ArrayPrototypeIncludes($,Y){return $.includes(Y)},ArrayPrototypeIndexOf($,Y){return $.indexOf(Y)},ArrayPrototypeJoin($,Y){return $.join(Y)},ArrayPrototypeMap($,Y){return $.map(Y)},ArrayPrototypePop($,Y){return $.pop(Y)},ArrayPrototypePush($,Y){return $.push(Y)},ArrayPrototypeSlice($,Y,z){return $.slice(Y,z)},Error,FunctionPrototypeCall($,Y,...z){return $.call(Y,...z)},FunctionPrototypeSymbolHasInstance($,Y){return Function.prototype[Symbol.hasInstance].call($,Y)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties($,Y){return Object.defineProperties($,Y)},ObjectDefineProperty($,Y,z){return Object.defineProperty($,Y,z)},ObjectGetOwnPropertyDescriptor($,Y){return Object.getOwnPropertyDescriptor($,Y)},ObjectKeys($){return Object.keys($)},ObjectSetPrototypeOf($,Y){return Object.setPrototypeOf($,Y)},Promise,PromisePrototypeCatch($,Y){return $.catch(Y)},PromisePrototypeThen($,Y,z){return $.then(Y,z)},PromiseReject($){return Promise.reject($)},PromiseResolve($){return Promise.resolve($)},ReflectApply:Reflect.apply,RegExpPrototypeTest($,Y){return $.test(Y)},SafeSet:Set,String,StringPrototypeSlice($,Y,z){return $.slice(Y,z)},StringPrototypeToLowerCase($){return $.toLowerCase()},StringPrototypeToUpperCase($){return $.toUpperCase()},StringPrototypeTrim($){return $.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet($,Y,z){return $.set(Y,z)},Boolean,Uint8Array}});var Od=E((F14,OA0)=>{OA0.exports={format($,...Y){return $.replace(/%([sdifj])/g,function(...[z,U]){let Q=Y.shift();if(U==="f")return Q.toFixed(6);else if(U==="j")return JSON.stringify(Q);else if(U==="s"&&typeof Q==="object")return`${Q.constructor!==Object?Q.constructor.name:""} {}`.trim();else return Q.toString()})},inspect($){switch(typeof $){case"string":if($.includes("'")){if(!$.includes('"'))return`"${$}"`;else if(!$.includes("`")&&!$.includes("${"))return`\`${$}\``}return`'${$}'`;case"number":if(isNaN($))return"NaN";else if(Object.is($,-0))return String($);return $;case"bigint":return`${String($)}n`;case"boolean":case"undefined":return String($);case"object":return"{}"}}}});var w8=E((w14,PA0)=>{var{format:aP1,inspect:QA}=Od(),{AggregateError:tP1}=x4(),eP1=globalThis.AggregateError||tP1,$A1=Symbol("kIsNodeError"),YA1=["string","function","number","object","Function","Object","boolean","bigint","symbol"],zA1=/^([A-Z][a-z0-9]*)+$/,JA={};function HU($,Y){if(!$)throw new JA.ERR_INTERNAL_ASSERTION(Y)}function NA0($){let Y="",z=$.length,U=$[0]==="-"?1:0;for(;z>=U+4;z-=3)Y=`_${$.slice(z-3,z)}${Y}`;return`${$.slice(0,z)}${Y}`}function UA1($,Y,z){if(typeof Y==="function")return HU(Y.length<=z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${Y.length}).`),Y(...z);let U=(Y.match(/%[dfijoOs]/g)||[]).length;if(HU(U===z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${U}).`),z.length===0)return Y;return aP1(Y,...z)}function z8($,Y,z){if(!z)z=Error;class U extends z{constructor(...Q){super(UA1($,Y,Q))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(U.prototype,{name:{value:z.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),U.prototype.code=$,U.prototype[$A1]=!0,JA[$]=U}function DA0($){let Y="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:Y}),$}function QA1($,Y){if($&&Y&&$!==Y){if(Array.isArray(Y.errors))return Y.errors.push($),Y;let z=new eP1([Y,$],Y.message);return z.code=Y.code,z}return $||Y}class BA0 extends Error{constructor($="The operation was aborted",Y=void 0){if(Y!==void 0&&typeof Y!=="object")throw new JA.ERR_INVALID_ARG_TYPE("options","Object",Y);super($,Y);this.code="ABORT_ERR",this.name="AbortError"}}z8("ERR_ASSERTION","%s",Error);z8("ERR_INVALID_ARG_TYPE",($,Y,z)=>{if(HU(typeof $==="string","'name' must be a string"),!Array.isArray(Y))Y=[Y];let U="The ";if($.endsWith(" argument"))U+=`${$} `;else U+=`"${$}" ${$.includes(".")?"property":"argument"} `;U+="must be ";let Q=[],J=[],I=[];for(let G of Y)if(HU(typeof G==="string","All expected entries have to be of type string"),YA1.includes(G))Q.push(G.toLowerCase());else if(zA1.test(G))J.push(G);else HU(G!=="object",'The value "object" should be written as "Object"'),I.push(G);if(J.length>0){let G=Q.indexOf("object");if(G!==-1)Q.splice(Q,G,1),J.push("Object")}if(Q.length>0){switch(Q.length){case 1:U+=`of type ${Q[Line truncated
|
||||
`);if(Y.linkname)z+=rm(" linkpath="+Y.linkname+`
|
||||
`);let U=Y.pax;if(U)for(let Q in U)z+=rm(" "+Q+"="+U[Q]+`
|
||||
`);return n1.from(z)};$v1.decodePax=function(Y){let z={};while(Y.length){let U=0;while(U<Y.length&&Y[U]!==32)U++;let Q=parseInt(n1.toString(Y.subarray(0,U)),10);if(!Q)return z;let J=n1.toString(Y.subarray(U+1,Q-1)),I=J.indexOf("=");if(I===-1)return z;z[J.slice(0,I)]=J.slice(I+1),Y=Y.subarray(Q)}return z};$v1.encode=function(Y){let z=n1.alloc(512),U=Y.name,Q="";if(Y.typeflag===5&&U[U.length-1]!=="/")U+="/";if(n1.byteLength(U)!==U.length)return null;while(n1.byteLength(U)>100){let J=U.indexOf("/");if(J===-1)return null;Q+=Q?"/"+U.slice(0,J):U.slice(0,J),U=U.slice(J+1)}if(n1.byteLength(U)>100||n1.byteLength(Q)>155)return null;if(Y.linkname&&n1.byteLength(Y.linkname)>100)return null;if(n1.write(z,U),n1.write(z,m2(Y.mode&4095,6),100),n1.write(z,m2(Y.uid,6),108),n1.write(z,m2(Y.gid,6),116),t_1(Y.size,z,124),n1.write(z,m2(Y.mtime.getTime()/1000|0,11),136),z[156]=48+s_1(Y.type),Y.linkname)n1.write(z,Y.linkname,157);if(n1.copy(lC0,z,257),n1.copy(n_1,z,263),Y.uname)n1.write(z,Y.uname,265);if(Y.gname)n1.write(z,Y.gname,297);if(n1.write(z,m2(Y.devmajor||0,6),329),n1.write(z,m2(Y.devminor||0,6),337),Q)n1.write(z,Q,345);return n1.write(z,m2(rC0(z),6),148),z};$v1.decode=function(Y,z,U){let Q=Y[156]===0?0:Y[156]-48,J=EK(Y,0,100,z),I=d2(Y,100,8),K=d2(Y,108,8),G=d2(Y,116,8),W=d2(Y,124,12),H=d2(Y,136,12),X=r_1(Q),Z=Y[157]===0?null:EK(Y,157,100,z),q=EK(Y,265,32),V=EK(Y,297,32),F=d2(Y,329,8),M=d2(Y,337,8),w=rC0(Y);if(w===256)return null;if(w!==d2(Y,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(m_1(Y)){if(Y[345])J=EK(Y,345,155,z)+"/"+J}else if(l_1(Y));else if(!U)throw Error("Invalid tar header: unknown format.");if(Q===0&&J&&J[J.length-1]==="/")Q=5;return{name:J,mode:I,uid:K,gid:G,size:W,byteOffset:0,mtime:new Date(1000*H),type:X,linkname:Z,uname:q,gname:V,devmajor:F,devminor:M,pax:null}};function m_1($){return n1.equals(lC0,$.subarray(257,263))}function l_1($){return n1.equals(p_1,$.subarray(257,263))&&n1.equals(d_1,$.subarray(263,265))}function o_1($,Y,z){if(typeof $!=="number")return z;if($=~~$,$>=Y)return Y;if($>=0)return $;if($+=Y,$>=0)return $;return 0}function r_1($){switch($){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function s_1($){switch($){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function oC0($,Y,z,U){for(;z<U;z++)if($[z]===Y)return z;return U}function rC0($){let Y=256;for(let z=0;z<148;z++)Y+=$[z];for(let z=156;z<512;z++)Y+=$[z];return Y}function m2($,Y){if($=$.toString(8),$.length>Y)return"7777777777777777777".slice(0,Y)+" ";return"0000000000000000000".slice(0,Y-$.length)+$+" "}function a_1($,Y,z){Y[z]=128;for(let U=11;U>0;U--)Y[z+U]=$&255,$=Math.floor($/256)}function t_1($,Y,z){if($.toString(8).length>11)a_1($,Y,z);else n1.write(Y,m2($,11),z)}function e_1($){let Y;if($[0]===128)Y=!0;else if($[0]===255)Y=!1;else return null;let z=[],U;for(U=$.length-1;U>0;U--){let I=$[U];if(Y)z.push(I);else z.push(255-I)}let Q=0,J=z.length;for(U=0;U<J;U++)Q+=z[U]*Math.pow(256,U);return Y?Q:-1*Q}function d2($,Y,z){if($=$.subarray(Y,Y+z),Y=0,$[Y]&128)return e_1($);else{while(Y<$.length&&$[Y]===32)Y++;let U=o_1(oC0($,32,Y,$.length),$.length,$.length);while(Y<U&&$[Y]===0)Y++;if(U===Y)return 0;return parseInt(n1.toString($.subarray(Y,U)),8)}}function EK($,Y,z,U){return n1.toString($.subarray(Y,oC0($,0,Y,Y+z)),U)}function rm($){let Y=n1.byteLength($),z=Math.floor(Math.log(Y)/Math.log(10))+1;if(Y+z>=Math.pow(10,z))z++;return Y+z+$}});var UR0=E((J64,zR0)=>{var{Writable:Iv1,Readable:Kv1,getStreamError:sC0}=om(),Gv1=bm(),aC0=jK(),CK=sm(),Wv1=aC0.alloc(0);class tC0{constructor(){this.buffered=0,this.shifted=0,this.queue=new Gv1,this._offset=0}push($){this.buffered+=$.byteLength,this.queue.push($)}shiftFirst($){return this.buffered===0?null:this._next($)}shift($){if($>this.buffered)return null;if($===0)return Wv1;let Y=this._next($);if($===Y.byteLength)return Y;let z=[Y];while(($-=Y.byteLength)>0)Y=this._next($),z.push(Y);return aC0.concat(z)}_next($){let Y=this.queue.peek(),z=Y.byteLength-this._offset;if($>=z){let U=this._offset?Y.subarray(this._offset,Y.byteLength):Y;return this.queue.shift(),this._offset=0,this.buffered-=z,this.shifted+=z,U}return this.buffered-=$,this.shifted+=$,Y.subarray(this._offset,this._offset+=$)}}class eC0 extends Kv1{constructor($,Y,z){super();this.header=Y,this.offset=z,this._parent=$}_read($){if(this.header.size===0)this.push(null);if(this._parent._stream===this)this._parent._update();$(null)}_predestroy(){this._parent.destroy(sC0(this))}_detach(){if(this._parent._stream=
Line truncated
|
||||
`);return n1.from(z)};Yv1.decodePax=function(Y){let z={};while(Y.length){let U=0;while(U<Y.length&&Y[U]!==32)U++;let Q=parseInt(n1.toString(Y.subarray(0,U)),10);if(!Q)return z;let J=n1.toString(Y.subarray(U+1,Q-1)),I=J.indexOf("=");if(I===-1)return z;z[J.slice(0,I)]=J.slice(I+1),Y=Y.subarray(Q)}return z};Yv1.encode=function(Y){let z=n1.alloc(512),U=Y.name,Q="";if(Y.typeflag===5&&U[U.length-1]!=="/")U+="/";if(n1.byteLength(U)!==U.length)return null;while(n1.byteLength(U)>100){let J=U.indexOf("/");if(J===-1)return null;Q+=Q?"/"+U.slice(0,J):U.slice(0,J),U=U.slice(J+1)}if(n1.byteLength(U)>100||n1.byteLength(Q)>155)return null;if(Y.linkname&&n1.byteLength(Y.linkname)>100)return null;if(n1.write(z,U),n1.write(z,m2(Y.mode&4095,6),100),n1.write(z,m2(Y.uid,6),108),n1.write(z,m2(Y.gid,6),116),e_1(Y.size,z,124),n1.write(z,m2(Y.mtime.getTime()/1000|0,11),136),z[156]=48+a_1(Y.type),Y.linkname)n1.write(z,Y.linkname,157);if(n1.copy(lC0,z,257),n1.copy(p_1,z,263),Y.uname)n1.write(z,Y.uname,265);if(Y.gname)n1.write(z,Y.gname,297);if(n1.write(z,m2(Y.devmajor||0,6),329),n1.write(z,m2(Y.devminor||0,6),337),Q)n1.write(z,Q,345);return n1.write(z,m2(rC0(z),6),148),z};Yv1.decode=function(Y,z,U){let Q=Y[156]===0?0:Y[156]-48,J=EK(Y,0,100,z),I=d2(Y,100,8),K=d2(Y,108,8),G=d2(Y,116,8),W=d2(Y,124,12),H=d2(Y,136,12),X=s_1(Q),Z=Y[157]===0?null:EK(Y,157,100,z),q=EK(Y,265,32),V=EK(Y,297,32),F=d2(Y,329,8),M=d2(Y,337,8),w=rC0(Y);if(w===256)return null;if(w!==d2(Y,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(l_1(Y)){if(Y[345])J=EK(Y,345,155,z)+"/"+J}else if(o_1(Y));else if(!U)throw Error("Invalid tar header: unknown format.");if(Q===0&&J&&J[J.length-1]==="/")Q=5;return{name:J,mode:I,uid:K,gid:G,size:W,byteOffset:0,mtime:new Date(1000*H),type:X,linkname:Z,uname:q,gname:V,devmajor:F,devminor:M,pax:null}};function l_1($){return n1.equals(lC0,$.subarray(257,263))}function o_1($){return n1.equals(d_1,$.subarray(257,263))&&n1.equals(m_1,$.subarray(263,265))}function r_1($,Y,z){if(typeof $!=="number")return z;if($=~~$,$>=Y)return Y;if($>=0)return $;if($+=Y,$>=0)return $;return 0}function s_1($){switch($){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function a_1($){switch($){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function oC0($,Y,z,U){for(;z<U;z++)if($[z]===Y)return z;return U}function rC0($){let Y=256;for(let z=0;z<148;z++)Y+=$[z];for(let z=156;z<512;z++)Y+=$[z];return Y}function m2($,Y){if($=$.toString(8),$.length>Y)return"7777777777777777777".slice(0,Y)+" ";return"0000000000000000000".slice(0,Y-$.length)+$+" "}function t_1($,Y,z){Y[z]=128;for(let U=11;U>0;U--)Y[z+U]=$&255,$=Math.floor($/256)}function e_1($,Y,z){if($.toString(8).length>11)t_1($,Y,z);else n1.write(Y,m2($,11),z)}function $v1($){let Y;if($[0]===128)Y=!0;else if($[0]===255)Y=!1;else return null;let z=[],U;for(U=$.length-1;U>0;U--){let I=$[U];if(Y)z.push(I);else z.push(255-I)}let Q=0,J=z.length;for(U=0;U<J;U++)Q+=z[U]*Math.pow(256,U);return Y?Q:-1*Q}function d2($,Y,z){if($=$.subarray(Y,Y+z),Y=0,$[Y]&128)return $v1($);else{while(Y<$.length&&$[Y]===32)Y++;let U=r_1(oC0($,32,Y,$.length),$.length,$.length);while(Y<U&&$[Y]===0)Y++;if(U===Y)return 0;return parseInt(n1.toString($.subarray(Y,U)),8)}}function EK($,Y,z,U){return n1.toString($.subarray(Y,oC0($,0,Y,Y+z)),U)}function rm($){let Y=n1.byteLength($),z=Math.floor(Math.log(Y)/Math.log(10))+1;if(Y+z>=Math.pow(10,z))z++;return Y+z+$}});var UR0=E((K64,zR0)=>{var{Writable:Kv1,Readable:Gv1,getStreamError:sC0}=om(),Wv1=bm(),aC0=jK(),CK=sm(),Hv1=aC0.alloc(0);class tC0{constructor(){this.buffered=0,this.shifted=0,this.queue=new Wv1,this._offset=0}push($){this.buffered+=$.byteLength,this.queue.push($)}shiftFirst($){return this.buffered===0?null:this._next($)}shift($){if($>this.buffered)return null;if($===0)return Hv1;let Y=this._next($);if($===Y.byteLength)return Y;let z=[Y];while(($-=Y.byteLength)>0)Y=this._next($),z.push(Y);return aC0.concat(z)}_next($){let Y=this.queue.peek(),z=Y.byteLength-this._offset;if($>=z){let U=this._offset?Y.subarray(this._offset,Y.byteLength):Y;return this.queue.shift(),this._offset=0,this.buffered-=z,this.shifted+=z,U}return this.buffered-=$,this.shifted+=$,Y.subarray(this._offset,this._offset+=$)}}class eC0 extends Gv1{constructor($,Y,z){super();this.header=Y,this.offset=z,this._parent=$}_read($){if(this.header.size===0)this.push(null);if(this._parent._stream===this)this._parent._update();$(null)}_predestroy(){this._parent.destroy(sC0(this))}_detach(){if(this._parent._stream=
Line truncated
|
||||
`),U=[await G4($,z.recordId)];else if(z.recordIds&&z.recordIds.length>0)process.stderr.write(`\uD83D\uDD0D 批量查询 ${z.recordIds.length} 条单据记录...
|
||||
`),U=await Promise.all(z.recordIds.map((w)=>G4($,w)));else{let w=z.limit??10;process.stderr.write(`\uD83D\uDD0D 检索企业「${Y.name}」(${Y.id}) 的线上审核记录 (限制 ${w} 条)...
|
||||
`);let D=(await b4($,{limit:w,status:z.status,startDate:z.startDate!==void 0?String(z.startDate):void 0,endDate:z.endDate!==void 0?String(z.endDate):void 0})).records??[];if(D.length===0)throw Error("未检索到符合条件的线上审核记录,无法导出 webhook 资源包。");process.stderr.write(`\uD83D\uDCE5 正在拉取 ${D.length} 条审核记录完整详情...
|
||||
`),U=await Promise.all(D.map((N)=>G4($,N.id)))}let Q=new Map,J=0;for(let w of U){let O=w.document,D=w.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??w.documentId??w.id,N=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,A=[];if(z.includeAttachments!==!1){let B=k2(w,{summary:!1}).attachments,j=new Set;for(let C of B){let b=C.ossSignedUrl??C.url;if(!b)continue;let k=C.fileName??C.fileId??"attachment",h=bn(k),i=h,c=h.lastIndexOf("."),U0=c>0?h.slice(0,c):h,x=c>0?h.slice(c):"",d=1;while(j.has(i.toLowerCase()))i=`${U0}_${d}${x}`,d++;j.add(i.toLowerCase());try{process.stderr.write(`⬇ 下载单据「${N}」附件: ${k}...
|
||||
`);let t=await fetch(b);if(t.ok){let $0=await t.arrayBuffer(),g=Buffer.from($0);A.push({fileName:i,zipPath:`${N}/${i}`,buffer:g,sourceField:C.sourceField??"附件"}),J++}}catch(t){process.stderr.write(`⚠️ [跳过附件] 下载失败 ${k}: ${t}
|
||||
`)}}}Q.set(N,A)}let I=new DR0.default.Workbook;I.creator="seal-use",I.created=new Date;let K=new Set;for(let w of Q.values())for(let O of w)K.add(O.sourceField);if(K.size===0)K.add("附件");let G=new Set;for(let w of U){let O=w.document,D=Array.isArray(O?.fields)?O.fields:[];for(let N of D)if(N&&typeof N==="object"){let A=N,T=typeof A.label==="string"?A.label.trim():typeof A.key==="string"?A.key.trim():"",B=typeof A.type==="string"?A.type.toUpperCase():"";if(T&&B!=="ATTACHMENT"&&B!=="LIST")G.add(T)}}let W=["会议编号","会议名称","状态","总金额","报销事由","申请日期"],H=Array.from(G).filter((w)=>!W.includes(w)&&w!=="单据编号"&&w!=="单号"),X=Array.from(K).map((w)=>`[附件]${w}`),Z=[...W,...H,...X],q=I.addWorksheet("主表");q.addRow(Z),q.getRow(1).font={bold:!0};for(let w of U){let O=w.document,D=w.sourceDocumentSN??(typeof O?.sn==="string"?O.sn:void 0)??(typeof O?.sourceDocumentSN==="string"?O.sourceDocumentSN:void 0)??w.id,N=w.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??w.documentId??w.id,A=`${z.docIdPrefix??""}${N}${z.docIdSuffix??""}`,T=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,B=(typeof O?.title==="string"?O.title:void 0)??(typeof O?.name==="string"?O.name:void 0)??T,j="";if(typeof O?.sourceStartTime==="number")j=new Date(O.sourceStartTime*1000).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="number")j=new Date(w.createdAt).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="string")j=w.createdAt.slice(0,10);let C=new Map,b=Array.isArray(O?.fields)?O.fields:[];for(let U0 of b)if(U0&&typeof U0==="object"){let x=U0,d=typeof x.label==="string"?x.label.trim():typeof x.key==="string"?x.key.trim():"";if(d)C.set(d,x.value)}let k,h=C.get("总金额")??C.get("报销金额")??C.get("total_amount");if(typeof h==="number")k=h;else if(h&&typeof h==="object"&&"amount"in h&&typeof h.amount==="number")k=h.amount;let i=[];i.push(A),i.push(B),i.push(w.status??"已审批"),i.push(k??""),i.push(C.get("报销事由")??C.get("事由")??B),i.push(j);for(let U0 of H){let x=C.get(U0);if(x===void 0||x===null)i.push("");else if(typeof x==="object")if("amount"in x)i.push(x.amount);else i.push(JSON.stringify(x));else i.push(x)}let c=Q.get(A)??[];for(let U0 of K){let x=c.filter((d)=>d.sourceField===U0||K.size===1);if(x.length>0)i.push(x.map((d)=>d.zipPath).join(`
|
||||
`));else i.push("")}q.addRow(i)}let V=Cv1(z,Y);Pv1(jv1(V),{recursive:!0});let F=await I.xlsx.writeBuffer();process.stderr.write(`\uD83D\uDCE6 正在压缩生成 Webhook 资源包: ${V}...
|
||||
`),await new Promise((w,O)=>{let D=Bv1(V),N=new Yl({zlib:{level:9}});D.on("close",()=>w()),N.on("error",(A)=>O(A)),N.pipe(D),N.append(Buffer.from(F),{name:"信息表.xlsx"});for(let A of Q.values())for(let T of A)N.append(T.buffer,{name:T.zipPath});N.finalize()});let M=Av1(V);return{filePath:V,corpId:Y.id,corpName:Y.name,recordCount:U.length,attachmentCount:J,fileSizeBytes:M.size,exportedAt:new Date().toISOString(),nextAction:`seal-use webhook resource-pack push ${V} --corp <targetCorpId>`}}var DR0;var zl=o(()=>{OR0();X6();TP();DR0=J6(PZ(),1)});import{readFileSync as Rv1}from"node:fs";function _v1($){let Y=new URL($),z=Y.pathname.match(/\/webhook\/([^/]+)/);if(!z)throw Error("Webhook URL 必须包含 /webhook/{webhookId}/document");return{baseUrl:`${Y.protocol}//${Y.host}`,webhookId:z[1]}}function vv1($,Y){return Y.toLowerCase().endsWith(".zip")||$[0]===80&&$[1]===75&&!Y.toLowerCase().endsWith(".xlsx")}function hv1($,Y){if(!$.length)return;let z=new Set($.map((J)=>{let I=J.fileName.split("/")[0],K=I.indexOf("@");return K>=0?I.slice(0,K):I}).filter((J)=>J!=="信息表.xlsx")),U=[];for(let J of Y){let I=J.document.documentId;if((J.documentAttachments.length>0||Object.values(J.expenseAttachments).some((G)=>G.length>0)||Object.values(J.personAttachments).some((G)=>G.length>0))&&!z.has(I))U.push(`Excel 会议编号「${I}」声明了附件,但在 ZIP 中找不到对应的根目录「${I}/」或「${I}@.../」。`)}let Q=new Set(Y.map((J)=>J.document.documentId));for(let J of z)if(!Q.has(J))U.push(`ZIP 根目录对应的编号「${J}」在信息表中找不到对应的会议编号。`);if(U.length)throw new D5(U)}async function BR0($,Y,z){let U=[],Q=$;if(vv1($,Y)){U=await hP0($),gP0(U,z);let G=U.find((W)=>W.fileName==="信息表.xlsx");if(!G)throw Error("ZIP 根目录缺少信息表.xlsx");Q=await zd($,G)}let J=await iP0(Q);hv1(U,J);let I=cP0(U,J),K=J.map((G)=>G.document);return{entries:U,parsed:J,plans:I,documents:K,fileBuffer:$}}async function CU($,Y,z){let U=await BR0($,Y,z),Q=U.parsed.map((J,I)=>Gd(J.document,U.plans[I],new Map));return{warnings:[],documents:Q,attachmentPlan:U.plans}}async function lA($,Y,z){let U=await BR0($,Y,z.materialPackFilePolicy),{baseUrl:Q,webhookId:J}=_v1(z.webhookUrl),I=[];for(let K=0;K<U.parsed.length;K+=1){let G=U.parsed[K],W=U.plans[K],H=new Map,X=[...W.categoryFields,...Object.values(W.personAttachments).flat(),...Object.values(W.expenseAttachments).flat()];for(let V of X)for(let F of V.paths){if(H.has(F))continue;let M=U.entries.find((T)=>T.fileName===F);if(!M)continue;process.stderr.write(`⬆ 上传附件: ${F}
|
||||
`));else i.push("")}q.addRow(i)}let V=Rv1(z,Y);Av1(Ev1(V),{recursive:!0});let F=await I.xlsx.writeBuffer();process.stderr.write(`\uD83D\uDCE6 正在压缩生成 Webhook 资源包: ${V}...
|
||||
`),await new Promise((w,O)=>{let D=Pv1(V),N=new Yl({zlib:{level:9}});D.on("close",()=>w()),N.on("error",(A)=>O(A)),N.pipe(D),N.append(Buffer.from(F),{name:"信息表.xlsx"});for(let A of Q.values())for(let T of A)N.append(T.buffer,{name:T.zipPath});N.finalize()});let M=Tv1(V);return{filePath:V,corpId:Y.id,corpName:Y.name,recordCount:U.length,attachmentCount:J,fileSizeBytes:M.size,exportedAt:new Date().toISOString(),nextAction:`seal-use webhook resource-pack push ${V} --corp <targetCorpId>`}}var DR0;var zl=o(()=>{OR0();X6();jP();DR0=J6(PZ(),1)});import{readFileSync as _v1}from"node:fs";function vv1($){let Y=new URL($),z=Y.pathname.match(/\/webhook\/([^/]+)/);if(!z)throw Error("Webhook URL 必须包含 /webhook/{webhookId}/document");return{baseUrl:`${Y.protocol}//${Y.host}`,webhookId:z[1]}}function hv1($,Y){return Y.toLowerCase().endsWith(".zip")||$[0]===80&&$[1]===75&&!Y.toLowerCase().endsWith(".xlsx")}function Sv1($,Y){if(!$.length)return;let z=new Set($.map((J)=>{let I=J.fileName.split("/")[0],K=I.indexOf("@");return K>=0?I.slice(0,K):I}).filter((J)=>J!=="信息表.xlsx")),U=[];for(let J of Y){let I=J.document.documentId;if((J.documentAttachments.length>0||Object.values(J.expenseAttachments).some((G)=>G.length>0)||Object.values(J.personAttachments).some((G)=>G.length>0))&&!z.has(I))U.push(`Excel 会议编号「${I}」声明了附件,但在 ZIP 中找不到对应的根目录「${I}/」或「${I}@.../」。`)}let Q=new Set(Y.map((J)=>J.document.documentId));for(let J of z)if(!Q.has(J))U.push(`ZIP 根目录对应的编号「${J}」在信息表中找不到对应的会议编号。`);if(U.length)throw new D5(U)}async function BR0($,Y,z){let U=[],Q=$;if(hv1($,Y)){U=await hP0($),gP0(U,z);let G=U.find((W)=>W.fileName==="信息表.xlsx");if(!G)throw Error("ZIP 根目录缺少信息表.xlsx");Q=await zd($,G)}let J=await iP0(Q);Sv1(U,J);let I=cP0(U,J),K=J.map((G)=>G.document);return{entries:U,parsed:J,plans:I,documents:K,fileBuffer:$}}async function CU($,Y,z){let U=await BR0($,Y,z),Q=U.parsed.map((J,I)=>Gd(J.document,U.plans[I],new Map));return{warnings:[],documents:Q,attachmentPlan:U.plans}}async function oA($,Y,z){let U=await BR0($,Y,z.materialPackFilePolicy),{baseUrl:Q,webhookId:J}=vv1(z.webhookUrl),I=[];for(let K=0;K<U.parsed.length;K+=1){let G=U.parsed[K],W=U.plans[K],H=new Map,X=[...W.categoryFields,...Object.values(W.personAttachments).flat(),...Object.values(W.expenseAttachments).flat()];for(let V of X)for(let F of V.paths){if(H.has(F))continue;let M=U.entries.find((T)=>T.fileName===F);if(!M)continue;process.stderr.write(`⬆ 上传附件: ${F}
|
||||
`);let w=new FormData,O=await zd(U.fileBuffer,M),D=F.split("/").pop()??F;w.append("files",new File([new Uint8Array(O)],D));let N=await fetch(`${Q}/api/v1/integrations/webhook/${encodeURIComponent(J)}/attachments`,{method:"POST",headers:{...z.customHeaders??{},...jZ({},z.secret)},body:w});if(!N.ok)throw Error(`附件上传失败 ${N.status}: ${await N.text()}`);let A=await N.json();H.set(F,A.attachments?.map((T)=>T.data)??(A.data===void 0?[]:[A.data])),process.stderr.write(`✓ 附件上传成功: ${F}
|
||||
`)}process.stderr.write(`\uD83D\uDCE4 推送单据: ${G.document.documentId}
|
||||
`);let Z=Gd(G.document,W,H),q=await fetch(`${Q}/api/v1/integrations/webhook/${encodeURIComponent(J)}/document`,{method:"POST",headers:{...z.customHeaders??{},"Content-Type":"application/json",...jZ({webhookId:J,...Z},z.secret)},body:JSON.stringify(Z)});if(!q.ok)throw Error(`Webhook 单据推送失败 ${q.status}: ${await q.text()}`);I.push({documentId:Z.documentId,document:Z,pushResult:await q.json()}),process.stderr.write(`✓ 单据推送成功: ${Z.documentId}
|
||||
`)}return{warnings:[],results:I}}function RU($){return{fileBuffer:Rv1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Ul=o(()=>{SP();Wd();Kd();Ud();tI();zl()});import{existsSync as Sv1}from"node:fs";async function oA($,Y,z={}){let Q=_4().stateful?"stateful":"stateless",J="ok",I,K,G;try{let N=await W8($);G={id:N.user.id,name:N.user.name,isAdmin:N.user.isAdmin},K={id:N.tenant.id,name:N.tenant.name,tenantSlug:N.tenant.tenantSlug,corporationName:N.tenant.hoseCorpConfig?.corporationName}}catch(N){J="error",I=N instanceof Error?N.message:String(N)}let W=[];if(J==="ok")try{W=await J$($,Y.seal.endpoints.approvalStylePreferences)}catch(N){J="error",I=`读取 Webhook 配置失败: ${N instanceof Error?N.message:String(N)}`}let H=W.length===1,X=W.map((N)=>({id:N.id,name:N.name,mode:N.mode,incomingDocumentWebhookUrl:N.incomingDocumentWebhook.url,outgoingResultWebhookUrl:N.outgoingResultWebhook,autoApprovalRate:N.autoApprovalRate,...H?{isDefault:!0}:{}})),Z=H?{id:W[0].id,name:W[0].name,mode:W[0].mode}:null,q=z.webhook?v3(W,z.webhook):H?W[0]:void 0,V;if(z.filePath)if(!Sv1(z.filePath))V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let N=RU(z.filePath),A=await CU(N.fileBuffer,N.fileName,q?.materialPackFilePolicy);V={valid:!0,filePath:z.filePath,fileName:N.fileName,documentCount:A.documents.length,warnings:A.warnings}}catch(N){V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[N instanceof Error?N.message:String(N)]}}let F=V?V.valid:!0,M=J==="ok"&&X.length>0&&F,w=Q==="stateful"?"":` --corp ${Y.id}`,O="",D="";if(J!=="ok")D=`凭证鉴权异常: ${I}`,O=`seal-use auth diagnose${w}`;else if(X.length===0)D="当前企业尚未配置任何 Webhook 集成通道",O=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${w}`;else if(V&&!V.valid)D=`资源包预检失败: ${V.errors?.join("; ")}`,O=`seal-use webhook resource-pack preview ${V.filePath}${w}`;else{D=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${X.length} 个 Webhook 通道,等待载入`;let N=V?.filePath??"<资源包.zip>",A=H?"":` --webhook ${Z?Z.id:"<webhookIdOrName>"}`;O=`seal-use webhook resource-pack push ${N}${A}${w}`}return{ready:M,corp:{id:Y.id,name:Y.name,sourceType:Y.source.type,tenant:K,user:G},stateMode:Q,authStatus:J,authError:I,activeWebhooks:X,defaultWebhook:Z,resourcePack:V,materialPack:V,statusMessage:D,nextAction:O}}var PR0=o(()=>{h7();X6();Ul()});var Ql=o(()=>{tI();pQ();SP();Ud();Kd();Wd();Ul();PR0();zl()});import{existsSync as AR0,mkdirSync as TR0,statSync as gv1}from"node:fs";import{homedir as yv1}from"node:os";import{dirname as kv1,resolve as rA}from"node:path";function xv1($){if($.outputFile){let I=rA($.outputFile),K=kv1(I);if(!AR0(K))TR0(K,{recursive:!0});return I}let z=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",U=$.dateTag||new Date().toISOString().slice(0,10),Q=`${z}_智能洞察报告_${U}.xlsx`,J;if($.toDownloads)J=rA(yv1(),"Downloads");else J=rA(process.cwd(),"exports");if(!AR0(J))TR0(J,{recursive:!0});return rA(J,Q)}async function sA($,Y,z={}){let U=Y.name||Y.id,Q=xn({startDate:z.startDate,endDate:z.endDate,force:z.force}),J=new Date().toISOString(),[I,K]=await Promise.all([ZM($,{startDate:Q.startDateStr,endDate:Q.endDateStr,limit:z.limit??100}),VM($,{startDate:Q.startDateStr,endDate:Q.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),G=I.tagStats||[],W=[],H=Math.min(G.length,z.limit??50);for(let C=0;C<H;C++){let b=G[C];if(!b?.tagId)continue;try{let k=await qM($,{tagId:b.tagId,startDate:Q.startDateStr,endDate:Q.endDateStr});for(let h of k.risks||[])W.push({tagId:b.tagId,tagName:b.tagName||b.tagId,documentSN:h.documentSN||"-",documentType:h.documentType||"-",riskLevel:h.riskLevel||"warning",confidence:h.confidence??0,riskDetails:h.riskDetails||"-",reasoning:h.reasoning||"-",sourceDocumentURL:h.sourceDocumentURL,createdAt:h.createdAt})}catch{}}let X=new jR0.default.Workbook;X.creator="seal-use",X.lastModifiedBy="seal-use",X.created=new Date,X.modified=new Date;let Z={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},q={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},V={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},F=X.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});F.columns=[{header:"分类",key:"category",width:20},{header:"指标名称",key:"name",width:28},{header:"数值",key:"val",width:22},{header:"环比/趋势",key:"trend",width:18},{header:"说明",key:"desc",width:36}],F.getRow(1).height=28,F.getRow(1).font=q,F.getRow(1).fill=Z,F.getRow(1).alignment={vertical:"middle",horizontal:"center"};let M=K.metrics||{},w=[{c
Line truncated
|
||||
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:_K({id:Y?.id,sn:Y?.sn??Y?.sourceDocumentSN??$.sourceDocumentSN,title:Y?.title??Y?.name,template:zT(Y,["template.name","templateName","form.name","formName","formTitle"]),amount:tA(z,["金额","报销金额","付款金额","合计","价税合计"])??zT(Y,["amount","totalAmount","expenseAmount"]),expenseType:tA(z,["费用类型","费用类别","报销类型"]),costCompany:tA(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:tA(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:$h1($),attachments:k2($,{summary:!0}).attachments,aiResult:QT($),manualResult:vU($)?.value,hints:_K({amountMentions:_R0(U,["金额","合计","税率"],8),partyMentions:_R0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function sv1($){let Y=[["result.citedRules",c7($,"result.citedRules")],["result.matchedRules",c7($,"result.matchedRules")],["result.ruleResults",c7($,"result.ruleResults")],["result.rules",c7($,"result.rules")],["pipelineData.citedRules",c7($,"pipelineData.citedRules")],["pipelineData.matchedRules",c7($,"pipelineData.matchedRules")]],z=[],U=new Set;for(let[Q,J]of Y)(Array.isArray(J)?J:J&&typeof J==="object"?Object.values(J):[]).forEach((K,G)=>{let W=Hq(K);if(!W)return;let H=S4(W.runtimeRuleId)??S4(W.runtimeId)??S4(W.id)??S4(W.ruleId),X=S4(W.ruleCode)??S4(W.code)??(H?Uh1(H):void 0),Z=_K({runtimeRuleId:H,ruleCode:X,versionNumber:tv1(W.versionNumber)??$.ruleSetVersionNumber,scope:S4(W.scope),strictness:S4(W.strictness),appliedAnalysis:W.appliedAnalysis??W.analysis??W.reasoning,checkResult:W.checkResult??W.result??W.decision,findings:W.findings??W.riskPoints??W.evidence,sourcePath:`${Q}.${G}`}),q=JSON.stringify(Z);if(!U.has(q))U.add(q),z.push(Z)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function zT($,Y){if(!$)return;for(let z of Y){let U=c7($,z);if(U!==void 0)return U}return}function RR0($,Y){if(!$)return 0;for(let z of Y){let U=c7($,z);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function c7($,Y){return Y.split(".").reduce((z,U)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let Q=Number(U);return Number.isInteger(Q)?z[Q]:void 0}if(typeof z==="object")return z[U];return},$)}function av1($,Y,z){let U=Y.split("."),Q=$;for(let J of U.slice(0,-1)){let I=Q[J];if(!I||typeof I!=="object"||Array.isArray(I))Q[J]={};Q=Q[J]}Q[U[U.length-1]??Y]=z}function _K($){return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0))}function Hq($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function tv1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function ev1($){let Y=[];return Gl($,"document",Y),Y}function Gl($,Y,z){if(Array.isArray($)){$.forEach((I,K)=>Gl(I,`${Y}.${K}`,z));return}let U=Hq($);if(!U)return;let Q=S4(U.label)??S4(U.name)??S4(U.title)??S4(U.fieldName),J=U.value??U.displayValue??U.text??U.content;if(Q&&J!==void 0&&typeof J!=="object")z.push(_K({path:Y,label:Q,value:J,type:S4(U.type)??S4(U.fieldType)}));for(let[I,K]of Object.entries(U)){if(I==="attachments")continue;Gl(K,`${Y}.${I}`,z)}}function tA($,Y){return $.find((U)=>{let Q=S4(U.label)??"";return Y.some((J)=>Q.includes(J))})?.value}function $h1($){let Y=[];return UT($.result,"result",Y),UT($.document,"document",Y),Y.slice(0,20)}function UT($,Y,z){if(Array.isArray($)){$.forEach((Q,J)=>UT(Q,`${Y}.${J}`,z));return}let U=Hq($);if(!U)return;if(/invoice|发票/i.test(Y))z.push(_K({path:Y,fileName:S4(U.fileName)??S4(U.filename)??S4(U.name),buyer:U.buyer??U.buyerName??U.purchaserName,seller:U.seller??U.sellerName,amount:U.amount??U.totalAmount??U.total,taxRate:U.taxRate,category:U.category??U.type}));for(let[Q,J]of Object.entries(U))UT(J,`${Y}.${Q}`,z)}function _R0($,Y,z){return $.split(/\r?\n/).filter((U)=>Y.some((Q)=>U.includes(Q))).slice(0,z)}function eA($){return $.map((Y)=>{let z=_U(Y);return{recordId:z.id,tenantId:z.tenantId,agentId:z.agentId,sourceDocumentSN:z.sourceDocumentSN,sourceDocumentId:z.sourceDocumentId,simulationBatchId:z.simulationBatchId,langfuseTraceId:z.langfuseTraceId,langfuseSessionFallback:z.langfuseSessionFallback,ruleSetVersionNumber:z.ruleSetVersionNumber,ruleSetPublishedAt:z.ruleSetPublishedAt,ruleSetPublishedByName:z.ruleSetPublishedByName,resolution:z.langfuseTraceId?"trace":z.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Il($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function Yh1($,Y){if(Y.recordId&&!Y.versionId&&!Y.versionNumber&&!Y.latest){let z=await G4($,Y.recordId);if(!z.ruleSetVersionNumber)throw Er
Line truncated
|
||||
`)}return{warnings:[],results:I}}function RU($){return{fileBuffer:_v1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Ul=o(()=>{gP();Wd();Kd();Ud();tI();zl()});import{existsSync as gv1}from"node:fs";async function rA($,Y,z={}){let Q=_4().stateful?"stateful":"stateless",J="ok",I,K,G;try{let N=await W8($);G={id:N.user.id,name:N.user.name,isAdmin:N.user.isAdmin},K={id:N.tenant.id,name:N.tenant.name,tenantSlug:N.tenant.tenantSlug,corporationName:N.tenant.hoseCorpConfig?.corporationName}}catch(N){J="error",I=N instanceof Error?N.message:String(N)}let W=[];if(J==="ok")try{W=await J$($,Y.seal.endpoints.approvalStylePreferences)}catch(N){J="error",I=`读取 Webhook 配置失败: ${N instanceof Error?N.message:String(N)}`}let H=W.length===1,X=W.map((N)=>({id:N.id,name:N.name,mode:N.mode,incomingDocumentWebhookUrl:N.incomingDocumentWebhook.url,outgoingResultWebhookUrl:N.outgoingResultWebhook,autoApprovalRate:N.autoApprovalRate,...H?{isDefault:!0}:{}})),Z=H?{id:W[0].id,name:W[0].name,mode:W[0].mode}:null,q=z.webhook?v3(W,z.webhook):H?W[0]:void 0,V;if(z.filePath)if(!gv1(z.filePath))V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let N=RU(z.filePath),A=await CU(N.fileBuffer,N.fileName,q?.materialPackFilePolicy);V={valid:!0,filePath:z.filePath,fileName:N.fileName,documentCount:A.documents.length,warnings:A.warnings}}catch(N){V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[N instanceof Error?N.message:String(N)]}}let F=V?V.valid:!0,M=J==="ok"&&X.length>0&&F,w=Q==="stateful"?"":` --corp ${Y.id}`,O="",D="";if(J!=="ok")D=`凭证鉴权异常: ${I}`,O=`seal-use auth diagnose${w}`;else if(X.length===0)D="当前企业尚未配置任何 Webhook 集成通道",O=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${w}`;else if(V&&!V.valid)D=`资源包预检失败: ${V.errors?.join("; ")}`,O=`seal-use webhook resource-pack preview ${V.filePath}${w}`;else{D=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${X.length} 个 Webhook 通道,等待载入`;let N=V?.filePath??"<资源包.zip>",A=H?"":` --webhook ${Z?Z.id:"<webhookIdOrName>"}`;O=`seal-use webhook resource-pack push ${N}${A}${w}`}return{ready:M,corp:{id:Y.id,name:Y.name,sourceType:Y.source.type,tenant:K,user:G},stateMode:Q,authStatus:J,authError:I,activeWebhooks:X,defaultWebhook:Z,resourcePack:V,materialPack:V,statusMessage:D,nextAction:O}}var PR0=o(()=>{h7();X6();Ul()});var Ql=o(()=>{tI();pQ();gP();Ud();Kd();Wd();Ul();PR0();zl()});import{existsSync as AR0,mkdirSync as TR0,statSync as yv1}from"node:fs";import{homedir as kv1}from"node:os";import{dirname as xv1,resolve as sA}from"node:path";function fv1($){if($.outputFile){let I=sA($.outputFile),K=xv1(I);if(!AR0(K))TR0(K,{recursive:!0});return I}let z=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",U=$.dateTag||new Date().toISOString().slice(0,10),Q=`${z}_智能洞察报告_${U}.xlsx`,J;if($.toDownloads)J=sA(kv1(),"Downloads");else J=sA(process.cwd(),"exports");if(!AR0(J))TR0(J,{recursive:!0});return sA(J,Q)}async function aA($,Y,z={}){let U=Y.name||Y.id,Q=xn({startDate:z.startDate,endDate:z.endDate,force:z.force}),J=new Date().toISOString(),[I,K]=await Promise.all([qM($,{startDate:Q.startDateStr,endDate:Q.endDateStr,limit:z.limit??100}),LM($,{startDate:Q.startDateStr,endDate:Q.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),G=I.tagStats||[],W=[],H=Math.min(G.length,z.limit??50);for(let C=0;C<H;C++){let b=G[C];if(!b?.tagId)continue;try{let k=await VM($,{tagId:b.tagId,startDate:Q.startDateStr,endDate:Q.endDateStr});for(let h of k.risks||[])W.push({tagId:b.tagId,tagName:b.tagName||b.tagId,documentSN:h.documentSN||"-",documentType:h.documentType||"-",riskLevel:h.riskLevel||"warning",confidence:h.confidence??0,riskDetails:h.riskDetails||"-",reasoning:h.reasoning||"-",sourceDocumentURL:h.sourceDocumentURL,createdAt:h.createdAt})}catch{}}let X=new jR0.default.Workbook;X.creator="seal-use",X.lastModifiedBy="seal-use",X.created=new Date,X.modified=new Date;let Z={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},q={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},V={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},F=X.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});F.columns=[{header:"分类",key:"category",width:20},{header:"指标名称",key:"name",width:28},{header:"数值",key:"val",width:22},{header:"环比/趋势",key:"trend",width:18},{header:"说明",key:"desc",width:36}],F.getRow(1).height=28,F.getRow(1).font=q,F.getRow(1).fill=Z,F.getRow(1).alignment={vertical:"middle",horizontal:"center"};let M=K.metrics||{},w=[{c
Line truncated
|
||||
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:_K({id:Y?.id,sn:Y?.sn??Y?.sourceDocumentSN??$.sourceDocumentSN,title:Y?.title??Y?.name,template:UT(Y,["template.name","templateName","form.name","formName","formTitle"]),amount:eA(z,["金额","报销金额","付款金额","合计","价税合计"])??UT(Y,["amount","totalAmount","expenseAmount"]),expenseType:eA(z,["费用类型","费用类别","报销类型"]),costCompany:eA(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:eA(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:zh1($),attachments:k2($,{summary:!0}).attachments,aiResult:JT($),manualResult:vU($)?.value,hints:_K({amountMentions:_R0(U,["金额","合计","税率"],8),partyMentions:_R0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function tv1($){let Y=[["result.citedRules",c7($,"result.citedRules")],["result.matchedRules",c7($,"result.matchedRules")],["result.ruleResults",c7($,"result.ruleResults")],["result.rules",c7($,"result.rules")],["pipelineData.citedRules",c7($,"pipelineData.citedRules")],["pipelineData.matchedRules",c7($,"pipelineData.matchedRules")]],z=[],U=new Set;for(let[Q,J]of Y)(Array.isArray(J)?J:J&&typeof J==="object"?Object.values(J):[]).forEach((K,G)=>{let W=Hq(K);if(!W)return;let H=S4(W.runtimeRuleId)??S4(W.runtimeId)??S4(W.id)??S4(W.ruleId),X=S4(W.ruleCode)??S4(W.code)??(H?Jh1(H):void 0),Z=_K({runtimeRuleId:H,ruleCode:X,versionNumber:$h1(W.versionNumber)??$.ruleSetVersionNumber,scope:S4(W.scope),strictness:S4(W.strictness),appliedAnalysis:W.appliedAnalysis??W.analysis??W.reasoning,checkResult:W.checkResult??W.result??W.decision,findings:W.findings??W.riskPoints??W.evidence,sourcePath:`${Q}.${G}`}),q=JSON.stringify(Z);if(!U.has(q))U.add(q),z.push(Z)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function UT($,Y){if(!$)return;for(let z of Y){let U=c7($,z);if(U!==void 0)return U}return}function RR0($,Y){if(!$)return 0;for(let z of Y){let U=c7($,z);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function c7($,Y){return Y.split(".").reduce((z,U)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let Q=Number(U);return Number.isInteger(Q)?z[Q]:void 0}if(typeof z==="object")return z[U];return},$)}function ev1($,Y,z){let U=Y.split("."),Q=$;for(let J of U.slice(0,-1)){let I=Q[J];if(!I||typeof I!=="object"||Array.isArray(I))Q[J]={};Q=Q[J]}Q[U[U.length-1]??Y]=z}function _K($){return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0))}function Hq($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function $h1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function Yh1($){let Y=[];return Gl($,"document",Y),Y}function Gl($,Y,z){if(Array.isArray($)){$.forEach((I,K)=>Gl(I,`${Y}.${K}`,z));return}let U=Hq($);if(!U)return;let Q=S4(U.label)??S4(U.name)??S4(U.title)??S4(U.fieldName),J=U.value??U.displayValue??U.text??U.content;if(Q&&J!==void 0&&typeof J!=="object")z.push(_K({path:Y,label:Q,value:J,type:S4(U.type)??S4(U.fieldType)}));for(let[I,K]of Object.entries(U)){if(I==="attachments")continue;Gl(K,`${Y}.${I}`,z)}}function eA($,Y){return $.find((U)=>{let Q=S4(U.label)??"";return Y.some((J)=>Q.includes(J))})?.value}function zh1($){let Y=[];return QT($.result,"result",Y),QT($.document,"document",Y),Y.slice(0,20)}function QT($,Y,z){if(Array.isArray($)){$.forEach((Q,J)=>QT(Q,`${Y}.${J}`,z));return}let U=Hq($);if(!U)return;if(/invoice|发票/i.test(Y))z.push(_K({path:Y,fileName:S4(U.fileName)??S4(U.filename)??S4(U.name),buyer:U.buyer??U.buyerName??U.purchaserName,seller:U.seller??U.sellerName,amount:U.amount??U.totalAmount??U.total,taxRate:U.taxRate,category:U.category??U.type}));for(let[Q,J]of Object.entries(U))QT(J,`${Y}.${Q}`,z)}function _R0($,Y,z){return $.split(/\r?\n/).filter((U)=>Y.some((Q)=>U.includes(Q))).slice(0,z)}function $T($){return $.map((Y)=>{let z=_U(Y);return{recordId:z.id,tenantId:z.tenantId,agentId:z.agentId,sourceDocumentSN:z.sourceDocumentSN,sourceDocumentId:z.sourceDocumentId,simulationBatchId:z.simulationBatchId,langfuseTraceId:z.langfuseTraceId,langfuseSessionFallback:z.langfuseSessionFallback,ruleSetVersionNumber:z.ruleSetVersionNumber,ruleSetPublishedAt:z.ruleSetPublishedAt,ruleSetPublishedByName:z.ruleSetPublishedByName,resolution:z.langfuseTraceId?"trace":z.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Il($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function Uh1($,Y){if(Y.recordId&&!Y.versionId&&!Y.versionNumber&&!Y.latest){let z=await G4($,Y.recordId);if(!z.ruleSetVersionNumber)throw Er
Line truncated
|
||||
`+`• 身份主体:${w}${O}
|
||||
`+`• 权限范围:持有该链接者在 Seal AI 中拥有该用户的完整操作权限(含系统设置与规则编辑)
|
||||
`+`• 时效性:换票凭证有效时间 ${q} 秒(${Math.round(q/60)} 分钟),在浏览器打开后将保留 30 天会话
|
||||
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:Y.sso?H:W,sealResultUrl:W,ssoUrl:H,type:Y.sso?"sso_link":"deep_link",expiresIn:Y.sso?q:void 0,identity:X,warning:Z,enterpriseAssistUrl:I,enterpriseUrl:I,hoseDomain:J.type==="hose"?Kh1(J.domain):void 0,documentUrl:K,recordId:Q?.id,sourceDocumentSN:Q?.sourceDocumentSN,sourceDocumentId:Q?.sourceDocumentId,sourceSystem:Q?.sourceSystem,missing:{enterpriseAssistUrl:I?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:U&&!K?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:L.object({query:L.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:L.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:L.string().optional().describe("模拟批次 ID"),latest:L.boolean().optional().describe("只返回最新一条匹配记录"),fields:L.union([L.string(),L.array(L.string())]).optional().describe("限制返回字段"),limit:L.number().int().positive().max(100).optional(),maxScan:L.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:L.boolean().optional()}),handler:async($,Y)=>{let z=Y.sn??Y.query;if(!z)throw Error("query or sn is required");let U=await Gh1($,{query:z,sn:Y.sn,batchId:Y.batchId,latest:Y.latest,limit:Y.latest?1:Y.limit??20,maxScan:Y.maxScan??1000}),Q=await Promise.all(U.records.map((K)=>G4($,K.id))),J=CR0(Y.fields),I=Q.map((K)=>Qh1(K,J));return{query:z,sourceDocumentSN:Y.sn,simulationBatchId:Y.batchId,latest:Y.latest??!1,total:U.total,scanned:U.scanned,matched:I.length,records:I,next:{getSummary:"seal-home approval-runs get <recordId> --summary",getRuleVersion:"seal-home rules version <ruleSetVersionNumber>",searchRuleVersion:`seal-home tool seal_approval_search --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version","ruleVersionNumber":14}'`,getVersionContext:`seal-home tool seal_approval_context_get --json '{"ruleVersionNumber":14}'`},...Y.includeBridge?{bridge:eA(Q)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:L.object({batchId:L.string().describe("simulation batch ID"),query:L.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,Y)=>{let z=Vl(await pS($,Y.batchId),Y.query);return{batchId:Y.batchId,count:z.length,records:z.map(_U),bridge:eA(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:L.object({mode:L.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:L.array(L.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:L.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:L.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:L.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:L.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:L.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:L.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:L.array(L.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:L.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:L.record(L.string(),L.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:L.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:L.record(L.string(),L.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,Y)=>{let z=Y.mode??"hosecloud",U=Y.signKey;if(z==="hosecloud"&&!U){if(U=(await mS($)).find((K)=>K.signKey)?.signKey,!U)throw Error("未找到合思集成 signKey, 请通过 signKey
Line truncated
|
||||
`)}function Mh1($){let Y=[];if(Y.push(`seal-use ${$.area} - ${$.title}`),$.description)Y.push($.description);Y.push(""),Y.push("Usage:");for(let z of $.commands)for(let U of z.usage)Y.push(` ${U}`);if($.commands.some((z)=>z.name))Y.push(""),Y.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return Y.join(`
|
||||
`)}function lR0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let Y of oR0)for(let z of Y.commands)for(let U of z.usage)$.push(` ${U}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
|
||||
`)}var oR0;var Nl=o(()=>{L$();oR0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List configured enterprises sorted by 7-day usage frequency",usage:["seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]"],options:[{flag:"--all",description:"Display all configured enterprises without the default 10-item limit"},{flag:"--limit <n>",description:"Maximum number of enterprises to display (defaults to 10)"},{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}]},{name:"search",aliases:["find"],summary:"Search configured enterprises with intelligent soft fuzzy matching",usage:["seal-use corps search <query> [--env <production|test>] [--strict]"],options:[{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}],description:"Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."},{name:"get",aliases:["show"],summary:"Get rich details and configuration of an enterprise",usage:["seal-use corps get <corpId>"],description:"Retrieves complete enterprise details (URLs, tenant slugs, custom headers/cookies, staff IDs, relations, config file path) with sensitive secrets safely redacted."},{name:"current",summary:"Show active enterprise in stateful mode",usage:["seal-use corps current [--corp <corpId>]"]},{name:"switch",summary:"Switch default active enterprise",usage:["seal-use corps switch <corpId>"]},{name:"mark",summary:"Mark enterprise environment as production or test",usage:["seal-use corps mark <corpId> --env <production|test> [--confirm]"],options:[{flag:"--env <production|test>",description:"Target environment: 'production' or 'test' (required)"},{flag:"--confirm",description:"Confirm the environment update (required)"}],description:"Explicitly updates an enterprise's environment tag. Requires --confirm to prevent accidental changes."},{name:"bind-test",summary:"Bind a production enterprise to a test enterprise (1-to-1 association)",usage:["seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]","seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]"],options:[{flag:"--confirm",description:"Explicitly confirm binding and tag test environment (required)"},{flag:"--force",description:"Force re-binding if the production enterprise is already bound"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Establishes a strict 1-to-1 association between a production enterprise and a test enterprise. Automatically marks the test enterprise with environment 'test'."},{name:"unbind-test",summary:"Unbind a production and test enterprise association",usage:["seal-use corps unbind-test [<corpId>] [--confirm]"],options:[{flag:"--confirm",description:"Explicitly confirm unbinding both sides (required)"},{flag:"--corp <corpId>",description:"Specify enterprise ID or name"}],description:"Removes the 1-to-1 test association from both the production enterprise and the test enterprise."},{name:"sync-test",summary:"Synchronize rules and preferences from production to test enterprise",usage:["seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]"],options:[{flag:"--dry-run",description:"Preview sync diff without making network mutations (default)"},{flag:"--yes",description:"Execute synchronization and publish new rule version on test enterprise"},{flag:"--version-name <name>",description:"Custom version name for published test rule version"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Overwrites test enterprise decision preferences with production preferences, syncs production draft rules to test enterprise, and immediately publishes a new version on the test enterprise. Production rules remain safe in draft state."},{name:"replay-test",summary:"Replay approval records from production enterprise to bound test enterprise via Webhook",usage:["seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--webhook <idOrName>] [--dry-run]"],options:[{flag:"<prodCorpId>",description:"Production enterprise ID (default: active enterprise)"},{flag:"--record-id <id>",description:"Replay a specific approval run ID"},{flag:"--sn <sn>",description:"Replay a specific document SN"},{flag:"--limit <n>",description:"Batch replay latest N records from production (default: 1)"},{flag:"--status <status>",descripti
Line truncated
|
||||
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:Y.sso?H:W,sealResultUrl:W,ssoUrl:H,type:Y.sso?"sso_link":"deep_link",expiresIn:Y.sso?q:void 0,identity:X,warning:Z,enterpriseAssistUrl:I,enterpriseUrl:I,hoseDomain:J.type==="hose"?Wh1(J.domain):void 0,documentUrl:K,recordId:Q?.id,sourceDocumentSN:Q?.sourceDocumentSN,sourceDocumentId:Q?.sourceDocumentId,sourceSystem:Q?.sourceSystem,missing:{enterpriseAssistUrl:I?void 0:"Current enterprise source is not Hose, so no Hose enterprise assist URL is configured.",documentUrl:U&&!K?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:L.object({query:L.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:L.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:L.string().optional().describe("模拟批次 ID"),latest:L.boolean().optional().describe("只返回最新一条匹配记录"),fields:L.union([L.string(),L.array(L.string())]).optional().describe("限制返回字段"),limit:L.number().int().positive().max(100).optional(),maxScan:L.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:L.boolean().optional()}),handler:async($,Y)=>{let z=Y.sn??Y.query;if(!z)throw Error("query or sn is required");let U=await Hh1($,{query:z,sn:Y.sn,batchId:Y.batchId,latest:Y.latest,limit:Y.latest?1:Y.limit??20,maxScan:Y.maxScan??1000}),Q=await Promise.all(U.records.map((K)=>G4($,K.id))),J=CR0(Y.fields),I=Q.map((K)=>Ih1(K,J));return{query:z,sourceDocumentSN:Y.sn,simulationBatchId:Y.batchId,latest:Y.latest??!1,total:U.total,scanned:U.scanned,matched:I.length,records:I,next:{getSummary:"seal-home approval-runs get <recordId> --summary",getRuleVersion:"seal-home rules version <ruleSetVersionNumber>",searchRuleVersion:`seal-home tool seal_approval_search --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version","ruleVersionNumber":14}'`,getVersionContext:`seal-home tool seal_approval_context_get --json '{"ruleVersionNumber":14}'`},...Y.includeBridge?{bridge:$T(Q)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:L.object({batchId:L.string().describe("simulation batch ID"),query:L.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,Y)=>{let z=Vl(await pS($,Y.batchId),Y.query);return{batchId:Y.batchId,count:z.length,records:z.map(_U),bridge:$T(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:L.object({mode:L.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:L.array(L.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:L.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:L.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:L.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:L.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:L.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:L.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:L.array(L.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:L.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:L.record(L.string(),L.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:L.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:L.record(L.string(),L.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,Y)=>{let z=Y.mode??"hosecloud",U=Y.signKey;if(z==="hosecloud"&&!U){if(U=(await mS($)).find((K)=>K.signKey)?.signKey,!U)throw Error("未找到合思集成 signKey, 请通过 signKey
Line truncated
|
||||
`)}function Nh1($){let Y=[];if(Y.push(`seal-use ${$.area} - ${$.title}`),$.description)Y.push($.description);Y.push(""),Y.push("Usage:");for(let z of $.commands)for(let U of z.usage)Y.push(` ${U}`);if($.commands.some((z)=>z.name))Y.push(""),Y.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return Y.join(`
|
||||
`)}function oR0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let Y of rR0)for(let z of Y.commands)for(let U of z.usage)$.push(` ${U}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
|
||||
`)}var rR0;var Nl=o(()=>{L$();rR0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List configured enterprises sorted by 7-day usage frequency",usage:["seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]"],options:[{flag:"--all",description:"Display all configured enterprises without the default 10-item limit"},{flag:"--limit <n>",description:"Maximum number of enterprises to display (defaults to 10)"},{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}]},{name:"search",aliases:["find"],summary:"Search configured enterprises with intelligent soft fuzzy matching",usage:["seal-use corps search <query> [--env <production|test>] [--strict]"],options:[{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}],description:"Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."},{name:"get",aliases:["show"],summary:"Get rich details and configuration of an enterprise",usage:["seal-use corps get <corpId>"],description:"Retrieves complete enterprise details (URLs, tenant slugs, custom headers/cookies, staff IDs, relations, config file path) with sensitive secrets safely redacted."},{name:"current",summary:"Show active enterprise in stateful mode",usage:["seal-use corps current [--corp <corpId>]"]},{name:"switch",summary:"Switch default active enterprise",usage:["seal-use corps switch <corpId>"]},{name:"mark",summary:"Mark enterprise environment as production or test",usage:["seal-use corps mark <corpId> --env <production|test> [--confirm]"],options:[{flag:"--env <production|test>",description:"Target environment: 'production' or 'test' (required)"},{flag:"--confirm",description:"Confirm the environment update (required)"}],description:"Explicitly updates an enterprise's environment tag. Requires --confirm to prevent accidental changes."},{name:"bind-test",summary:"Bind a production enterprise to a test enterprise (1-to-1 association)",usage:["seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]","seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]"],options:[{flag:"--confirm",description:"Explicitly confirm binding and tag test environment (required)"},{flag:"--force",description:"Force re-binding if the production enterprise is already bound"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Establishes a strict 1-to-1 association between a production enterprise and a test enterprise. Automatically marks the test enterprise with environment 'test'."},{name:"unbind-test",summary:"Unbind a production and test enterprise association",usage:["seal-use corps unbind-test [<corpId>] [--confirm]"],options:[{flag:"--confirm",description:"Explicitly confirm unbinding both sides (required)"},{flag:"--corp <corpId>",description:"Specify enterprise ID or name"}],description:"Removes the 1-to-1 test association from both the production enterprise and the test enterprise."},{name:"sync-test",summary:"Synchronize rules and preferences from production to test enterprise",usage:["seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]"],options:[{flag:"--dry-run",description:"Preview sync diff without making network mutations (default)"},{flag:"--yes",description:"Execute synchronization and publish new rule version on test enterprise"},{flag:"--version-name <name>",description:"Custom version name for published test rule version"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Overwrites test enterprise decision preferences with production preferences, syncs production draft rules to test enterprise, and immediately publishes a new version on the test enterprise. Production rules remain safe in draft state."},{name:"replay-test",summary:"Replay approval records from production enterprise to bound test enterprise via Webhook",usage:["seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--webhook <idOrName>] [--dry-run]"],options:[{flag:"<prodCorpId>",description:"Production enterprise ID (default: active enterprise)"},{flag:"--record-id <id>",description:"Replay a specific approval run ID"},{flag:"--sn <sn>",description:"Replay a specific document SN"},{flag:"--limit <n>",description:"Batch replay latest N records from production (default: 1)"},{flag:"--status <status>",descripti
Line truncated
|
||||
`)}
|
||||
`}function qq($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function c0($,Y={}){Ph1($,Y);let z=`${JSON.stringify($,null,2)}
|
||||
`;if(Y.outputFile){Oh1(Y.outputFile,z),console.log(JSON.stringify({outputFile:Y.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function Ph1($,Y={}){if(Y.allowFull||Y.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>Bh1)throw new gP(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function tR0($,Y){if(Y)return;let z=$&&typeof $==="object"?$:{},U=typeof z.count==="number"?z.count:void 0,Q=Array.isArray(z.rules)?z.rules.length:void 0,J=Buffer.byteLength(JSON.stringify($),"utf-8"),I=U??Q??0;if(I>Nh1||J>Dh1)throw new gP(`Rule list is large (${I} rules, ${J} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function C0($){return{allowFull:F0($.full)===!0,outputFile:S($.outputFile)??S($["output-file"])}}function eR0($=[]){console.log(sR0($))}var Nh1=100,Dh1=120000,aR0,Bh1=200000;var J4=o(()=>{D4();L$();Nl();aR0=["id","code","status","strictness","scope","createdAt","updatedAt"]});var $_0={};x8($_0,{selectCorp:()=>E1,runToolResult:()=>o2,runTool:()=>k0,globalConfigSummary:()=>l2});function E1($){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},v7());return tD0(U.id),U}function l2($=_4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:JU()}}async function k0($,Y,z,U,Q={}){c0(await o2($,Y,z,U),Q)}async function o2($,Y,z,U){let Q=Wq.find((K)=>K.name===$);if(!Q)throw Error(`Unknown Seal tool: ${$}`);let J=Object.fromEntries(Object.entries(U).filter(([,K])=>K!==void 0)),I=Q.handler;return I(Y,J,{corp:z})}var o4=o(()=>{h7();tn();JT();J4()});import{existsSync as Y_0}from"node:fs";async function z_0($,Y){if(!Y_0($))throw Error(`File not found: ${$}`);let z=RU($);console.log(JSON.stringify(await CU(z.fileBuffer,z.fileName,Y),null,2))}async function HT($,Y,z,U,Q){if($==="ready"||$==="status"){let J=Y??S(Q.options.file)??S(Q.options.input),I=await oA(z,U,{filePath:J,webhook:S(Q.options.webhook)??S(Q.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${I.corp.name} (${I.corp.id}) [${I.stateMode}]`),I.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${I.corp.tenant.name} (${I.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${I.authStatus==="ok"?"OK":`异常 (${I.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${I.activeWebhooks.length} 个可用`);for(let K of I.activeWebhooks){let G=K.isDefault?" [默认通道]":"";console.error(` - ${K.name} (${K.id}) mode=${K.mode}${G}`)}if(I.materialPack)console.error(`[webhook-ready] 材料包预检: ${I.materialPack.valid?`通过 (${I.materialPack.documentCount} 单)`:`失败 (${I.materialPack.errors?.join("; ")})`}`);if(I.ready)console.error(`\uD83D\uDFE2 ${I.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${I.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${I.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${I.nextAction}`);console.log(JSON.stringify(I,null,2));return}if($==="replay"){let J=Y??S(Q.options.recordId)??S(Q.options["record-id"])??S(Q.options.id),I=S(Q.options.recordIds)??S(Q.options["record-ids"]),K=I?I.split(",").map((c)=>c.trim()).filter(Boolean):void 0,G=S(Q.options.sn)??S(Q.options.documentSn)??S(Q.options["document-sn"]),W=S(Q.options.sns)??S(Q.options["document-sns"]),H=W?W.split(",").map((c)=>c.trim()).filter(Boolean):void 0,X=s0(Q.options.limit),Z=S(Q.options.status),q=S(Q.options.startDate)??S(Q.options["start-date"]),V=S(Q.options.endDate)??S(Q.options["end-date"]);if(!J&&!K&&!G&&!H&&X===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let F=S(Q.options.sourceCorp)??S(Q.options["source-corp"])??S(Q.options.prodCorp)??S(Q.options["prod-corp"]),M=S(Q.options.targetCorp)??S(Q.options["target-corp"])??S(Q.options.testCorp)??S(Q.options["test-corp"]),w=F0(Q.options.force)===!0,{sourceCorp:O,targetCorp:D}=yP({sourceCorpId:F,targetCorpId:M,activeCorp:U,force:w},E1),N=O.id===U.id?z:await j1(O),A=D.id===U.id?z:await j1(D),T=S(Q.options.webhook)??S(Q.options.selector),B=S(Q.options.snSuffix)??S(Q.options["sn-suffix"]),j=S(Q.options.snPrefix)??S(Q.options["sn-prefix"]),C=S(Q.options.docIdSuffix)??S(Q.options["doc-id-suffix"]),b=S(Q.options.docIdPrefix)??S(Q.options["doc-id-prefix"]),k=F0(Q.options.dryRun)??F0(Q.options["dry-run"]),i=await sI({query:{recordId:J,recordIds:K,sn:G,sns:H,limit:X,status:Z,startDate:q,endDate:V},sourceClient:N,targetClient:A,sourceCorp:O,targetCorp:D,webhookSelector:T,snPrefix:j,snSuffix:B,docIdPrefix:b,docIdSuffix:C
Line truncated
|
||||
`}function Vq($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function c0($,Y={}){Th1($,Y);let z=`${JSON.stringify($,null,2)}
|
||||
`;if(Y.outputFile){Dh1(Y.outputFile,z),console.log(JSON.stringify({outputFile:Y.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function Th1($,Y={}){if(Y.allowFull||Y.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>Ah1)throw new yP(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function eR0($,Y){if(Y)return;let z=$&&typeof $==="object"?$:{},U=typeof z.count==="number"?z.count:void 0,Q=Array.isArray(z.rules)?z.rules.length:void 0,J=Buffer.byteLength(JSON.stringify($),"utf-8"),I=U??Q??0;if(I>Bh1||J>Ph1)throw new yP(`Rule list is large (${I} rules, ${J} bytes). Use "seal-use rules list --summary" or "seal-use rules count"; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function C0($){return{allowFull:F0($.full)===!0,outputFile:S($.outputFile)??S($["output-file"])}}function $_0($=[]){console.log(aR0($))}var Bh1=100,Ph1=120000,tR0,Ah1=200000;var J4=o(()=>{D4();L$();Nl();tR0=["id","code","status","strictness","scope","createdAt","updatedAt"]});var Y_0={};x8(Y_0,{selectCorp:()=>E1,runToolResult:()=>o2,runTool:()=>k0,globalConfigSummary:()=>l2});function E1($){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},v7());return tD0(U.id),U}function l2($=_4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:JU()}}async function k0($,Y,z,U,Q={}){c0(await o2($,Y,z,U),Q)}async function o2($,Y,z,U){let Q=Wq.find((K)=>K.name===$);if(!Q)throw Error(`Unknown Seal tool: ${$}`);let J=Object.fromEntries(Object.entries(U).filter(([,K])=>K!==void 0)),I=Q.handler;return I(Y,J,{corp:z})}var o4=o(()=>{h7();tn();Xq();J4()});import{existsSync as z_0}from"node:fs";async function U_0($,Y){if(!z_0($))throw Error(`File not found: ${$}`);let z=RU($);console.log(JSON.stringify(await CU(z.fileBuffer,z.fileName,Y),null,2))}async function HT($,Y,z,U,Q){if($==="ready"||$==="status"){let J=Y??S(Q.options.file)??S(Q.options.input),I=await rA(z,U,{filePath:J,webhook:S(Q.options.webhook)??S(Q.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${I.corp.name} (${I.corp.id}) [${I.stateMode}]`),I.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${I.corp.tenant.name} (${I.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${I.authStatus==="ok"?"OK":`异常 (${I.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${I.activeWebhooks.length} 个可用`);for(let K of I.activeWebhooks){let G=K.isDefault?" [默认通道]":"";console.error(` - ${K.name} (${K.id}) mode=${K.mode}${G}`)}if(I.materialPack)console.error(`[webhook-ready] 材料包预检: ${I.materialPack.valid?`通过 (${I.materialPack.documentCount} 单)`:`失败 (${I.materialPack.errors?.join("; ")})`}`);if(I.ready)console.error(`\uD83D\uDFE2 ${I.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${I.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${I.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${I.nextAction}`);console.log(JSON.stringify(I,null,2));return}if($==="replay"){let J=Y??S(Q.options.recordId)??S(Q.options["record-id"])??S(Q.options.id),I=S(Q.options.recordIds)??S(Q.options["record-ids"]),K=I?I.split(",").map((c)=>c.trim()).filter(Boolean):void 0,G=S(Q.options.sn)??S(Q.options.documentSn)??S(Q.options["document-sn"]),W=S(Q.options.sns)??S(Q.options["document-sns"]),H=W?W.split(",").map((c)=>c.trim()).filter(Boolean):void 0,X=s0(Q.options.limit),Z=S(Q.options.status),q=S(Q.options.startDate)??S(Q.options["start-date"]),V=S(Q.options.endDate)??S(Q.options["end-date"]);if(!J&&!K&&!G&&!H&&X===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let F=S(Q.options.sourceCorp)??S(Q.options["source-corp"])??S(Q.options.prodCorp)??S(Q.options["prod-corp"]),M=S(Q.options.targetCorp)??S(Q.options["target-corp"])??S(Q.options.testCorp)??S(Q.options["test-corp"]),w=F0(Q.options.force)===!0,{sourceCorp:O,targetCorp:D}=kP({sourceCorpId:F,targetCorpId:M,activeCorp:U,force:w},E1),N=O.id===U.id?z:await j1(O),A=D.id===U.id?z:await j1(D),T=S(Q.options.webhook)??S(Q.options.selector),B=S(Q.options.snSuffix)??S(Q.options["sn-suffix"]),j=S(Q.options.snPrefix)??S(Q.options["sn-prefix"]),C=S(Q.options.docIdSuffix)??S(Q.options["doc-id-suffix"]),b=S(Q.options.docIdPrefix)??S(Q.options["doc-id-prefix"]),k=F0(Q.options.dryRun)??F0(Q.options["dry-run"]),i=await sI({query:{recordId:J,recordIds:K,sn:G,sns:H,limit:X,status:Z,startDate:q,endDate:V},sourceClient:N,targetClient:A,sourceCorp:O,targetCorp:D,webhookSelector:T,snPrefix:j,snSuffix:B,docIdPrefix:b,docIdSuffix:C
Line truncated
|
||||
`+`\uD83D\uDC49 查看全部请添加: seal-use corps list --all
|
||||
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}c0(w.map((O)=>({id:O.id,name:O.name,environment:O.environment??"production",sourceType:O.source.type,provider:O.source.provider??O.source.type,staffId:O.source.staffId,testCorpId:O.testCorpId,prodCorpId:O.prodCorpId,current:O.id===W})));return}if($==="get"||$==="show"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps get <corpId>");let Q=E1(U),J=on(Q.id),I=ah1(Q);c0({id:Q.id,name:Q.name,environment:Q.environment??"production",configFile:J,seal:{url:I,tenantSlug:Q.seal.tenantSlug??Q.source.tenantSlug,customHeaderNames:Q.seal.headers?Object.keys(Q.seal.headers):[],customCookieNames:Q.seal.cookies?Object.keys(Q.seal.cookies):[],endpoints:Q.seal.endpoints},source:th1(Q.source),relations:{testCorpId:Q.testCorpId,prodCorpId:Q.prodCorpId},auth:{refreshTtl:Q.auth.refreshTtl}});return}if($==="current"){let U=E1(S(z.options.corp));c0({id:U.id,name:U.name,environment:U.environment??"production",sourceType:U.source.type,provider:U.source.provider??U.source.type,staffId:U.source.staffId,testCorpId:U.testCorpId,prodCorpId:U.prodCorpId});return}if($==="mark"||$==="mark-test"||$==="mark-prod"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");let Q=E1(U),J=$==="mark-test"?"test":$==="mark-prod"?"production":S(z.options.env)??S(z.options.environment);if(J!=="production"&&J!=="test")throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(F0(z.options.confirm)===!0||F0(z.options.yes)===!0))throw N9(`Refusing to change environment tag of enterprise '${Q.name}' (${Q.id}) to '${J}' without --confirm. Marking alters synchronization safety guards.`,`seal-use corps mark ${Q.id} --env ${J} --confirm`);let K=x2(Q.id,{environment:J});c0({id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId,prodCorpId:K.prodCorpId});return}if($==="bind-test"){let U,Q;if(Y&&z.command[3])U=Y,Q=z.command[3];else if(Y){let X=S(z.options.corp),Z=S(z.options["test-corp"])??S(z.options.testCorp);if(X)U=X,Q=Y;else if(Z)U=Y,Q=Z}if(!U||!Q)throw d4(`Usage: seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
|
||||
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}c0(w.map((O)=>({id:O.id,name:O.name,environment:O.environment??"production",sourceType:O.source.type,provider:O.source.provider??O.source.type,staffId:O.source.staffId,testCorpId:O.testCorpId,prodCorpId:O.prodCorpId,current:O.id===W})));return}if($==="get"||$==="show"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps get <corpId>");let Q=E1(U),J=on(Q.id),I=eh1(Q);c0({id:Q.id,name:Q.name,environment:Q.environment??"production",configFile:J,seal:{url:I,tenantSlug:Q.seal.tenantSlug??Q.source.tenantSlug,customHeaderNames:Q.seal.headers?Object.keys(Q.seal.headers):[],customCookieNames:Q.seal.cookies?Object.keys(Q.seal.cookies):[],endpoints:Q.seal.endpoints},source:$S1(Q.source),relations:{testCorpId:Q.testCorpId,prodCorpId:Q.prodCorpId},auth:{refreshTtl:Q.auth.refreshTtl}});return}if($==="current"){let U=E1(S(z.options.corp));c0({id:U.id,name:U.name,environment:U.environment??"production",sourceType:U.source.type,provider:U.source.provider??U.source.type,staffId:U.source.staffId,testCorpId:U.testCorpId,prodCorpId:U.prodCorpId});return}if($==="mark"||$==="mark-test"||$==="mark-prod"){let U=Y??S(z.options.corp);if(!U)throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");let Q=E1(U),J=$==="mark-test"?"test":$==="mark-prod"?"production":S(z.options.env)??S(z.options.environment);if(J!=="production"&&J!=="test")throw d4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(F0(z.options.confirm)===!0||F0(z.options.yes)===!0))throw N9(`Refusing to change environment tag of enterprise '${Q.name}' (${Q.id}) to '${J}' without --confirm. Marking alters synchronization safety guards.`,`seal-use corps mark ${Q.id} --env ${J} --confirm`);let K=x2(Q.id,{environment:J});c0({id:K.id,name:K.name,environment:K.environment,testCorpId:K.testCorpId,prodCorpId:K.prodCorpId});return}if($==="bind-test"){let U,Q;if(Y&&z.command[3])U=Y,Q=z.command[3];else if(Y){let X=S(z.options.corp),Z=S(z.options["test-corp"])??S(z.options.testCorp);if(X)U=X,Q=Y;else if(Z)U=Y,Q=Z}if(!U||!Q)throw d4(`Usage: seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
|
||||
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let J=E1(U),I=E1(Q);if(J.id===I.id)throw d4(`Cannot bind enterprise '${J.id}' to itself.`);if(J.prodCorpId&&J.prodCorpId!==I.id)throw d4(`Cannot use '${J.id}' as a production enterprise because it is already registered as a test enterprise for '${J.prodCorpId}'. Multi-tier chaining is not permitted.`);if(I.testCorpId&&I.testCorpId!==J.id)throw d4(`Cannot bind '${I.id}' as a test enterprise because it already has a bound test enterprise '${I.testCorpId}'. Multi-tier chaining is not permitted.`);let K=F0(z.options.force)===!0;if(J.testCorpId&&J.testCorpId!==I.id||I.prodCorpId&&I.prodCorpId!==J.id){if(!K)throw N9(`Enterprise binding conflict: production enterprise '${J.id}' is bound to '${J.testCorpId??"none"}', and test enterprise '${I.id}' is bound to '${I.prodCorpId??"none"}'. Overwriting an existing binding requires --force and --confirm.`,`seal-use corps bind-test ${J.id} ${I.id} --confirm --force`)}if(!(F0(z.options.confirm)===!0||F0(z.options.yes)===!0)){let X=K?" --force":"";throw N9(`Refusing to bind test enterprise '${I.name}' (${I.id}) to production enterprise '${J.name}' (${J.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${I.id}' as a test environment.`,`seal-use corps bind-test ${J.id} ${I.id} --confirm${X}`)}if(J.testCorpId&&J.testCorpId!==I.id)try{x2(J.testCorpId,{prodCorpId:void 0})}catch{}if(I.prodCorpId&&I.prodCorpId!==J.id)try{x2(I.prodCorpId,{testCorpId:void 0})}catch{}let W=x2(J.id,{environment:"production",testCorpId:I.id}),H=x2(I.id,{environment:"test",prodCorpId:J.id});c0({success:!0,productionEnterprise:{id:W.id,name:W.name,environment:W.environment,testCorpId:W.testCorpId},testEnterprise:{id:H.id,name:H.name,environment:H.environment,prodCorpId:H.prodCorpId}});return}if($==="unbind-test"){let U=Y??S(z.options.corp),Q=E1(U);if(!Q.testCorpId&&!Q.prodCorpId){c0({unbound:!1,message:`Enterprise '${Q.name}' (${Q.id}) does not have an active test enterprise binding.`});return}let J=Q.testCorpId?Q.id:Q.prodCorpId,I=Q.testCorpId?Q.testCorpId:Q.id;if(!(F0(z.options.confirm)===!0||F0(z.options.yes)===!0))throw N9(`Refusing to unbind production enterprise '${J}' and test enterprise '${I}' without --confirm.`,`seal-use corps unbind-test ${Q.id} --confirm`);x2(J,{testCorpId:void 0});try{x2(I,{prodCorpId:void 0})}catch{}c0({success:!0,unboundProduction:J,unboundTest:I});return}if($==="sync-test"){let U=Y??S(z.options.corp),Q=E1(U);if(!Q.testCorpId)throw d4(`Production enterprise '${Q.name}' (${Q.id}) has no bound test enterprise.
|
||||
Run 'seal-use corps bind-test ${Q.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let J=E1(Q.testCorpId);if(J.environment!=="test")throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let I=await j1(Q),K=await j1(J),[G,W,H,X,Z,q,V,F]=await Promise.all([o1(I,Q.seal.endpoints.approvalStylePreferences).catch(()=>({})),o1(K,J.seal.endpoints.approvalStylePreferences).catch(()=>({})),n6(I),n6(K),A$(I).catch(()=>[]),A$(K).catch(()=>[]),_3(I,{limit:100}).catch(()=>({articles:[]})),_3(K,{limit:100}).catch(()=>({articles:[]}))]),M=(V.articles||[]).filter((G0)=>!G0.isDeleted),w=(F.articles||[]).filter((G0)=>!G0.isDeleted),O=new Map(w.map((G0)=>[G0.title.trim(),G0])),D=[],N=[],A=new Set(M.map((G0)=>G0.title.trim()));for(let G0 of M){let T0=G0.title.trim(),b0=O.get(T0);if(!b0)D.push(G0);else{let Y1=b0.content!==G0.content,a=(b0.purpose??"")!==(G0.purpose??""),H0=b0.enabled!==G0.enabled,L0=b0.contentType!==G0.contentType,f0=(b0.status??"")!==(G0.status??""),u0=JSON.stringify([...b0.scenarios??[]].sort())!==JSON.stringify([...G0.scenarios??[]].sort()),i0=JSON.stringify([...b0.tags??[]].sort())!==JSON.stringify([...G0.tags??[]].sort());if(Y1||a||H0||L0||f0||u0||i0)N.push({testId:b0.id,prodDoc:G0,reasons:[...Y1?["content"]:[],...a?["purpose"]:[],...H0?["enabled"]:[],...L0?["contentType"]:[],...f0?["status"]:[],...u0?["scenarios"]:[],...i0?["tags"]:[]]})}}let T=w.filter((G0)=>!A.has(G0.title.trim())),j=[...Z].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0],C=j?.versionNumber,k=([...q].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0]?.versionNumber??0)+1,h=Cv0(Q.name,C,q),c=S(z.options["version-name"])??S(z.options.versionName)??Rv0(Q.name,C,h,k),U0={...W,tone:G.tone,language:G.language,detailLevel:G.detailLevel,outputFormat:G.outputFormat,examples:G.examples??[],prohibitedPhrases:G.prohibitedPhrases??[],customInstructions:G.customInstructions,decisionPreferences:G.decisionPreferences,thinkingDepthPreference:G.thinkingDepthPreference};if(F0(z.options["dry-run"])===!0||F0(z.options.dryRun)===!0){c0({dryRun:!0,source:{id:Q.id,name:Q.name,environment:Q.environment,latestPublishedVersion:j?{versionNumber:j.versionNumber,versionName:j.versionName}:null,documentsCount:M.length},target:{id:J.id,name:J.name,environment:J.environment},versionMappingPlan:{sourceProdVersionNumber:C??null,sourceProdVersionName:j?.versionName??null,targetTestExpectedVersionNumber:k,targetTestPublishVersionName:c,iteration:h},preferencesDiff:{decisionPreferences:{before:W.decisionPreferences,after:G.decisionPreferences},thinkingDepthPreference:{before:W.thinkingDepthPreference,after:G.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:X.rules.length,toDeleteCount:X.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((G0,T0)=>({index:T0+1,sourceRuleId:G0.id,sourceRuleCode:G0.code??T0+1,expectedTargetCode:`rule-${T0+1}`,description:G0.description,scope:G0.scope,strictness:G0.strictness}))},documentsPlan:{sourceDocumentCount:M.length,targetExistingDocumentCount:w.length,toCreateCount:D.length,toCreate:D.map((G0)=>({title:G0.title,purpose:G0.purpose,contentType:G0.contentType,scenarios:G0.scenarios})),toUpdateCount:N.length,toUpdate:N.map((G0)=>({targetDocumentId:G0.testId,title:G0.prodDoc.title,reasons:G0.reasons})),toDeleteCount:T.length,toDelete:T.map((G0)=>({targetDocumentId:G0.id,title:G0.title}))},publishingPlan:{targetCorpId:J.id,publishVersionName:c,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(Q.source.type!=="hose")return{sourceType:Q.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let G0=(G.integrations??[]).filter((Y1)=>Y1.type==="hosecloud"),T0=new Set,b0=G0.filter((Y1)=>{let a=Y1.corporationId??Q.id;if(T0.has(a))return!1;return T0.add(a),!0});return{sourceType:"hose",outboundName:yv0(Q.name),targetMode:"assisted",integrationsCount:b0.length,integrations:b0.map((Y1)=>({corporationId:Y1.corporationId,apiOrigin:Y1.apiOrigin,customApiUrl:Y1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(F0(z.options.yes)===!0||F0(z.options.confirm)===!0))throw N9(`Refusing to overwrite test enterprise '${J.name}' (${J.id}) with preferences, ${H.rules.length} draft rules, and ${M.length} knowledge documents from production enterprise '${Q.name}' (${Q.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${Q.id} --yes`);await d5(K,U0,J.seal.endpoints.approvalStylePreferences);let t=[];for(let G0 of T)await IM(K,G0.id),t.push({id:G0.id,title:G0.title});let $0=[];for(let G0 of N)await JM(K,G0.testId,{title:G0.prodDoc.title,purpose:G0.prodDoc.purpose,content:G0.prodDoc.content,contentType:G0.prodDoc.contentType,status:G0.prodDoc.status,enabled:G0.prodDoc.enabled,
Line truncated
|
||||
Run 'seal-use corps bind-test ${Q.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let J=E1(Q.testCorpId);if(J.environment!=="test")throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let I=await j1(Q),K=await j1(J),[G,W,H,X,Z,q,V,F]=await Promise.all([o1(I,Q.seal.endpoints.approvalStylePreferences).catch(()=>({})),o1(K,J.seal.endpoints.approvalStylePreferences).catch(()=>({})),n6(I),n6(K),A$(I).catch(()=>[]),A$(K).catch(()=>[]),_3(I,{limit:100}).catch(()=>({articles:[]})),_3(K,{limit:100}).catch(()=>({articles:[]}))]),M=(V.articles||[]).filter((G0)=>!G0.isDeleted),w=(F.articles||[]).filter((G0)=>!G0.isDeleted),O=new Map(w.map((G0)=>[G0.title.trim(),G0])),D=[],N=[],A=new Set(M.map((G0)=>G0.title.trim()));for(let G0 of M){let T0=G0.title.trim(),b0=O.get(T0);if(!b0)D.push(G0);else{let Y1=b0.content!==G0.content,a=(b0.purpose??"")!==(G0.purpose??""),H0=b0.enabled!==G0.enabled,L0=b0.contentType!==G0.contentType,f0=(b0.status??"")!==(G0.status??""),u0=JSON.stringify([...b0.scenarios??[]].sort())!==JSON.stringify([...G0.scenarios??[]].sort()),i0=JSON.stringify([...b0.tags??[]].sort())!==JSON.stringify([...G0.tags??[]].sort());if(Y1||a||H0||L0||f0||u0||i0)N.push({testId:b0.id,prodDoc:G0,reasons:[...Y1?["content"]:[],...a?["purpose"]:[],...H0?["enabled"]:[],...L0?["contentType"]:[],...f0?["status"]:[],...u0?["scenarios"]:[],...i0?["tags"]:[]]})}}let T=w.filter((G0)=>!A.has(G0.title.trim())),j=[...Z].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0],C=j?.versionNumber,k=([...q].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0]?.versionNumber??0)+1,h=Rv0(Q.name,C,q),c=S(z.options["version-name"])??S(z.options.versionName)??_v0(Q.name,C,h,k),U0={...W,tone:G.tone,language:G.language,detailLevel:G.detailLevel,outputFormat:G.outputFormat,examples:G.examples??[],prohibitedPhrases:G.prohibitedPhrases??[],customInstructions:G.customInstructions,decisionPreferences:G.decisionPreferences,thinkingDepthPreference:G.thinkingDepthPreference};if(F0(z.options["dry-run"])===!0||F0(z.options.dryRun)===!0){c0({dryRun:!0,source:{id:Q.id,name:Q.name,environment:Q.environment,latestPublishedVersion:j?{versionNumber:j.versionNumber,versionName:j.versionName}:null,documentsCount:M.length},target:{id:J.id,name:J.name,environment:J.environment},versionMappingPlan:{sourceProdVersionNumber:C??null,sourceProdVersionName:j?.versionName??null,targetTestExpectedVersionNumber:k,targetTestPublishVersionName:c,iteration:h},preferencesDiff:{decisionPreferences:{before:W.decisionPreferences,after:G.decisionPreferences},thinkingDepthPreference:{before:W.thinkingDepthPreference,after:G.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:X.rules.length,toDeleteCount:X.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((G0,T0)=>({index:T0+1,sourceRuleId:G0.id,sourceRuleCode:G0.code??T0+1,expectedTargetCode:`rule-${T0+1}`,description:G0.description,scope:G0.scope,strictness:G0.strictness}))},documentsPlan:{sourceDocumentCount:M.length,targetExistingDocumentCount:w.length,toCreateCount:D.length,toCreate:D.map((G0)=>({title:G0.title,purpose:G0.purpose,contentType:G0.contentType,scenarios:G0.scenarios})),toUpdateCount:N.length,toUpdate:N.map((G0)=>({targetDocumentId:G0.testId,title:G0.prodDoc.title,reasons:G0.reasons})),toDeleteCount:T.length,toDelete:T.map((G0)=>({targetDocumentId:G0.id,title:G0.title}))},publishingPlan:{targetCorpId:J.id,publishVersionName:c,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(Q.source.type!=="hose")return{sourceType:Q.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let G0=(G.integrations??[]).filter((Y1)=>Y1.type==="hosecloud"),T0=new Set,b0=G0.filter((Y1)=>{let a=Y1.corporationId??Q.id;if(T0.has(a))return!1;return T0.add(a),!0});return{sourceType:"hose",outboundName:kv0(Q.name),targetMode:"assisted",integrationsCount:b0.length,integrations:b0.map((Y1)=>({corporationId:Y1.corporationId,apiOrigin:Y1.apiOrigin,customApiUrl:Y1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(F0(z.options.yes)===!0||F0(z.options.confirm)===!0))throw N9(`Refusing to overwrite test enterprise '${J.name}' (${J.id}) with preferences, ${H.rules.length} draft rules, and ${M.length} knowledge documents from production enterprise '${Q.name}' (${Q.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${Q.id} --yes`);await d5(K,U0,J.seal.endpoints.approvalStylePreferences);let t=[];for(let G0 of T)await KM(K,G0.id),t.push({id:G0.id,title:G0.title});let $0=[];for(let G0 of N)await IM(K,G0.testId,{title:G0.prodDoc.title,purpose:G0.prodDoc.purpose,content:G0.prodDoc.content,contentType:G0.prodDoc.contentType,status:G0.prodDoc.status,enabled:G0.prodDoc.enabled,
Line truncated
|
||||
Run 'seal-use corps bind-test ${Q.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association,
|
||||
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);I=Q}else if(I=E1(Q.testCorpId),I.environment!=="test"&&!J)throw Error(`Target enterprise '${I.name}' (${I.id}) is marked as '${I.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let K=S(z.options.recordId)??S(z.options["record-id"])??S(z.options.id),G=S(z.options.recordIds)??S(z.options["record-ids"]),W=G?G.split(",").map((k)=>k.trim()).filter(Boolean):void 0,H=S(z.options.sn)??S(z.options.documentSn)??S(z.options["document-sn"]),X=S(z.options.sns)??S(z.options["document-sns"]),Z=X?X.split(",").map((k)=>k.trim()).filter(Boolean):void 0,q=s0(z.options.limit)??(!K&&!W&&!H&&!Z?1:void 0),V=S(z.options.status),F=S(z.options.startDate)??S(z.options["start-date"]),M=S(z.options.endDate)??S(z.options["end-date"]),w=await j1(Q),O=Q.id===I.id?w:await j1(I),D=S(z.options.webhook)??S(z.options.selector),N=S(z.options.snSuffix)??S(z.options["sn-suffix"]),A=S(z.options.snPrefix)??S(z.options["sn-prefix"]),T=S(z.options.docIdSuffix)??S(z.options["doc-id-suffix"]),B=S(z.options.docIdPrefix)??S(z.options["doc-id-prefix"]),j=F0(z.options.dryRun)??F0(z.options["dry-run"]),C={recordId:K,recordIds:W,sn:H,sns:Z,limit:q,status:V,startDate:F,endDate:M};console.error(`[corps-replay-test] 正式企业「${Q.name}」(${Q.id}) -> 测试企业「${I.name}」(${I.id})`);let b=await sI({query:C,sourceClient:w,targetClient:O,sourceCorp:Q,targetCorp:I,webhookSelector:D,snPrefix:A,snSuffix:N,docIdPrefix:B,docIdSuffix:T,dryRun:j});if(j){console.error(`[corps-replay-test] 预览模式:已成功从 ${Q.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(b,null,2));return}if(b.success)if(b.totalCount===1&&b.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${b.replayedDocument.documentSN}」至 ${I.name} (${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${b.successCount} 条单据(来自「${Q.name}」)至「${I.name}」(${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${b.successCount} 条,失败 ${b.failureCount} 条)至「${I.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${I.id} --limit ${b.totalCount}`),console.log(JSON.stringify(b,null,2)),!b.success)process.exitCode=1;return}if($==="switch"){let U=Y;if(!U)throw Error("Usage: seal-use corps switch <corpId>");let Q=_4();if(!Q.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let J=E1(U);IU({...Q,stateful:!0,defaultCorpId:J.id}),c0({current:!0,id:J.id,name:J.name});return}if($==="probe-hose"){await $S1(y8(z.json));return}if($==="hose-staffs"){await YS1(y8(z.json));return}if($==="add-hose"){await kl(y8(z.json));return}if($==="add-seal"){await zS1(y8(z.json));return}if($==="add-link"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--overwrite]");if(F0(z.options["as-hose"])===!0||F0(z.options.hose)===!0){await QS1(U,S(z.options.name),F0(z.options.overwrite)===!0,F0(z.options.force)===!0,{appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await US1(U,S(z.options.name),F0(z.options.overwrite)===!0);return}if($==="extract-keys"||$==="extract-key"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--app-key <key>] [--key-id <id>] [--name <customName>] [--overwrite]");let Q=F0(z.options.reveal)===!0||F0(z.options.r)===!0||F0(z.options.plain)===!0,J=F0(z.options.save)===!0||F0(z.options.add)===!0;await NT(U,{reveal:Q,save:J,name:S(z.options.name),overwrite:F0(z.options.overwrite)===!0,force:F0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}if($==="keys"){let U=Y??S(z.options.link)??S(z.options.url)??S(z.options.corp),Q=F0(z.options.reveal)===!0||F0(z.options.r)===!0||F0(z.options.plain)===!0;if(U&&(U.startsWith("http://")||U.startsWith("https://"))){let J=F0(z.options.save)===!0||F0(z.options.add)===!0;await NT(U,{reveal:Q,save:J,name:S(z.options.name),overwrite:F0(z.options.overwrite)===!0,force:F0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await xl(U,{reveal:Q});return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function yv0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function eh1($,Y,z,U){if($.source.type!=="hose")return{skipped:!0,reason:"prod source is not hose; no hosecloud creden
Line truncated
|
||||
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);I=Q}else if(I=E1(Q.testCorpId),I.environment!=="test"&&!J)throw Error(`Target enterprise '${I.name}' (${I.id}) is marked as '${I.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let K=S(z.options.recordId)??S(z.options["record-id"])??S(z.options.id),G=S(z.options.recordIds)??S(z.options["record-ids"]),W=G?G.split(",").map((k)=>k.trim()).filter(Boolean):void 0,H=S(z.options.sn)??S(z.options.documentSn)??S(z.options["document-sn"]),X=S(z.options.sns)??S(z.options["document-sns"]),Z=X?X.split(",").map((k)=>k.trim()).filter(Boolean):void 0,q=s0(z.options.limit)??(!K&&!W&&!H&&!Z?1:void 0),V=S(z.options.status),F=S(z.options.startDate)??S(z.options["start-date"]),M=S(z.options.endDate)??S(z.options["end-date"]),w=await j1(Q),O=Q.id===I.id?w:await j1(I),D=S(z.options.webhook)??S(z.options.selector),N=S(z.options.snSuffix)??S(z.options["sn-suffix"]),A=S(z.options.snPrefix)??S(z.options["sn-prefix"]),T=S(z.options.docIdSuffix)??S(z.options["doc-id-suffix"]),B=S(z.options.docIdPrefix)??S(z.options["doc-id-prefix"]),j=F0(z.options.dryRun)??F0(z.options["dry-run"]),C={recordId:K,recordIds:W,sn:H,sns:Z,limit:q,status:V,startDate:F,endDate:M};console.error(`[corps-replay-test] 正式企业「${Q.name}」(${Q.id}) -> 测试企业「${I.name}」(${I.id})`);let b=await sI({query:C,sourceClient:w,targetClient:O,sourceCorp:Q,targetCorp:I,webhookSelector:D,snPrefix:A,snSuffix:N,docIdPrefix:B,docIdSuffix:T,dryRun:j});if(j){console.error(`[corps-replay-test] 预览模式:已成功从 ${Q.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(b,null,2));return}if(b.success)if(b.totalCount===1&&b.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${b.replayedDocument.documentSN}」至 ${I.name} (${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${b.successCount} 条单据(来自「${Q.name}」)至「${I.name}」(${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${b.successCount} 条,失败 ${b.failureCount} 条)至「${I.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${I.id} --limit ${b.totalCount}`),console.log(JSON.stringify(b,null,2)),!b.success)process.exitCode=1;return}if($==="switch"){let U=Y;if(!U)throw Error("Usage: seal-use corps switch <corpId>");let Q=_4();if(!Q.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let J=E1(U);IU({...Q,stateful:!0,defaultCorpId:J.id}),c0({current:!0,id:J.id,name:J.name});return}if($==="probe-hose"){await zS1(y8(z.json));return}if($==="hose-staffs"){await US1(y8(z.json));return}if($==="add-hose"){await kl(y8(z.json));return}if($==="add-seal"){await QS1(y8(z.json));return}if($==="add-link"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--overwrite]");if(F0(z.options["as-hose"])===!0||F0(z.options.hose)===!0){await IS1(U,S(z.options.name),F0(z.options.overwrite)===!0,F0(z.options.force)===!0,{appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await JS1(U,S(z.options.name),F0(z.options.overwrite)===!0);return}if($==="extract-keys"||$==="extract-key"){let U=Y??S(z.options.link)??S(z.options.url);if(!U)throw Error("Usage: seal-use corps extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--app-key <key>] [--key-id <id>] [--name <customName>] [--overwrite]");let Q=F0(z.options.reveal)===!0||F0(z.options.r)===!0||F0(z.options.plain)===!0,J=F0(z.options.save)===!0||F0(z.options.add)===!0;await NT(U,{reveal:Q,save:J,name:S(z.options.name),overwrite:F0(z.options.overwrite)===!0,force:F0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}if($==="keys"){let U=Y??S(z.options.link)??S(z.options.url)??S(z.options.corp),Q=F0(z.options.reveal)===!0||F0(z.options.r)===!0||F0(z.options.plain)===!0;if(U&&(U.startsWith("http://")||U.startsWith("https://"))){let J=F0(z.options.save)===!0||F0(z.options.add)===!0;await NT(U,{reveal:Q,save:J,name:S(z.options.name),overwrite:F0(z.options.overwrite)===!0,force:F0(z.options.force)===!0,appKey:S(z.options["app-key"])??S(z.options.appKey),keyId:S(z.options["key-id"])??S(z.options.keyId)});return}await xl(U,{reveal:Q});return}throw Error(`Unknown corps command: ${$??""}. Run 'seal-use help' for available commands.`)}function kv0($){return[...$].slice(0,6).join("")+"(Seal测)"}async function YS1($,Y,z,U){if($.source.type!=="hose")return{skipped:!0,reason:"prod source is not hose; no hosecloud creden
Line truncated
|
||||
- `);throw Error(`Missing required parameter: staffId. Found ${C.length} candidate administrators:
|
||||
- ${b}
|
||||
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!F)if(!H&&J)F=J;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let M=H4($,"id")??Z,w=q??Z,O=H4($,"sealUrl")??`https://${Z.toLowerCase()}.sealai.cc`,D={id:M,name:w,environment:"production",seal:{url:O,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:X,appKey:z,appSecurity:U,corpId:Z,staffId:F},auth:{refreshTtl:300}};if(H)cw(M),await yK(D);let N=ln();vv0(N,{recursive:!0,mode:448});let A=Sv0(N,`${IT(M)}.json`);if(_v0(A)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${A}. Pass "overwrite": true to replace it.`);hv0(A,`${JSON.stringify(D,null,2)}
|
||||
`,{mode:384}),c0({id:M,name:w,corpId:Z,domain:X,staffId:F,verified:H,path:A})}async function zS1($){let Y=n7($,"token"),z=(H4($,"sealUrl")??H4($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let U=Ll($,"expiresIn")??2592000,Q=$.force===!0||$.verify===!1?!1:!0,J=kv0($),I=Q?await JS1(z,Y,B6(J)):void 0;fv0($,{token:Y,sealUrl:z,expiresIn:U,verify:Q,remote:I,custom:J})}function kv0($){return{headers:cn.parse($.headers),cookies:nn.parse($.cookies)}}async function US1($,Y,z){let U=await nw($),Q=T8(U.sealUrl,U.token),J=await W8(Q),I={user:J.user,tenant:J.tenant};pw(U.corpId,I.tenant),fv0({id:U.corpId,corpId:U.corpId,name:Y,provider:"hosecloud",overwrite:z},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:I})}function xv0($,Y,z,U){if($.length===0)throw Error(`[合思子域提权] 未能从协助链接中提取到合思企业 [${Y}] 的 OpenAPI 密钥凭据。
|
||||
Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an account (or pass force:true to bypass).`)}}}if(!F)if(!H&&J)F=J;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let M=H4($,"id")??Z,w=q??Z,O=H4($,"sealUrl")??`https://${Z.toLowerCase()}.sealai.cc`,D={id:M,name:w,environment:"production",seal:{url:O,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:X,appKey:z,appSecurity:U,corpId:Z,staffId:F},auth:{refreshTtl:300}};if(H)nw(M),await yK(D);let N=ln();hv0(N,{recursive:!0,mode:448});let A=gv0(N,`${IT(M)}.json`);if(vv0(A)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${A}. Pass "overwrite": true to replace it.`);Sv0(A,`${JSON.stringify(D,null,2)}
|
||||
`,{mode:384}),c0({id:M,name:w,corpId:Z,domain:X,staffId:F,verified:H,path:A})}async function QS1($){let Y=n7($,"token"),z=(H4($,"sealUrl")??H4($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let U=Ll($,"expiresIn")??2592000,Q=$.force===!0||$.verify===!1?!1:!0,J=xv0($),I=Q?await KS1(z,Y,B6(J)):void 0;uv0($,{token:Y,sealUrl:z,expiresIn:U,verify:Q,remote:I,custom:J})}function xv0($){return{headers:cn.parse($.headers),cookies:nn.parse($.cookies)}}async function JS1($,Y,z){let U=await pw($),Q=T8(U.sealUrl,U.token),J=await W8(Q),I={user:J.user,tenant:J.tenant};dw(U.corpId,I.tenant),uv0({id:U.corpId,corpId:U.corpId,name:Y,provider:"hosecloud",overwrite:z},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:I})}function fv0($,Y,z,U){if($.length===0)throw Error(`[合思子域提权] 未能从协助链接中提取到合思企业 [${Y}] 的 OpenAPI 密钥凭据。
|
||||
`+"\uD83D\uDCA1 说明:此能力专属于合思 (Hose) 子域,用于将临时会话提权为标准 OpenAPI 开发者接入。需要企业管理员已在合思开放平台创建应用并生成 appKey/appSecurity。");if(z.keyId||z.appKey){let Q=$.find((J)=>z.keyId&&J.id===z.keyId||z.appKey&&J.appKey===z.appKey);if(!Q){console.error(`
|
||||
❌ 未找到指定的合思 OpenAPI 密钥 (${z.appKey??z.keyId})。`),console.error(`ℹ️ 该合思企业当前存在以下 ${$.length} 套候选密钥:`);for(let J of $){let I=J.active?"\uD83D\uDFE2 启用":"⚪ 停用";console.error(` • "${J.name||"未命名应用"}" (appKey: ${J.appKey}, keyId: ${J.id}, 状态: ${I})`)}throw new w4("指定的合思密钥不存在,请从上述候选列表中选择正确的 appKey 或 keyId。",2,`${U} --app-key ${$[0].appKey}`)}return Q}if($.length===1)return $[0];console.error(`
|
||||
ℹ️ [合思子域提权] 合思企业 [${Y}] 存在多套 (${$.length} 套) OpenAPI 应用密钥凭据:`);for(let Q=0;Q<$.length;Q++){let J=$[Q],I=J.active?"\uD83D\uDFE2 启用":"⚪ 停用",K=J.name||"未命名应用";console.error(` [${Q+1}] "${K}" (appKey: ${J.appKey}, keyId: ${J.id}, 状态: ${I})`)}throw console.error(`
|
||||
\uD83D\uDC49 为确保权限提权绑定正确的业务应用,请显式指定要使用的密钥套件:`),console.error(` 在命令后追加 --app-key <key> 或 --key-id <id> 参数。
|
||||
`),new w4(`合思企业 [${Y}] 存在多套 OpenAPI 密钥,必须指定 --app-key 或 --key-id 明确选择要绑定的密钥。`,2,`${U} --app-key ${$[0].appKey}`)}async function QS1($,Y,z,U=!1,Q){console.error("ℹ️ [合思子域提权] 正在通过合思协助链接提取 OpenAPI 开发者密钥并提升企业权限等级...");let J=await ES($),I=xv0(J.keys,J.corpId,Q??{},'seal-use corps add-link "<url>" --as-hose');console.error(`ℹ️ [合思子域提权] 已选定合思 OpenAPI 凭据 (appKey: ${I.appKey}, 应用: "${I.name||"未命名应用"}"),正在初始化为长期合思标准配置...`),await kl({domain:J.baseUrl,appKey:I.appKey,appSecurity:I.appSecurity,corpId:J.corpId,name:Y??J.corpName??J.corpId,staffId:J.staffId,overwrite:z,force:U})}async function NT($,Y){let z=await ES($),U=Y.reveal===!0;if(Y.save){let Q=xv0(z.keys,z.corpId,{appKey:Y.appKey,keyId:Y.keyId},'seal-use corps extract-keys "<url>" --save');console.error(`ℹ️ [合思子域提权] 正在将选定的合思 OpenAPI 密钥 (appKey: ${Q.appKey}, 应用: "${Q.name||"未命名应用"}") 保存为标准合思企业配置...`),await kl({domain:z.baseUrl,appKey:Q.appKey,appSecurity:Q.appSecurity,corpId:z.corpId,name:Y.name??z.corpName??z.corpId,staffId:z.staffId,overwrite:Y.overwrite,force:Y.force});return}if(!U)console.error(`ℹ️ [合思子域提权] 成功提取合思 (Hose) OpenAPI 密钥。接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文;附加 --save 可将临时会话提权并持久化为标准合思企业。
|
||||
`),new w4(`合思企业 [${Y}] 存在多套 OpenAPI 密钥,必须指定 --app-key 或 --key-id 明确选择要绑定的密钥。`,2,`${U} --app-key ${$[0].appKey}`)}async function IS1($,Y,z,U=!1,Q){console.error("ℹ️ [合思子域提权] 正在通过合思协助链接提取 OpenAPI 开发者密钥并提升企业权限等级...");let J=await ES($),I=fv0(J.keys,J.corpId,Q??{},'seal-use corps add-link "<url>" --as-hose');console.error(`ℹ️ [合思子域提权] 已选定合思 OpenAPI 凭据 (appKey: ${I.appKey}, 应用: "${I.name||"未命名应用"}"),正在初始化为长期合思标准配置...`),await kl({domain:J.baseUrl,appKey:I.appKey,appSecurity:I.appSecurity,corpId:J.corpId,name:Y??J.corpName??J.corpId,staffId:J.staffId,overwrite:z,force:U})}async function NT($,Y){let z=await ES($),U=Y.reveal===!0;if(Y.save){let Q=fv0(z.keys,z.corpId,{appKey:Y.appKey,keyId:Y.keyId},'seal-use corps extract-keys "<url>" --save');console.error(`ℹ️ [合思子域提权] 正在将选定的合思 OpenAPI 密钥 (appKey: ${Q.appKey}, 应用: "${Q.name||"未命名应用"}") 保存为标准合思企业配置...`),await kl({domain:z.baseUrl,appKey:Q.appKey,appSecurity:Q.appSecurity,corpId:z.corpId,name:Y.name??z.corpName??z.corpId,staffId:z.staffId,overwrite:Y.overwrite,force:Y.force});return}if(!U)console.error(`ℹ️ [合思子域提权] 成功提取合思 (Hose) OpenAPI 密钥。接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文;附加 --save 可将临时会话提权并持久化为标准合思企业。
|
||||
`);else console.error(`⚠️ [合思子域提权] 正在以明文展示合思 (Hose) appSecurity 接入密码,请妥善保管敏感凭据。
|
||||
`);c0({provider:"hose",capability:"privilege-elevation",corpId:z.corpId,corpName:z.corpName??z.corpId,baseUrl:z.baseUrl,staffId:z.staffId,keyCount:z.keys.length,keys:z.keys.map((Q)=>({id:Q.id,name:Q.name||"-",appKey:Q.appKey,appSecurity:U?Q.appSecurity:jS(Q.appSecurity),active:Q.active,createTime:Q.createTime,updateTime:Q.updateTime}))})}async function xl($,Y){let z=E1($),U=Y.reveal===!0;if(z.source.type!=="hose")throw new w4(`【合思子域专享能力】当前企业「${z.name}」(id: ${z.id}) 为原生 Seal (${z.source.type}) 租户,非合思 (Hose/合思云/易快报) 渠道企业。
|
||||
`+"OpenAPI 密钥查询与提权能力专属于合思生态租户(用于从合思协助链接或合思凭据中提取开发者密钥提升权限等级),非合思渠道企业不支持此能力。",2);let Q=z.source.appKey??z.source.key,J=z.source.appSecurity??z.source.password;if(!U)console.error(`\uD83D\uDCA1 [合思子域] 接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文。
|
||||
`);else console.error(`⚠️ [合思子域] 正在以明文展示合思 appSecurity 接入密码,请妥善保管敏感凭据。
|
||||
`);c0({provider:"hose",capability:"privilege-elevation",corpId:z.id,corpName:z.name,domain:z.source.domain,staffId:z.source.staffId,appKey:Q??"-",appSecurity:J?U?J:jS(J):"-",active:!0})}function fv0($,Y){let{token:z,sealUrl:U,expiresIn:Q,verify:J,remote:I}=Y,K=Y.custom??kv0($),G=I?.user,W=I?.tenant,H=H4($,"tenantSlug")??s2(W?.tenantSlug),X=H4($,"tenantId")??s2(W?.id),Z=H4($,"tenantName")??s2(W?.name),q=H4($,"id")??H??X;if(!q)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=H4($,"staffId")??s2(G?.providerUserId)??s2(G?.id)??"seal",F=H4($,"provider")??s2(G?.provider)??s2(W?.providerConfig?.provider),M=H4($,"corpId")??H??X??q,w={id:q,name:H4($,"name")??Z??q,environment:"production",seal:{url:U,tenantSlug:H,headers:K.headers,cookies:K.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:U,expiresIn:Q,staffId:V,corpId:M,tenantId:X,tenantSlug:H,tenantName:Z,providerUserId:s2(G?.providerUserId),provider:F},auth:{refreshTtl:300}},O=ln();vv0(O,{recursive:!0,mode:448});let D=Sv0(O,`${IT(q)}.json`);if(_v0(D)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${D}. Pass "overwrite": true to replace it.`);hv0(D,`${JSON.stringify(w,null,2)}
|
||||
`,{mode:384}),c0({id:q,name:w.name,tenantId:X,tenantSlug:H,verified:J,path:D})}async function JS1($,Y,z={}){let U=T8($,Y,z),Q=await W8(U);return{user:Q.user??{},tenant:Q.tenant??{}}}function s2($){return typeof $==="string"&&$?$:void 0}var fl=o(()=>{s9();DW();i8();h7();Bv0();tn();dn();X6();X6();gl();CZ();OT();o4();L$();D4();J4()});async function bv0($,Y){let z=$??S(Y.options.link)??S(Y.options.url);if(!z)throw Error("Usage: seal-use auth extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--name <customName>] [--overwrite]");let U=F0(Y.options.reveal)===!0||F0(Y.options.r)===!0||F0(Y.options.plain)===!0,Q=F0(Y.options.save)===!0||F0(Y.options.add)===!0;await NT(z,{reveal:U,save:Q,name:S(Y.options.name),overwrite:F0(Y.options.overwrite)===!0,force:F0(Y.options.force)===!0,appKey:S(Y.options["app-key"])??S(Y.options.appKey),keyId:S(Y.options["key-id"])??S(Y.options.keyId)})}async function iv0($,Y,z){if($==="diagnose"){c0(await IS1(Y));return}if($==="hose-link"){let U=s0(z.options.expire)??7200;c0(await mw(Y,U));return}if($==="keys"){let U=F0(z.options.reveal)===!0||F0(z.options.r)===!0||F0(z.options.plain)===!0;await xl(Y.id,{reveal:U});return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function IS1($){if($.source.type!=="hose"){let F=await j1($),M=await W8(F);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:M.user,tenant:M.tenant}]}}cw($.id);let Y=$.source,z=Y.appKey??Y.key,U=Y.appSecurity??Y.password,Q=($.seal.url??Y.sealUrl??`https://${Y.corpId.toLowerCase()}.sealai.cc`).replace(/\/+$/,""),J=Y.staffId.includes(":")?Y.staffId:`${Y.corpId}:${Y.staffId}`,I=[];if(!z||!U)return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!1,stages:[{name:"hose.openapi",ok:!1,error:"Hose source requires appKey/key and appSecurity/password"}]};let K=await DT("hose.openapi",async()=>{let F=await uv0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1/auth/getAccessToken`,{appKey:z,appSecurity:U}),M=p7(F.value),w=b6(M.accessToken)??b6(F.accessToken)??b6(F.token);if(!w)throw Error("Hose login did not return an access token");return{token:w,public:{corporationId:b6(M.corporationId)??b6(p7(M.corporation).id),expireTime:Mq(M.expireTime)}}});I.push(K.public);let G=K.private?.token,W=G?await DT("hose.provisional",async()=>{let F=await uv0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1.1/provisional/getProvisionalAuth?accessToken=${encodeURIComponent(G)}`,{uid:J,pageType:"home",expireDate:7200}),M=b6(p7(F.value).message);if(!M)throw Error("Hose CloseAPI did not return a provisional auth URL");let w=new URL(M).searchParams.get("accessToken");if(!w)throw Error("Hose provisional auth URL did not include accessToken");return{token:w,public:{uid:J,enterpriseUrl:qq(M)}}}):ul("hose.provisional");I.push(W.public);let H=B6($.seal),X=W.private?.token,Z=X?await DT("seal.sso",async()=>{let M=await T8(Q,void 0,H).get(`api/auth/oauth2/session/oem-hosecloud?token=${encodeURIComponent(X)}&returnToken=1`).json(),w=p7(M.data),O=b6(M.token)??b6(M.accessToken)??b6(w.token)??b6(w.accessToken);if(!O)throw Error("Seal SSO did not return a bearer token");return{token:O,public:{sealUrl:Q,expiresIn:Mq(M.expiresIn)??Mq(M.expires_in)??Mq(w.expiresIn)??Mq(w.expires_in)}}}):ul("seal.sso");I.push(Z.public);let q=Z.private?.token,V=q?await DT("seal.whoami",async()=>{let M=await T8(Q,q,H).get("api/v1/auth/me").json(),w=p7(M.data),O=p7(w.user??M.user),D=p7(w.tenant??M.tenant);return{public:{user:{id:b6(O.id),name:b6(O.name),isAdmin:GS1(O.isAdmin),providerUserId:b6(O.providerUserId)},tenant:{id:b6(D.id),name:b6(D.name),tenantSlug:b6(D.tenantSlug),hoseCorpConfig:WS1(D.hoseCorpConfig)}}}}):ul("seal.whoami");return I.push(V.public),{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:I.every((F)=>F.ok===!0),stages:I}}async function DT($,Y){try{let z=await Y();return{public:{name:$,ok:!0,...cv0(z.public)},private:z.token?{token:z.token}:void 0}}catch(z){return{public:{name:$,ok:!1,error:qq(z instanceof Error?z.message:String(z))}}}}function ul($){return{public:{name:$,ok:!1,skipped:!0}}}async function uv0($,Y){let z=await fetch($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Y)});return KS1(z)}async function KS1($){let Y=await $.text();if(!$.ok)throw Error(`${$.status} ${Y}`);let z=JSON.parse(Y);return p7(z)}function p7($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function b6($){return typeof $==="string"&&$?$:void 0}function Mq($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function GS1($){return typeof $==="boolean"?$:void 0}function WS1($){let Y=p7($);return cv0({corporationId:b6(Y.corporationId),corporationName:b6(Y.corporationName)})}function cv0($){return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0))}var nv0=o(()=>{s9();DW();i8();X6();D4();J4();fl()});async function pv0($,Y,z,U){if($==="status"||$==="get"){await k0("seal_billing_status_get",Y,z,{},C0(U.options)
Line truncated
|
||||
`);c0({provider:"hose",capability:"privilege-elevation",corpId:z.id,corpName:z.name,domain:z.source.domain,staffId:z.source.staffId,appKey:Q??"-",appSecurity:J?U?J:jS(J):"-",active:!0})}function uv0($,Y){let{token:z,sealUrl:U,expiresIn:Q,verify:J,remote:I}=Y,K=Y.custom??xv0($),G=I?.user,W=I?.tenant,H=H4($,"tenantSlug")??s2(W?.tenantSlug),X=H4($,"tenantId")??s2(W?.id),Z=H4($,"tenantName")??s2(W?.name),q=H4($,"id")??H??X;if(!q)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=H4($,"staffId")??s2(G?.providerUserId)??s2(G?.id)??"seal",F=H4($,"provider")??s2(G?.provider)??s2(W?.providerConfig?.provider),M=H4($,"corpId")??H??X??q,w={id:q,name:H4($,"name")??Z??q,environment:"production",seal:{url:U,tenantSlug:H,headers:K.headers,cookies:K.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:U,expiresIn:Q,staffId:V,corpId:M,tenantId:X,tenantSlug:H,tenantName:Z,providerUserId:s2(G?.providerUserId),provider:F},auth:{refreshTtl:300}},O=ln();hv0(O,{recursive:!0,mode:448});let D=gv0(O,`${IT(q)}.json`);if(vv0(D)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${D}. Pass "overwrite": true to replace it.`);Sv0(D,`${JSON.stringify(w,null,2)}
|
||||
`,{mode:384}),c0({id:q,name:w.name,tenantId:X,tenantSlug:H,verified:J,path:D})}async function KS1($,Y,z={}){let U=T8($,Y,z),Q=await W8(U);return{user:Q.user??{},tenant:Q.tenant??{}}}function s2($){return typeof $==="string"&&$?$:void 0}var fl=o(()=>{s9();DW();i8();h7();Pv0();tn();dn();X6();X6();gl();CZ();OT();o4();L$();D4();J4()});async function iv0($,Y){let z=$??S(Y.options.link)??S(Y.options.url);if(!z)throw Error("Usage: seal-use auth extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--name <customName>] [--overwrite]");let U=F0(Y.options.reveal)===!0||F0(Y.options.r)===!0||F0(Y.options.plain)===!0,Q=F0(Y.options.save)===!0||F0(Y.options.add)===!0;await NT(z,{reveal:U,save:Q,name:S(Y.options.name),overwrite:F0(Y.options.overwrite)===!0,force:F0(Y.options.force)===!0,appKey:S(Y.options["app-key"])??S(Y.options.appKey),keyId:S(Y.options["key-id"])??S(Y.options.keyId)})}async function cv0($,Y,z){if($==="diagnose"){c0(await GS1(Y));return}if($==="hose-link"){let U=s0(z.options.expire)??7200;c0(await lw(Y,U));return}if($==="keys"){let U=F0(z.options.reveal)===!0||F0(z.options.r)===!0||F0(z.options.plain)===!0;await xl(Y.id,{reveal:U});return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function GS1($){if($.source.type!=="hose"){let F=await j1($),M=await W8(F);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:M.user,tenant:M.tenant}]}}nw($.id);let Y=$.source,z=Y.appKey??Y.key,U=Y.appSecurity??Y.password,Q=($.seal.url??Y.sealUrl??`https://${Y.corpId.toLowerCase()}.sealai.cc`).replace(/\/+$/,""),J=Y.staffId.includes(":")?Y.staffId:`${Y.corpId}:${Y.staffId}`,I=[];if(!z||!U)return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!1,stages:[{name:"hose.openapi",ok:!1,error:"Hose source requires appKey/key and appSecurity/password"}]};let K=await DT("hose.openapi",async()=>{let F=await bv0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1/auth/getAccessToken`,{appKey:z,appSecurity:U}),M=p7(F.value),w=b6(M.accessToken)??b6(F.accessToken)??b6(F.token);if(!w)throw Error("Hose login did not return an access token");return{token:w,public:{corporationId:b6(M.corporationId)??b6(p7(M.corporation).id),expireTime:Oq(M.expireTime)}}});I.push(K.public);let G=K.private?.token,W=G?await DT("hose.provisional",async()=>{let F=await bv0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1.1/provisional/getProvisionalAuth?accessToken=${encodeURIComponent(G)}`,{uid:J,pageType:"home",expireDate:7200}),M=b6(p7(F.value).message);if(!M)throw Error("Hose CloseAPI did not return a provisional auth URL");let w=new URL(M).searchParams.get("accessToken");if(!w)throw Error("Hose provisional auth URL did not include accessToken");return{token:w,public:{uid:J,enterpriseUrl:Vq(M)}}}):ul("hose.provisional");I.push(W.public);let H=B6($.seal),X=W.private?.token,Z=X?await DT("seal.sso",async()=>{let M=await T8(Q,void 0,H).get(`api/auth/oauth2/session/oem-hosecloud?token=${encodeURIComponent(X)}&returnToken=1`).json(),w=p7(M.data),O=b6(M.token)??b6(M.accessToken)??b6(w.token)??b6(w.accessToken);if(!O)throw Error("Seal SSO did not return a bearer token");return{token:O,public:{sealUrl:Q,expiresIn:Oq(M.expiresIn)??Oq(M.expires_in)??Oq(w.expiresIn)??Oq(w.expires_in)}}}):ul("seal.sso");I.push(Z.public);let q=Z.private?.token,V=q?await DT("seal.whoami",async()=>{let M=await T8(Q,q,H).get("api/v1/auth/me").json(),w=p7(M.data),O=p7(w.user??M.user),D=p7(w.tenant??M.tenant);return{public:{user:{id:b6(O.id),name:b6(O.name),isAdmin:HS1(O.isAdmin),providerUserId:b6(O.providerUserId)},tenant:{id:b6(D.id),name:b6(D.name),tenantSlug:b6(D.tenantSlug),hoseCorpConfig:XS1(D.hoseCorpConfig)}}}}):ul("seal.whoami");return I.push(V.public),{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:I.every((F)=>F.ok===!0),stages:I}}async function DT($,Y){try{let z=await Y();return{public:{name:$,ok:!0,...nv0(z.public)},private:z.token?{token:z.token}:void 0}}catch(z){return{public:{name:$,ok:!1,error:Vq(z instanceof Error?z.message:String(z))}}}}function ul($){return{public:{name:$,ok:!1,skipped:!0}}}async function bv0($,Y){let z=await fetch($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Y)});return WS1(z)}async function WS1($){let Y=await $.text();if(!$.ok)throw Error(`${$.status} ${Y}`);let z=JSON.parse(Y);return p7(z)}function p7($){return $&&typeof $==="object"&&!Array.isArray($)?$:{}}function b6($){return typeof $==="string"&&$?$:void 0}function Oq($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function HS1($){return typeof $==="boolean"?$:void 0}function XS1($){let Y=p7($);return nv0({corporationId:b6(Y.corporationId),corporationName:b6(Y.corporationName)})}function nv0($){return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0))}var pv0=o(()=>{s9();DW();i8();X6();D4();J4();fl()});async function dv0($,Y,z,U){if($==="status"||$==="get"){await k0("seal_billing_status_get",Y,z,{},C0(U.options)
Line truncated
|
||||
|
||||
`+`支持的审批系统与发布目标:
|
||||
`+` • hosecloud (合思费控): seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>
|
||||
@@ -942,11 +942,11 @@ Please specify 'staffId', 'staffName', or 'staffPhone' to explicitly select an a
|
||||
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let W=$==="maycur"?"每刻报销":"汇联易";throw Error(`${W}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${W}' --result-url <url> --corp <corpId>`)}let I=$==="hosecloud",K=$==="hosecloud"?Y:$,G=$==="hosecloud"?z:Y;if(!I)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(K==="requirements"){await k0("seal_deploy_hosecloud_requirements",U,Q,{},C0(J.options));return}if(K==="list"){await k0("seal_deploy_hosecloud_list",U,Q,{},C0(J.options));return}if(K==="get"){let W=G??S(J.options.signKey)??S(J.options["sign-key"]);if(!W){let X=((await o1(U)).integrations??[]).filter((Z)=>Z.type==="hosecloud");if(X.length===0)throw Error(`当前企业 (${Q.name}) 尚未添加合思发布配置。
|
||||
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Q.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${Q.id}]
|
||||
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let Z of X){let q=Z.outboundName??"SealAI 审批",V=Z.signKey,F=Z.apiOrigin??"production";console.error(` • "${q}" (signKey: ${V}, 环境: ${F})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${V} --corp ${Q.id}
|
||||
`)}throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,X.length===1?`seal-use deploy hosecloud get ${X[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_get",U,Q,{signKey:W},C0(J.options));return}if(K==="status"){await k0("seal_deploy_hosecloud_status",U,Q,{},C0(J.options));return}if(K==="configure"){let W=S(J.options.input),H=W?JSON.parse(HS1(W,"utf8")):y8(J.json);if(!H||Object.keys(H).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await k0("seal_deploy_hosecloud_configure",U,Q,{...H,dryRun:F0(J.options.dryRun)??F0(J.options["dry-run"])},C0(J.options));return}if(K==="sync"){let W=G??S(J.options.signKey)??S(J.options["sign-key"]),H=F0(J.options.auto)??F0(J.options.yes);if(!W){let Z=((await o1(U)).integrations??[]).filter((V)=>V.type==="hosecloud");if(Z.length===0)throw Error(`当前企业 (${Q.name}) 尚未添加合思发布配置。
|
||||
`)}throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,X.length===1?`seal-use deploy hosecloud get ${X[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_get",U,Q,{signKey:W},C0(J.options));return}if(K==="status"){await k0("seal_deploy_hosecloud_status",U,Q,{},C0(J.options));return}if(K==="configure"){let W=S(J.options.input),H=W?JSON.parse(ZS1(W,"utf8")):y8(J.json);if(!H||Object.keys(H).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await k0("seal_deploy_hosecloud_configure",U,Q,{...H,dryRun:F0(J.options.dryRun)??F0(J.options["dry-run"])},C0(J.options));return}if(K==="sync"){let W=G??S(J.options.signKey)??S(J.options["sign-key"]),H=F0(J.options.auto)??F0(J.options.yes);if(!W){let Z=((await o1(U)).integrations??[]).filter((V)=>V.type==="hosecloud");if(Z.length===0)throw Error(`当前企业 (${Q.name}) 尚未添加合思发布配置。
|
||||
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Q.id}`);let q=Z[0];if(q&&Z.length===1&&H){let V=q.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${V})`),await k0("seal_deploy_hosecloud_sync",U,Q,{signKey:V},C0(J.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${Q.id}]
|
||||
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let V of Z){let F=V.outboundName??"SealAI 审批",M=V.signKey,w=V.apiOrigin??"production";console.error(` • "${F}" (signKey: ${M}, 环境: ${w})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${M} --corp ${Q.id}
|
||||
`)}if(Z.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${Q.id}
|
||||
`);throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_sync",U,Q,{signKey:W},C0(J.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}var Qh0=o(()=>{o4();D4();J4();X6();L$()});var Ih0=`---
|
||||
`);throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_sync",U,Q,{signKey:W},C0(J.options));return}throw Error(`Unknown deploy hosecloud action: ${K??""}. Available: requirements, list, get, status, configure, sync.`)}var Jh0=o(()=>{o4();D4();J4();X6();L$()});var Kh0=`---
|
||||
name: seal-use
|
||||
description: "v0.10.24: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
|
||||
metadata:
|
||||
@@ -963,7 +963,7 @@ When MCP *is* available, two tools are exposed:
|
||||
- \`seal_cli\` — **read-only only.** Reads tenant state without changing it. It is annotated \`readOnlyHint: true\`, so clients may auto-approve it.
|
||||
- \`seal_cli_write\` — everything that mutates tenant state, publishes configuration, mints credentials, self-updates or starts a server. Annotated \`destructiveHint: true\`; **confirm the exact command with the user before calling it.**
|
||||
|
||||
The boundary is enforced, not merely advertised: \`seal_cli\` refuses any command that is not on its read-only allow-list, and unclassified commands fail closed. A refusal names \`seal_cli_write\` as the follow-up. \`seal-use tool <name>\` is not on the allow-list, so invoke the 98 internal tools through \`seal_cli_write\` only.
|
||||
The boundary is enforced, not merely advertised: \`seal_cli\` refuses any command that is not on its read-only allow-list, and unclassified commands fail closed. A refusal names \`seal_cli_write\` as the follow-up. \`seal-use tool <name>\` is allowed through \`seal_cli\` only for tools the registry classifies as read-only (\`SEAL_READ_ONLY_TOOLS\`); the rest need \`seal_cli_write\`.
|
||||
|
||||
This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.
|
||||
|
||||
@@ -1156,11 +1156,11 @@ seal-use tool seal_approval_search --corp <corpId> --json '{"keywords":["差旅"
|
||||
## Safety
|
||||
|
||||
Rule, document, style preference, and publish actions mutate Seal configuration. Make the target enterprise explicit, show the intended payload, and verify after the write. Never send real \`enterprises/*.json\` files, tokens, signed URLs, or full raw documents to GitHub, tickets, logs, or chat unless the user explicitly requests a safe export.
|
||||
`;var Jh0=()=>{};var Gh0=`interface:
|
||||
`;var Ih0=()=>{};var Wh0=`interface:
|
||||
display_name: "Seal Use"
|
||||
short_description: "Diagnose approval feedback and publish minimal rule fixes"
|
||||
default_prompt: "Use $seal-use to resolve a customer feedback package to the correct tenant, diagnose the approval run, propose a minimal rule diff, and publish only after explicit confirmation."
|
||||
`;var Kh0=()=>{};var Hh0=`# Rule Lightweight Queries
|
||||
`;var Gh0=()=>{};var Xh0=`# Rule Lightweight Queries
|
||||
|
||||
Use this reference when the user wants rule counts, compact rule lists, one rule from a historical version, or approval knowledge search without dumping hundreds of rule descriptions.
|
||||
|
||||
@@ -1271,7 +1271,7 @@ Use current search only when the question is about current draft/current knowled
|
||||
## Output Discipline
|
||||
|
||||
If a rule command would return many descriptions or more than about 20 rules, use \`rules count\`, \`rules list --summary\`, \`fields\`, \`snippetOnly\`, or \`--output-file\`. Use \`--full\` only for deliberate exports.
|
||||
`;var Wh0=()=>{};var Zh0=`# Approval Bad Case Catalog
|
||||
`;var Hh0=()=>{};var qh0=`# Approval Bad Case Catalog
|
||||
|
||||
Use this file only as a comparison catalog after inspecting the current trace. Do not treat any case below as a default diagnosis.
|
||||
|
||||
@@ -1321,7 +1321,7 @@ Important nuance:
|
||||
|
||||
- This is a bad-case pattern, not a general rule that every amount-total dispute is caused by \`pre_analysis\`.
|
||||
- Use it when the current trace shows recognized amounts being excluded downstream or duplicate attachments producing inconsistent conclusions.
|
||||
`;var Xh0=()=>{};var Vh0="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use <command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise the user-level `~/.config/seal-use/enterprises` directory is loaded. A configured\n `testEnterprisesDir` is loaded first for test-tenant workflows. The current working directory's\n `./enterprises` directory is not loaded implicitly.\n- Set `SEAL_USE_ENTERPRISES_DIR` to use one explicit directory instead. Legacy\n `~/.config/seal-home/enterprises` files are migrated to the primary directory when possible.\n\nEnterprise selection is stateless by default. Commands that access an enterprise require\n`--corp <corpId>` unless stateful mode is explicitly enabled:\n\n```bash\nseal-use config mode stateful --corp <corpId>\nseal-use corps switch <corpId>\nseal-use config mode stateless\n```\n\nThe global mode is stored in `~/.config/seal-use/config.json`; set `SEAL_USE_CONFIG_FILE` to\noverride that path. The legacy `current-corp` file is not read.\n\n## Stream & Exit Code Contract\n\n- **`stdout`**: Pure, deterministic JSON for machine/Agent parsing.\n- **`stderr`**: Diagnostics, probing logs, and **Next-Step Command Suggestions** with the stable prefix `👉 Next action: seal-use ...`.\n- **`Exit Code`**: `0` on success; `1` runtime/upstream failure, `2` usage/argument error, `10` explicit destructive-operation confirmation required, `11` missing/invalid authentication, and `12` output protection requiring a compact/file/query alternative.\n\n## Top-Level Commands\n\n```bash\nseal-use version\nseal-use config paths\nseal-use config get\nseal-use config mode <stateful|stateless> [--corp <corpId>]\nseal-use config test-dir [<path>|--clear]\nseal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]\nseal-use rules count [--corp <corpId>]\nseal-use rules list [--summary] [--count] [--limit 20] [--offset 0] [--corp <corpId>]\nseal-use rules clear [--corp <corpId>] [--dry-run|--yes]\nseal-use rules versions [--corp <corpId>]\nseal-use rules version <versionId|versionNumber|latest> [--corp <corpId>]\nseal-use rules get --corp <corpId> --version <number|latest> --code '#0038'\nseal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205\nseal-use rules search <keyword> [--version <versionId|versionNumber|latest>] [--maxResults 20] [--corp <corpId>]\nseal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]\nseal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]\nseal-use rules linters [--corp <corpId>]\nseal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]\nseal-use rules map [--corp <corpId>] [--version <id|num|latest>] [--code <code>]\nseal-use service <start|stop|restart|status|logs> [--port 8787] [--host 127.0.0.1] [--lines 50]\nseal-use http [--port 8787] [--host 127.0.0.1]\nseal-use serve [--port 8787]\nseal-use update [--check] [--force] [--version <v>]\nseal-use update check\nseal-use update changelog [--limit <n>]\nseal-use changelog [--limit <n>]\nseal-use mcp\nseal-use mcp config\nseal-use mcp-config\nseal-use skill dump\nseal-use skill install [--dir <path>|--local]\nseal-use skill status\nseal-use doctor [--quiet]\nseal-use doctor tenant [--corp <corpId>] [--quiet]\nseal-use doctor guide\nseal-use doctor paths\nseal-use test regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips]\nseal-use probe [<corpId>]\nseal-use tools list\nseal-use corps list [query] [--env <production|test>] [--limit <n>] [--all] [--sort <usage|name|id>] [--strict] [--corp <corpId>]\nseal-use corps search <query> [--env <production|test>] [--strict]\nseal-use corps get <corpId>\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\nseal-use corps mark <corpId> --env <production|test> [--confirm]\nseal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]\nseal-use corps unbind-test [<corpId>] [--confirm]\nseal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]\nseal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--force]\nseal-use corps regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips]\nseal-use corps add-hose --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-use corps add-seal --json '{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--app-key <key>] [--key-id <id>] [--overwrite]\nseal-use corps extract-keys <https://.Line truncated
|
||||
`;var Zh0=()=>{};var Lh0="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use <command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise the user-level `~/.config/seal-use/enterprises` directory is loaded. A configured\n `testEnterprisesDir` is loaded first for test-tenant workflows. The current working directory's\n `./enterprises` directory is not loaded implicitly.\n- Set `SEAL_USE_ENTERPRISES_DIR` to use one explicit directory instead. Legacy\n `~/.config/seal-home/enterprises` files are migrated to the primary directory when possible.\n\nEnterprise selection is stateless by default. Commands that access an enterprise require\n`--corp <corpId>` unless stateful mode is explicitly enabled:\n\n```bash\nseal-use config mode stateful --corp <corpId>\nseal-use corps switch <corpId>\nseal-use config mode stateless\n```\n\nThe global mode is stored in `~/.config/seal-use/config.json`; set `SEAL_USE_CONFIG_FILE` to\noverride that path. The legacy `current-corp` file is not read.\n\n## Stream & Exit Code Contract\n\n- **`stdout`**: Pure, deterministic JSON for machine/Agent parsing.\n- **`stderr`**: Diagnostics, probing logs, and **Next-Step Command Suggestions** with the stable prefix `👉 Next action: seal-use ...`.\n- **`Exit Code`**: `0` on success; `1` runtime/upstream failure, `2` usage/argument error, `10` explicit destructive-operation confirmation required, `11` missing/invalid authentication, and `12` output protection requiring a compact/file/query alternative.\n\n## Top-Level Commands\n\n```bash\nseal-use version\nseal-use config paths\nseal-use config get\nseal-use config mode <stateful|stateless> [--corp <corpId>]\nseal-use config test-dir [<path>|--clear]\nseal-use config lint <enable|disable|status> [--linter <name>] [--min-score <score>]\nseal-use rules count [--corp <corpId>]\nseal-use rules list [--summary] [--count] [--limit 20] [--offset 0] [--corp <corpId>]\nseal-use rules clear [--corp <corpId>] [--dry-run|--yes]\nseal-use rules versions [--corp <corpId>]\nseal-use rules version <versionId|versionNumber|latest> [--corp <corpId>]\nseal-use rules get --corp <corpId> --version <number|latest> --code '#0038'\nseal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205\nseal-use rules search <keyword> [--version <versionId|versionNumber|latest>] [--maxResults 20] [--corp <corpId>]\nseal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]\nseal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]\nseal-use rules linters [--corp <corpId>]\nseal-use rules push [--file <path>] [--corp <corpId>] [--publish] [--version-name <name>] [--dry-run|--yes]\nseal-use rules map [--corp <corpId>] [--version <id|num|latest>] [--code <code>]\nseal-use service <start|stop|restart|status|logs> [--port 8787] [--host 127.0.0.1] [--lines 50]\nseal-use http [--port 8787] [--host 127.0.0.1]\nseal-use serve [--port 8787]\nseal-use update [--check] [--force] [--version <v>]\nseal-use update check\nseal-use update changelog [--limit <n>]\nseal-use changelog [--limit <n>]\nseal-use mcp\nseal-use mcp config\nseal-use mcp-config\nseal-use skill dump\nseal-use skill install [--dir <path>|--local]\nseal-use skill status\nseal-use doctor [--quiet]\nseal-use doctor tenant [--corp <corpId>] [--quiet]\nseal-use doctor guide\nseal-use doctor paths\nseal-use test regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips]\nseal-use probe [<corpId>]\nseal-use tools list\nseal-use corps list [query] [--env <production|test>] [--limit <n>] [--all] [--sort <usage|name|id>] [--strict] [--corp <corpId>]\nseal-use corps search <query> [--env <production|test>] [--strict]\nseal-use corps get <corpId>\nseal-use corps current [--corp <corpId>]\nseal-use corps switch <corpId>\nseal-use corps mark <corpId> --env <production|test> [--confirm]\nseal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]\nseal-use corps unbind-test [<corpId>] [--confirm]\nseal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]\nseal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--force]\nseal-use corps regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips]\nseal-use corps add-hose --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-use corps add-seal --json '{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--app-key <key>] [--key-id <id>] [--overwrite]\nseal-use corps extract-keys <https://.Line truncated
|
||||
|
||||
Use this workflow when a customer disputes an AI approval finding about an attachment, invoice, receipt, OCR result, or a UI-highlighted audit result.
|
||||
|
||||
@@ -1542,7 +1542,7 @@ Manual image check:
|
||||
- The customer's objection that they were receipts rather than invoices was reasonable.
|
||||
|
||||
However, the final rejection also had an independent rule-37 reason: payment screenshots totaled 699.48 while reimbursement was 700.00.
|
||||
`;var wh0=()=>{};var Nh0=`# Customer Feedback Rule Remediation
|
||||
`;var Mh0=()=>{};var Dh0=`# Customer Feedback Rule Remediation
|
||||
|
||||
Use this low-freedom workflow when the user provides packaged customer feedback from WeChat, screenshots, rejection notifications, a document number, or expected business behavior and wants diagnosis or an approval-rule change.
|
||||
|
||||
@@ -1712,7 +1712,7 @@ Return a compact report containing:
|
||||
- New version number and version name, if published
|
||||
- Verification result
|
||||
- Whether a regression rerun was performed
|
||||
`;var Oh0=()=>{};var Bh0=`# Enterprise Onboarding
|
||||
`;var Nh0=()=>{};var Ph0=`# Enterprise Onboarding
|
||||
|
||||
Read this reference for first installation, zero configured enterprises, incoming credentials or assistance links, and browser-copied cURL. The goal is to identify the enterprise with the least user effort while keeping authentication material confidential.
|
||||
|
||||
@@ -1900,7 +1900,7 @@ seal-use auth diagnose --corp <discovered-id> # Hose source
|
||||
Report the human enterprise name, identity provider, credential method, and whether verification succeeded. Do not expose internal IDs unless they help with troubleshooting. Do not perform approval, rule, document, simulation, publishing, or other business mutations just because onboarding succeeded; continue only with the user's requested task and its normal confirmation rules.
|
||||
|
||||
If a temporary assistance-link or browser session expires, explain that it must be renewed or recaptured. Recommend standard Hose app credentials when the user needs durable unattended access.
|
||||
`;var Dh0=()=>{};var Ah0=`# Hose Enterprise Auth
|
||||
`;var Bh0=()=>{};var Th0=`# Hose Enterprise Auth
|
||||
|
||||
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
|
||||
|
||||
@@ -1965,7 +1965,7 @@ Important:
|
||||
- \`seal-use auth diagnose\` proves this stage works but redacts the token, so it is not enough when the user needs the actual clickable Hose link.
|
||||
- **Formatting Requirement**: When returning a Hose authorization link to the user, ALWAYS provide BOTH a code block (\` \`\`\`text ... \`\`\` \`) for easy copying without accidental default browser redirection, AND a clickable hyperlink.
|
||||
- If the CLI later provides a dedicated command for this, prefer that command.
|
||||
`;var Ph0=()=>{};var jh0=`# Hose Enterprise Initialization & Automated Discovery
|
||||
`;var Ah0=()=>{};var Eh0=`# Hose Enterprise Initialization & Automated Discovery
|
||||
|
||||
Use this reference for automated Hose/合思 enterprise onboarding, multi-domain probing (including dedicated private cloud domains like 美年大健康), OpenAPI role and staff discovery, and non-TUI safe administrator selection.
|
||||
|
||||
@@ -2071,7 +2071,7 @@ seal-use corps hose-staffs --json '{
|
||||
}'
|
||||
\`\`\`
|
||||
* 直接使用指定 ID 完成接入并进行连通性验证。
|
||||
`;var Th0=()=>{};import{existsSync as bl,mkdirSync as Eh0,rmSync as BS1,writeFileSync as PS1}from"node:fs";import{homedir as Ch0}from"node:os";import{dirname as AS1,join as il}from"node:path";function _h0(){return Rh0["SKILL.md"]||""}function hU(){return il(Ch0(),".agents","skills","seal-use")}function vh0(){return il(Ch0(),".agents","skills","seal-home")}function hh0(){let $=vh0();if(bl($))try{return BS1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function cl($=hU()){hh0(),Eh0($,{recursive:!0});let Y=[];for(let[z,U]of Object.entries(Rh0)){let Q=il($,z);Eh0(AS1(Q),{recursive:!0}),PS1(Q,U,"utf8"),Y.push(z)}return{targetDir:$,files:Y}}function nl(){let $=vh0(),Y=hU(),z=bl($),U=bl(Y);if(z||U)return hh0(),cl(Y),{synced:!0,targetDir:Y};return{synced:!1}}var Rh0;var Oq=o(()=>{Jh0();Kh0();Wh0();Xh0();qh0();Lh0();wh0();Oh0();Dh0();Ph0();Th0();Rh0={"SKILL.md":Ih0,"agents/openai.yaml":Gh0,"references/rule-lightweight.md":Hh0,"references/approval-bad-cases.md":Zh0,"references/cli.md":Vh0,"references/approval-run-lightweight.md":Fh0,"references/approval-attachment-trace.md":Mh0,"references/customer-feedback-rule-remediation.md":Nh0,"references/enterprise-onboarding.md":Bh0,"references/hose-enterprise-auth.md":Ah0,"references/hose-enterprise-init.md":jh0}});function Sh0(){return`# Seal Use 系统架构与运行规范白皮书
|
||||
`;var jh0=()=>{};import{existsSync as bl,mkdirSync as Ch0,rmSync as AS1,writeFileSync as TS1}from"node:fs";import{homedir as Rh0}from"node:os";import{dirname as jS1,join as il}from"node:path";function vh0(){return _h0["SKILL.md"]||""}function hU(){return il(Rh0(),".agents","skills","seal-use")}function hh0(){return il(Rh0(),".agents","skills","seal-home")}function Sh0(){let $=hh0();if(bl($))try{return AS1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function cl($=hU()){Sh0(),Ch0($,{recursive:!0});let Y=[];for(let[z,U]of Object.entries(_h0)){let Q=il($,z);Ch0(jS1(Q),{recursive:!0}),TS1(Q,U,"utf8"),Y.push(z)}return{targetDir:$,files:Y}}function nl(){let $=hh0(),Y=hU(),z=bl($),U=bl(Y);if(z||U)return Sh0(),cl(Y),{synced:!0,targetDir:Y};return{synced:!1}}var _h0;var Nq=o(()=>{Ih0();Gh0();Hh0();Zh0();Vh0();Fh0();Mh0();Nh0();Bh0();Ah0();jh0();_h0={"SKILL.md":Kh0,"agents/openai.yaml":Wh0,"references/rule-lightweight.md":Xh0,"references/approval-bad-cases.md":qh0,"references/cli.md":Lh0,"references/approval-run-lightweight.md":wh0,"references/approval-attachment-trace.md":Oh0,"references/customer-feedback-rule-remediation.md":Dh0,"references/enterprise-onboarding.md":Ph0,"references/hose-enterprise-auth.md":Th0,"references/hose-enterprise-init.md":Eh0}});function gh0(){return`# Seal Use 系统架构与运行规范白皮书
|
||||
|
||||
> 本文档由 \`seal-use\` 单文件二进制程序内嵌提供,纯内存只读,未向用户电脑写入任何临时文件。
|
||||
|
||||
@@ -2124,16 +2124,16 @@ ${ml.map(($)=>`### \`seal-use ${$.domain}\`
|
||||
- **环境自检**:运行 \`seal-use doctor\`,一键检查当前运行时版本、本地目录健康度、企业资产接入数量以及守护服务状态。
|
||||
- **查看企业配置源文件**:运行 \`seal-use corps get <corpId>\`,可直接查看指定企业的本地 JSON 存储绝对路径。
|
||||
- **查阅完整操作手册**:运行 \`seal-use doctor guide\` 随时在离线状态下查看本文档。
|
||||
`}var pl,dl,ml;var ll=o(()=>{pl=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;附带软链接 seal-home -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],dl=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],ml=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search <query>","corps get <corpId>","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、免登 SSO 深度链接",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs url"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合思单据指定、材
Line truncated
|
||||
`)}var kh0=o(()=>{Gp();a9();h7();Oq();ll()});var xh0={};x8(xh0,{formatTenantDoctorDashboard:()=>_S1,diagnoseTenantContract:()=>RS1});async function RS1($,Y){let z=[],U=Y.environment==="test"?"test":"production",Q=U==="test"?Y.prodCorpId:Y.testCorpId,J=U==="test"?"prodParent":"testTarget",I=null,K=null;try{let M=await W8($);if(I=M.user,K=M.tenant,Boolean(I?.isAdmin||I?.permissions?.includes("*")))z.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${I.name??"未知"}」(${I.id??""}),具备完整操作权限`,details:{userId:I.id,userName:I.name,isAdmin:!0,tenantSlug:K?.tenantSlug,permissions:I.permissions}});else z.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${I.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:I.id,userName:I.name,isAdmin:!1,permissions:I.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(M){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let G={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},W={used:0,remaining:0};try{let M=await bY($),w=Array.isArray(M.features)?M.features:[],O=w.find((N)=>N?.code==="ai-approval");if(O){let N=typeof O.balance==="number"?O.balance:0,A=typeof O.deductionAmount==="number"&&O.deductionAmount>0?O.deductionAmount:120,T=Math.floor(N/A);if(G.balance=N,G.deductionAmount=A,G.estimatedRuns=T,N<=0)G.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:N,deductionAmount:A,estimatedRuns:T},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(T<10)G.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${N} 点 (单笔扣除 ${A} 点),仅可支持约 ${T} 笔审核`,details:{balance:N,deductionAmount:A,estimatedRuns:T},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else G.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${N} 点,预估可支持 ${T} 笔审核单据`,details:{balance:N,deductionAmount:A,estimatedRuns:T}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:w.map((N)=>N?.code)}});let D=w.find((N)=>N?.code==="approval-rules");if(D)W.used=typeof D.used==="number"?D.used:0,W.remaining=typeof D.remaining==="number"?D.remaining:0}catch(M){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let H={totalCount:0,activeCount:0,quotaUsed:W.used,quotaRemaining:W.remaining};try{let M=await n6($),w=Array.isArray(M.rules)?M.rules:[];if(H.totalCount=w.length,H.activeCount=w.filter((O)=>O.status==="ACTIVE").length,w.length===0)z.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:U==="test"&&Q?`可运行 seal-use corps sync-test --corp ${Q} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else z.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${H.totalCount} 条规则,其中生效活跃 ${H.activeCount} 条`,details:{totalCount:H.totalCount,activeCount:H.activeCount,quotaUsed:W.used,quotaRemaining:W.remaining}})}catch(M){z.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let X={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let M=await J$($);X.integrationCount=M.length;let w=M.find((O)=>O.name.includes("回放")||O.name.toLowerCase().includes("replay"));if(X.hasReplayChannel=Boolean(w),X.activeWebhookId=w?.id??M[0]?.id,M.length===0)z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:"未配置任何 Webhook 集成通道,执行重放测试时将自动创建临时回放通道",details:{integrationCount:0},recommendation:"可运行 seal-use webhook add --name (回放通道) 手动注册专属通道"});else z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${M.length} 个通道${w?` (含专属回放通道「${w.name}」)`:""}`,details:{integrationCount:M.length,hasR
Line truncated
|
||||
`)}var fh0=o(()=>{X6()});async function uh0($,Y,z){let U=($??Y??"").toLowerCase();if(U==="guide"||U==="doc"||U==="knowledge"||U==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
|
||||
`),console.log(Sh0());return}if(U==="paths"||U==="dirs"||U==="directories"){let I=ol();c0(I.directories);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:I}=await Promise.resolve().then(() => (o4(),$_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),V00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),mR0)),{diagnoseTenantContract:W,formatTenantDoctorDashboard:H}=await Promise.resolve().then(() => (fh0(),xh0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=I(X),q=await K(Z),V=await W(q,Z);if(!(F0(z.options.quiet)||F0(z.options.silent)))console.error(H(V));c0(V);return}let Q=ol();if(!(F0(z.options.quiet)||F0(z.options.silent)))console.error(yh0(Q));c0(Q)}var bh0=o(()=>{kh0();ll();D4();J4()});var ch0;var ih0=o(()=>{ch0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.24",description:`Planned HTTP contract for the seal-use wrapped backend API.
|
||||
`}var pl,dl,ml;var ll=o(()=>{pl=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;附带软链接 seal-home -> seal-use 兼容旧指令。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],dl=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],ml=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search <query>","corps get <corpId>","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、免登 SSO 深度链接",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs url"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合思单据指定、材
Line truncated
|
||||
`)}var xh0=o(()=>{Gp();a9();h7();Nq();ll()});var fh0={};x8(fh0,{formatTenantDoctorDashboard:()=>hS1,diagnoseTenantContract:()=>vS1});async function vS1($,Y){let z=[],U=Y.environment==="test"?"test":"production",Q=U==="test"?Y.prodCorpId:Y.testCorpId,J=U==="test"?"prodParent":"testTarget",I=null,K=null;try{let M=await W8($);if(I=M.user,K=M.tenant,Boolean(I?.isAdmin||I?.permissions?.includes("*")))z.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${I.name??"未知"}」(${I.id??""}),具备完整操作权限`,details:{userId:I.id,userName:I.name,isAdmin:!0,tenantSlug:K?.tenantSlug,permissions:I.permissions}});else z.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${I.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:I.id,userName:I.name,isAdmin:!1,permissions:I.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(M){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let G={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},W={used:0,remaining:0};try{let M=await bY($),w=Array.isArray(M.features)?M.features:[],O=w.find((N)=>N?.code==="ai-approval");if(O){let N=typeof O.balance==="number"?O.balance:0,A=typeof O.deductionAmount==="number"&&O.deductionAmount>0?O.deductionAmount:120,T=Math.floor(N/A);if(G.balance=N,G.deductionAmount=A,G.estimatedRuns=T,N<=0)G.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:N,deductionAmount:A,estimatedRuns:T},recommendation:"请联系管理员为企业充值 AI 审批额度"});else if(T<10)G.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${N} 点 (单笔扣除 ${A} 点),仅可支持约 ${T} 笔审核`,details:{balance:N,deductionAmount:A,estimatedRuns:T},recommendation:"建议在发起大规模自动化回归前充值补充额度"});else G.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${N} 点,预估可支持 ${T} 笔审核单据`,details:{balance:N,deductionAmount:A,estimatedRuns:T}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:w.map((N)=>N?.code)}});let D=w.find((N)=>N?.code==="approval-rules");if(D)W.used=typeof D.used==="number"?D.used:0,W.remaining=typeof D.remaining==="number"?D.remaining:0}catch(M){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let H={totalCount:0,activeCount:0,quotaUsed:W.used,quotaRemaining:W.remaining};try{let M=await n6($),w=Array.isArray(M.rules)?M.rules:[];if(H.totalCount=w.length,H.activeCount=w.filter((O)=>O.status==="ACTIVE").length,w.length===0)z.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:U==="test"&&Q?`可运行 seal-use corps sync-test --corp ${Q} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else z.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${H.totalCount} 条规则,其中生效活跃 ${H.activeCount} 条`,details:{totalCount:H.totalCount,activeCount:H.activeCount,quotaUsed:W.used,quotaRemaining:W.remaining}})}catch(M){z.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let X={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let M=await J$($);X.integrationCount=M.length;let w=M.find((O)=>O.name.includes("回放")||O.name.toLowerCase().includes("replay"));if(X.hasReplayChannel=Boolean(w),X.activeWebhookId=w?.id??M[0]?.id,M.length===0)z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"warn",summary:"未配置任何 Webhook 集成通道,执行重放测试时将自动创建临时回放通道",details:{integrationCount:0},recommendation:"可运行 seal-use webhook add --name (回放通道) 手动注册专属通道"});else z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:`Webhook 集成通道就绪:共 ${M.length} 个通道${w?` (含专属回放通道「${w.name}」)`:""}`,details:{integrationCount:M.length,hasR
Line truncated
|
||||
`)}var uh0=o(()=>{X6()});async function bh0($,Y,z){let U=($??Y??"").toLowerCase();if(U==="guide"||U==="doc"||U==="knowledge"||U==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
|
||||
`),console.log(gh0());return}if(U==="paths"||U==="dirs"||U==="directories"){let I=ol();c0(I.directories);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:I}=await Promise.resolve().then(() => (o4(),Y_0)),{createSealClient:K}=await Promise.resolve().then(() => (i8(),V00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),lR0)),{diagnoseTenantContract:W,formatTenantDoctorDashboard:H}=await Promise.resolve().then(() => (uh0(),fh0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=I(X),q=await K(Z),V=await W(q,Z);if(!(F0(z.options.quiet)||F0(z.options.silent)))console.error(H(V));c0(V);return}let Q=ol();if(!(F0(z.options.quiet)||F0(z.options.silent)))console.error(kh0(Q));c0(Q)}var ih0=o(()=>{xh0();ll();D4();J4()});var nh0;var ch0=o(()=>{nh0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.24",description:`Planned HTTP contract for the seal-use wrapped backend API.
|
||||
|
||||
These endpoints describe the intended stable API for frontend developers and agents once
|
||||
the HTTP adapter is implemented.
|
||||
They are not the raw downstream Seal endpoints. seal-use is responsible for enterprise
|
||||
selection, source authentication, response compaction, and diagnostics-friendly fields.
|
||||
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"2
Line truncated
|
||||
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"2
Line truncated
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
@@ -2157,24 +2157,24 @@ selection, source authentication, response compaction, and diagnostics-friendly
|
||||
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
|
||||
></script>
|
||||
</body>
|
||||
</html>`}var dh0=o(()=>{a9()});import{URL as hS1}from"node:url";async function _6($,Y,z,U){let Q=$.handler;return Q(Y,z,{corp:U})}async function mh0($,Y){if(Y.setHeader("Access-Control-Allow-Origin","*"),Y.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),Y.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){Y.writeHead(204),Y.end();return}let z=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",Q=new hS1($.url||"/",`${U}://${z}`),J=Q.pathname.replace(/\/+$/,"")||"/",I=($.method||"GET").toUpperCase();try{if(I==="GET"&&J==="/"){B4(Y,200,{name:"seal-use",version:P1,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(I==="GET"&&J==="/docs"){gS1(Y,200,ph0());return}if(I==="GET"&&J==="/openapi.json"){B4(Y,200,PT());return}if(I==="GET"&&J==="/health"){B4(Y,200,{status:"ok",version:P1,name:"seal-use",timestamp:new Date().toISOString()});return}if(I==="POST"&&(J==="/shutdown"||J==="/api/shutdown")){B4(Y,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(I==="POST"&&J==="/api/cli"){let K=await TT($),G=(typeof K?.command==="string"?K.command:"").trim();if(!G){AT(Y,400,"Missing 'command' property in request body");return}let W=Nq(G),H=W[0]==="seal-use"||W[0]==="seal-home"||W[0]?.endsWith("/seal-use")||W[0]?.endsWith("/seal-home")?W.slice(1):W,X=await Dq(H),Z=void 0;try{if(X.stdout.trim().startsWith("{")||X.stdout.trim().startsWith("["))Z=JSON.parse(X.stdout)}catch{}B4(Y,X.isError?400:200,{success:!X.isError,stdout:X.stdout,stderr:X.stderr,exitCode:X.exitCode,data:Z});return}if(I==="POST"&&J.startsWith("/api/tool/")){let K=J.slice(10).trim(),G=M6(K);if(!G){AT(Y,404,`Tool not found: '${K}'`);return}let W=await TT($)||{},H=k8($,Q,W),X=E1(H),Z=await j1(X),q={...W};delete q.corp;let V=await _6(G,Z,q,X);B4(Y,200,V);return}if(J.startsWith("/v1/")){if(await SS1($,Y,I,J,Q))return}AT(Y,404,`Cannot ${I} ${J}. Visit /docs for available endpoints.`)}catch(K){let G=K instanceof Error?K.message:String(K);AT(Y,500,G)}}async function SS1($,Y,z,U,Q){let J=Object.fromEntries(Q.searchParams.entries());if(z==="GET"&&U==="/v1/corps"){let I=s8(),K=_4();return B4(Y,200,{count:I.length,mode:K.stateful?"stateful":"stateless",defaultCorpId:K.defaultCorpId,corps:I.map((G)=>({id:G.id,name:G.name,sourceType:G.source.type,sealUrl:G.seal?.url}))}),!0}if(z==="GET"&&U==="/v1/whoami"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_whoami"),H=await _6(W,G,{},K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/session"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_session_get"),H=await _6(W,G,{},K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/summary"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_runs_summary"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/stats"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_runs_stats"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/pick"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_run_pick"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/url"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_run_url_get"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(U.startsWith("/v1/approval-runs/")){let I=U.slice(18).split("/"),K=I[0],G=I[1];if(K&&!["summary","pick","stats","url","bridge"].includes(K)){let W=k8($,Q,J),H=E1(W),X=await j1(H);if(!G){let Z=M6("seal_approval_run_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}if(G==="attachments"){let Z=M6("seal_approval_run_attachments_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}if(G==="cited-rules"){let Z=M6("seal_approval_run_cited_rules_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}if(G==="document-summary"){let Z=M6("seal_approval_run_document_summary_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}if(G==="result"){let Z=M6("seal_approval_run_result_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}}}if(z==="GET"&&U==="/v1/approval-runs"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_runs_search"),H=await _6(W,G,{...J,limit:J.limit?Number(J.limit):void 0,offset:J.offset?Number(J.offset):void 0,includeBridge:J.includeBridge==="true"},K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval/rules"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_rules_list"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/simulation/batches"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_simulation_batches_list"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="POST"&&U==="/v1/simulation/create-batchLine truncated
|
||||
</html>`}var mh0=o(()=>{a9()});import{URL as gS1}from"node:url";async function _6($,Y,z,U){let Q=$.handler;return Q(Y,z,{corp:U})}async function lh0($,Y){if(Y.setHeader("Access-Control-Allow-Origin","*"),Y.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),Y.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){Y.writeHead(204),Y.end();return}let z=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",Q=new gS1($.url||"/",`${U}://${z}`),J=Q.pathname.replace(/\/+$/,"")||"/",I=($.method||"GET").toUpperCase();try{if(I==="GET"&&J==="/"){B4(Y,200,{name:"seal-use",version:P1,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(I==="GET"&&J==="/docs"){kS1(Y,200,dh0());return}if(I==="GET"&&J==="/openapi.json"){B4(Y,200,PT());return}if(I==="GET"&&J==="/health"){B4(Y,200,{status:"ok",version:P1,name:"seal-use",timestamp:new Date().toISOString()});return}if(I==="POST"&&(J==="/shutdown"||J==="/api/shutdown")){B4(Y,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(I==="POST"&&J==="/api/cli"){let K=await TT($),G=(typeof K?.command==="string"?K.command:"").trim();if(!G){AT(Y,400,"Missing 'command' property in request body");return}let W=Dq(G),H=W[0]==="seal-use"||W[0]==="seal-home"||W[0]?.endsWith("/seal-use")||W[0]?.endsWith("/seal-home")?W.slice(1):W,X=await Bq(H),Z=void 0;try{if(X.stdout.trim().startsWith("{")||X.stdout.trim().startsWith("["))Z=JSON.parse(X.stdout)}catch{}B4(Y,X.isError?400:200,{success:!X.isError,stdout:X.stdout,stderr:X.stderr,exitCode:X.exitCode,data:Z});return}if(I==="POST"&&J.startsWith("/api/tool/")){let K=J.slice(10).trim(),G=M6(K);if(!G){AT(Y,404,`Tool not found: '${K}'`);return}let W=await TT($)||{},H=k8($,Q,W),X=E1(H),Z=await j1(X),q={...W};delete q.corp;let V=await _6(G,Z,q,X);B4(Y,200,V);return}if(J.startsWith("/v1/")){if(await yS1($,Y,I,J,Q))return}AT(Y,404,`Cannot ${I} ${J}. Visit /docs for available endpoints.`)}catch(K){let G=K instanceof Error?K.message:String(K);AT(Y,500,G)}}async function yS1($,Y,z,U,Q){let J=Object.fromEntries(Q.searchParams.entries());if(z==="GET"&&U==="/v1/corps"){let I=s8(),K=_4();return B4(Y,200,{count:I.length,mode:K.stateful?"stateful":"stateless",defaultCorpId:K.defaultCorpId,corps:I.map((G)=>({id:G.id,name:G.name,sourceType:G.source.type,sealUrl:G.seal?.url}))}),!0}if(z==="GET"&&U==="/v1/whoami"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_whoami"),H=await _6(W,G,{},K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/session"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_session_get"),H=await _6(W,G,{},K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/summary"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_runs_summary"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/stats"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_runs_stats"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/pick"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_run_pick"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/url"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_run_url_get"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(U.startsWith("/v1/approval-runs/")){let I=U.slice(18).split("/"),K=I[0],G=I[1];if(K&&!["summary","pick","stats","url","bridge"].includes(K)){let W=k8($,Q,J),H=E1(W),X=await j1(H);if(!G){let Z=M6("seal_approval_run_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}if(G==="attachments"){let Z=M6("seal_approval_run_attachments_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}if(G==="cited-rules"){let Z=M6("seal_approval_run_cited_rules_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}if(G==="document-summary"){let Z=M6("seal_approval_run_document_summary_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}if(G==="result"){let Z=M6("seal_approval_run_result_get"),q=await _6(Z,X,{recordId:K,...J},H);return B4(Y,200,q),!0}}}if(z==="GET"&&U==="/v1/approval-runs"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_runs_search"),H=await _6(W,G,{...J,limit:J.limit?Number(J.limit):void 0,offset:J.offset?Number(J.offset):void 0,includeBridge:J.includeBridge==="true"},K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval/rules"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_approval_rules_list"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="GET"&&U==="/v1/simulation/batches"){let I=k8($,Q,J),K=E1(I),G=await j1(K),W=M6("seal_simulation_batches_list"),H=await _6(W,G,J,K);return B4(Y,200,H),!0}if(z==="POST"&&U==="/v1/simulation/create-batchLine truncated
|
||||
\uD83D\uDE80 seal-use HTTP Server (v${P1}) started`),console.error(` URL: http://${z}:${Y}`),console.error(` Docs: http://${z}:${Y}/docs`),console.error(` OpenAPI: http://${z}:${Y}/openapi.json`),console.error(` CLI Exec: POST http://${z}:${Y}/api/cli`),console.error(` REST API: http://${z}:${Y}/v1/...
|
||||
`);Q(U)})})}var jT=8787,ET="127.0.0.1";var al=o(()=>{lh0();a9()});async function oh0($){let Y=s0($.options.port)??s0($.options.p),z=S($.options.host)??S($.options.h),U=await CT({port:Y,host:z}),Q=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",Q),process.on("SIGTERM",Q),await new Promise(()=>{})}var rh0=o(()=>{D4();al()});async function sh0($,Y,z,U){if($==="config"||$==="get"){await k0("seal_llm_config_get",Y,z,{},C0(U.options));return}if($==="providers"||$==="list"){await k0("seal_llm_providers_list",Y,z,{},C0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}var ah0=o(()=>{o4();J4()});async function th0($,Y){if($==="config"||$==="json"){tl();return}let{startServer:z}=await YS0().then(() => $S0);z()}function tl(){c0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}var eh0=o(()=>{J4()});function zS0($){let Y=PT();c0(Y,{...C0($.options),allowFull:!0})}var US0=o(()=>{rl();J4()});async function QS0($,Y,z,U){if($==="available"){await k0("seal_permissions_available_list",Y,z,{},C0(U.options));return}if($==="configs"||$==="list"){await k0("seal_permissions_configs_list",Y,z,{},C0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}var JS0=o(()=>{o4();J4()});import{readFileSync as IS0}from"node:fs";async function KS0($,Y,z,U,Q,J,I){if(!$||$==="get"){await k0("seal_preference_get",Q,J,{},C0(I.options));return}if($==="decision"){if(Y==="update"||!Y){let K=S(I.options.input),G=K?JSON.parse(IS0(K,"utf8")):y8(I.json);if(!G||Object.keys(G).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await k0("seal_preference_decision_update",Q,J,{...G,dryRun:F0(I.options.dryRun)??F0(I.options["dry-run"])},C0(I.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(Y==="set"){let K=S(I.options.default)??S(I.options.level)??U;if(K!=="medium"&&K!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await k0("seal_preference_thinking_depth_set",Q,J,{defaultLevel:K,dryRun:F0(I.options.dryRun)??F0(I.options["dry-run"])},C0(I.options));return}if(Y==="policies"){if(z==="list"||!z){await k0("seal_preference_thinking_depth_policies_list",Q,J,{},C0(I.options));return}if(z==="upsert"){let K=S(I.options.input),G=K?JSON.parse(IS0(K,"utf8")):y8(I.json);if(!G||!G.id||!G.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await k0("seal_preference_thinking_depth_policies_upsert",Q,J,{...G,dryRun:F0(I.options.dryRun)??F0(I.options["dry-run"])},C0(I.options));return}if(z==="remove"||z==="delete"){let K=U??S(I.options.id)??S(I.options.policyId);if(!K)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await k0("seal_preference_thinking_depth_policies_remove",Q,J,{policyId:K,dryRun:F0(I.options.dryRun)??F0(I.options["dry-run"])},C0(I.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}var GS0=o(()=>{o4();D4();J4()});async function WS0($={}){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},v7());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let Q=await yK(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(Q,null,2));let J=await j1(U),I=await HM(J,{documentLimit:20,stylePreferencesEndpoint:U.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:I.rules.rules.length,hasPendingRuleDeletes:I.rules.hasPendingDeletes,documents:I.documents.articles.length,documentsTotal:I.documents.total,stylePreferences:I.stylePreferences.ok?"ok":`error: ${I.stylePreferences.error}`},null,2))}var HS0=o(()=>{h7();i8();OT();X6()});async function XS0($,Y,z){let U=Y??S(z.options.corp)??($&&$!=="--corp"?$:void 0);await WS0({corpId:U})}var ZS0=o(()=>{HS0();D4()});async function el($,Y,z,U,Q){if($==="count"){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(Q.options));return}if($==="list"){if(F0(Q.options.count)){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(Q.options));return}let J=s0(Q.options.limit),I=s0(Q.options.offset);if(F0(Q.options.summary)){await k0("seal_approval_rules_list",z,U,{fields:aR0,limit:J,offset:I},C0(Q.options));return}let K=await o2("seal_approval_rules_list",z,U,{limit:J,offset:I});tR0(K,F0(Q.options.full)===!0),c0(K);return}if($==="clear"){let J=F0(Q.options.yes)===!0,I=F0(Q.options.dryRun)??F0(Q.options["dry-run"])??!J;if(!J&&!I)throw N9("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${U.id} --dry-run`);let K=await o2("seal_approval_rules_clear",z,U,{dryRun:I,recode:F0(Q.options.recode)});if(!J&&I&&K&&typeof K==="object"){c0({...K,
Line truncated
|
||||
`).filter(Boolean),J=Q.slice(-Y);return{logFile:z,lines:J,totalLines:Q.length}}async function bS1($){let Y=hT($),z=zo($),U=Bq($);wS0($.stateDir);let Q=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):jT),J=$.host??(process.env.HOST?process.env.HOST:ET);_T(Y,`${process.pid}
|
||||
`,{mode:384}),_T(z,JSON.stringify({pid:process.pid,port:Q,host:J,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),kK(U,`service starting on http://${J}:${Q} pid=${process.pid}`);let I=null;try{I=await CT({port:Q,host:J,silent:!0}),kK(U,`service listening pid=${process.pid}`)}catch(G){if(kK(U,`service failed to bind port ${Q}: ${G instanceof Error?G.message:String(G)}`),vT(Y)===process.pid)_9(Y,{force:!0}),_9(z,{force:!0});throw G}let K=()=>{if(I)I.close(),I=null;if(vT(Y)===process.pid)_9(Y,{force:!0}),_9(z,{force:!0});kK(U,`stopped pid=${process.pid}`)};await new Promise((G)=>{let W=!1,H=()=>{if(W)return;W=!0,K(),process.off("SIGTERM",H),process.off("SIGINT",H),G()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function VS0($){wS0($.stateDir);let Y=xK($);if(Y.running)return Y;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},U=[...z.args??[],"service","run"];if($.port)U.push("--port",String($.port));if($.host)U.push("--host",String($.host));let Q=kS1(z.command,U,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});Q.unref();let J=hT($);return _T(J,`${Q.pid}
|
||||
`,{mode:384}),kK(Bq($),`started pid=${Q.pid}`),{started:!0,...xK($)}}function LS0($,Y={}){let z=hT($),U=zo($),Q=vT(z);if(!Q||!FS0(Q,$.appRoot))return _9(z,{force:!0}),_9(U,{force:!0}),Y.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(Q,"SIGTERM"),_9(z,{force:!0}),_9(U,{force:!0}),kK(Bq($),`stop requested pid=${Q}`),Y.quiet?void 0:{stopped:!0,pid:Q}}function FS0($,Y){if(!iS1($))return!1;try{let z=xS1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(z.includes(Y)||z.includes("seal-use")||z.includes("src/cli.ts"))&&z.includes("service")&&z.includes("run")}catch{return!1}}function iS1($){try{return process.kill($,0),!0}catch{return!1}}function hT($){return Yo($.stateDir,"service.pid")}function zo($){return Yo($.stateDir,"service.json")}function Bq($){return Yo($.stateDir,"service.log")}function vT($){if(!RT($))return;let Y=Number($o($,"utf8").trim());return Number.isInteger(Y)&&Y>0?Y:void 0}function wS0($){fS1($,{recursive:!0,mode:448})}function kK($,Y){_T($,`${new Date().toISOString()} ${Y}
|
||||
`,{flag:"a",mode:384})}var Uo=o(()=>{al()});import{homedir as cS1}from"node:os";import{join as nS1}from"node:path";async function Jo($,Y,z){let U=z?s0(z.options.port)??s0(z.options.p):void 0,Q=z?S(z.options.host)??S(z.options.h):void 0,J=z?s0(z.options.lines)??s0(z.options.n):void 0,I=await SU($,{appRoot:Y.appRoot,entryFile:Y.entryFile,stateDir:Qo,version:P1,launcher:Y.launcher,port:U,host:Q},{maxLines:J});if(I!==void 0)c0(I)}var Qo;var Io=o(()=>{a9();Uo();J4();D4();Qo=nS1(cS1(),".config","seal-use")});import{existsSync as pS1,readFileSync as MS0}from"node:fs";async function OS0($,Y,z,U,Q){if($==="batch-records"||$==="records"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation batch-records <batchId>");await k0("seal_simulation_batch_records_get",z,U,{batchId:J,query:S(Q.options.query)},C0(Q.options));return}if($==="create"||$==="run"){let J=S(Q.options.mode)??S(Q.options.sourceSystem)??S(Q.options["source-system"])??"hosecloud",I=J==="material-pack"?"material_pack":J,K=S(Q.options.schemaConfig)??S(Q.options["schema-config"]),G=K?JSON.parse(MS0(K,"utf8")):void 0,W=S(Q.options.input),H=W?JSON.parse(MS0(W,"utf8")):y8(Q.json),X=S(Q.options.packageId)??S(Q.options["package-id"]),Z=u6(Q.options.packageIds)??u6(Q.options["package-ids"])??(X?[X]:void 0),q=u6(Q.options.flowIds)??u6(Q.options["flow-ids"])??u6(Q.options.documentSn)??u6(Q.options["document-sn"]),V=S(Q.options.signKey)??S(Q.options["sign-key"])??S(Q.options.integration),F=F0(Q.options.noWait)??F0(Q.options["no-wait"]);await k0("seal_simulation_batch_create",z,U,{mode:I,sourceSystem:I,flowIds:q,documentSn:q,rejectNodeName:S(Q.options.rejectNode)??S(Q.options["reject-node"])??null,thinkingDepthOverride:S(Q.options.thinkingDepth)??S(Q.options["thinking-depth"]),skipInvoiceGeneration:F0(Q.options.skipInvoiceGeneration)??F0(Q.options["skip-invoice-generation"]),skipExpenseExtraction:F0(Q.options.skipExpenseExtraction)??F0(Q.options["skip-expense-extraction"]),disableAttachmentCache:F0(Q.options.disableAttachmentCache)??F0(Q.options["disable-attachment-cache"]),signKey:V,packageIds:Z,packageId:X,templateId:S(Q.options.templateId)??S(Q.options["template-id"]),schemaConfig:G,requestIds:u6(Q.options.requestIds)??u6(Q.options["request-ids"]),workflowTypeId:S(Q.options.workflowTypeId)??S(Q.options["workflow-type-id"]),flowStatusList:u6(Q.options.flowStatusList)?.map(Number)??u6(Q.options["flow-status-list"])?.map(Number),businessCodes:u6(Q.options.businessCodes)??u6(Q.options["business-codes"]),documentType:S(Q.options.documentType)??S(Q.options["document-type"]),startTime:s0(Q.options.startTime)??s0(Q.options["start-time"]),endTime:s0(Q.options.endTime)??s0(Q.options["end-time"]),status:u6(Q.options.status),limit:s0(Q.options.limit),noWait:F,rawParams:H},C0(Q.options));return}if($==="wait"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await k0("seal_simulation_batch_wait",z,U,{batchId:J,timeout:S(Q.options.timeout),pollInterval:S(Q.options.pollInterval)??S(Q.options["poll-interval"])},C0(Q.options));return}if($==="status"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation status <batchId>");await k0("seal_simulation_batch_status",z,U,{batchId:J},C0(Q.options));return}if($==="clean"||$==="delete"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation clean <batchId>");await k0("seal_simulation_batch_clean",z,U,{batchId:J},C0(Q.options));return}if($==="specifications"){let J=Y??S(Q.options.integration)??S(Q.options.signKey)??S(Q.options["sign-key"]);await k0("seal_simulation_specifications_list",z,U,{signKey:J},C0(Q.options));return}if($==="approval-definitions"||$==="definitions"){await k0("seal_simulation_feishu_approval_definitions_list",z,U,{},C0(Q.options));return}if($==="list"){await k0("seal_simulation_batches_list",z,U,{limit:s0(Q.options.limit)},C0(Q.options));return}if($==="get"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation get <batchId>");await k0("seal_simulation_batch_get",z,U,{batchId:J},C0(Q.options));return}if($==="templates"){await k0("seal_simulation_templates_get",z,U,{},C0(Q.options));return}if($==="integrations"){await k0("seal_simulation_integrations_get",z,U,{},C0(Q.options));return}if($==="package-upload"){let J=Y??S(Q.options.file);if(!J)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!pS1(J))throw Error(`File not found: ${J}`);await k0("seal_simulation_material_package_upload",z,U,{filePath:J},C0(Q.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}var NS0=o(()=>{o4();D4();J4()});import{existsSync as DS0}from"node:fs";import{join as ST}from"node:path";function BS0($,Y,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${_hLine truncated
|
||||
`);return}if($==="install"||$==="init"||$==="sync"){let U=F0(z.options.local)||F0(z.options.workspace),Q=S(z.options.dir)??S(z.options.target)??Y,J=Q?Q:U?ST(process.cwd(),".agents","skills","seal-use"):hU(),I=cl(J);c0({installed:!0,targetDir:I.targetDir,fileCount:I.files.length,files:I.files});return}if($==="status"||$==="get"||!$){let U=hU(),Q=ST(process.cwd(),".agents","skills","seal-use");c0({global:{dir:U,installed:DS0(ST(U,"SKILL.md"))},local:{dir:Q,installed:DS0(ST(Q,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}var PS0=o(()=>{Oq();D4();J4()});async function AS0($,Y){if($==="config"){c0(await yK(Y));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}var TS0=o(()=>{OT();J4()});function Ko($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let Y=$.toUpperCase().trim();if(Y==="APPROVE"||Y==="PASS")return"APPROVE";if(Y==="REJECT"||Y==="DENIED")return"REJECT";if(Y==="MANUAL"||Y==="ASSISTED")return"MANUAL";if(Y==="ERROR"||Y==="FAILED")return"ERROR";return Y}async function jS0($){let{sourceCorp:Y,targetCorp:z,sourceClient:U,targetClient:Q,samples:J=10,dryRun:I=!1,pollIntervalMs:K=2000,timeoutMs:G=45000,snPrefix:W="REG_",fetchFn:H=fetch}=$;if(z.environment!=="test")throw new w4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
|
||||
`);Q(U)})})}var jT=8787,ET="127.0.0.1";var al=o(()=>{oh0();a9()});async function rh0($){let Y=s0($.options.port)??s0($.options.p),z=S($.options.host)??S($.options.h),U=await CT({port:Y,host:z}),Q=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",Q),process.on("SIGTERM",Q),await new Promise(()=>{})}var sh0=o(()=>{D4();al()});async function ah0($,Y,z,U){if($==="config"||$==="get"){await k0("seal_llm_config_get",Y,z,{},C0(U.options));return}if($==="providers"||$==="list"){await k0("seal_llm_providers_list",Y,z,{},C0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}var th0=o(()=>{o4();J4()});async function eh0($,Y){if($==="config"||$==="json"){tl();return}let{startServer:z}=await zS0().then(() => YS0);z()}function tl(){c0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}var $S0=o(()=>{J4()});function US0($){let Y=PT();c0(Y,{...C0($.options),allowFull:!0})}var QS0=o(()=>{rl();J4()});async function JS0($,Y,z,U){if($==="available"){await k0("seal_permissions_available_list",Y,z,{},C0(U.options));return}if($==="configs"||$==="list"){await k0("seal_permissions_configs_list",Y,z,{},C0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}var IS0=o(()=>{o4();J4()});import{readFileSync as KS0}from"node:fs";async function GS0($,Y,z,U,Q,J,I){if(!$||$==="get"){await k0("seal_preference_get",Q,J,{},C0(I.options));return}if($==="decision"){if(Y==="update"||!Y){let K=S(I.options.input),G=K?JSON.parse(KS0(K,"utf8")):y8(I.json);if(!G||Object.keys(G).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await k0("seal_preference_decision_update",Q,J,{...G,dryRun:F0(I.options.dryRun)??F0(I.options["dry-run"])},C0(I.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(Y==="set"){let K=S(I.options.default)??S(I.options.level)??U;if(K!=="medium"&&K!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await k0("seal_preference_thinking_depth_set",Q,J,{defaultLevel:K,dryRun:F0(I.options.dryRun)??F0(I.options["dry-run"])},C0(I.options));return}if(Y==="policies"){if(z==="list"||!z){await k0("seal_preference_thinking_depth_policies_list",Q,J,{},C0(I.options));return}if(z==="upsert"){let K=S(I.options.input),G=K?JSON.parse(KS0(K,"utf8")):y8(I.json);if(!G||!G.id||!G.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await k0("seal_preference_thinking_depth_policies_upsert",Q,J,{...G,dryRun:F0(I.options.dryRun)??F0(I.options["dry-run"])},C0(I.options));return}if(z==="remove"||z==="delete"){let K=U??S(I.options.id)??S(I.options.policyId);if(!K)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await k0("seal_preference_thinking_depth_policies_remove",Q,J,{policyId:K,dryRun:F0(I.options.dryRun)??F0(I.options["dry-run"])},C0(I.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}var WS0=o(()=>{o4();D4();J4()});async function HS0($={}){let Y=s8(),z=_4(),U=f2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},v7());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let Q=await yK(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(Q,null,2));let J=await j1(U),I=await XM(J,{documentLimit:20,stylePreferencesEndpoint:U.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:I.rules.rules.length,hasPendingRuleDeletes:I.rules.hasPendingDeletes,documents:I.documents.articles.length,documentsTotal:I.documents.total,stylePreferences:I.stylePreferences.ok?"ok":`error: ${I.stylePreferences.error}`},null,2))}var XS0=o(()=>{h7();i8();OT();X6()});async function ZS0($,Y,z){let U=Y??S(z.options.corp)??($&&$!=="--corp"?$:void 0);await HS0({corpId:U})}var qS0=o(()=>{XS0();D4()});async function el($,Y,z,U,Q){if($==="count"){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(Q.options));return}if($==="list"){if(F0(Q.options.count)){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(Q.options));return}let J=s0(Q.options.limit),I=s0(Q.options.offset);if(F0(Q.options.summary)){await k0("seal_approval_rules_list",z,U,{fields:tR0,limit:J,offset:I},C0(Q.options));return}let K=await o2("seal_approval_rules_list",z,U,{limit:J,offset:I});eR0(K,F0(Q.options.full)===!0),c0(K);return}if($==="clear"){let J=F0(Q.options.yes)===!0,I=F0(Q.options.dryRun)??F0(Q.options["dry-run"])??!J;if(!J&&!I)throw N9("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${U.id} --dry-run`);let K=await o2("seal_approval_rules_clear",z,U,{dryRun:I,recode:F0(Q.options.recode)});if(!J&&I&&K&&typeof K==="object"){c0({...K,
Line truncated
|
||||
`).filter(Boolean),J=Q.slice(-Y);return{logFile:z,lines:J,totalLines:Q.length}}async function cS1($){let Y=hT($),z=zo($),U=Pq($);MS0($.stateDir);let Q=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):jT),J=$.host??(process.env.HOST?process.env.HOST:ET);_T(Y,`${process.pid}
|
||||
`,{mode:384}),_T(z,JSON.stringify({pid:process.pid,port:Q,host:J,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),kK(U,`service starting on http://${J}:${Q} pid=${process.pid}`);let I=null;try{I=await CT({port:Q,host:J,silent:!0}),kK(U,`service listening pid=${process.pid}`)}catch(G){if(kK(U,`service failed to bind port ${Q}: ${G instanceof Error?G.message:String(G)}`),vT(Y)===process.pid)_9(Y,{force:!0}),_9(z,{force:!0});throw G}let K=()=>{if(I)I.close(),I=null;if(vT(Y)===process.pid)_9(Y,{force:!0}),_9(z,{force:!0});kK(U,`stopped pid=${process.pid}`)};await new Promise((G)=>{let W=!1,H=()=>{if(W)return;W=!0,K(),process.off("SIGTERM",H),process.off("SIGINT",H),G()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function LS0($){MS0($.stateDir);let Y=xK($);if(Y.running)return Y;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},U=[...z.args??[],"service","run"];if($.port)U.push("--port",String($.port));if($.host)U.push("--host",String($.host));let Q=fS1(z.command,U,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});Q.unref();let J=hT($);return _T(J,`${Q.pid}
|
||||
`,{mode:384}),kK(Pq($),`started pid=${Q.pid}`),{started:!0,...xK($)}}function FS0($,Y={}){let z=hT($),U=zo($),Q=vT(z);if(!Q||!wS0(Q,$.appRoot))return _9(z,{force:!0}),_9(U,{force:!0}),Y.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(Q,"SIGTERM"),_9(z,{force:!0}),_9(U,{force:!0}),kK(Pq($),`stop requested pid=${Q}`),Y.quiet?void 0:{stopped:!0,pid:Q}}function wS0($,Y){if(!nS1($))return!1;try{let z=uS1("ps",["-p",String($),"-o","command="],{encoding:"utf8"});return(z.includes(Y)||z.includes("seal-use")||z.includes("src/cli.ts"))&&z.includes("service")&&z.includes("run")}catch{return!1}}function nS1($){try{return process.kill($,0),!0}catch{return!1}}function hT($){return Yo($.stateDir,"service.pid")}function zo($){return Yo($.stateDir,"service.json")}function Pq($){return Yo($.stateDir,"service.log")}function vT($){if(!RT($))return;let Y=Number($o($,"utf8").trim());return Number.isInteger(Y)&&Y>0?Y:void 0}function MS0($){bS1($,{recursive:!0,mode:448})}function kK($,Y){_T($,`${new Date().toISOString()} ${Y}
|
||||
`,{flag:"a",mode:384})}var Uo=o(()=>{al()});import{homedir as pS1}from"node:os";import{join as dS1}from"node:path";async function Jo($,Y,z){let U=z?s0(z.options.port)??s0(z.options.p):void 0,Q=z?S(z.options.host)??S(z.options.h):void 0,J=z?s0(z.options.lines)??s0(z.options.n):void 0,I=await SU($,{appRoot:Y.appRoot,entryFile:Y.entryFile,stateDir:Qo,version:P1,launcher:Y.launcher,port:U,host:Q},{maxLines:J});if(I!==void 0)c0(I)}var Qo;var Io=o(()=>{a9();Uo();J4();D4();Qo=dS1(pS1(),".config","seal-use")});import{existsSync as mS1,readFileSync as OS0}from"node:fs";async function NS0($,Y,z,U,Q){if($==="batch-records"||$==="records"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation batch-records <batchId>");await k0("seal_simulation_batch_records_get",z,U,{batchId:J,query:S(Q.options.query)},C0(Q.options));return}if($==="create"||$==="run"){let J=S(Q.options.mode)??S(Q.options.sourceSystem)??S(Q.options["source-system"])??"hosecloud",I=J==="material-pack"?"material_pack":J,K=S(Q.options.schemaConfig)??S(Q.options["schema-config"]),G=K?JSON.parse(OS0(K,"utf8")):void 0,W=S(Q.options.input),H=W?JSON.parse(OS0(W,"utf8")):y8(Q.json),X=S(Q.options.packageId)??S(Q.options["package-id"]),Z=u6(Q.options.packageIds)??u6(Q.options["package-ids"])??(X?[X]:void 0),q=u6(Q.options.flowIds)??u6(Q.options["flow-ids"])??u6(Q.options.documentSn)??u6(Q.options["document-sn"]),V=S(Q.options.signKey)??S(Q.options["sign-key"])??S(Q.options.integration),F=F0(Q.options.noWait)??F0(Q.options["no-wait"]);await k0("seal_simulation_batch_create",z,U,{mode:I,sourceSystem:I,flowIds:q,documentSn:q,rejectNodeName:S(Q.options.rejectNode)??S(Q.options["reject-node"])??null,thinkingDepthOverride:S(Q.options.thinkingDepth)??S(Q.options["thinking-depth"]),skipInvoiceGeneration:F0(Q.options.skipInvoiceGeneration)??F0(Q.options["skip-invoice-generation"]),skipExpenseExtraction:F0(Q.options.skipExpenseExtraction)??F0(Q.options["skip-expense-extraction"]),disableAttachmentCache:F0(Q.options.disableAttachmentCache)??F0(Q.options["disable-attachment-cache"]),signKey:V,packageIds:Z,packageId:X,templateId:S(Q.options.templateId)??S(Q.options["template-id"]),schemaConfig:G,requestIds:u6(Q.options.requestIds)??u6(Q.options["request-ids"]),workflowTypeId:S(Q.options.workflowTypeId)??S(Q.options["workflow-type-id"]),flowStatusList:u6(Q.options.flowStatusList)?.map(Number)??u6(Q.options["flow-status-list"])?.map(Number),businessCodes:u6(Q.options.businessCodes)??u6(Q.options["business-codes"]),documentType:S(Q.options.documentType)??S(Q.options["document-type"]),startTime:s0(Q.options.startTime)??s0(Q.options["start-time"]),endTime:s0(Q.options.endTime)??s0(Q.options["end-time"]),status:u6(Q.options.status),limit:s0(Q.options.limit),noWait:F,rawParams:H},C0(Q.options));return}if($==="wait"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await k0("seal_simulation_batch_wait",z,U,{batchId:J,timeout:S(Q.options.timeout),pollInterval:S(Q.options.pollInterval)??S(Q.options["poll-interval"])},C0(Q.options));return}if($==="status"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation status <batchId>");await k0("seal_simulation_batch_status",z,U,{batchId:J},C0(Q.options));return}if($==="clean"||$==="delete"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation clean <batchId>");await k0("seal_simulation_batch_clean",z,U,{batchId:J},C0(Q.options));return}if($==="specifications"){let J=Y??S(Q.options.integration)??S(Q.options.signKey)??S(Q.options["sign-key"]);await k0("seal_simulation_specifications_list",z,U,{signKey:J},C0(Q.options));return}if($==="approval-definitions"||$==="definitions"){await k0("seal_simulation_feishu_approval_definitions_list",z,U,{},C0(Q.options));return}if($==="list"){await k0("seal_simulation_batches_list",z,U,{limit:s0(Q.options.limit)},C0(Q.options));return}if($==="get"){let J=Y??S(Q.options.batchId)??S(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation get <batchId>");await k0("seal_simulation_batch_get",z,U,{batchId:J},C0(Q.options));return}if($==="templates"){await k0("seal_simulation_templates_get",z,U,{},C0(Q.options));return}if($==="integrations"){await k0("seal_simulation_integrations_get",z,U,{},C0(Q.options));return}if($==="package-upload"){let J=Y??S(Q.options.file);if(!J)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!mS1(J))throw Error(`File not found: ${J}`);await k0("seal_simulation_material_package_upload",z,U,{filePath:J},C0(Q.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}var DS0=o(()=>{o4();D4();J4()});import{existsSync as BS0}from"node:fs";import{join as ST}from"node:path";function PS0($,Y,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${vhLine truncated
|
||||
`);return}if($==="install"||$==="init"||$==="sync"){let U=F0(z.options.local)||F0(z.options.workspace),Q=S(z.options.dir)??S(z.options.target)??Y,J=Q?Q:U?ST(process.cwd(),".agents","skills","seal-use"):hU(),I=cl(J);c0({installed:!0,targetDir:I.targetDir,fileCount:I.files.length,files:I.files});return}if($==="status"||$==="get"||!$){let U=hU(),Q=ST(process.cwd(),".agents","skills","seal-use");c0({global:{dir:U,installed:BS0(ST(U,"SKILL.md"))},local:{dir:Q,installed:BS0(ST(Q,"SKILL.md"))}});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}var AS0=o(()=>{Nq();D4();J4()});async function TS0($,Y){if($==="config"){c0(await yK(Y));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}var jS0=o(()=>{OT();J4()});function Ko($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let Y=$.toUpperCase().trim();if(Y==="APPROVE"||Y==="PASS")return"APPROVE";if(Y==="REJECT"||Y==="DENIED")return"REJECT";if(Y==="MANUAL"||Y==="ASSISTED")return"MANUAL";if(Y==="ERROR"||Y==="FAILED")return"ERROR";return Y}async function ES0($){let{sourceCorp:Y,targetCorp:z,sourceClient:U,targetClient:Q,samples:J=10,dryRun:I=!1,pollIntervalMs:K=2000,timeoutMs:G=45000,snPrefix:W="REG_",fetchFn:H=fetch}=$;if(z.environment!=="test")throw new w4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
|
||||
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);let X=await bY(Q),q=(Array.isArray(X.features)?X.features:[]).find((d)=>d?.code==="ai-approval"),V=typeof q?.balance==="number"?q.balance:0,F=typeof q?.deductionAmount==="number"&&q.deductionAmount>0?q.deductionAmount:120,M=J*F;if(V<M)throw new w4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${V} 点,本次回归抽样 ${J} 笔需要约 ${M} 点。
|
||||
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(V/F))})`);let w=await b4(U,{limit:J,status:"completed"}),O=Array.isArray(w.records)?w.records:[];if(O.length===0){let d=await b4(U,{limit:J});O=Array.isArray(d.records)?d.records:[]}if(O.length===0)throw new w4(`在母企业「${Y.name}」(${Y.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(O=O.slice(0,J),I){let d=O.map((t)=>{let $0=t.sourceDocumentSN??t.id,g=t?.result?.decision??t.aiDecision??t?.decision,p=Ko(g),e=t?.result?.summary??t.aiSummary;return{sn:$0,sourceRecordId:t.id,prodDecision:p,prodSummary:e,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M},metrics:{sampleCount:d.length,successCount:d.length,failureCount:0,matchCount:d.length,flipCount:0,concordanceRate:1},flips:[],records:d}}let D=await Yp(Q,z),N=[];for(let d of O){let t=Date.now(),$0=d.sourceDocumentSN??d.id,g=Ko(d?.result?.decision??d.aiDecision??d?.decision),p=d?.result?.summary??d.aiSummary;try{let e=await G4(U,d.id),y=`${W}${$0}`,s=en(e,{snPrefix:W,docIdPrefix:W});await $p(D.incomingDocumentWebhook.url,D.secret,s,H,B6(z.seal));let Y0=null,M0=Date.now();while(Date.now()-M0<G){await new Promise((H0)=>setTimeout(H0,K));let a=await b4(Q,{sourceDocumentSN:y,limit:1});if(a.records&&a.records.length>0){let H0=a.records[0];if(H0.status==="completed"||H0.status==="failed"){Y0=H0;break}}}if(!Y0){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(G/1000)}s 未完成)`,durationMs:Date.now()-t});continue}let E0=Ko(Y0?.result?.decision??Y0.aiDecision??Y0?.decision??(Y0.status==="completed"?"APPROVE":"ERROR")),G0=Y0?.result?.summary??Y0.aiSummary,T0=g===E0,b0=T0?"MATCHED":"FLIPPED",Y1={sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,testRecordId:Y0.id,testDecision:E0,testSummary:G0,status:b0,durationMs:Date.now()-t};if(!T0)Y1.diff={from:g,to:E0,reasonDiff:G0&&p&&G0!==p?`生产: ${p.slice(0,60)}... -> 测试: ${G0.slice(0,60)}...`:void 0};N.push(Y1)}catch(e){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:e instanceof Error?e.message:String(e),durationMs:Date.now()-t})}}let A=N.filter((d)=>d.status==="MATCHED"||d.status==="FLIPPED"),T=N.filter((d)=>d.status==="MATCHED"),B=N.filter((d)=>d.status==="FLIPPED"),j=N.filter((d)=>d.status==="FAILED").length,C=T.length,b=B.length,k=C+b,h=k>0?C/k:0,i=b>0,c=i?"REGRESSIONS_DETECTED":"CLEAN",U0=!i&&j===0,x;try{let d=await bY(Q),$0=(Array.isArray(d.features)?d.features:[]).find((g)=>g?.code==="ai-approval");if(typeof $0?.balance==="number")x=$0.balance}catch{}return{ok:!i&&j===0,verdict:c,safeToPublish:U0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M,balanceAfter:x},metrics:{sampleCount:N.length,successCount:A.length,failureCount:j,matchCount:C,flipCount:b,concordanceRate:Number(h.toFixed(4))},flips:B,records:N}}function ES0($){let{sourceCorp:Y,targetCorp:z,verdict:U,safeToPublish:Q,metrics:J,quota:I,flips:K,records:G}=$,W=U==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":U==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",H=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${Y.name}」-> 测试靶场「${z.name}」`,` 判定: ${W} · 准许发布: ${Q?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${J.sampleCount} | 一致通过: ${J.matchCount} | 决策翻转: ${J.flipCount} | 异常失败: ${J.failureCount}`,` 一致率: ${(J.concordanceRate*100).toFixed(1)}% | 消耗预估: ${I.estimatedRequired} 点 (余量: ${I.balanceBefore}${I.balanceAfter!==void 0?` -> ${I.balanceAfter}`:""})`," "+"─".repeat(65)];if(K.length>0){H.push(` ⚠️ 决策翻转清单 (${K.length} 笔单据在新规则下结果改变):`);for(let X of K)if(H.push(` • 单据 [${X.sn}]: 原生产判定「${X.prodDecision}」 ➔ 测试新判定「${X.testDecision}」`),X.diff?.reasonDiff)H.push(` 理由差异: ${X.diff.reasonDiff}`);H.push(" "+"─".repeat(65)),H.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(U==="CLEAN")H.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100% 吻合,无任
Line truncated
|
||||
`)}var CS0=o(()=>{L$();X6();CZ()});async function Go($,Y,z){let U=($??Y??"regression").toLowerCase();if(U==="regression"||U==="regress"||U==="matrix"){let Q=S(z.options.corp)??(Y&&Y!==U?Y:void 0),J=E1(Q),I=J,K=J;if(J.environment==="test"){K=J;let O=S(z.options["prod-corp"])??S(z.options.prod)??J.prodCorpId;if(!O)throw new w4(`测试企业「${J.name}」(${J.id}) 未绑定生产母企业,无法拉取历史样本。
|
||||
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(V/F))})`);let w=await b4(U,{limit:J,status:"completed"}),O=Array.isArray(w.records)?w.records:[];if(O.length===0){let d=await b4(U,{limit:J});O=Array.isArray(d.records)?d.records:[]}if(O.length===0)throw new w4(`在母企业「${Y.name}」(${Y.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(O=O.slice(0,J),I){let d=O.map((t)=>{let $0=t.sourceDocumentSN??t.id,g=t?.result?.decision??t.aiDecision??t?.decision,p=Ko(g),e=t?.result?.summary??t.aiSummary;return{sn:$0,sourceRecordId:t.id,prodDecision:p,prodSummary:e,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M},metrics:{sampleCount:d.length,successCount:d.length,failureCount:0,matchCount:d.length,flipCount:0,concordanceRate:1},flips:[],records:d}}let D=await Yp(Q,z),N=[];for(let d of O){let t=Date.now(),$0=d.sourceDocumentSN??d.id,g=Ko(d?.result?.decision??d.aiDecision??d?.decision),p=d?.result?.summary??d.aiSummary;try{let e=await G4(U,d.id),y=`${W}${$0}`,s=en(e,{snPrefix:W,docIdPrefix:W});await $p(D.incomingDocumentWebhook.url,D.secret,s,H,B6(z.seal));let Y0=null,M0=Date.now();while(Date.now()-M0<G){await new Promise((H0)=>setTimeout(H0,K));let a=await b4(Q,{sourceDocumentSN:y,limit:1});if(a.records&&a.records.length>0){let H0=a.records[0];if(H0.status==="completed"||H0.status==="failed"){Y0=H0;break}}}if(!Y0){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(G/1000)}s 未完成)`,durationMs:Date.now()-t});continue}let E0=Ko(Y0?.result?.decision??Y0.aiDecision??Y0?.decision??(Y0.status==="completed"?"APPROVE":"ERROR")),G0=Y0?.result?.summary??Y0.aiSummary,T0=g===E0,b0=T0?"MATCHED":"FLIPPED",Y1={sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,testRecordId:Y0.id,testDecision:E0,testSummary:G0,status:b0,durationMs:Date.now()-t};if(!T0)Y1.diff={from:g,to:E0,reasonDiff:G0&&p&&G0!==p?`生产: ${p.slice(0,60)}... -> 测试: ${G0.slice(0,60)}...`:void 0};N.push(Y1)}catch(e){N.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:e instanceof Error?e.message:String(e),durationMs:Date.now()-t})}}let A=N.filter((d)=>d.status==="MATCHED"||d.status==="FLIPPED"),T=N.filter((d)=>d.status==="MATCHED"),B=N.filter((d)=>d.status==="FLIPPED"),j=N.filter((d)=>d.status==="FAILED").length,C=T.length,b=B.length,k=C+b,h=k>0?C/k:0,i=b>0,c=i?"REGRESSIONS_DETECTED":"CLEAN",U0=!i&&j===0,x;try{let d=await bY(Q),$0=(Array.isArray(d.features)?d.features:[]).find((g)=>g?.code==="ai-approval");if(typeof $0?.balance==="number")x=$0.balance}catch{}return{ok:!i&&j===0,verdict:c,safeToPublish:U0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M,balanceAfter:x},metrics:{sampleCount:N.length,successCount:A.length,failureCount:j,matchCount:C,flipCount:b,concordanceRate:Number(h.toFixed(4))},flips:B,records:N}}function CS0($){let{sourceCorp:Y,targetCorp:z,verdict:U,safeToPublish:Q,metrics:J,quota:I,flips:K,records:G}=$,W=U==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":U==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",H=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${Y.name}」-> 测试靶场「${z.name}」`,` 判定: ${W} · 准许发布: ${Q?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${J.sampleCount} | 一致通过: ${J.matchCount} | 决策翻转: ${J.flipCount} | 异常失败: ${J.failureCount}`,` 一致率: ${(J.concordanceRate*100).toFixed(1)}% | 消耗预估: ${I.estimatedRequired} 点 (余量: ${I.balanceBefore}${I.balanceAfter!==void 0?` -> ${I.balanceAfter}`:""})`," "+"─".repeat(65)];if(K.length>0){H.push(` ⚠️ 决策翻转清单 (${K.length} 笔单据在新规则下结果改变):`);for(let X of K)if(H.push(` • 单据 [${X.sn}]: 原生产判定「${X.prodDecision}」 ➔ 测试新判定「${X.testDecision}」`),X.diff?.reasonDiff)H.push(` 理由差异: ${X.diff.reasonDiff}`);H.push(" "+"─".repeat(65)),H.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(U==="CLEAN")H.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100% 吻合,无任
Line truncated
|
||||
`)}var RS0=o(()=>{L$();X6();CZ()});async function Go($,Y,z){let U=($??Y??"regression").toLowerCase();if(U==="regression"||U==="regress"||U==="matrix"){let Q=S(z.options.corp)??(Y&&Y!==U?Y:void 0),J=E1(Q),I=J,K=J;if(J.environment==="test"){K=J;let O=S(z.options["prod-corp"])??S(z.options.prod)??J.prodCorpId;if(!O)throw new w4(`测试企业「${J.name}」(${J.id}) 未绑定生产母企业,无法拉取历史样本。
|
||||
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${J.id}`);I=E1(O)}else{I=J;let O=S(z.options["test-corp"])??S(z.options.test)??J.testCorpId;if(!O)throw new w4(`生产企业「${J.name}」(${J.id}) 未绑定测试靶场企业。
|
||||
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${J.id} <testCorpId>`);K=E1(O)}let G=await j1(I),W=await j1(K),H=s0(z.options.samples)??s0(z.options.limit)??s0(z.options.n)??10,X=F0(z.options["dry-run"]),Z=F0(z.options["fail-on-flips"]),q=s0(z.options["poll-interval"])??2000,V=s0(z.options.timeout)??45000,F=S(z.options["sn-prefix"])??"REG_",M=await jS0({sourceCorp:I,targetCorp:K,sourceClient:G,targetClient:W,samples:H,dryRun:X,pollIntervalMs:q,timeoutMs:V,snPrefix:F,failOnFlips:Z});if(!(F0(z.options.quiet)||F0(z.options.silent)))console.error(ES0(M));if(c0(M),Z&&!M.ok)throw new w4(`回归测试发现 ${M.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new w4(`未知的 test 子命令: "${U}"。
|
||||
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}var RS0=o(()=>{L$();o4();D4();J4();i8();CS0()});async function _S0($,Y,z,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await k0($,Y,z,y8(U.json),C0(U.options))}var vS0=o(()=>{o4();D4();J4()});function hS0(){c0(Wq.map(($)=>({name:$.name,description:$.description})))}var SS0=o(()=>{JT();J4()});function gT($=process.execPath,Y=import.meta.url){if(Y.includes("/$bunfs/")||Y.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}var gS0=o(()=>{Oq()});import{chmodSync as dS1,mkdirSync as mS1,renameSync as Wo,rmSync as lS1,unlinkSync as uS0,writeFileSync as yS0}from"node:fs";import{dirname as oS1,join as kS0}from"node:path";import{spawnSync as gU}from"node:child_process";async function iS0($,Y={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Qo,version:P1,launcher:$.launcher},U=Y.repo||process.env[rS1]?.trim()||process.env[sS1]?.trim()||bS0,Q=Y.targetVersion?.trim(),J=Q&&Q.toLowerCase()!=="latest"?Q:void 0;if(J){let N=J.replace(/^v/,""),A=cS0(N,P1);if(A<0)if(!_S&&Y.force);else{c0({updated:!1,currentVersion:P1,targetVersion:N,mode:gT()?"binary":"source",message:!_S?`Cannot downgrade seal-use from dev build v${P1} to release v${N}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${P1} to older version v${N}. Updates must be forward-only.`});return}if(A===0&&!Y.force){c0({updated:!1,currentVersion:P1,targetVersion:N,mode:gT()?"binary":"source",message:`seal-use is already at version v${P1}. Use --force to reinstall.`});return}}if(Y.changelogOnly){let N=await Ho(U,Y.limit??10);c0({currentVersion:P1,totalQueried:N.length,releases:N.map((A)=>({version:A.version,tagName:A.tagName,publishedAt:A.publishedAt,author:A.author,releaseNotes:A.notes,releaseUrl:A.htmlUrl,isCurrent:A.version===P1,isNewer:Pq(A.version,P1)}))});return}if(!gT()){if(Y.checkOnly){let A=await Ho(U,30),T=A[0],B=T?.version??P1,j=A.find((k)=>k.version===P1),C=Pq(B,P1),b=A.filter((k)=>Pq(k.version,P1));c0({updated:!1,updateAvailable:C,currentVersion:P1,currentVersionPublishedAt:j?.publishedAt,latestVersion:B,latestVersionPublishedAt:T?.publishedAt,behindCount:b.length,pendingReleases:b.map((k)=>({version:k.version,tagName:k.tagName,publishedAt:k.publishedAt,author:k.author,releaseNotes:k.notes,releaseUrl:k.htmlUrl})),releaseNotes:T?.notes??"",releaseUrl:T?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let N=xK(z).running;if(N)await SU("stop",z);try{fS0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(A){console.error(`git pull skipped: ${A instanceof Error?A.message:String(A)}`)}if(fS0("bun",["install"],{cwd:$.appRoot}),N)await SU("start",z);c0({updated:!0,serviceRestarted:N,version:P1,mode:"source"});return}let I=aS1(),K=tS1(),G=await Ho(U,30),W=J?G.find((N)=>N.version===J||N.tagName===J||N.tagName===`v${J}`)??await xS0(U,J):G[0]??await xS0(U);if(!W){c0({updated:!1,currentVersion:P1,mode:"binary",message:`Failed to query releases from repository '${U}'`});return}let H=W.version,X=G.find((N)=>N.version===P1),Z=Pq(H,P1),q=Z||Boolean(Y.force),V=G.filter((N)=>Pq(N.version,P1));if(Y.checkOnly){c0({updated:!1,updateAvailable:Z,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:H,latestVersionPublishedAt:W.publishedAt,behindCount:V.length,pendingReleases:V.map((N)=>({version:N.version,tagName:N.tagName,publishedAt:N.publishedAt,author:N.author,releaseNotes:N.notes,releaseUrl:N.htmlUrl})),releaseNotes:W.notes,releaseUrl:W.htmlUrl,mode:"binary"});return}if(!q){c0({updated:!1,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:H,latestVersionPublishedAt:W.publishedAt,mode:"binary",message:`seal-use is already up to date (v${P1})`});return}let F=eS1(W.assets,I,K);if(!F)throw Error(`No compatible binary found for ${I}-${K} in release v${H}. Available assets: ${W.assets.map((N)=>N.name).join(", ")}`);let M=xK(z).running;if(M)await SU("stop",z);let w=process.execPath,O=oS1(w),D=kS0(O,`.tmp-update-${Date.now()}`);mS1(D,{recursive:!0});try{let N=kS0(D,F.name);await $g1(F.downloadUrl,N,W.tagName,F.name);let A=N;if(F.name.endsWith(".tar.gz")||F.name.endsWith(".tgz"))A=Yg1(N,D,I);else if(F.name.endsWith(".zip"))A=zg1(N,D,I);if(dS1(A,493),process.platform==="darwin")try{gU("/usr/bin/codesign",["--remove-signature",A],{stdio:"ignore"}),gU("/usr/bin/codesign",["--force","--sign","-",A],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let B=`${w}.old.${Date.now()}`;try{Wo(w,B)}catch{}Wo(A,w)}else Wo(A,w);if(M)await SU("start",z);let T=nl();c0({updated:!0,fromVersion:P1,toVersion:H,serviceRestarted:M,skillSynced:T.synced?T.targetDir:!1,mode:"binary"})}finally{try{lS1(D,{recursive:!0,force:!0})}catch{}}}function aS1(){if(process.platform==="darwin")return"darwin";if
Line truncated
|
||||
`)}catch{}}async function $g1($,Y,z,U){let Q=Xo(),J=[],I=z?z.startsWith("v")?z:`v${z}`:void 0,K=U||$.split("/").pop()||"";if(Q!=="github"){if(I&&K)J.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${I}/${K}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${I}/${K}`);if($.startsWith("https://git.ying-qing.cn"))J.push($)}if(Q!=="gitea")if(I&&K){let F=`https://github.com/${bS0}/releases/download/${I}/${K}`;if(!process.env.CI)J.push(`https://ghfast.top/${F}`,`https://gh.ddlc.top/${F}`);J.push(F)}else if($.includes("github.com")){if(!process.env.CI)J.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);J.push($)}else J.push($);let G=Array.from(new Set(J)),W,H=6000,X=6000,Z=307200,q=1e4,V=180000;for(let F=0;F<G.length;F++){let M=G[F],w=new AbortController,O="",D=(B)=>{O=B;try{w.abort()}catch{}},N=setTimeout(()=>{D("Connection timed out (no response headers within 6s)")},H),A,T;try{yT(`==> [${F+1}/${G.length}] Downloading via: ${M}`);let B=await fetch(M,{signal:w.signal});if(N)clearTimeout(N),N=void 0;if(!B.ok)throw Error(`HTTP ${B.status} ${B.statusText}`);A=setTimeout(()=>{D("Overall download time exceeded 3 minutes")},V);let j=Number(B.headers.get("content-length"))||0,C=B.body?.getReader();if(!C){let c=Buffer.from(await B.arrayBuffer());if(c.length<1000)throw Error(`Downloaded content is suspiciously small (${c.length} bytes)`);yS0(Y,c),yT(`✓ Download succeeded (${(c.length/1024/1024).toFixed(1)} MB)`);return}let b=[],k=0,h=0;T=setTimeout(()=>{if(k<Z){let c=(k/1024).toFixed(1);D(`Initial transfer too slow (${c} KB < 300 KB in 6s), switching mirror...`)}},X);while(!0){let c=C.read(),U0,x=new Promise((g,p)=>{U0=setTimeout(()=>{p(Error("Data transfer stalled (no chunk received for 10s)"))},q)}),d;try{d=await Promise.race([c,x])}finally{if(U0)clearTimeout(U0)}let{done:t,value:$0}=d;if(t)break;if($0){if(b.push($0),k+=$0.length,T&&k>=Z)clearTimeout(T),T=void 0;let g=Date.now();if(g-h>200){h=g;let p=j?Math.round(k/j*100):0,e=(k/1048576).toFixed(1),y=j?(j/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${p}% (${e} / ${y} MB)...`)}catch{}}}}try{process.stderr.write(`
|
||||
`)}catch{}let i=Buffer.concat(b);if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);yS0(Y,i),yT(`✓ Download completed successfully (${(i.length/1024/1024).toFixed(1)} MB)`);return}catch(B){if(N)clearTimeout(N);if(T)clearTimeout(T);if(A)clearTimeout(A);let j=O||(B instanceof Error?B.message:String(B));W=Error(j),yT(`
|
||||
↳ Mirror failed: ${W.message}`)}finally{if(N)clearTimeout(N);if(T)clearTimeout(T);if(A)clearTimeout(A)}}throw Error(`Failed to download asset from all mirrors: ${W?.message}`)}function Yg1($,Y,z){let U=gU("tar",["-xzf",$,"-C",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);uS0($);let Q=z==="windows"?"seal-use.exe":"seal-use",J=gU("find",[Y,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
|
||||
`).filter(Boolean),I=J.find((K)=>K.endsWith(`/${Q}`)||K.endsWith(Q));if(I)return I;return J[0]||$}function zg1($,Y,z){let U=gU("unzip",["-q","-o",$,"-d",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);uS0($);let Q=z==="windows"?"seal-use.exe":"seal-use",J=gU("find",[Y,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
|
||||
`).filter(Boolean),I=J.find((K)=>K.endsWith(`/${Q}`)||K.endsWith(Q));if(I)return I;return J[0]||$}function cS0($,Y){let z=$.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0),U=Y.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0);for(let Q=0;Q<Math.max(z.length,U.length);Q++){let J=z[Q]??0,I=U[Q]??0;if(J>I)return 1;if(J<I)return-1}return 0}function Pq($,Y){return cS0($,Y)>0}function fS0($,Y,z={}){let U=gU($,Y,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${Y.join(" ")} failed with status ${U.status}`)}var bS0="yunyingk/seal-use",Aq="yunyingk/seal-home",rS1="SEAL_USE_GITHUB_REPO",sS1="SEAL_HOME_GITHUB_REPO";var nS0=o(()=>{gS0();Oq();a9();Uo();J4();Io()});async function pS0($,Y,z,U,Q){if($==="create"){let J=S(Q.options.name)??Y,I=S(Q.options.phone);if(!J||!I)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let K=S(Q.options.dept)??S(Q.options.departmentId);await k0("seal_user_create",z,U,{name:J,phone:I,departmentIds:K?[K]:void 0},C0(Q.options));return}if($==="reset-password"){let J=Y??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users reset-password <userId>");await k0("seal_user_reset_password",z,U,{userId:J},C0(Q.options));return}if($==="search"||$==="list"){let J=Y??S(Q.options.keyword)??S(Q.options.query)??"";await k0("seal_user_search",z,U,{keyword:J},C0(Q.options));return}if($==="get"){let J=Y??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users get <userId>");await k0("seal_user_get",z,U,{userId:J},C0(Q.options));return}if($==="delete"){let J=Y??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users delete <userId>");await k0("seal_user_delete",z,U,{userId:J},C0(Q.options));return}if($==="activate"){let J=Y??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users activate <userId>");await k0("seal_user_activate",z,U,{userId:J},C0(Q.options));return}if($==="delegation"||$==="impersonate"){let J=Y??S(Q.options.userId)??S(Q.options.phone);if(!J)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let I=S(Q.options.note);await k0("seal_user_delegation_create",z,U,{userIdOrPhone:J,note:I},C0(Q.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var dS0=o(()=>{o4();D4();J4()});import{dirname as Zo,join as Ug1}from"node:path";import{fileURLToPath as Qg1}from"node:url";function Kg1($){if(!$.length)return!1;let Y=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(Y&&Ig1.has(Y))return!0;if((Y==="service"||Y==="daemon")&&z==="run")return!0;return!1}function Dq($,Y={}){if(Kg1($))return oS0($,Y);let z=lS0.then(()=>oS0($,Y));return lS0=z.then(()=>{return},()=>{return}),z}async function oS0($,Y){let z=[],U=[],Q=console.log,J=console.error,I={appRoot:Y.appRoot??mS0,entryFile:Y.entryFile??Ug1(Y.appRoot??mS0,"src","cli.ts"),launcher:Y.launcher};console.log=(...K)=>{z.push(Dl(K))},console.error=(...K)=>{U.push(Dl(K))};try{return await Gg1($,I),{stdout:Zq(z),stderr:Zq(U),isError:!1,exitCode:0}}catch(K){let G=qq(K instanceof Error?K.message:String(K)),W=EZ(K);if(U.push(G),W.nextAction&&!G.includes("Next action:"))U.push(`\uD83D\uDC49 Next action: ${W.nextAction}`);return{stdout:Zq(z),stderr:Zq(U),isError:!0,exitCode:W.exitCode}}finally{console.log=Q,console.error=J}}async function Gg1($,Y){let z=Xq($),[U,Q,J]=z.command;if(U==="version"||U==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){c0(PW);return}let I=rR0(z);if(I.isHelp){eR0(I.target);return}if(!U||!Jg1.has(U))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(U==="webhook"&&(Q==="resource-pack"||Q==="pack"||Q==="material-pack")&&J==="preview"){let W=z.command[3]??S(z.options.file)??S(z.options.input);if(!W)throw Error("Usage: seal-use webhook resource-pack preview <资源包.zip>");await z_0(W,hK(z.options));return}if(U==="openapi"){zS0(z);return}if(U==="mcp-config"){tl();return}if(U==="skill"){BS0(Q,J,z);return}if(U==="mcp"||U==="server"){await th0(Q,z);return}if(U==="probe"){await XS0(Q,J,z);return}if(U==="doctor"){await uh0(Q,J,z);return}if(U==="test"){await Go(Q,J,z);return}if(U==="config"){mv0(Q,J,z);return}if(U==="service"){await Jo(Q,Y,z);return}if(U==="stop"){await Jo("stop",Y,z);return}if(U==="http"||U==="serve"){await oh0(z);return}if(U==="update"||U==="changelog"){let W=U==="changelog"||Q==="changelog"||Q==="log"||Q==="history"||F0(z.options.changelog)===!0,H=Q==="check"||F0(z.options.check)===!0||F0(z.options["check-only"])===!0,X=S(z.options.version)??S(z.options.tag)??(!W&&!H&&Q&&!Q.startsWith("-")?Q:void 0);await iS0(Y,{checkOnly:H,changelogOnly:W,limit:s0(z.options.limit),force:F0(z.options.force),targetVersion:X,repo:S(z.options.repo)});return}if(U==="tools"&&Q==="list"){hS0();return}if(U==="corps"||U==="corp"){if(Q==="regression"||Q==="test-regression"){awai
Line truncated
|
||||
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${J.id} <testCorpId>`);K=E1(O)}let G=await j1(I),W=await j1(K),H=s0(z.options.samples)??s0(z.options.limit)??s0(z.options.n)??10,X=F0(z.options["dry-run"]),Z=F0(z.options["fail-on-flips"]),q=s0(z.options["poll-interval"])??2000,V=s0(z.options.timeout)??45000,F=S(z.options["sn-prefix"])??"REG_",M=await ES0({sourceCorp:I,targetCorp:K,sourceClient:G,targetClient:W,samples:H,dryRun:X,pollIntervalMs:q,timeoutMs:V,snPrefix:F,failOnFlips:Z});if(!(F0(z.options.quiet)||F0(z.options.silent)))console.error(CS0(M));if(c0(M),Z&&!M.ok)throw new w4(`回归测试发现 ${M.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new w4(`未知的 test 子命令: "${U}"。
|
||||
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}var _S0=o(()=>{L$();o4();D4();J4();i8();RS0()});async function vS0($,Y,z,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await k0($,Y,z,y8(U.json),C0(U.options))}var hS0=o(()=>{o4();D4();J4()});function SS0(){c0(Wq.map(($)=>({name:$.name,description:$.description})))}var gS0=o(()=>{Xq();J4()});function gT($=process.execPath,Y=import.meta.url){if(Y.includes("/$bunfs/")||Y.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}var yS0=o(()=>{Nq()});import{chmodSync as lS1,mkdirSync as oS1,renameSync as Wo,rmSync as rS1,unlinkSync as bS0,writeFileSync as kS0}from"node:fs";import{dirname as sS1,join as xS0}from"node:path";import{spawnSync as gU}from"node:child_process";async function cS0($,Y={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Qo,version:P1,launcher:$.launcher},U=Y.repo||process.env[aS1]?.trim()||process.env[tS1]?.trim()||iS0,Q=Y.targetVersion?.trim(),J=Q&&Q.toLowerCase()!=="latest"?Q:void 0;if(J){let N=J.replace(/^v/,""),A=nS0(N,P1);if(A<0)if(!_S&&Y.force);else{c0({updated:!1,currentVersion:P1,targetVersion:N,mode:gT()?"binary":"source",message:!_S?`Cannot downgrade seal-use from dev build v${P1} to release v${N}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${P1} to older version v${N}. Updates must be forward-only.`});return}if(A===0&&!Y.force){c0({updated:!1,currentVersion:P1,targetVersion:N,mode:gT()?"binary":"source",message:`seal-use is already at version v${P1}. Use --force to reinstall.`});return}}if(Y.changelogOnly){let N=await Ho(U,Y.limit??10);c0({currentVersion:P1,totalQueried:N.length,releases:N.map((A)=>({version:A.version,tagName:A.tagName,publishedAt:A.publishedAt,author:A.author,releaseNotes:A.notes,releaseUrl:A.htmlUrl,isCurrent:A.version===P1,isNewer:Aq(A.version,P1)}))});return}if(!gT()){if(Y.checkOnly){let A=await Ho(U,30),T=A[0],B=T?.version??P1,j=A.find((k)=>k.version===P1),C=Aq(B,P1),b=A.filter((k)=>Aq(k.version,P1));c0({updated:!1,updateAvailable:C,currentVersion:P1,currentVersionPublishedAt:j?.publishedAt,latestVersion:B,latestVersionPublishedAt:T?.publishedAt,behindCount:b.length,pendingReleases:b.map((k)=>({version:k.version,tagName:k.tagName,publishedAt:k.publishedAt,author:k.author,releaseNotes:k.notes,releaseUrl:k.htmlUrl})),releaseNotes:T?.notes??"",releaseUrl:T?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let N=xK(z).running;if(N)await SU("stop",z);try{uS0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(A){console.error(`git pull skipped: ${A instanceof Error?A.message:String(A)}`)}if(uS0("bun",["install"],{cwd:$.appRoot}),N)await SU("start",z);c0({updated:!0,serviceRestarted:N,version:P1,mode:"source"});return}let I=eS1(),K=$g1(),G=await Ho(U,30),W=J?G.find((N)=>N.version===J||N.tagName===J||N.tagName===`v${J}`)??await fS0(U,J):G[0]??await fS0(U);if(!W){c0({updated:!1,currentVersion:P1,mode:"binary",message:`Failed to query releases from repository '${U}'`});return}let H=W.version,X=G.find((N)=>N.version===P1),Z=Aq(H,P1),q=Z||Boolean(Y.force),V=G.filter((N)=>Aq(N.version,P1));if(Y.checkOnly){c0({updated:!1,updateAvailable:Z,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:H,latestVersionPublishedAt:W.publishedAt,behindCount:V.length,pendingReleases:V.map((N)=>({version:N.version,tagName:N.tagName,publishedAt:N.publishedAt,author:N.author,releaseNotes:N.notes,releaseUrl:N.htmlUrl})),releaseNotes:W.notes,releaseUrl:W.htmlUrl,mode:"binary"});return}if(!q){c0({updated:!1,currentVersion:P1,currentVersionPublishedAt:X?.publishedAt,latestVersion:H,latestVersionPublishedAt:W.publishedAt,mode:"binary",message:`seal-use is already up to date (v${P1})`});return}let F=Yg1(W.assets,I,K);if(!F)throw Error(`No compatible binary found for ${I}-${K} in release v${H}. Available assets: ${W.assets.map((N)=>N.name).join(", ")}`);let M=xK(z).running;if(M)await SU("stop",z);let w=process.execPath,O=sS1(w),D=xS0(O,`.tmp-update-${Date.now()}`);oS1(D,{recursive:!0});try{let N=xS0(D,F.name);await zg1(F.downloadUrl,N,W.tagName,F.name);let A=N;if(F.name.endsWith(".tar.gz")||F.name.endsWith(".tgz"))A=Ug1(N,D,I);else if(F.name.endsWith(".zip"))A=Qg1(N,D,I);if(lS1(A,493),process.platform==="darwin")try{gU("/usr/bin/codesign",["--remove-signature",A],{stdio:"ignore"}),gU("/usr/bin/codesign",["--force","--sign","-",A],{stdio:"ignore"})}catch{}if(process.platform==="win32"){let B=`${w}.old.${Date.now()}`;try{Wo(w,B)}catch{}Wo(A,w)}else Wo(A,w);if(M)await SU("start",z);let T=nl();c0({updated:!0,fromVersion:P1,toVersion:H,serviceRestarted:M,skillSynced:T.synced?T.targetDir:!1,mode:"binary"})}finally{try{rS1(D,{recursive:!0,force:!0})}catch{}}}function eS1(){if(process.platform==="darwin")return"darwin";if
Line truncated
|
||||
`)}catch{}}async function zg1($,Y,z,U){let Q=Xo(),J=[],I=z?z.startsWith("v")?z:`v${z}`:void 0,K=U||$.split("/").pop()||"";if(Q!=="github"){if(I&&K)J.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${I}/${K}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${I}/${K}`);if($.startsWith("https://git.ying-qing.cn"))J.push($)}if(Q!=="gitea")if(I&&K){let F=`https://github.com/${iS0}/releases/download/${I}/${K}`;if(!process.env.CI)J.push(`https://ghfast.top/${F}`,`https://gh.ddlc.top/${F}`);J.push(F)}else if($.includes("github.com")){if(!process.env.CI)J.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);J.push($)}else J.push($);let G=Array.from(new Set(J)),W,H=6000,X=6000,Z=307200,q=1e4,V=180000;for(let F=0;F<G.length;F++){let M=G[F],w=new AbortController,O="",D=(B)=>{O=B;try{w.abort()}catch{}},N=setTimeout(()=>{D("Connection timed out (no response headers within 6s)")},H),A,T;try{yT(`==> [${F+1}/${G.length}] Downloading via: ${M}`);let B=await fetch(M,{signal:w.signal});if(N)clearTimeout(N),N=void 0;if(!B.ok)throw Error(`HTTP ${B.status} ${B.statusText}`);A=setTimeout(()=>{D("Overall download time exceeded 3 minutes")},V);let j=Number(B.headers.get("content-length"))||0,C=B.body?.getReader();if(!C){let c=Buffer.from(await B.arrayBuffer());if(c.length<1000)throw Error(`Downloaded content is suspiciously small (${c.length} bytes)`);kS0(Y,c),yT(`✓ Download succeeded (${(c.length/1024/1024).toFixed(1)} MB)`);return}let b=[],k=0,h=0;T=setTimeout(()=>{if(k<Z){let c=(k/1024).toFixed(1);D(`Initial transfer too slow (${c} KB < 300 KB in 6s), switching mirror...`)}},X);while(!0){let c=C.read(),U0,x=new Promise((g,p)=>{U0=setTimeout(()=>{p(Error("Data transfer stalled (no chunk received for 10s)"))},q)}),d;try{d=await Promise.race([c,x])}finally{if(U0)clearTimeout(U0)}let{done:t,value:$0}=d;if(t)break;if($0){if(b.push($0),k+=$0.length,T&&k>=Z)clearTimeout(T),T=void 0;let g=Date.now();if(g-h>200){h=g;let p=j?Math.round(k/j*100):0,e=(k/1048576).toFixed(1),y=j?(j/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${p}% (${e} / ${y} MB)...`)}catch{}}}}try{process.stderr.write(`
|
||||
`)}catch{}let i=Buffer.concat(b);if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);kS0(Y,i),yT(`✓ Download completed successfully (${(i.length/1024/1024).toFixed(1)} MB)`);return}catch(B){if(N)clearTimeout(N);if(T)clearTimeout(T);if(A)clearTimeout(A);let j=O||(B instanceof Error?B.message:String(B));W=Error(j),yT(`
|
||||
↳ Mirror failed: ${W.message}`)}finally{if(N)clearTimeout(N);if(T)clearTimeout(T);if(A)clearTimeout(A)}}throw Error(`Failed to download asset from all mirrors: ${W?.message}`)}function Ug1($,Y,z){let U=gU("tar",["-xzf",$,"-C",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);bS0($);let Q=z==="windows"?"seal-use.exe":"seal-use",J=gU("find",[Y,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
|
||||
`).filter(Boolean),I=J.find((K)=>K.endsWith(`/${Q}`)||K.endsWith(Q));if(I)return I;return J[0]||$}function Qg1($,Y,z){let U=gU("unzip",["-q","-o",$,"-d",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);bS0($);let Q=z==="windows"?"seal-use.exe":"seal-use",J=gU("find",[Y,"-type","f"],{encoding:"utf8"}).stdout.trim().split(`
|
||||
`).filter(Boolean),I=J.find((K)=>K.endsWith(`/${Q}`)||K.endsWith(Q));if(I)return I;return J[0]||$}function nS0($,Y){let z=$.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0),U=Y.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0);for(let Q=0;Q<Math.max(z.length,U.length);Q++){let J=z[Q]??0,I=U[Q]??0;if(J>I)return 1;if(J<I)return-1}return 0}function Aq($,Y){return nS0($,Y)>0}function uS0($,Y,z={}){let U=gU($,Y,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${Y.join(" ")} failed with status ${U.status}`)}var iS0="yunyingk/seal-use",Tq="yunyingk/seal-home",aS1="SEAL_USE_GITHUB_REPO",tS1="SEAL_HOME_GITHUB_REPO";var pS0=o(()=>{yS0();Nq();a9();Uo();J4();Io()});async function dS0($,Y,z,U,Q){if($==="create"){let J=S(Q.options.name)??Y,I=S(Q.options.phone);if(!J||!I)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let K=S(Q.options.dept)??S(Q.options.departmentId);await k0("seal_user_create",z,U,{name:J,phone:I,departmentIds:K?[K]:void 0},C0(Q.options));return}if($==="reset-password"){let J=Y??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users reset-password <userId>");await k0("seal_user_reset_password",z,U,{userId:J},C0(Q.options));return}if($==="search"||$==="list"){let J=Y??S(Q.options.keyword)??S(Q.options.query)??"";await k0("seal_user_search",z,U,{keyword:J},C0(Q.options));return}if($==="get"){let J=Y??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users get <userId>");await k0("seal_user_get",z,U,{userId:J},C0(Q.options));return}if($==="delete"){let J=Y??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users delete <userId>");await k0("seal_user_delete",z,U,{userId:J},C0(Q.options));return}if($==="activate"){let J=Y??S(Q.options.userId);if(!J)throw Error("Usage: seal-use users activate <userId>");await k0("seal_user_activate",z,U,{userId:J},C0(Q.options));return}if($==="delegation"||$==="impersonate"){let J=Y??S(Q.options.userId)??S(Q.options.phone);if(!J)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let I=S(Q.options.note);await k0("seal_user_delegation_create",z,U,{userIdOrPhone:J,note:I},C0(Q.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var mS0=o(()=>{o4();D4();J4()});import{dirname as Zo,join as Jg1}from"node:path";import{fileURLToPath as Ig1}from"node:url";function Wg1($){if(!$.length)return!1;let Y=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(Y&&Gg1.has(Y))return!0;if((Y==="service"||Y==="daemon")&&z==="run")return!0;return!1}function Bq($,Y={}){if(Wg1($))return rS0($,Y);let z=oS0.then(()=>rS0($,Y));return oS0=z.then(()=>{return},()=>{return}),z}async function rS0($,Y){let z=[],U=[],Q=console.log,J=console.error,I={appRoot:Y.appRoot??lS0,entryFile:Y.entryFile??Jg1(Y.appRoot??lS0,"src","cli.ts"),launcher:Y.launcher};console.log=(...K)=>{z.push(Dl(K))},console.error=(...K)=>{U.push(Dl(K))};try{return await Hg1($,I),{stdout:qq(z),stderr:qq(U),isError:!1,exitCode:0}}catch(K){let G=Vq(K instanceof Error?K.message:String(K)),W=EZ(K);if(U.push(G),W.nextAction&&!G.includes("Next action:"))U.push(`\uD83D\uDC49 Next action: ${W.nextAction}`);return{stdout:qq(z),stderr:qq(U),isError:!0,exitCode:W.exitCode}}finally{console.log=Q,console.error=J}}async function Hg1($,Y){let z=Zq($),[U,Q,J]=z.command;if(U==="version"||U==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){c0(PW);return}let I=sR0(z);if(I.isHelp){$_0(I.target);return}if(!U||!Kg1.has(U))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(U==="webhook"&&(Q==="resource-pack"||Q==="pack"||Q==="material-pack")&&J==="preview"){let W=z.command[3]??S(z.options.file)??S(z.options.input);if(!W)throw Error("Usage: seal-use webhook resource-pack preview <资源包.zip>");await U_0(W,hK(z.options));return}if(U==="openapi"){US0(z);return}if(U==="mcp-config"){tl();return}if(U==="skill"){PS0(Q,J,z);return}if(U==="mcp"||U==="server"){await eh0(Q,z);return}if(U==="probe"){await ZS0(Q,J,z);return}if(U==="doctor"){await bh0(Q,J,z);return}if(U==="test"){await Go(Q,J,z);return}if(U==="config"){lv0(Q,J,z);return}if(U==="service"){await Jo(Q,Y,z);return}if(U==="stop"){await Jo("stop",Y,z);return}if(U==="http"||U==="serve"){await rh0(z);return}if(U==="update"||U==="changelog"){let W=U==="changelog"||Q==="changelog"||Q==="log"||Q==="history"||F0(z.options.changelog)===!0,H=Q==="check"||F0(z.options.check)===!0||F0(z.options["check-only"])===!0,X=S(z.options.version)??S(z.options.tag)??(!W&&!H&&Q&&!Q.startsWith("-")?Q:void 0);await cS0(Y,{checkOnly:H,changelogOnly:W,limit:s0(z.options.limit),force:F0(z.options.force),targetVersion:X,repo:S(z.options.repo)});return}if(U==="tools"&&Q==="list"){SS0();return}if(U==="corps"||U==="corp"){if(Q==="regression"||Q==="test-regression"){awai
Line truncated
|
||||
`)?"":`
|
||||
`}`);process.exitCode=$.exitCode}var m7,eS0,kT="seal_cli",Eq="seal_cli_write",$g0="SEAL_USE_MCP_ENABLED",Yg0="SEAL_HOME_MCP_ENABLED",Lg1;var YS0=o(async()=>{Xe();Ve();B$();sl();sS0();L$();a9();m7=qg1(import.meta.url),eS0=m7.includes("/dist/mcp/")||m7.includes("\\dist\\mcp\\")?Tq(Tq(Tq(m7))):Tq(Tq(m7));Lg1=Boolean(I0.main==I0.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&aS0(process.argv[1])===aS0(m7));if(Lg1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await Vg1();else try{Qg0()}catch($){console.error($),process.exitCode=1}});await YS0();export{Nq as tokenizeCommand,Qg0 as startServer,zg0 as resolveMcpEnabled,Ug0 as createServer,$g0 as SEAL_MCP_ENABLED_ENV,Eq as SEAL_CLI_WRITE_TOOL_NAME,kT as SEAL_CLI_TOOL_NAME,Yg0 as LEGACY_SEAL_MCP_ENABLED_ENV};
|
||||
`}`);process.exitCode=$.exitCode}var m7,$g0,kT="seal_cli",Cq="seal_cli_write",Yg0="SEAL_USE_MCP_ENABLED",zg0="SEAL_HOME_MCP_ENABLED",wg1;var zS0=o(async()=>{Xe();Ve();B$();sl();aS0();L$();a9();m7=Lg1(import.meta.url),$g0=m7.includes("/dist/mcp/")||m7.includes("\\dist\\mcp\\")?jq(jq(jq(m7))):jq(jq(m7));wg1=Boolean(I0.main==I0.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&tS0(process.argv[1])===tS0(m7));if(wg1)if(process.argv[2]==="--seal-use-cli"||process.argv[2]==="--seal-home-cli")await Fg1();else try{Jg0()}catch($){console.error($),process.exitCode=1}});await zS0();export{Dq as tokenizeCommand,Jg0 as startServer,Ug0 as resolveMcpEnabled,Qg0 as createServer,Yg0 as SEAL_MCP_ENABLED_ENV,Cq as SEAL_CLI_WRITE_TOOL_NAME,kT as SEAL_CLI_TOOL_NAME,zg0 as LEGACY_SEAL_MCP_ENABLED_ENV};
|
||||
@@ -15,7 +15,7 @@ When MCP *is* available, two tools are exposed:
|
||||
- `seal_cli` — **read-only only.** Reads tenant state without changing it. It is annotated `readOnlyHint: true`, so clients may auto-approve it.
|
||||
- `seal_cli_write` — everything that mutates tenant state, publishes configuration, mints credentials, self-updates or starts a server. Annotated `destructiveHint: true`; **confirm the exact command with the user before calling it.**
|
||||
|
||||
The boundary is enforced, not merely advertised: `seal_cli` refuses any command that is not on its read-only allow-list, and unclassified commands fail closed. A refusal names `seal_cli_write` as the follow-up. `seal-use tool <name>` is not on the allow-list, so invoke the 98 internal tools through `seal_cli_write` only.
|
||||
The boundary is enforced, not merely advertised: `seal_cli` refuses any command that is not on its read-only allow-list, and unclassified commands fail closed. A refusal names `seal_cli_write` as the follow-up. `seal-use tool <name>` is allowed through `seal_cli` only for tools the registry classifies as read-only (`SEAL_READ_ONLY_TOOLS`); the rest need `seal_cli_write`.
|
||||
|
||||
This skill is a routing layer for agents: keep this file short, choose the right command, and read a focused reference only when the task needs detail.
|
||||
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { HELP_REGISTRY } from "./help.js";
|
||||
import { KNOWN_AREAS } from "./runner.js";
|
||||
import { SEAL_MUTATING_TOOLS, SEAL_READ_ONLY_TOOLS, sealTools } from "../domains/seal/tools.js";
|
||||
import { isReadOnlyCliCommand, listReadOnlyCommands } from "./read-only.js";
|
||||
|
||||
describe("CLI read-only classification", () => {
|
||||
test("the tool registry is classified exhaustively and without overlap", () => {
|
||||
const all = sealTools.map((tool) => tool.name);
|
||||
const classified = [...SEAL_READ_ONLY_TOOLS, ...SEAL_MUTATING_TOOLS];
|
||||
|
||||
// A newly added tool must fail here rather than silently defaulting into either bucket.
|
||||
expect(classified.slice().sort()).toEqual(all.slice().sort());
|
||||
for (const name of SEAL_READ_ONLY_TOOLS) {
|
||||
expect({ name, alsoMutating: SEAL_MUTATING_TOOLS.has(name) }).toEqual({ name, alsoMutating: false });
|
||||
}
|
||||
});
|
||||
|
||||
test("every allow-listed command exists in the help registry", () => {
|
||||
const byArea = new Map(HELP_REGISTRY.map((area) => [area.area, area.commands.map((c) => c.name)]));
|
||||
|
||||
@@ -59,7 +71,11 @@ describe("CLI read-only classification", () => {
|
||||
["update"],
|
||||
["stop"],
|
||||
["auth", "keys"],
|
||||
["tool", "seal_approval_search", "--json", "{}"],
|
||||
["analytics", "analyze", "record-1"],
|
||||
["tool", "seal_approval_rule_create", "--json", "{}"],
|
||||
["tool", "seal_webhook_delete", "--json", "{}"],
|
||||
["tool", "seal_insight_record_analyze", "--json", "{}"],
|
||||
["tool"],
|
||||
["totally-unknown", "list"],
|
||||
[]
|
||||
]) {
|
||||
@@ -67,6 +83,17 @@ describe("CLI read-only classification", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("routes `seal-use tool` through the tool registry's own classification", () => {
|
||||
for (const command of [
|
||||
["tool", "seal_approval_search", "--json", "{}"],
|
||||
["tool", "seal_approval_rules_list", "--corp", "corp-a"],
|
||||
["tool", "seal_whoami"],
|
||||
["tool", "seal_approval_run_flow_get", "--json", '{"sn":"B26002352"}']
|
||||
]) {
|
||||
expect({ command, readOnly: isReadOnlyCliCommand(command) }).toEqual({ command, readOnly: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("matches whole tokens, so a read prefix cannot smuggle a mutation", () => {
|
||||
for (const command of [
|
||||
["corps", "listing"],
|
||||
|
||||
+11
-1
@@ -1,3 +1,4 @@
|
||||
import { isReadOnlySealTool } from "../domains/seal/tools.js";
|
||||
import { parseArgs } from "./parser.js";
|
||||
|
||||
/**
|
||||
@@ -65,7 +66,9 @@ const READ_ONLY_COMMANDS: Record<string, string[]> = {
|
||||
llm: ["config", "providers"],
|
||||
permissions: ["available", "configs"],
|
||||
billing: ["status", "plans", "features"],
|
||||
analytics: ["insight", "risks", "performance", "analyze", "export"],
|
||||
// `analyze` is deliberately absent: it POSTs and starts an analysis server-side, so it is a
|
||||
// mutation despite reading like a query. See SEAL_MUTATING_TOOLS.
|
||||
analytics: ["insight", "risks", "performance", "export"],
|
||||
source: ["config"],
|
||||
tools: ["list"],
|
||||
skill: ["dump", "status"],
|
||||
@@ -101,6 +104,13 @@ export function isReadOnlyCliCommand(argv: string[]): boolean {
|
||||
|
||||
if (actionTokens.length === 0 && TOP_LEVEL_READ_ONLY.has(area)) return true;
|
||||
|
||||
// `seal-use tool <name>` reaches the internal tool registry, which carries its own exhaustive
|
||||
// read/write classification. Delegating to it keeps the two from drifting apart.
|
||||
if (area === "tool") {
|
||||
const toolName = actionTokens[0];
|
||||
return toolName !== undefined && isReadOnlySealTool(toolName);
|
||||
}
|
||||
|
||||
const allowed = READ_ONLY_COMMANDS[area];
|
||||
if (!allowed) return false;
|
||||
|
||||
|
||||
@@ -2684,6 +2684,128 @@ export const sealTools = [
|
||||
|
||||
export type SealTool = (typeof sealTools)[number];
|
||||
|
||||
/**
|
||||
* MCP read/write classification for the tool registry.
|
||||
*
|
||||
* The two sets are exhaustive by construction: `tools.test.ts` asserts they partition `sealTools`
|
||||
* exactly, so a newly added tool fails the suite until it is classified here. The read-only MCP tool
|
||||
* (`seal_cli`) may only invoke names in {@link SEAL_READ_ONLY_TOOLS}; everything else is reachable
|
||||
* solely through `seal_cli_write`.
|
||||
*
|
||||
* Read-only means it reads tenant state, or writes only a local file. Anything that creates, updates,
|
||||
* deletes, publishes, pushes, replays, uploads, activates or mints a credential counts as mutating —
|
||||
* including when it reads like a query. `seal_insight_record_analyze` is the instructive case: it
|
||||
* sounds like a read but issues a POST that starts an analysis server-side.
|
||||
*/
|
||||
export const SEAL_READ_ONLY_TOOLS: ReadonlySet<string> = new Set([
|
||||
"seal_approval_context_get",
|
||||
"seal_approval_document_get",
|
||||
"seal_approval_documents_list",
|
||||
"seal_approval_rule_get",
|
||||
"seal_approval_rule_version_get",
|
||||
"seal_approval_rule_versions_list",
|
||||
"seal_approval_rules_lint",
|
||||
"seal_approval_rules_list",
|
||||
"seal_approval_rules_pull",
|
||||
"seal_approval_run_attachments_get",
|
||||
"seal_approval_run_cited_rules_get",
|
||||
"seal_approval_run_document_summary_get",
|
||||
"seal_approval_run_flow_get",
|
||||
"seal_approval_run_get",
|
||||
"seal_approval_run_langfuse_bridge_get",
|
||||
"seal_approval_run_pick",
|
||||
"seal_approval_run_result_get",
|
||||
"seal_approval_run_url_get",
|
||||
"seal_approval_runs_count",
|
||||
"seal_approval_runs_export",
|
||||
"seal_approval_runs_search",
|
||||
"seal_approval_runs_stats",
|
||||
"seal_approval_runs_summary",
|
||||
"seal_approval_search",
|
||||
"seal_approval_style_preferences_get",
|
||||
"seal_billing_features_list",
|
||||
"seal_billing_plans_list",
|
||||
"seal_billing_status_get",
|
||||
"seal_contacts_department_children_list",
|
||||
"seal_contacts_department_get",
|
||||
"seal_contacts_department_users_list",
|
||||
"seal_contacts_departments_root_list",
|
||||
"seal_contacts_last_sync_time_get",
|
||||
"seal_delegation_list",
|
||||
"seal_deploy_hosecloud_get",
|
||||
"seal_deploy_hosecloud_list",
|
||||
"seal_deploy_hosecloud_requirements",
|
||||
"seal_deploy_hosecloud_status",
|
||||
"seal_expenses_list",
|
||||
"seal_insight_export",
|
||||
"seal_insight_performance_get",
|
||||
"seal_insight_risks_by_tag_get",
|
||||
"seal_insight_stats_get",
|
||||
"seal_invoices_list",
|
||||
"seal_llm_config_get",
|
||||
"seal_llm_providers_list",
|
||||
"seal_permissions_available_list",
|
||||
"seal_permissions_configs_list",
|
||||
"seal_preference_get",
|
||||
"seal_preference_thinking_depth_policies_list",
|
||||
"seal_session_get",
|
||||
"seal_simulation_batch_get",
|
||||
"seal_simulation_batch_records_get",
|
||||
"seal_simulation_batch_status",
|
||||
"seal_simulation_batch_wait",
|
||||
"seal_simulation_batches_list",
|
||||
"seal_simulation_feishu_approval_definitions_list",
|
||||
"seal_simulation_integrations_get",
|
||||
"seal_simulation_specifications_list",
|
||||
"seal_simulation_templates_get",
|
||||
"seal_user_get",
|
||||
"seal_user_search",
|
||||
"seal_webhook_get",
|
||||
"seal_webhook_list",
|
||||
"seal_webhook_ready",
|
||||
"seal_whoami"
|
||||
]);
|
||||
|
||||
export const SEAL_MUTATING_TOOLS: ReadonlySet<string> = new Set([
|
||||
"seal_approval_delete_document",
|
||||
"seal_approval_document_create",
|
||||
"seal_approval_document_update",
|
||||
"seal_approval_rule_create",
|
||||
"seal_approval_rule_delete",
|
||||
"seal_approval_rule_update",
|
||||
"seal_approval_rule_version_publish",
|
||||
"seal_approval_rules_clear",
|
||||
"seal_approval_rules_push",
|
||||
"seal_approval_style_preferences_update",
|
||||
"seal_delegation_create",
|
||||
"seal_delegation_revoke",
|
||||
"seal_deploy_hosecloud_configure",
|
||||
"seal_deploy_hosecloud_sync",
|
||||
"seal_insight_record_analyze",
|
||||
"seal_preference_decision_update",
|
||||
"seal_preference_thinking_depth_policies_remove",
|
||||
"seal_preference_thinking_depth_policies_upsert",
|
||||
"seal_preference_thinking_depth_set",
|
||||
"seal_simulation_batch_clean",
|
||||
"seal_simulation_batch_create",
|
||||
"seal_simulation_material_package_upload",
|
||||
"seal_user_activate",
|
||||
"seal_user_create",
|
||||
"seal_user_delegation_create",
|
||||
"seal_user_delete",
|
||||
"seal_user_reset_password",
|
||||
"seal_webhook_add",
|
||||
"seal_webhook_delete",
|
||||
"seal_webhook_material_pack",
|
||||
"seal_webhook_replay",
|
||||
"seal_webhook_update"
|
||||
]);
|
||||
|
||||
export function isReadOnlySealTool(name: string): boolean {
|
||||
return SEAL_READ_ONLY_TOOLS.has(name);
|
||||
}
|
||||
|
||||
|
||||
const sealToolByName = new Map<string, SealTool>(
|
||||
sealTools.map((tool) => [tool.name, tool])
|
||||
);
|
||||
|
||||
+3
-2
@@ -131,7 +131,8 @@ describe("seal-use MCP server", () => {
|
||||
"seal-use webhook replay",
|
||||
"seal-use update",
|
||||
"seal-use mcp",
|
||||
"seal-use tool seal_approval_search --json '{}'",
|
||||
"seal-use tool seal_approval_rule_create --json '{}'",
|
||||
"seal-use tool seal_webhook_replay --json '{}'",
|
||||
"seal-use totally-unknown-area list",
|
||||
""
|
||||
]) {
|
||||
@@ -141,7 +142,7 @@ describe("seal-use MCP server", () => {
|
||||
|
||||
// Read-only commands must get past the policy; `version` is a top-level command with no
|
||||
// registry row, and `corp` is an area alias the CLI dispatches as `corps`.
|
||||
for (const command of ["seal-use version", "seal-use corps list", "seal-use corp list"]) {
|
||||
for (const command of ["seal-use version", "seal-use corps list", "seal-use corp list", "seal-use tool seal_approval_search --json '{}'"]) {
|
||||
const allowed = await callRead(command);
|
||||
expect({ command, refusedByPolicy: allowed.text.includes("only runs read-only commands") }).toEqual({
|
||||
command,
|
||||
|
||||
Reference in new issue
Block a user