selligent 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: de6faef8370041f9b1f8c5da19505e395fdcd8d8a6a3d1e4558bfd933651e220
4
- data.tar.gz: 8e449eeb011415cc0f00166148e8509a3e10f671b6235b140b057fb595bba931
3
+ metadata.gz: ad45d9f6139a62885e82c40fea33f78c288b8a42a652cbfd71924410676072a6
4
+ data.tar.gz: 2325d061753ff1a97eb91c8ef3f7674b92cfabdd7423c1d8b9ec22f222d877ea
5
5
  SHA512:
6
- metadata.gz: eccae6c1af4879c29655efcc115370f1bfcbb96feec983ef7a92021a256767e0995b19f7d6e5add573d9add8d8ea5e8735f19520f47f17ddc14b7dc9d8c5dd0d
7
- data.tar.gz: abea162c004234d8cbaf7117f0c674d12ada5f9a5702b8abbf30a93d3b01e5cbc069ef2002a4d83fdac62579428c2b8f323c8271224abe0c50ab07d2996cd56e
6
+ metadata.gz: 524d8e138358e6d1a884cebebb739915412a78efd38cee0e47163a6dc2f8886ba994e2314a0e3c6d77daf3746a3621ac375cb0941b626d09a6f3c8039ac16e7a
7
+ data.tar.gz: 25a74dc22bdd7b46daaa9a48112dc1cd762a3f2cf5893fd8eb80c61accfb590293e416ac082b4e0722007ae13a5e3ad20e4b8c04b8cf49d46229d1c525d592cd
data/.circleci/config.yml CHANGED
@@ -1,87 +1,38 @@
1
- version: 2.0
1
+ version: 2.1
2
2
 
3
- jobs:
4
- ruby2.2:
5
- docker:
6
- - image: circleci/ruby:2.2
7
- steps:
8
- - checkout
9
- - restore_cache:
10
- key: gemfile-2-2-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
11
- - run: bundle install -j3 --path vendor/bundle
12
- - save_cache:
13
- key: gemfile-2-2-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
14
- paths:
15
- - vendor/bundle
16
- - run: bundle check --path vendor/bundle
17
- - run: bundle exec rubocop
18
- - run: |
19
- bundle exec rspec --profile 10 \
20
- --format RspecJunitFormatter \
21
- --out tmp/results/rspec.xml \
22
- --format progress \
23
- $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
24
- - store_test_results:
25
- path: tmp/results
3
+ docker-auth: &docker-auth
4
+ auth:
5
+ username: $DOCKERHUB_USERNAME
6
+ password: $DOCKERHUB_ACCESS_TOKEN
26
7
 
27
- ruby2.3:
28
- docker:
29
- - image: circleci/ruby:2.3
30
- steps:
31
- - checkout
32
- - restore_cache:
33
- key: gemfile-2-3-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
34
- - run: bundle install -j3 --path vendor/bundle
35
- - save_cache:
36
- key: gemfile-2-3-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
37
- paths:
38
- - vendor/bundle
39
- - run: bundle check --path vendor/bundle
40
- - run: bundle exec rubocop
41
- - run: |
42
- bundle exec rspec --profile 10 \
43
- --format RspecJunitFormatter \
44
- --out tmp/results/rspec.xml \
45
- --format progress \
46
- $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
47
- - store_test_results:
48
- path: tmp/results
49
-
50
- ruby2.4:
8
+ jobs:
9
+ bundle:
10
+ parameters:
11
+ ruby_version: { type: string }
51
12
  docker:
52
- - image: circleci/ruby:2.4
13
+ - image: cimg/ruby:<< parameters.ruby_version >>
14
+ <<: *docker-auth
53
15
  steps:
54
16
  - checkout
55
17
  - restore_cache:
56
- key: gemfile-2-4-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
57
- - run: bundle install -j3 --path vendor/bundle
18
+ key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
19
+ - run: bundle install -j3
58
20
  - save_cache:
59
- key: gemfile-2-4-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
21
+ key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
60
22
  paths:
61
23
  - vendor/bundle
62
- - run: bundle check --path vendor/bundle
63
- - run: bundle exec rubocop
64
- - run: |
65
- bundle exec rspec --profile 10 \
66
- --format RspecJunitFormatter \
67
- --out tmp/results/rspec.xml \
68
- --format progress \
69
- $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
70
- - store_test_results:
71
- path: tmp/results
72
24
 
73
- ruby2.5:
25
+ ruby:
26
+ parameters:
27
+ ruby_version: { type: string }
74
28
  docker:
75
- - image: circleci/ruby:2.5
29
+ - image: cimg/ruby:<< parameters.ruby_version >>
30
+ <<: *docker-auth
76
31
  steps:
77
32
  - checkout
78
33
  - restore_cache:
79
- key: gemfile-2-5-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
80
- - run: bundle install -j3 --path vendor/bundle
81
- - save_cache:
82
- key: gemfile-2-5-{{ checksum "Gemfile" }}-{{ checksum "selligent.gemspec" }}
83
- paths:
84
- - vendor/bundle
34
+ key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
35
+ - run: gem install bundler:2.3.26
85
36
  - run: bundle check --path vendor/bundle
86
37
  - run: bundle exec rubocop
87
38
  - run: |
@@ -93,12 +44,19 @@ jobs:
93
44
  - store_test_results:
94
45
  path: tmp/results
95
46
 
96
-
97
47
  workflows:
98
48
  version: 2
99
49
  build:
100
50
  jobs:
101
- - ruby2.2
102
- - ruby2.3
103
- - ruby2.4
104
- - ruby2.5
51
+ - bundle:
52
+ context: org-global
53
+ matrix:
54
+ parameters:
55
+ ruby_version: ['2.7', '3.0']
56
+ - ruby:
57
+ context: org-global
58
+ matrix:
59
+ parameters:
60
+ ruby_version: ['2.7', '3.0']
61
+ requires:
62
+ - bundle
data/.rubocop.yml CHANGED
@@ -1,3 +1,6 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.7
3
+
1
4
  Metrics/BlockLength:
2
5
  Exclude:
3
6
  - 'spec/**/*'
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  group :development do
data/README.md CHANGED
@@ -261,6 +261,13 @@ Selligent.cumulio_datasets
261
261
  Selligent.cumulio_query(model)
262
262
  ```
263
263
 
264
+ ### Custom journey
265
+
266
+ ```ruby
267
+ # Trigger custom journey. Reffer to the docs from CRM team for input.
268
+ Selligent.trigger_custom_journey(api_name, entrypoint_name, input)
269
+ ```
270
+
264
271
  ### Status
265
272
 
266
273
  ```ruby
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Selligent
4
+ class Client
5
+ # Implements the custom journeys endpoints
6
+ #
7
+ # /organizations/:organization/journeys/custom/:api_name/entrypoints/:entrypoint_name/trigger
8
+ module CustomJourney
9
+ # Trigger execution of a custom journey
10
+ #
11
+ # The input has the following shape:
12
+ # Please note that parameter_values will differ per journey
13
+ #
14
+ # {
15
+ # "user_id": 0,
16
+ # "parameter_values": {
17
+ # "catawiki_id": Interger,
18
+ # "bid_timestamp": String
19
+ # }
20
+ # }
21
+ #
22
+ # @param user_id [Integer] Internal Selligent user ID. Sent as 0 by default.
23
+ # @param parameter_values [Hash] The input data in the format provided by the CRM team.
24
+ def trigger_custom_journey(api_name, entrypoint_name, input)
25
+ post "#{base_url}/journeys/custom/#{api_name}/entrypoints/#{entrypoint_name}/trigger", input
26
+ end
27
+ end
28
+ end
29
+ end
@@ -4,6 +4,7 @@ require 'selligent/configuration'
4
4
  require 'selligent/connection'
