stbaldricks 12.2.0 → 12.3.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1589618ca40e9b3f0188dcc567a12fa34eb044251d5527aed7bbd88332e6d162
4
- data.tar.gz: a975d7550a1a313d9929de379e5b41ab06e4c440874d01dee9ae40a11b20dad4
3
+ metadata.gz: 0d3e445bf7c689869be9b0d4df99991bc1394fd1c71c19e4e7103c8c49fcb107
4
+ data.tar.gz: 279daf859b15505699245fb778afd7184c2f1fb1ea7647bb27ddd063b57496d9
5
5
  SHA512:
6
- metadata.gz: 3297499769c5fc74d114b0b72e1c28fac2e1c6dd545975aa027187419c9ed252ec9af766711603c8d0a73ed2b0b4b241788d538af17033610edf62f6300c8526
7
- data.tar.gz: 72e227b4f317171ac6cd680286339a06bab1a5ad0c4b0072e01b8f1344dbbdc9438d968f3074e1856b0c8a29e1821c66172b7391c91b9d8a0282e41bcba662ea
6
+ metadata.gz: 8331bd13af2528d191807a3df1c8f3b2a96136fb01a9dd63932da502ca06da47bb0190516b851aa6be4d39a2a6e31862cfbece68b1d11207110793d8c5c6398a
7
+ data.tar.gz: 669a8d3b7814fbb7f6ea6f627d18ee31b82eaa50805100cde362949759596fd96143bd26f4a1d05bb7333ed6b53f4086ce484d7c0509ff0d7200c9824ab61732
@@ -0,0 +1,74 @@
1
+ require 'stbaldricks/api'
2
+ require 'stbaldricks/endpoints/lib/entity'
3
+
4
+ module SBF
5
+ module Client
6
+ class BlogPostEndpoint < SBF::Client::EntityEndpoint
7
+ FILTER_BY_AUTHOR = 'author'.freeze
8
+ FILTER_BY_CATEGORY = 'category'.freeze
9
+ FILTER_BY_TERM = 'filter_term'.freeze
10
+ FILTER_BY_TAG = 'tag'.freeze
11
+
12
+ def base_uri
13
+ "/#{SBF::Client::Api::VERSION}/blog_post"
14
+ end
15
+
16
+ def get(slug)
17
+ response = SBF::Client::Api::Request.get_request("#{base_uri}/get/#{slug}")
18
+
19
+ if ok?(response)
20
+ hydrated_entity(response, {}, nil)
21
+ elsif response.code == 404
22
+ nil
23
+ else
24
+ parsed_response_body = JSON.parse(response.body).symbolize!
25
+ error = SBF::Client::ErrorEntity.new(parsed_response_body)
26
+ SBF::Client::Api::Response.new(http_code: response.code, data: parsed_response_body[:data], error: error)
27
+ end
28
+ end
29
+
30
+ def find_by_term(term, order = {}, limit = 10, offset = 0, show_hidden = true)
31
+ # Build the parameter list for search; an empty find is supported
32
+ filter = {}
33
+ filter[:type] = FILTER_BY_TERM
34
+ filter[:term] = term unless term.empty?
35
+ filter[:show_hidden] = show_hidden
36
+
37
+ find(filter, order, limit, offset)
38
+ end
39
+
40
+ def find_by_author(author, order = {}, limit = 10, offset = 0, show_hidden = true)
41
+ raise SBF::Client::Error, 'Must provide author for the query' if author.empty?
42
+
43
+ filter = {}
44
+ filter[:type] = FILTER_BY_AUTHOR
45
+ filter[:term] = author
46
+ filter[:show_hidden] = show_hidden
47
+
48
+ find(filter, order, limit, offset)
49
+ end
50
+
51
+ def find_by_category(category, order = {}, limit = 10, offset = 0, show_hidden = true)
52
+ raise SBF::Client::Error, 'Must provide category for the query' if category.empty?
53
+
54
+ filter = {}
55
+ filter[:type] = FILTER_BY_CATEGORY
56
+ filter[:term] = category
57
+ filter[:show_hidden] = show_hidden
58
+
59
+ find(filter, order, limit, offset)
60
+ end
61
+
62
+ def find_by_tag(tag, order = {}, limit = 10, offset = 0, show_hidden = true)
63
+ raise SBF::Client::Error, 'Must provide tag for the query' if tag.empty?
64
+
65
+ filter = {}
66
+ filter[:type] = FILTER_BY_TAG
67
+ filter[:term] = tag
68
+ filter[:show_hidden] = show_hidden
69
+
70
+ find(filter, order, limit, offset)
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,25 @@
1
+ require 'stbaldricks/endpoints/blog_post'
2
+ require 'stbaldricks/entities/lib/top_level'
3
+
4
+ module SBF
5
+ module Client
6
+ module Blog
7
+ class Post < SBF::Client::TopLevelEntity
8
+ endpoint SBF::Client::BlogPostEndpoint
9
+ action :get
10
+ action :find_by_term
11
+ action :find_by_author
12
+ action :find_by_category
13
+ action :find_by_tag
14
+
15
+ attr_reader :id
16
+ attr_reader :slug
17
+ attr_reader :url
18
+ attr_reader :title
19
+ attr_reader :content
20
+ attr_reader :published_at
21
+ attr_reader :modified_at
22
+ end
23
+ end
24
+ end
25
+ end
@@ -10,6 +10,7 @@ module SBF
10
10
  attr_accessor :amount
