stbaldricks 12.2.1 → 12.2.2.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: 293c8cba3aa9c26524c352bd522785f34d01f6a29c701e7e23548a56a664a171
4
- data.tar.gz: f9c03293da07ed619104ac6c2b371112d5e177304f694f0c217b18c9cfc4a266
3
+ metadata.gz: b6b06880d87b41ca451e513e1bac494a43a15105a05d52886c9366c82a01e11e
4
+ data.tar.gz: 05bef7f96bea609148ca0fc3bbc0fd7cca1de61a238c060a1f2bdac7a42491d7
5
5
  SHA512:
6
- metadata.gz: 7107911e785678e5dc317e587a0ae4712cfcdc3b9ad818adfd7f78d7f29643b9755ecaf3979a1ffbca7d7a07d46cb49abc4a2640bef0b692dfaf271d6c43cb44
7
- data.tar.gz: 20e4877fe0c689aa454736aa4360a7f7064f17e860e010a861d7aeef2b95823d8e74072cd2425828e98fd62b9d767a97bf30c9735195e10f3f1fe5c61be8eedb
6
+ metadata.gz: f3bd0496ffe9f98050bd49a8ac7c03fbbc5d139d472894359cdb6d499a9d182099525f69d899b0e6e63afdb959629075e24a2ead98b2a9d37be80ec47c9255ff
7
+ data.tar.gz: d5226ae54647c5006877663560dbdd2834e0a0cbb1f6324580635d53063e0f917a07a988bb1e5dc529bc842dd949c061b292a5ca152460b0d6f018f6c8e57596
@@ -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
  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.1'.freeze
3
+ VERSION = '12.2.2.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.1
4
+ version: 12.2.2.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-22 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/organization/addresses.rb
569
- - spec/factories/organization/email_addresses.rb
570
- - spec/factories/organization/phone_numbers.rb
571
- - spec/factories/payment.rb
572
- - spec/factories/fundraising_page.rb
573
- - spec/factories/donation/participant.rb
574
- - spec/factories/challenge.rb
575
- - spec/factories/kid_institution.rb
576
- - spec/factories/memorial/totals.rb
577
- - spec/factories/memorial/photos.rb
578
- - spec/factories/memorial/tribute.rb
579
- - spec/factories/search_kid.rb
580
- - spec/factories/contact.rb
581
- - spec/factories/researcher.rb
582
- - spec/factories/photos.rb
583
- - spec/factories/challenger.rb
584
- - spec/factories/name_pieces.rb
585
- - spec/factories/milestone.rb
586
- - spec/factories/person/policies.rb
587
- - spec/factories/person/addresses.rb
588
- - spec/factories/person/email_addresses.rb
589
- - spec/factories/person/phone_numbers.rb
590
- - spec/factories/participant/policies.rb
591
- - spec/factories/participant/totals.rb
570
+ - spec/factories/participant/rankings.rb
592
571
  - spec/factories/participant/photos.rb
593
572
  - spec/factories/participant/roles/role.rb
594
- - spec/factories/participant/rankings/ranking.rb
595
- - spec/factories/participant/rankings.rb
573
+ - spec/factories/participant/policies.rb
574
+ - spec/factories/participant/totals.rb
596
575
  - spec/factories/participant/roles.rb
597
- - spec/factories/donation.rb
598
- - spec/factories/third_party_media.rb
599
- - spec/factories/search_team.rb
600
- - spec/factories/permissions.rb
601
- - spec/factories/photo.rb
602
- - spec/factories/collection.rb
603
- - spec/factories/campaign.rb
576
+ - spec/factories/participant/rankings/ranking.rb
577
+ - spec/factories/search_fundraiser.rb
578
+ - spec/factories/newsletter_recipient.rb
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
604
591
  - spec/factories/grant.rb
605
- - spec/factories/location.rb
606
- - spec/factories/email_address.rb
607
- - spec/factories/disease.rb
608
- - spec/factories/participant.rb
609
- - spec/factories/kid.rb
592
+ - spec/factories/search_team.rb
610
593
  - spec/factories/search_participant.rb
