ps99-api 1.0.1 → 1.1.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.
- package/.github/actions/test/action.yml +27 -0
- package/.github/workflows/release-on-main.yml +1 -13
- package/.github/workflows/test-on-branch.yml +18 -0
- package/.idea/jsLibraryMappings.xml +6 -0
- package/README.md +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ps99-api.d.ts +2 -3
- package/dist/ps99-api.js.map +1 -1
- package/dist/responses/activeClanBattle.d.ts +34 -29
- package/dist/responses/clan.d.ts +81 -88
- package/dist/responses/clans.d.ts +11 -18
- package/dist/responses/collection.d.ts +1355 -1240
- package/dist/responses/collections.d.ts +1 -1
- package/dist/responses/exists.d.ts +11 -29
- package/dist/responses/rap.d.ts +12 -36
- package/dump-result.js +9 -0
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/ps99-api-live.ts.snap +98822 -0
- package/src/__tests__/ps99-api-changes.ts +36 -0
- package/src/__tests__/ps99-api-live.ts +177 -0
- package/src/index.ts +1 -1
- package/src/ps99-api.ts +3 -4
- package/src/responses/activeClanBattle.ts +42 -19
- package/src/responses/clan.ts +90 -64
- package/src/responses/clans.ts +11 -21
- package/src/responses/collection.ts +1543 -1261
- package/src/responses/collections.ts +1 -1
- package/src/responses/exists.ts +13 -18
- package/src/responses/rap.ts +14 -27
- package/dist/common.d.ts +0 -2
- package/dist/common.js +0 -3
- package/dist/common.js.map +0 -1
- package/src/common.ts +0 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: 'Test'
|
|
2
|
+
description: 'Test the library'
|
|
3
|
+
runs:
|
|
4
|
+
using: 'composite'
|
|
5
|
+
steps:
|
|
6
|
+
- name: Checkout
|
|
7
|
+
uses: actions/checkout@v4
|
|
8
|
+
with:
|
|
9
|
+
fetch-depth: 0
|
|
10
|
+
- name: Setup Node.js
|
|
11
|
+
uses: actions/setup-node@v4
|
|
12
|
+
with:
|
|
13
|
+
node-version: "lts/*"
|
|
14
|
+
- name: Install dependencies
|
|
15
|
+
shell: bash
|
|
16
|
+
run: |
|
|
17
|
+
npm install -g npm@latest
|
|
18
|
+
npm ci
|
|
19
|
+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
|
|
20
|
+
shell: bash
|
|
21
|
+
run: npm audit signatures
|
|
22
|
+
- name: Test
|
|
23
|
+
shell: bash
|
|
24
|
+
run: npm run test
|
|
25
|
+
- name: Compile
|
|
26
|
+
shell: bash
|
|
27
|
+
run: npm run build
|
|
@@ -20,20 +20,8 @@ jobs:
|
|
|
20
20
|
uses: actions/checkout@v4
|
|
21
21
|
with:
|
|
22
22
|
fetch-depth: 0
|
|
23
|
-
- name: Setup Node.js
|
|
24
|
-
uses: actions/setup-node@v4
|
|
25
|
-
with:
|
|
26
|
-
node-version: "lts/*"
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: |
|
|
29
|
-
npm install -g npm@latest
|
|
30
|
-
npm ci
|
|
31
|
-
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
|
|
32
|
-
run: npm audit signatures
|
|
33
23
|
- name: Test
|
|
34
|
-
|
|
35
|
-
- name: Compile
|
|
36
|
-
run: npm run build
|
|
24
|
+
uses: ./.github/actions/test
|
|
37
25
|
- name: Release
|
|
38
26
|
env:
|
|
39
27
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Test on Branch
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- '!main'
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
release:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
- name: Test
|
|
18
|
+
uses: ./.github/actions/test
|
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ export * from "./ps99-api";
|
|
|
2
2
|
export * from "./request-client/common";
|
|
3
3
|
export * from "./request-client/axios";
|
|
4
4
|
export * from "./responses/collections";
|
|
5
|
-
export * from "./common";
|
|
6
5
|
export * from "./responses/clan";
|
|
7
6
|
export * from "./responses/clans";
|
|
8
7
|
export * from "./params/clans";
|
|
9
8
|
export * from "./responses/exists";
|
|
10
9
|
export * from "./responses/rap";
|
|
11
10
|
export * from "./responses/activeClanBattle";
|
|
11
|
+
export * from "./responses/collection";
|
package/dist/index.js
CHANGED
|
@@ -18,11 +18,11 @@ __exportStar(require("./ps99-api"), exports);
|
|
|
18
18
|
__exportStar(require("./request-client/common"), exports);
|
|
19
19
|
__exportStar(require("./request-client/axios"), exports);
|
|
20
20
|
__exportStar(require("./responses/collections"), exports);
|
|
21
|
-
__exportStar(require("./common"), exports);
|
|
22
21
|
__exportStar(require("./responses/clan"), exports);
|
|
23
22
|
__exportStar(require("./responses/clans"), exports);
|
|
24
23
|
__exportStar(require("./params/clans"), exports);
|
|
25
24
|
__exportStar(require("./responses/exists"), exports);
|
|
26
25
|
__exportStar(require("./responses/rap"), exports);
|
|
27
26
|
__exportStar(require("./responses/activeClanBattle"), exports);
|
|
27
|
+
__exportStar(require("./responses/collection"), exports);
|
|
28
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,mDAAiC;AACjC,oDAAkC;AAClC,iDAA+B;AAC/B,qDAAmC;AACnC,kDAAgC;AAChC,+DAA6C;AAC7C,yDAAuC"}
|
package/dist/ps99-api.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { RequestClient } from "./request-client/common";
|
|
3
3
|
import { CollectionsResponseBody } from "./responses/collections";
|
|
4
|
-
import { Collection } from "./
|
|
5
|
-
import { CollectionResponseBody } from "./responses/collection";
|
|
4
|
+
import { Collection, GetCollectionResponse } from "./responses/collection";
|
|
6
5
|
import { ClanResponseBody } from "./responses/clan";
|
|
7
6
|
import { ClansResponseBody } from "./responses/clans";
|
|
8
7
|
import { GetClansParams } from "./params/clans";
|
|
@@ -17,7 +16,7 @@ export declare class PetSimulator99API {
|
|
|
17
16
|
constructor(params?: PetSimulator99APIOptions);
|
|
18
17
|
private request;
|
|
19
18
|
getCollections(): Promise<CollectionsResponseBody>;
|
|
20
|
-
getCollection(collection:
|
|
19
|
+
getCollection<C extends Collection>(collection: C): Promise<GetCollectionResponse<C>>;
|
|
21
20
|
getClans(params?: GetClansParams): Promise<ClansResponseBody>;
|
|
22
21
|
getClan(name: string): Promise<ClanResponseBody>;
|
|
23
22
|
getExists(): Promise<ExistsResponseBody>;
|
package/dist/ps99-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ps99-api.js","sourceRoot":"","sources":["../src/ps99-api.ts"],"names":[],"mappings":";;;AACA,kDAAyD;
|
|
1
|
+
{"version":3,"file":"ps99-api.js","sourceRoot":"","sources":["../src/ps99-api.ts"],"names":[],"mappings":";;;AACA,kDAAyD;AAazD,MAAa,iBAAiB;IACrB,aAAa,CAAgB;IAEpC,YAAY,MAAiC;QAC3C,IAAI,CAAC,aAAa;YAChB,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa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OAAO,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,OAAO,CAAmB,aAAa,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAqB,aAAa,CAAC,CAAC;IACzD,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,OAAO,CAAkB,UAAU,CAAC,CAAC;IACnD,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,OAAO,CAA+B,uBAAuB,CAAC,CAAC;IAC7E,CAAC;IAED,QAAQ,CAAC,UAAkB;QACzB,IAAI,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;YAC3C,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAO,cAAc,UAAU,EAAE,EAAE;YACpD,YAAY,EAAE,aAAa;YAC3B,gBAAgB,EAAE,QAAQ;SAC3B,CAAC,CAAC;IACL,CAAC;CACF;AAxFD,8CAwFC"}
|
|
@@ -1,32 +1,37 @@
|
|
|
1
|
+
export type ActiveBattleData = {
|
|
2
|
+
_id: string;
|
|
3
|
+
category: string;
|
|
4
|
+
configData: ActiveBattleConfigData;
|
|
5
|
+
configName: string;
|
|
6
|
+
};
|
|
7
|
+
export type ActiveBattleConfigData = {
|
|
8
|
+
FinishTime: number;
|
|
9
|
+
PlacementRewards: ActiveBattlePlacementReward[];
|
|
10
|
+
Rewards: ActiveBattleRewards;
|
|
11
|
+
StartTime: number;
|
|
12
|
+
Title: string;
|
|
13
|
+
_id: string;
|
|
14
|
+
_script: any;
|
|
15
|
+
};
|
|
16
|
+
export type ActiveBattlePlacementReward = {
|
|
17
|
+
Best: number;
|
|
18
|
+
Item: ActiveBattleItem;
|
|
19
|
+
Worst: number;
|
|
20
|
+
};
|
|
21
|
+
export type ActiveBattleItem = {
|
|
22
|
+
_data: ActiveBattleItemData;
|
|
23
|
+
};
|
|
24
|
+
export type ActiveBattleItemData = {
|
|
25
|
+
id: string;
|
|
26
|
+
pt?: number;
|
|
27
|
+
};
|
|
28
|
+
export type ActiveBattleRewards = {
|
|
29
|
+
Bronze: any[];
|
|
30
|
+
Gold: any[];
|
|
31
|
+
Good: any[];
|
|
32
|
+
Silver: any[];
|
|
33
|
+
};
|
|
1
34
|
export type ActiveClanBattleResponseBody = {
|
|
2
35
|
status: string;
|
|
3
|
-
data:
|
|
4
|
-
_id: string;
|
|
5
|
-
configName: string;
|
|
6
|
-
category: string;
|
|
7
|
-
configData: {
|
|
8
|
-
_script: {};
|
|
9
|
-
FinishTime: number;
|
|
10
|
-
Title: string;
|
|
11
|
-
_id: string;
|
|
12
|
-
StartTime: number;
|
|
13
|
-
Rewards: {
|
|
14
|
-
Bronze: {
|
|
15
|
-
_data: {
|
|
16
|
-
id: string;
|
|
17
|
-
};
|
|
18
|
-
}[];
|
|
19
|
-
Silver: {
|
|
20
|
-
_data: {
|
|
21
|
-
id: string;
|
|
22
|
-
};
|
|
23
|
-
}[];
|
|
24
|
-
Gold: {
|
|
25
|
-
_data: {
|
|
26
|
-
id: string;
|
|
27
|
-
};
|
|
28
|
-
}[];
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
36
|
+
data: ActiveBattleData;
|
|
32
37
|
};
|
package/dist/responses/clan.d.ts
CHANGED
|
@@ -1,90 +1,83 @@
|
|
|
1
1
|
export type ClanResponseBody = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}[];
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
CountryCode: string;
|
|
87
|
-
BronzeMedals: number;
|
|
88
|
-
LastKickTimestamp: number;
|
|
89
|
-
};
|
|
2
|
+
Battles: Battles;
|
|
3
|
+
BronzeMedals: number;
|
|
4
|
+
CountryCode: string;
|
|
5
|
+
Created: number;
|
|
6
|
+
DepositedDiamonds: number;
|
|
7
|
+
Desc: string;
|
|
8
|
+
DiamondContributions: DiamondContributions;
|
|
9
|
+
GoodMedals: number;
|
|
10
|
+
GuildLevel: number;
|
|
11
|
+
Icon: string;
|
|
12
|
+
LastKickTimestamp: number;
|
|
13
|
+
MemberCapacity: number;
|
|
14
|
+
Members: Member[];
|
|
15
|
+
Name: string;
|
|
16
|
+
OfficerCapacity: number;
|
|
17
|
+
Owner: number;
|
|
18
|
+
SilverMedals: number;
|
|
19
|
+
Status: string;
|
|
20
|
+
StatusTimestamp: number;
|
|
21
|
+
StatusUsername: string;
|
|
22
|
+
};
|
|
23
|
+
export type Battles = {
|
|
24
|
+
[key: string]: PointsBattle | GoalBattle;
|
|
25
|
+
};
|
|
26
|
+
export type PointsBattle = {
|
|
27
|
+
AwardUserIDs: number[];
|
|
28
|
+
BattleID: string;
|
|
29
|
+
EarnedMedal?: string;
|
|
30
|
+
Place?: number;
|
|
31
|
+
PointContributions: PointContribution[];
|
|
32
|
+
Points: number;
|
|
33
|
+
ProcessedAwards: boolean;
|
|
34
|
+
};
|
|
35
|
+
export type PointContribution = {
|
|
36
|
+
Points: number;
|
|
37
|
+
UserID: number;
|
|
38
|
+
};
|
|
39
|
+
export type GoalBattle = {
|
|
40
|
+
AwardUserIDs: any[];
|
|
41
|
+
BattleID: string;
|
|
42
|
+
EarnedMedal?: string;
|
|
43
|
+
Goals: Goal[];
|
|
44
|
+
Place?: number;
|
|
45
|
+
PointContributions: PointContribution[];
|
|
46
|
+
Points: number;
|
|
47
|
+
ProcessedAwards: boolean;
|
|
48
|
+
};
|
|
49
|
+
export type Goal = {
|
|
50
|
+
Amount: number;
|
|
51
|
+
Contributions: Contributions;
|
|
52
|
+
Progress: number;
|
|
53
|
+
Stars: number;
|
|
54
|
+
Tier: number;
|
|
55
|
+
Type: number;
|
|
56
|
+
};
|
|
57
|
+
export type Contributions = {
|
|
58
|
+
[key: string]: number;
|
|
59
|
+
};
|
|
60
|
+
export type HackerBattle = {
|
|
61
|
+
AwardUserIDs: any[];
|
|
62
|
+
BattleID: string;
|
|
63
|
+
Place: number;
|
|
64
|
+
PointContributions: PointContribution[];
|
|
65
|
+
Points: number;
|
|
66
|
+
ProcessedAwards: boolean;
|
|
67
|
+
};
|
|
68
|
+
export type DiamondContributions = {
|
|
69
|
+
AllTime: AllTime;
|
|
70
|
+
};
|
|
71
|
+
export type AllTime = {
|
|
72
|
+
Data: Daum[];
|
|
73
|
+
Sum: number;
|
|
74
|
+
};
|
|
75
|
+
export type Daum = {
|
|
76
|
+
Diamonds: number;
|
|
77
|
+
UserID: number;
|
|
78
|
+
};
|
|
79
|
+
export type Member = {
|
|
80
|
+
JoinTime: number;
|
|
81
|
+
PermissionLevel: number;
|
|
82
|
+
UserID: number;
|
|
90
83
|
};
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
export type ClansData = {
|
|
2
|
+
CountryCode: string;
|
|
3
|
+
Created: number;
|
|
4
|
+
DepositedDiamonds: number;
|
|
5
|
+
Icon: string;
|
|
6
|
+
MemberCapacity: number;
|
|
7
|
+
Members: number;
|
|
8
|
+
Name: string;
|
|
9
|
+
Points: number;
|
|
10
|
+
};
|
|
2
11
|
export type ClansResponseBody = {
|
|
3
12
|
status: string;
|
|
4
|
-
data:
|
|
5
|
-
Created: number;
|
|
6
|
-
Name: string;
|
|
7
|
-
MemberCapacity: number;
|
|
8
|
-
DepositedDiamonds: number;
|
|
9
|
-
CountryCode: string;
|
|
10
|
-
Members: number;
|
|
11
|
-
Points: number;
|
|
12
|
-
} | {
|
|
13
|
-
Created: number;
|
|
14
|
-
Name: ClanName;
|
|
15
|
-
CountryCode: string;
|
|
16
|
-
MemberCapacity: number;
|
|
17
|
-
DepositedDiamonds: number;
|
|
18
|
-
Members: number;
|
|
19
|
-
Points: number;
|
|
20
|
-
})[];
|
|
13
|
+
data: ClansData[];
|
|
21
14
|
};
|