selligent 0.1.3 → 1.0.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/.circleci/config.yml +36 -76
- data/.rubocop.yml +4 -1
- data/Gemfile +2 -0
- data/README.md +29 -1
- data/lib/selligent/client/cim.rb +64 -0
- data/lib/selligent/client/custom_journey.rb +29 -0
- data/lib/selligent/client.rb +4 -0
- data/lib/selligent/middlewares/authorization.rb +1 -1
- data/lib/selligent/version.rb +1 -1
- data/selligent.gemspec +7 -4
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4617530beb4b985250cf5e72e540c43b3a4c2fa39ebe3d6ffde9e357fc89221d
|
4
|
+
data.tar.gz: 2cde2ba1726810ce0fb9d6b14d1e2d703f2f65056f431036ecd01e8b56af64b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c77f0f37b5f5f1860ea4be718728e73ffd46f6dfbe05e3ce3af8e813d0c6877a354482c886d548b5590023e235e1e6ea44aee4ce767cb63a145ca66676ba7b3
|
7
|
+
data.tar.gz: e7993edb3aa6af3c55004b4ac88d57aa9d113d3bf1b8ce288bcebe7c02161e23da257bde2f594473c8fafc1dc4573429e3fa83de52acd6f62aad480752c05a7b
|
data/.circleci/config.yml
CHANGED
@@ -1,88 +1,41 @@
|
|
1
|
-
version: 2.
|
1
|
+
version: 2.1
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
26
|
-
|
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
|
3
|
+
docker-auth: &docker-auth
|
4
|
+
auth:
|
5
|
+
username: $DOCKERHUB_USERNAME
|
6
|
+
password: $DOCKERHUB_ACCESS_TOKEN
|
49
7
|
|
50
|
-
|
8
|
+
jobs:
|
9
|
+
bundle:
|
10
|
+
parameters:
|
11
|
+
ruby_version: { type: string }
|
51
12
|
docker:
|
52
|
-
- image:
|
13
|
+
- image: cimg/ruby:<< parameters.ruby_version >>
|
14
|
+
<<: *docker-auth
|
53
15
|
steps:
|
54
16
|
- checkout
|
55
17
|
- restore_cache:
|
56
|
-
key: gemfile
|
57
|
-
- run:
|
18
|
+
key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
|
19
|
+
- run: gem install bundler:2.6.7
|
20
|
+
- run: bundle install -j3
|
58
21
|
- save_cache:
|
59
|
-
key: gemfile
|
22
|
+
key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
|
60
23
|
paths:
|
61
24
|
- 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
25
|
|
73
|
-
|
26
|
+
ruby:
|
27
|
+
parameters:
|
28
|
+
ruby_version: { type: string }
|
74
29
|
docker:
|
75
|
-
- image:
|
30
|
+
- image: cimg/ruby:<< parameters.ruby_version >>
|
31
|
+
<<: *docker-auth
|
76
32
|
steps:
|
77
33
|
- checkout
|
78
34
|
- restore_cache:
|
79
|
-
key: gemfile
|
80
|
-
- run:
|
81
|
-
-
|
82
|
-
|
83
|
-
paths:
|
84
|
-
- vendor/bundle
|
85
|
-
- run: bundle check --path vendor/bundle
|
35
|
+
key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
|
36
|
+
- run: gem install bundler:2.6.7
|
37
|
+
- run: bundle install -j3
|
38
|
+
- run: bundle check
|
86
39
|
- run: bundle exec rubocop
|
87
40
|
- run: |
|
88
41
|
bundle exec rspec --profile 10 \
|
@@ -93,12 +46,19 @@ jobs:
|
|
93
46
|
- store_test_results:
|
94
47
|
path: tmp/results
|
95
48
|
|
96
|
-
|
97
49
|
workflows:
|
98
50
|
version: 2
|
99
51
|
build:
|
100
52
|
jobs:
|
101
|
-
-
|
102
|
-
|
103
|
-
|
104
|
-
|
53
|
+
- bundle:
|
54
|
+
context: org-global
|
55
|
+
matrix:
|
56
|
+
parameters:
|
57
|
+
ruby_version: ['3.2', '3.3', '3.4']
|
58
|
+
- ruby:
|
59
|
+
context: org-global
|
60
|
+
matrix:
|
61
|
+
parameters:
|
62
|
+
ruby_version: ['3.2', '3.3', '3.4']
|
63
|
+
requires:
|
64
|
+
- bundle
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -131,7 +131,6 @@ Selligent.transactionals_status(ids)
|
|
131
131
|
Selligent.transactional_status(id)
|
132
132
|
```
|
133
133
|
|
134
|
-
|
135
134
|
### Transactional Bulk
|
136
135
|
|
137
136
|
```ruby
|
@@ -261,6 +260,35 @@ Selligent.cumulio_datasets
|
|
261
260
|
Selligent.cumulio_query(model)
|
262
261
|
```
|
263
262
|
|
263
|
+
### Custom journey
|
264
|
+
|
265
|
+
```ruby
|
266
|
+
# Trigger custom journey. Reffer to the docs from CRM team for input.
|
267
|
+
Selligent.trigger_custom_journey(api_name, entrypoint_name, input)
|
268
|
+
```
|
269
|
+
|
270
|
+
### CIM
|
271
|
+
|
272
|
+
```ruby
|
273
|
+
# Create a CIM collect request
|
274
|
+
Selligent.cim_collect(api_name, data)
|
275
|
+
|
276
|
+
# Create a CIM optout request
|
277
|
+
Selligent.cim_optout(api_name, data)
|
278
|
+
|
279
|
+
# Create a CIM remove request
|
280
|
+
Selligent.cim_remove(api_name, data)
|
281
|
+
|
282
|
+
# Cancel a CIM request
|
283
|
+
Selligent.cim_cancel(request_id)
|
284
|
+
|
285
|
+
# Get the state of a CIM request
|
286
|
+
Selligent.cim_state(request_id)
|
287
|
+
|
288
|
+
# Get the result of a CIM collect request
|
289
|
+
Selligent.cim_result(request_id)
|
290
|
+
```
|
291
|
+
|
264
292
|
### Status
|
265
293
|
|
266
294
|
```ruby
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Selligent
|
4
|
+
class Client
|
5
|
+
# Implements the CIM endpoints
|
6
|
+
#
|
7
|
+
# /organizations/:organization/cim/*
|
8
|
+
module CIM
|
9
|
+
# The request body for collect/optout/remove
|
10
|
+
# should have the following structure:
|
11
|
+
#
|
12
|
+
# {
|
13
|
+
# "filters": [
|
14
|
+
# {
|
15
|
+
# "field": "string",
|
16
|
+
# "value": "string"
|
17
|
+
# }
|
18
|
+
# ]
|
19
|
+
# }
|
20
|
+
#
|
21
|
+
# @param api_name [String] The api name
|
22
|
+
# @param filters [Array<Hash>] The filters to apply
|
23
|
+
# @option filters [String] :field The field to filter on
|
24
|
+
# @option filters [String] :value The value to filter by
|
25
|
+
# You can choose up to four fields to identify the subject
|
26
|
+
# for the request.
|
27
|
+
|
28
|
+
# Collects, for the selected lists, all data available
|
29
|
+
# in the Engage environment, including Site and Recommendations.
|
30
|
+
# Once the data has been gathered, it can be downloaded and
|
31
|
+
# made available in a JSON file. The dashboard indicates when
|
32
|
+
# the file is available for download
|
33
|
+
def cim_collect(api_name, data)
|
34
|
+
post("#{base_url}/cim/#{api_name}/collect", data)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Unsubscribes a subject from the selected lists
|
38
|
+
def cim_optout(api_name, data)
|
39
|
+
post("#{base_url}/cim/#{api_name}/optout", data)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Permanently removes the data after 30 days.
|
43
|
+
# No restore of the data is possible.
|
44
|
+
def cim_remove(api_name, data)
|
45
|
+
post("#{base_url}/cim/#{api_name}/remove", data)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Cancel a CIM request
|
49
|
+
def cim_cancel(request_id)
|
50
|
+
delete("#{base_url}/cim/request/#{request_id}")
|
51
|
+
end
|
52
|
+
|
53
|
+
# Get the state of a CIM request
|
54
|
+
def cim_state(request_id)
|
55
|
+
get("#{base_url}/cim/request/#{request_id}/state")
|
56
|
+
end
|
57
|
+
|
58
|
+
# Get the result of a CIM collect request
|
59
|
+
def cim_result(request_id)
|
60
|
+
get("#{base_url}/cim/request/#{request_id}")
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -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
|
data/lib/selligent/client.rb
CHANGED
@@ -4,6 +4,8 @@ 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'
|
8
|
+
require 'selligent/client/cim'
|
7
9
|
require 'selligent/client/data'
|
8
10
|
require 'selligent/client/journeys'
|
9
11
|
require 'selligent/client/lists'
|
@@ -24,6 +26,8 @@ module Selligent
|
|
24
26
|
include Selligent::Connection
|
25
27
|
include Selligent::Client::Content
|
26
28
|
include Selligent::Client::Cumulio
|
29
|
+
include Selligent::Client::CustomJourney
|
30
|
+
include Selligent::Client::CIM
|
27
31
|
include Selligent::Client::Data
|
28
32
|
include Selligent::Client::Journeys
|
29
33
|
include Selligent::Client::Lists
|
data/lib/selligent/version.rb
CHANGED
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'
|
@@ -7,19 +9,20 @@ Gem::Specification.new do |s|
|
|
7
9
|
s.name = 'selligent'
|
8
10
|
s.version = Selligent::VERSION
|
9
11
|
s.authors = ['Werner Hofstra']
|
10
|
-
s.email = ['
|
12
|
+
s.email = ['opensource@catawiki.nl']
|
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 = '
|
16
|
+
s.license = 'MIT'
|
17
|
+
s.required_ruby_version = '>= 3.2'
|
15
18
|
|
16
|
-
s.files
|
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'
|
25
|
+
s.add_development_dependency 'bundler'
|
23
26
|
s.add_dependency 'faraday'
|
24
27
|
s.add_dependency 'faraday_middleware'
|
25
28
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selligent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.2
|
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:
|
11
|
+
date: 2025-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
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: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
description: Provides access to the Selligent REST API
|
56
56
|
email:
|
57
|
-
-
|
57
|
+
- opensource@catawiki.nl
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
@@ -67,8 +67,10 @@ files:
|
|
67
67
|
- README.md
|
68
68
|
- lib/selligent.rb
|
69
69
|
- lib/selligent/client.rb
|
70
|
+
- lib/selligent/client/cim.rb
|
70
71
|
- lib/selligent/client/content.rb
|
71
72
|
- lib/selligent/client/cumulio.rb
|
73
|
+
- lib/selligent/client/custom_journey.rb
|
72
74
|
- lib/selligent/client/data.rb
|
73
75
|
- lib/selligent/client/journeys.rb
|
74
76
|
- lib/selligent/client/lists.rb
|
@@ -86,9 +88,9 @@ files:
|
|
86
88
|
- selligent.gemspec
|
87
89
|
homepage: https://github.com/catawiki/selligent-rb
|
88
90
|
licenses:
|
89
|
-
-
|
91
|
+
- MIT
|
90
92
|
metadata: {}
|
91
|
-
post_install_message:
|
93
|
+
post_install_message:
|
92
94
|
rdoc_options: []
|
93
95
|
require_paths:
|
94
96
|
- lib
|
@@ -96,15 +98,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
98
|
requirements:
|
97
99
|
- - ">="
|
98
100
|
- !ruby/object:Gem::Version
|
99
|
-
version: '
|
101
|
+
version: '3.2'
|
100
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
103
|
requirements:
|
102
104
|
- - ">="
|
103
105
|
- !ruby/object:Gem::Version
|
104
106
|
version: '0'
|
105
107
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
107
|
-
signing_key:
|
108
|
+
rubygems_version: 3.4.19
|
109
|
+
signing_key:
|
108
110
|
specification_version: 4
|
109
111
|
summary: Selligent Ruby API client
|
110
112
|
test_files: []
|