eve_online 0.30.0 → 0.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +18 -54
  3. data/.deepsource.toml +5 -0
  4. data/.ruby-version +1 -1
  5. data/Appraisals +0 -12
  6. data/CHANGELOG.md +58 -0
  7. data/Gemfile.lock +57 -53
  8. data/Gemfile.mutant.lock +49 -50
  9. data/README.md +401 -133
  10. data/eve_online.gemspec +3 -3
  11. data/lib/eve_online.rb +40 -7
  12. data/lib/eve_online/esi/alliance_corporations.rb +1 -1
  13. data/lib/eve_online/esi/alliances.rb +1 -1
  14. data/lib/eve_online/esi/base.rb +15 -6
  15. data/lib/eve_online/esi/character_assets.rb +1 -1
  16. data/lib/eve_online/esi/character_calendar.rb +1 -1
  17. data/lib/eve_online/esi/character_calendar_event.rb +1 -1
  18. data/lib/eve_online/esi/{character_bookmarks.rb → character_contracts.rb} +7 -7
  19. data/lib/eve_online/esi/character_get_mail.rb +37 -0
  20. data/lib/eve_online/esi/character_location.rb +1 -1
  21. data/lib/eve_online/esi/character_mail_labels.rb +40 -0
  22. data/lib/eve_online/esi/character_online.rb +1 -1
  23. data/lib/eve_online/esi/character_ship.rb +1 -1
  24. data/lib/eve_online/esi/character_skills.rb +1 -1
  25. data/lib/eve_online/esi/character_wallet.rb +1 -1
  26. data/lib/eve_online/esi/character_wallet_journal.rb +2 -2
  27. data/lib/eve_online/esi/character_wallet_transactions.rb +41 -0
  28. data/lib/eve_online/esi/corporation_assets.rb +1 -1
  29. data/lib/eve_online/esi/corporation_npc.rb +20 -0
  30. data/lib/eve_online/esi/killmail.rb +30 -0
  31. data/lib/eve_online/esi/market_prices.rb +27 -0
  32. data/lib/eve_online/esi/models/aggressor.rb +1 -1
  33. data/lib/eve_online/esi/models/alliance.rb +1 -1
  34. data/lib/eve_online/esi/models/alliance_icon.rb +1 -1
  35. data/lib/eve_online/esi/models/alliance_short.rb +1 -1
  36. data/lib/eve_online/esi/models/ally.rb +1 -1
  37. data/lib/eve_online/esi/models/ancestry.rb +1 -1
  38. data/lib/eve_online/esi/models/asset.rb +1 -1
  39. data/lib/eve_online/esi/models/asset_location.rb +1 -1
  40. data/lib/eve_online/esi/models/asset_name.rb +1 -1
  41. data/lib/eve_online/esi/models/asteroid_belt.rb +1 -1
  42. data/lib/eve_online/esi/models/attributes.rb +1 -1
  43. data/lib/eve_online/esi/models/bloodline.rb +1 -1
  44. data/lib/eve_online/esi/models/blueprint.rb +1 -1
  45. data/lib/eve_online/esi/models/category.rb +1 -1
  46. data/lib/eve_online/esi/models/character.rb +1 -1
  47. data/lib/eve_online/esi/models/character_corporation_history.rb +1 -1
  48. data/lib/eve_online/esi/models/character_industry_job.rb +1 -1
  49. data/lib/eve_online/esi/models/character_location.rb +1 -1
  50. data/lib/eve_online/esi/models/character_order.rb +1 -1
  51. data/lib/eve_online/esi/models/character_portrait.rb +1 -1
  52. data/lib/eve_online/esi/models/character_ship.rb +1 -1
  53. data/lib/eve_online/esi/models/constellation.rb +1 -1
  54. data/lib/eve_online/esi/models/contract.rb +132 -0
  55. data/lib/eve_online/esi/models/coordinates.rb +1 -1
  56. data/lib/eve_online/esi/models/corporation.rb +1 -1
  57. data/lib/eve_online/esi/models/corporation_alliance_history.rb +1 -1
  58. data/lib/eve_online/esi/models/corporation_industry_job.rb +1 -1
  59. data/lib/eve_online/esi/models/corporation_order.rb +1 -1
  60. data/lib/eve_online/esi/models/defender.rb +1 -1
  61. data/lib/eve_online/esi/models/dogma_attribute.rb +1 -1
  62. data/lib/eve_online/esi/models/dogma_attribute_short.rb +1 -1
  63. data/lib/eve_online/esi/models/dogma_effect.rb +1 -1
  64. data/lib/eve_online/esi/models/dogma_effect_modifier.rb +1 -1
  65. data/lib/eve_online/esi/models/dogma_effect_short.rb +1 -1
  66. data/lib/eve_online/esi/models/event.rb +1 -1
  67. data/lib/eve_online/esi/models/event_details.rb +1 -1
  68. data/lib/eve_online/esi/models/faction.rb +1 -1
  69. data/lib/eve_online/esi/models/fatigue.rb +1 -1
  70. data/lib/eve_online/esi/models/graphic.rb +1 -1
  71. data/lib/eve_online/esi/models/group.rb +1 -1
  72. data/lib/eve_online/esi/models/home_location.rb +1 -1
  73. data/lib/eve_online/esi/models/jump_clone.rb +1 -1
  74. data/lib/eve_online/esi/models/killmail.rb +47 -0
  75. data/lib/eve_online/esi/models/killmail_short.rb +1 -1
  76. data/lib/eve_online/esi/models/loyalty_point.rb +1 -1
  77. data/lib/eve_online/esi/models/loyalty_store_offer.rb +1 -1
  78. data/lib/eve_online/esi/models/mail.rb +49 -0
  79. data/lib/eve_online/esi/models/mail_label.rb +34 -0
  80. data/lib/eve_online/esi/models/mail_recipient.rb +24 -0
  81. data/lib/eve_online/esi/models/mail_recipients.rb +21 -0
  82. data/lib/eve_online/esi/models/market_group.rb +1 -1
  83. data/lib/eve_online/esi/models/market_history.rb +1 -1
  84. data/lib/eve_online/esi/models/market_price.rb +29 -0
  85. data/lib/eve_online/esi/models/moon.rb +1 -1
  86. data/lib/eve_online/esi/models/notification.rb +1 -1
  87. data/lib/eve_online/esi/models/offer_required_item.rb +1 -1
  88. data/lib/eve_online/esi/models/online.rb +1 -1
  89. data/lib/eve_online/esi/models/planet.rb +1 -1
  90. data/lib/eve_online/esi/models/planet_short.rb +1 -1
  91. data/lib/eve_online/esi/models/position.rb +1 -1
  92. data/lib/eve_online/esi/models/public_contract.rb +98 -0
  93. data/lib/eve_online/esi/models/public_contract_item.rb +59 -0
  94. data/lib/eve_online/esi/models/race.rb +3 -3
  95. data/lib/eve_online/esi/models/region.rb +5 -6
  96. data/lib/eve_online/esi/models/server_status.rb +1 -1
  97. data/lib/eve_online/esi/models/skill.rb +1 -1
  98. data/lib/eve_online/esi/models/skill_queue_entry.rb +1 -1
  99. data/lib/eve_online/esi/models/standing.rb +1 -1
  100. data/lib/eve_online/esi/models/star.rb +1 -1
  101. data/lib/eve_online/esi/models/stargate.rb +8 -2
  102. data/lib/eve_online/esi/models/station.rb +1 -1
  103. data/lib/eve_online/esi/models/system.rb +1 -1
  104. data/lib/eve_online/esi/models/system_jump.rb +1 -1
  105. data/lib/eve_online/esi/models/system_kill.rb +1 -1
  106. data/lib/eve_online/esi/models/type.rb +1 -1
  107. data/lib/eve_online/esi/models/{wallet_journal_entry.rb → wallet_journal.rb} +4 -4
  108. data/lib/eve_online/esi/models/wallet_transaction.rb +66 -0
  109. data/lib/eve_online/esi/models/war.rb +1 -1
  110. data/lib/eve_online/esi/public_contract.rb +40 -0
  111. data/lib/eve_online/esi/public_contracts.rb +40 -0
  112. data/lib/eve_online/esi/universe_region.rb +2 -2
  113. data/lib/eve_online/esi/universe_stargate.rb +1 -1
  114. data/lib/eve_online/exceptions/error_limited.rb +8 -0
  115. data/lib/eve_online/formulas/blueprint_copy_time.rb +47 -0
  116. data/lib/eve_online/version.rb +1 -1
  117. metadata +32 -15
  118. data/lib/eve_online/esi/character_bookmark_folders.rb +0 -41
  119. data/lib/eve_online/esi/models/bookmark.rb +0 -71
  120. data/lib/eve_online/esi/models/bookmark_folder.rb +0 -24
  121. data/lib/eve_online/esi/models/stargate_destination.rb +0 -24
