arkham-investigator-data 1.2.2 → 1.3.2

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 (35) hide show
  1. package/.env +1 -0
  2. package/build/src/api/arkhamCards.d.ts +39 -0
  3. package/build/src/api/index.d.ts +0 -0
  4. package/build/src/components/index.d.ts +1 -0
  5. package/build/src/components/signatures/getEnglishSignatures.d.ts +3 -0
  6. package/build/src/components/signatures/getSignatureBase.d.ts +2 -0
  7. package/build/src/components/signatures/getSignatureCollection.d.ts +2 -0
  8. package/build/src/components/signatures/getSignatureTranslations.d.ts +3 -0
  9. package/build/src/components/signatures/getSignatures.d.ts +2 -0
  10. package/build/src/components/signatures/index.d.ts +1 -0
  11. package/build/src/config/api.d.ts +1 -0
  12. package/build/src/config/app.d.ts +1 -0
  13. package/build/src/config/index.d.ts +3 -2
  14. package/build/src/features/googleDrive/getGoogleDriveFile.d.ts +2 -2
  15. package/build/src/features/googleDrive/getGoogleDriveFolderContents.d.ts +1 -1
  16. package/build/src/features/googleDrive/getGoogleDriveService.d.ts +1 -1
  17. package/build/src/features/googleDrive/index.d.ts +2 -2
  18. package/build/src/features/index.d.ts +2 -2
  19. package/build/src/features/util/fs.d.ts +2 -2
  20. package/build/src/features/util/index.d.ts +2 -2
  21. package/build/src/index.d.ts +1 -1
  22. package/build/src/model/build.d.ts +3 -1
  23. package/build/src/model/game/abilities.d.ts +1 -0
  24. package/build/src/model/game/chaosBag.d.ts +1 -1
  25. package/build/src/model/game/common.d.ts +1 -1
  26. package/build/src/model/game/entities.d.ts +3 -3
  27. package/build/src/model/game/image.d.ts +2 -2
  28. package/build/src/model/game/index.d.ts +6 -5
  29. package/build/src/model/game/options.d.ts +3 -3
  30. package/build/src/model/game/signature.d.ts +16 -0
  31. package/build/src/model/index.d.ts +4 -4
  32. package/build/src/tasks/createSignatureCache.d.ts +1 -0
  33. package/build/src/tasks/index.d.ts +2 -2
  34. package/build/src/types.d.ts +1 -1
  35. package/package.json +9 -5
