arkham-investigator-data 2.8.0 → 2.9.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.
Files changed (50) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/biome.json +30 -0
  3. package/build/src/api/arkhamCards/config/chaosBag.d.ts +2 -0
  4. package/build/src/api/arkhamCards/config/index.d.ts +1 -0
  5. package/build/src/api/arkhamCards/model/chaosOdd.d.ts +32 -0
  6. package/build/src/api/arkhamCards/model/index.d.ts +1 -0
  7. package/build/src/api/arkhamCards/request/graphql/index.d.ts +4 -0
  8. package/build/src/api/arkhamCards/request/{loadArkhamCardsCycles.d.ts → graphql/loadArkhamCardsCycles.d.ts} +1 -1
  9. package/build/src/api/arkhamCards/request/{loadArkhamCardsInvestigators.d.ts → graphql/loadArkhamCardsInvestigators.d.ts} +5 -5
  10. package/build/src/api/arkhamCards/request/{loadArkhamCardsPacks.d.ts → graphql/loadArkhamCardsPacks.d.ts} +1 -1
  11. package/build/src/api/arkhamCards/request/{loadArkhamCardsReferenceCards.d.ts → graphql/loadArkhamCardsReferenceCards.d.ts} +1 -1
  12. package/build/src/api/arkhamCards/request/index.d.ts +2 -6
  13. package/build/src/api/arkhamCards/request/raw/index.d.ts +2 -0
  14. package/build/src/api/arkhamCards/request/{loadArkhamCardsCampaigns.d.ts → raw/loadArkhamCardsCampaigns.d.ts} +1 -1
  15. package/build/src/api/arkhamCards/request/raw/loadArkhamCardsChaosOdds.d.ts +2 -0
  16. package/build/src/api/arkhamCards/request/{loadArkhamCardsRules.d.ts → raw/loadArkhamCardsRules.d.ts} +1 -1
  17. package/build/src/components/chaos-bag/getChaosBagTokenReference.d.ts +2 -0
  18. package/build/src/components/chaos-bag/index.d.ts +1 -0
  19. package/build/src/components/meta/arkhamCards.d.ts +2 -1
  20. package/build/src/components/stories/index.d.ts +1 -0
  21. package/build/src/components/stories/reference/getChaosBagTokenReferenceValues.d.ts +3 -0
  22. package/build/src/components/stories/reference/getReferenceCardChaosTokens.d.ts +5 -0
  23. package/build/src/components/stories/reference/getReferenceCardDifficulty.d.ts +1 -0
  24. package/build/src/components/stories/{getReferenceCards.d.ts → reference/getReferenceCards.d.ts} +1 -1
  25. package/build/src/components/stories/reference/index.d.ts +2 -0
  26. package/build/src/components/stories/reference/parseChaosOdds.d.ts +3 -0
  27. package/build/src/config/chaosBag.d.ts +2 -0
  28. package/build/src/config/index.d.ts +1 -0
  29. package/build/src/data/chaos-bag/scenarios/campaigns/core.d.ts +0 -0
  30. package/build/src/data/chaos-bag/scenarios/campaigns/dwl.d.ts +0 -0
  31. package/build/src/data/chaos-bag/scenarios/campaigns/eoe.d.ts +0 -0
  32. package/build/src/data/chaos-bag/scenarios/campaigns/fhv.d.ts +0 -0
  33. package/build/src/data/chaos-bag/scenarios/campaigns/index.d.ts +0 -0
  34. package/build/src/data/chaos-bag/scenarios/campaigns/ptc.d.ts +0 -0
  35. package/build/src/data/chaos-bag/scenarios/campaigns/tcu.d.ts +0 -0
  36. package/build/src/data/chaos-bag/scenarios/campaigns/tdc.d.ts +0 -0
  37. package/build/src/data/chaos-bag/scenarios/campaigns/tde.d.ts +0 -0
  38. package/build/src/data/chaos-bag/scenarios/campaigns/tfa.d.ts +0 -0
  39. package/build/src/data/chaos-bag/scenarios/campaigns/tic.d.ts +0 -0
  40. package/build/src/data/chaos-bag/scenarios/campaigns/tsk.d.ts +0 -0
  41. package/build/src/data/chaos-bag/scenarios/custom/index.d.ts +0 -0
  42. package/build/src/data/chaos-bag/scenarios/index.d.ts +0 -0
  43. package/build/src/features/util/index.d.ts +1 -0
  44. package/build/src/features/util/string.d.ts +1 -0
  45. package/build/src/model/game/chaosBag.d.ts +1 -1
  46. package/build/src/model/game/investigator/signature.d.ts +2 -0
  47. package/build/src/model/game/story/reference.d.ts +32 -0
  48. package/package.json +2 -2
  49. package/build/src/components/stories/getStoryReferences.d.ts +0 -1
  50. /package/build/src/{components/stories/getStoryEnglishReferences.d.ts → data/chaos-bag/index.d.ts} +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ "editor.formatOnSave": true
