@telia-ace/alliance-cli 4.0.0-next.9 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-N2CDOUZC.js +399 -0
- package/dist/chunk-XJQR7EZD.js +8 -0
- package/dist/index.js +1 -1
- package/dist/{jwt-ARROXAEA.js → jwt-E6TAS4VE.js} +1 -1
- package/dist/{public-key-GRPF4KHS.js → public-key-JP5EX6FK.js} +1 -1
- package/dist/{serve-4CGYCEYF.js → serve-NKWFSQIB.js} +1 -1
- package/dist/{upgrade-P3X5DB22.js → upgrade-CLZT4VIC.js} +1 -1
- package/package.json +6 -6
- package/dist/build-B7JNCB5Q.js +0 -402
- package/dist/chunk-MJYEZ65F.js +0 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as c__createRequire } from 'node:module';
|
|
2
|
+
const require = c__createRequire(import.meta.url);
|
|
3
|
+
import{a as $,b as Oe,c as P}from"./chunk-SQJLD7IF.js";import{d as ot}from"./chunk-MCRDX3J3.js";import{existsSync as z,readFileSync as at}from"fs";import{relative as je,resolve as D}from"path";var g={};ot(g,{BRAND:()=>Rt,DIRTY:()=>J,EMPTY_PATH:()=>lt,INVALID:()=>h,NEVER:()=>yr,OK:()=>k,ParseStatus:()=>b,Schema:()=>v,ZodAny:()=>W,ZodArray:()=>V,ZodBigInt:()=>Y,ZodBoolean:()=>G,ZodBranded:()=>_e,ZodCatch:()=>oe,ZodDate:()=>K,ZodDefault:()=>ie,ZodDiscriminatedUnion:()=>Ae,ZodEffects:()=>j,ZodEnum:()=>ne,ZodError:()=>w,ZodFirstPartyTypeKind:()=>m,ZodFunction:()=>Se,ZodIntersection:()=>te,ZodIssueCode:()=>c,ZodLazy:()=>re,ZodLiteral:()=>se,ZodMap:()=>me,ZodNaN:()=>ye,ZodNativeEnum:()=>ae,ZodNever:()=>N,ZodNull:()=>X,ZodNullable:()=>R,ZodNumber:()=>H,ZodObject:()=>T,ZodOptional:()=>C,ZodParsedType:()=>u,ZodPipeline:()=>xe,ZodPromise:()=>B,ZodReadonly:()=>ce,ZodRecord:()=>Ce,ZodSchema:()=>v,ZodSet:()=>ge,ZodString:()=>U,ZodSymbol:()=>pe,ZodTransformer:()=>j,ZodTuple:()=>E,ZodType:()=>v,ZodUndefined:()=>Q,ZodUnion:()=>ee,ZodUnknown:()=>L,ZodVoid:()=>he,addIssueToContext:()=>d,any:()=>Ft,array:()=>qt,bigint:()=>Zt,boolean:()=>Ge,coerce:()=>gr,custom:()=>Je,date:()=>Lt,datetimeRegex:()=>Be,defaultErrorMap:()=>M,discriminatedUnion:()=>Gt,effect:()=>cr,enum:()=>ar,function:()=>rr,getErrorMap:()=>ue,getParsedType:()=>I,instanceof:()=>Pt,intersection:()=>Kt,isAborted:()=>we,isAsync:()=>le,isDirty:()=>Te,isValid:()=>F,late:()=>$t,lazy:()=>sr,literal:()=>nr,makeIssue:()=>ve,map:()=>er,nan:()=>Mt,nativeEnum:()=>ir,never:()=>Wt,null:()=>Dt,nullable:()=>ur,number:()=>Ye,object:()=>Jt,objectUtil:()=>Ie,oboolean:()=>mr,onumber:()=>hr,optional:()=>dr,ostring:()=>pr,pipeline:()=>fr,preprocess:()=>lr,promise:()=>or,quotelessJson:()=>ct,record:()=>Xt,set:()=>tr,setErrorMap:()=>ut,strictObject:()=>Ht,string:()=>He,symbol:()=>Vt,transformer:()=>cr,tuple:()=>Qt,undefined:()=>zt,union:()=>Yt,unknown:()=>Ut,util:()=>_,void:()=>Bt});var _;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let a={};for(let i of n)a[i]=i;return a},t.getValidEnumValues=n=>{let a=t.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of a)i[o]=n[o];return t.objectValues(i)},t.objectValues=n=>t.objectKeys(n).map(function(a){return n[a]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},t.find=(n,a)=>{for(let i of n)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(_||(_={}));var Ie;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ie||(Ie={}));var u=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),I=t=>{switch(typeof t){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(t)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(t)?u.array:t===null?u.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?u.promise:typeof Map<"u"&&t instanceof Map?u.map:typeof Set<"u"&&t instanceof Set?u.set:typeof Date<"u"&&t instanceof Date?u.date:u.object;default:return u.unknown}};var c=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ct=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),w=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},s={_errors:[]},n=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(r(i));else{let o=s,f=0;for(;f<i.path.length;){let l=i.path[f];f===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(i))):o[l]=o[l]||{_errors:[]},o=o[l],f++}}};return n(this),s}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},s=[];for(let n of this.issues)if(n.path.length>0){let a=n.path[0];r[a]=r[a]||[],r[a].push(e(n))}else s.push(e(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}};w.create=t=>new w(t);var dt=(t,e)=>{let r;switch(t.code){case c.invalid_type:t.received===u.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case c.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,_.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:r=`Unrecognized key(s) in object: ${_.joinValues(t.keys,", ")}`;break;case c.invalid_union:r="Invalid input";break;case c.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_.joinValues(t.options)}`;break;case c.invalid_enum_value:r=`Invalid enum value. Expected ${_.joinValues(t.options)}, received '${t.received}'`;break;case c.invalid_arguments:r="Invalid function arguments";break;case c.invalid_return_type:r="Invalid function return type";break;case c.invalid_date:r="Invalid date";break;case c.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:_.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case c.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case c.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case c.custom:r="Invalid input";break;case c.invalid_intersection_types:r="Intersection results could not be merged";break;case c.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case c.not_finite:r="Number must be finite";break;default:r=e.defaultError,_.assertNever(t)}return{message:r}},M=dt;var ze=M;function ut(t){ze=t}function ue(){return ze}var ve=t=>{let{data:e,path:r,errorMaps:s,issueData:n}=t,a=[...r,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="",f=s.filter(l=>!!l).slice().reverse();for(let l of f)o=l(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},lt=[];function d(t,e){let r=ue(),s=ve({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===M?void 0:M].filter(n=>!!n)});t.common.issues.push(s)}var b=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let s=[];for(let n of r){if(n.status==="aborted")return h;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){let s=[];for(let n of r){let a=await n.key,i=await n.value;s.push({key:a,value:i})}return t.mergeObjectSync(e,s)}static mergeObjectSync(e,r){let s={};for(let n of r){let{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return h;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}},h=Object.freeze({status:"aborted"}),J=t=>({status:"dirty",value:t}),k=t=>({status:"valid",value:t}),we=t=>t.status==="aborted",Te=t=>t.status==="dirty",F=t=>t.status==="valid",le=t=>typeof Promise<"u"&&t instanceof Promise;var p;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(p||(p={}));var S=class{constructor(e,r,s,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},De=(t,e)=>{if(F(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new w(t.common.issues);return this._error=r,this._error}}};function y(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:s,description:n}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{let{message:f}=t;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??s??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??r??o.defaultError}},description:n}}var v=class{get description(){return this._def.description}_getType(e){return I(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:I(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:I(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(le(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){let s={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(e)},n=this._parseSync({data:e,path:s.path,parent:s});return De(s,n)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:r});return F(s)?{value:s.value}:{issues:r.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(s=>F(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(e,r){let s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){let s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(le(n)?n:Promise.resolve(n));return De(s,a)}refine(e,r){let s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,a)=>{let i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(e){return new j({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return C.create(this,this._def)}nullable(){return R.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V.create(this)}promise(){return B.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new j({...y(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new ie({...y(this._def),innerType:this,defaultValue:r,typeName:m.ZodDefault})}brand(){return new _e({typeName:m.ZodBranded,type:this,...y(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new oe({...y(this._def),innerType:this,catchValue:r,typeName:m.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return ce.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ft=/^c[^\s-]{8,}$/i,pt=/^[0-9a-z]+$/,ht=/^[0-9A-HJKMNP-TV-Z]{26}$/i,mt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gt=/^[a-z0-9_-]{21}$/i,yt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_t=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ee,bt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,kt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Tt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,At=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ct=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ue="((\\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])))",St=new RegExp(`^${Ue}$`);function We(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function jt(t){return new RegExp(`^${We(t)}$`)}function Be(t){let e=`${Ue}T${We(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Nt(t,e){return!!((e==="v4"||!e)&&bt.test(t)||(e==="v6"||!e)&&wt.test(t))}function Ot(t,e){if(!yt.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function It(t,e){return!!((e==="v4"||!e)&&kt.test(t)||(e==="v6"||!e)&&Tt.test(t))}var U=class t extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.string,received:a.parsedType}),h}let s=new b,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?d(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&d(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")_t.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Ee||(Ee=new RegExp(xt,"u")),Ee.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")mt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")gt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")ft.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")pt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")ht.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),d(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?Be(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?St.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?jt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?vt.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Nt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Ot(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?It(e.data,a.version)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?At.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?Ct.test(e.data)||(n=this._getOrReturnCtx(e,n),d(n,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):_.assertNever(a);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(n=>e.test(n),{validation:r,code:c.invalid_string,...p.errToObj(s)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...p.errToObj(e)})}url(e){return this._addCheck({kind:"url",...p.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...p.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...p.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...p.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...p.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...p.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...p.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...p.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...p.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...p.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...p.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...p.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...p.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...p.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...p.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...p.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...p.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...p.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...p.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...p.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...p.errToObj(r)})}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};U.create=t=>new U({checks:[],typeName:m.ZodString,coerce:t?.coerce??!1,...y(t)});function Et(t,e){let r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=r>s?r:s,a=Number.parseInt(t.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}var H=class t extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.number,received:a.parsedType}),h}let s,n=new b;for(let a of this._def.checks)a.kind==="int"?_.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Et(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_finite,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,s,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:p.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}};H.create=t=>new H({checks:[],typeName:m.ZodNumber,coerce:t?.coerce||!1,...y(t)});var Y=class t extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let s,n=new b;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),d(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.bigint,received:r.parsedType}),h}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,s,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:p.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Y.create=t=>new Y({checks:[],typeName:m.ZodBigInt,coerce:t?.coerce??!1,...y(t)});var G=class extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.boolean,received:s.parsedType}),h}return k(e.data)}};G.create=t=>new G({typeName:m.ZodBoolean,coerce:t?.coerce||!1,...y(t)});var K=class t extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_type,expected:u.date,received:a.parsedType}),h}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return d(a,{code:c.invalid_date}),h}let s=new b,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),d(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):_.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:p.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};K.create=t=>new K({checks:[],coerce:t?.coerce||!1,typeName:m.ZodDate,...y(t)});var pe=class extends v{_parse(e){if(this._getType(e)!==u.symbol){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.symbol,received:s.parsedType}),h}return k(e.data)}};pe.create=t=>new pe({typeName:m.ZodSymbol,...y(t)});var Q=class extends v{_parse(e){if(this._getType(e)!==u.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.undefined,received:s.parsedType}),h}return k(e.data)}};Q.create=t=>new Q({typeName:m.ZodUndefined,...y(t)});var X=class extends v{_parse(e){if(this._getType(e)!==u.null){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.null,received:s.parsedType}),h}return k(e.data)}};X.create=t=>new X({typeName:m.ZodNull,...y(t)});var W=class extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}};W.create=t=>new W({typeName:m.ZodAny,...y(t)});var L=class extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}};L.create=t=>new L({typeName:m.ZodUnknown,...y(t)});var N=class extends v{_parse(e){let r=this._getOrReturnCtx(e);return d(r,{code:c.invalid_type,expected:u.never,received:r.parsedType}),h}};N.create=t=>new N({typeName:m.ZodNever,...y(t)});var he=class extends v{_parse(e){if(this._getType(e)!==u.undefined){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.void,received:s.parsedType}),h}return k(e.data)}};he.create=t=>new he({typeName:m.ZodVoid,...y(t)});var V=class t extends v{_parse(e){let{ctx:r,status:s}=this._processInputParams(e),n=this._def;if(r.parsedType!==u.array)return d(r,{code:c.invalid_type,expected:u.array,received:r.parsedType}),h;if(n.exactLength!==null){let i=r.data.length>n.exactLength.value,o=r.data.length<n.exactLength.value;(i||o)&&(d(r,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(d(r,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(d(r,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>n.type._parseAsync(new S(r,i,r.path,o)))).then(i=>b.mergeArray(s,i));let a=[...r.data].map((i,o)=>n.type._parseSync(new S(r,i,r.path,o)));return b.mergeArray(s,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:p.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:p.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:p.toString(r)}})}nonempty(e){return this.min(1,e)}};V.create=(t,e)=>new V({type:t,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...y(e)});function fe(t){if(t instanceof T){let e={};for(let r in t.shape){let s=t.shape[r];e[r]=C.create(fe(s))}return new T({...t._def,shape:()=>e})}else return t instanceof V?new V({...t._def,type:fe(t.element)}):t instanceof C?C.create(fe(t.unwrap())):t instanceof R?R.create(fe(t.unwrap())):t instanceof E?E.create(t.items.map(e=>fe(e))):t}var T=class t extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=_.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==u.object){let l=this._getOrReturnCtx(e);return d(l,{code:c.invalid_type,expected:u.object,received:l.parsedType}),h}let{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof N&&this._def.unknownKeys==="strip"))for(let l in n.data)i.includes(l)||o.push(l);let f=[];for(let l of i){let x=a[l],A=n.data[l];f.push({key:{status:"valid",value:l},value:x._parse(new S(n,A,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof N){let l=this._def.unknownKeys;if(l==="passthrough")for(let x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(l==="strict")o.length>0&&(d(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let x of o){let A=n.data[x];f.push({key:{status:"valid",value:x},value:l._parse(new S(n,A,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let l=[];for(let x of f){let A=await x.key,Ve=await x.value;l.push({key:A,value:Ve,alwaysSet:x.alwaysSet})}return l}).then(l=>b.mergeObjectSync(s,l)):b.mergeObjectSync(s,f)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{let n=this._def.errorMap?.(r,s).message??s.defaultError;return r.code==="unrecognized_keys"?{message:p.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let s of _.objectKeys(e))e[s]&&this.shape[s]&&(r[s]=this.shape[s]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let s of _.objectKeys(this.shape))e[s]||(r[s]=this.shape[s]);return new t({...this._def,shape:()=>r})}deepPartial(){return fe(this)}partial(e){let r={};for(let s of _.objectKeys(this.shape)){let n=this.shape[s];e&&!e[s]?r[s]=n:r[s]=n.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let s of _.objectKeys(this.shape))if(e&&!e[s])r[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof C;)a=a._def.innerType;r[s]=a}return new t({...this._def,shape:()=>r})}keyof(){return qe(_.objectKeys(this.shape))}};T.create=(t,e)=>new T({shape:()=>t,unknownKeys:"strip",catchall:N.create(),typeName:m.ZodObject,...y(e)});T.strictCreate=(t,e)=>new T({shape:()=>t,unknownKeys:"strict",catchall:N.create(),typeName:m.ZodObject,...y(e)});T.lazycreate=(t,e)=>new T({shape:t,unknownKeys:"strip",catchall:N.create(),typeName:m.ZodObject,...y(e)});var ee=class extends v{_parse(e){let{ctx:r}=this._processInputParams(e),s=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new w(o.ctx.common.issues));return d(r,{code:c.invalid_union,unionErrors:i}),h}if(r.common.async)return Promise.all(s.map(async a=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let f of s){let l={...r,common:{...r.common,issues:[]},parent:null},x=f._parseSync({data:r.data,path:r.path,parent:l});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(f=>new w(f));return d(r,{code:c.invalid_union,unionErrors:o}),h}}get options(){return this._def.options}};ee.create=(t,e)=>new ee({options:t,typeName:m.ZodUnion,...y(e)});var Z=t=>t instanceof re?Z(t.schema):t instanceof j?Z(t.innerType()):t instanceof se?[t.value]:t instanceof ne?t.options:t instanceof ae?_.objectValues(t.enum):t instanceof ie?Z(t._def.innerType):t instanceof Q?[void 0]:t instanceof X?[null]:t instanceof C?[void 0,...Z(t.unwrap())]:t instanceof R?[null,...Z(t.unwrap())]:t instanceof _e||t instanceof ce?Z(t.unwrap()):t instanceof oe?Z(t._def.innerType):[],Ae=class t extends v{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return d(r,{code:c.invalid_type,expected:u.object,received:r.parsedType}),h;let s=this.discriminator,n=r.data[s],a=this.optionsMap.get(n);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(d(r,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),h)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){let n=new Map;for(let a of r){let i=Z(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new t({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...y(s)})}};function Re(t,e){let r=I(t),s=I(e);if(t===e)return{valid:!0,data:t};if(r===u.object&&s===u.object){let n=_.objectKeys(e),a=_.objectKeys(t).filter(o=>n.indexOf(o)!==-1),i={...t,...e};for(let o of a){let f=Re(t[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(r===u.array&&s===u.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<t.length;a++){let i=t[a],o=e[a],f=Re(i,o);if(!f.valid)return{valid:!1};n.push(f.data)}return{valid:!0,data:n}}else return r===u.date&&s===u.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var te=class extends v{_parse(e){let{status:r,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(we(a)||we(i))return h;let o=Re(a.value,i.value);return o.valid?((Te(a)||Te(i))&&r.dirty(),{status:r.value,value:o.data}):(d(s,{code:c.invalid_intersection_types}),h)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};te.create=(t,e,r)=>new te({left:t,right:e,typeName:m.ZodIntersection,...y(r)});var E=class t extends v{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.array)return d(s,{code:c.invalid_type,expected:u.array,received:s.parsedType}),h;if(s.data.length<this._def.items.length)return d(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),h;!this._def.rest&&s.data.length>this._def.items.length&&(d(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...s.data].map((i,o)=>{let f=this._def.items[o]||this._def.rest;return f?f._parse(new S(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>b.mergeArray(r,i)):b.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};E.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new E({items:t,typeName:m.ZodTuple,rest:null,...y(e)})};var Ce=class t extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.object)return d(s,{code:c.invalid_type,expected:u.object,received:s.parsedType}),h;let n=[],a=this._def.keyType,i=this._def.valueType;for(let o in s.data)n.push({key:a._parse(new S(s,o,s.path,o)),value:i._parse(new S(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?b.mergeObjectAsync(r,n):b.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof v?new t({keyType:e,valueType:r,typeName:m.ZodRecord,...y(s)}):new t({keyType:U.create(),valueType:e,typeName:m.ZodRecord,...y(r)})}},me=class extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.map)return d(s,{code:c.invalid_type,expected:u.map,received:s.parsedType}),h;let n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,f],l)=>({key:n._parse(new S(s,o,s.path,[l,"key"])),value:a._parse(new S(s,f,s.path,[l,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let f of i){let l=await f.key,x=await f.value;if(l.status==="aborted"||x.status==="aborted")return h;(l.status==="dirty"||x.status==="dirty")&&r.dirty(),o.set(l.value,x.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let f of i){let l=f.key,x=f.value;if(l.status==="aborted"||x.status==="aborted")return h;(l.status==="dirty"||x.status==="dirty")&&r.dirty(),o.set(l.value,x.value)}return{status:r.value,value:o}}}};me.create=(t,e,r)=>new me({valueType:e,keyType:t,typeName:m.ZodMap,...y(r)});var ge=class t extends v{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.set)return d(s,{code:c.invalid_type,expected:u.set,received:s.parsedType}),h;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(d(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(d(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let l=new Set;for(let x of f){if(x.status==="aborted")return h;x.status==="dirty"&&r.dirty(),l.add(x.value)}return{status:r.value,value:l}}let o=[...s.data.values()].map((f,l)=>a._parse(new S(s,f,s.path,l)));return s.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:p.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:p.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};ge.create=(t,e)=>new ge({valueType:t,minSize:null,maxSize:null,typeName:m.ZodSet,...y(e)});var Se=class t extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==u.function)return d(r,{code:c.invalid_type,expected:u.function,received:r.parsedType}),h;function s(o,f){return ve({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ue(),M].filter(l=>!!l),issueData:{code:c.invalid_arguments,argumentsError:f}})}function n(o,f){return ve({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ue(),M].filter(l=>!!l),issueData:{code:c.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof B){let o=this;return k(async function(...f){let l=new w([]),x=await o._def.args.parseAsync(f,a).catch(Ne=>{throw l.addIssue(s(f,Ne)),l}),A=await Reflect.apply(i,this,x);return await o._def.returns._def.type.parseAsync(A,a).catch(Ne=>{throw l.addIssue(n(A,Ne)),l})})}else{let o=this;return k(function(...f){let l=o._def.args.safeParse(f,a);if(!l.success)throw new w([s(f,l.error)]);let x=Reflect.apply(i,this,l.data),A=o._def.returns.safeParse(x,a);if(!A.success)throw new w([n(x,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:E.create(e).rest(L.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,s){return new t({args:e||E.create([]).rest(L.create()),returns:r||L.create(),typeName:m.ZodFunction,...y(s)})}},re=class extends v{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};re.create=(t,e)=>new re({getter:t,typeName:m.ZodLazy,...y(e)});var se=class extends v{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return d(r,{received:r.data,code:c.invalid_literal,expected:this._def.value}),h}return{status:"valid",value:e.data}}get value(){return this._def.value}};se.create=(t,e)=>new se({value:t,typeName:m.ZodLiteral,...y(e)});function qe(t,e){return new ne({values:t,typeName:m.ZodEnum,...y(e)})}var ne=class t extends v{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),s=this._def.values;return d(r,{expected:_.joinValues(s),received:r.parsedType,code:c.invalid_type}),h}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),s=this._def.values;return d(r,{received:r.data,code:c.invalid_enum_value,options:s}),h}return k(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}};ne.create=qe;var ae=class extends v{_parse(e){let r=_.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==u.string&&s.parsedType!==u.number){let n=_.objectValues(r);return d(s,{expected:_.joinValues(n),received:s.parsedType,code:c.invalid_type}),h}if(this._cache||(this._cache=new Set(_.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=_.objectValues(r);return d(s,{received:s.data,code:c.invalid_enum_value,options:n}),h}return k(e.data)}get enum(){return this._def.values}};ae.create=(t,e)=>new ae({values:t,typeName:m.ZodNativeEnum,...y(e)});var B=class extends v{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==u.promise&&r.common.async===!1)return d(r,{code:c.invalid_type,expected:u.promise,received:r.parsedType}),h;let s=r.parsedType===u.promise?r.data:Promise.resolve(r.data);return k(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};B.create=(t,e)=>new B({type:t,typeName:m.ZodPromise,...y(e)});var j=class extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{d(s,i),i.fatal?r.abort():r.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return h;let f=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return f.status==="aborted"?h:f.status==="dirty"?J(f.value):r.value==="dirty"?J(f.value):f});{if(r.value==="aborted")return h;let o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?h:o.status==="dirty"?J(o.value):r.value==="dirty"?J(o.value):o}}if(n.type==="refinement"){let i=o=>{let f=n.refinement(o,a);if(s.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?h:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?h:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!F(i))return h;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>F(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:r.value,value:o})):h);_.assertNever(n)}};j.create=(t,e,r)=>new j({schema:t,typeName:m.ZodEffects,effect:e,...y(r)});j.createWithPreprocess=(t,e,r)=>new j({schema:e,effect:{type:"preprocess",transform:t},typeName:m.ZodEffects,...y(r)});var C=class extends v{_parse(e){return this._getType(e)===u.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};C.create=(t,e)=>new C({innerType:t,typeName:m.ZodOptional,...y(e)});var R=class extends v{_parse(e){return this._getType(e)===u.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};R.create=(t,e)=>new R({innerType:t,typeName:m.ZodNullable,...y(e)});var ie=class extends v{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return r.parsedType===u.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ie.create=(t,e)=>new ie({innerType:t,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});var oe=class extends v{_parse(e){let{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return le(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new w(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new w(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};oe.create=(t,e)=>new oe({innerType:t,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});var ye=class extends v{_parse(e){if(this._getType(e)!==u.nan){let s=this._getOrReturnCtx(e);return d(s,{code:c.invalid_type,expected:u.nan,received:s.parsedType}),h}return{status:"valid",value:e.data}}};ye.create=t=>new ye({typeName:m.ZodNaN,...y(t)});var Rt=Symbol("zod_brand"),_e=class extends v{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}},xe=class t extends v{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?h:a.status==="dirty"?(r.dirty(),J(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?h:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,r){return new t({in:e,out:r,typeName:m.ZodPipeline})}},ce=class extends v{_parse(e){let r=this._def.innerType._parse(e),s=n=>(F(n)&&(n.value=Object.freeze(n.value)),n);return le(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}};ce.create=(t,e)=>new ce({innerType:t,typeName:m.ZodReadonly,...y(e)});function Fe(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Je(t,e={},r){return t?W.create().superRefine((s,n)=>{let a=t(s);if(a instanceof Promise)return a.then(i=>{if(!i){let o=Fe(e,s),f=o.fatal??r??!0;n.addIssue({code:"custom",...o,fatal:f})}});if(!a){let i=Fe(e,s),o=i.fatal??r??!0;n.addIssue({code:"custom",...i,fatal:o})}}):W.create()}var $t={object:T.lazycreate},m;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(m||(m={}));var Pt=(t,e={message:`Input not instance of ${t.name}`})=>Je(r=>r instanceof t,e),He=U.create,Ye=H.create,Mt=ye.create,Zt=Y.create,Ge=G.create,Lt=K.create,Vt=pe.create,zt=Q.create,Dt=X.create,Ft=W.create,Ut=L.create,Wt=N.create,Bt=he.create,qt=V.create,Jt=T.create,Ht=T.strictCreate,Yt=ee.create,Gt=Ae.create,Kt=te.create,Qt=E.create,Xt=Ce.create,er=me.create,tr=ge.create,rr=Se.create,sr=re.create,nr=se.create,ar=ne.create,ir=ae.create,or=B.create,cr=j.create,dr=C.create,ur=R.create,lr=j.createWithPreprocess,fr=xe.create,pr=()=>He().optional(),hr=()=>Ye().optional(),mr=()=>Ge().optional(),gr={string:t=>U.create({...t,coerce:!0}),number:t=>H.create({...t,coerce:!0}),boolean:t=>G.create({...t,coerce:!0}),bigint:t=>Y.create({...t,coerce:!0}),date:t=>K.create({...t,coerce:!0})};var yr=h;var vr=g.object({}),_r=g.object({alias:g.object({}).passthrough().default({}).describe("Equivalent to `vite.resolve.alias`.\n\nhttps://vitejs.dev/config/shared-options.html#resolve-alias"),plugins:g.any().array().default([]).describe("Equivalent to `vite.plugins`.\n\nhttps://vitejs.dev/config/shared-options.html#plugins")}),xr=g.object({server:g.number().default(3e3).describe("The port that the dev server should use."),gateway:g.number().default(3001).describe("The port that the api gateway should use.")}),br=g.object({apps:g.string().array().default([]).describe(`Additional apps to include.
|
|
4
|
+
|
|
5
|
+
Note: additional apps need to be added as devDependencies.`),ports:xr.default({}).describe("Options for ports."),open:g.boolean().default(!1).describe("Whether the dev server should automatically open in your browser or not."),logging:g.boolean().default(!1).describe("Whether the dev server and browser console should output more log information or not.")}),kr=g.object({mode:g.string().default("production").describe("Which mode to use when building the app. [production | development]"),watch:g.boolean().default(!1).describe("Whether the build should start watching and rebuild when files change or not.")}),wr=g.object({app:g.string().default("./src/app.ts").describe("The entry file for the app."),manifest:g.string().default("./src/manifest.json").describe("The entry file for the app manifest.")}),be=g.object({vite:_r.default({}).describe("Options related to Vite."),server:br.default({}).describe("Options related to the dev server."),entries:wr.default({}).describe("Options related to the app entry points."),build:kr.default({}).describe("Options related to app build."),experimental:vr.default({}).describe("Experimental options.")}),Tr=g.enum(["build","serve"]),Ar=g.object({command:Tr,mode:g.string()}),Cr=g.function().args(Ar).returns(be.or(g.promise(be))),As=g.function().args(g.union([be,Cr]));var Sr=g.enum(["necessary","functional","analytics","marketing"]),jr=g.object({purpose:g.string().describe("Purpose of the storing the value."),category:Sr.describe("Category of the storage value - necessary, functional, analytics or marketing."),lifespan:g.string().describe("Basic description of how long the value will be stored.")}),Nr=g.record(jr.describe("Key used when writing to the storage.")),Or=g.object({value:g.string().describe("The localization token default value."),description:g.string().describe("The localization token description.")}),Ir=g.object({localization:g.record(Or.describe("Key used when getting the localized text.")).default({}).describe("Translateable texts used in the app")}),Er=g.object({common:g.object({order:g.number().optional().describe("Order of the capability in the common capabilities list."),variant:g.enum(["primary","secondary","expressive","destructive","text","primary-white","secondary-white","expressive-white","tertiary-purple"]).default("secondary").describe("Variant of the capability button.")}).optional().describe("Common capability configuration."),label:g.string().optional().describe("Label for the capability.")}),Rr=g.object({name:g.string().describe("URL friendly name of the app."),endpoints:g.string().array().default([]).describe("Endpoints that should be communicated with using the API gateway."),permissions:g.string().array().default([]).describe("Permissions that can be added to user roles."),resources:Ir.default({}).describe("Resources used by the app."),storage:Nr.default({}).describe("Cookies, session storage, and local storage values that are used by the app."),capabilities:g.record(Er.describe("Capability key.")).default({}).describe("Capabilities that the app has.")}).passthrough();function Ke(t,e){let r=Rr.safeParse(t);return r.success?r.data:Qe(r.error.format(),e?[e]:[]).join(`
|
|
6
|
+
`)}function Qe(t,e=[],r=""){t._errors?.length&&e.push(`${r} - ${t._errors.join(" + ")}`);for(let[s,n]of Object.entries(t))s==="_errors"||!n||typeof n!="object"||Array.isArray(n)||Qe(n,e,r?`${r}.${s}`:s);return e}function $e(t){if(t===null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Pe(t,e,r=".",s){if(!$e(e))return Pe(t,{},r,s);let n=Object.assign({},e);for(let a in t){if(a==="__proto__"||a==="constructor")continue;let i=t[a];i!=null&&(s&&s(n,a,i,r)||(Array.isArray(i)&&Array.isArray(n[a])?n[a]=[...i,...n[a]]:$e(i)&&$e(n[a])?n[a]=Pe(i,n[a],(r?`${r}.`:"")+a.toString(),s):n[a]=i))}return n}function Me(t){return(...e)=>e.reduce((r,s)=>Pe(r,s,"",t),{})}var Xe=Me(),Ns=Me((t,e,r)=>{if(t[e]!==void 0&&typeof r=="function")return t[e]=r(t[e]),!0}),Os=Me((t,e,r)=>{if(Array.isArray(t[e])&&typeof r=="function")return t[e]=r(t[e]),!0});var $r=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Pr=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Mr=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Zr(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Lr(t);return}return e}function Lr(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Ze(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);let r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!Mr.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if($r.test(t)||Pr.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Zr)}return JSON.parse(t)}catch(s){if(e.strict)throw s;return t}}import{createServer as Vr,Server as $s}from"net";import{networkInterfaces as zr,tmpdir as Ms}from"os";import{join as Ls}from"path";import{rm as zs}from"fs/promises";var Dr=new Set([1,7,9,11,13,15,17,19,20,21,22,23,25,37,42,43,53,69,77,79,87,95,101,102,103,104,109,110,111,113,115,117,119,123,135,137,139,143,161,179,389,427,465,512,513,514,515,526,530,531,532,540,548,554,556,563,587,601,636,989,990,993,995,1719,1720,1723,2049,3659,4045,5060,5061,6e3,6566,6665,6666,6667,6668,6669,6697,10080]);function Fr(t){return Dr.has(t)}function Ur(t){return!Fr(t)}function Wr(t,e){t&&console.log(`[get-port] ${e}`)}function et(t,e){return new Promise(r=>{let s=Vr();s.unref(),s.on("error",()=>{r(!1)}),s.listen({port:t,host:e},()=>{let{port:n}=s.address();s.close(()=>{r(Ur(n)&&n)})})})}function Br(t){let e=new Set(t);for(let r of Object.values(zr()))for(let s of r||[])s.address&&!s.internal&&!s.address.startsWith("fe80::")&&!s.address.startsWith("169.254")&&e.add(s.address);return[...e]}function qr(t){return t?`on host ${JSON.stringify(t)}`:"on any host"}async function Le(t,e=process.env.HOST,r){if(e||(e=Br([void 0,"0.0.0.0"])),!Array.isArray(e))return et(t,e);for(let s of e){let n=await et(t,s);if(n===!1)return t<1024&&r&&Wr(r,`Unable to listen to the privileged port ${t} ${qr(s)}`),!1;t===0&&n!==0&&(t=n)}return t}import{loadConfigFromFile as Jr}from"vite";var O=$("yellow"),q=$("green"),tt=$("red"),rt=$("cyan"),ke=$("bold"),st=$("underline"),Qs=$("italic"),Xs=$("magentaBright"),it={"arg.build.watch":"Whether the build should start watching and rebuild when files change or not.","arg.config":"The path to the app configuration file.","arg.debug":"Whether to output debug information or not.","arg.entries.app":"The entry file for the app.","arg.entries.manifest":"The entry file for the app manifest.","arg.jwt.app":"Token app name.","arg.jwt.expiration":"Token expiration time compatible with https://npmjs.com/package/ms.","arg.jwt.user.email":"Token user email.","arg.jwt.user.firstName":"Token user first name.","arg.jwt.user.lastName":"Token user last name.","arg.jwt.user.permission":"Token user permission(s).","arg.jwt.user.sub":"Token user sub.","arg.jwt.workspace":"Token workspace name.","arg.jwt.organization":"Token organization name.","arg.mode":"Which mode to use when building the app.","arg.public-key.clean":"Whether to exclude the -----BEGIN PUBLIC KEY----- prefix and -----END PUBLIC KEY----- suffix or not.","arg.public-key.type":"Type of public key.","arg.serve.logging":"Whether the server and browser console should output more log information or not.","arg.serve.open":"Whether the server should automatically open in your browser or not.","arg.serve.ports.gateway":"The port that the gateway should use.","arg.serve.ports.server":"The port that the server should use.","arg.upgrade.next":"Whether or not the CLI should include the 'next' tag when upgrading @telia-ace packages.","changes.upgraded":`Upgraded ${O("'{{pkg}}'")} to ${q("'{{v}}'")}`,"command.build":"Builds an Alliance app.","command.jwt":"Creates an Alliance JWT.","command.public-key":"Creates a public key used to verify an Alliance JWT.","command.serve":"Starts the Alliance development server.","command.upgrade":"Upgrades Alliance app(s).","errors.invalid-manifest":"Invalid app manifest","errors.no-entry":"Could not find any app and/or manifest entry file at '{{app}}' or '{{manifest}}'","errors.npm-error":"Could not get upgrade information from NPM.","errors.port-busy":"Port {{busy}} is busy","info.gateway-url":`${ke("Gateway:")} ${st(rt("{{url}}"))}`,"info.header.changes":"Changes","info.header.recommendations":"Recommendations","info.header.warnings":"Warnings","info.next-steps":"Next steps:","info.server-url":`${ke("Server:")} ${st(rt("{{url}}"))}`,"info.steps.install":`Run ${O("'{{cmd}}'")} to install the changed package versions`,"info.steps.warnings":`Address the ${tt("warnings")} and ${O("recommendations")} detailed above`,"info.stop-server":ke("Press CTRL + C to stop the server."),"info.upgraded":`Upgraded ${O("'{{pkg}}'")} to ${q("'{{v}}'")}`,"recommendations.update.webprovisions-registry-app":`Remove ${O("'{{pkg}}'")} and install ${q("'{{wpPkg}}'")} (preferably as a dev dependency)`,"recommendations.update.webprovisions-registry-config":`Add ${O("'@webprovisions-registry:registry=https://registry.webprovisions.io'")} to the ${q("'.npmrc'")} file to always use the Webprovisions registry for Webprovisions packages`,"recommendations.add.webprovisions-registry-config":`Create a ${q("'.npmrc'")} file containing ${O("'@webprovisions-registry:registry=https://registry.webprovisions.io'")} to always use the Webprovisions registry for Webprovisions packages`,"recommendations.upgrade":`Upgrade ${O("'{{pkg}}'")} to ${q("'{{v}}'")}`,"warnings.set":`Set ${O("'{{property}}'")} to ${q("'{{new}}'")}`,"warnings.change":`Change ${O("'{{property}}'")} from ${tt("'{{current}}'")} to ${q("'{{new}}'")}`,"warnings.remove":`Remove ${O("'{{property}}'")}{{alt}}`},en=Object.keys(it);function de(t,e={}){return Object.entries(e).reduce((r,[s,n])=>r.replaceAll(`{{${s}}}`,String(n)),it[t]).trim()}var tn={type:"string",description:de("arg.config"),required:!1,alias:"c",valueHint:"./alliance.config.ts"},rn={type:"boolean",description:de("arg.debug"),required:!1,default:!1,alias:"d"};function sn({debug:t,input:e,output:r}){t&&(P.log(ke(Oe("cyan","Input:"))),console.log(JSON.stringify(e,null,2),`
|
|
7
|
+
`),P.log(ke(Oe("cyan","Output:")))),console.log(r,`
|
|
8
|
+
`)}var nt=["./src/app.ts","./src/app.js","./src/app.mts","./src/app.mjs","./src/app.cts","./src/app.cjs"],Hr=["alliance.config.js","alliance.config.mjs","alliance.config.ts","alliance.config.cjs","alliance.config.mts","alliance.config.cts","alliance.config.json"];async function Yr(t,e){let r;if(e?r=D(process.cwd(),e):r=Kr(),r&&z(r)){if(r.endsWith(".json"))return Ze(at(r).toString());try{return(await Jr(t,r))?.config||{}}catch(s){P.error(s.message),process.exit(1)}}return{}}function Gr(t){let e=D(process.cwd(),t.app);if(t.manifest=D(process.cwd(),t.manifest),!nt.includes(t.app))return t.app=e,t;for(let r of nt){let s=D(process.cwd(),r);if(z(s)){t.app=s;break}}return t}function Kr(){let t=Hr.reduce((e,r)=>{if(e.length)return e;let s=D(process.cwd(),r);return z(s)?s:e},"");if(z(t))return t}async function nn(t,e="",r={}){let s=Xe(r,await Yr(t,e));!s.build?.mode&&(s.build?.watch||t.command==="serve")&&(s.build={...s.build,mode:"development"});let n=be.parse(s);return t.command==="serve"&&(await Le(n.server.ports.server)||(P.error(de("errors.port-busy",{busy:n.server.ports.server})),process.exit(1)),await Le(n.server.ports.gateway)||(P.error(de("errors.port-busy",{busy:n.server.ports.gateway})),process.exit(1))),{...n,entries:Gr(n.entries)}}function an(t,e){let r={};if(z(e.entries.manifest)){let s=Ze(at(e.entries.manifest).toString()),n=Ke(s,de("errors.invalid-manifest"));typeof n=="string"&&(P.error(n),process.exit(1)),r.ALLIANCE_APP_MANIFEST=n,r.ALLIANCE_APP_NAME=JSON.stringify(n.name)}return t==="build"&&(!z(e.entries.manifest)||!z(e.entries.app))&&(P.error(de("errors.no-entry",{app:je(process.cwd(),D(e.entries.app)),manifest:je(process.cwd(),D(e.entries.manifest))})),process.exit(1)),t==="serve"&&(r.ALLIANCE_ENVIRONMENT={logging:e.server.logging}),r}function on({entries:t,server:e}){let r=[];z(t.app)&&z(t.manifest)&&r.push({packageName:"entry",appImportPath:t.app,manifestImportPath:t.manifest});for(let s of e.apps)r.push({packageName:s,appImportPath:`${s}/app`,manifestImportPath:`${s}/manifest`});return r.length||(P.error(de("errors.no-entry",{app:je(process.cwd(),D(t.app)),manifest:je(process.cwd(),D(t.manifest))})),process.exit(1)),r}export{Ze as a,O as b,q as c,tt as d,rt as e,ke as f,st as g,en as h,de as i,tn as j,rn as k,sn as l,nn as m,an as n,on as o};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as c__createRequire } from 'node:module';
|
|
3
3
|
const require = c__createRequire(import.meta.url);
|
|
4
|
-
import{b as i,c as
|
|
4
|
+
import{b as i,c as a,d as n}from"./chunk-SQJLD7IF.js";import"./chunk-MCRDX3J3.js";var l="@telia-ace/alliance-cli",o="4.0.0",s="CLI used when developing ACE Alliance apps.";try{await n({meta:{name:l,version:o,description:s},subCommands:{build:()=>import("./build-N2CDOUZC.js").then(e=>e.default),serve:()=>import("./serve-NKWFSQIB.js").then(e=>e.default),jwt:()=>import("./jwt-E6TAS4VE.js").then(e=>e.default),"public-key":()=>import("./public-key-JP5EX6FK.js").then(e=>e.default),upgrade:()=>import("./upgrade-CLZT4VIC.js").then(e=>e.default)}})}catch(e){a.error(i("bold",i("red","Error:")),i("bold",e?.message||"something went wrong"))}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as c__createRequire } from 'node:module';
|
|
2
2
|
const require = c__createRequire(import.meta.url);
|
|
3
|
-
import{i as s,k as t,l as n}from"./chunk-
|
|
3
|
+
import{i as s,k as t,l as n}from"./chunk-XJQR7EZD.js";import"./chunk-SQJLD7IF.js";import"./chunk-MCRDX3J3.js";import{createBearerToken as u,getPrivateKey as m,slugify as o,zSharedConfig as l}from"@telia-ace/alliance-internal-node-utilities";var f={meta:{name:"jwt",description:s("command.jwt")},args:{app:{type:"string",description:s("arg.jwt.app"),required:!1,alias:"a",default:"the-app"},workspace:{type:"string",description:s("arg.jwt.workspace"),required:!1,alias:"w",default:"The Workspace"},organization:{type:"string",description:s("arg.jwt.organization"),required:!1,alias:"o",default:"The Organization"},expiration:{type:"string",description:s("arg.jwt.expiration"),required:!1,alias:"e",default:"1d"},"user.firstName":{type:"string",description:s("arg.jwt.user.firstName"),required:!1,default:"John"},"user.lastName":{type:"string",description:s("arg.jwt.user.lastName"),required:!1,default:"Doe"},"user.email":{type:"string",description:s("arg.jwt.user.email"),required:!1,default:"john.doe@acme.org"},"user.permission":{type:"string",description:s("arg.jwt.user.permission"),required:!1,alias:"p"},"user.sub":{type:"string",description:s("arg.jwt.user.sub"),required:!1,alias:"s",default:"2ccaa1b2-5e34-4dd7-bb47-28435e973969"},debug:t},run({args:e}){let r=[];if(Array.isArray(e["user.permission"]))for(let a of e["user.permission"])typeof a=="string"&&r.push(a);else typeof e["user.permission"]=="string"&&r.push(e["user.permission"]);let i={user:{firstName:e["user.firstName"],lastName:e["user.lastName"],email:e["user.email"],permissions:r,sub:e["user.sub"]},app:e.app,workspace:{name:e.workspace,slug:o(e.workspace)},organization:{name:e.organization,slug:o(e.organization)},expiration:e.expiration},p=u({user:{id:i.user.sub,firstName:i.user.firstName,lastName:i.user.lastName,email:i.user.email,accessToken:"",permissions:i.user.permissions},audience:i.app,workspace:{name:i.workspace.name,slug:i.workspace.slug},organization:{name:i.organization.name,slug:i.organization.slug},privateKey:m(l.pick({JWT_PRIVATE_KEY:!0}).parse({}))});n({debug:e.debug,input:i,output:p})}};export{f as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as c__createRequire } from 'node:module';
|
|
2
2
|
const require = c__createRequire(import.meta.url);
|
|
3
|
-
import{i as t,k as l,l as c}from"./chunk-
|
|
3
|
+
import{i as t,k as l,l as c}from"./chunk-XJQR7EZD.js";import"./chunk-SQJLD7IF.js";import"./chunk-MCRDX3J3.js";import{createPublicKeys as a,getCleanPublicKey as n,zSharedConfig as o}from"@telia-ace/alliance-internal-node-utilities";var r={meta:{name:"public-key",description:t("command.public-key")},args:{type:{type:"string",required:!1,default:"spki",alias:"t",description:t("arg.public-key.type"),valueHint:"pkcs|spki|csp"},clean:{type:"boolean",required:!1,default:!1,alias:"c",description:t("arg.public-key.clean")},debug:l},run({args:i}){let e={clean:i.clean,type:i.type},p=a(o.pick({JWT_PUBLIC_CSP_KEY:!0,JWT_PRIVATE_KEY:!0}).parse({})),u=e.clean?n(e.type,p):p[e.type];c({debug:i.debug,input:e,output:u})}};export{r as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as c__createRequire } from 'node:module';
|
|
2
2
|
const require = c__createRequire(import.meta.url);
|
|
3
|
-
import{a as p,i as r,j as m,m as l,n as f,o as c}from"./chunk-
|
|
3
|
+
import{a as p,i as r,j as m,m as l,n as f,o as c}from"./chunk-XJQR7EZD.js";import{c as s}from"./chunk-SQJLD7IF.js";import"./chunk-MCRDX3J3.js";import{existsSync as d,readFileSync as h,rmSync as S}from"fs";import{start as x}from"@telia-ace/alliance-gateway/dev";import{createIndexHtml as b,getAppManifests as A}from"@telia-ace/alliance-internal-node-utilities";import{onExit as D}from"signal-exit";import y from"dns";import{createServer as g}from"vite";var w=process.env.CI==="true"||process.env.NODE_ENV==="test";async function v(e){let t=f("serve",e);y.setDefaultResultOrder("verbatim");let i=await g({plugins:e.vite.plugins,configFile:!1,mode:e.build.mode,server:{open:e.server.open,port:e.server.ports.server,host:"localhost",proxy:{"/-/":{target:`http://localhost:${e.server.ports.gateway}/`,prependPath:!1,rewrite:o=>o.replace("/-/","/")}},strictPort:!0},clearScreen:!1,resolve:{alias:e.vite.alias},define:t}).then(o=>o.listen());return(w?console.log:s.box)([r("info.server-url",{url:`http://localhost:${e.server.ports.server}`}),r("info.gateway-url",{url:`http://localhost:${e.server.ports.gateway}`}),r("info.stop-server")].join(`
|
|
4
4
|
`)),i}async function u(e){let t,i,o;D(()=>{if(t)try{t.close()}catch(n){s.error(n)}if(i&&d(i))try{S(i,{force:!0})}catch(n){s.error(n)}if(o)try{o.close()}catch(n){s.error(n)}});let a=await A(e.server.apps);d(e.entries.manifest)&&a.unshift(p(h(e.entries.manifest).toString())),t=await x(e,a),i=b(c(e)),o=await v(e)}var _={meta:{name:"serve",description:r("command.serve")},args:{"ports.server":{type:"string",description:r("arg.serve.ports.server"),required:!1},"ports.gateway":{type:"string",description:r("arg.serve.ports.gateway"),required:!1},"entries.app":{type:"string",valueHint:"./src/app.ts",description:r("arg.entries.app"),required:!1},"entries.manifest":{type:"string",valueHint:"./src/manifest.json",description:r("arg.entries.manifest"),required:!1},mode:{type:"string",alias:"m",description:r("arg.mode"),required:!1},logging:{type:"boolean",alias:"l",description:r("arg.serve.logging"),required:!1},open:{type:"boolean",alias:"o",description:r("arg.serve.open"),required:!1},config:m},async run({args:e}){let t=await l({command:"serve",mode:e.mode||"development"},e.config,{build:{mode:e.mode},server:{open:e.open,ports:{gateway:e["ports.gateway"]?Number(e["ports.gateway"]):void 0,server:e["ports.server"]?Number(e["ports.server"]):void 0},logging:e.logging},entries:{app:e["entries.app"],manifest:e["entries.manifest"]}});await u(t)}};export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as c__createRequire } from 'node:module';
|
|
2
2
|
const require = c__createRequire(import.meta.url);
|
|
3
|
-
import{a as _,b as F,c as P,d as N,e as H,f as E,g as z,h as B,i as p}from"./chunk-
|
|
3
|
+
import{a as _,b as F,c as P,d as N,e as H,f as E,g as z,h as B,i as p}from"./chunk-XJQR7EZD.js";import{c as A}from"./chunk-SQJLD7IF.js";import{a as C,c as D,e as me}from"./chunk-MCRDX3J3.js";var Q=D((Ie,K)=>{"use strict";var X=process.platform==="win32",he=X?"\\\\+":"\\/",G=X?"\\\\":"/",ye="((?:[^/]*(?:/|$))*)",we="([^/]*)",j=`((?:[^${G}]*(?:${G}|$))*)`,be=`([^${G}]*)`;function xe(e,{extended:r=!1,globstar:n=!1,strict:l=!1,filepath:t=!1,flags:s=""}={}){let c="",a="",g={regex:"",segments:[]},w=!1,d=!1,h=[];function o(f,{split:m,last:S,only:v}={}){v!=="path"&&(c+=f),t&&v!=="regex"&&(g.regex+=f==="\\/"?he:f,m?(S&&(a+=f),a!==""&&(s.includes("g")||(a=`^${a}$`),g.segments.push(new RegExp(a,s))),a=""):a+=f)}let i,u;for(let f=0;f<e.length;f++){if(i=e[f],u=e[f+1],["\\","$","^",".","="].includes(i)){o(`\\${i}`);continue}if(i==="/"){o(`\\${i}`,{split:!0}),u==="/"&&!l&&(c+="?");continue}if(i==="("){if(h.length){o(i);continue}o(`\\${i}`);continue}if(i===")"){if(h.length){o(i);let m=h.pop();o(m==="@"?"{1}":m==="!"?"([^/]*)":m);continue}o(`\\${i}`);continue}if(i==="|"){if(h.length){o(i);continue}o(`\\${i}`);continue}if(i==="+"){if(u==="("&&r){h.push(i);continue}o(`\\${i}`);continue}if(i==="@"&&r&&u==="("){h.push(i);continue}if(i==="!"){if(r){if(d){o("^");continue}if(u==="("){h.push(i),o("(?!"),f++;continue}o(`\\${i}`);continue}o(`\\${i}`);continue}if(i==="?"){if(r){u==="("?h.push(i):o(".");continue}o(`\\${i}`);continue}if(i==="["){if(d&&u===":"){f++;let m="";for(;e[++f]!==":";)m+=e[f];m==="alnum"?o("(\\w|\\d)"):m==="space"?o("\\s"):m==="digit"&&o("\\d"),f++;continue}if(r){d=!0,o(i);continue}o(`\\${i}`);continue}if(i==="]"){if(r){d=!1,o(i);continue}o(`\\${i}`);continue}if(i==="{"){if(r){w=!0,o("(");continue}o(`\\${i}`);continue}if(i==="}"){if(r){w=!1,o(")");continue}o(`\\${i}`);continue}if(i===","){if(w){o("|");continue}o(`\\${i}`);continue}if(i==="*"){if(u==="("&&r){h.push(i);continue}let m=e[f-1],S=1;for(;e[f+1]==="*";)S++,f++;let v=e[f+1];n?S>1&&(m==="/"||m===void 0)&&(v==="/"||v===void 0)?(o(ye,{only:"regex"}),o(j,{only:"path",last:!0,split:!0}),f++):(o(we,{only:"regex"}),o(be,{only:"path"})):o(".*");continue}o(i)}s.includes("g")||(c=`^${c}$`,a=`^${a}$`,t&&(g.regex=`^${g.regex}$`));let y={regex:new RegExp(c,s)};return t&&(g.segments.push(new RegExp(a,s)),g.regex=new RegExp(g.regex,s),g.globstar=new RegExp(s.includes("g")?j:`^${j}$`,s),y.path=g),y}K.exports=xe});var Z=D((Me,Y)=>{"use strict";var $e=C("os"),U=C("path"),ve=$e.platform()==="win32",Ce={"{":"}","(":")","[":"]"},Re=/\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\)|(\\).|([@?!+*]\(.*\)))/,Se=/\\(.)|(^!|[*?{}()[\]]|\(\?)/;function V(e,{strict:r=!0}={}){if(e==="")return!1;let n,l=r?Re:Se;for(;n=l.exec(e);){if(n[2])return!0;let t=n.index+n[0].length,s=n[1],c=s?Ce[s]:null;if(s&&c){let a=e.indexOf(c,t);a!==-1&&(t=a+1)}e=e.slice(t)}return!1}function Ae(e,{strict:r=!1}={}){ve&&e.includes("/")&&(e=e.split("\\").join("/")),/[\{\[].*[\/]*.*[\}\]]$/.test(e)&&(e+="/"),e+="a";do e=U.dirname(e);while(V(e,{strict:r})||/(^|[^\\])([\{\[]|\([^\)]+$)/.test(e));return e.replace(/\\([\*\?\|\[\]\(\)\{\}])/g,"$1")}function Pe(e,r={}){let n=Ae(e,r),l=V(e,r),t;return n!="."?(t=e.substr(n.length),t.startsWith("/")&&(t=t.substr(1))):t=e,l||(n=U.dirname(e),t=n!=="."?e.substr(n.length):e),t.startsWith("./")&&(t=t.substr(2)),t.startsWith("/")&&(t=t.substr(1)),{base:n,glob:t,isGlob:l}}Y.exports=Pe});var ie=D((Fe,te)=>{"use strict";var I=C("fs"),Ee=Q(),{promisify:ee}=C("util"),ze=Z(),{join:q,resolve:J,relative:Oe}=C("path"),ke=/(^|[\\\/])\.[^\\\/\.]/g,We=ee(I.readdir),Te=ee(I.stat),L={};async function ne(e,r,n,l,t="",s=0){let c=n.segments[s],a=J(l.cwd,r,t),g=await We(a),{dot:w,filesOnly:d}=l,h=0,o=g.length,i,u,y,f,m;for(;h<o;h++)if(u=q(a,i=g[h]),y=t?q(t,i):i,!(!w&&ke.test(y))){if(m=n.regex.test(y),(f=L[y])===void 0&&(L[y]=f=I.lstatSync(u)),!f.isDirectory()){m&&e.push(Oe(l.cwd,u));continue}c&&!c.test(i)||(!d&&m&&e.push(q(r,y)),await ne(e,r,n,l,y,c&&c.toString()!==n.globstar&&s+1))}}te.exports=async function(e,r={}){if(!e)return[];let n=ze(e);if(r.cwd=r.cwd||".",!n.isGlob)try{let s=J(r.cwd,e),c=await Te(s);return r.filesOnly&&!c.isFile()?[]:r.absolute?[s]:[e]}catch(s){if(s.code!="ENOENT")throw s;return[]}r.flush&&(L={});let l=[],{path:t}=Ee(n.glob,{filepath:!0,globstar:!0,extended:!0});return t.globstar=t.globstar.toString(),await ne(l,n.base,t,r,".",0),r.absolute?l.map(s=>J(r.cwd,s)):l}});import{existsSync as O,readFileSync as W,writeFileSync as De}from"fs";import{dirname as _e,relative as se,resolve as x,sep as M}from"path";var le=me(ie(),1);import Ne from"detect-indent";import{loadFile as je}from"magicast";import{getDefaultExportOptions as Ge}from"magicast/helpers";import{run as qe}from"npm-check-updates";function b(...e){let r=" ";return(n,l)=>e.reduce((t,s)=>typeof s=="number"?`${new Array(s).fill(r).join("")}${t}`:typeof s=="string"?`${s}${t}`:s(t),B.includes(n)?p(n,l):n)}async function ce(e){let r=await qe({deep:!0,cwd:process.cwd(),filter:n=>n.startsWith($)||n.startsWith(R)||["typescript","vite"].includes(n),target:n=>(n.startsWith($)||n.startsWith(R))&&e?"@next":"@latest"});return r||(A.error(p("errors.npm-error")),process.exit(1)),Promise.all(Object.entries(r).filter(([n])=>{try{return W(x(n)).toString().includes($)}catch{return!1}}).map(async([n,l])=>{let t=x(_e(n)),s=x(t,"tsconfig.json"),c=x(t,"package.json"),a=x(t,".npmrc"),[g]=await(0,le.default)(`${oe(t)}/alliance.config*`);return{path:oe(se(process.cwd(),t)),packageJson:O(c)?k(c,t):void 0,tsConfigJson:O(s)?k(s,t):void 0,allianceConfig:O(g)?k(g,t):void 0,npmConfig:O(a)?k(a,t):void 0,upgrades:l}}))}async function ae({tsConfigJson:e}){if(!e)return;let{warn:r,error:n,output:l}=T(e.relative);try{let t=_(W(e.full).toString());t?.compilerOptions?.moduleResolution?.toLowerCase()!=="bundler"&&r(p("warnings.change",{property:"compilerOptions.moduleResolution",current:t?.compilerOptions?.moduleResolution,new:"bundler"}))}catch(t){n(t)}l()}async function fe({npmConfig:e}){let{error:r,output:n,recommend:l}=T(e?.relative||".npmrc");if(!e)l(p("recommendations.add.webprovisions-registry-config"));else try{W(e.full).toString().includes(`${ge}:registry=https://registry.webprovisions.io`)||l(p("recommendations.update.webprovisions-registry-config"))}catch(t){r(t)}n()}async function ue({allianceConfig:e}){if(!e)return;let{warn:r,error:n,output:l}=T(e.relative,!1);try{let t=await je(e.full),s=Ge(t);typeof s?.experimental?.logging=="boolean"&&r(p("warnings.remove",{property:"experimental.logging",alt:`, use ${P("'server.logging'")} instead`})),typeof s?.server?.mode<"u"&&r(p("warnings.remove",{property:"server.mode",alt:", no longer supported"}))}catch(t){n(t)}l()}async function pe({packageJson:e,allianceConfig:r,tsConfigJson:n,upgrades:l}){if(!e)return;let{change:t,warn:s,output:c,error:a,recommend:g}=T(e.relative,!!r||!!n);try{let w=W(e.full).toString(),d=_(w);if(d.publishConfig?.registry!=="https://registry.webprovisions.io"&&s(p("warnings.set",{property:"publishConfig.registry",new:"https://registry.webprovisions.io"})),d.publishConfig?.access!=="public"&&s(p("warnings.set",{property:"publishConfig.access",new:"public"})),d.alliance?.apps&&s(p("warnings.remove",{property:"alliance.apps",alt:`, use the app config ${P("'server.apps'")} option instead`})),d.scripts){let o=Object.entries(d.scripts).filter(([i,u])=>u&&(u.includes("create alliance")||u.includes("create-alliance")));for(let[i,u]of o)try{u.includes("serve")||u.includes("server")?(s(p("warnings.change",{property:`scripts.${i}`,current:u,new:"npx @telia-ace/alliance-cli serve"})),u.includes("--server-mode")&&s(p("warnings.remove",{property:"--server-mode",alt:", no longer supported"}))):u.includes("build")&&s(p("warnings.change",{property:`scripts.${i}`,current:u,new:"npx @telia-ace/alliance-cli build"}))}catch(y){a(y)}}for(let o of Object.keys({...d?.dependencies,...d?.devDependencies})){if(!o.startsWith(re))continue;let i=o.replace(re,"");g(p("recommendations.update.webprovisions-registry-app",{pkg:o,wpPkg:`${R}${i}`}))}let h=o=>{if(o)for(let i of Object.keys(o))!i.startsWith($)&&!i.startsWith(R)||!l[i]||(o[i]=l[i])};h(d.dependencies),h(d.devDependencies);for(let[o,i]of Object.entries(l))o.startsWith($)||o.startsWith(R)?t(p("changes.upgraded",{pkg:o,v:i})):g(p("recommendations.upgrade",{pkg:o,v:i}));De(e.full,JSON.stringify(d,null,Ne(w).indent))}catch(w){a(w)}c()}var $="@telia-ace",ge="@webprovisions-registry",re=`${$}/alliance-app-`,R=`${ge}/alliance-app-`;function T(e,r=!0){let n=[],l=[],t=[],s=[];return{warn:c=>l.push(c),change:c=>n.push(c),recommend:c=>t.push(c),error:c=>s.push(c),output:()=>{if(!n.length&&!l.length&&!t.length)return;console.log(b(H,1)(e));let c=b("- ",2);if(n.length){console.log(b(2,P)("info.header.changes"));for(let a of n)console.log(c(a))}if(l.length){console.log(b(2,N)("info.header.warnings"));for(let a of l)console.log(c(a))}if(t.length){console.log(b(2,F)("info.header.recommendations"));for(let a of t)console.log(c(a))}if(s.length){console.log(b(2,N)("Errors"));for(let a of s)A.error(c(a))}r&&console.log()}}}function oe(e){return e.replaceAll(M,"/")}function k(e,r=process.cwd()){let n=x(process.cwd(),e);return{full:n.replaceAll(M,"/"),relative:se(r,n).replaceAll(M,"/")}}function de(){let e=Je();return A.log(b(z,E)("info.next-steps")),console.log([p("info.steps.warnings"),p("info.steps.install",{cmd:`${e} install`})].map(r=>b("- ",1)(r)).join(`
|
|
4
4
|
`))}function Je(){try{if(!process.env.npm_config_user_agent)return"npm";let r=process.env.npm_config_user_agent.split(" ")[0],n=r.lastIndexOf("/"),l=r.substring(0,n);return l==="npminstall"?"cnpm":l}catch{return"npm"}}var rn={meta:{name:"upgrade",description:p("command.upgrade")},args:{next:{type:"boolean",description:p("arg.upgrade.next"),default:!1,required:!1,alias:"n"}},async run(e){let r=await ce(e.args.next);for(let n of r)console.log(),console.log(b(z,E)(n.path||"root")),await fe(n),await pe(n),await ae(n),await ue(n);console.log(),de(),console.log()}};export{rn as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/alliance-cli",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "CLI used when developing ACE Alliance apps.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"type": "module",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"detect-indent": "^7.0.1",
|
|
17
17
|
"magicast": "^0.3.5",
|
|
18
|
-
"npm-check-updates": "^18.0
|
|
18
|
+
"npm-check-updates": "^18.1.0",
|
|
19
19
|
"signal-exit": "^4.1.0",
|
|
20
|
-
"vite": "^
|
|
21
|
-
"@telia-ace/alliance-gateway": "^4.0.0
|
|
22
|
-
"@telia-ace/alliance-internal-node-utilities": "^4.0.0
|
|
20
|
+
"vite": "^7.1.5",
|
|
21
|
+
"@telia-ace/alliance-gateway": "^4.0.0",
|
|
22
|
+
"@telia-ace/alliance-internal-node-utilities": "^4.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@telia-ace/alliance-framework": "^4.0.0
|
|
25
|
+
"@telia-ace/alliance-framework": "^4.0.0"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=15.0.0"
|