@skullandbonestools/snbdata 5.0.0 → 5.0.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 CHANGED
@@ -2,40 +2,44 @@
2
2
 
3
3
  Welcome to the inofficial data repository for the Skull and Bones game by Ubisoft.
4
4
 
5
- This repository hosts data for the several elements in the game like **Materials**, **Items**, **Cosmetics** and more in a JSON format.
5
+ This repository hosts data for the several elements in the game like **Materials**, **Items**, **Cosmetics** and more in a JSON format and provides a npm package to access the data in typescript and javascript.
6
6
 
7
7
  As the move to a public repository (see [History](#history)) includes several changes the following things are planned:
8
- - [ ] Extract events, locations, contracts into own data files
9
- - Those are currently only stored in the translation files
8
+ - [ ] Extract data stored in translation files into own data files
9
+ - [x] Sets
10
+ - [x] Events
11
+ - [x] World Events
12
+ - [ ] Locations
10
13
  - [ ] Crowdin workflow integration
11
- - [ ] npm packages with generated types for the different data (events, cosmetics, items, ...)
14
+ - [x] npm packages with generated types for the different data (events, cosmetics, items, ...)
12
15
 
13
16
  For each update of the game a new release is provided containing the updated files which can be found under the [Releases](https://github.com/SkullAndBonesTools/SkullAndBonesData/releases) section.
14
17
 
15
- The version number of the release is tied to the Skull and Bones version the data represents and put together like so:\
18
+ The version schema of the release is tied to the Skull and Bones version the data represents and put together like so:\
16
19
  **Example**: snbdata@5.2.4
17
20
  ```
18
- 5 - Season
21
+ 5 - Season (a year has 4 seasons, so season 5 = Y2S1)
19
22
  2 - Patch Level
20
- 4 - Bug Fixes / Minor Changes
23
+ 4 - Bug Fixes / Minor Changes (this one is related to releases of this repository)
21
24
 
22
- This represent the SnB game version Y2S1.2.X
25
+ This represents the SnB game version Y2S1.2.X
23
26
  ```
24
27
 
25
- *Because the first published version of the package was for Y1S2, so season 5 of Skull and Bones, the first release was the 5.0.0.*
28
+ *Because the first published version of the package was for Y2S1, so season 5 of Skull and Bones, the first release was the 5.0.0.*
26
29
 
27
30
  ## How to Use
28
31
  ### Raw Data
29
- You can find the raw data files as JSON in the [data](https://github.com/SkullAndBonesTools/SkullAndBonesData/tree/master/data) folder for the different types.
32
+ You can find the raw data files as JSON in the [data](https://github.com/SkullAndBonesTools/SkullAndBonesData/tree/master/data) folder.
30
33
 
31
34
  ### Package
32
- Based on the raw data is the `snbdata` npm package available, featuring access to the data as typescript objects with type safety and autocompletion.
35
+ Based on the raw data is the `snbdata` npm package available, featuring access to the data as objects with type safety and autocompletion.
33
36
 
34
37
  #### Guide
35
- **Install the Package**
36
- `TODO`
38
+ **Install the Package**\
39
+ ~~`npm i @skullandbonestools/snbdata`~~` // Package will be available in the coming days`
37
40
 
38
41
  **Access the Data**
42
+
39
43
  Getting the season of the `Barque` (TS):
40
44
  ```typescript
41
45
  import { Ships } from "@skullandbonestools/snbdata";
@@ -49,6 +53,7 @@ Getting the required materials for `Orca Intricate Apparatus` (JS):
49
53
  ```javascript
50
54
  import { Materials } from "@skullandbonestools/snbdata";
51
55
 
56
+ // Only check required materials not their amount
52
57
  Materials.orcaIntricateApparatus.required.keys().forEach(material => {
53
58
  console.log("Id: %s - Required: %s", material.id, material.required?.keys().map((m) => m.id).toArray().join(", "));
54
59
  });
@@ -0,0 +1,11 @@
1
+ import contractsData from '../../data/contracts.json';
2
+ export declare class Contract {
3
+ readonly id: string;
4
+ constructor(id: string);
5
+ static loadContracts(): Record<string, Contract>;
6
+ }
7
+ export type Contracts = {
8
+ [K in keyof typeof contractsData]: Contract;
9
+ };
10
+ export declare const Contracts: Contracts;
11
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/daos/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAEtD,qBAAa,QAAQ;aAEG,EAAE,EAAE,MAAM;gBAAV,EAAE,EAAE,MAAM;WAGhB,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC;CAS1D;AAED,MAAM,MAAM,SAAS,GAAG;KACnB,CAAC,IAAI,MAAM,OAAO,aAAa,GAAG,QAAQ;CAC9C,CAAC;AAEF,eAAO,MAAM,SAAS,EAA+B,SAAS,CAAC"}
@@ -0,0 +1,15 @@
1
+ import contractsData from '../../data/contracts.json';
2
+ export class Contract {
3
+ constructor(id) {
4
+ this.id = id;
5
+ }
6
+ static loadContracts() {
7
+ const contracts = {};
8
+ for (const [key, value] of Object.entries(contractsData)) {
9
+ contracts[key] = new Contract(value.id);
10
+ }
11
+ return contracts;
12
+ }
13
+ }
14
+ export const Contracts = Contract.loadContracts();
15
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/daos/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAEtD,MAAM,OAAO,QAAQ;IACjB,YACoB,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAC3B,CAAC;IAEG,MAAM,CAAC,aAAa;QACvB,MAAM,SAAS,GAA6B,EAAE,CAAC;QAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;YACvD,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,QAAQ,CACzB,KAAK,CAAC,EAAE,CACX,CAAC;QACN,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAMD,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,EAAe,CAAC"}
@@ -0,0 +1,13 @@
1
+ import eventsData from '../../data/events.json';
2
+ import { Season } from './seasons';
3
+ export declare class Event {
4
+ readonly id: string;
5
+ readonly seasons: Season[];
6
+ constructor(id: string, seasons: Season[]);
7
+ static loadEvents(): Record<string, Event>;
8
+ }
9
+ export type Events = {
10
+ [K in keyof typeof eventsData]: Event;
11
+ };
12
+ export declare const Events: Events;
13
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/daos/events.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAW,MAAM,WAAW,CAAC;AAE5C,qBAAa,KAAK;aAEM,EAAE,EAAE,MAAM;aACV,OAAO,EAAE,MAAM,EAAE;gBADjB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EAAE;WAGvB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;CAcpD;AAED,MAAM,MAAM,MAAM,GAAG;KAChB,CAAC,IAAI,MAAM,OAAO,UAAU,GAAG,KAAK;CACxC,CAAC;AAEF,eAAO,MAAM,MAAM,EAAyB,MAAM,CAAC"}
@@ -0,0 +1,21 @@
1
+ import eventsData from '../../data/events.json';
2
+ import { Seasons } from './seasons';
3
+ export class Event {
4
+ constructor(id, seasons) {
5
+ this.id = id;
6
+ this.seasons = seasons;
7
+ }
8
+ static loadEvents() {
9
+ const events = {};
10
+ for (const [key, value] of Object.entries(eventsData)) {
11
+ const seasons = value.seasons.map((_season) => {
12
+ const season = _season;
13
+ return Seasons[season];
14
+ });
15
+ events[key] = new Event(value.id, seasons);
16
+ }
17
+ return events;
18
+ }
19
+ }
20
+ export const Events = Event.loadEvents();
21
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/daos/events.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAU,OAAO,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,OAAO,KAAK;IACd,YACoB,EAAU,EACV,OAAiB;QADjB,OAAE,GAAF,EAAE,CAAQ;QACV,YAAO,GAAP,OAAO,CAAU;IAClC,CAAC;IAEG,MAAM,CAAC,UAAU;QACpB,MAAM,MAAM,GAA0B,EAAE,CAAC;QACzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YACpD,MAAM,OAAO,GAAa,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAe,EAAE,EAAE;gBAC5D,MAAM,MAAM,GAAG,OAA+B,CAAC;gBAC/C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,KAAK,CACnB,KAAK,CAAC,EAAE,EACR,OAAO,CACV,CAAC;QACN,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAMD,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,EAAY,CAAC"}
@@ -1,8 +1,13 @@
1
+ import setsData from '../../data/sets.json';
2
+ import { SetType } from '../types/SetProperties';
1
3
  export declare class Set {
2
4
  readonly id: string;
3
- constructor(id: string);
4
- static fromRawData(rawData: any): Set;
5
+ readonly type: SetType;
6
+ constructor(id: string, type: SetType);
5
7
  static loadSets(): Record<string, Set>;
6
8
  }
7
- export declare const Sets: Record<string, Set>;
9
+ export type Sets = {
10
+ [K in keyof typeof setsData]: Set;
11
+ };
12
+ export declare const Sets: Sets;
8
13
  //# sourceMappingURL=sets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../../src/daos/sets.ts"],"names":[],"mappings":"AAGA,qBAAa,GAAG;aAEQ,EAAE,EAAE,MAAM;gBAAV,EAAE,EAAE,MAAM;WAGhB,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,GAAG;WAM9B,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAUhD;AAID,eAAO,MAAM,IAAI,qBAAiB,CAAC"}
1
+ {"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../../src/daos/sets.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,qBAAa,GAAG;aAEQ,EAAE,EAAE,MAAM;aACV,IAAI,EAAE,OAAO;gBADb,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,OAAO;WAGnB,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAUhD;AAED,MAAM,MAAM,IAAI,GAAG;KACd,CAAC,IAAI,MAAM,OAAO,QAAQ,GAAG,GAAG;CACpC,CAAC;AAEF,eAAO,MAAM,IAAI,EAAqB,IAAI,CAAC"}
package/dist/daos/sets.js CHANGED
@@ -1,23 +1,16 @@
1
- import cosmeticsData from '../../data/cosmetics.json';
1
+ import setsData from '../../data/sets.json';
2
2
  export class Set {
3
- constructor(id) {
3
+ constructor(id, type) {
4
4
  this.id = id;
5
- }
6
- static fromRawData(rawData) {
7
- return new Set(rawData.set);
5
+ this.type = type;
8
6
  }
9
7
  static loadSets() {
10
8
  const sets = {};
11
- for (const [key, value] of Object.entries(cosmeticsData)) {
12
- const cosmetic = value;
13
- const set = cosmetic.set;
14
- if (!set || sets[set])
15
- continue;
16
- sets[set] = Set.fromRawData(value);
9
+ for (const [key, value] of Object.entries(setsData)) {
10
+ sets[key] = new Set(value.id, value.type);
17
11
  }
18
12
  return sets;
19
13
  }
20
14
  }
21
- // TODO: Add auto completion for set names
22
15
  export const Sets = Set.loadSets();
23
16
  //# sourceMappingURL=sets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sets.js","sourceRoot":"","sources":["../../src/daos/sets.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAGtD,MAAM,OAAO,GAAG;IACZ,YACoB,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAC3B,CAAC;IAEG,MAAM,CAAC,WAAW,CAAC,OAAY;QAClC,OAAO,IAAI,GAAG,CACV,OAAO,CAAC,GA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/worldEvents.json';
2
+ export declare class WorldEvent {
3
+ readonly id: string;
4
+ constructor(id: string);
5
+ static loadWorldEvents(): Record<string, WorldEvent>;
6
+ }
7
+ export type WorldEvents = {
8
+ [K in keyof typeof worldEventsData]: WorldEvent;
9
+ };
10
+ export declare const WorldEvents: WorldEvents;
11
+ //# sourceMappingURL=worldEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worldEvents.d.ts","sourceRoot":"","sources":["../../src/daos/worldEvents.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAE1D,qBAAa,UAAU;aAEC,EAAE,EAAE,MAAM;gBAAV,EAAE,EAAE,MAAM;WAGhB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;CAS9D;AAED,MAAM,MAAM,WAAW,GAAG;KACrB,CAAC,IAAI,MAAM,OAAO,eAAe,GAAG,UAAU;CAClD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAmC,WAAW,CAAC"}
@@ -0,0 +1,15 @@
1
+ import worldEventsData from '../../data/worldEvents.json';
2
+ export class WorldEvent {
3
+ constructor(id) {
4
+ this.id = id;
5
+ }
6
+ static loadWorldEvents() {
7
+ const worldEvents = {};
8
+ for (const [key, value] of Object.entries(worldEventsData)) {
9
+ worldEvents[key] = new WorldEvent(value.id);
10
+ }
11
+ return worldEvents;
12
+ }
13
+ }
14
+ export const WorldEvents = WorldEvent.loadWorldEvents();
15
+ //# sourceMappingURL=worldEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worldEvents.js","sourceRoot":"","sources":["../../src/daos/worldEvents.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAE1D,MAAM,OAAO,UAAU;IACnB,YACoB,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAC3B,CAAC;IAEG,MAAM,CAAC,eAAe;QACzB,MAAM,WAAW,GAA+B,EAAE,CAAC;QACnD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;YACzD,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,UAAU,CAC7B,KAAK,CAAC,EAAE,CACX,CAAC;QACN,CAAC;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;CACJ;AAMD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,eAAe,EAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type SetType = "player" | "ship";
2
+ //# sourceMappingURL=SetProperties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetProperties.d.ts","sourceRoot":"","sources":["../../src/types/SetProperties.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SetProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetProperties.js","sourceRoot":"","sources":["../../src/types/SetProperties.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skullandbonestools/snbdata",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Inofficial data package for the Skull and Bones game by Ubisoft.",
5
5
  "keywords": [
6
6
  "ubisoft",