3
+ }
package/biome.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3
+ "vcs": {
4
+ "enabled": false,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": false
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false,
10
+ "ignore": ["dist/*.json"]
11
+ },
12
+ "formatter": {
13
+ "enabled": true,
14
+ "indentStyle": "tab"
15
+ },
16
+ "organizeImports": {
17
+ "enabled": true
18
+ },
19
+ "linter": {
20
+ "enabled": true,
21
+ "rules": {
22
+ "recommended": true
23
+ }
24
+ },
25
+ "javascript": {
26
+ "formatter": {
27
+ "quoteStyle": "double"
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,2 @@
1
+ import { ArkhamCardsChaosToken } from "../model";
2
+ export declare const arkhamCardsSymbolTokens: ArkhamCardsChaosToken[];
@@ -0,0 +1 @@
1
+ export * from "./chaosBag";
@@ -0,0 +1,32 @@
1
+ export type ArkhamCardsChaosOdd = {
2
+ code: string;
3
+ scenario: string;
4
+ standard: ArkhamCardsChaosOddToken[];
5
+ hard: ArkhamCardsChaosOddToken[];
6
+ };
7
+ export type ArkhamCardsChaosToken = "+1" | "0" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "bless" | "curse" | "elder_sign" | "skull" | "cultist" | "auto_fail" | "tablet" | "frost" | "elder_thing";
8
+ export type ArkhamCardsChaosOddToken = {
9
+ token: ArkhamCardsChaosToken;
10
+ } & ({
11
+ value: ArkhamCardsChaosOddTokenValue;
12
+ } | {
13
+ type: "counter";
14
+ counter: {
15
+ min?: number;
16
+ adjustment?: number;
17
+ max?: number;
18
+ };
19
+ } | {
20
+ type: "condition";
21
+ condition: {
22
+ default_value: ArkhamCardsChaosOddTokenValue;
23
+ options: ArkhamCardsChaosOddConditionOption[];
24
+ };
25
+ });
26
+ export type ArkhamCardsChaosOddTokenValue = {
27
+ modifier: ArkhamCardsChaosOddTokenValueType;
28
+ };
29
+ export type ArkhamCardsChaosOddTokenValueType = number | "auto_fail" | "auto_succeed";
30
+ export type ArkhamCardsChaosOddConditionOption = {
31
+ modified_value: ArkhamCardsChaosOddTokenValue;
32
+ };
@@ -3,3 +3,4 @@ export * from "./investigator";
3
3
  export * from "./reference";
4
4
  export * from "./rules";
5
5
  export * from "./campaign";
6
+ export * from "./chaosOdd";
@@ -0,0 +1,4 @@
1
+ export * from "./loadArkhamCardsInvestigators";
2
+ export * from "./loadArkhamCardsReferenceCards";
3
+ export * from "./loadArkhamCardsPacks";
4
+ export * from "./loadArkhamCardsCycles";
@@ -1,2 +1,2 @@
1
- import type { ArkhamCardsCycle } from "../model";
1
+ import type { ArkhamCardsCycle } from "../../model";
2
2
  export declare const loadArkhamCardsCycles: () => Promise<ArkhamCardsCycle[]>;
@@ -2,7 +2,7 @@ export declare const loadArkhamCardsInvestigators: () => Promise<{
2
2
  linked_code: string;
3
3
  id: string;
4
4
  alternate_of_code: string | null;
5
- gender: import("../model").ArkhamCardsInvestigatorGender;
5
+ gender: import("../../model").ArkhamCardsInvestigatorGender;
6
6
  code: string;
7
7
  real_text: string;
8
8
  real_name: string;
@@ -11,15 +11,15 @@ export declare const loadArkhamCardsInvestigators: () => Promise<{
11
11
  real_traits: string;
12
12
  real_taboo_original_text: string | null;
13
13
  real_taboo_text_change: string | null;
14
- faction_code: import("../../../model").InvestigatorFaction;
14
+ faction_code: import("../../../../model").InvestigatorFaction;
15
15
  sanity: number;
16
16
  health: number;
17
17
  skill_agility: number;
18
18
  skill_combat: number;
19
19
  skill_intellect: number;
20
20
  skill_willpower: number;
21
- translations: import("../model").ArkhamCardsInvestigatorTranslation[];
22
- taboo_set: import("../model").ArkhamCardsTabooSet | null;
23
- pack: import("../model").ArkhamCardsFullPack;
21
+ translations: import("../../model").ArkhamCardsInvestigatorTranslation[];
22
+ taboo_set: import("../../model").ArkhamCardsTabooSet | null;
23
+ pack: import("../../model").ArkhamCardsFullPack;
24
24
  spoiler: boolean;
25
25
  }[]>;
@@ -1,2 +1,2 @@
1
- import type { ArkhamCardsFullPack } from "../model";
1
+ import type { ArkhamCardsFullPack } from "../../model";
2
2
  export declare const loadArkhamCardsPacks: () => Promise<ArkhamCardsFullPack[]>;
@@ -1,2 +1,2 @@
1
- import type { ArkhamCardsReference } from "../model";
1
+ import type { ArkhamCardsReference } from "../../model";
2
2
  export declare const loadArkhamCardsReferenceCards: () => Promise<ArkhamCardsReference[]>;
@@ -1,6 +1,2 @@
1
- export * from "./loadArkhamCardsInvestigators";
2
- export * from "./loadArkhamCardsReferenceCards";
3
- export * from "./loadArkhamCardsPacks";
4
- export * from "./loadArkhamCardsCycles";
5
- export * from "./loadArkhamCardsRules";
6
- export * from "./loadArkhamCardsCampaigns";
1
+ export * from "./graphql";
2
+ export * from "./raw";
@@ -0,0 +1,2 @@
1
+ export * from "./loadArkhamCardsCampaigns";
2
+ export * from "./loadArkhamCardsRules";
@@ -1,2 +1,2 @@
1
- import type { ArkhamCardsCampaign } from "../model";
1
+ import type { ArkhamCardsCampaign } from "../../model";
2
2
  export declare const loadArkhamCardsCampaigns: () => Promise<ArkhamCardsCampaign[]>;
@@ -0,0 +1,2 @@
1
+ import type { ArkhamCardsChaosOdd } from "../../model";
2
+ export declare const loadArkhamCardsChaosOdds: () => Promise<ArkhamCardsChaosOdd[]>;
@@ -1,2 +1,2 @@
1
- import type { ArkhamCardsRulesItem } from "../model";
1
+ import type { ArkhamCardsRulesItem } from "../../model";
2
2
  export declare const loadArkhamCardsRules: (language?: string) => Promise<ArkhamCardsRulesItem[]>;
@@ -0,0 +1,2 @@
1
+ import { ReferencePart } from "../../model";
2
+ export declare const getChaosBagTokenReference: (sources: string[]) => NonNullable<ReferencePart>[];
@@ -0,0 +1 @@
1
+ export * from "./getChaosBagTokenReference";
@@ -1,5 +1,6 @@
1
- import type { ArkhamCardsCampaign, ArkhamCardsCycle, ArkhamCardsPack, ArkhamCardsReference } from "../../api/arkhamCards";
1
+ import type { ArkhamCardsCampaign, ArkhamCardsChaosOdd, ArkhamCardsCycle, ArkhamCardsPack, ArkhamCardsReference } from "../../api/arkhamCards";
2
2
  export declare const getArkhamCardsCycles: () => ArkhamCardsCycle[];
3
3
  export declare const getArkhamCardsPacks: () => ArkhamCardsPack[];
4
4
  export declare const getArkhamCardsReferenceCards: () => ArkhamCardsReference[];
5
5
  export declare const getArkhamCardsCampaigns: () => ArkhamCardsCampaign[];
6
+ export declare const getArkhamCardsOdds: () => ArkhamCardsChaosOdd[];
@@ -1 +1,2 @@
1
1
  export * from "./getStories";
2
+ export * from "./reference";
@@ -0,0 +1,3 @@
1
+ import { ReferenceCardToken } from "../../../model";
2
+ export declare const getChaosBagTokenReferenceValues: (text: string) => ReferenceCardToken[];
3
+ export declare const parseEffectValue: (text: string) => number;
@@ -0,0 +1,5 @@
1
+ import type { ArkhamCardsReference } from "../../../api/arkhamCards";
2
+ export declare const getReferenceCardChaosTokens: ({ code, encounter_code, real_text, real_back_text, }: ArkhamCardsReference) => {
3
+ tokens: import("../../../model").ReferenceCardToken[];
4
+ back_tokens: import("../../../model").ReferenceCardToken[];
5
+ };
@@ -0,0 +1 @@
1
+ export declare const getReferenceCardDifficulty: (text: string) => string;
@@ -1,4 +1,4 @@
1
- import type { ReferenceCard } from "../../model";
1
+ import type { ReferenceCard } from "../../../model";
2
2
  import type { ArkhamDivider } from "arkham-divider-data";
3
3
  type Story = ArkhamDivider.Core["stories"][number];
4
4
  export declare const getReferenceCards: (story: Story) => ReferenceCard[];
@@ -0,0 +1,2 @@
1
+ export * from "./getReferenceCardChaosTokens";
2
+ export * from "./getReferenceCards";
@@ -0,0 +1,3 @@
1
+ import type { ArkhamCardsChaosOddToken } from "../../../api/arkhamCards";
2
+ import type { ReferenceCardToken } from "../../../model";
3
+ export declare const parseChaosOdds: (tokens?: ArkhamCardsChaosOddToken[]) => NonNullable<ReferenceCardToken>[];
@@ -0,0 +1,2 @@
1
+ import { ChaosBagToken } from "../model/game/chaosBag";
2
+ export declare const chaosBagSymbolTokens: ChaosBagToken[];
@@ -1,3 +1,4 @@
1
1
  export * from "./app";
2
2
  export * from "./googleDrive";
3
3
  export * from "./api";
4
+ export * from "./chaosBag";
File without changes
@@ -1,2 +1,3 @@
1
1
  export * from "./fs";
2
2
  export * from "./promise";
3
+ export * from "./string";
@@ -0,0 +1 @@
1
+ export declare const underscore2CamelCase: (str: string) => string;
@@ -1 +1 @@
1
- export type ChaosBagToken = "bless" | "curse" | "elderSign" | "skull" | "cultist" | "autoFail" | "tablet" | "frost" | "elderThing";
1
+ export type ChaosBagToken = "+1" | "0" | "-1" | "-2" | "-3" | "-4" | "-5" | "-6" | "-7" | "-8" | "bless" | "curse" | "elderSign" | "skull" | "cultist" | "autoFail" | "tablet" | "frost" | "elderThing";
@@ -1,6 +1,7 @@
1
1
  import type { ArkhamCardsInvestigator } from "../../../api/arkhamCards";
2
2
  import type { Investigator, InvestigatorFaction } from "./common";
3
3
  import type { InvestigatorSkin } from "./options";
4
+ import { ReferencePart } from "../story";
4
5
  export type InvestigatorSignatureGender = "male" | "female" | "non-binary";
5
6
  export type InvestigatorSignature = Omit<ArkhamCardsInvestigator, "real_name" | "real_subname" | "real_text" | "real_flavor" | "real_traits" | "real_taboo_original_text" | "real_taboo_text_change" | "translations" | "pack" | "gender"> & Omit<Investigator, "variants" | "skins" | "image"> & {
6
7
  icon: string;
@@ -23,6 +24,7 @@ export type InvestigatorSignature = Omit<ArkhamCardsInvestigator, "real_name" |
23
24
  pack: InvestigatorSignaturePack;
24
25
  cycle: InvestigatorSignatureCycle;
25
26
  gender: InvestigatorSignatureGender;
27
+ tokens_reference: ReferencePart[];
26
28
  };
27
29
  export type InvestigatorSignatureType = "default" | "custom" | "parallel" | "book" | "taboo";
28
30
  export type InvestigatorSignaturePack = {
@@ -1,7 +1,39 @@
1
1
  import type { ArkhamCardsReferenceTranslation } from "../../../api/arkhamCards";
2
+ import type { ChaosBagToken } from "../chaosBag";
2
3
  export type ReferenceCard = ArkhamCardsReferenceTranslation & {
3
4
  code: string;
4
5
  encounter_code: string;
5
6
  icon?: string;
6
7
  position: number;
8
+ reference: ReferencePart[];
9
+ back_reference: ReferencePart[];
10
+ tokens: ReferenceCardToken[];
11
+ back_tokens: ReferenceCardToken[];
12
+ difficulty: string;
13
+ back_difficulty: string;
7
14
  };
15
+ export type ReferencePart = {
16
+ id: string;
17
+ } & ({
18
+ type: "single";
19
+ token: ChaosBagToken;
20
+ effect: string;
21
+ } | {
22
+ type: "group";
23
+ tokens: ChaosBagToken[];
24
+ effect: string;
25
+ });
26
+ export type ReferenceCardTokenResolve = number | "fail" | "success";
27
+ export type ReferenceCardToken = {
28
+ token: ChaosBagToken;
29
+ value?: ReferenceCardTokenResolve;
30
+ } & ({
31
+ type: "value";
32
+ } | {
33
+ type: "counter";
34
+ min?: number;
35
+ max?: number;
36
+ } | {
37
+ type: "select";
38
+ values?: number[];
39
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkham-investigator-data",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "main": "index.js",
5
5
  "types": "build/src/types.d.ts",
6
6
  "scripts": {
@@ -10,8 +10,8 @@
10
10
  "serve": "http-server ./dist --cors",
11
11
  "build:clean": "rimraf ./build",
12
12
  "build": "npm run build:clean && tsc && tsc-alias",
13
+ "format": "npx @biomejs/biome check --write ./src",
13
14
  "biome:lint": "npx @biomejs/biome check ./src",
14
- "biome:format": "npx @biomejs/biome check --write ./src",
15
15
  "biome:fix": "npx @biomejs/biome lint --write ./src"
16
16
  },
17
17
  "repository": {
@@ -1 +0,0 @@
1
- export declare const getStoryReference: () => void;