611
- - spec/factories/event_supporter.rb
612
- - spec/factories/page.rb
594
+ - spec/factories/name_pieces.rb
595
+ - spec/factories/researcher.rb
596
+ - spec/factories/photos.rb
597
+ - spec/factories/donor.rb
598
+ - spec/factories/diagnosis.rb
599
+ - spec/factories/kid_institution.rb
613
600
  - spec/factories/message.rb
614
- - spec/factories/response.rb
615
601
  - spec/factories/search_event.rb
602
+ - spec/factories/photo.rb
603
+ - spec/factories/event.rb
604
+ - spec/factories/organization.rb
605
+ - spec/factories/campaign.rb
606
+ - spec/factories/kid/custom_institution.rb
607
+ - spec/factories/fundraising_page.rb
608
+ - spec/factories/contact.rb
616
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
615
+ - spec/factories/institution.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
622
+ - spec/factories/person/policies.rb
623
+ - spec/factories/person/addresses.rb
624
+ - spec/factories/person/email_addresses.rb
625
+ - spec/factories/collection.rb
617
626
  - spec/factories/fundraiser.rb
618
- - spec/factories/team.rb
619
- - spec/factories/memorial.rb
620
- - spec/factories/diagnosis.rb
621
- - spec/factories/team/totals.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
622
632
  - spec/factories/team/photos.rb
633
+ - spec/factories/team/totals.rb
623
634
  - spec/factories/team/rankings/ranking.rb
624
- - spec/factories/team/rankings.rb
625
- - spec/factories/newsletter_recipient.rb
626
- - spec/factories/shave_schedule.rb
627
- - spec/factories/organization.rb
635
+ - spec/factories/kid_honor.rb
636
+ - spec/factories/disease.rb
637
+ - spec/factories/payment.rb
638
+ - spec/factories/search_kid.rb
639
+ - spec/factories/user.rb
628
640
  - spec/factories/campaign/totals.rb
629
- - spec/factories/lib/helpers.rb
630
- - spec/factories/lib/faker_patch.rb
631
- - spec/factories/error.rb
632
- - spec/factories/donor.rb
633
- - spec/factories/contact_group.rb
634
- - spec/factories/recurring_gift.rb
635
- - spec/factories/person.rb
636
- - spec/factories/treatment_status.rb
637
- - spec/factories/fundraiser/policies.rb
638
- - spec/factories/fundraiser/totals.rb
639
- - spec/factories/fundraiser/photos.rb
640
- - spec/factories/venue.rb
641
- - spec/factories/search_fundraiser.rb
642
- - spec/factories/institution.rb
643
- - spec/factories/grant_institution.rb
644
- - spec/factories/address.rb
645
- - spec/factories/phone.rb
646
- - spec/factories/event/totals.rb
647
- - spec/factories/event/photos.rb
648
- - spec/factories/event/contacts/contact.rb
649
- - spec/factories/event/contacts/name_pieces.rb
650
- - spec/factories/event/coach_tracking/coaching_interactions.rb
641
+ - spec/factories/organization/phone_numbers.rb
642
+ - spec/factories/organization/addresses.rb
643
+ - spec/factories/organization/email_addresses.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
651
650
  - spec/factories/event/coach_tracking/proceeds.rb
652
651
  - spec/factories/event/coach_tracking/plaque.rb
652
+ - spec/factories/event/coach_tracking/coaching_interactions.rb
653
+ - spec/factories/event/photos.rb
653
654
  - spec/factories/event/coach_tracking.rb
655
+ - spec/factories/event/contacts/name_pieces.rb
656
+ - spec/factories/event/contacts/contact.rb
654
657
  - spec/factories/event/venue/location.rb
655
658
  - spec/factories/event/venue/social.rb
656
- - spec/factories/event/contacts.rb
657
- - spec/factories/event/venue.rb
658
- - spec/factories/fund.rb
659
- - spec/factories/event.rb
660
- - spec/factories/kid/custom_institution.rb
661
- - spec/factories/shave_schedule/time_selection_permissions.rb
662
- - spec/factories/user.rb
663
- - spec/factories/kid_honor.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
665
+ - spec/factories/permissions.rb