saasu2 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +9 -1
- data/README.md +16 -1
- data/lib/saasu/contact_aggregate.rb +3 -0
- data/lib/saasu/file_identity.rb +7 -0
- data/lib/saasu/invoice.rb +12 -0
- data/lib/saasu/search.rb +18 -3
- data/lib/saasu/user.rb +6 -0
- data/lib/saasu/version.rb +1 -1
- data/lib/saasu.rb +3 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a8d35ea5e24cb6fe01ec9f88b9b46fb34a373d3
|
4
|
+
data.tar.gz: 3d71d23be75c004dee22405fd70ee1f1a9b54624
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ac5b6e2b2c049042a34eef4d7d670ddd1d038bc77ab8dabdf9b5be3599766bccab348f51b39581c695d53c75a75f79088ffd8d6642a2187bc411ef1f2b7bd57
|
7
|
+
data.tar.gz: 35981f4eb95688dd6d94d65477e142312baab4d51245d44f061794a022d8e105f9c9e5c8249111a2b189d9d2faac0629a7c85ce4d4628ff940757a5d02865686
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
+
==== Version 0.1.4
|
2
|
+
Features:
|
3
|
+
* Saasu::User.reset_password – Allows a user to request that a password reset email be generated and sent to them.
|
4
|
+
* Sassu::FileIdentity - list the set of files a user has access to.
|
5
|
+
* Saasu::ContactAggregate - allows a user to add a Contact with a related company and contact manager in one call. This can also be retrieved and updated BUT NO delete operation is allowed.
|
6
|
+
* Saasu::Search - new filtering options for transaction_type.
|
7
|
+
* Saasu::Invoice#email - allows emailing to the contact on the invoice or emailing to a specified email address.
|
8
|
+
|
1
9
|
==== Version 0.1.2
|
2
10
|
Features:
|
3
11
|
* Add support #create, #update, #destroy methods for /Items API
|
4
|
-
* Add support for /Search endpoint
|
12
|
+
* Add support for /Search endpoint
|
data/README.md
CHANGED
@@ -42,6 +42,9 @@ You can access the following objects:
|
|
42
42
|
- Saasu::Payment
|
43
43
|
- Saasu::TaxCode
|
44
44
|
- Saasu::Search
|
45
|
+
- Saasu::User
|
46
|
+
- Saasu::FileIdentity
|
47
|
+
- Saasu::ContactAggregate
|
45
48
|
|
46
49
|
Usage examples:
|
47
50
|
|
@@ -76,13 +79,25 @@ contact['GivenName'] = 'John'
|
|
76
79
|
# get all attributes
|
77
80
|
contact.attributes
|
78
81
|
|
79
|
-
# Search. Available scopes: All, Transactions, Contacts, InventoryItems.
|
82
|
+
# Search. Available scopes: All, Transactions, Contacts, InventoryItems.
|
80
83
|
query = Saasu::Search.new('Book', 'InventoryItems')
|
81
84
|
query.perform
|
82
85
|
|
83
86
|
query.contacts
|
84
87
|
query.items
|
85
88
|
query.invoices
|
89
|
+
|
90
|
+
# You can filter search results by transaction type - Sale, Purchase, Journal, Payroll
|
91
|
+
query = Saasu::Search.new('Book', scope: 'InventoryItems', transaction_type: 'Sale')
|
92
|
+
|
93
|
+
# or you can use the default scope - 'All'
|
94
|
+
query = Saasu::Search.new('Book', transaction_type: 'Purchase')
|
95
|
+
|
96
|
+
# reset user password
|
97
|
+
Saasu::User.reset_password('user@saasu.com')
|
98
|
+
|
99
|
+
# list the set of files a user has access to
|
100
|
+
Saasu::FileIdentity.all
|
86
101
|
```
|
87
102
|
|
88
103
|
Note - Saasu uses .NET naming convention for fields and filters eg. GivenName, LastModifiedDate
|
data/lib/saasu/invoice.rb
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
class Saasu::Invoice < Saasu::Base
|
2
2
|
allowed_methods :show, :index, :destroy, :update, :create
|
3
3
|
filter_by %W(InvoiceNumber LastModifiedFromDate LastModifiedToDate TransactionType Tags TagSelection InvoiceFromDate InvoiceToDate InvoiceStatus PaymentStatus ContactId)
|
4
|
+
|
5
|
+
def email(email_address = nil)
|
6
|
+
if email_address.present?
|
7
|
+
url = ['Invoice', id, 'email'].join('/')
|
8
|
+
params = { EmailTo: email_address }
|
9
|
+
else
|
10
|
+
url = ['Invoice', id, 'email-contact'].join('/')
|
11
|
+
params = {}
|
12
|
+
end
|
13
|
+
|
14
|
+
Saasu::Client.request(:post, url, params)
|
15
|
+
end
|
4
16
|
end
|
data/lib/saasu/search.rb
CHANGED
@@ -3,8 +3,17 @@ module Saasu
|
|
3
3
|
VALID_SCOPES = %W(All Transactions Contacts InventoryItems)
|
4
4
|
attr_accessor :scope, :keywords
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
# allowed params:
|
7
|
+
# :scope - All, Transactions, Contacts, InventoryItems
|
8
|
+
# :transaction_type - Sale, Purchase, Journal, Payroll
|
9
|
+
def initialize(keywords, params = {})
|
10
|
+
if params.is_a?(Hash)
|
11
|
+
@scope = params[:scope].presence || 'All'
|
12
|
+
@transaction_type = "Transactions.#{params[:transaction_type]}" if params[:transaction_type].present?
|
13
|
+
else
|
14
|
+
@scope = params
|
15
|
+
end
|
16
|
+
|
8
17
|
@keywords = keywords
|
9
18
|
|
10
19
|
validate_scope!
|
@@ -34,8 +43,14 @@ module Saasu
|
|
34
43
|
end
|
35
44
|
|
36
45
|
private
|
46
|
+
def search_params
|
47
|
+
_params = { Scope: @scope, Keywords: @keywords, IncludeSearchTermHighlights: false }
|
48
|
+
_params[:TransactionType] = @transaction_type if @transaction_type.present?
|
49
|
+
_params
|
50
|
+
end
|
51
|
+
|
37
52
|
def perform_search!
|
38
|
-
@search_results = Saasu::Client.request(:get, 'search',
|
53
|
+
@search_results = Saasu::Client.request(:get, 'search', search_params)
|
39
54
|
end
|
40
55
|
|
41
56
|
def search_results
|
data/lib/saasu/user.rb
ADDED
data/lib/saasu/version.rb
CHANGED
data/lib/saasu.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saasu2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sinenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -177,12 +177,15 @@ files:
|
|
177
177
|
- lib/saasu/company.rb
|
178
178
|
- lib/saasu/config.rb
|
179
179
|
- lib/saasu/contact.rb
|
180
|
+
- lib/saasu/contact_aggregate.rb
|
181
|
+
- lib/saasu/file_identity.rb
|
180
182
|
- lib/saasu/invoice.rb
|
181
183
|
- lib/saasu/invoice_attachment.rb
|
182
184
|
- lib/saasu/item.rb
|
183
185
|
- lib/saasu/payment.rb
|
184
186
|
- lib/saasu/search.rb
|
185
187
|
- lib/saasu/tax_code.rb
|
188
|
+
- lib/saasu/user.rb
|
186
189
|
- lib/saasu/version.rb
|
187
190
|
- saasu2.gemspec
|
188
191
|
homepage: https://api.saasu.com
|
@@ -205,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
208
|
version: '0'
|
206
209
|
requirements: []
|
207
210
|
rubyforge_project:
|
208
|
-
rubygems_version: 2.
|
211
|
+
rubygems_version: 2.4.8
|
209
212
|
signing_key:
|
210
213
|
specification_version: 4
|
211
214
|
summary: Ruby wrapper for Saasu API.
|