cxf 0.0.4 → 0.0.5

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +11 -11
  3. data/lib/client.rb +2 -2
  4. data/lib/contact/content/content.rb +4 -4
  5. data/lib/contact/ecommerce/ecommerce.rb +4 -4
  6. data/lib/pub/config/config.rb +6 -6
  7. data/lib/pub/ecommerce/ecommerce.rb +6 -6
  8. data/lib/user/config/config.rb +10 -0
  9. data/lib/user/config/docs.rb +11 -0
  10. data/lib/user/config/exports.rb +43 -0
  11. data/lib/user/config/logs.rb +85 -0
  12. data/lib/user/config/password.rb +7 -0
  13. data/lib/user/config/relationships.rb +17 -31
  14. data/lib/user/config/seeds.rb +4 -48
  15. data/lib/user/config/system_settings.rb +5 -5
  16. data/lib/user/config/views.rb +24 -0
  17. data/lib/user/content/assets.rb +27 -221
  18. data/lib/user/content/bundles.rb +96 -0
  19. data/lib/user/content/content.rb +6 -0
  20. data/lib/user/content/instances.rb +37 -0
  21. data/lib/user/content/message_templates.rb +114 -0
  22. data/lib/user/content/print_versions.rb +18 -0
  23. data/lib/user/content/prints.rb +96 -0
  24. data/lib/user/content/templates.rb +28 -0
  25. data/lib/user/{crm → customer-data}/companies.rb +6 -6
  26. data/lib/user/{crm → customer-data}/contacts.rb +43 -18
  27. data/lib/user/customer-data/customer_data.rb +17 -0
  28. data/lib/user/customer-data/profiles.rb +93 -0
  29. data/lib/user/customer-data/segments.rb +93 -0
  30. data/lib/user/customer-data/workflow_steps.rb +127 -0
  31. data/lib/user/customer-data/workflows.rb +115 -0
  32. data/lib/user/ecommerce/ecommerce.rb +6 -22
  33. data/lib/user/ecommerce/item_codes.rb +89 -0
  34. data/lib/user/ecommerce/order_templates.rb +89 -0
  35. data/lib/user/ecommerce/orders.rb +205 -0
  36. data/lib/user/helpers/helpers.rb +0 -96
  37. data/lib/user.rb +2 -3
  38. metadata +18 -19
  39. data/lib/user/contacts/contacts.rb +0 -22
  40. data/lib/user/crm/crm.rb +0 -9
  41. data/lib/user/ecommerce/item_prices.rb +0 -89
  42. data/lib/user/ecommerce/price_lists.rb +0 -75
  43. data/lib/user/ecommerce/product_templates.rb +0 -106
  44. data/lib/user/ecommerce/product_variations.rb +0 -133
  45. data/lib/user/ecommerce/product_versions.rb +0 -107
  46. data/lib/user/ecommerce/products.rb +0 -156
  47. data/lib/user/ecommerce/skus.rb +0 -90
  48. data/lib/user/ecommerce/taxes.rb +0 -84
  49. data/lib/user/ecommerce/variant_options.rb +0 -71
  50. data/lib/user/ecommerce/variant_values.rb +0 -74
  51. data/lib/user/ecommerce/vouchers.rb +0 -90
  52. data/lib/user/helpers/object_activities.rb +0 -85
  53. data/lib/user/helpers/object_folders.rb +0 -84
  54. data/lib/user/helpers/user_folders.rb +0 -85
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22426960737d0c65a4ca1603559ef4aeee6a510a7c06a8f2e0c072d411b1859c
4
- data.tar.gz: 64ae056bc07ceaeac86c3891cede013561d1925ed9e7a394953807209fff0fe9
3
+ metadata.gz: 1c8cbe1cc3db14801bba1018da757262a9dfc3c7fc181aa662cd8587cd22fdd5
4
+ data.tar.gz: 5194302848b46fc2bdafb6de8ebbed78cfe3f7b9f31fe4de37a25e7ccfbcd686
5
5
  SHA512:
6
- metadata.gz: 96b03b5dde503caf427298ffc193f3b6f1cd1da77f6c654949531f8d9a757101cd46c994fb6b88de331821e50f4c10742afed4751caba4159cdece130446333f
7
- data.tar.gz: 0af7c700c417c05402f2b9ccdea8727b7f75cd4eb34742c36b1eb22db28ede33038bbaa6d85a555b0e3e5bac519c29b59edba94eb872dda38154673b04f7312c
6
+ metadata.gz: 12490c8b54f73f9d46294f704e39ea6031af993231d43aa4b62c664c3c9457acae14e3a03bddef9340bcc91ca53d91709a77b277f0f4d21c8d6445d237dfb726
7
+ data.tar.gz: e772e7072cf77ae9134dcd2fea2149d4dff0249b706f19b2b318a8bef052b9a1d19060f2bfef125f246e2fd5823c703f7e88f2bfecd0d54040255ae9692fdf67
data/Gemfile CHANGED
@@ -1,12 +1,12 @@
1
- source :rubygems
2
-
3
- gem 'json'
4
- gem 'httparty'
5
- gem 'addressable'
6
- gem 'rails-reverse-proxy', '~> 0.9.1'
7
- gem 'redis'
8
- gem 'mongo', "~> 2"
9
- gem 'concurrent-ruby', require: 'concurrent'
10
- gem 'rubocop', require: false
11
- gem 'rack', '~> 2.2.0'
1
+ source :rubygems
2
+
3
+ gem 'json'
4
+ gem 'httparty'
5
+ gem 'addressable'
6
+ gem 'rails-reverse-proxy', '~> 0.9.1'
7
+ gem 'redis'
8
+ gem 'mongo', "~> 2"
9
+ gem 'concurrent-ruby', require: 'concurrent'
10
+ gem 'rubocop', require: false
11
+ gem 'rack', '~> 2.2.0'
12
12
  gem 'rack-test', '~> 1.1.0'
data/lib/client.rb CHANGED
@@ -80,7 +80,7 @@ module Cxf
80
80
  found_options_with_encoding = options.keys.select { |key| need_encoding.include?(key.to_s.downcase) and options[key]&.class == Hash }
81
81
 
82
82
  found_options_with_encoding.each do |key|
83
- options[key] = CGI::escape(Base64.encode64(options[key].to_json))
83
+ options[key] = Base64.encode64(options[key].to_json)
84
84
  end
85
85
 
86
86
  uri = Addressable::URI.new
@@ -259,7 +259,7 @@ module Cxf
259
259
  def replacements
260
260
  [
261
261
  { old_value: '_', new_value: '-' },
262
- { old_value: 'people', new_value: 'crm' },
262
+ { old_value: 'people', new_value: 'customer-data' },
263
263
  { old_value: 'store', new_value: 'ecommerce' }
264
264
  ]
265
265
  end
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: true
2
-
3
- module ContactContent
4
- end
1
+ # frozen_string_literal: true
2
+
3
+ module ContactContent
4
+ end
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: true
2
-
3
- module ContactEcommerce
4
- end
1
+ # frozen_string_literal: true
2
+
3
+ module ContactEcommerce
4
+ end
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
-
3
- ### V1/CONFIG ###
4
-
5
- module PublicConfig
6
- end
1
+ # frozen_string_literal: true
2
+
3
+ ### V1/CONFIG ###
4
+
5
+ module PublicConfig
6
+ end
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
-
3
- ### V1/ECOMMERCE ###
4
-
5
- module PublicEcommerce
6
- end
1
+ # frozen_string_literal: true
2
+
3
+ ### V1/ECOMMERCE ###
4
+
5
+ module PublicEcommerce
6
+ end
@@ -9,6 +9,11 @@ require_relative './system_settings'
9
9
  require_relative './tags'
10
10
  require_relative './taxonomies'
11
11
  require_relative './users'
12
+ require_relative './docs'
13
+ require_relative './exports'
14
+ require_relative './logs'
15
+ require_relative './password'
16
+ require_relative './calendars'
12
17
 
