@webnovel-proxy/schemas 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.d.ts +2506 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +22 -0
- package/package.json +43 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import j from"zod";var b=j.string().regex(/^n\/\d+$/,"Invalid WebNovel novel ID"),u=j.string().regex(/^n\/\d+\/c\/\d+$/,"Invalid WebNovel novel chapter ID"),y=j.string().regex(/^c\/\d+$/,"Invalid WebNovel creator ID");import v from"zod";import T from"zod";var g=T.string().regex(/^n\/[a-zA-Z0-9_-]+$/,"Invalid HostedNovel novel ID"),N=T.string().regex(/^n\/[a-zA-Z0-9_-]+\/c\/[a-zA-Z0-9_-]+$/,"Invalid HostedNovel novel chapter ID"),x=T.string().regex(/^c\/[a-zA-Z0-9_-]+$/,"Invalid HostedNovel creator ID");import k from"zod";var w=k.string().regex(/^n\/[a-zA-Z0-9_-]+$/,"Invalid NovelFire novel ID"),W=k.string().regex(/^n\/[a-zA-Z0-9_-]+\/c\/[a-zA-Z0-9_-]+$/,"Invalid NovelFire novel chapter ID");var E=v.enum(["webnovel.com","novelfire.net","hostednovel.com"]),d=v.object({provider:E,id:v.union([b,u,y,w,W,g,N,x])}),z=v.enum(["qidian.com","ciweimao.com"]);import P from"language-tags";import R from"zod";var f=R.string().refine((r)=>P(r).valid(),{error:(r)=>`Invalid Language Tag: ${P(String(r?.input??"")).errors().join(";")}`}).transform((r)=>String(P(r).format()));var A=["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 V from"zod";var M=V.enum(A);import{Mime as $}from"mime/lite";import q from"mime/types/other.js";import B from"mime/types/standard.js";var O=new $().define({...B,...q});import{Temporal as I}from"temporal-polyfill";import C from"zod";var l=C.string({error:(r)=>`Not a string: "${typeof r?.input}"`}).transform((r)=>r.trim()).refine((r)=>r!=="","String must not be empty"),gr=C.string({error:(r)=>`Not a string: "${typeof r?.input}"`}).transform((r)=>r.trim()).transform((r)=>r===""?null:r),i=C.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 I.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 I.PlainDate.from(r),!0}catch{return!1}else if(o.length===2)try{return I.PlainDate.from(r+"-01"),!0}catch{return!1}else if(o.length===1)try{return I.PlainDate.from(r+"-01-01"),!0}catch{return!1}return!1}},{error:(r)=>`Date "${String(r?.input??"").substring(0,20)}" is invalid`}),S=C.coerce.string().refine((r)=>O.getExtension(r)!==null,{error:(r)=>`Invalid MIME type "${String(r.input)}"`}).transform((r)=>r.toLocaleLowerCase().trim());function p(r){let o=r.filter((a)=>a.primary===!0).length;if(o>1){let a=r.findIndex((n)=>n.primary===!0);return r.map((n,m)=>{return n.primary=m===a,n})}if(o===0&&typeof r[0]<"u")return r[0].primary=!0,r;return r}import e from"zod";var s=e.object({language:f.nullable().default(null),value:l,type:e.enum(["plain","markdown","html"]).nullable().default(null),primary:e.boolean().default(!1)}),G=e.object({displayName:l,givenName:l.nullable(),middleName:l.nullable(),familyName:l.nullable(),primary:e.boolean().default(!1)}),h=e.object({externalIdentifiers:e.array(d),names:e.array(G).min(1).transform(p),roles:e.array(M)}),H=e.enum(["cover","backdrop","spine","back"]),D=e.intersection(e.object({type:H,height:e.int().min(1).nullable(),width:e.int().min(1).nullable(),language:f.nullable().default(null),primary:e.boolean().default(!1),mediaType:S.pipe(e.string().startsWith("image/")).nullable()}),e.union([e.object({provider:E,id:l}),e.object({provider:e.null(),id:e.url()})]));import t from"zod";var J=t.object({externalIdentifiers:t.array(d).min(1),volumeNumber:t.number().min(0).nullable(),number:t.number().min(0),names:t.array(s).min(1).transform(p),creators:t.array(h),createdAt:i.nullable(),updatedAt:i.nullable()}),K=t.object({externalIdentifiers:t.array(d),number:t.number().min(0),names:t.array(s).transform(p),createdAt:i.nullable(),updatedAt:i.nullable(),chapters:t.array(J)}),Mr=t.object({externalIdentifiers:t.array(d).min(1),names:t.array(s).min(1).transform(p),language:f,overviews:t.array(s).transform(p),creators:t.array(h),images:t.array(D).transform(p),originalLanguage:f.nullable(),originalSource:z.nullable(),isComplete:t.boolean().nullable(),createdAt:i.nullable(),updatedAt:i.nullable(),volumes:t.array(K)});function Vr(r){if(r.provider==="webnovel.com"){let o=b.safeParse(r.id)?.data??void 0,a=u.safeParse(r.id)?.data??void 0,n=y.safeParse(r.id)?.data??void 0,m="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 c=a.split("/");return new URL(`/book/${c[1]}/${c[3]}`,"https://www.webnovel.com")}else if(typeof n==="string")return new URL(`/profile/${n.substring(2)}`,"https://www.webnovel.com")}else if(r.provider==="novelfire.net"){let o=w.safeParse(r.id)?.data??void 0,a=W.safeParse(r.id)?.data??void 0,n="https://novelfire.net";if(typeof o==="string")return new URL(`/book/${o.substring(2)}`,"https://novelfire.net");else if(typeof a==="string"){let m=a.split("/");return new URL(`/book/${m[1]}/${m[3]}`,"https://novelfire.net")}}else if(r.provider==="hostednovel.com"){let o=g.safeParse(r.id)?.data??void 0,a=N.safeParse(r.id)?.data??void 0,n=x.safeParse(r.id)?.data??void 0,m="https://hostednovel.com";if(typeof o==="string")return new URL(`/novel/${o.substring(2)}`,"https://hostednovel.com");else if(typeof a==="string"){let c=a.split("/");return new URL(`/novel/${c[1]}/${c[3]}`,"https://hostednovel.com")}else if(typeof n==="string")return new URL(`/creator/${n.substring(2)}`,"https://hostednovel.com")}return}export{Vr as webNovelExternalIdentifierToURL,O as mime,K as WebNovelVolume,b as WebNovelComNovelId,u as WebNovelComNovelChapterId,y as WebNovelComCreatorId,J as WebNovelChapter,Mr as WebNovel,s as Translation,M as Relator,G as PersonalName,i as PartialDateTime,z as OriginalSource,gr as NullableNonEmptyString,w as NovelFireNetNovelId,W as NovelFireNetNovelChapterId,l as NonEmptyString,S as Mime,H as ImageType,D as Image,g as HostedNovelComNovelId,N as HostedNovelComNovelChapterId,x as HostedNovelComCreatorId,E as ExternalProvider,d as ExternalIdentifier,h as Creator,f as BCP47LanguageTag};
|
|
2
|
+
|
|
3
|
+
//# debugId=9A451E850986AEC764756E2164756E21
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/schemas/external/webnovel_com.ts", "../src/schemas/external/common.ts", "../src/schemas/external/hostednovel_com.ts", "../src/schemas/external/novelfire_net.ts", "../src/schemas/ietf.ts", "../src/constants/loc/relators.ts", "../src/schemas/loc.ts", "../src/utils/mime.ts", "../src/schemas/string.ts", "../src/utils/array.ts", "../src/schemas/common.ts", "../src/schemas/webnovel.ts", "../src/utils/external.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import z from \"zod\";\n\n/** @example `n/1234` */\nexport const WebNovelComNovelId = z.string().regex(/^n\\/\\d+$/, \"Invalid WebNovel novel ID\");\nexport type WebNovelComNovelId = z.infer<typeof WebNovelComNovelId>;\n\n/** @example `n/1234/c/5678` */\nexport const WebNovelComNovelChapterId = z\n\t.string()\n\t.regex(/^n\\/\\d+\\/c\\/\\d+$/, \"Invalid WebNovel novel chapter ID\");\nexport type WebNovelComNovelChapterId = z.infer<typeof WebNovelComNovelChapterId>;\n\n/** @example `c/1234` */\nexport const WebNovelComCreatorId = z.string().regex(/^c\\/\\d+$/, \"Invalid WebNovel creator ID\");\nexport type WebNovelComCreatorId = z.infer<typeof WebNovelComCreatorId>;\n",
|
|
6
|
+
"import {\n\tWebNovelComCreatorId,\n\tWebNovelComNovelChapterId,\n\tWebNovelComNovelId,\n} from \"@/schemas/external/webnovel_com\";\nimport z from \"zod\";\nimport {\n\tHostedNovelComCreatorId,\n\tHostedNovelComNovelChapterId,\n\tHostedNovelComNovelId,\n} from \"./hostednovel_com\";\nimport { NovelFireNetNovelChapterId, NovelFireNetNovelId } from \"./novelfire_net\";\n\nexport const ExternalProvider = z.enum([\"webnovel.com\", \"novelfire.net\", \"hostednovel.com\"]);\nexport type ExternalProvider = z.infer<typeof ExternalProvider>;\n\nexport const ExternalIdentifier = z.object({\n\tprovider: ExternalProvider,\n\tid: z.union([\n\t\tWebNovelComNovelId,\n\t\tWebNovelComNovelChapterId,\n\t\tWebNovelComCreatorId,\n\t\tNovelFireNetNovelId,\n\t\tNovelFireNetNovelChapterId,\n\t\tHostedNovelComNovelId,\n\t\tHostedNovelComNovelChapterId,\n\t\tHostedNovelComCreatorId,\n\t]),\n});\nexport type ExternalIdentifier = z.infer<typeof ExternalIdentifier>;\n\nexport const OriginalSource = z.enum([\"qidian.com\", \"ciweimao.com\"]);\nexport type OriginalSource = z.infer<typeof OriginalSource>;\n",
|
|
7
|
+
"import z from \"zod\";\n\n/** @example `n/example-novel` */\nexport const HostedNovelComNovelId = z\n\t.string()\n\t.regex(/^n\\/[a-zA-Z0-9_-]+$/, \"Invalid HostedNovel novel ID\");\nexport type HostedNovelComNovelId = z.infer<typeof HostedNovelComNovelId>;\n\n/** @example `n/example-novel/c/chapter-1` */\nexport const HostedNovelComNovelChapterId = z\n\t.string()\n\t.regex(/^n\\/[a-zA-Z0-9_-]+\\/c\\/[a-zA-Z0-9_-]+$/, \"Invalid HostedNovel novel chapter ID\");\nexport type HostedNovelComNovelChapterId = z.infer<typeof HostedNovelComNovelChapterId>;\n\n/** @example `c/example-creator` */\nexport const HostedNovelComCreatorId = z\n\t.string()\n\t.regex(/^c\\/[a-zA-Z0-9_-]+$/, \"Invalid HostedNovel creator ID\");\nexport type HostedNovelComCreatorId = z.infer<typeof HostedNovelComCreatorId>;\n",
|
|
8
|
+
"import z from \"zod\";\n\n/** @example `n/example-novel` */\nexport const NovelFireNetNovelId = z\n\t.string()\n\t.regex(/^n\\/[a-zA-Z0-9_-]+$/, \"Invalid NovelFire novel ID\");\nexport type NovelFireNetNovelId = z.infer<typeof NovelFireNetNovelId>;\n\n/** @example `n/example-novel/c/chapter-1` */\nexport const NovelFireNetNovelChapterId = z\n\t.string()\n\t.regex(/^n\\/[a-zA-Z0-9_-]+\\/c\\/[a-zA-Z0-9_-]+$/, \"Invalid NovelFire novel chapter ID\");\nexport type NovelFireNetNovelChapterId = z.infer<typeof NovelFireNetNovelChapterId>;\n",
|
|
9
|
+
"import tags from \"language-tags\";\nimport z from \"zod\";\n\n/**\n * IETF BCP 47 Language Tag\n *\n * {@link https://datatracker.ietf.org/doc/bcp47/|BCP 47} |\n * {@link https://datatracker.ietf.org/doc/rfc5646/|RFC 5646} |\n * {@link https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry|Database of official tags}\n *\n * @example\n * \"en\"\n * \"en-US\"\n * \"en-Latn\"\n * \"en-Latn-US\"\n */\nexport const BCP47LanguageTag = z\n\t.string()\n\t.refine((v) => tags(v).valid(), {\n\t\terror: (e) =>\n\t\t\t`Invalid Language Tag: ${tags(String(e?.input ?? \"\"))\n\t\t\t\t.errors()\n\t\t\t\t.join(\";\")}`,\n\t})\n\t.transform((v) => String(tags(v).format()));\nexport type BCP47LanguageTag = z.infer<typeof BCP47LanguageTag>;\n",
|
|
10
|
+
"export default [\n\t\"abr\",\n\t\"acp\",\n\t\"act\",\n\t\"adi\",\n\t\"adp\",\n\t\"aft\",\n\t\"anc\",\n\t\"anl\",\n\t\"anm\",\n\t\"ann\",\n\t\"ant\",\n\t\"ape\",\n\t\"apl\",\n\t\"app\",\n\t\"aqt\",\n\t\"arc\",\n\t\"ard\",\n\t\"arr\",\n\t\"art\",\n\t\"asg\",\n\t\"asn\",\n\t\"ato\",\n\t\"att\",\n\t\"auc\",\n\t\"aud\",\n\t\"aue\",\n\t\"aui\",\n\t\"aup\",\n\t\"aus\",\n\t\"aut\",\n\t\"bdd\",\n\t\"bjd\",\n\t\"bka\",\n\t\"bkd\",\n\t\"bkp\",\n\t\"blw\",\n\t\"bnd\",\n\t\"bpd\",\n\t\"brd\",\n\t\"brl\",\n\t\"bsl\",\n\t\"cad\",\n\t\"cas\",\n\t\"ccp\",\n\t\"chr\",\n\t\"cli\",\n\t\"cll\",\n\t\"clr\",\n\t\"clt\",\n\t\"cmm\",\n\t\"cmp\",\n\t\"cmt\",\n\t\"cnd\",\n\t\"cng\",\n\t\"cns\",\n\t\"coe\",\n\t\"col\",\n\t\"com\",\n\t\"con\",\n\t\"cop\",\n\t\"cor\",\n\t\"cos\",\n\t\"cot\",\n\t\"cou\",\n\t\"cov\",\n\t\"cpc\",\n\t\"cpe\",\n\t\"cph\",\n\t\"cpl\",\n\t\"cpt\",\n\t\"cre\",\n\t\"crp\",\n\t\"crr\",\n\t\"crt\",\n\t\"csl\",\n\t\"csp\",\n\t\"cst\",\n\t\"ctb\",\n\t\"cte\",\n\t\"ctg\",\n\t\"ctr\",\n\t\"cts\",\n\t\"ctt\",\n\t\"cur\",\n\t\"cwt\",\n\t\"dbd\",\n\t\"dbp\",\n\t\"dfd\",\n\t\"dfe\",\n\t\"dft\",\n\t\"dgc\",\n\t\"dgg\",\n\t\"dgs\",\n\t\"dis\",\n\t\"djo\",\n\t\"dln\",\n\t\"dnc\",\n\t\"dnr\",\n\t\"dpc\",\n\t\"dpt\",\n\t\"drm\",\n\t\"drt\",\n\t\"dsr\",\n\t\"dst\",\n\t\"dtc\",\n\t\"dte\",\n\t\"dtm\",\n\t\"dto\",\n\t\"dub\",\n\t\"edc\",\n\t\"edd\",\n\t\"edm\",\n\t\"edt\",\n\t\"egr\",\n\t\"elg\",\n\t\"elt\",\n\t\"eng\",\n\t\"enj\",\n\t\"etr\",\n\t\"evp\",\n\t\"exp\",\n\t\"fac\",\n\t\"fds\",\n\t\"fld\",\n\t\"flm\",\n\t\"fmd\",\n\t\"fmk\",\n\t\"fmo\",\n\t\"fmp\",\n\t\"fnd\",\n\t\"fon\",\n\t\"fpy\",\n\t\"frg\",\n\t\"gdv\",\n\t\"gis\",\n\t\"his\",\n\t\"hnr\",\n\t\"hst\",\n\t\"ill\",\n\t\"ilu\",\n\t\"ink\",\n\t\"ins\",\n\t\"inv\",\n\t\"isb\",\n\t\"itr\",\n\t\"ive\",\n\t\"ivr\",\n\t\"jud\",\n\t\"jug\",\n\t\"lbr\",\n\t\"lbt\",\n\t\"ldr\",\n\t\"led\",\n\t\"lee\",\n\t\"lel\",\n\t\"len\",\n\t\"let\",\n\t\"lgd\",\n\t\"lie\",\n\t\"lil\",\n\t\"lit\",\n\t\"lsa\",\n\t\"lse\",\n\t\"lso\",\n\t\"ltg\",\n\t\"ltr\",\n\t\"lyr\",\n\t\"mcp\",\n\t\"mdc\",\n\t\"med\",\n\t\"mfp\",\n\t\"mfr\",\n\t\"mka\",\n\t\"mod\",\n\t\"mon\",\n\t\"mrb\",\n\t\"mrk\",\n\t\"msd\",\n\t\"mte\",\n\t\"mtk\",\n\t\"mup\",\n\t\"mus\",\n\t\"mxe\",\n\t\"nan\",\n\t\"nrt\",\n\t\"onp\",\n\t\"opn\",\n\t\"org\",\n\t\"orm\",\n\t\"osp\",\n\t\"oth\",\n\t\"own\",\n\t\"pad\",\n\t\"pan\",\n\t\"pat\",\n\t\"pbd\",\n\t\"pbl\",\n\t\"pdr\",\n\t\"pfr\",\n\t\"pht\",\n\t\"plt\",\n\t\"pma\",\n\t\"pmn\",\n\t\"pnc\",\n\t\"pop\",\n\t\"ppm\",\n\t\"ppt\",\n\t\"pra\",\n\t\"prc\",\n\t\"prd\",\n\t\"pre\",\n\t\"prf\",\n\t\"prg\",\n\t\"prm\",\n\t\"prn\",\n\t\"pro\",\n\t\"prp\",\n\t\"prs\",\n\t\"prt\",\n\t\"prv\",\n\t\"pta\",\n\t\"pte\",\n\t\"ptf\",\n\t\"pth\",\n\t\"ptt\",\n\t\"pup\",\n\t\"rap\",\n\t\"rbr\",\n\t\"rcd\",\n\t\"rce\",\n\t\"rcp\",\n\t\"rdd\",\n\t\"red\",\n\t\"ren\",\n\t\"res\",\n\t\"rev\",\n\t\"rpc\",\n\t\"rps\",\n\t\"rpt\",\n\t\"rpy\",\n\t\"rse\",\n\t\"rsg\",\n\t\"rsp\",\n\t\"rsr\",\n\t\"rst\",\n\t\"rth\",\n\t\"rtm\",\n\t\"rxa\",\n\t\"sad\",\n\t\"sce\",\n\t\"scl\",\n\t\"scr\",\n\t\"sde\",\n\t\"sds\",\n\t\"sec\",\n\t\"sfx\",\n\t\"sgd\",\n\t\"sgn\",\n\t\"sht\",\n\t\"sll\",\n\t\"sng\",\n\t\"spk\",\n\t\"spn\",\n\t\"spy\",\n\t\"srv\",\n\t\"std\",\n\t\"stg\",\n\t\"stl\",\n\t\"stm\",\n\t\"stn\",\n\t\"str\",\n\t\"swd\",\n\t\"tad\",\n\t\"tau\",\n\t\"tcd\",\n\t\"tch\",\n\t\"ths\",\n\t\"tld\",\n\t\"tlg\",\n\t\"tlh\",\n\t\"tlp\",\n\t\"trc\",\n\t\"trl\",\n\t\"tyd\",\n\t\"tyg\",\n\t\"uvp\",\n\t\"vac\",\n\t\"vdg\",\n\t\"vfx\",\n\t\"voc\",\n\t\"wac\",\n\t\"wal\",\n\t\"wam\",\n\t\"wat\",\n\t\"waw\",\n\t\"wdc\",\n\t\"wde\",\n\t\"wfs\",\n\t\"wft\",\n\t\"wfw\",\n\t\"win\",\n\t\"wit\",\n\t\"wpr\",\n\t\"wst\",\n\t\"wts\",\n] as const satisfies string[];\n",
|
|
11
|
+
"import relators from \"@/constants/loc/relators\";\nimport z from \"zod\";\n\nexport const Relator = z.enum(relators);\nexport type Relator = z.infer<typeof Relator>;\n",
|
|
12
|
+
"import { Mime } from \"mime/lite\";\nimport otherTypes from \"mime/types/other.js\";\nimport standardTypes from \"mime/types/standard.js\";\n\nexport const mime = new Mime().define({\n\t...standardTypes,\n\t...otherTypes,\n});\n",
|
|
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
|
+
"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
|
+
"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 { mandatoryArray } from \"@/utils/array\";\nimport z from \"zod\";\nimport { PartialDateTime } from \"./string\";\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",
|
|
17
|
+
"import 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\";\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"
|
|
18
|
+
],
|
|
19
|
+
"mappings": "AAAA,mBAGO,IAAM,EAAqB,EAAE,OAAO,EAAE,MAAM,WAAY,2BAA2B,EAI7E,EAA4B,EACvC,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,KACD,ECjTA,mBAEO,IAAM,EAAU,EAAE,KAAK,CAAQ,ECHtC,eAAS,kBACT,mCAC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,OAC3D,EAAiB,EAA6B,UAAU,EAAI,EAAE,GAAG,MAAQ,OACzE,EAAY,EAAwB,UAAU,EAAI,EAAE,GAAG,MAAQ,OAE/D,EAAO,0BAEb,GAAI,OAAO,IAAY,SACtB,OAAO,IAAI,IAAI,UAAU,EAAQ,UAAU,CAAC,IAHhC,yBAGyC,EAC/C,QAAI,OAAO,IAAmB,SAAU,CAC9C,IAAM,EAAI,EAAe,MAAM,GAAG,EAClC,OAAO,IAAI,IAAI,UAAU,EAAE,MAAM,EAAE,KANvB,yBAMiC,EACvC,QAAI,OAAO,IAAc,SAC/B,OAAO,IAAI,IAAI,YAAY,EAAU,UAAU,CAAC,IARpC,yBAQ6C,EAI3D",
|
|
20
|
+
"debugId": "9A451E850986AEC764756E2164756E21",
|
|
21
|
+
"names": []
|
|
22
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webnovel-proxy/schemas",
|
|
3
|
+
"main": "dist/index.js",
|
|
4
|
+
"exports": {
|
|
5
|
+
".": "./dist/index.js"
|
|
6
|
+
},
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"version": "0.1.1",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"format": "prettier --write --cache .",
|
|
14
|
+
"lint": "prettier --check . && eslint --cache .",
|
|
15
|
+
"build": "bun run ./build.ts"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@eslint/compat": "^2.0.0",
|
|
19
|
+
"@eslint/js": "^9.39.2",
|
|
20
|
+
"@types/bun": "latest",
|
|
21
|
+
"@types/language-tags": "^1.0.4",
|
|
22
|
+
"bun-plugin-dts": "^0.3.0",
|
|
23
|
+
"eslint": "^9.39.2",
|
|
24
|
+
"eslint-config-prettier": "^10.1.8",
|
|
25
|
+
"globals": "^17.0.0",
|
|
26
|
+
"prettier": "^3.7.4",
|
|
27
|
+
"prettier-plugin-eslint": "^1.0.2",
|
|
28
|
+
"rimraf": "^6.1.2",
|
|
29
|
+
"typescript-eslint": "^8.52.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"typescript": "^5"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"language-tags": "^2.1.0",
|
|
39
|
+
"mime": "^4.1.0",
|
|
40
|
+
"temporal-polyfill": "^0.3.2",
|
|
41
|
+
"zod": "^4.3.6"
|
|
42
|
+
}
|
|
43
|
+
}
|