@lycoristech/azurapi 0.0.2 → 0.0.4

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 (53) hide show
  1. package/LICENSE +1 -5
  2. package/data/ship-list.json +34 -34
  3. package/data/ships.json +3694 -3693
  4. package/data/version.json +1 -1
  5. package/dist/cjs/ingest/files.js +25 -15
  6. package/dist/cjs/normalize/identity.js +2 -2
  7. package/dist/cjs/normalize/ship.js +9 -10
  8. package/dist/cjs/normalize/skins.js +33 -9
  9. package/dist/cjs/normalize/stats.js +66 -8
  10. package/dist/cjs/schema/output/ship.js +1 -1
  11. package/dist/cjs/schema/raw/index.js +1 -0
  12. package/dist/cjs/schema/raw/shipDataBlueprint.js +2 -0
  13. package/dist/cjs/schema/raw/shipStrengthenBlueprint.js +22 -0
  14. package/dist/cjs/translate/enums.js +27 -17
  15. package/dist/ingest/files.d.ts +2 -1
  16. package/dist/ingest/files.d.ts.map +1 -1
  17. package/dist/ingest/files.js +25 -16
  18. package/dist/ingest/files.js.map +1 -1
  19. package/dist/normalize/identity.d.ts +0 -2
  20. package/dist/normalize/identity.d.ts.map +1 -1
  21. package/dist/normalize/identity.js +2 -2
  22. package/dist/normalize/identity.js.map +1 -1
  23. package/dist/normalize/ship.d.ts +2 -3
  24. package/dist/normalize/ship.d.ts.map +1 -1
  25. package/dist/normalize/ship.js +9 -10
  26. package/dist/normalize/ship.js.map +1 -1
  27. package/dist/normalize/skins.d.ts.map +1 -1
  28. package/dist/normalize/skins.js +33 -9
  29. package/dist/normalize/skins.js.map +1 -1
  30. package/dist/normalize/stats.d.ts +5 -1
  31. package/dist/normalize/stats.d.ts.map +1 -1
  32. package/dist/normalize/stats.js +66 -8
  33. package/dist/normalize/stats.js.map +1 -1
  34. package/dist/schema/output/ship.d.ts +5 -5
  35. package/dist/schema/output/ship.js +1 -1
  36. package/dist/schema/output/ship.js.map +1 -1
  37. package/dist/schema/raw/index.d.ts +1 -0
  38. package/dist/schema/raw/index.d.ts.map +1 -1
  39. package/dist/schema/raw/index.js +1 -0
  40. package/dist/schema/raw/index.js.map +1 -1
  41. package/dist/schema/raw/shipDataBlueprint.d.ts +12 -0
  42. package/dist/schema/raw/shipDataBlueprint.d.ts.map +1 -1
  43. package/dist/schema/raw/shipDataBlueprint.js +2 -0
  44. package/dist/schema/raw/shipDataBlueprint.js.map +1 -1
  45. package/dist/schema/raw/shipStrengthenBlueprint.d.ts +46 -0
  46. package/dist/schema/raw/shipStrengthenBlueprint.d.ts.map +1 -0
  47. package/dist/schema/raw/shipStrengthenBlueprint.js +20 -0
  48. package/dist/schema/raw/shipStrengthenBlueprint.js.map +1 -0
  49. package/dist/translate/enums.d.ts +20 -10
  50. package/dist/translate/enums.d.ts.map +1 -1
  51. package/dist/translate/enums.js +27 -17
  52. package/dist/translate/enums.js.map +1 -1
  53. package/package.json +1 -1
@@ -2,22 +2,34 @@ import { z } from "zod";
2
2
  declare const shipDataBlueprintValueSchema: z.ZodObject<{
3
3
  name: z.ZodOptional<z.ZodString>;
4
4
  blueprint_version: z.ZodOptional<z.ZodNumber>;
5
+ strengthen_effect: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
6
+ fate_strengthen: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
5
7
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6
8
  name: z.ZodOptional<z.ZodString>;
7
9
  blueprint_version: z.ZodOptional<z.ZodNumber>;
10
+ strengthen_effect: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
11
+ fate_strengthen: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
8
12
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
9
13
  name: z.ZodOptional<z.ZodString>;
10
14
  blueprint_version: z.ZodOptional<z.ZodNumber>;
15
+ strengthen_effect: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
16
+ fate_strengthen: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
11
17
  }, z.ZodTypeAny, "passthrough">>;
12
18
  export declare const ShipDataBlueprintSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