13
18
  module Config
14
19
  include AttributeGroups
@@ -20,4 +25,9 @@ module Config
20
25
  include Tags
21
26
  include Taxonomies
22
27
  include Users
28
+ include Docs
29
+ include Exports
30
+ include Logs
31
+ include Password
32
+ include Calendars
23
33
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Docs
4
+ def generate_docs(data)
5
+ @client.raw('post', '/config/docs/generate', nil, data_transform(data))
6
+ end
7
+
8
+ def get_doc_jobs
9
+ @client.raw('get', '/config/docs/jobs')
10
+ end
11
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Exports
4
+ # === Get export.
5
+ # Get a collection of export.
6
+ #
7
+ # ==== Parameters
8
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
9
+ #
10
+ # ==== First Example
11
+ # @data = @cxf_user.get_export
12
+ #
13
+ # ==== Second Example
14
+ # options = { sort: 'id' }
15
+ # @data = @cxf_user.get_export(options)
16
+ def get_exports(options = nil)
17
+ @client.raw('get', '/config/export', options)
18
+ end
19
+
20
+ # === Get export.
21
+ # Get an export configuration info.
22
+ #
23
+ # ==== Parameters
24
+ # id:: (Integer) -- Export configuration id.
25
+ #
26
+ # ==== Example
27
+ # @data = @cxf_user.get_export(10)
28
+ def get_export(id)
29
+ @client.raw('get', "/config/export/#{id}")
30
+ end
31
+
32
+ # === Get export jobs using view id.
33
+ # Get a collection of export jobs using a view id.
34
+ #
35
+ # ==== Parameters
36
+ # id:: (Integer) -- View id.
37
+ #
38
+ # ==== Example
39
+ # @data = @cxf_user.get_export_jobs_using_view_id(10)
40
+ def get_export_jobs_using_view_id(id)
41
+ @client.raw('get', "/config/export/#{id}/jobs")
42
+ end
43
+ end
@@ -0,0 +1,85 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Logs
4
+ # === Get logs.
5
+ # Get a collection of logs.
6
+ #
7
+ # ==== Parameters
8
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
9
+ #
10
+ # ==== First Example
11
+ # @data = @cxf_user.get_logs
12
+ #
13
+ # ==== Second Example
14
+ # options = { fields: 'id' }
15
+ # @data = @cxf_user.get_logs(options)
16
+ def get_logs(options = nil)
17
+ @client.raw('get', '/config/logs', options)
18
+ end
19
+
20
+ # === Get log.
21
+ # Get a log info.
22
+ #
23
+ # ==== Parameters
24
+ # id:: (Integer) -- Relationship id.
25
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
26
+ #
27
+ # ==== First Example
28
+ # @data = @cxf_user.get_log(1)
29
+ #
30
+ # ==== Second Example
31
+ # options = { fields: 'id' }
32
+ # @data = @cxf_user.get_log(1, options)
33
+ def get_log(id, options = nil)
34
+ @client.raw('get', "/config/logs/#{id}", options)
35
+ end
36
+
37
+ # === Create log.
38
+ # Create a log with data.
39
+ #
40
+ # ==== Parameters
41
+ # data:: (Hash) -- Data to be submitted.
42
+ #
43
+ # ==== Example
44
+ # data = {
45
+ # alias_1: 'eventsCopy',
46
+ # alias_2: 'ticketsCopy',
47
+ # object_model_1: 'Story',
48
+ # object_model_2: 'Product'
49
+ # }
50
+ # @data = @cxf_user.create_log(data)
51
+ def create_log(data)
52
+ @client.raw('post', '/config/logs', nil, data_transform(data))
53
+ end
54
+
55
+ # === Update log.
56
+ # Update a log info.
57
+ #
58
+ # ==== Parameters
59
+ # id:: (Integer) -- Relationship id.
60
+ # data:: (Hash) -- Data to be submitted.
61
+ #
62
+ # ==== Example
63
+ # data = {
64
+ # alias_1: 'eventsCopyModified',
65
+ # alias_2: 'ticketsCopyModified',
66
+ # object_model_1: 'Story',
67
+ # object_model_2: 'Product'
68
+ # }
69
+ # @data = @cxf_user.update_log(5, data)
70
+ def update_log(id, data)
71
+ @client.raw('put', "/config/logs/#{id}", nil, data_transform(data))
72
+ end
73
+
74
+ # === Delete log.
75
+ # Delete a log.
76
+ #
77
+ # ==== Parameters
78
+ # id:: (Integer) -- Relationship id.
79
+ #
80
+ # ==== Example
81
+ # @data = @cxf_user.delete_log(5)
82
+ def delete_log(id)
83
+ @client.raw('delete', "/config/logs/#{id}")
84
+ end
85
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Password
4
+ def update_password(type,data)
5
+ @client.raw('post', "/config/#{type}/password/update", nil, data_transform(data))
6
+ end
7
+ end
@@ -1,24 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Relationships
4
- ##
5
- # == Relationships
6
- #
7
- # === Get relationships available for.
8
- # Get relationships available.
9
- #
10
- # ==== Parameters
11
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
12
- #
13
- # ==== Example
14
- # options = {
15
- # objectType: 'contacts'
16
- # }
17
- # @data = @cxf_user.get_relationships_available_for(options)
18
- def get_relationships_available_for(options)
19
- @client.raw('get', '/config/relationships/available-for', options)
20
- end
21
-
22
4
  # === Attach relationship.