11
11
  attr_accessor :count
12
12
  attr_accessor :donation_created_at
13
+ attr_accessor :donation_collected_at
13
14
  end
14
15
  end
15
16
  end
@@ -10,6 +10,7 @@ module SBF
10
10
  FIRE_DEPARTMENT = 'fire_department'
11
11
  POLICE_DEPARTMENT = 'police_department'
12
12
  FIRE_AND_POLICE = 'fire_and_police'
13
+ SERVICE_ORGANIZATION = 'service_organization'
13
14
  end
14
15
  end
15
16
  end
@@ -1,5 +1,5 @@
1
1
  module SBF
2
2
  module Client
3
- VERSION = '12.2.0'.freeze
3
+ VERSION = '12.3.0.alpha.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stbaldricks
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.2.0
4
+ version: 12.3.0.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-10 00:00:00.000000000 Z
11
+ date: 2022-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -304,6 +304,7 @@ files:
304
304
  - lib/stbaldricks/client.rb
305
305
  - lib/stbaldricks/configuration.rb
306
306
  - lib/stbaldricks/default_logger.rb
307
+ - lib/stbaldricks/endpoints/blog_post.rb
307
308
  - lib/stbaldricks/endpoints/communicate.rb
308
309
  - lib/stbaldricks/endpoints/config.rb
309
310
  - lib/stbaldricks/endpoints/contact.rb
@@ -327,6 +328,7 @@ files:
327
328
  - lib/stbaldricks/endpoints/shave_schedule.rb
328
329
  - lib/stbaldricks/endpoints/user.rb
329
330
  - lib/stbaldricks/entities/batch.rb
331
+ - lib/stbaldricks/entities/blog_post.rb
330
332
  - lib/stbaldricks/entities/campaign.rb
331
333
  - lib/stbaldricks/entities/challenge.rb
332
334
  - lib/stbaldricks/entities/challenger.rb
@@ -555,9 +557,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
555
557
  version: '0'
556
558
  required_rubygems_version: !ruby/object:Gem::Requirement
557
559
  requirements:
558
- - - ">="
560
+ - - ">"
559
561
  - !ruby/object:Gem::Version
560
- version: '0'
562
+ version: 1.3.1
561
563
  requirements: []
562
564
  rubygems_version: 3.0.3.1
563
565
  signing_key:
@@ -565,99 +567,99 @@ specification_version: 4
565
567
  summary: St. Baldrick's Foundation Ruby Client Library
566
568
  test_files:
567
569
  - lib/stbaldricks_factories.rb