5
5
  require 'selligent/client/content'
6
6
  require 'selligent/client/cumulio'
7
+ require 'selligent/client/custom_journey'
7
8
  require 'selligent/client/data'
8
9
  require 'selligent/client/journeys'
9
10
  require 'selligent/client/lists'
@@ -24,6 +25,7 @@ module Selligent
24
25
  include Selligent::Connection
25
26
  include Selligent::Client::Content
26
27
  include Selligent::Client::Cumulio
28
+ include Selligent::Client::CustomJourney
27
29
  include Selligent::Client::Data
28
30
  include Selligent::Client::Journeys
29
31
  include Selligent::Client::Lists
@@ -8,7 +8,7 @@ module Selligent
8
8
  module Middlewares
9
9
  # Auth is a Faraday middleware
10
10
  class Authorization < ::Faraday::Middleware
11
- AUTH_HEADER = 'X-ApiKey'.freeze
11
+ AUTH_HEADER = 'X-ApiKey'
12
12
 
13
13
  def call(env)
14
14
  env[:request_headers][AUTH_HEADER] = auth_header
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Selligent
4
- VERSION = '0.1.3'.freeze
4
+ VERSION = '0.1.4'
5
5
  end
data/selligent.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'selligent/version'
@@ -11,15 +13,16 @@ Gem::Specification.new do |s|
11
13
  s.homepage = 'https://github.com/catawiki/selligent-rb'
12
14
  s.summary = 'Selligent Ruby API client'
13
15
  s.description = 'Provides access to the Selligent REST API'
14
- s.license = 'proprietary'
16
+ s.license = 'MIT'
17
+ s.required_ruby_version = '>= 2.7'
15
18
 
16
- s.files = `git ls-files -z`.split("\x0").reject do |f|
19
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
17
20
  f.match(%r{^(test|spec|features)/})
18
21
  end
19
22
 
20
23
  s.require_paths = ['lib']
21
24
 
22
- s.add_development_dependency 'bundler', '~> 1.16'
25
+ s.add_development_dependency 'bundler', '~> 2.3'
23
26
  s.add_dependency 'faraday'
24
27
  s.add_dependency 'faraday_middleware'
25
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selligent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Werner Hofstra
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-13 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '2.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.16'
26
+ version: '2.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -69,6 +69,7 @@ files:
69
69
  - lib/selligent/client.rb
70
70
  - lib/selligent/client/content.rb
71
71
  - lib/selligent/client/cumulio.rb
72
+ - lib/selligent/client/custom_journey.rb
72
73
  - lib/selligent/client/data.rb
73
74
  - lib/selligent/client/journeys.rb
74
75
  - lib/selligent/client/lists.rb
@@ -86,9 +87,9 @@ files:
86
87
  - selligent.gemspec
87
88
  homepage: https://github.com/catawiki/selligent-rb
88
89
  licenses:
89
- - proprietary
90
+ - MIT
90
91
  metadata: {}
91
- post_install_message:
92
+ post_install_message:
92
93
  rdoc_options: []
93
94
  require_paths:
94
95
  - lib
@@ -96,15 +97,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
97
  requirements:
97
98
  - - ">="
98
99
  - !ruby/object:Gem::Version
99
- version: '0'
100
+ version: '2.7'
100
101
  required_rubygems_version: !ruby/object:Gem::Requirement
101
102
  requirements:
102
103
  - - ">="
103
104
  - !ruby/object:Gem::Version
104
105
  version: '0'
105
106
  requirements: []
106
- rubygems_version: 3.0.1
107
- signing_key:
107
+ rubygems_version: 3.2.33
108
+ signing_key:
108
109
  specification_version: 4
109
110
  summary: Selligent Ruby API client
110
111
  test_files: []