@na-ji/pogo-protos 2.59.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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 niico
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # pogo-protos [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate/?hosted_button_id=WXA874KBC7RNN)
2
+ Uses [protobuf.js](https://github.com/dcodeIO/protobuf.js) to compile the Protobuf files from
3
+ [POGOProtos](https://github.com/Furtif/POGOProtos) into an easy to use Node module.
4
+
5
+ [![Test Build](https://github.com/Furtif/pogo-protos/actions/workflows/test.yml/badge.svg)](https://github.com/Furtif/pogo-protos/actions)
6
+ ![license](https://img.shields.io/npm/l/pogo-protos.svg)
7
+
8
+
9
+ ## How to use
10
+ ```javascript
11
+ const POGOProtos = require('pogo-protos');
12
+
13
+ const nbPokemon = Object.keys(POGOProtos.Rpc.HoloPokemonId).length -1;
14
+ console.log(`We have ${nbPokemon} pokemons in protos.`);
15
+ const nbCostumes = Object.keys(POGOProtos.Rpc.PokemonDisplayProto.Costume).length -1;
16
+ console.log(`We have ${nbCostumes} costumes in protos.`);
17
+ const nbForms = Object.keys(POGOProtos.Rpc.PokemonDisplayProto.Form).length -1;
18
+ console.log(`We have ${nbForms} forms in protos.`);
19
+ const nbBadges = Object.keys(POGOProtos.Rpc.HoloBadgeType).length -1;
20
+ console.log(`We have ${nbBadges} badges in protos.`);
21
+ const nbMoves = Object.keys(POGOProtos.Rpc.HoloPokemonMove).length -1;
22
+ console.log(`We have ${nbMoves} moves in protos.`);
23
+ const nbItems = Object.keys(POGOProtos.Rpc.Item).length -1;
24
+ console.log(`We have ${nbItems} items in protos.`);
25
+ const nbMethodRequests = Object.keys(POGOProtos.Rpc.Method).length -1;
26
+ console.log(`We have ${nbMethodRequests} method requests in protos.`);
27
+ const nbSocialRequests = Object.keys(POGOProtos.Rpc.SocialAction).length -1;
28
+ console.log(`We have ${nbSocialRequests} social requests in protos.`);
29
+ const nbPlatformRequests = Object.keys(POGOProtos.Rpc.ClientAction).length -1;
30
+ console.log(`We have ${nbPlatformRequests} platform requests in protos.`);
31
+ const nbGameActionClientRequests = Object.keys(POGOProtos.Rpc.GameActionClient).length -1;
32
+ console.log(`We have ${nbGameActionClientRequests} game action client requests in protos.`);
33
+ const nbGameActionRequests = Object.keys(POGOProtos.Rpc.GameAction).length -1;
34
+ console.log(`We have ${nbGameActionRequests} game action requests in protos.`);
35
+ const nbGameAdventureSyncRequests = Object.keys(POGOProtos.Rpc.GameAdventureSyncAction).length -1;
36
+ console.log(`We have ${nbGameAdventureSyncRequests} game adventure sync requests in protos.`);
37
+ const nbPGameOthersRequests = Object.keys(POGOProtos.Rpc.GameOthersAction).length -1;
38
+ console.log(`We have ${nbPGameOthersRequests} game others requests in protos.`);
39
+ const nbPlayerSubmissionsRequests = Object.keys(POGOProtos.Rpc.PlayerSubmissionAction).length -1;
40
+ console.log(`We have ${nbPlayerSubmissionsRequests} Player Submissions requests in protos.`);
41
+ const nbGamefitnessRequests = Object.keys(POGOProtos.Rpc.GameFitnessAction).length -1;
42
+ console.log(`We have ${nbGamefitnessRequests} game fitness requests in protos.`);
43
+
44
+ // Count of all req's
45
+ const all_in_one = nbMethodRequests
46
+ + nbSocialRequests
47
+ + nbPlatformRequests
48
+ + nbGameActionClientRequests
49
+ + nbGameActionRequests
50
+ + nbGameAdventureSyncRequests
51
+ + nbPGameOthersRequests
52
+ + nbPlayerSubmissionsRequests
53
+ + nbGamefitnessRequests;
54
+
55
+ console.log(`We have ${all_in_one} (GLOBAL) multi method requests in protos.\n`);
56
+
57
+ var myMessage = POGOProtos.Rpc.RecycleItemProto.fromObject({
58
+ item: POGOProtos.Rpc.Item.ITEM_POTION,
59
+ count: 50
60
+ });
61
+
62
+ var encoded = POGOProtos.Rpc.RecycleItemProto.encode(myMessage).finish();
63
+ var decodedAgain = POGOProtos.Rpc.RecycleItemProto.decode(encoded);
64
+ console.log('Test encode/decode:\nItem: ' + decodedAgain.item + ' count: ' + decodedAgain.count);
65
+
66
+ // will print:
67
+ // We have x pokemons in protos.
68
+ // We have x costumes in protos.
69
+ // We have x forms in protos.
70
+ // We have x badges in protos.
71
+ // We have x moves in protos.
72
+ // We have x items in protos.
73
+ // We have x method requests in protos.
74
+ // We have x social requests in protos.
75
+ // We have x platform requests in protos.
76
+ // We have x game action client requests in protos.
77
+ // We have x game action requests in protos.
78
+ // We have x game adventure sync requests in protos.
79
+ // We have x game others requests in protos.
80
+ // We have x Player Submissions requests in protos.
81
+ // We have x game fitness requests in protos.
82
+ // We have x (GLOBAL) multi method requests in protos.
83
+
84
+ //Test encode/decode:
85
+ //Item: 101 count: 50
86
+ ```
87
+
88
+ For more details see the [protobuf.js documentation](https://github.com/dcodeIO/protobuf.js/wiki).
89
+
90
+ ## Usage with TypeScript
91
+ TypeScript definitions are included. Modern IDE should use them automatically.