568
- - spec/factories/photo.rb
569
- - spec/factories/participant.rb
570
- - spec/factories/search_team.rb
571
- - spec/factories/fund.rb
572
- - spec/factories/kid_institution.rb
570
+ - spec/factories/participant/rankings.rb
571
+ - spec/factories/participant/photos.rb
572
+ - spec/factories/participant/roles/role.rb
573
+ - spec/factories/participant/policies.rb
574
+ - spec/factories/participant/totals.rb
575
+ - spec/factories/participant/roles.rb
576
+ - spec/factories/participant/rankings/ranking.rb
577
+ - spec/factories/search_fundraiser.rb
578
+ - spec/factories/newsletter_recipient.rb
573
579
  - spec/factories/phone.rb
580
+ - spec/factories/contact_group.rb
581
+ - spec/factories/fundraiser/photos.rb
582
+ - spec/factories/fundraiser/policies.rb
583
+ - spec/factories/fundraiser/totals.rb
584
+ - spec/factories/team.rb
585
+ - spec/factories/venue.rb
586
+ - spec/factories/recurring_gift.rb
587
+ - spec/factories/donation/participant.rb
588
+ - spec/factories/error.rb
589
+ - spec/factories/grant_institution.rb
590
+ - spec/factories/page.rb
591
+ - spec/factories/grant.rb
592
+ - spec/factories/search_team.rb
593
+ - spec/factories/search_participant.rb
594
+ - spec/factories/name_pieces.rb
595
+ - spec/factories/researcher.rb
596
+ - spec/factories/photos.rb
597
+ - spec/factories/donor.rb
574
598
  - spec/factories/diagnosis.rb
575
- - spec/factories/location.rb
576
- - spec/factories/event_application.rb
599
+ - spec/factories/kid_institution.rb
600
+ - spec/factories/message.rb
577
601
  - spec/factories/search_event.rb
578
- - spec/factories/shave_schedule/time_selection_permissions.rb
579
- - spec/factories/collection.rb
602
+ - spec/factories/photo.rb
580
603
  - spec/factories/event.rb
581
- - spec/factories/challenger.rb
582
- - spec/factories/campaign/totals.rb
583
- - spec/factories/kid_honor.rb
584
- - spec/factories/response.rb
585
- - spec/factories/grant_institution.rb
586
604
  - spec/factories/organization.rb
587
- - spec/factories/researcher.rb
588
- - spec/factories/treatment_status.rb
589
- - spec/factories/event/totals.rb
590
- - spec/factories/event/contacts.rb
591
- - spec/factories/event/photos.rb
592
- - spec/factories/event/venue/location.rb
593
- - spec/factories/event/venue/social.rb
594
- - spec/factories/event/coach_tracking.rb
595
- - spec/factories/event/venue.rb
596
- - spec/factories/event/coach_tracking/coaching_interactions.rb
597
- - spec/factories/event/coach_tracking/proceeds.rb
598
- - spec/factories/event/coach_tracking/plaque.rb
599
- - spec/factories/event/contacts/name_pieces.rb
600
- - spec/factories/event/contacts/contact.rb
601
- - spec/factories/fundraiser/totals.rb
602
- - spec/factories/fundraiser/policies.rb
603
- - spec/factories/fundraiser/photos.rb
604
- - spec/factories/shave_schedule.rb
605
- - spec/factories/event_supporter.rb
606
- - spec/factories/participant/totals.rb
607
- - spec/factories/participant/policies.rb
608
- - spec/factories/participant/roles/role.rb
609
- - spec/factories/participant/photos.rb
610
- - spec/factories/participant/rankings.rb
611
- - spec/factories/participant/rankings/ranking.rb
612
- - spec/factories/participant/roles.rb
613
- - spec/factories/error.rb
614
- - spec/factories/recurring_gift.rb
615
- - spec/factories/challenge.rb
616
- - spec/factories/address.rb
605
+ - spec/factories/campaign.rb
617
606
  - spec/factories/kid/custom_institution.rb
618
- - spec/factories/person.rb
619
- - spec/factories/search_participant.rb
620
- - spec/factories/milestone.rb
621
607
  - spec/factories/fundraising_page.rb
