vng 2.4.0 → 3.0.0
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.md +8 -0
- data/lib/vng/contact.rb +7 -5
- data/lib/vng/mock_request.rb +1 -1
- data/lib/vng/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ce0b4bfa1bc71ea60e74d3ded65c3a610a5a9bd02d867fab27d0e59c7272a24
|
4
|
+
data.tar.gz: 85345a62558558d22899adcdf1f052d42ef19b61d160dc0d49a87604f1292695
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1d3770ed3fe0ef347ec57deb447af38ac3b93885fee6f20e557a61c7ea788001dd1d01485b4c95b9232ca7ae3e74397aaf382b77a21fb05304a33c20c6dd34a
|
7
|
+
data.tar.gz: 53d11a0458c95f71a557531821141ec120b58dafe266952a06149fac84e348c0cd1e0a80d86298dfb242a20bfeb69010f8fad53f9e026fc7cb6418c123bd7666
|
data/CHANGELOG.md
CHANGED
data/lib/vng/contact.rb
CHANGED
@@ -5,19 +5,20 @@ module Vng
|
|
5
5
|
class Contact < Resource
|
6
6
|
PATH = '/api/v1/data/Contacts/'
|
7
7
|
|
8
|
-
attr_reader :id, :first_name, :last_name, :email, :phone, :client_id
|
8
|
+
attr_reader :id, :first_name, :last_name, :email, :phone, :client_id, :edited_at
|
9
9
|
|
10
|
-
def initialize(id:, first_name:, last_name:, email:, phone:, client_id:)
|
10
|
+
def initialize(id:, first_name:, last_name:, email:, phone:, client_id:, edited_at: nil)
|
11
11
|
@id = id
|
12
12
|
@first_name = first_name
|
13
13
|
@last_name = last_name
|
14
14
|
@email = email
|
15
15
|
@phone = phone
|
16
16
|
@client_id = client_id
|
17
|
+
@edited_at = edited_at
|
17
18
|
end
|
18
19
|
|
19
|
-
def self.
|
20
|
-
body = { isCompleteObject: 'true' }
|
20
|
+
def self.edited_since(timestamp)
|
21
|
+
body = { isCompleteObject: 'true', dateStart: timestamp.to_i, dateMode: 2 }
|
21
22
|
|
22
23
|
data = request path: PATH, body: body, returning: 'Contacts'
|
23
24
|
|
@@ -30,8 +31,9 @@ module Vng
|
|
30
31
|
email = value_for_field body, 97
|
31
32
|
phone = value_for_field body, 96
|
32
33
|
client_id = value_for_relation body, 'client'
|
34
|
+
edited_at = Time.at Integer(body['dateLastEdited']), in: 'UTC'
|
33
35
|
|
34
|
-
new id: id, first_name: first_name, last_name: last_name, email: email, phone: phone, client_id: client_id
|
36
|
+
new id: id, first_name: first_name, last_name: last_name, email: email, phone: phone, client_id: client_id, edited_at: edited_at
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
data/lib/vng/mock_request.rb
CHANGED
@@ -123,7 +123,7 @@ module Vng
|
|
123
123
|
when '/api/v1/data/Contacts/'
|
124
124
|
if @body[:pageNo].eql? 1
|
125
125
|
{"Contacts" => [
|
126
|
-
{"objectID" => "2201007", "isActive" => "true", "Fields" => [
|
126
|
+
{"objectID" => "2201007", "dateLastEdited" => "1736479080", "isActive" => "true", "Fields" => [
|
127
127
|
{"fieldID"=>127, "fieldValue"=>"Vng" },
|
128
128
|
{"fieldID"=>128, "fieldValue"=>"Example" },
|
129
129
|
{"fieldID"=>97, "fieldValue"=>"vng@example.com" },
|
data/lib/vng/version.rb
CHANGED