23
5
  # Attach a relationship.
24
6
  #
@@ -28,7 +10,6 @@ module Relationships
28
10
  # ==== Example
29
11
  #
30
12
  def attach_relationship(data)
31
- # FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.
32
13
  @client.raw('post', '/config/relationships/attach', nil, data_transform(data))
33
14
  end
34
15
 
@@ -41,21 +22,9 @@ module Relationships
41
22
  # ==== Example
42
23
  #
43
24
  def detach_relationship(data)
44
- # FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.
45
25
  @client.raw('post', '/config/relationships/detach', nil, data_transform(data))
46
26
  end
47
27
 
48
- # === Relationship has objects.
49
- # Get relationships that has objects.
50
- #
51
- # ==== Parameters
52
- # id:: (Integer) -- Relationship id.
53
- #
54
- # ==== Example
55
- # @data = @cxf_user.relationship_has_objects(1)
56
- def relationship_has_objects(id)
57
- @client.raw('get', "/config/relationships/#{id}/hasObjects")
58
- end
59
28
 
60
29
  # === Get relationships.
61
30
  # Get a collection of relationships.
@@ -138,4 +107,21 @@ module Relationships
138
107
  def delete_relationship(id)
139
108
  @client.raw('delete', "/config/relationships/#{id}")
140
109
  end
110
+
111
+ ##
112
+ # === Update relationship pivot fields.
113
+ # Update pivot fields for relationships.
114
+ #
115
+ # ==== Parameters
116
+ # data:: (Hash) -- Data to be submitted.
117
+ #
118
+ # ==== Example
119
+ # data = {
120
+ # field_name_1: 'value_1',
121
+ # field_name_2: 'value_2'
122
+ # }
123
+ # @data = @cxf_user.update_relationship_pivot_fields(data)
124
+ def update_relationship_pivot_fields(data)
125
+ @client.raw('put', '/config/relationships/pivot-fields', nil, data_transform(data))
126
+ end
141
127
  end
@@ -1,55 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Seeds
4
- ##
5
- # == Seeds
6
- #
7
- # === Apply seeds.
8
- # Apply seeds.
9
- #
10
- # ==== Example
11
- #
12
- def apply_seeds(data, async: false)
13
- url = '/config/seeds'
14
- url = "#{url}?async" if async
15
- @client.raw('post', url, nil, data)
4
+ def process_seed(data)
5
+ @client.raw('post', "/config/seeds", nil, data_transform(data))
16
6
  end
17
7
 
