selligent 0.1.4 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad45d9f6139a62885e82c40fea33f78c288b8a42a652cbfd71924410676072a6
4
- data.tar.gz: 2325d061753ff1a97eb91c8ef3f7674b92cfabdd7423c1d8b9ec22f222d877ea
3
+ metadata.gz: 4617530beb4b985250cf5e72e540c43b3a4c2fa39ebe3d6ffde9e357fc89221d
4
+ data.tar.gz: 2cde2ba1726810ce0fb9d6b14d1e2d703f2f65056f431036ecd01e8b56af64b7
5
5
  SHA512:
6
- metadata.gz: 524d8e138358e6d1a884cebebb739915412a78efd38cee0e47163a6dc2f8886ba994e2314a0e3c6d77daf3746a3621ac375cb0941b626d09a6f3c8039ac16e7a
7
- data.tar.gz: 25a74dc22bdd7b46daaa9a48112dc1cd762a3f2cf5893fd8eb80c61accfb590293e416ac082b4e0722007ae13a5e3ad20e4b8c04b8cf49d46229d1c525d592cd
6
+ metadata.gz: 7c77f0f37b5f5f1860ea4be718728e73ffd46f6dfbe05e3ce3af8e813d0c6877a354482c886d548b5590023e235e1e6ea44aee4ce767cb63a145ca66676ba7b3
7
+ data.tar.gz: e7993edb3aa6af3c55004b4ac88d57aa9d113d3bf1b8ce288bcebe7c02161e23da257bde2f594473c8fafc1dc4573429e3fa83de52acd6f62aad480752c05a7b
data/.circleci/config.yml CHANGED
@@ -16,6 +16,7 @@ jobs:
16
16
  - checkout
17
17
  - restore_cache:
18
18
  key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
19
+ - run: gem install bundler:2.6.7
19
20
  - run: bundle install -j3
20
21
  - save_cache:
21
22
  key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
@@ -32,8 +33,9 @@ jobs:
32
33
  - checkout
33
34
  - restore_cache:
34
35
  key: gemfile-<< parameters.ruby_version >>-{{ checksum "Gemfile" }}
35
- - run: gem install bundler:2.3.26
36
- - run: bundle check --path vendor/bundle
36
+ - run: gem install bundler:2.6.7
37
+ - run: bundle install -j3
38
+ - run: bundle check
37
39
  - run: bundle exec rubocop
38
40
  - run: |
39
41
  bundle exec rspec --profile 10 \
@@ -52,11 +54,11 @@ workflows:
52
54
  context: org-global
53
55
  matrix:
54
56
  parameters:
55
- ruby_version: ['2.7', '3.0']
57
+ ruby_version: ['3.2', '3.3', '3.4']
56
58
  - ruby:
57
59
  context: org-global
58
60
  matrix:
59
61
  parameters:
60
- ruby_version: ['2.7', '3.0']
62
+ ruby_version: ['3.2', '3.3', '3.4']
61
63
  requires:
62
64
  - bundle
data/.rubocop.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.7
2
+ TargetRubyVersion: 3.2
3
3
 
4
4
  Metrics/BlockLength:
5
5
  Exclude:
6
6
  - 'spec/**/*'
7
7
 
8
- Metrics/LineLength:
8
+ Layout/LineLength:
9
9
  Max: 100
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
@@ -268,6 +267,28 @@ Selligent.cumulio_query(model)
268
267
  Selligent.trigger_custom_journey(api_name, entrypoint_name, input)
269
268
  ```
270
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
+
271
292
  ### Status
272
293
 
273
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
@@ -5,6 +5,7 @@ require 'selligent/connection'
5
5
  require 'selligent/client/content'
6
6
  require 'selligent/client/cumulio'
7
7
  require 'selligent/client/custom_journey'
8
+ require 'selligent/client/cim'
8
9
  require 'selligent/client/data'
9
10
  require 'selligent/client/journeys'
10
11
  require 'selligent/client/lists'
@@ -26,6 +27,7 @@ module Selligent
26
27
  include Selligent::Client::Content
27
28
  include Selligent::Client::Cumulio
28
29
  include Selligent::Client::CustomJourney
30
+ include Selligent::Client::CIM
29
31
  include Selligent::Client::Data
30
32
  include Selligent::Client::Journeys
31
33
  include Selligent::Client::Lists
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Selligent
4
- VERSION = '0.1.4'
4
+ VERSION = '1.0.2'
5
5
  end
data/selligent.gemspec CHANGED
@@ -9,12 +9,12 @@ Gem::Specification.new do |s|
9
9
  s.name = 'selligent'
10
10
  s.version = Selligent::VERSION
11
11
  s.authors = ['Werner Hofstra']
12
- s.email = ['w.hofstra@catawiki.nl']
12
+ s.email = ['opensource@catawiki.nl']
13
13
  s.homepage = 'https://github.com/catawiki/selligent-rb'
14
14
  s.summary = 'Selligent Ruby API client'
15
15
  s.description = 'Provides access to the Selligent REST API'
16
16
  s.license = 'MIT'
17
- s.required_ruby_version = '>= 2.7'
17
+ s.required_ruby_version = '>= 3.2'
18
18
 
19
19
  s.files = `git ls-files -z`.split("\x0").reject do |f|
20
20
  f.match(%r{^(test|spec|features)/})
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.require_paths = ['lib']
24
24
 
25
- s.add_development_dependency 'bundler', '~> 2.3'
25
+ s.add_development_dependency 'bundler'
26
26
  s.add_dependency 'faraday'
27
27
  s.add_dependency 'faraday_middleware'
28
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.1.4
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Werner Hofstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-12 00:00:00.000000000 Z
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: '2.3'
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: '2.3'
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
- - w.hofstra@catawiki.nl
57
+ - opensource@catawiki.nl
58
58
  executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
@@ -67,6 +67,7 @@ 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
72
73
  - lib/selligent/client/custom_journey.rb
@@ -97,14 +98,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
98
  requirements:
98
99
  - - ">="
99
100
  - !ruby/object:Gem::Version
100
- version: '2.7'
101
+ version: '3.2'
101
102
  required_rubygems_version: !ruby/object:Gem::Requirement
102
103
  requirements:
103
104
  - - ">="
104
105
  - !ruby/object:Gem::Version
105
106
  version: '0'
106
107
  requirements: []
107
- rubygems_version: 3.2.33
108
+ rubygems_version: 3.4.19
108
109
  signing_key:
109
110
  specification_version: 4
110
111
  summary: Selligent Ruby API client