ps99-api 1.0.0 → 1.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.
Files changed (45) hide show
  1. package/.github/workflows/release-on-main.yml +19 -7
  2. package/dist/common.d.ts +2 -0
  3. package/dist/common.js +1 -0
  4. package/dist/common.js.map +1 -0
  5. package/dist/index.d.ts +11 -0
  6. package/dist/index.js +11 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/params/clans.d.ts +8 -0
  9. package/dist/params/clans.js +1 -0
  10. package/dist/params/clans.js.map +1 -0
  11. package/dist/ps99-api.d.ts +27 -0
  12. package/dist/ps99-api.js +1 -0
  13. package/dist/ps99-api.js.map +1 -0
  14. package/dist/request-client/axios.d.ts +3 -0
  15. package/dist/request-client/axios.js +1 -0
  16. package/dist/request-client/axios.js.map +1 -0
  17. package/dist/request-client/common.d.ts +18 -0
  18. package/dist/request-client/common.js +1 -0
  19. package/dist/request-client/common.js.map +1 -0
  20. package/dist/responses/activeClanBattle.d.ts +32 -0
  21. package/dist/responses/activeClanBattle.js +1 -0
  22. package/dist/responses/activeClanBattle.js.map +1 -0
  23. package/dist/responses/clan.d.ts +90 -0
  24. package/dist/responses/clan.js +1 -0
  25. package/dist/responses/clan.js.map +1 -0
  26. package/dist/responses/clans.d.ts +21 -0
  27. package/dist/responses/clans.js +1 -0
  28. package/dist/responses/clans.js.map +1 -0
  29. package/dist/responses/collection.d.ts +1242 -0
  30. package/dist/responses/collection.js +1 -0
  31. package/dist/responses/collection.js.map +1 -0
  32. package/dist/responses/collections.d.ts +5 -0
  33. package/dist/responses/collections.js +1 -0
  34. package/dist/responses/collections.js.map +1 -0
  35. package/dist/responses/exists.d.ts +32 -0
  36. package/dist/responses/exists.js +1 -0
  37. package/dist/responses/exists.js.map +1 -0
  38. package/dist/responses/rap.d.ts +39 -0
  39. package/dist/responses/rap.js +1 -0
  40. package/dist/responses/rap.js.map +1 -0
  41. package/package.json +3 -3
  42. package/src/index.ts +10 -0
  43. package/tsconfig.json +5 -2
  44. package/dist/__tests__/ps99-api.js +0 -150
  45. package/tsconfig.build.json +0 -10
@@ -16,14 +16,26 @@ jobs:
16
16
  release:
17
17
  runs-on: ubuntu-latest
18
18
  steps:
19
- - uses: actions/checkout@v4
20
- - uses: actions/setup-node@v4
19
+ - name: Checkout
20
+ uses: actions/checkout@v4
21
21
  with:
22
- node-version: 20
23
- - run: npm ci
24
- - run: npm run test
25
- - run: npm run build
26
- - env:
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
+ - name: Test
34
+ run: npm run test
35
+ - name: Compile
36
+ run: npm run build
37
+ - name: Release
38
+ env:
27
39
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28
40
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29
41
  run: npx semantic-release
@@ -0,0 +1,2 @@
1
+ export type Collection<T = string> = T;
2
+ export type ClanName = string;
package/dist/common.js CHANGED
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ export * from "./ps99-api";
2
+ export * from "./request-client/common";
3
+ export * from "./request-client/axios";
4
+ export * from "./responses/collections";
5
+ export * from "./common";
6
+ export * from "./responses/clan";
7
+ export * from "./responses/clans";
8
+ export * from "./params/clans";
9
+ export * from "./responses/exists";
10
+ export * from "./responses/rap";
11
+ export * from "./responses/activeClanBattle";
package/dist/index.js CHANGED
@@ -15,3 +15,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ps99-api"), exports);
18
+ __exportStar(require("./request-client/common"), exports);
19
+ __exportStar(require("./request-client/axios"), exports);
20
+ __exportStar(require("./responses/collections"), exports);
21
+ __exportStar(require("./common"), exports);
22
+ __exportStar(require("./responses/clan"), exports);
23
+ __exportStar(require("./responses/clans"), exports);
24
+ __exportStar(require("./params/clans"), exports);
25
+ __exportStar(require("./responses/exists"), exports);
26
+ __exportStar(require("./responses/rap"), exports);
27
+ __exportStar(require("./responses/activeClanBattle"), exports);
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,2CAAyB;AACzB,mDAAiC;AACjC,oDAAkC;AAClC,iDAA+B;AAC/B,qDAAmC;AACnC,kDAAgC;AAChC,+DAA6C"}
@@ -0,0 +1,8 @@
1
+ export type ClansSort = "DepositedDiamonds" | "Points" | "Created";
2
+ export type SortOrder = "asc" | "desc";
3
+ export type GetClansParams = {
4
+ page?: number;
5
+ pageSize?: number;
6
+ sort?: ClansSort;
7
+ sortOrder?: SortOrder;
8
+ };
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=clans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clans.js","sourceRoot":"","sources":["../../src/params/clans.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ /// <reference types="node" />
2
+ import { RequestClient } from "./request-client/common";
3
+ import { CollectionsResponseBody } from "./responses/collections";
4
+ import { Collection } from "./common";
5
+ import { CollectionResponseBody } from "./responses/collection";
6
+ import { ClanResponseBody } from "./responses/clan";
7
+ import { ClansResponseBody } from "./responses/clans";
8
+ import { GetClansParams } from "./params/clans";
9
+ import { ExistsResponseBody } from "./responses/exists";
10
+ import { RAPResponseBody } from "./responses/rap";
11
+ import { ActiveClanBattleResponseBody } from "./responses/activeClanBattle";
12
+ export type PetSimulator99APIOptions = {
13
+ requestClient?: RequestClient;
14
+ };
15
+ export declare class PetSimulator99API {
16
+ requestClient: RequestClient;
17
+ constructor(params?: PetSimulator99APIOptions);
18
+ private request;
19
+ getCollections(): Promise<CollectionsResponseBody>;
20
+ getCollection(collection: Collection): Promise<CollectionResponseBody>;
21
+ getClans(params?: GetClansParams): Promise<ClansResponseBody>;
22
+ getClan(name: string): Promise<ClanResponseBody>;
23
+ getExists(): Promise<ExistsResponseBody>;
24
+ getRAP(): Promise<RAPResponseBody>;
25
+ getActiveClanBattle(): Promise<ActiveClanBattleResponseBody>;
26
+ getImage(rbxassetid: string): Promise<Blob>;
27
+ }
package/dist/ps99-api.js CHANGED
@@ -69,3 +69,4 @@ class PetSimulator99API {
69
69
  }
70
70
  }
71
71
  exports.PetSimulator99API = PetSimulator99API;
72
+ //# sourceMappingURL=ps99-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ps99-api.js","sourceRoot":"","sources":["../src/ps99-api.ts"],"names":[],"mappings":";;;AACA,kDAAyD;AAczD,MAAa,iBAAiB;IACrB,aAAa,CAAgB;IAEpC,YAAY,MAAiC;QAC3C,IAAI,CAAC,aAAa;YAChB,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAA,uBAAe,GAAE,CAAC;IAC9E,CAAC;IAEO,OAAO,CACb,IAAY,EACZ,EACE,MAAM,EACN,YAAY,EACZ,gBAAgB,MAKd;QACF,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,MAAM;QACpB,gBAAgB,EAAE,MAAM;KACzB;QAED,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QACtB,YAAY,GAAG,YAAY,IAAI,MAAM,CAAC;QACtC,gBAAgB,GA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AuB,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"}
@@ -0,0 +1,3 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { RequestClient } from "./common";
3
+ export declare function getAxiosRequest(instance?: AxiosInstance): RequestClient;
@@ -26,3 +26,4 @@ exports.getAxiosRequest = getAxiosRequest;
26
26
  function isAxiosError(err) {
27
27
  return Object.prototype.hasOwnProperty.call(err, "isAxiosError");
28
28
  }