18
- # === Get seed processes.
19
- # Get a collection of seed processes.
20
- #
21
- # ==== Parameters
22
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
23
- # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
24
- #
25
- # ==== First Example
26
- # @data = @cxf_user.get_seed_processes
27
- #
28
- # ==== Second Example
29
- # options = {
30
- # fields: 'id'
31
- # }
32
- # @data = @cxf_user.get_seed_processes(options)
33
- def get_seed_processes(options = nil)
34
- @client.raw('post', '/config/seed-processes', options)
35
- end
36
-
37
- # === Get seed process.
38
- # Get a seed process info.
39
- #
40
- # ==== Parameters
41
- # id:: (Integer) -- Seed process id.
42
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
43
- #
44
- # ==== First Example
45
- # @data = @cxf_user.get_seed_process(1)
46
- #
47
- # ==== Second Example
48
- # options = {
49
- # fields: 'id, title'
50
- # }
51
- # @data = @cxf_user.get_seed_process(1, options)
52
- def get_seed_process(id, options = nil)
53
- @client.raw('get', "/config/seed-processes/#{id}", options)
8
+ def get_seed_process_status(id)
9
+ @client.raw('get', "/config/seeds/jobs/#{id}")
54
10
  end
55
11
  end
@@ -13,7 +13,7 @@ module SystemSettings
13
13
  # }
14
14
  # @data = @cxf_user.get_settings_by_keys(options)
15
15
  def get_settings_by_keys(options)
16
- @client.raw('get', '/config/settings/by-keys', options)
16
+ @client.raw('get', '/config/system-settings/by-keys', options)
17
17
  end
18
18
 
19
19
  # === Get settings.
@@ -22,7 +22,7 @@ module SystemSettings
22
22
  # ==== Example
23
23
  # @data = @cxf_user.get_settings
24
24
  def get_settings
25
- @client.raw('get', '/config/settings')
25
+ @client.raw('get', '/config/system-settings')
26
26
  end
27
27
 
28
28
  # === Create setting.
@@ -37,7 +37,7 @@ module SystemSettings
37
37
  # }
38
38
  # @data = @cxf_user.create_setting(data)
39
39
  def create_setting(data)
40
- @client.raw('post', '/config/settings', nil, data_transform(data))
40
+ @client.raw('post', '/config/system-settings', nil, data_transform(data))
41
41
  end
42
42
 
43
43
  # === Clear tag.
@@ -48,7 +48,7 @@ module SystemSettings
48
48
  #
49
49
  # ==== Example
50
50
  # @data = @cxf_user.clear_tag(1)
51
- def clear_tag(tag)
52
- @client.raw('get', "/config/settings/tags/#{tag}/clear")
51
+ def clear_settings_cache
52
+ @client.raw('post', "/config/system-settings/clear-cache")
53
53
  end
54
54
  end
@@ -65,4 +65,28 @@ module Views
65
65
  def update_view(id, data)
66
66
  @client.raw('put', "/config/views/#{id}", nil, data_transform(data))
67
67
  end
68
+
69
+ # === Get view query.
70
+ # Get a view query.
71
+ #
72
+ # ==== Parameters
73
+ # id_or_slug:: (String) -- The id or slug of the view to be queried.
74
+ #
75
+ # ==== Example
76
+ # @data = @cxf_user.get_view_query('view-slug')
77
+ def get_view_query(id_or_slug)
78
+ @client.raw('get', "/config/views/#{id_or_slug}/query")
79
+ end
80
+
81
+ # === Export view to BigQuery.
82
+ # Export a view to BigQuery using its id or slug.
83
+ #
84
+ # ==== Parameters
85
+ # id_or_slug:: (String) -- The id or slug of the view to be exported.
86
+ #
87
+ # ==== Example
88
+ # @data = @cxf_user.export_view_to_bigquery('view-slug')
89
+ def export_view_to_bigquery(id_or_slug)
90
+ @client.raw('post', "/config/views/#{id_or_slug}/export")
91
+ end
68
92
  end