13
19
  name: z.ZodOptional<z.ZodString>;
14
20
  blueprint_version: z.ZodOptional<z.ZodNumber>;
21
+ strengthen_effect: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
22
+ fate_strengthen: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
15
23
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
16
24
  name: z.ZodOptional<z.ZodString>;
17
25
  blueprint_version: z.ZodOptional<z.ZodNumber>;
26
+ strengthen_effect: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
27
+ fate_strengthen: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
18
28
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
19
29
  name: z.ZodOptional<z.ZodString>;
20
30
  blueprint_version: z.ZodOptional<z.ZodNumber>;
31
+ strengthen_effect: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
32
+ fate_strengthen: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
21
33
  }, z.ZodTypeAny, "passthrough">>>;
22
34
  export type ShipDataBlueprint = z.infer<typeof ShipDataBlueprintSchema>;
23
35
  export type ShipDataBlueprintValue = z.infer<typeof shipDataBlueprintValueSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"shipDataBlueprint.d.ts","sourceRoot":"","sources":["../../../src/schema/raw/shipDataBlueprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,4BAA4B;;;;;;;;;gCAKlB,CAAC;AAEjB,eAAO,MAAM,uBAAuB;;;;;;;;;iCAAqD,CAAC;AAC1F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
1
+ {"version":3,"file":"shipDataBlueprint.d.ts","sourceRoot":"","sources":["../../../src/schema/raw/shipDataBlueprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;gCAOlB,CAAC;AAEjB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;iCAAqD,CAAC;AAC1F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -3,6 +3,8 @@ const shipDataBlueprintValueSchema = z
3
3
  .object({
4
4
  name: z.string().optional(),
5
5
  blueprint_version: z.number().optional(),
6
+ strengthen_effect: z.array(z.number()).optional(),
7
+ fate_strengthen: z.array(z.number()).optional(),
6
8
  })
7
9
  .passthrough();
8
10
  export const ShipDataBlueprintSchema = z.record(z.string(), shipDataBlueprintValueSchema);
@@ -1 +1 @@
1
- {"version":3,"file":"shipDataBlueprint.js","sourceRoot":"","sources":["../../../src/schema/raw/shipDataBlueprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,4BAA4B,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACzC,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,4BAA4B,CAAC,CAAC"}
1
+ {"version":3,"file":"shipDataBlueprint.js","sourceRoot":"","sources":["../../../src/schema/raw/shipDataBlueprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,4BAA4B,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACjD,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAChD,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * ship_strengthen_blueprint.json — per-level dev/fate strengthen rows for
4
+ * research ships. Keyed by a numeric row id referenced from
5
+ * ship_data_blueprint[group].strengthen_effect[] and fate_strengthen[].
6
+ *
7
+ * `effect` is a 5-element CUMULATIVE array with the same layout as
8
+ * ship_data_strengthen.durability: [firepower, torpedo, _, aviation, reload].
9
+ * Index 2 is unused (always 0 in current data).
10
+ */
11
+ declare const shipStrengthenBlueprintValueSchema: z.ZodObject<{
12
+ id: z.ZodNumber;
13
+ lv: z.ZodNumber;
14
+ need_lv: z.ZodOptional<z.ZodNumber>;
15
+ effect: z.ZodArray<z.ZodNumber, "many">;
16
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
17
+ id: z.ZodNumber;
18
+ lv: z.ZodNumber;
19
+ need_lv: z.ZodOptional<z.ZodNumber>;
20
+ effect: z.ZodArray<z.ZodNumber, "many">;
21
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
22
+ id: z.ZodNumber;
23
+ lv: z.ZodNumber;
24
+ need_lv: z.ZodOptional<z.ZodNumber>;
25
+ effect: z.ZodArray<z.ZodNumber, "many">;
26
+ }, z.ZodTypeAny, "passthrough">>;
27
+ export declare const ShipStrengthenBlueprintSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
28
+ id: z.ZodNumber;
29
+ lv: z.ZodNumber;
30
+ need_lv: z.ZodOptional<z.ZodNumber>;
31
+ effect: z.ZodArray<z.ZodNumber, "many">;
32
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
33
+ id: z.ZodNumber;
34
+ lv: z.ZodNumber;
35
+ need_lv: z.ZodOptional<z.ZodNumber>;
36
+ effect: z.ZodArray<z.ZodNumber, "many">;
37
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
38
+ id: z.ZodNumber;
39
+ lv: z.ZodNumber;
40
+ need_lv: z.ZodOptional<z.ZodNumber>;
41
+ effect: z.ZodArray<z.ZodNumber, "many">;
42
+ }, z.ZodTypeAny, "passthrough">>>;
43
+ export type ShipStrengthenBlueprint = z.infer<typeof ShipStrengthenBlueprintSchema>;
44
+ export type ShipStrengthenBlueprintValue = z.infer<typeof shipStrengthenBlueprintValueSchema>;
45
+ export {};
46
+ //# sourceMappingURL=shipStrengthenBlueprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipStrengthenBlueprint.d.ts","sourceRoot":"","sources":["../../../src/schema/raw/shipStrengthenBlueprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,QAAA,MAAM,kCAAkC;;;;;;;;;;;;;;;gCAOxB,CAAC;AAEjB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;iCAGzC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * ship_strengthen_blueprint.json — per-level dev/fate strengthen rows for
4
+ * research ships. Keyed by a numeric row id referenced from
5
+ * ship_data_blueprint[group].strengthen_effect[] and fate_strengthen[].
6
+ *
7
+ * `effect` is a 5-element CUMULATIVE array with the same layout as
8
+ * ship_data_strengthen.durability: [firepower, torpedo, _, aviation, reload].
9
+ * Index 2 is unused (always 0 in current data).
10
+ */
11
+ const shipStrengthenBlueprintValueSchema = z
12
+ .object({
13
+ id: z.number(),
14
+ lv: z.number(),
15
+ need_lv: z.number().optional(),
16
+ effect: z.array(z.number()),
17
+ })
18
+ .passthrough();
19
+ export const ShipStrengthenBlueprintSchema = z.record(z.string(), shipStrengthenBlueprintValueSchema);
20
+ //# sourceMappingURL=shipStrengthenBlueprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipStrengthenBlueprint.js","sourceRoot":"","sources":["../../../src/schema/raw/shipStrengthenBlueprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,kCAAkC,GAAG,CAAC;KACzC,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC5B,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CACnD,CAAC,CAAC,MAAM,EAAE,EACV,kCAAkC,CACnC,CAAC"}
@@ -4,23 +4,33 @@ export declare const RARITY_MAP: Record<number, "Normal" | "Rare" | "Elite" | "S
4
4
  /**
5
5
  * Resolve a rarity integer to its display string.
6
6
  *
7
- * Rules:
8
- * - int === 6 && isResearch && blueprintVersion >= 6 → "Decisive"
9
- * - int === 6 && isResearch → "Priority"
10
- * - else → RARITY_MAP[int] || "Normal"
7
+ * Research ships are keyed off the raw `rarity` value, not `blueprint_version`:
8
+ * - rarity === 5 && isResearch → "Priority"
9
+ * - rarity === 6 && isResearch → "Decisive"
10
+ * - else → RARITY_MAP[rarity] ?? "Normal"
11
11
  */
12
- export declare function rarityName(rarity: number, isResearch: boolean, blueprintVersion: number | undefined): string;
12
+ export declare function rarityName(rarity: number, isResearch: boolean): string;
13
13
  /** Nationality int → display string. Matches Azur Lane wiki convention. */
14
14
  export declare const NATIONALITY_MAP: Record<number, string>;
15
15
  /** Look up a nationality code; falls back to "Universal". */
16
16
  export declare function nationalityName(code: number): string;
17
17
  /**
18
- * Skill type int → AzurAPI color.
19
- * 1 = offensive (yellow), 2 = support (pink), 3 = defensive (blue), 0 = unset (pink).
18
+ * Skill type int → Azur Lane in-client border color.
19
+ *
20
+ * 1 = offensive → "red"
21
+ * 2 = defensive → "blue"
22
+ * 3 = support → "yellow"
23
+ * 0 = unset / placeholder (legacy passives like "Repair I") → "blue"
24
+ *
25
+ * NOTE: this corrects a long-standing AzurAPI mislabeling where the map read
26
+ * 1 → "yellow", 2 → "pink", 3 → "blue"
27
+ * — the game type numbers had been bound to the wrong category names, and
28
+ * the "pink" sentinel was invented to paper over type 2. Consumers relying
29
+ * on the old labels will now see the in-game colors instead.
20
30
  */
21
- export declare const SKILL_COLOR_MAP: Record<number, "red" | "pink" | "gold" | "yellow" | "blue">;
22
- /** Look up a skill type color; falls back to "pink". */
23
- export declare function skillColor(type: number): "red" | "pink" | "gold" | "yellow" | "blue";
31
+ export declare const SKILL_COLOR_MAP: Record<number, "red" | "yellow" | "blue">;
32
+ /** Look up a skill type color; falls back to "blue" for unknown types. */
33
+ export declare function skillColor(type: number): "red" | "yellow" | "blue";
24
34
  /**
25
35
  * Stat index (0..11) → AzurAPI stat field name (on StatBlock).
26
36
  * Only the 10 exposed stats. armor (6) and antisub (11) are intentionally missing.
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/translate/enums.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAM1D,kDAAkD;AAClD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,CAOhG,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,EACnB,gBAAgB,EAAE,MAAM,GAAG,SAAS,GACnC,MAAM,CAQR;AAMD,2EAA2E;AAC3E,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA4BlD,CAAC;AAEF,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAMD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAKvF,CAAC;AAEF,wDAAwD;AACxD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAEpF;AAMD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,SAAS,GAAG,SAAS,CAa3E,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAatD,CAAC"}
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/translate/enums.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAM1D,kDAAkD;AAClD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,CAOhG,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,MAAM,CAMtE;AAMD,2EAA2E;AAC3E,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA4BlD,CAAC;AAEF,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAMD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAKrE,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAElE;AAMD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,SAAS,GAAG,SAAS,CAa3E,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAatD,CAAC"}
@@ -13,17 +13,17 @@ export const RARITY_MAP = {
13
13
  /**
14
14
  * Resolve a rarity integer to its display string.
15
15
  *
16
- * Rules:
17
- * - int === 6 && isResearch && blueprintVersion >= 6 → "Decisive"
18
- * - int === 6 && isResearch → "Priority"
19
- * - else → RARITY_MAP[int] || "Normal"
16
+ * Research ships are keyed off the raw `rarity` value, not `blueprint_version`:
17
+ * - rarity === 5 && isResearch → "Priority"
18
+ * - rarity === 6 && isResearch → "Decisive"
19
+ * - else → RARITY_MAP[rarity] ?? "Normal"
20
20
  */
21
- export function rarityName(rarity, isResearch, blueprintVersion) {
22
- if (rarity === 6 && isResearch) {
23
- if (blueprintVersion !== undefined && blueprintVersion >= 6) {
21
+ export function rarityName(rarity, isResearch) {
22
+ if (isResearch) {
23
+ if (rarity === 5)
24
+ return "Priority";
25
+ if (rarity === 6)
24
26
  return "Decisive";
25
- }
26
- return "Priority";
27
27
  }
28
28
  return RARITY_MAP[rarity] ?? "Normal";
29
29
  }
@@ -68,18 +68,28 @@ export function nationalityName(code) {
68
68
  // Skill color
69
69
  // ---------------------------------------------------------------------------
70
70
  /**
71
- * Skill type int → AzurAPI color.
72
- * 1 = offensive (yellow), 2 = support (pink), 3 = defensive (blue), 0 = unset (pink).
71
+ * Skill type int → Azur Lane in-client border color.
72
+ *
73
+ * 1 = offensive → "red"
74
+ * 2 = defensive → "blue"
75
+ * 3 = support → "yellow"
76
+ * 0 = unset / placeholder (legacy passives like "Repair I") → "blue"
77
+ *
78
+ * NOTE: this corrects a long-standing AzurAPI mislabeling where the map read
79
+ * 1 → "yellow", 2 → "pink", 3 → "blue"
80
+ * — the game type numbers had been bound to the wrong category names, and
81
+ * the "pink" sentinel was invented to paper over type 2. Consumers relying
82
+ * on the old labels will now see the in-game colors instead.
73
83
  */
74
84
  export const SKILL_COLOR_MAP = {
75
- 0: "pink",
76
- 1: "yellow",
77
- 2: "pink",
78
- 3: "blue",
85
+ 0: "blue",
86
+ 1: "red",
87
+ 2: "blue",
88
+ 3: "yellow",
79
89
  };
80
- /** Look up a skill type color; falls back to "pink". */
90
+ /** Look up a skill type color; falls back to "blue" for unknown types. */
81
91
  export function skillColor(type) {
82
- return SKILL_COLOR_MAP[type] ?? "pink";
92
+ return SKILL_COLOR_MAP[type] ?? "blue";
83
93
  }
84
94
  // ---------------------------------------------------------------------------
85
95
  // Stat index map
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/translate/enums.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,kDAAkD;AA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ACX,CAAC,EAAE,WAAW;IACd,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,cAAc;IACjB,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,SAAS;IACZ,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,SAAS;CACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lycoristech/azurapi",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",