@webnovel-proxy/schemas 0.5.0 → 0.6.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/index.d.ts +4 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -797,6 +797,7 @@ export declare const WebNovelChapterContent: z.ZodObject<{
|
|
|
797
797
|
}, z.core.$strip>;
|
|
798
798
|
export type WebNovelChapterContent = z.infer<typeof WebNovelChapterContent>;
|
|
799
799
|
export declare const WebNovelChapter: z.ZodObject<{
|
|
800
|
+
internalIdentifier: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
800
801
|
externalIdentifiers: z.ZodArray<z.ZodObject<{
|
|
801
802
|
provider: z.ZodEnum<{
|
|
802
803
|
"webnovel.com": "webnovel.com";
|
|
@@ -1227,6 +1228,7 @@ export declare const WebNovelVolume: z.ZodObject<{
|
|
|
1227
1228
|
createdAt: z.ZodNullable<z.ZodCustom<`${number}` | `${number}-${number}` | `${number}-${number}-${number}` | `${number}-${number}-${number}T${number}:${number}:${number}Z`, `${number}` | `${number}-${number}` | `${number}-${number}-${number}` | `${number}-${number}-${number}T${number}:${number}:${number}Z`>>;
|
|
1228
1229
|
updatedAt: z.ZodNullable<z.ZodCustom<`${number}` | `${number}-${number}` | `${number}-${number}-${number}` | `${number}-${number}-${number}T${number}:${number}:${number}Z`, `${number}` | `${number}-${number}` | `${number}-${number}-${number}` | `${number}-${number}-${number}T${number}:${number}:${number}Z`>>;
|
|
1229
1230
|
chapters: z.ZodArray<z.ZodObject<{
|
|
1231
|
+
internalIdentifier: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1230
1232
|
externalIdentifiers: z.ZodArray<z.ZodObject<{
|
|
1231
1233
|
provider: z.ZodEnum<{
|
|
1232
1234
|
"webnovel.com": "webnovel.com";
|
|
@@ -1617,6 +1619,7 @@ export declare const WebNovelVolume: z.ZodObject<{
|
|
|
1617
1619
|
}, z.core.$strip>;
|
|
1618
1620
|
export type WebNovelVolume = z.infer<typeof WebNovelVolume>;
|
|
1619
1621
|
export declare const WebNovel: z.ZodObject<{
|
|
1622
|
+
internalIdentifier: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1620
1623
|
externalIdentifiers: z.ZodArray<z.ZodObject<{
|
|
1621
1624
|
provider: z.ZodEnum<{
|
|
1622
1625
|
"webnovel.com": "webnovel.com";
|
|
@@ -2122,6 +2125,7 @@ export declare const WebNovel: z.ZodObject<{
|
|
|
2122
2125
|
createdAt: z.ZodNullable<z.ZodCustom<`${number}` | `${number}-${number}` | `${number}-${number}-${number}` | `${number}-${number}-${number}T${number}:${number}:${number}Z`, `${number}` | `${number}-${number}` | `${number}-${number}-${number}` | `${number}-${number}-${number}T${number}:${number}:${number}Z`>>;
|
|
2123
2126
|
updatedAt: z.ZodNullable<z.ZodCustom<`${number}` | `${number}-${number}` | `${number}-${number}-${number}` | `${number}-${number}-${number}T${number}:${number}:${number}Z`, `${number}` | `${number}-${number}` | `${number}-${number}-${number}` | `${number}-${number}-${number}T${number}:${number}:${number}Z`>>;
|
|
2124
2127
|
chapters: z.ZodArray<z.ZodObject<{
|
|
2128
|
+
internalIdentifier: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
2125
2129
|
externalIdentifiers: z.ZodArray<z.ZodObject<{
|
|
2126
2130
|
provider: z.ZodEnum<{
|
|
2127
2131
|
"webnovel.com": "webnovel.com";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import s from"zod";var z=s.object({uid:s.string().regex(/^\d+$/).max(64),ukey:s.string().regex(/^[a-zA-Z0-9]+$/).max(64)}),N=s.string().regex(/^n\/\d+$/,"Invalid WebNovel novel ID"),y=s.string().regex(/^n\/\d+\/c\/\d+$/,"Invalid WebNovel novel chapter ID"),W=s.string().regex(/^c\/\d+$/,"Invalid WebNovel creator ID");import T from"zod";import A from"zod";var v=A.string().regex(/^n\/[a-zA-Z0-9_-]+$/,"Invalid HostedNovel novel ID"),w=A.string().regex(/^n\/[a-zA-Z0-9_-]+\/c\/[a-zA-Z0-9_-]+$/,"Invalid HostedNovel novel chapter ID"),j=A.string().regex(/^c\/[a-zA-Z0-9_-]+$/,"Invalid HostedNovel creator ID");import $ from"zod";var h=$.string().regex(/^n\/[a-zA-Z0-9_-]+$/,"Invalid NovelFire novel ID"),I=$.string().regex(/^n\/[a-zA-Z0-9_-]+\/c\/[a-zA-Z0-9_-]+$/,"Invalid NovelFire novel chapter ID");var P=T.enum(["webnovel.com","novelfire.net","hostednovel.com"]),b=T.object({provider:P,id:T.union([N,y,W,h,I,v,w,j])}),O=T.enum(["qidian.com","ciweimao.com"]);import M from"language-tags";import B from"zod";var u=B.string().refine((r)=>M(r).valid(),{error:(r)=>`Invalid Language Tag: ${M(String(r?.input??"")).errors().join(";")}`}).transform((r)=>String(M(r).format()));var D=["abr","acp","act","adi","adp","aft","anc","anl","anm","ann","ant","ape","apl","app","aqt","arc","ard","arr","art","asg","asn","ato","att","auc","aud","aue","aui","aup","aus","aut","bdd","bjd","bka","bkd","bkp","blw","bnd","bpd","brd","brl","bsl","cad","cas","ccp","chr","cli","cll","clr","clt","cmm","cmp","cmt","cnd","cng","cns","coe","col","com","con","cop","cor","cos","cot","cou","cov","cpc","cpe","cph","cpl","cpt","cre","crp","crr","crt","csl","csp","cst","ctb","cte","ctg","ctr","cts","ctt","cur","cwt","dbd","dbp","dfd","dfe","dft","dgc","dgg","dgs","dis","djo","dln","dnc","dnr","dpc","dpt","drm","drt","dsr","dst","dtc","dte","dtm","dto","dub","edc","edd","edm","edt","egr","elg","elt","eng","enj","etr","evp","exp","fac","fds","fld","flm","fmd","fmk","fmo","fmp","fnd","fon","fpy","frg","gdv","gis","his","hnr","hst","ill","ilu","ink","ins","inv","isb","itr","ive","ivr","jud","jug","lbr","lbt","ldr","led","lee","lel","len","let","lgd","lie","lil","lit","lsa","lse","lso","ltg","ltr","lyr","mcp","mdc","med","mfp","mfr","mka","mod","mon","mrb","mrk","msd","mte","mtk","mup","mus","mxe","nan","nrt","onp","opn","org","orm","osp","oth","own","pad","pan","pat","pbd","pbl","pdr","pfr","pht","plt","pma","pmn","pnc","pop","ppm","ppt","pra","prc","prd","pre","prf","prg","prm","prn","pro","prp","prs","prt","prv","pta","pte","ptf","pth","ptt","pup","rap","rbr","rcd","rce","rcp","rdd","red","ren","res","rev","rpc","rps","rpt","rpy","rse","rsg","rsp","rsr","rst","rth","rtm","rxa","sad","sce","scl","scr","sde","sds","sec","sfx","sgd","sgn","sht","sll","sng","spk","spn","spy","srv","std","stg","stl","stm","stn","str","swd","tad","tau","tcd","tch","ths","tld","tlg","tlh","tlp","trc","trl","tyd","tyg","uvp","vac","vdg","vfx","voc","wac","wal","wam","wat","waw","wdc","wde","wfs","wft","wfw","win","wit","wpr","wst","wts"];import G from"zod";var V=G.enum(D);import{Mime as J}from"mime/lite";import K from"mime/types/other.js";import Q from"mime/types/standard.js";var q=new J().define({...Q,...K});import{Temporal as E}from"temporal-polyfill";import k from"zod";var m=k.string({error:(r)=>`Not a string: "${typeof r?.input}"`}).transform((r)=>r.trim()).refine((r)=>r!=="","String must not be empty"),jr=k.string({error:(r)=>`Not a string: "${typeof r?.input}"`}).transform((r)=>r.trim()).transform((r)=>r===""?null:r),i=k.custom((r)=>{return typeof r==="string"&&/^(\d{4})(-\d{2})?(-\d{2})?(T\d{2}:\d{2}:\d{2}Z)?$/.test(r)}).refine((r)=>{if(r.indexOf("T")>0)try{return E.Instant.from(r),!0}catch{return!1}else{let o=r.split("-");if(o.length>3)return!1;else if(o.length===3)try{return E.PlainDate.from(r),!0}catch{return!1}else if(o.length===2)try{return E.PlainDate.from(r+"-01"),!0}catch{return!1}else if(o.length===1)try{return E.PlainDate.from(r+"-01-01"),!0}catch{return!1}return!1}},{error:(r)=>`Date "${String(r?.input??"").substring(0,20)}" is invalid`}),H=k.coerce.string().refine((r)=>q.getExtension(r)!==null,{error:(r)=>`Invalid MIME type "${String(r.input)}"`}).transform((r)=>r.toLocaleLowerCase().trim());function c(r){let o=r.filter((n)=>n.primary===!0).length;if(o>1){let n=r.findIndex((p)=>p.primary===!0);return r.map((p,t)=>{return p.primary=t===n,p})}if(o===0&&typeof r[0]<"u")return r[0].primary=!0,r;return r}import a from"zod";var f=a.object({language:u.nullable().default(null),value:m,type:a.enum(["plain","markdown","html"]).nullable().default(null),primary:a.boolean().default(!1)}),X=a.object({displayName:m,givenName:m.nullable(),middleName:m.nullable(),familyName:m.nullable(),primary:a.boolean().default(!1)}),S=a.object({externalIdentifiers:a.array(b),names:a.array(X).min(1).transform(c),roles:a.array(V)}),Y=a.enum(["cover","backdrop","spine","back"]),Z=a.intersection(a.object({type:Y,height:a.int().min(1).nullable(),width:a.int().min(1).nullable(),language:u.nullable().default(null),primary:a.boolean().default(!1),mediaType:H.pipe(a.string().startsWith("image/")).nullable()}),a.union([a.object({provider:P,id:m}),a.object({provider:a.null(),id:a.url()})]));import l from"zod";var Zr=l.object({originalHTML:l.array(m),originalHTMLSize:l.int().min(0),generatedMarkdown:m,generatedMarkdownSize:l.int().min(0)}),C=l.object({externalIdentifiers:l.array(b).min(1),volumeNumber:l.number().min(0).nullable(),number:l.number().min(0),names:l.array(f).min(1).transform(c),creators:l.array(S),createdAt:i.nullable(),updatedAt:i.nullable()}),F=l.object({externalIdentifiers:l.array(b),number:l.number().min(0),names:l.array(f).transform(c),createdAt:i.nullable(),updatedAt:i.nullable(),chapters:l.array(C)}),gr=l.object({externalIdentifiers:l.array(b).min(1),names:l.array(f).min(1).transform(c),language:u,overviews:l.array(f).transform(c),creators:l.array(S),images:l.array(Z).transform(c),originalLanguage:u.nullable(),originalSource:O.nullable(),isComplete:l.boolean().nullable(),createdAt:i.nullable(),updatedAt:i.nullable(),volumes:l.array(F)});function Gr(r){let o=r.find((n)=>n.primary===!0);if(typeof o<"u")return o;return r?.[0]??void 0}function Jr(r){let o=r.find((n)=>n.primary===!0);if(typeof o<"u")return o;return r?.[0]??void 0}import d from"zod";function Fr(r){if(r.provider==="webnovel.com"){let o=N.safeParse(r.id)?.data??void 0,n=y.safeParse(r.id)?.data??void 0,p=W.safeParse(r.id)?.data??void 0,t="https://www.webnovel.com";if(typeof o==="string")return new URL(`/book/${o.substring(2)}`,"https://www.webnovel.com");else if(typeof n==="string"){let e=n.split("/");return new URL(`/book/${e[1]}/${e[3]}`,"https://www.webnovel.com")}else if(typeof p==="string")return new URL(`/profile/${p.substring(2)}`,"https://www.webnovel.com")}else if(r.provider==="novelfire.net"){let o=h.safeParse(r.id)?.data??void 0,n=I.safeParse(r.id)?.data??void 0,p="https://novelfire.net";if(typeof o==="string")return new URL(`/book/${o.substring(2)}`,"https://novelfire.net");else if(typeof n==="string"){let t=n.split("/");return new URL(`/book/${t[1]}/${t[3]}`,"https://novelfire.net")}}else if(r.provider==="hostednovel.com"){let o=v.safeParse(r.id)?.data??void 0,n=w.safeParse(r.id)?.data??void 0,p=j.safeParse(r.id)?.data??void 0,t="https://hostednovel.com";if(typeof o==="string")return new URL(`/novel/${o.substring(2)}`,"https://hostednovel.com");else if(typeof n==="string"){let e=n.split("/");return new URL(`/novel/${e[1]}/${e[3]}`,"https://hostednovel.com")}else if(typeof p==="string")return new URL(`/creator/${p.substring(2)}`,"https://hostednovel.com")}return}var g=d.object({imageProxy:d.literal("wsrv.nl"),output:d.enum(["jpg","jxl","png","gif","tiff","webp","original"]).default("original").optional(),quality:d.int().min(1).max(100).default(80).optional(),default:d.url().optional(),lossless:d.boolean().optional(),compressionLevel:d.int().min(0).max(9).default(6).optional(),width:d.int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),height:d.int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),devicePixelRatio:d.int().min(1).max(8).optional(),fit:d.enum(["inside","outside","cover","fill","contain"]).optional(),withoutEnlargement:d.boolean().default(!0).optional(),alignmentPosition:d.enum(["top","right","bottom","left","top-left","bottom-left","bottom-right","top-right","center","entropy","attention"]).default("center").optional()}),x=d.discriminatedUnion("imageProxy",[d.object({imageProxy:d.literal(!1)}),g]);function xr(r,o={imageProxy:!1}){let n=x.parse(o),p=void 0;if(r.provider==="webnovel.com"){if(/^n\/\d+(\/\d+)?/.test(r.id)){let t=r.id.split("/");if(p=new URL(`/bookcover/${t[1]}`,"https://book-pic.webnovel.com"),p.searchParams.set("imageMogr2/thumbnail/600x",""),typeof t?.[2]==="string")p.searchParams.set("imageId",t[2])}}if(typeof p>"u")return;if(n.imageProxy==="wsrv.nl"){let t=new URL("https://wsrv.nl");t.searchParams.set("url",p.toString());let e=g.parse(n);if(typeof e?.width==="number")t.searchParams.set("w",e.width.toString());else if(typeof r?.width==="number")t.searchParams.set("w",r.width.toString());if(typeof e?.height==="number")t.searchParams.set("h",e.height.toString());else if(typeof r?.height==="number")t.searchParams.set("h",r.height.toString());if(typeof e?.devicePixelRatio==="number")t.searchParams.set("dpr",e.devicePixelRatio.toString());if(typeof e?.fit==="string")t.searchParams.set("fit",e.fit);if(typeof e?.withoutEnlargement==="boolean"&&e.withoutEnlargement===!0)t.searchParams.set("we","true");if(typeof e?.alignmentPosition==="string")t.searchParams.set("a",e.alignmentPosition);if(typeof e?.compressionLevel==="number")t.searchParams.set("l",e.compressionLevel.toString());if(typeof e?.lossless==="boolean"&&e.lossless===!0)t.searchParams.set("ll","true");if(typeof e?.default==="string")t.searchParams.set("default",e.default);if(typeof e?.output==="string"&&e.output!=="original")t.searchParams.set("output",e.output);if(typeof e?.quality==="number")t.searchParams.set("q",e.quality.toString());return t}return p}export{xr as webNovelImageToURL,Fr as webNovelExternalIdentifierToURL,q as mime,Gr as getPrimaryTranslation,Jr as getPrimaryImage,F as WebNovelVolume,N as WebNovelComNovelId,y as WebNovelComNovelChapterId,W as WebNovelComCreatorId,z as WebNovelComAuth,Zr as WebNovelChapterContent,C as WebNovelChapter,gr as WebNovel,f as Translation,V as Relator,X as PersonalName,i as PartialDateTime,O as OriginalSource,jr as NullableNonEmptyString,h as NovelFireNetNovelId,I as NovelFireNetNovelChapterId,m as NonEmptyString,H as Mime,Y as ImageType,Z as Image,v as HostedNovelComNovelId,w as HostedNovelComNovelChapterId,j as HostedNovelComCreatorId,P as ExternalProvider,b as ExternalIdentifier,S as Creator,u as BCP47LanguageTag};
|
|
1
|
+
import s from"zod";var z=s.object({uid:s.string().regex(/^\d+$/).max(64),ukey:s.string().regex(/^[a-zA-Z0-9]+$/).max(64)}),N=s.string().regex(/^n\/\d+$/,"Invalid WebNovel novel ID"),y=s.string().regex(/^n\/\d+\/c\/\d+$/,"Invalid WebNovel novel chapter ID"),W=s.string().regex(/^c\/\d+$/,"Invalid WebNovel creator ID");import T from"zod";import A from"zod";var v=A.string().regex(/^n\/[a-zA-Z0-9_-]+$/,"Invalid HostedNovel novel ID"),w=A.string().regex(/^n\/[a-zA-Z0-9_-]+\/c\/[a-zA-Z0-9_-]+$/,"Invalid HostedNovel novel chapter ID"),j=A.string().regex(/^c\/[a-zA-Z0-9_-]+$/,"Invalid HostedNovel creator ID");import $ from"zod";var I=$.string().regex(/^n\/[a-zA-Z0-9_-]+$/,"Invalid NovelFire novel ID"),h=$.string().regex(/^n\/[a-zA-Z0-9_-]+\/c\/[a-zA-Z0-9_-]+$/,"Invalid NovelFire novel chapter ID");var P=T.enum(["webnovel.com","novelfire.net","hostednovel.com"]),b=T.object({provider:P,id:T.union([N,y,W,I,h,v,w,j])}),O=T.enum(["qidian.com","ciweimao.com"]);import M from"language-tags";import B from"zod";var f=B.string().refine((r)=>M(r).valid(),{error:(r)=>`Invalid Language Tag: ${M(String(r?.input??"")).errors().join(";")}`}).transform((r)=>String(M(r).format()));var D=["abr","acp","act","adi","adp","aft","anc","anl","anm","ann","ant","ape","apl","app","aqt","arc","ard","arr","art","asg","asn","ato","att","auc","aud","aue","aui","aup","aus","aut","bdd","bjd","bka","bkd","bkp","blw","bnd","bpd","brd","brl","bsl","cad","cas","ccp","chr","cli","cll","clr","clt","cmm","cmp","cmt","cnd","cng","cns","coe","col","com","con","cop","cor","cos","cot","cou","cov","cpc","cpe","cph","cpl","cpt","cre","crp","crr","crt","csl","csp","cst","ctb","cte","ctg","ctr","cts","ctt","cur","cwt","dbd","dbp","dfd","dfe","dft","dgc","dgg","dgs","dis","djo","dln","dnc","dnr","dpc","dpt","drm","drt","dsr","dst","dtc","dte","dtm","dto","dub","edc","edd","edm","edt","egr","elg","elt","eng","enj","etr","evp","exp","fac","fds","fld","flm","fmd","fmk","fmo","fmp","fnd","fon","fpy","frg","gdv","gis","his","hnr","hst","ill","ilu","ink","ins","inv","isb","itr","ive","ivr","jud","jug","lbr","lbt","ldr","led","lee","lel","len","let","lgd","lie","lil","lit","lsa","lse","lso","ltg","ltr","lyr","mcp","mdc","med","mfp","mfr","mka","mod","mon","mrb","mrk","msd","mte","mtk","mup","mus","mxe","nan","nrt","onp","opn","org","orm","osp","oth","own","pad","pan","pat","pbd","pbl","pdr","pfr","pht","plt","pma","pmn","pnc","pop","ppm","ppt","pra","prc","prd","pre","prf","prg","prm","prn","pro","prp","prs","prt","prv","pta","pte","ptf","pth","ptt","pup","rap","rbr","rcd","rce","rcp","rdd","red","ren","res","rev","rpc","rps","rpt","rpy","rse","rsg","rsp","rsr","rst","rth","rtm","rxa","sad","sce","scl","scr","sde","sds","sec","sfx","sgd","sgn","sht","sll","sng","spk","spn","spy","srv","std","stg","stl","stm","stn","str","swd","tad","tau","tcd","tch","ths","tld","tlg","tlh","tlp","trc","trl","tyd","tyg","uvp","vac","vdg","vfx","voc","wac","wal","wam","wat","waw","wdc","wde","wfs","wft","wfw","win","wit","wpr","wst","wts"];import G from"zod";var V=G.enum(D);import{Mime as J}from"mime/lite";import K from"mime/types/other.js";import Q from"mime/types/standard.js";var q=new J().define({...Q,...K});import{Temporal as E}from"temporal-polyfill";import k from"zod";var m=k.string({error:(r)=>`Not a string: "${typeof r?.input}"`}).transform((r)=>r.trim()).refine((r)=>r!=="","String must not be empty"),jr=k.string({error:(r)=>`Not a string: "${typeof r?.input}"`}).transform((r)=>r.trim()).transform((r)=>r===""?null:r),i=k.custom((r)=>{return typeof r==="string"&&/^(\d{4})(-\d{2})?(-\d{2})?(T\d{2}:\d{2}:\d{2}Z)?$/.test(r)}).refine((r)=>{if(r.indexOf("T")>0)try{return E.Instant.from(r),!0}catch{return!1}else{let o=r.split("-");if(o.length>3)return!1;else if(o.length===3)try{return E.PlainDate.from(r),!0}catch{return!1}else if(o.length===2)try{return E.PlainDate.from(r+"-01"),!0}catch{return!1}else if(o.length===1)try{return E.PlainDate.from(r+"-01-01"),!0}catch{return!1}return!1}},{error:(r)=>`Date "${String(r?.input??"").substring(0,20)}" is invalid`}),H=k.coerce.string().refine((r)=>q.getExtension(r)!==null,{error:(r)=>`Invalid MIME type "${String(r.input)}"`}).transform((r)=>r.toLocaleLowerCase().trim());function c(r){let o=r.filter((a)=>a.primary===!0).length;if(o>1){let a=r.findIndex((p)=>p.primary===!0);return r.map((p,t)=>{return p.primary=t===a,p})}if(o===0&&typeof r[0]<"u")return r[0].primary=!0,r;return r}import n from"zod";var u=n.object({language:f.nullable().default(null),value:m,type:n.enum(["plain","markdown","html"]).nullable().default(null),primary:n.boolean().default(!1)}),X=n.object({displayName:m,givenName:m.nullable(),middleName:m.nullable(),familyName:m.nullable(),primary:n.boolean().default(!1)}),S=n.object({externalIdentifiers:n.array(b),names:n.array(X).min(1).transform(c),roles:n.array(V)}),Y=n.enum(["cover","backdrop","spine","back"]),Z=n.intersection(n.object({type:Y,height:n.int().min(1).nullable(),width:n.int().min(1).nullable(),language:f.nullable().default(null),primary:n.boolean().default(!1),mediaType:H.pipe(n.string().startsWith("image/")).nullable()}),n.union([n.object({provider:P,id:m}),n.object({provider:n.null(),id:n.url()})]));import l from"zod";var Zr=l.object({originalHTML:l.array(m),originalHTMLSize:l.int().min(0),generatedMarkdown:m,generatedMarkdownSize:l.int().min(0)}),C=l.object({internalIdentifier:m,externalIdentifiers:l.array(b).min(1),volumeNumber:l.number().min(0).nullable(),number:l.number().min(0),names:l.array(u).min(1).transform(c),creators:l.array(S),createdAt:i.nullable(),updatedAt:i.nullable()}),F=l.object({externalIdentifiers:l.array(b),number:l.number().min(0),names:l.array(u).transform(c),createdAt:i.nullable(),updatedAt:i.nullable(),chapters:l.array(C)}),gr=l.object({internalIdentifier:m,externalIdentifiers:l.array(b).min(1),names:l.array(u).min(1).transform(c),language:f,overviews:l.array(u).transform(c),creators:l.array(S),images:l.array(Z).transform(c),originalLanguage:f.nullable(),originalSource:O.nullable(),isComplete:l.boolean().nullable(),createdAt:i.nullable(),updatedAt:i.nullable(),volumes:l.array(F)});function Gr(r){let o=r.find((a)=>a.primary===!0);if(typeof o<"u")return o;return r?.[0]??void 0}function Jr(r){let o=r.find((a)=>a.primary===!0);if(typeof o<"u")return o;return r?.[0]??void 0}import d from"zod";function Fr(r){if(r.provider==="webnovel.com"){let o=N.safeParse(r.id)?.data??void 0,a=y.safeParse(r.id)?.data??void 0,p=W.safeParse(r.id)?.data??void 0,t="https://www.webnovel.com";if(typeof o==="string")return new URL(`/book/${o.substring(2)}`,"https://www.webnovel.com");else if(typeof a==="string"){let e=a.split("/");return new URL(`/book/${e[1]}/${e[3]}`,"https://www.webnovel.com")}else if(typeof p==="string")return new URL(`/profile/${p.substring(2)}`,"https://www.webnovel.com")}else if(r.provider==="novelfire.net"){let o=I.safeParse(r.id)?.data??void 0,a=h.safeParse(r.id)?.data??void 0,p="https://novelfire.net";if(typeof o==="string")return new URL(`/book/${o.substring(2)}`,"https://novelfire.net");else if(typeof a==="string"){let t=a.split("/");return new URL(`/book/${t[1]}/${t[3]}`,"https://novelfire.net")}}else if(r.provider==="hostednovel.com"){let o=v.safeParse(r.id)?.data??void 0,a=w.safeParse(r.id)?.data??void 0,p=j.safeParse(r.id)?.data??void 0,t="https://hostednovel.com";if(typeof o==="string")return new URL(`/novel/${o.substring(2)}`,"https://hostednovel.com");else if(typeof a==="string"){let e=a.split("/");return new URL(`/novel/${e[1]}/${e[3]}`,"https://hostednovel.com")}else if(typeof p==="string")return new URL(`/creator/${p.substring(2)}`,"https://hostednovel.com")}return}var g=d.object({imageProxy:d.literal("wsrv.nl"),output:d.enum(["jpg","jxl","png","gif","tiff","webp","original"]).default("original").optional(),quality:d.int().min(1).max(100).default(80).optional(),default:d.url().optional(),lossless:d.boolean().optional(),compressionLevel:d.int().min(0).max(9).default(6).optional(),width:d.int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),height:d.int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),devicePixelRatio:d.int().min(1).max(8).optional(),fit:d.enum(["inside","outside","cover","fill","contain"]).optional(),withoutEnlargement:d.boolean().default(!0).optional(),alignmentPosition:d.enum(["top","right","bottom","left","top-left","bottom-left","bottom-right","top-right","center","entropy","attention"]).default("center").optional()}),x=d.discriminatedUnion("imageProxy",[d.object({imageProxy:d.literal(!1)}),g]);function xr(r,o={imageProxy:!1}){let a=x.parse(o),p=void 0;if(r.provider==="webnovel.com"){if(/^n\/\d+(\/\d+)?/.test(r.id)){let t=r.id.split("/");if(p=new URL(`/bookcover/${t[1]}`,"https://book-pic.webnovel.com"),p.searchParams.set("imageMogr2/thumbnail/600x",""),typeof t?.[2]==="string")p.searchParams.set("imageId",t[2])}}if(typeof p>"u")return;if(a.imageProxy==="wsrv.nl"){let t=new URL("https://wsrv.nl");t.searchParams.set("url",p.toString());let e=g.parse(a);if(typeof e?.width==="number")t.searchParams.set("w",e.width.toString());else if(typeof r?.width==="number")t.searchParams.set("w",r.width.toString());if(typeof e?.height==="number")t.searchParams.set("h",e.height.toString());else if(typeof r?.height==="number")t.searchParams.set("h",r.height.toString());if(typeof e?.devicePixelRatio==="number")t.searchParams.set("dpr",e.devicePixelRatio.toString());if(typeof e?.fit==="string")t.searchParams.set("fit",e.fit);if(typeof e?.withoutEnlargement==="boolean"&&e.withoutEnlargement===!0)t.searchParams.set("we","true");if(typeof e?.alignmentPosition==="string")t.searchParams.set("a",e.alignmentPosition);if(typeof e?.compressionLevel==="number")t.searchParams.set("l",e.compressionLevel.toString());if(typeof e?.lossless==="boolean"&&e.lossless===!0)t.searchParams.set("ll","true");if(typeof e?.default==="string")t.searchParams.set("default",e.default);if(typeof e?.output==="string"&&e.output!=="original")t.searchParams.set("output",e.output);if(typeof e?.quality==="number")t.searchParams.set("q",e.quality.toString());return t}return p}export{xr as webNovelImageToURL,Fr as webNovelExternalIdentifierToURL,q as mime,Gr as getPrimaryTranslation,Jr as getPrimaryImage,F as WebNovelVolume,N as WebNovelComNovelId,y as WebNovelComNovelChapterId,W as WebNovelComCreatorId,z as WebNovelComAuth,Zr as WebNovelChapterContent,C as WebNovelChapter,gr as WebNovel,u as Translation,V as Relator,X as PersonalName,i as PartialDateTime,O as OriginalSource,jr as NullableNonEmptyString,I as NovelFireNetNovelId,h as NovelFireNetNovelChapterId,m as NonEmptyString,H as Mime,Y as ImageType,Z as Image,v as HostedNovelComNovelId,w as HostedNovelComNovelChapterId,j as HostedNovelComCreatorId,P as ExternalProvider,b as ExternalIdentifier,S as Creator,f as BCP47LanguageTag};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=19DEB59BCFBDFE7864756E2164756E21
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"import { mime } from \"@/utils/mime\";\nimport { Temporal } from \"temporal-polyfill\";\nimport z from \"zod\";\n\nexport const NonEmptyString = z\n\t.string({ error: (e) => `Not a string: \"${typeof e?.input}\"` })\n\t.transform((e) => e.trim())\n\t.refine((e) => e !== \"\", \"String must not be empty\");\nexport type NonEmptyString = z.infer<typeof NonEmptyString>;\n\nexport const NullableNonEmptyString = z\n\t.string({ error: (e) => `Not a string: \"${typeof e?.input}\"` })\n\t.transform((e) => e.trim())\n\t.transform((e) => (e === \"\" ? null : e));\nexport type NullableNonEmptyString = z.infer<typeof NullableNonEmptyString>;\n\nexport const PartialDateTime = z\n\t.custom<\n\t\t| `${number}`\n\t\t| `${number}-${number}`\n\t\t| `${number}-${number}-${number}`\n\t\t| `${number}-${number}-${number}T${number}:${number}:${number}Z`\n\t>((v) => {\n\t\treturn typeof v === \"string\" && /^(\\d{4})(-\\d{2})?(-\\d{2})?(T\\d{2}:\\d{2}:\\d{2}Z)?$/.test(v);\n\t})\n\t.refine(\n\t\t(v) => {\n\t\t\tif (v.indexOf(\"T\") > 0) {\n\t\t\t\ttry {\n\t\t\t\t\tTemporal.Instant.from(v);\n\t\t\t\t\treturn true;\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst m = v.split(\"-\");\n\n\t\t\t\tif (m.length > 3) {\n\t\t\t\t\t// sanity check; should never happen\n\t\t\t\t\treturn false;\n\t\t\t\t} else if (m.length === 3) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tTemporal.PlainDate.from(v);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else if (m.length === 2) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tTemporal.PlainDate.from(v + \"-01\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else if (m.length === 1) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tTemporal.PlainDate.from(v + \"-01-01\");\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// sanity check; should never happen\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\t{ error: (e) => `Date \"${String(e?.input ?? \"\").substring(0, 20)}\" is invalid` }\n\t);\nexport type PartialDateTime = z.infer<typeof PartialDateTime>;\n\nexport const Mime = z.coerce\n\t.string()\n\t.refine((v) => mime.getExtension(v) !== null, {\n\t\terror: (e) => `Invalid MIME type \"${String(e.input)}\"`,\n\t})\n\t.transform((v) => v.toLocaleLowerCase().trim());\nexport type Mime = z.infer<typeof Mime>;\n",
|
|
14
14
|
"interface MandatoryArrayInput {\n\t[x: string]: unknown;\n\tprimary: boolean;\n}\nexport function mandatoryArray<T extends MandatoryArrayInput>(inputArray: T[]): T[] {\n\tconst primaryCount = inputArray.filter((e) => e.primary === true).length;\n\n\tif (primaryCount > 1) {\n\t\tconst firstPrimaryIndex = inputArray.findIndex((e) => e.primary === true);\n\n\t\treturn inputArray.map((e, i) => {\n\t\t\te.primary = i === firstPrimaryIndex;\n\t\t\treturn e;\n\t\t});\n\t}\n\n\tif (primaryCount === 0 && typeof inputArray[0] !== \"undefined\") {\n\t\tinputArray[0].primary = true;\n\t\treturn inputArray;\n\t}\n\n\treturn inputArray;\n}\n",
|
|
15
15
|
"import { ExternalIdentifier, ExternalProvider } from \"@/schemas/external/common\";\nimport { BCP47LanguageTag } from \"@/schemas/ietf\";\nimport { Relator } from \"@/schemas/loc\";\nimport { Mime, NonEmptyString } from \"@/schemas/string\";\nimport { mandatoryArray } from \"@/utils/array\";\nimport z from \"zod\";\n\nexport const Translation = z.object({\n\tlanguage: BCP47LanguageTag.nullable().default(null),\n\tvalue: NonEmptyString,\n\ttype: z.enum([\"plain\", \"markdown\", \"html\"]).nullable().default(null),\n\tprimary: z.boolean().default(false),\n});\nexport type Translation = z.infer<typeof Translation>;\n\nexport const PersonalName = z.object({\n\tdisplayName: NonEmptyString,\n\tgivenName: NonEmptyString.nullable(),\n\tmiddleName: NonEmptyString.nullable(),\n\tfamilyName: NonEmptyString.nullable(),\n\tprimary: z.boolean().default(false),\n});\nexport type PersonalName = z.infer<typeof PersonalName>;\n\nexport const Creator = z.object({\n\texternalIdentifiers: z.array(ExternalIdentifier),\n\tnames: z.array(PersonalName).min(1).transform(mandatoryArray),\n\troles: z.array(Relator),\n});\nexport type Creator = z.infer<typeof Creator>;\n\nexport const ImageType = z.enum([\"cover\", \"backdrop\", \"spine\", \"back\"]);\nexport type ImageType = z.infer<typeof ImageType>;\n\nexport const Image = z.intersection(\n\tz.object({\n\t\ttype: ImageType,\n\t\theight: z.int().min(1).nullable(),\n\t\twidth: z.int().min(1).nullable(),\n\t\tlanguage: BCP47LanguageTag.nullable().default(null),\n\t\tprimary: z.boolean().default(false),\n\t\tmediaType: Mime.pipe(z.string().startsWith(\"image/\")).nullable(),\n\t}),\n\tz.union([\n\t\tz.object({\n\t\t\tprovider: ExternalProvider,\n\t\t\tid: NonEmptyString,\n\t\t}),\n\t\tz.object({\n\t\t\tprovider: z.null(),\n\t\t\tid: z.url(),\n\t\t}),\n\t])\n);\nexport type Image = z.infer<typeof Image>;\n",
|
|
16
|
-
"import { Creator, Image, Translation } from \"@/schemas/common\";\nimport { ExternalIdentifier, OriginalSource } from \"@/schemas/external/common\";\nimport { BCP47LanguageTag } from \"@/schemas/ietf\";\nimport { NonEmptyString, PartialDateTime } from \"@/schemas/string\";\nimport { mandatoryArray } from \"@/utils/array\";\nimport z from \"zod\";\n\nexport const WebNovelChapterContent = z.object({\n\toriginalHTML: z.array(NonEmptyString),\n\toriginalHTMLSize: z.int().min(0),\n\n\tgeneratedMarkdown: NonEmptyString,\n\tgeneratedMarkdownSize: z.int().min(0),\n});\nexport type WebNovelChapterContent = z.infer<typeof WebNovelChapterContent>;\n\nexport const WebNovelChapter = z.object({\n\texternalIdentifiers: z.array(ExternalIdentifier).min(1),\n\n\tvolumeNumber: z.number().min(0).nullable(),\n\tnumber: z.number().min(0),\n\tnames: z.array(Translation).min(1).transform(mandatoryArray),\n\tcreators: z.array(Creator),\n\n\tcreatedAt: PartialDateTime.nullable(),\n\tupdatedAt: PartialDateTime.nullable(),\n});\nexport type WebNovelChapter = z.infer<typeof WebNovelChapter>;\n\nexport const WebNovelVolume = z.object({\n\texternalIdentifiers: z.array(ExternalIdentifier),\n\n\tnumber: z.number().min(0),\n\tnames: z.array(Translation).transform(mandatoryArray),\n\n\tcreatedAt: PartialDateTime.nullable(),\n\tupdatedAt: PartialDateTime.nullable(),\n\n\tchapters: z.array(WebNovelChapter),\n});\nexport type WebNovelVolume = z.infer<typeof WebNovelVolume>;\n\nexport const WebNovel = z.object({\n\texternalIdentifiers: z.array(ExternalIdentifier).min(1),\n\n\tnames: z.array(Translation).min(1).transform(mandatoryArray),\n\tlanguage: BCP47LanguageTag,\n\toverviews: z.array(Translation).transform(mandatoryArray),\n\tcreators: z.array(Creator),\n\timages: z.array(Image).transform(mandatoryArray),\n\toriginalLanguage: BCP47LanguageTag.nullable(),\n\toriginalSource: OriginalSource.nullable(),\n\n\tisComplete: z.boolean().nullable(),\n\n\tcreatedAt: PartialDateTime.nullable(),\n\tupdatedAt: PartialDateTime.nullable(),\n\n\tvolumes: z.array(WebNovelVolume),\n});\nexport type WebNovel = z.infer<typeof WebNovel>;\n",
|
|
16
|
+
"import { Creator, Image, Translation } from \"@/schemas/common\";\nimport { ExternalIdentifier, OriginalSource } from \"@/schemas/external/common\";\nimport { BCP47LanguageTag } from \"@/schemas/ietf\";\nimport { NonEmptyString, PartialDateTime } from \"@/schemas/string\";\nimport { mandatoryArray } from \"@/utils/array\";\nimport z from \"zod\";\n\nexport const WebNovelChapterContent = z.object({\n\toriginalHTML: z.array(NonEmptyString),\n\toriginalHTMLSize: z.int().min(0),\n\n\tgeneratedMarkdown: NonEmptyString,\n\tgeneratedMarkdownSize: z.int().min(0),\n});\nexport type WebNovelChapterContent = z.infer<typeof WebNovelChapterContent>;\n\nexport const WebNovelChapter = z.object({\n\tinternalIdentifier: NonEmptyString,\n\texternalIdentifiers: z.array(ExternalIdentifier).min(1),\n\n\tvolumeNumber: z.number().min(0).nullable(),\n\tnumber: z.number().min(0),\n\tnames: z.array(Translation).min(1).transform(mandatoryArray),\n\tcreators: z.array(Creator),\n\n\tcreatedAt: PartialDateTime.nullable(),\n\tupdatedAt: PartialDateTime.nullable(),\n});\nexport type WebNovelChapter = z.infer<typeof WebNovelChapter>;\n\nexport const WebNovelVolume = z.object({\n\texternalIdentifiers: z.array(ExternalIdentifier),\n\n\tnumber: z.number().min(0),\n\tnames: z.array(Translation).transform(mandatoryArray),\n\n\tcreatedAt: PartialDateTime.nullable(),\n\tupdatedAt: PartialDateTime.nullable(),\n\n\tchapters: z.array(WebNovelChapter),\n});\nexport type WebNovelVolume = z.infer<typeof WebNovelVolume>;\n\nexport const WebNovel = z.object({\n\tinternalIdentifier: NonEmptyString,\n\texternalIdentifiers: z.array(ExternalIdentifier).min(1),\n\n\tnames: z.array(Translation).min(1).transform(mandatoryArray),\n\tlanguage: BCP47LanguageTag,\n\toverviews: z.array(Translation).transform(mandatoryArray),\n\tcreators: z.array(Creator),\n\timages: z.array(Image).transform(mandatoryArray),\n\toriginalLanguage: BCP47LanguageTag.nullable(),\n\toriginalSource: OriginalSource.nullable(),\n\n\tisComplete: z.boolean().nullable(),\n\n\tcreatedAt: PartialDateTime.nullable(),\n\tupdatedAt: PartialDateTime.nullable(),\n\n\tvolumes: z.array(WebNovelVolume),\n});\nexport type WebNovel = z.infer<typeof WebNovel>;\n",
|
|
17
17
|
"import type { Image, Translation } from \"@/schemas/common\";\n\n/**\n * Return primary translation, if none is marked as primary, return the first one\n */\nexport function getPrimaryTranslation(t: Translation[]): Translation | undefined {\n\tconst primary = t.find((e) => e.primary === true);\n\tif (typeof primary !== \"undefined\") {\n\t\treturn primary;\n\t}\n\n\treturn t?.[0] ?? undefined;\n}\n\n/**\n * Return primary image, if none is marked as primary, return the first one\n */\nexport function getPrimaryImage(t: Image[]): Image | undefined {\n\tconst primary = t.find((e) => e.primary === true);\n\tif (typeof primary !== \"undefined\") {\n\t\treturn primary;\n\t}\n\n\treturn t?.[0] ?? undefined;\n}\n",
|
|
18
18
|
"import type { Image } from \"@/schemas/common\";\nimport type { ExternalIdentifier } from \"@/schemas/external/common\";\nimport {\n\tHostedNovelComCreatorId,\n\tHostedNovelComNovelChapterId,\n\tHostedNovelComNovelId,\n} from \"@/schemas/external/hostednovel_com\";\nimport { NovelFireNetNovelChapterId, NovelFireNetNovelId } from \"@/schemas/external/novelfire_net\";\nimport {\n\tWebNovelComCreatorId,\n\tWebNovelComNovelChapterId,\n\tWebNovelComNovelId,\n} from \"@/schemas/external/webnovel_com\";\nimport z from \"zod\";\n\nexport function webNovelExternalIdentifierToURL(ext: ExternalIdentifier): URL | undefined {\n\tif (ext.provider === \"webnovel.com\") {\n\t\tconst novelId = WebNovelComNovelId.safeParse(ext.id)?.data ?? undefined;\n\t\tconst novelChapterId = WebNovelComNovelChapterId.safeParse(ext.id)?.data ?? undefined;\n\t\tconst creatorId = WebNovelComCreatorId.safeParse(ext.id)?.data ?? undefined;\n\n\t\tconst HOST = \"https://www.webnovel.com\";\n\n\t\tif (typeof novelId === \"string\") {\n\t\t\treturn new URL(`/book/${novelId.substring(2)}`, HOST);\n\t\t} else if (typeof novelChapterId === \"string\") {\n\t\t\tconst p = novelChapterId.split(\"/\");\n\t\t\treturn new URL(`/book/${p[1]}/${p[3]}`, HOST);\n\t\t} else if (typeof creatorId === \"string\") {\n\t\t\treturn new URL(`/profile/${creatorId.substring(2)}`, HOST);\n\t\t}\n\t} else if (ext.provider === \"novelfire.net\") {\n\t\tconst novelId = NovelFireNetNovelId.safeParse(ext.id)?.data ?? undefined;\n\t\tconst novelChapterId = NovelFireNetNovelChapterId.safeParse(ext.id)?.data ?? undefined;\n\n\t\tconst HOST = \"https://novelfire.net\";\n\n\t\tif (typeof novelId === \"string\") {\n\t\t\treturn new URL(`/book/${novelId.substring(2)}`, HOST);\n\t\t} else if (typeof novelChapterId === \"string\") {\n\t\t\tconst p = novelChapterId.split(\"/\");\n\t\t\treturn new URL(`/book/${p[1]}/${p[3]}`, HOST);\n\t\t}\n\t} else if (ext.provider === \"hostednovel.com\") {\n\t\tconst novelId = HostedNovelComNovelId.safeParse(ext.id)?.data ?? undefined;\n\t\tconst novelChapterId = HostedNovelComNovelChapterId.safeParse(ext.id)?.data ?? undefined;\n\t\tconst creatorId = HostedNovelComCreatorId.safeParse(ext.id)?.data ?? undefined;\n\n\t\tconst HOST = \"https://hostednovel.com\";\n\n\t\tif (typeof novelId === \"string\") {\n\t\t\treturn new URL(`/novel/${novelId.substring(2)}`, HOST);\n\t\t} else if (typeof novelChapterId === \"string\") {\n\t\t\tconst p = novelChapterId.split(\"/\");\n\t\t\treturn new URL(`/novel/${p[1]}/${p[3]}`, HOST);\n\t\t} else if (typeof creatorId === \"string\") {\n\t\t\treturn new URL(`/creator/${creatorId.substring(2)}`, HOST);\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nconst ImageConfigWsrvNl = z.object({\n\timageProxy: z.literal(\"wsrv.nl\"),\n\n\t// ================================ Format ================\n\t/**\n\t * @see {@link https://wsrv.nl/docs/format#output}\n\t */\n\toutput: z\n\t\t.enum([\"jpg\", \"jxl\", \"png\", \"gif\", \"tiff\", \"webp\", \"original\"])\n\t\t.default(\"original\")\n\t\t.optional(),\n\t/**\n\t * Only supported by `jpg`, `jxl`, `tiff` and `webp`\n\t * @see {@link https://wsrv.nl/docs/format#quality}\n\t */\n\tquality: z.int().min(1).max(100).default(80).optional(),\n\t/**\n\t * @see {@link https://wsrv.nl/docs/format#default-image}\n\t */\n\tdefault: z.url().optional(),\n\t/**\n\t * Only supported by `png`\n\t * @see {@link https://wsrv.nl/docs/format#lossless-compression}\n\t */\n\tlossless: z.boolean().optional(),\n\t/**\n\t * Only supported by `png`\n\t * @see {@link https://wsrv.nl/docs/format#compression-level}\n\t */\n\tcompressionLevel: z.int().min(0).max(9).default(6).optional(),\n\n\t// ================================ Size ================\n\t/**\n\t * @see {@link https://wsrv.nl/docs/size#width}\n\t */\n\twidth: z.int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),\n\t/**\n\t * @see {@link https://wsrv.nl/docs/size#height}\n\t */\n\theight: z.int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),\n\t/**\n\t * A `width`, a `height`, or both must be specified for this parameter to work.\n\t * @see {@link https://wsrv.nl/docs/size#device-pixel-ratio}\n\t */\n\tdevicePixelRatio: z.int().min(1).max(8).optional(),\n\n\t// ================================ Fit ================\n\t/**\n\t * @see {@link https://wsrv.nl/docs/fit#fit}\n\t */\n\tfit: z.enum([\"inside\", \"outside\", \"cover\", \"fill\", \"contain\"]).optional(),\n\t/**\n\t * @see {@link https://wsrv.nl/docs/fit#without-enlargement}\n\t */\n\twithoutEnlargement: z.boolean().default(true).optional(),\n\n\t// ================================ Crop ================\n\t/**\n\t * How the image should be aligned when `fit=cover` or `fit=contain` is set. The `width` and `height` parameters should also be specified.\n\t *\n\t * `entropy`: Focus on the region with the highest [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_%28information_theory%29)\n\t *\n\t * `attention`: Focus on the region with the highest luminance frequency, color saturation and presence of skin tones.\n\t *\n\t * @see {@link https://wsrv.nl/docs/crop#alignment-position}\n\t */\n\talignmentPosition: z\n\t\t.enum([\n\t\t\t\"top\",\n\t\t\t\"right\",\n\t\t\t\"bottom\",\n\t\t\t\"left\",\n\t\t\t\"top-left\",\n\t\t\t\"bottom-left\",\n\t\t\t\"bottom-right\",\n\t\t\t\"top-right\",\n\t\t\t\"center\",\n\n\t\t\t\"entropy\",\n\t\t\t\"attention\",\n\t\t])\n\t\t.default(\"center\")\n\t\t.optional(),\n});\nconst ImageConfig = z.discriminatedUnion(\"imageProxy\", [\n\tz.object({\n\t\timageProxy: z.literal(false),\n\t}),\n\tImageConfigWsrvNl,\n]);\ntype ImageConfig = z.infer<typeof ImageConfig>;\nexport function webNovelImageToURL(\n\timage: Image,\n\tinputConfig: ImageConfig = { imageProxy: false }\n): URL | undefined {\n\tconst config = ImageConfig.parse(inputConfig);\n\n\tlet imageURL: URL | undefined = undefined;\n\n\tif (image.provider === \"webnovel.com\") {\n\t\tif (/^n\\/\\d+(\\/\\d+)?/.test(image.id)) {\n\t\t\tconst sId = image.id.split(\"/\");\n\t\t\t/* cspell:disable-next-line */\n\t\t\timageURL = new URL(`/bookcover/${sId[1]}`, \"https://book-pic.webnovel.com\");\n\t\t\t/* cspell:disable-next-line */\n\t\t\timageURL.searchParams.set(\"imageMogr2/thumbnail/600x\", \"\");\n\t\t\tif (typeof sId?.[2] === \"string\") {\n\t\t\t\timageURL.searchParams.set(\"imageId\", sId[2]);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof imageURL === \"undefined\") {\n\t\treturn undefined;\n\t}\n\n\t// Image Proxy\n\n\tif (config.imageProxy === \"wsrv.nl\") {\n\t\tconst proxyURL = new URL(\"https://wsrv.nl\");\n\t\tproxyURL.searchParams.set(\"url\", imageURL.toString());\n\n\t\tconst proxyConfig = ImageConfigWsrvNl.parse(config);\n\n\t\tif (typeof proxyConfig?.width === \"number\") {\n\t\t\tproxyURL.searchParams.set(\"w\", proxyConfig.width.toString());\n\t\t} else if (typeof image?.width === \"number\") {\n\t\t\tproxyURL.searchParams.set(\"w\", image.width.toString());\n\t\t}\n\t\tif (typeof proxyConfig?.height === \"number\") {\n\t\t\tproxyURL.searchParams.set(\"h\", proxyConfig.height.toString());\n\t\t} else if (typeof image?.height === \"number\") {\n\t\t\tproxyURL.searchParams.set(\"h\", image.height.toString());\n\t\t}\n\t\tif (typeof proxyConfig?.devicePixelRatio === \"number\") {\n\t\t\tproxyURL.searchParams.set(\"dpr\", proxyConfig.devicePixelRatio.toString());\n\t\t}\n\n\t\tif (typeof proxyConfig?.fit === \"string\") {\n\t\t\tproxyURL.searchParams.set(\"fit\", proxyConfig.fit);\n\t\t}\n\t\tif (\n\t\t\ttypeof proxyConfig?.withoutEnlargement === \"boolean\" &&\n\t\t\tproxyConfig.withoutEnlargement === true\n\t\t) {\n\t\t\tproxyURL.searchParams.set(\"we\", \"true\");\n\t\t}\n\n\t\tif (typeof proxyConfig?.alignmentPosition === \"string\") {\n\t\t\tproxyURL.searchParams.set(\"a\", proxyConfig.alignmentPosition);\n\t\t}\n\n\t\tif (typeof proxyConfig?.compressionLevel === \"number\") {\n\t\t\tproxyURL.searchParams.set(\"l\", proxyConfig.compressionLevel.toString());\n\t\t}\n\t\tif (typeof proxyConfig?.lossless === \"boolean\" && proxyConfig.lossless === true) {\n\t\t\tproxyURL.searchParams.set(\"ll\", \"true\");\n\t\t}\n\t\tif (typeof proxyConfig?.default === \"string\") {\n\t\t\tproxyURL.searchParams.set(\"default\", proxyConfig.default);\n\t\t}\n\t\tif (typeof proxyConfig?.output === \"string\" && proxyConfig.output !== \"original\") {\n\t\t\tproxyURL.searchParams.set(\"output\", proxyConfig.output);\n\t\t}\n\t\tif (typeof proxyConfig?.quality === \"number\") {\n\t\t\tproxyURL.searchParams.set(\"q\", proxyConfig.quality.toString());\n\t\t}\n\n\t\treturn proxyURL;\n\t}\n\n\t// Not yet implemented\n\treturn imageURL;\n}\n"
|
|
19
19
|
],
|
|
20
|
-
"mappings": "AAAA,mBAEO,IAAM,EAAkB,EAAE,OAAO,CACvC,IAAK,EAAE,OAAO,EAAE,MAAM,OAAO,EAAE,IAAI,EAAE,EACrC,KAAM,EACJ,OAAO,EACP,MAAM,gBAAgB,EACtB,IAAI,EAAE,CACT,CAAC,EAIY,EAAqB,EAAE,OAAO,EAAE,MAAM,WAAY,2BAA2B,EAI7E,EAA4B,EACvC,OAAO,EACP,MAAM,mBAAoB,mCAAmC,EAIlD,EAAuB,EAAE,OAAO,EAAE,MAAM,WAAY,6BAA6B,ECjB9F,mBCLA,mBAGO,IAAM,EAAwB,EACnC,OAAO,EACP,MAAM,sBAAuB,8BAA8B,EAIhD,EAA+B,EAC1C,OAAO,EACP,MAAM,yCAA0C,sCAAsC,EAI3E,EAA0B,EACrC,OAAO,EACP,MAAM,sBAAuB,gCAAgC,ECjB/D,mBAGO,IAAM,EAAsB,EACjC,OAAO,EACP,MAAM,sBAAuB,4BAA4B,EAI9C,EAA6B,EACxC,OAAO,EACP,MAAM,yCAA0C,oCAAoC,EFE/E,IAAM,EAAmB,EAAE,KAAK,CAAC,eAAgB,gBAAiB,iBAAiB,CAAC,EAG9E,EAAqB,EAAE,OAAO,CAC1C,SAAU,EACV,GAAI,EAAE,MAAM,CACX,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACD,CAAC,CACF,CAAC,EAGY,EAAiB,EAAE,KAAK,CAAC,aAAc,cAAc,CAAC,EG/BnE,6BACA,mBAeO,IAAM,EAAmB,EAC9B,OAAO,EACP,OAAO,CAAC,IAAM,EAAK,CAAC,EAAE,MAAM,EAAG,CAC/B,MAAO,CAAC,IACP,yBAAyB,EAAK,OAAO,GAAG,OAAS,EAAE,CAAC,EAClD,OAAO,EACP,KAAK,GAAG,GACZ,CAAC,EACA,UAAU,CAAC,IAAM,OAAO,EAAK,CAAC,EAAE,OAAO,CAAC,CAAC,ECxB3C,IAAe,GACd,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACD,ECjTA,mBAEO,IAAM,EAAU,EAAE,KAAK,CAAQ,ECHtC,eAAS,kBACT,mCACA,sCAEO,IAAM,EAAO,IAAI,EAAK,EAAE,OAAO,IAClC,KACA,CACJ,CAAC,ECND,mBAAS,0BACT,mBAEO,IAAM,EAAiB,EAC5B,OAAO,CAAE,MAAO,CAAC,IAAM,kBAAkB,OAAO,GAAG,QAAS,CAAC,EAC7D,UAAU,CAAC,IAAM,EAAE,KAAK,CAAC,EACzB,OAAO,CAAC,IAAM,IAAM,GAAI,0BAA0B,EAGvC,GAAyB,EACpC,OAAO,CAAE,MAAO,CAAC,IAAM,kBAAkB,OAAO,GAAG,QAAS,CAAC,EAC7D,UAAU,CAAC,IAAM,EAAE,KAAK,CAAC,EACzB,UAAU,CAAC,IAAO,IAAM,GAAK,KAAO,CAAE,EAG3B,EAAkB,EAC7B,OAKC,CAAC,IAAM,CACR,OAAO,O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ACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,M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