package/.env ADDED
@@ -0,0 +1 @@
1
+ ARKHAM_CARDS_GRAPHQL_URL="https://gapi.arkhamcards.com/v1/graphql"
@@ -0,0 +1,39 @@
1
+ import type { InvestigatorFaction } from "../model";
2
+ export declare type ArkhamCardsInvestigator = {
3
+ id: string;
4
+ code: string;
5
+ real_text: string;
6
+ real_name: string;
7
+ real_subname: string;
8
+ real_flavor: string;
9
+ real_traits: string;
10
+ real_taboo_original_text: string | null;
11
+ real_taboo_text_change: string | null;
12
+ faction_code: InvestigatorFaction;
13
+ sanity: number;
14
+ health: number;
15
+ skill_agility: number;
16
+ skill_combat: number;
17
+ skill_intellect: number;
18
+ skill_willpower: number;
19
+ translations: ArkhamCardsInvestigatorTranslation[];
20
+ taboo_set: ArkhamCardsTabooSet | null;
21
+ spoiler: boolean;
22
+ };
23
+ export declare type ArkhamCardsInvestigatorTranslation = {
24
+ locale: string;
25
+ name: string;
26
+ subname: string;
27
+ text: string;
28
+ traits: string;
29
+ flavor: string;
30
+ taboo_original_text: string;
31
+ taboo_text_change: string;
32
+ };
33
+ export declare type ArkhamCardsTabooSet = {
34
+ id: number;
35
+ date: string;
36
+ code: string;
37
+ name: string;
38
+ };
39
+ export declare const loadArkhamCardsInvestigators: () => Promise<ArkhamCardsInvestigator[]>;
File without changes
@@ -0,0 +1 @@
1
+ export * from "./signatures";
@@ -0,0 +1,3 @@
1
+ import type { ArkhamCardsInvestigator } from "../../api/arkhamCards";
2
+ import type { InvestigatorTabooSignature } from "../../model";
3
+ export declare const getEnglishSignatures: (data: ArkhamCardsInvestigator[]) => InvestigatorTabooSignature[];
@@ -0,0 +1,2 @@
1
+ import type { ArkhamCardsInvestigator } from "../../api/arkhamCards";
2
+ export declare const getSignatureBase: (card: ArkhamCardsInvestigator) => Omit<ArkhamCardsInvestigator, "real_name" | "real_subname" | "real_text" | "real_flavor" | "real_traits" | "real_taboo_original_text" | "real_taboo_text_change" | "translations">;
@@ -0,0 +1,2 @@
1
+ import type { InvestigatorTabooSignature, SignatureCollection } from "../../model";
2
+ export declare const getSignatureCollection: (data: InvestigatorTabooSignature[]) => SignatureCollection;
@@ -0,0 +1,3 @@
1
+ import type { ArkhamCardsInvestigator } from "../../api/arkhamCards";
2
+ import type { InvestigatorTabooSignature } from "../../model";
3
+ export declare const getSignatureTranslations: (data: ArkhamCardsInvestigator[]) => Map<string, InvestigatorTabooSignature[]>;
@@ -0,0 +1,2 @@
1
+ import type { SignatureCollection } from "../../model";
2
+ export declare const getSignatures: () => Promise<Map<string, SignatureCollection>>;
@@ -0,0 +1 @@
1
+ export * from "./getSignatures";
@@ -0,0 +1 @@
1
+ export declare const ARKHAM_CARDS_GRAPHQL_URL: string;
@@ -5,3 +5,4 @@ export declare const DOWNLOADS_DIR: string;
5
5
  export declare const CACHED_IMAGES_DIR: string;
6
6
  export declare const DEVELOPMENT_MODE: boolean;
7
7
  export declare const APP_VERSION: string;
8
+ export declare const MIN_CLIENT_VERSION = "1.4.0";
@@ -1,2 +1,3 @@
1
- export * from './app';
2
- export * from './googleDrive';
1
+ export * from "./app";
2
+ export * from "./googleDrive";
3
+ export * from "./api";
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
- import type { drive_v3 } from "@googleapis/drive";
3
2
  import type { WriteStream } from "node:fs";
3
+ import type { drive_v3 } from "@googleapis/drive";
4
4
  export declare type IGetGoogleDriveFileOptions = drive_v3.Schema$File & {
5
5
  stream: WriteStream;
6
6
  };
7
- export declare const getGoogleDriveFile: ({ id, name, stream }: IGetGoogleDriveFileOptions) => Promise<unknown>;
7
+ export declare const getGoogleDriveFile: ({ id, name, stream, }: IGetGoogleDriveFileOptions) => Promise<unknown>;
@@ -1,2 +1,2 @@
1
- import type { drive_v3 } from '@googleapis/drive';
1
+ import type { drive_v3 } from "@googleapis/drive";
2
2
  export declare const getGoogleDriveFolderContents: (parentId: string) => Promise<drive_v3.Schema$File[]>;
@@ -1,2 +1,2 @@
1
- import * as google from '@googleapis/drive';
1
+ import * as google from "@googleapis/drive";
2
2
  export declare const getGoogleDriveService: () => Promise<google.drive_v3.Drive>;
@@ -1,2 +1,2 @@
1
- export * from './getGoogleDriveFile';
2
- export * from './getGoogleDriveFolderContents';
1
+ export * from "./getGoogleDriveFile";
2
+ export * from "./getGoogleDriveFolderContents";
@@ -1,2 +1,2 @@
1
- export * from './util';
2
- export * from './googleDrive';
1
+ export * from "./util";
2
+ export * from "./googleDrive";
@@ -2,13 +2,13 @@ export declare const createExistsChecker: ({ dir, extension, }: {
2
2
  dir: string;
3
3
  extension?: string;
4
4
  }) => (name: string) => boolean;