29
+ //# sourceMappingURL=axios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axios.js","sourceRoot":"","sources":["../../src/request-client/axios.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyD;AAGzD,SAAgB,eAAe,CAAC,QAAwB;IACtD,OAAO;QACL,KAAK,CAAC,IAAI,CAAI,OAAyB;YACrC,IAAI,CAAC;gBACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,eAAK,EAAC,OAAO,CAAC,CAAC,CAAC;gBAEvE,OAAO,IAAS,CAAC;YACnB,CAAC;YAAC,OAAO,CAAU,EAAE,CAAC;gBACpB,IAAI,YAAY,CAAuB,CAAC,CAAC,EAAE,CAAC;oBAC1C,MAAM,OAAO,GAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC;oBAChE,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC,CAAC;gBAClE,CAAC;gBAED,MAAM,CAAC,CAAC;YACV,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAjBD,0CAiBC;AAED,SAAS,YAAY,CACnB,GAAoC;IAEpC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;AACnE,CAAC"}
@@ -0,0 +1,18 @@
1
+ export type ApiRequestParams = {
2
+ method: "GET" | "POST" | "DELETE" | "PATCH";
3
+ url: string;
4
+ params?: {
5
+ [key: string]: any;
6
+ };
7
+ data?: {
8
+ [key: string]: any;
9
+ };
10
+ headers?: {
11
+ [key: string]: any;
12
+ };
13
+ responseType?: "json" | "arraybuffer";
14
+ responseEncoding?: "utf8" | "BINARY";
15
+ };
16
+ export type RequestClient = {
17
+ send<T>(options: ApiRequestParams): Promise<T>;
18
+ };
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/request-client/common.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ export type ActiveClanBattleResponseBody = {
2
+ 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
+ };
32
+ };
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=activeClanBattle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activeClanBattle.js","sourceRoot":"","sources":["../../src/responses/activeClanBattle.ts"],"names":[],"mappings":""}
@@ -0,0 +1,90 @@
1
+ export type ClanResponseBody = {
2
+ status: string;
3
+ data: {
4
+ Created: number;
5
+ Owner: number;
6
+ Name: string;
7
+ Icon: string;
8
+ Desc: string;
9
+ MemberCapacity: number;
10
+ OfficerCapacity: number;
11
+ GuildLevel: number;
12
+ Members: {
13
+ UserID: number;
14
+ PermissionLevel: number;
15
+ JoinTime: number;
16
+ }[];
17
+ DepositedDiamonds: number;
18
+ DiamondContributions: {
19
+ AllTime: {
20
+ Sum: number;
21
+ Data: {
22
+ UserID: number;
23
+ Diamonds: number;
24
+ }[];
25
+ };
26
+ };
27
+ Status: string;
28
+ StatusTimestamp: number;
29
+ StatusUsername: string;
30
+ Battles: {
31
+ Christmas2023: {
32
+ ProcessedAwards: boolean;
33
+ AwardUserIDs: number[];
34
+ BattleID: string;
35
+ Points: number;
36
+ PointContributions: {
37
+ UserID: number;
38
+ Points: number;
39
+ }[];
40
+ EarnedMedal: string;
41
+ };
42
+ DecemberActiveHugePets: {
43
+ ProcessedAwards: boolean;
44
+ AwardUserIDs: number[];
45
+ BattleID: string;
46
+ Points: number;
47
+ PointContributions: {
48
+ UserID: number;
49
+ Points: number;
50
+ }[];
51
+ EarnedMedal: string;
52
+ };
53
+ IndexBattle: {
54
+ ProcessedAwards: boolean;
55
+ AwardUserIDs: number[];
56
+ BattleID: string;
57
+ Points: number;
58
+ PointContributions: {
59
+ UserID: number;
60
+ Points: number;
61
+ }[];
62
+ EarnedMedal: string;
63
+ };
64
+ AchBattle: {
65
+ ProcessedAwards: boolean;
66
+ AwardUserIDs: number[];
67
+ BattleID: string;
68
+ Points: number;
69
+ PointContributions: {
70
+ UserID: number;
71
+ Points: number;
72
+ }[];
73
+ EarnedMedal: string;
74
+ };
75
+ RaidBattle: {
76
+ ProcessedAwards: boolean;
77
+ AwardUserIDs: any[];
78
+ BattleID: string;
79
+ Points: number;
80
+ PointContributions: {
81
+ UserID: number;
82
+ Points: number;
83
+ }[];
84
+ };
85
+ };
86
+ CountryCode: string;
87
+ BronzeMedals: number;
88
+ LastKickTimestamp: number;
89
+ };
90
+ };
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=clan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clan.js","sourceRoot":"","sources":["../../src/responses/clan.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { ClanName } from "../common";
2
+ export type ClansResponseBody = {
3
+ 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
+ })[];
21
+ };
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=clans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clans.js","sourceRoot":"","sources":["../../src/responses/clans.ts"],"names":[],"mappings":""}