@archivist-gg/dnd5e 0.3.26 → 0.3.28
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/LICENSES/SRD.md +6 -13
- package/README.md +1 -1
- package/dist/background/background.codec.js +1 -1
- package/dist/background/background.parser.js +1 -1
- package/dist/background/background.schema.js +1 -1
- package/dist/chunk-2GZM7FCD.js +1 -0
- package/dist/{chunk-KEXSF3CH.js → chunk-2OVDSMPY.js} +1 -1
- package/dist/chunk-4AJYEWFQ.js +1 -0
- package/dist/chunk-4FTTUZXM.js +1 -0
- package/dist/{chunk-CCAVZANF.js → chunk-53SHSS4M.js} +1 -1
- package/dist/{chunk-HX7WBOKR.js → chunk-5QDSAZG6.js} +1 -1
- package/dist/chunk-6IPWTOLU.js +1 -0
- package/dist/{chunk-XPF53K54.js → chunk-7HOOPNF5.js} +1 -1
- package/dist/{chunk-DTB7YBMZ.js → chunk-ADX7435T.js} +1 -1
- package/dist/{chunk-GIQLIBC7.js → chunk-AFEWQFQZ.js} +1 -1
- package/dist/{chunk-EPA24PVZ.js → chunk-C4T6BUSP.js} +1 -1
- package/dist/chunk-CLZRWPWT.js +1 -0
- package/dist/{chunk-E7KFJLDR.js → chunk-CYYVM6H3.js} +1 -1
- package/dist/{chunk-4SYAKWY4.js → chunk-D2BXAFOL.js} +1 -1
- package/dist/{chunk-PKIMOVQG.js → chunk-E4E6YEN6.js} +1 -1
- package/dist/{chunk-OTRH62HY.js → chunk-EBFLUJIW.js} +1 -1
- package/dist/{chunk-ZVL5FXXO.js → chunk-EON7T2SN.js} +1 -1
- package/dist/{chunk-NU2Z7MTS.js → chunk-GKNOCYDT.js} +1 -1
- package/dist/{chunk-VVJXZZ4Z.js → chunk-IR5BA2DZ.js} +1 -1
- package/dist/{chunk-WAUNLUFQ.js → chunk-J27N3KUE.js} +1 -1
- package/dist/{chunk-ETDMOGFO.js → chunk-J6FIBUI4.js} +1 -1
- package/dist/{chunk-CNMHADNV.js → chunk-KGZXAAFN.js} +1 -1
- package/dist/chunk-KZFTTAFN.js +1 -0
- package/dist/chunk-M2UA2FAK.js +1 -0
- package/dist/{chunk-J3RP5C7L.js → chunk-MMDUUEFA.js} +1 -1
- package/dist/{chunk-RHIEOYDX.js → chunk-NB4QWMF5.js} +1 -1
- package/dist/{chunk-ONCXJMJM.js → chunk-NU6WP4P5.js} +1 -1
- package/dist/{chunk-SFK57JAA.js → chunk-OV4FG4KO.js} +1 -1
- package/dist/{chunk-GGQDQSIF.js → chunk-R2YRQM7G.js} +1 -1
- package/dist/{chunk-CEHL7PPC.js → chunk-RR26E7LH.js} +1 -1
- package/dist/{chunk-NYPH7RQN.js → chunk-U7BPRRY5.js} +1 -1
- package/dist/{chunk-LHH5XSEA.js → chunk-VHIE2KYQ.js} +1 -1
- package/dist/{chunk-ZS5BMNXC.js → chunk-VY5ZEOLG.js} +1 -1
- package/dist/{chunk-NYTR6NJS.js → chunk-WXL7ABDO.js} +1 -1
- package/dist/{chunk-6R46KYGU.js → chunk-XCF5R5XX.js} +1 -1
- package/dist/{chunk-L2DXF7YS.js → chunk-XFFFTR6O.js} +1 -1
- package/dist/class/class.codec.js +1 -1
- package/dist/class/class.parser.js +1 -1
- package/dist/class/class.schema.js +1 -1
- package/dist/feat/feat.codec.js +1 -1
- package/dist/feat/feat.parser.js +1 -1
- package/dist/feat/feat.schema.d.ts +31 -0
- package/dist/feat/feat.schema.js +1 -1
- package/dist/index.js +8 -8
- package/dist/item/item.icon.js +1 -1
- package/dist/monster/monster.parser.js +1 -1
- package/dist/monster/monster.schema.js +1 -1
- package/dist/optional-feature/optional-feature.codec.js +1 -1
- package/dist/optional-feature/optional-feature.parser.js +1 -1
- package/dist/optional-feature/optional-feature.schema.d.ts +31 -0
- package/dist/optional-feature/optional-feature.schema.js +1 -1
- package/dist/pc/pc.additional-spells.js +1 -1
- package/dist/pc/pc.amount-bindings.js +1 -1
- package/dist/pc/pc.decision-engine.d.ts +2 -0
- package/dist/pc/pc.decision-engine.js +1 -1
- package/dist/pc/pc.entry-overrides.js +1 -1
- package/dist/pc/pc.equipment.d.ts +5 -1
- package/dist/pc/pc.equipment.js +1 -1
- package/dist/pc/pc.feature-effects.d.ts +9 -1
- package/dist/pc/pc.feature-effects.js +1 -1
- package/dist/pc/pc.infusions.js +1 -1
- package/dist/pc/pc.item-effects.js +1 -1
- package/dist/pc/pc.member-choices.js +1 -1
- package/dist/pc/pc.parser.js +1 -1
- package/dist/pc/pc.pools.js +1 -1
- package/dist/pc/pc.proficiencies.js +1 -1
- package/dist/pc/pc.proficiency-replacements.d.ts +22 -0
- package/dist/pc/pc.proficiency-replacements.js +1 -0
- package/dist/pc/pc.recalc.d.ts +3 -1
- package/dist/pc/pc.recalc.js +1 -1
- package/dist/pc/pc.resolver.js +1 -1
- package/dist/pc/pc.resource-seed.js +1 -1
- package/dist/pc/pc.resources.js +1 -1
- package/dist/pc/pc.rest.js +1 -1
- package/dist/pc/pc.schema.d.ts +8 -0
- package/dist/pc/pc.schema.js +1 -1
- package/dist/pc/pc.species-increases.d.ts +12 -0
- package/dist/pc/pc.species-increases.js +1 -0
- package/dist/pc/pc.types.d.ts +46 -0
- package/dist/race/race.codec.js +1 -1
- package/dist/race/race.parser.js +1 -1
- package/dist/race/race.schema.js +1 -1
- package/dist/race/race.subspecies.d.ts +12 -0
- package/dist/race/race.subspecies.js +1 -0
- package/dist/schemas/attack-schema.d.ts +1 -0
- package/dist/schemas/choice-schema.js +1 -1
- package/dist/schemas/feature-effect-schema.d.ts +31 -0
- package/dist/schemas/feature-effect-schema.js +1 -1
- package/dist/schemas/feature-schema.js +1 -1
- package/dist/subclass/subclass.codec.js +1 -1
- package/dist/subclass/subclass.parser.js +1 -1
- package/dist/subclass/subclass.schema.js +1 -1
- package/dist/types/attack.d.ts +1 -0
- package/dist/types/feature-effect.d.ts +8 -0
- package/package.json +1 -1
- package/dist/chunk-E3MS4M3N.js +0 -1
- package/dist/chunk-GD7WRCNH.js +0 -1
- package/dist/chunk-J5GL6FLP.js +0 -1
- package/dist/chunk-NIWLD33X.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{featureEffectSchema}from"./chunk-
|
|
1
|
+
import{featureEffectSchema}from"./chunk-EON7T2SN.js";import{z}from"zod";var abilityEnum=z.enum(["str","dex","con","int","wis","cha"]);var entityFilterSchema=z.object({feature_type:z.string().min(1).optional(),category:z.string().min(1).optional(),parent_class:z.literal("self").optional(),available_to:z.literal("self").optional(),weapon_category:z.enum(["simple","martial"]).optional(),armor_category:z.enum(["light","medium","heavy","shield"]).optional(),item_type:z.array(z.string().min(1)).nonempty().optional(),mundane:z.boolean().optional(),list:z.string().min(1).optional(),level:z.number().int().min(0).max(9).optional(),edition:z.string().min(1).optional(),ritual:z.boolean().optional(),inventory:z.boolean().optional()}).strict();var inlineOptionSchema=z.lazy(()=>z.object({value:z.string().min(1),label:z.string().min(1),description:z.string().optional(),effects:z.array(featureEffectSchema).optional(),choices:z.array(choiceSchema).optional()}).strict());var choiceSchema=z.lazy(()=>z.discriminatedUnion("kind",[z.object({kind:z.literal("select-inline"),id:z.string().min(1),label:z.string().optional(),count:z.number().int().positive().optional(),options:z.array(inlineOptionSchema).nonempty()}).strict(),z.object({kind:z.literal("select-entity"),id:z.string().min(1),label:z.string().optional(),count:z.number().int().positive().optional(),entity_type:z.string().min(1),from:z.array(z.string().min(1)).nonempty().optional(),where:entityFilterSchema.optional(),target:z.literal(true).optional()}).strict(),z.object({kind:z.literal("select-proficiency"),id:z.string().min(1),label:z.string().optional(),count:z.number().int().positive(),domain:z.enum(["skill","tool","language","save"]),from:z.array(z.string().min(1)).nonempty().optional(),from_proficient:z.boolean().optional(),expertise:z.boolean().optional()}).strict(),z.object({kind:z.literal("ability-points"),id:z.string().min(1),label:z.string().optional(),points:z.number().int().positive(),max_per:z.number().int().positive(),pool:z.array(abilityEnum).nonempty().optional()}).strict()]));export{choiceSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MONSTER_KNOWN_KEYS,monsterSchema}from"./chunk-
|
|
1
|
+
import{MONSTER_KNOWN_KEYS,monsterSchema}from"./chunk-5QDSAZG6.js";import{parseYaml}from"@archivist-gg/core";var VALID_RECHARGE_TYPES=new Set(["recharge_on_roll","per_day","per_short_rest","per_long_rest"]);var NUMERIC_STRING=/^[+-]?\d+(\.\d+)?$/;var FEATURE_ARRAYS=["traits","actions","reactions","legendary_actions","bonus_actions","mythic"];var SPEED_MODES=["walk","fly","swim","climb","burrow"];var ABILITY_KEYS=["str","dex","con","int","wis","cha"];var NULL_KEPT=new Set(["senses","languages","group"]);function isRecord(v){return typeof v==="object"&&v!==null&&!Array.isArray(v)}function coerceNumeric(obj,key){const v=obj[key];if(typeof v==="string"&&NUMERIC_STRING.test(v.trim()))obj[key]=Number(v)}function scrubNulls(v,top){if(Array.isArray(v)){for(let i=v.length-1;i>=0;i--){if(v[i]===null)v.splice(i,1);else scrubNulls(v[i],false)}return}if(!isRecord(v))return;for(const[k,x]of Object.entries(v)){if(x===null){if(!(top&&NULL_KEPT.has(k)))delete v[k]}else scrubNulls(x,false)}}function scrubNonFinite(v){if(Array.isArray(v)){for(const x of v)scrubNonFinite(x);return}if(!isRecord(v))return;for(const[k,x]of Object.entries(v)){if(typeof x==="number"&&!Number.isFinite(x))delete v[k];else scrubNonFinite(x)}}function migrateLegacy(raw){scrubNulls(raw,true);if(raw.legendary_actions!=null&&!Array.isArray(raw.legendary_actions)&&typeof raw.legendary_actions!=="object"){if(raw.legendary_action_uses==null)raw.legendary_action_uses=Number(raw.legendary_actions);delete raw.legendary_actions}if(!Array.isArray(raw.legendary_actions)&&Array.isArray(raw.legendary))raw.legendary_actions=raw.legendary;delete raw.legendary;if(typeof raw.ac==="number")raw.ac=[{ac:raw.ac}];if(Array.isArray(raw.ac))raw.ac=raw.ac.map(e=>typeof e==="number"?{ac:e}:e);if(typeof raw.hp==="number")raw.hp={average:raw.hp};if(typeof raw.cr==="number")raw.cr=String(raw.cr);for(const k of["passive_perception","legendary_action_uses","legendary_resistance","columns","initiative"])coerceNumeric(raw,k);if(isRecord(raw.initiative))coerceNumeric(raw.initiative,"proficiency");for(const k of["saves","skills"]){const o=raw[k];if(isRecord(o))for(const m of Object.keys(o))coerceNumeric(o,m)}if(isRecord(raw.hp))coerceNumeric(raw.hp,"average");if(Array.isArray(raw.ac)){for(const e of raw.ac)if(isRecord(e))coerceNumeric(e,"ac")}if(isRecord(raw.abilities))for(const k of ABILITY_KEYS)coerceNumeric(raw.abilities,k);if(isRecord(raw.speed))for(const k of SPEED_MODES){coerceNumeric(raw.speed,k);const v=raw.speed[k];if(isRecord(v))coerceNumeric(v,"number")}scrubNonFinite(raw);if(isRecord(raw.abilities)){for(const k of ABILITY_KEYS)if(raw.abilities[k]==null)raw.abilities[k]=10}if(typeof raw.senses==="string")raw.senses=[raw.senses];if(typeof raw.languages==="string")raw.languages=[raw.languages];for(const k of FEATURE_ARRAYS){const arr=raw[k];if(!Array.isArray(arr))continue;for(const f of arr){if(!isRecord(f))continue;if(typeof f.desc==="string"&&f.description===void 0&&!Array.isArray(f.entries)){f.description=f.desc;delete f.desc}const r=f.recharge;if(r!==void 0&&!(isRecord(r)&&typeof r.param==="number"&&VALID_RECHARGE_TYPES.has(r.type)))delete f.recharge}}}function parseMonster(source){var _a,_b;const result=parseYaml(source,["name"]);if(!result.success)return result;const raw=result.data;migrateLegacy(raw);const parsed=monsterSchema.safeParse(raw);if(!parsed.success){return{success:false,error:`monster schema validation failed: ${parsed.error.message}`}}const monster=parsed.data;const extras={};for(const[k,v]of Object.entries(raw))if(!MONSTER_KNOWN_KEYS.has(k))extras[k]=v;if(Object.keys(extras).length>0)monster.raw={...(_a=monster.raw)!=null?_a:{},...extras};if(!monster.legendary_resistance&&monster.traits){const lrIndex=monster.traits.findIndex(t=>{var _a2;return/^Legendary Resistance\s*\(/i.test((_a2=t.name)!=null?_a2:"")});if(lrIndex!==-1){const match=(_b=monster.traits[lrIndex].name)==null?void 0:_b.match(/\((\d+)\/Day\)/i);if(match){monster.legendary_resistance=parseInt(match[1],10);monster.traits.splice(lrIndex,1)}}}return{success:true,data:monster}}export{migrateLegacy,parseMonster};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseBackground}from"./chunk-
|
|
1
|
+
import{parseBackground}from"./chunk-IR5BA2DZ.js";import yaml from"js-yaml";var backgroundCodec={parse(doc){return parseBackground(doc.body)},serialize(entity){return yaml.dump(entity,{lineWidth:-1,sortKeys:false})}};export{backgroundCodec};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseRace}from"./chunk-
|
|
1
|
+
import{parseRace}from"./chunk-KGZXAAFN.js";import yaml from"js-yaml";var raceCodec={parse(doc){return parseRace(doc.body)},serialize(entity){return yaml.dump(entity,{lineWidth:-1,sortKeys:false})}};export{raceCodec};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{startingEquipmentEntrySchema}from"./chunk-TKIEPC6F.js";import{choiceSchema}from"./chunk-
|
|
1
|
+
import{startingEquipmentEntrySchema}from"./chunk-TKIEPC6F.js";import{choiceSchema}from"./chunk-VHIE2KYQ.js";import{additionalSpellsEntrySchema,imageField}from"./chunk-I26FHSI6.js";import{z}from"zod";var abilityEnum=z.enum(["str","dex","con","int","wis","cha"]);var editionEnum=z.enum(["2014","2024"]);var skillEnum=z.enum(["acrobatics","animal-handling","arcana","athletics","deception","history","insight","intimidation","investigation","medicine","nature","perception","performance","persuasion","religion","sleight-of-hand","stealth","survival"]);var wikilinkRegex=/^\[\[[^[\]]+\]\]$/;var toolProfSchema=z.discriminatedUnion("kind",[z.object({kind:z.literal("fixed"),items:z.array(z.string()).nonempty()}),z.object({kind:z.literal("choice"),count:z.number().int().positive(),from:z.array(z.string()).nonempty()})]);var langProfSchema=z.discriminatedUnion("kind",[z.object({kind:z.literal("fixed"),languages:z.array(z.string()).nonempty()}),z.object({kind:z.literal("choice"),count:z.number().int().positive(),from:z.union([z.string(),z.array(z.string())])})]);var suggestedCharSchema=z.object({personality_traits:z.record(z.string(),z.string()).optional(),ideals:z.record(z.string(),z.object({name:z.string().optional(),desc:z.string(),alignment:z.string().optional()})).optional(),bonds:z.record(z.string(),z.string()).optional(),flaws:z.record(z.string(),z.string()).optional()});var backgroundEntitySchema=z.object({slug:z.string().min(1),name:z.string().min(1),edition:editionEnum,source:z.string().min(1),description:z.string(),skill_proficiencies:z.array(skillEnum),tool_proficiencies:z.array(toolProfSchema),language_proficiencies:z.array(langProfSchema),equipment:z.array(startingEquipmentEntrySchema),feature:z.object({name:z.string().min(1),description:z.string().min(1)}),ability_score_increases:z.object({pool:z.array(abilityEnum).length(3)}).nullable(),origin_feat:z.string().regex(wikilinkRegex).nullable(),suggested_characteristics:suggestedCharSchema.nullable(),choices:z.array(choiceSchema).optional(),rendering_hint:z.string().optional(),has_fluff_images:z.boolean().optional(),tables:z.array(z.object({name:z.string().min(1),dice:z.string().min(1),rows:z.array(z.object({roll:z.string(),text:z.string()}))})).optional(),additional_spells:z.array(additionalSpellsEntrySchema).optional(),prerequisites:z.array(z.object({kind:z.literal("campaign"),slug:z.string().min(1)})).optional(),image:imageField});export{langProfSchema,backgroundEntitySchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{classCodec}from"../chunk-
|
|
1
|
+
import{classCodec}from"../chunk-C4T6BUSP.js";import"../chunk-7HOOPNF5.js";import"../chunk-S5UCI27C.js";import"../chunk-ADX7435T.js";import"../chunk-GCYUCIDN.js";import"../chunk-X22SISGM.js";import"../chunk-M2UA2FAK.js";import"../chunk-ZE46ADXS.js";import"../chunk-CCFIINBA.js";import"../chunk-TKIEPC6F.js";import"../chunk-VHIE2KYQ.js";import"../chunk-EON7T2SN.js";import"../chunk-I26FHSI6.js";export{classCodec};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseClass}from"../chunk-
|
|
1
|
+
import{parseClass}from"../chunk-7HOOPNF5.js";import"../chunk-S5UCI27C.js";import"../chunk-ADX7435T.js";import"../chunk-GCYUCIDN.js";import"../chunk-X22SISGM.js";import"../chunk-M2UA2FAK.js";import"../chunk-ZE46ADXS.js";import"../chunk-CCFIINBA.js";import"../chunk-TKIEPC6F.js";import"../chunk-VHIE2KYQ.js";import"../chunk-EON7T2SN.js";import"../chunk-I26FHSI6.js";export{parseClass};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{classEntitySchema}from"../chunk-
|
|
1
|
+
import{classEntitySchema}from"../chunk-ADX7435T.js";import"../chunk-GCYUCIDN.js";import"../chunk-X22SISGM.js";import"../chunk-M2UA2FAK.js";import"../chunk-ZE46ADXS.js";import"../chunk-CCFIINBA.js";import"../chunk-TKIEPC6F.js";import"../chunk-VHIE2KYQ.js";import"../chunk-EON7T2SN.js";import"../chunk-I26FHSI6.js";export{classEntitySchema};
|
package/dist/feat/feat.codec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{featCodec}from"../chunk-
|
|
1
|
+
import{featCodec}from"../chunk-GKNOCYDT.js";import"../chunk-EBFLUJIW.js";import"../chunk-AFEWQFQZ.js";import"../chunk-CCFIINBA.js";import"../chunk-VHIE2KYQ.js";import"../chunk-EON7T2SN.js";import"../chunk-I26FHSI6.js";export{featCodec};
|
package/dist/feat/feat.parser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseFeat}from"../chunk-
|
|
1
|
+
import{parseFeat}from"../chunk-EBFLUJIW.js";import"../chunk-AFEWQFQZ.js";import"../chunk-CCFIINBA.js";import"../chunk-VHIE2KYQ.js";import"../chunk-EON7T2SN.js";import"../chunk-I26FHSI6.js";export{parseFeat};
|
|
@@ -374,6 +374,37 @@ export declare const featEntitySchema: z.ZodObject<{
|
|
|
374
374
|
}>;
|
|
375
375
|
condition: z.ZodOptional<z.ZodString>;
|
|
376
376
|
subject: z.ZodOptional<z.ZodString>;
|
|
377
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
378
|
+
kind: z.ZodLiteral<"damage-roll-option">;
|
|
379
|
+
mode: z.ZodEnum<{
|
|
380
|
+
"reroll-weapon-dice-keep-higher": "reroll-weapon-dice-keep-higher";
|
|
381
|
+
"min-die-face": "min-die-face";
|
|
382
|
+
"reroll-below": "reroll-below";
|
|
383
|
+
}>;
|
|
384
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
385
|
+
applies_to: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
386
|
+
weapon: "weapon";
|
|
387
|
+
melee: "melee";
|
|
388
|
+
ranged: "ranged";
|
|
389
|
+
unarmed: "unarmed";
|
|
390
|
+
finesse: "finesse";
|
|
391
|
+
thrown: "thrown";
|
|
392
|
+
heavy: "heavy";
|
|
393
|
+
"pact-weapon": "pact-weapon";
|
|
394
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
395
|
+
weapon: "weapon";
|
|
396
|
+
melee: "melee";
|
|
397
|
+
ranged: "ranged";
|
|
398
|
+
unarmed: "unarmed";
|
|
399
|
+
finesse: "finesse";
|
|
400
|
+
thrown: "thrown";
|
|
401
|
+
heavy: "heavy";
|
|
402
|
+
"pact-weapon": "pact-weapon";
|
|
403
|
+
}>>]>>;
|
|
404
|
+
two_handed: z.ZodOptional<z.ZodBoolean>;
|
|
405
|
+
once_per_turn: z.ZodOptional<z.ZodBoolean>;
|
|
406
|
+
condition: z.ZodOptional<z.ZodString>;
|
|
407
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
377
408
|
}, z.core.$strip>, z.ZodObject<{
|
|
378
409
|
kind: z.ZodLiteral<"immunity">;
|
|
379
410
|
damage_type: z.ZodString;
|
package/dist/feat/feat.schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{featEntitySchema}from"../chunk-
|
|
1
|
+
import{featEntitySchema}from"../chunk-AFEWQFQZ.js";import"../chunk-CCFIINBA.js";import"../chunk-VHIE2KYQ.js";import"../chunk-EON7T2SN.js";import"../chunk-I26FHSI6.js";export{featEntitySchema};
|