5
- export declare const createWriter: <T = string, D = string>({ dir, extension, serialize }: {
5
+ export declare const createWriter: <T = string, D = string>({ dir, extension, serialize, }: {
6
6
  dir: string;
7
7
  extension?: string;
8
8
  serialize?: (data: D) => string;
9
9
  }) => (name: T, data: D) => void;
10
10
  export declare const createJSONWriter: (dir: string) => (name: string, data: object) => void;
11
- export declare const createReader: <T = string, D = string>({ dir, extension, unserialize }: {
11
+ export declare const createReader: <T = string, D = string>({ dir, extension, unserialize, }: {
12
12
  dir: string;
13
13
  extension: string;
14
14
  unserialize?: (data: string) => D;
@@ -1,2 +1,2 @@
1
- export * from './fs';
2
- export * from './promise';
1
+ export * from "./fs";
2
+ export * from "./promise";
@@ -1 +1 @@
1
- import './environment';
1
+ import "./environment";
@@ -1,5 +1,7 @@
1
- import type { Investigator } from "./game";
1
+ import type { Investigator, SignatureCollection } from "./game";
2
2
  export declare type Build = {
3
3
  version: string;
4
+ minClientVersion: string;
4
5
  data: Investigator[];
5
6
  };
7
+ export declare type SignatureBuild = SignatureCollection;
@@ -3,6 +3,7 @@ import type { Stat } from "./entities";
3
3
  export declare type LimitType = "round" | "turn" | "phase" | "ability" | "test" | "game";
4
4
  export declare type InvestigatorAbilityType = {
5
5
  type: "reaction" | "fast" | "permanent";
6
+ icon?: string;
6
7
  } | {
7
8
  type: "action" | "special-action";
8
9
  icon: string;
@@ -1 +1 @@
1
- export declare type ChaosBagToken = 'bless' | 'curse' | 'elderSign' | 'skull' | 'cultist' | 'autoFail' | 'tablet' | 'frost' | 'elderThing';
1
+ export declare type ChaosBagToken = "bless" | "curse" | "elderSign" | "skull" | "cultist" | "autoFail" | "tablet" | "frost" | "elderThing";
@@ -14,4 +14,4 @@ export declare type Investigator = {
14
14
  roles?: InvestigatorFaction[];
15
15
  spoiler?: boolean;
16
16
  };
17
- export declare type InvestigatorFaction = 'guardian' | 'rogue' | 'seeker' | 'mystic' | 'survivor' | 'neutral';
17
+ export declare type InvestigatorFaction = "guardian" | "rogue" | "seeker" | "mystic" | "survivor" | "neutral";
@@ -1,4 +1,4 @@
1
1
  export declare type Stat = MainStat | SecondaryStat | Skill;
2
- export declare type MainStat = 'health' | 'sanity';
3
- export declare type SecondaryStat = 'actions' | 'clues' | 'resources';
4
- export declare type Skill = 'willpower' | 'intellect' | 'combat' | 'agility';
2
+ export declare type MainStat = "health" | "sanity";
3
+ export declare type SecondaryStat = "actions" | "clues" | "resources";
4
+ export declare type Skill = "willpower" | "intellect" | "combat" | "agility";
@@ -4,14 +4,14 @@ export declare type InvestigatorImageBox = Box & {
4
4
  left: number;
5
5
  };
6
6
  export declare type InvestigatorImageSource = Box & {
7
- type: 'mini' | 'full';
7
+ type: "mini" | "full";
8
8
  id: string;
9
9
  face: InvestigatorImageBox;
10
10
  };
11
11
  export declare type InvestigatorImageMedia = InvestigatorImageBox & {
12
12
  source?: InvestigatorImageSource;
13
13
  primary?: boolean;
14
- type?: 'face' | 'body';
14
+ type?: "face" | "body";
15
15
  };
16
16
  export declare type InvestigatorImage = Box & {
17
17
  id?: string;
@@ -1,5 +1,6 @@
1
- export * from './common';
2
- export * from './options';
3
- export * from './image';
4
- export * from './abilities';
5
- export * from './entities';
1
+ export * from "./common";
2
+ export * from "./options";
3
+ export * from "./image";
4
+ export * from "./abilities";
5
+ export * from "./entities";
6
+ export * from "./signature";
@@ -12,7 +12,7 @@ export declare type InvestigatorVariant = InvestigatorVariantIdentity & {
12
12
  };
13
13
  export declare type InvestigatorVariantIdentity = InvestigatorVariantWithPack | InvestigatorCustomVariant;
14
14
  export declare type InvestigatorCustomVariant = {
15
- type: 'custom';
15
+ type: "custom";
16
16
  } & ({
17
17
  code: string;
18
18
  image?: InvestigatorImage;
@@ -23,9 +23,9 @@ export declare type InvestigatorCustomVariant = {
23
23
  export declare type InvestigatorVariantWithPack = {
24
24
  code: string;
25
25
  } & ({
26
- type: 'parallel';
26
+ type: "parallel";
27
27
  image?: InvestigatorImage;
28
28
  } | {
29
- type: 'book';
29
+ type: "book";
30
30
  image: InvestigatorImage;
31
31
  });
@@ -0,0 +1,16 @@
1
+ import type { ArkhamCardsInvestigator } from "../../api/arkhamCards";
2
+ export declare type InvestigatorTabooSignature = Omit<ArkhamCardsInvestigator, "real_name" | "real_subname" | "real_text" | "real_flavor" | "real_traits" | "real_taboo_original_text" | "real_taboo_text_change" | "translations"> & {
3
+ locale: string;
4
+ text: string;
5
+ name: string;
6
+ subname: string;
7
+ flavor: string;
8
+ traits: string;
9
+ taboo_original_text: string | null;
10
+ taboo_text_change: string | null;
11
+ };
12
+ export declare type InvestigatorSignature = Omit<InvestigatorTabooSignature, "taboo_original_text" | "taboo_text_change" | "taboo_set">;
13
+ export declare type SignatureCollection = {
14
+ cards: InvestigatorSignature[];
15
+ taboo: InvestigatorTabooSignature[];
16
+ };
@@ -1,4 +1,4 @@
1
- export * from './common';
2
- export * from './dimensions';
3
- export * from './game';
4
- export * from './build';
1
+ export * from "./common";
2
+ export * from "./dimensions";
3
+ export * from "./game";
4
+ export * from "./build";
@@ -0,0 +1 @@
1
+ export declare const createSignatureCache: () => Promise<void>;
@@ -1,2 +1,2 @@
1
- export * from './createImageCache';
2
- export * from './createInvestigatorsCache';
1
+ export * from "./createImageCache";
2
+ export * from "./createInvestigatorsCache";
@@ -1 +1 @@
1
- export * from './model';
1
+ export * from "./model";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkham-investigator-data",
3
- "version": "1.2.2",
3
+ "version": "1.3.2",
4
4
  "main": "index.js",
5
5
  "types": "build/src/types.d.ts",
6
6
  "scripts": {
@@ -9,7 +9,10 @@
9
9
  "lint": "npx @biomejs/biome format --write ./src",
10
10
  "serve": "http-server ./dist --cors",
11
11
  "build:clean": "rimraf ./build",
12
- "build": "npm run build:clean && tsc && tsc-alias"
12
+ "build": "npm run build:clean && tsc && tsc-alias",
13
+ "biome:lint": "npx @biomejs/biome check ./src",
14
+ "biome:format": "npx @biomejs/biome check --write ./src",
15
+ "biome:fix": "npx @biomejs/biome lint --write ./src"
13
16
  },
14
17
  "repository": {
15
18
  "type": "git",
@@ -26,14 +29,15 @@
26
29
  "@biomejs/biome": "^1.9.4",
27
30
  "@types/decompress": "^4.2.7",
28
31
  "@types/node": "^22.13.1",
32
+ "@types/ramda": "^0.30.2",
29
33
  "http-server": "^14.1.1",
30
34
  "rimraf": "^6.0.1",
31
- "tsx": "^4.19.2"
32
- },
33
- "dependencies": {
35
+ "tsx": "^4.19.2",
34
36
  "@googleapis/drive": "^8.14.0",
35
37
  "decompress": "^4.2.1",
36
38
  "dotenv": "^16.4.7",
39
+ "graphql-request": "^7.1.2",
40
+ "ramda": "^0.30.1",
37
41
  "tsc-alias": "^1.8.10"
38
42
  }
39
43
  }