dashx 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72a2f7bbabfb1c2a5197ef1de7919a269819a945a29844006734e33cf2a35419
4
- data.tar.gz: 19ed1f73093d99fa4f5940124891c2555e3557a4a64621f33644b8b23b342529
3
+ metadata.gz: 06ad40758bc5f6cd2a2112d112e5d5f89116236223d49d4f587e4e5b3e1fec29
4
+ data.tar.gz: 1e69514d594c29381d72bb39fa88601b19c8172344fee5cd09f23f815d2d9fec
5
5
  SHA512:
6
- metadata.gz: ef4af976040d640d984efa4511337b312cc77af5c1a7aa122efc049e5541bb8d36d522e8089224c631c8eb27f1cccc7020961ba4cbd7b96884cacc53dc7c4cd8
7
- data.tar.gz: f25b91cdacc3a6b8f5444a47e3d38d4b6fb3e131f8bfc188b28132c0b9d90f1a166e328afb43928d30c13b5414b8c4bad67c045d2f35aa2a5f1620bc9a3a6c04
6
+ metadata.gz: d8259173a1f98ea91ebd618ce630c7852bc5e95d2088e250a52867aa24dbdc4a20267c30566d4c972c525bd455737010d3a7fae8accb93bc188f98eebd2d1893
7
+ data.tar.gz: 1ed90ead1e57ac5d62caebe5717469af66e01dc44b6ccc083511d102919cfd94b4decf57263620c0eb97f9c94fa532b05f71cd0878f77023d3314f81e6af4a0a
data/README.md CHANGED
@@ -89,9 +89,30 @@ DashX.track('event_name', 'uid_of_user', { hello: 'world' })
89
89
 
90
90
  ## Development
91
91
 
92
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
92
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
93
93
 
94
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
94
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
95
+
96
+ To install this gem onto your local machine, run `bundle exec rake install`.
97
+
98
+ # Publishing
99
+
100
+ We use the amazing [gem-release](https://github.com/svenfuchs/gem-release) for releases.
101
+
102
+ **Installation**
103
+
104
+ ```
105
+ gem install gem-release
106
+ ```
107
+
108
+ **Deploying a new version**
109
+
110
+ ```
111
+ git checkout master // Ensure you're in the master branch
112
+ gem bump -v minor // Automatically sets the version number, commits
113
+ git push origin master // Push the version bump commit
114
+ gem release
115
+ ```
95
116
 
96
117
  ## Contributing
97
118
 
data/lib/dashx/client.rb CHANGED
@@ -26,6 +26,15 @@ module DashX
26
26
  }
27
27
  '
28
28
 
29
+ SAVE_CONTACTS_REQUEST = 'mutation SaveContacts($input: SaveContactsInput!) {
30
+ saveContacts(input: $input) {
31
+ contacts {
32
+ id
33
+ }
34
+ }
35
+ }
36
+ '
37
+
29
38
  def initialize(config)
30
39
  @config = config
31
40
 
@@ -105,6 +114,11 @@ module DashX
105
114
  Base64.urlsafe_encode64(encrypted_token)
106
115
  end
107
116
 
117
+ def save_contacts(uid, contacts = [])
118
+ contacts.each(&:symbolize_keys!)
119
+ make_graphql_request(SAVE_CONTACTS_REQUEST, { uid: uid, contacts: contacts })
120
+ end
121
+
108
122
  private
109
123
 
110
124
  def make_graphql_request(request, params)
data/lib/dashx/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DashX
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
data/lib/dashx.rb CHANGED
@@ -26,4 +26,8 @@ module DashX
26
26
  def self.generate_identity_token(uid)
27
27
  @clients[:default].generate_identity_token(uid)
28
28
  end
29
+
30
+ def self.save_contacts(uid, contacts)
31
+ @clients[:default].save_contacts(uid, contacts)
32
+ end
29
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dashx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DashX
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-07 00:00:00.000000000 Z
11
+ date: 2022-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty