sugarcrm_rest 0.1.1 → 0.1.2
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/README.md +2 -2
- data/lib/sugarcrm_rest.rb +5 -9
- data/lib/sugarcrm_rest/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd7a7a4127b0ee2e4e87ad3f604d511b973124294ccf634c1fb2b74b7481b26b
|
4
|
+
data.tar.gz: 2355732d73c0d5c52acfc101a15f8ebb78c3c6b3d7703e996600366d40753f40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce1e79ab3ca2e6acb4faedea4f9c3f18a6190f9e6b24d5ee1a5a64534b65cd59ba21da346a1eeaa473ca93940420cb6cfb37e83c7cd9511ae6096194cbba232c
|
7
|
+
data.tar.gz: 57ce8a069646a00fd707d759f0ba8a9ce244e7a27290c3e8109b29059cf3bbae2df60a263811ee46cb45241e4f827cdf3873dcd792ef597839315c42cbda3bad
|
data/README.md
CHANGED
@@ -22,9 +22,9 @@ Or install it yourself as:
|
|
22
22
|
```r
|
23
23
|
connect=SugarcrmRest::Connect.new(consumer_key,consumer_secret,username,password,platform,url) #Provide the connection object
|
24
24
|
SugarcrmRest::Fetch_Data.fetch_single_record(connect,module_name,id) #Give the record with specified id from specified module
|
25
|
-
SugarcrmRest::Fetch_Data.fetch_all_data(connect,module_name,offset) #Fetch data from specified module according to offset
|
25
|
+
SugarcrmRest::Fetch_Data.fetch_all_data(connect,module_name,offset,maxnum) #Fetch data from specified module according to offset
|
26
26
|
SugarcrmRest::Fetch_Data.fetch_data_with_filters(connect,module_name,filter_json,fields=["no"],offset=0) #Return a json object of data having specified fields by applying specified filters
|
27
|
-
SugarcrmRest::Fetch_Data.upload_document(connect,id,
|
27
|
+
SugarcrmRest::Fetch_Data.upload_document(connect,id,path) #upload the file having specified path and id to doccument module
|
28
28
|
|
29
29
|
SugarcrmRest::Update_Sugar.create_new_record(connect,module_name,params) #Creating new record in specified module
|
30
30
|
SugarcrmRest::Update_Sugar.update_data(connect,module_name,params,id) #update fields of specified id and module
|
data/lib/sugarcrm_rest.rb
CHANGED
@@ -85,8 +85,8 @@ class Fetch_Data
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
#fetch all data from agiven module
|
88
|
-
def self.fetch_all_data(connect,module_name,offset)
|
89
|
-
url = ''+"#{connect.url}"+"#{module_name}"+"?offset="+"#{offset}"+''
|
88
|
+
def self.fetch_all_data(connect,module_name,offset=0,max_num=100)
|
89
|
+
url = ''+"#{connect.url}"+"#{module_name}"+"?offset="+"#{offset}"+"&max_num="+"+#{max_num}"+''
|
90
90
|
response = Get_Token_Process_Url.execute_uri(connect,url)
|
91
91
|
if response.kind_of? Net::HTTPSuccess
|
92
92
|
root = JSON.parse response.body
|
@@ -166,11 +166,9 @@ class Fetch_Data
|
|
166
166
|
end
|
167
167
|
|
168
168
|
|
169
|
-
def upload_document(connect,id,
|
169
|
+
def self.upload_document(connect,id,path)
|
170
170
|
|
171
|
-
@token=Get_Token_Process_Url.authenticate
|
172
|
-
puts @token
|
173
|
-
path = File.join(__dir__,filename)
|
171
|
+
@token=Get_Token_Process_Url.authenticate(connect)
|
174
172
|
f=File.new(path,'rb')
|
175
173
|
response = RestClient::Request.execute(
|
176
174
|
:url => "#{connect.url}/Documents/#{id}/file/filename",
|
@@ -199,7 +197,7 @@ class Fetch_Data
|
|
199
197
|
|
200
198
|
def self.create_new_record(connect,module_name,params)
|
201
199
|
|
202
|
-
url=
|
200
|
+
url=''+"#{connect.url}"+module_name
|
203
201
|
uri = URI.parse url
|
204
202
|
http = Net::HTTP.new(uri.host, uri.port)
|
205
203
|
request = Net::HTTP::Post.new(uri)
|
@@ -219,7 +217,6 @@ class Fetch_Data
|
|
219
217
|
|
220
218
|
def self.update_data(connect,module_name,params,id)
|
221
219
|
url=''+"#{connect.url}"+module_name+'/'+id
|
222
|
-
p url
|
223
220
|
uri = URI.parse url
|
224
221
|
http = Net::HTTP.new(uri.host, uri.port)
|
225
222
|
request = Net::HTTP::Put.new(uri)
|
@@ -239,7 +236,6 @@ class Fetch_Data
|
|
239
236
|
|
240
237
|
def self.delete_record(connect,module_name,id)
|
241
238
|
url=''+"#{connect.url}"+module_name+'/'+id
|
242
|
-
p url
|
243
239
|
uri = URI.parse url
|
244
240
|
http = Net::HTTP.new(uri.host, uri.port)
|
245
241
|
request = Net::HTTP::Delete.new(uri)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugarcrm_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sruthi PN
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
description:
|
55
|
+
description:
|
56
56
|
email:
|
57
57
|
- pn.sruthinarayanan@gmail.com
|
58
58
|
executables: []
|
@@ -76,7 +76,7 @@ homepage: https://bitbucket.org/sruthipn96/sugarcrm_rest
|
|
76
76
|
licenses:
|
77
77
|
- MIT
|
78
78
|
metadata: {}
|
79
|
-
post_install_message:
|
79
|
+
post_install_message:
|
80
80
|
rdoc_options: []
|
81
81
|
require_paths:
|
82
82
|
- lib
|
@@ -91,8 +91,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
|
-
rubygems_version: 3.
|
95
|
-
signing_key:
|
94
|
+
rubygems_version: 3.2.3
|
95
|
+
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: A gem for communicating with sugarcrm
|
98
98
|
test_files: []
|