data/README.md CHANGED
@@ -3,8 +3,9 @@
3
3
  [![CircleCI](https://circleci.com/gh/evemonk/eve_online.svg?style=svg)](https://circleci.com/gh/evemonk/eve_online)
4
4
  [![Gem Version](https://badge.fury.io/rb/eve_online.svg)](https://badge.fury.io/rb/eve_online)
5
5
  [![Gem Downloads](https://img.shields.io/gem/dt/eve_online.svg)](https://rubygems.org/gems/eve_online)
6
- [![Test Coverage](https://api.codeclimate.com/v1/badges/955073c905b91d53e68c/test_coverage)](https://codeclimate.com/github/evemonk/eve_online/test_coverage)
6
+ [![Known Vulnerabilities](https://snyk.io/test/github/evemonk/eve_online/badge.svg)](https://snyk.io/test/github/evemonk/eve_online)
7
7
  [![security](https://hakiri.io/github/evemonk/eve_online/master.svg)](https://hakiri.io/github/evemonk/eve_online/master)
8
+ [![DeepSource](https://static.deepsource.io/deepsource-badge-light-mini.svg)](https://deepsource.io/gh/evemonk/eve_online/?ref=repository-badge)
8
9
 
9
10
  This gem implement Ruby API for EveOnline MMORPG (ESI).
10
11
 
@@ -48,16 +49,13 @@ gem install eve_online
48
49
 
49
50
  ## Supported ruby versions
50
51
 
51
- * MRI 2.4
52
52
  * MRI 2.5
53
53
  * MRI 2.6
54
- * JRuby 9.2.9.0
54
+ * MRI 2.7
55
+ * JRuby 9.2.11.1
55
56
 
56
57
  ## Supported rails versions
57
58
 
58
- * 4.2
59
- * 5.0
60
- * 5.1
61
59
  * 5.2
62
60
  * 6.0
63
61
  * Edge
@@ -330,74 +328,8 @@ corporation_assets_names.etag # => NotImplementedError
330
328
 
331
329
  #### List bookmarks
332
330
 
333
- ```ruby
334
- options = { token: 'token123', character_id: 90_729_314, page: 1 }
335
-
336
- character_bookmarks = EveOnline::ESI::CharacterBookmarks.new(options)
337
-
338
- character_bookmarks.scope # => "esi-bookmarks.read_character_bookmarks.v1"
339
-
340
- character_bookmarks.page # => 1
341
-
342
- character_bookmarks.total_pages # => 1
343
-
344
- character_bookmarks.bookmarks.size # => 20
345
-
346
- bookmark = character_bookmarks.bookmarks.first
347
-
348
- bookmark.as_json # => {:bookmark_id=>4,
349
- # :created=>Mon, 09 Jul 2012 22:38:31 UTC +00:00,
350
- # :creator_id=>2112625428,
351
- # :folder_id=>5,
352
- # :item_id=>30003496,
353
- # :item_type_id=>5,
354
- # :label=>"Stargate",
355
- # :location_id=>30003430,
356
- # :notes=>"This is a stargate"}
357
-
358
- bookmark.bookmark_id # => 4
359
- bookmark.created # => Mon, 09 Jul 2012 22:38:31 UTC +00:00
360
- bookmark.creator_id # => 2112625428
361
- bookmark.folder_id # => 5
362
- bookmark.item_id # => 30003496
363
- bookmark.item_type_id # => 5
364
- bookmark.label # => "Stargate"
365
- bookmark.location_id # => 30003430
366
- bookmark.notes # => "This is a stargate"
367
-
368
- bookmark.coordinates.as_json # => {:x=>-144951231521.81625,
369
- # :y=>164030047870.25558,
370
- # :z=>211467631848.1311}
371
-
372
- # TODO: character_bookmarks.etag
373
- ```
374
-
375
331
  #### List bookmark folders
376
332
 
377
- ```ruby
378
- options = { token: 'token123', character_id: 90_729_314, page: 1 }
379
-
380
- character_bookmark_folders = EveOnline::ESI::CharacterBookmarkFolders.new(options)
381
-
382
- character_bookmark_folders.scope # => "esi-bookmarks.read_character_bookmarks.v1"
383
-
384
- character_bookmark_folders.page # => 1
385
-
386
- character_bookmark_folders.total_pages # => 1
387
-
388
- character_bookmark_folders.bookmark_folders.size # => 1
389
-
390
- bookmark_folder = character_bookmark_folders.bookmark_folders.first
391
-
392
- bookmark_folder.as_json # => {:folder_id=>5,
393
- # :name=>"Icecream"}
394
-
395
- bookmark_folder.folder_id # => 5
396
- bookmark_folder.name # => "Icecream"
397
-
398
- # TODO: character_bookmark_folders.etag
399
- ```
400
-
401
333
  #### List corporation bookmarks
402
334
 
403
335
  #### List corporation bookmark folders
@@ -644,15 +576,15 @@ character_portrait = EveOnline::ESI::CharacterPortrait.new(options)
644
576
 
645
577
  character_portrait.scope # => nil
646
578
 
647
- character_portrait.as_json # => {:medium=>"http://imageserver.eveonline.com/Character/90729314_128.jpg",
648
- # :large=>"http://imageserver.eveonline.com/Character/90729314_256.jpg",
649
- # :huge=>"http://imageserver.eveonline.com/Character/90729314_512.jpg",
650
- # :small=>"http://imageserver.eveonline.com/Character/90729314_64.jpg"}
579
+ character_portrait.as_json # => {:medium=>"https://images.evetech.net/Character/1337512245_128.jpg",
580
+ # :large=>"https://images.evetech.net/Character/1337512245_256.jpg",
581
+ # :huge=>"https://images.evetech.net/Character/1337512245_512.jpg",
582
+ # :small=>"https://images.evetech.net/Character/1337512245_64.jpg"}
651
583
 
652
- character_portrait.medium # => "http://imageserver.eveonline.com/Character/90729314_128.jpg"
653
- character_portrait.large # => "http://imageserver.eveonline.com/Character/90729314_256.jpg"
654
- character_portrait.huge # => "http://imageserver.eveonline.com/Character/90729314_512.jpg"
655
- character_portrait.small # => "http://imageserver.eveonline.com/Character/90729314_64.jpg"
584
+ character_portrait.medium # => "https://images.evetech.net/Character/1337512245_128.jpg"
585
+ character_portrait.large # => "https://images.evetech.net/Character/1337512245_256.jpg"
586
+ character_portrait.huge # => "https://images.evetech.net/Character/1337512245_512.jpg"
587
+ character_portrait.small # => "https://images.evetech.net/Character/1337512245_64.jpg"
656
588
 
657
589
  character_portrait.etag # => "2c8392581d493e06c015ca3d48d4076079bf4c976b1f776742592260"
658
590
  ```
@@ -766,14 +698,164 @@ character_implants.implant_ids # => [9899, 9941, 9942, 9943, 9956]
766
698
 
767
699
  #### Get contracts
768
700
 
701
+ ```ruby
702
+ options = { token: 'token123', character_id: 1337512245, page: 1 }
703
+
704
+ contracts = EveOnline::ESI::CharacterContracts.new(options)
705
+
706
+ contracts.scope # => "esi-contracts.read_character_contracts.v1"
707
+
708
+ contracts.contracts.size # => 3
709
+
710
+ contract = contracts.contracts.first
711
+
712
+ contract.as_json # => {:acceptor_id=>2116199184,
713
+ # :assignee_id=>2116199184,
714
+ # :availability=>"personal",
715
+ # :buyout=>nil,
716
+ # :collateral=>0.0,
717
+ # :contract_id=>154837125,
718
+ # :date_accepted=>Fri, 06 Mar 2020 21:09:32 UTC +00:00,
719
+ # :date_completed=>Fri, 06 Mar 2020 21:09:32 UTC +00:00,
720
+ # :date_expired=>Sat, 07 Mar 2020 21:09:11 UTC +00:00,
721
+ # :date_issued=>Fri, 06 Mar 2020 21:09:11 UTC +00:00,
722
+ # :days_to_complete=>0,
723
+ # :end_location_id=>60008674,
724
+ # :for_corporation=>false,
725
+ # :issuer_corporation_id=>98134807,
726
+ # :issuer_id=>1337512245,
727
+ # :price=>0.0,
728
+ # :reward=>0.0,
729
+ # :start_location_id=>60008674,
730
+ # :status=>"finished",
731
+ # :title=>"",
732
+ # :type=>"item_exchange",
733
+ # :volume=>15000.0}
734
+
735
+ contract.acceptor_id # => 2116199184
736
+ contract.assignee_id # => 2116199184
737
+ contract.availability # => "personal"
738
+ contract.buyout # => nil
739
+ contract.collateral # => 0.0
740
+ contract.contract_id # => 154837125
741
+ contract.date_accepted # => Fri, 06 Mar 2020 21:09:32 UTC +00:00
742
+ contract.date_completed # => Fri, 06 Mar 2020 21:09:32 UTC +00:00
743
+ contract.date_expired # => Sat, 07 Mar 2020 21:09:11 UTC +00:00
744
+ contract.date_issued # => Fri, 06 Mar 2020 21:09:11 UTC +00:00
745
+ contract.days_to_complete # => 0
746
+ contract.end_location_id # => 60008674
747
+ contract.for_corporation # => false
748
+ contract.issuer_corporation_id # => 98134807
749
+ contract.issuer_id # => 1337512245
750
+ contract.price # => 0.0
751
+ contract.reward # => 0.0
752
+ contract.start_location_id # => 60008674
753
+ contract.status # => "finished"
754
+ contract.title # => ""
755
+ contract.type # => "item_exchange"
756
+ contract.volume # => 15000.0
757
+
758
+ contracts.etag # => "6e18566a8f786f08aba678262360d0c74a783f9923aa43f8043133e4"
759
+ ```
760
+
769
761
  #### Get contract bids
770
762
 
771
763
  #### Get contract items
772
764
 
773
765
  #### Get public contracts
774
766
 
767
+ ```ruby
768
+ options = { region_id: 10_000_043, page: 1 }
769
+
770
+ contracts = EveOnline::ESI::PublicContracts.new(options)
771
+
772
+ contracts.scope # => nil
773
+
774
+ contracts.page # => 1
775
+
776
+ contracts.total_pages # => 4
777
+
778
+ contracts.contracts.size # => 1000
779
+
780
+ contract = contracts.contracts.first
781
+
782
+ contract.as_json # => {:buyout=>nil,
783
+ # :collateral=>0.0,
784
+ # :contract_id=>157834735,
785
+ # :date_expired=>Wed, 17 Jun 2020 21:36:41 UTC +00:00,
786
+ # :date_issued=>Wed, 20 May 2020 21:36:41 UTC +00:00,
787
+ # :days_to_complete=>0,
788
+ # :end_location_id=>60008494,
789
+ # :for_corporation=>true,
790
+ # :issuer_corporation_id=>897372069,
791
+ # :issuer_id=>1314102096,
792
+ # :price=>1250000000.0,
793
+ # :reward=>0.0,
794
+ # :start_location_id=>60008494,
795
+ # :title=>"Apostle Me10/Te16 Complete Bpc 10 Pack",
796
+ # :type=>"item_exchange",
797
+ # :volume=>100.0}
798
+
799
+ contract.buyout # => nil
800
+ contract.collateral # => 0.0
801
+ contract.contract_id # => 157834735
802
+ contract.date_expired # => Wed, 17 Jun 2020 21:36:41 UTC +00:00
803
+ contract.date_issued # => Wed, 20 May 2020 21:36:41 UTC +00:00
804
+ contract.days_to_complete # => 0
805
+ contract.end_location_id # => 60008494
806
+ contract.for_corporation # => true
807
+ contract.issuer_corporation_id # => 897372069
808
+ contract.issuer_id # => 1314102096
809
+ contract.price # => 1250000000.0
810
+ contract.reward # => 0.0
811
+ contract.start_location_id # => 60008494
812
+ contract.title # => "Apostle Me10/Te16 Complete Bpc 10 Pack"
813
+ contract.type # => "item_exchange"
814
+ contract.volume # => 100.0
815
+
816
+ contracts.etag # => "3f7fdf9a69e35bb35d619b6cb5043a2766d11ca6306a8b5af369ce6e"
817
+ ```
818
+
775
819
  #### Get public contract bids
776
820
 
821
+ ```ruby
822
+ options = { contract_id: 157_872_948, page: 1 }
823
+
824
+ contract = EveOnline::ESI::PublicContract.new(options)
825
+
826
+ contract.scope # => nil
827
+
828
+ contract.page # => 1
829
+
830
+ contract.total_pages # => 1
831
+
832
+ contract.items.size # => 1
833
+
834
+ item = contract.items.first
835
+
836
+ item.as_json # => {:is_blueprint_copy=>true,
837
+ # :is_included=>true,
838
+ # :item_id=>1029552558074,
839
+ # :material_efficiency=>10,
840
+ # :quantity=>1,
841
+ # :record_id=>3210378611,
842
+ # :runs=>400,
843
+ # :time_efficiency=>20,
844
+ # :type_id=>29040}
845
+
846
+ item.is_blueprint_copy # => true
847
+ item.is_included # => true
848
+ item.item_id # => 1029552558074
849
+ item.material_efficiency # => 10
850
+ item.quantity # => 1
851
+ item.record_id # => 3210378611
852
+ item.runs # => 400
853
+ item.time_efficiency # => 20
854
+ item.type_id # => 29040
855
+
856
+ contract.etag # => "d458c3f56c114882a9ecfe1aaf173837310b15b6e7cef86a019e700f"
857
+ ```
858
+
777
859
  #### Get public contract items
778
860
 
779
861
  #### Get corporation contracts
@@ -932,6 +1014,18 @@ corporation_blueprints.roles # => ["Director"]
932
1014
 
933
1015
  #### Get npc corporations
934
1016
 
1017
+ ```ruby
1018
+ corporation_npcs = EveOnline::ESI::CorporationNPC.new
1019
+
1020
+ corporation_npcs.scope # => nil
1021
+
1022
+ corporation_npcs.corporation_npc_ids.size # => 262
1023
+
1024
+ corporation_npcs.corporation_npc_ids.first # => 1000001
1025
+
1026
+ corporation_npcs.etag # => "085946820256a4f7be2e9926e9d1de9e420cca53ffb31f7547740a05"
1027
+ ```
1028
+
935
1029
  ### Dogma
936
1030
 
937
1031
  #### Get attributes
@@ -1297,13 +1391,13 @@ character_killmails.killmails.size # => 1
1297
1391
 
1298
1392
  killmail = character_killmails.killmails.first
1299
1393
 
1300
- killmail.as_json # => {:killmail_hash=>"07f7ef1d7f6090e78d8e85b4a98e680f67b5e9d5",
1301
- # :killmail_id=>72410059}
1394
+ killmail.as_json # => {:killmail_hash=>"8f1450fca8ce97be9b10e106a1257088407ef387",
1395
+ # :killmail_id=>81_646_519}
1302
1396
 
1303
- killmail.killmail_hash # => "07f7ef1d7f6090e78d8e85b4a98e680f67b5e9d5"
1304
- killmail.killmail_id # => 72410059
1397
+ killmail.killmail_hash # => "8f1450fca8ce97be9b10e106a1257088407ef387"
1398
+ killmail.killmail_id # => 81646519
1305
1399
 
1306
- # TODO: character_killmails.etag
1400
+ character_killmails.etag # => "ba5068bc1b07db98d9efce93437295fbdb9d29b14b4ffbcbfa91ac0d"
1307
1401
  ```
1308
1402
 
1309
1403
  #### Get a corporation's recent kills and losses
@@ -1336,6 +1430,14 @@ corporation_killmails.roles # => ["Director"]
1336
1430
 
1337
1431
  #### Get a single killmail
1338
1432
 
1433
+ ```ruby
1434
+ options = { killmail_id: 81_646_519, killmail_hash: "8f1450fca8ce97be9b10e106a1257088407ef387" }
1435
+
1436
+ killmail = EveOnline::ESI::Killmail.new(options)
1437
+
1438
+ # TODO: finish this
1439
+ ```
1440
+
1339
1441
  ### Location
1340
1442
 
1341
1443
  #### Get character location
@@ -1466,22 +1568,103 @@ corporation_loyalty_store_offers.etag # => "89211f42fde090e4d22621e9b97d7604ab87
1466
1568
 
1467
1569
  #### Return mail headers
1468
1570
 
1571
+ ```ruby
1572
+ ```
1573
+
1469
1574
  #### Send a new mail
1470
1575
 
1576
+ ```ruby
1577
+ ```
1578
+
1471
1579
  #### Delete a mail
1472
1580
 
1581
+ ```ruby
1582
+ ```
1583
+
1473
1584
  #### Return a mail
1474
1585
 
1586
+ ```ruby
1587
+ options = { character_id: 1_337_512_245, mail_id: 376_045_681, token: "token" }
1588
+
1589
+ character_mail = EveOnline::ESI::CharacterGetMail.new(options)
1590
+
1591
+ character_mail.scope # => "esi-mail.read_mail.v1"
1592
+
1593
+ character_mail.as_json # => {:body=>"<font size=\"12\" color=\"#bfffffff\">moving</font>",
1594
+ # :from_id=>1208274826,
1595
+ # :read=>true,
1596
+ # :subject=>"moving",
1597
+ # :timestamp=>Mon, 10 Jun 2019 07:50:00 UTC +00:00}
1598
+
1599
+ character_mail.body # => "<font size=\"12\" color=\"#bfffffff\">moving</font>"
1600
+ character_mail.from_id # => 1208274826
1601
+ character_mail.read # => true
1602
+ character_mail.subject # => "moving"
1603
+ character_mail.timestamp # => Mon, 10 Jun 2019 07:50:00 UTC +00:00
1604
+
1605
+ character_mail.label_ids # => [4]
1606
+
1607
+ character_mail.recipients.size # => 1
1608
+
1609
+ recipient = character_mail.recipients.first
1610
+
1611
+ recipient.as_json # => {:recipient_id=>98134807,
1612
+ # :recipient_type=>"corporation"}
1613
+
1614
+ recipient.recipient_id # => 98134807
1615
+ recipient.recipient_type # => "corporation"
1616
+
1617
+ character_mail.etag # => "90dba7f7a6e60bfe8527b9f5112b9ca588c8f57d01415717be525a91"
1618
+ ```
1619
+
1475
1620
  #### Update metadata about a mail
1476
1621
 
1622
+ ```ruby
1623
+ ```
1624
+
1477
1625
  #### Get mail labels and unread counts
1478
1626
 
1627
+ ```ruby
1628
+ options = { character_id: 1_337_512_245, token: "token" }
1629
+
1630
+ character_mail_labels = EveOnline::ESI::CharacterMailLabels.new(options)
1631
+
1632
+ character_mail_labels.scope # => "esi-mail.read_mail.v1"
1633
+
1634
+ character_mail_labels.total_unread_count # => 288
1635
+
1636
+ character_mail_labels.labels.size # => 4
1637
+
1638
+ label = character_mail_labels.labels.last
1639
+
1640
+ label.as_json # => {:color=>"#ffffff",
1641
+ # :label_id=>8,
1642
+ # :name=>"[Alliance]",
1643
+ # :unread_count=>227}
1644
+
1645
+ label.color # => "#ffffff"
1646
+ label.label_id # => 8
1647
+ label.name # => "[Alliance]"
1648
+ label.unread_count # => 227
1649
+
1650
+ character_mail_labels.etag # => "265cfe7f2d7df2273342ed75c92b5047af6f76a3807dcc8353b5f379"
1651
+ ```
1652
+
1479
1653
  #### Create a mail label
1480
1654
 
1655
+ ```ruby
1656
+ ```
1657
+
1481
1658
  #### Delete a mail label
1482
1659
 
1660
+ ```ruby
1661
+ ```
1662
+
1483
1663
  #### Return mailing list subscriptions
1484
1664
 
1665
+ ```ruby
1666
+ ```
1667
+
1485
1668
  ### Market
1486
1669
 
1487
1670
  #### List open orders from a character
@@ -1645,6 +1828,27 @@ market_group.etag # => "bf7832bfc20f5f9fdeddc9cb0360b941067310e7e3a2a80315b45a43
1645
1828
 
1646
1829
  #### List market prices
1647
1830
 
1831
+ ```ruby
1832
+ market_prices = EveOnline::ESI::MarketPrices.new
1833
+
1834
+ market_prices.scope # => nil
1835
+
1836
+ market_prices.market_prices.size # => 12565
1837
+
1838
+ market_price = market_prices.market_prices.first
1839
+
1840
+
1841
+ market_price.as_json # => {:adjusted_price=>923296.88,
1842
+ # :average_price=>1273871.6,
1843
+ # :type_id=>32772}
1844
+
1845
+ market_price.adjusted_price # => 923296.88
1846
+ market_price.average_price # => 1273871.6
1847
+ market_price.type_id # => 32772
1848
+
1849
+ market_prices.etag # => "2d5acc3bd4555821bb91d787596f5ddad129f849739e83162e93c02f"
1850
+ ```
1851
+
1648
1852
  #### List orders in a structure
1649
1853
 
1650
1854
  ### Opportunities
@@ -1938,7 +2142,7 @@ category.published # => true
1938
2142
  category.group_ids.size # => 46
1939
2143
  category.group_ids.first # => 25
1940
2144
 
1941
- # TODO: category.etag
2145
+ category.etag # => "37a39e7a5f5ecc07b19a3128c319f1198d035aee10052d0a21ccdd94"
1942
2146
  ```
1943
2147
 
1944
2148
  #### Get constellations
@@ -2185,12 +2389,12 @@ races.races.size # => 4
2185
2389
 
2186
2390
  race = races.races.first
2187
2391
 
2188
- race.as_json # => {:alliance_id=>500002,
2392
+ race.as_json # => {:faction_id=>500002,
2189
2393
  # :description=>"Once a thriving tribal civilization, the Minmatar...",
2190
2394
  # :name=>"Minmatar",
2191
2395
  # :race_id=>2}
2192
2396
 
2193
- race.alliance_id # => 500002
2397
+ race.faction_id # => 500002
2194
2398
  race.description # => "Once a thriving tribal civilization, the Minmatar..."
2195
2399
  race.name # => "Minmatar"
2196
2400
  race.race_id # => 2
@@ -2221,23 +2425,24 @@ region = EveOnline::ESI::UniverseRegion.new(options)
2221
2425
 
2222
2426
  region.scope # => nil
2223
2427
 
2224
- region.as_json # => {:constellations=>[20000001,20000002,20000003,...,20000016],
2225
- # :description=>"The Derelik region...",
2428
+ region.as_json # => {:description=>"The Derelik region...",
2226
2429
  # :name=>"Derelik",
2227
2430
  # :region_id=>10000001}
2228
2431
 
2229
- region.constellations # => [20000001,20000002,20000003,...,20000016]
2230
2432
  region.description # => "The Derelik region..."
2231
2433
  region.name # => "Derelik"
2232
2434
  region.region_id # => 10000001
2233
2435
 
2436
+ region.constellation_ids.size # => 16
2437
+ region.constellation_ids.first # => 20000001
2438
+
2234
2439
  region.etag # => "2c8392581d493e06c015ca3d48d4076079bf4c976b1f776742592260"
2235
2440
  ```
2236
2441
 
2237
2442
  #### Get stargate information
2238
2443
 
2239
2444
  ```ruby
2240
- options = { id: 50000056 }
2445
+ options = { id: 50_000_056 }
2241
2446
 
2242
2447
  stargate = EveOnline::ESI::UniverseStargate.new(options)
2243
2448
 
@@ -2246,18 +2451,16 @@ stargate.scope # => nil
2246
2451
  stargate.as_json # => {:name=>"Stargate (Akpivem)",
2247
2452
  # :stargate_id=>50000056,
2248
2453
  # :system_id=>30000001,
2249
- # :type_id=>29624}
2454
+ # :type_id=>29624,
2455
+ # :destination_stargate_id=>50000342,
2456
+ # :destination_system_id=>30000003}
2250
2457
 
2251
2458
  stargate.name # => "Stargate (Akpivem)"
2252
2459
  stargate.stargate_id # => 50000056
2253
2460
  stargate.system_id # => 30000001
2254
2461
  stargate.type_id # => 29624
2255
-
2256
- stargate.destination.as_json # => {:stargate_id=>50000342,
2257
- # :system_id=>30000003}
2258
-
2259
- stargate.destination.stargate_id # => 50000342
2260
- stargate.destination.system_id # => 30000003
2462
+ stargate.destination_stargate_id # => 50000342
2463
+ stargate.destination_system_id # => 30000003
2261
2464
 
2262
2465
  stargate.position.as_json # => {:x=>331516354560.0,
2263
2466
  # :y=>43597455360.0,
@@ -2609,7 +2812,7 @@ type.etag # => "e3f6a76b4a1287f54966c6253f8f5d6ac6460bc43d47570331b43e0b"
2609
2812
  #### Get a character's wallet balance
2610
2813
 
2611
2814
  ```ruby
2612
- options = { token: 'token123', character_id: 90729314 }
2815
+ options = { token: 'token123', character_id: 90_729_314 }
2613
2816
 
2614
2817
  character_wallet = EveOnline::ESI::CharacterWallet.new(options)
2615
2818
 
@@ -2619,13 +2822,13 @@ character_wallet.as_json # => {:wallet=>409488252.49}
2619
2822
 
2620
2823
  character_wallet.wallet # => 409488252.49
2621
2824
 
2622
- # TODO: character_wallet.etag
2825
+ character_wallet.etag # => "482786a491138fdf393f42c457424b0cd3f3c3c7c2c9afb3f55c618a"
2623
2826
  ```
2624
2827
 
2625
2828
  #### Get character wallet journal
2626
2829
 
2627
2830
  ```ruby
2628
- options = { token: 'token123', character_id: 90729314, page: 1 }
2831
+ options = { token: 'token123', character_id: 90_729_314, page: 1 }
2629
2832
 
2630
2833
  character_wallet_journal = EveOnline::ESI::CharacterWalletJournal.new(options)
2631
2834
 
@@ -2635,39 +2838,94 @@ character_wallet_journal.page # => 1
2635
2838
 
2636
2839
  character_wallet_journal.total_pages # => 1
2637
2840
 
2638
- character_wallet_journal.wallet_journal_entries.size # => 1
2841
+ character_wallet_journal.wallet_journal_entries.size # => 220
2639
2842
 
2640
2843
  wallet_journal_entry = character_wallet_journal.wallet_journal_entries.first
2641
2844
 
2642
- wallet_journal_entry.as_json
2643
-
2644
- wallet_journal_entry.amount
2645
- wallet_journal_entry.balance
2646
- wallet_journal_entry.context_id
2647
- wallet_journal_entry.context_id_type
2648
- wallet_journal_entry.date
2649
- wallet_journal_entry.description
2650
- wallet_journal_entry.first_party_id
2651
- wallet_journal_entry.id
2652
- wallet_journal_entry.reason
2653
- wallet_journal_entry.ref_type
2654
- wallet_journal_entry.second_party_id
2655
- wallet_journal_entry.tax
2656
- wallet_journal_entry.tax_receiver_id
2657
-
2658
- # TODO: update example
2659
-
2660
- # TODO: character_wallet_journal.etag
2845
+ wallet_journal_entry.as_json # => {:amount=>87375.0,
2846
+ # :balance=>2405126.01,
2847
+ # :context_id=>30003498,
2848
+ # :context_id_type=>"system_id",
2849
+ # :date=>Sun, 08 Mar 2020 12:08:25 UTC +00:00,
2850
+ # :description=>"Johnn Dillinger got bounty prizes for killing pirates in Sharhelund",
2851
+ # :first_party_id=>1000125,
2852
+ # :wallet_journal_id=>17740466914,
2853
+ # :reason=>"3744: 2,3748: 2,18085: 2,18070: 1",
2854
+ # :ref_type=>"bounty_prizes",
2855
+ # :second_party_id=>1337512245,
2856
+ # :tax=>nil,
2857
+ # :tax_receiver_id=>nil}
2858
+
2859
+ wallet_journal_entry.amount # => 87375.0
2860
+ wallet_journal_entry.balance # => 2405126.01
2861
+ wallet_journal_entry.context_id # => 30003498
2862
+ wallet_journal_entry.context_id_type # => "system_id"
2863
+ wallet_journal_entry.date # => Sun, 08 Mar 2020 12:08:25 UTC +00:00
2864
+ wallet_journal_entry.description # => "Johnn Dillinger got bounty prizes for killing pirates in Sharhelund"
2865
+ wallet_journal_entry.first_party_id # => 1000125
2866
+ wallet_journal_entry.wallet_journal_id # => 17740466914
2867
+ wallet_journal_entry.reason # => "3744: 2,3748: 2,18085: 2,18070: 1"
2868
+ wallet_journal_entry.ref_type # => "bounty_prizes"
2869
+ wallet_journal_entry.second_party_id # => 1337512245
2870
+ wallet_journal_entry.tax # => nil
2871
+ wallet_journal_entry.tax_receiver_id # => nil
2872
+
2873
+ character_wallet_journal.etag # => "b618a1a584f6aad53cb79c72d6de26d8c9210d0a18be1421d5355446"
2661
2874
  ```
2662
2875
 
2663
2876
  #### Get wallet transactions
2664
2877
 
2878
+ ```ruby
2879
+ options = { token: "token123", character_id: 1_337_512_245 } # optional, add `from_id: 123` to skip records
2880
+
2881
+ wallet_transactions = EveOnline::ESI::CharacterWalletTransactions.new(options)
2882
+
2883
+ wallet_transactions.scope # => "esi-wallet.read_character_wallet.v1"
2884
+
2885
+ wallet_transactions.wallet_transactions.size # => 47
2886
+
2887
+ wallet_transaction = wallet_transactions.wallet_transactions.first
2888
+
2889
+ wallet_transaction.as_json # => {:client_id=>2116253203,
2890
+ # :date=>Sun, 08 Mar 2020 11:49:16 UTC +00:00,
2891
+ # :is_buy=>true,
2892
+ # :is_personal=>true,
2893
+ # :journal_ref_id=>17740411474,
2894
+ # :location_id=>60008494,
2895
+ # :quantity=>1,
2896
+ # :transaction_id=>5296927639,
2897
+ # :type_id=>3538,
2898
+ # :unit_price=>99887.79}
2899
+
2900
+ wallet_transaction.client_id # => 2116253203
2901
+ wallet_transaction.date # => Sun, 08 Mar 2020 11:49:16 UTC +00:00
2902
+ wallet_transaction.is_buy # => true
2903
+ wallet_transaction.is_personal # => true
2904
+ wallet_transaction.journal_ref_id # => 17740411474
2905
+ wallet_transaction.location_id # => 60008494
2906
+ wallet_transaction.quantity # => 1
2907
+ wallet_transaction.transaction_id # => 5296927639
2908
+ wallet_transaction.type_id # => 3538
2909
+ wallet_transaction.unit_price # => 99887.79
2910
+
2911
+ wallet_transactions.etag # => "55d0fbe8b408d6a76dab70c0a709d4e7c5dd58d4e0b7bd785549e268"
2912
+ ```
2913
+
2665
2914
  #### Returns a corporation's wallet balance
2666
2915
 
2916
+ ```ruby
2917
+ ```
2918
+
2667
2919
  #### Get corporation wallet journal
2668
2920
 
2921
+ ```ruby
2922
+ ```
2923
+
2669
2924
  #### Get corporation wallet transactions
2670
2925
 
2926
+ ```ruby
2927
+ ```
2928
+
2671
2929
  ### Wars
2672
2930
 
2673
2931
  #### List wars
@@ -2853,19 +3111,9 @@ races.write_timeout = 120
2853
3111
  races.write_timeout # => 120
2854
3112
  ```
2855
3113
 
2856
- ## Datasource
2857
-
2858
- Default datasource is `tranquility`. If you want to change it, for e.g., to `singularity`, add `datasource: 'singularity'` to default hash with options:
2859
-
2860
- ```ruby
2861
- options = { datasource: 'singularity' }
2862
-
2863
- races = EveOnline::ESI::UniverseRaces.new(options)
2864
- ```
2865
-
2866
3114
  ## Languages support
2867
3115
 
2868
- Default language is `en-us`. Supported languages: `de`, `en-us`, `fr`, `ja`, `ru`, `zh`.
3116
+ Default language is `en-us`. Supported languages: `de`, `en-us`, `fr`, `ja`, `ru`, `zh`, `ko`.
2869
3117
 
2870
3118
  If you want change it, for e.g., to `de`, add `language: 'de'` to default hash with options:
2871
3119
 
@@ -2885,6 +3133,26 @@ Oj.mimic_JSON()
2885
3133
  races = EveOnline::ESI::UniverseRaces.new
2886
3134
  ```
2887
3135
 
3136
+ ## Formulas
3137
+
3138
+ ### Blueprint copy time
3139
+
3140
+ ```ruby
3141
+ seconds = 240 # 240 seconds it time to copy e.g. "Acolyte I Blueprint"
3142
+ science_level = 5 # character science level
3143
+ advanced_industry_level = 1 # character advanced industry level
3144
+ science_copy_speed_bonus_per_level = -5.00 # type dogma attribute copy speed bonus for science
3145
+ advanced_industry_skill_industry_job_time_bonus_per_level = -3.00 # type dogma attribute industry job time bonuse for advanced industry
3146
+ runs = 1 # number of copy, optional. default: 1
3147
+
3148
+ formula = EveOnline::Formulas::BlueprintCopyTime.new(seconds, science_level,
3149
+ advanced_industry_level, science_copy_speed_bonus_per_level,
3150
+ advanced_industry_skill_industry_job_time_bonus_per_level, runs)
3151
+
3152
+ # time of copy in seconds
3153
+ formula.time # => 174.6
3154
+ ```
3155
+
2888
3156
  ## Useful links
2889
3157
 
2890
3158
  * [BREAKING CHANGES AND YOU - HOW TO USE ALT-ROUTES TO ENHANCE YOUR SANITY](https://developers.eveonline.com/blog/article/breaking-changes-and-you)