moreapp-api 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: c97dec146d082c2364c34954725119064c0a368f
4
- data.tar.gz: 98653ba574c07848b20517cc0e195d2485cd3431
3
+ metadata.gz: be48822790a7912dbebb4264577152926e184e51
4
+ data.tar.gz: 4b6b1200cfa24b61090d11be7a37627411397716
5
5
  SHA512:
6
- metadata.gz: 607fa79765744e87428cbf2cd38c90ec4003224d2149d9c90c9b1e435cb674d3bf73a7a385033ff54feef2590933f4759d88ddbe2c0427b2973f9e11ae25ed17
7
- data.tar.gz: 569b6a5929c9bdde7ec306555f154a71e9647002cef034f82531c8dd246610f673cd63907b0afd9e1c4ddcedc8d7ce10198e41f616e591009adfe372db2fe113
6
+ metadata.gz: b3057624050241beecdb2dae40d1ca595baffeb81adca61c476722bbbd27245df3d301e6b7643264e4a1a52e0df64bf1f4e91c7b34e7a0f17f27cc989f3cc719
7
+ data.tar.gz: 3cb3ce76c736a86d14e6af806e27adfd23e2a274b35354f29c663121a67a165a0524fe5258a4c96a7a80a06ee478422638f953046179713dbeac85f907ceea36
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -27,9 +27,9 @@ puts "My folder has forms = #{my_folder.forms.inspect}"
27
27
 
28
28
  my_form = my_folder.forms.first
29
29
 
30
- my_registrations = my_form.registrations
30
+ my_submissions = my_form.submissions
31
31
 
32
- puts my_registrations.inspect
32
+ puts my_submissions.inspect
33
33
 
34
34
 
35
35
  puts "Post an instruction!"
@@ -39,7 +39,7 @@ form_data = {
39
39
  description: "You should visit this place and conduct our survey!",
40
40
  }
41
41
 
42
- response = my_form.post_instruction("nathanvda@gmail.com", "RELAX! This is only a test!", form_data)
42
+ response = my_form.post_instruction("some-person@someemaildomain.com", "RELAX! This is only a test!", form_data)
43
43
 
44
44
  puts response.inspect
45
45
 
@@ -14,11 +14,11 @@ class MoreappAPI
14
14
  end
15
15
 
16
16
  def folders
17
- response = @moreapp_api.request(:get, "/api/v1.0/customers/#{self.id}/folders")
17
+ response = @moreapp_api.request(:get, "/api/v1.0/forms/customer/#{self.id}/folders")
18
18
 
19
19
  folders = JSON.parse(response.body)
20
20
  folders.map{|data| MoreappAPI::Folder.new(self, data)}
21
21
  end
22
22
 
23
23
  end
24
- end
24
+ end
@@ -1,4 +1,4 @@
1
- require_relative 'registration'
1
+ require_relative 'submission'
2
2
 
3
3
 
4
4
  class MoreappAPI
@@ -33,23 +33,29 @@ class MoreappAPI
33
33
  end
34
34
 
35
35
 
36
- def registrations(page=0, options = {})
36
+
37
+ def submissions(page=0, options = {})
37
38
  options[:pageSize] ||= 100
38
39
  options[:sort] ||= []
39
40
  options[:query] ||= []
40
- response = @moreapp_api.request(:post, "/api/v1.0/customers/#{@customer_id}/folders/#{@folder_id}/forms/#{self.id}/registrations/filter/#{page}",
41
+ response = @moreapp_api.request(:post, "/api/v1.0/customers/#{@customer_id}/forms/#{self.id}/submissions/filter/#{page}",
41
42
  { pageSize: options[:pageSize], sort: options[:sort], query: options[:query] }.to_json,
42
43
  { 'Content-Type' => 'application/json' } )
43
44
 
44
45
  registrations = JSON.parse(response.body)
45
- registrations.map{|data| MoreappAPI::Registration.new(self, data)}
46
+ registrations.map{|data| MoreappAPI::Submission.new(self, data)}
47
+ end
48
+
49
+
50
+ def registrations(page=0, options={})
51
+ submissions page, options
46
52
  end
47
53
 
48
54
 
49
55
  def post_instruction(recipients, message, data, options={})
50
56
  recipients = recipients.is_a?(String) ? [recipients] : recipients
51
57
 
52
- response = @moreapp_api.request(:post, "/api/v1.0/customers/#{@customer_id}/#{@folder_id}/#{self.id}/instructions",
58
+ response = @moreapp_api.request(:post, "/api/v1.0/customers/#{@customer_id}/#{self.id}/instructions",
53
59
  {
54
60
  publishInfo: {type: "IMMEDIATE"},
55
61
  recipients: recipients,
@@ -61,4 +67,4 @@ class MoreappAPI
61
67
  end
62
68
 
63
69
  end
64
- end
70
+ end
@@ -8,6 +8,7 @@ class MoreappAPI
8
8
 
9
9
  def post(filename, content_type = 'image/png')
10
10
  # !!! Undocumented more-app API
11
+ # !!! TODO verify this still works after API changes of 08/2020
11
12
 
12
13
  image_data = Base64.encode64(File.open(filename, "rb").read)
13
14
 
@@ -26,4 +27,4 @@ class MoreappAPI
26
27
 
27
28
 
28
29
  end
29
- end
30
+ end
@@ -1,5 +1,5 @@
1
1
  class MoreappAPI
2
- class Registration
2
+ class Submission
3
3
 
4
4
  attr_accessor :id, :name, :raw_data
5
5
 
@@ -11,4 +11,4 @@ class MoreappAPI
11
11
  end
12
12
 
13
13
  end
14
- end
14
+ end
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: moreapp-api 0.0.2 ruby lib
5
+ # stub: moreapp-api 0.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "moreapp-api".freeze
9
- s.version = "0.0.2"
9
+ s.version = "0.0.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["'nathanvda'".freeze]
14
- s.date = "2019-04-24"
14
+ s.date = "2021-01-29"
15
15
  s.description = "This gem allows you to connect to the moreapp API to send instructions and retrieve the registrations".freeze
16
16
  s.email = "'nathan@dixis.com'".freeze
17
17
  s.extra_rdoc_files = [
@@ -35,8 +35,8 @@ Gem::Specification.new do |s|
35
35
  "lib/moreapp_api/customer.rb",
36
36
  "lib/moreapp_api/folder.rb",
37
37
  "lib/moreapp_api/form.rb",
38
- "lib/moreapp_api/registration.rb",
39
38
  "lib/moreapp_api/registration_file.rb",
39
+ "lib/moreapp_api/submission.rb",
40
40
  "moreapp-api.gemspec",
41
41
  "spec/moreapp_api_spec.rb",
42
42
  "spec/spec_helper.rb"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moreapp-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'nathanvda'"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-24 00:00:00.000000000 Z
11
+ date: 2021-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth
@@ -147,8 +147,8 @@ files:
147
147
  - lib/moreapp_api/customer.rb
148
148
  - lib/moreapp_api/folder.rb
149
149
  - lib/moreapp_api/form.rb
150
- - lib/moreapp_api/registration.rb
151
150
  - lib/moreapp_api/registration_file.rb
151
+ - lib/moreapp_api/submission.rb
152
152
  - moreapp-api.gemspec
153
153
  - spec/moreapp_api_spec.rb
154
154
  - spec/spec_helper.rb