622
- - spec/factories/photos.rb
623
- - spec/factories/team/totals.rb
624
- - spec/factories/team/photos.rb
625
- - spec/factories/team/rankings.rb
626
- - spec/factories/team/rankings/ranking.rb
627
- - spec/factories/donation.rb
628
- - spec/factories/memorial.rb
608
+ - spec/factories/contact.rb
609
+ - spec/factories/event_application.rb
610
+ - spec/factories/location.rb
611
+ - spec/factories/response.rb
612
+ - spec/factories/kid.rb
613
+ - spec/factories/challenger.rb
614
+ - spec/factories/treatment_status.rb
629
615
  - spec/factories/institution.rb
630
- - spec/factories/memorial/totals.rb
631
- - spec/factories/memorial/tribute.rb
632
- - spec/factories/memorial/photos.rb
616
+ - spec/factories/lib/helpers.rb
617
+ - spec/factories/lib/faker_patch.rb
618
+ - spec/factories/shave_schedule.rb
619
+ - spec/factories/address.rb
620
+ - spec/factories/shave_schedule/time_selection_permissions.rb
621
+ - spec/factories/person/phone_numbers.rb
633
622
  - spec/factories/person/policies.rb
634
623
  - spec/factories/person/addresses.rb
635
- - spec/factories/person/phone_numbers.rb
636
624
  - spec/factories/person/email_addresses.rb
637
- - spec/factories/donor.rb
638
- - spec/factories/kid.rb
639
- - spec/factories/name_pieces.rb
640
- - spec/factories/team.rb
641
- - spec/factories/user.rb
625
+ - spec/factories/collection.rb
626
+ - spec/factories/fundraiser.rb
627
+ - spec/factories/email_address.rb
628
+ - spec/factories/third_party_media.rb
629
+ - spec/factories/donation.rb
630
+ - spec/factories/person.rb
631
+ - spec/factories/team/rankings.rb
632
+ - spec/factories/team/photos.rb
633
+ - spec/factories/team/totals.rb
634
+ - spec/factories/team/rankings/ranking.rb
635
+ - spec/factories/kid_honor.rb
642
636
  - spec/factories/disease.rb
637
+ - spec/factories/payment.rb
643
638
  - spec/factories/search_kid.rb
644
- - spec/factories/page.rb
645
- - spec/factories/venue.rb
646
- - spec/factories/organization/addresses.rb
639
+ - spec/factories/user.rb
640
+ - spec/factories/campaign/totals.rb
647
641
  - spec/factories/organization/phone_numbers.rb
642
+ - spec/factories/organization/addresses.rb
648
643
  - spec/factories/organization/email_addresses.rb
649
- - spec/factories/lib/faker_patch.rb
650
- - spec/factories/lib/helpers.rb
651
- - spec/factories/newsletter_recipient.rb
652
- - spec/factories/payment.rb
653
- - spec/factories/contact.rb
654
- - spec/factories/message.rb
655
- - spec/factories/search_fundraiser.rb
656
- - spec/factories/third_party_media.rb
657
- - spec/factories/donation/participant.rb
658
- - spec/factories/grant.rb
659
- - spec/factories/fundraiser.rb
660
- - spec/factories/contact_group.rb
661
- - spec/factories/email_address.rb
644
+ - spec/factories/fund.rb
645
+ - spec/factories/milestone.rb
646
+ - spec/factories/memorial.rb
647
+ - spec/factories/challenge.rb
648
+ - spec/factories/event/contacts.rb
649
+ - spec/factories/event/venue.rb
650
+ - spec/factories/event/coach_tracking/proceeds.rb
651
+ - spec/factories/event/coach_tracking/plaque.rb
652
+ - spec/factories/event/coach_tracking/coaching_interactions.rb
653
+ - spec/factories/event/photos.rb
654
+ - spec/factories/event/coach_tracking.rb
655
+ - spec/factories/event/contacts/name_pieces.rb
656
+ - spec/factories/event/contacts/contact.rb
657
+ - spec/factories/event/venue/location.rb
658
+ - spec/factories/event/venue/social.rb
659
+ - spec/factories/event/totals.rb
660
+ - spec/factories/participant.rb
661
+ - spec/factories/event_supporter.rb
662
+ - spec/factories/memorial/photos.rb
663
+ - spec/factories/memorial/totals.rb
664
+ - spec/factories/memorial/tribute.rb
662
665
  - spec/factories/permissions.rb
663
- - spec/factories/campaign.rb