cxf 0.0.2 → 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.
- checksums.yaml +4 -4
- data/Gemfile +11 -11
- data/lib/client.rb +19 -10
- data/lib/contact/content/content.rb +4 -4
- data/lib/contact/ecommerce/ecommerce.rb +4 -4
- data/lib/contact.rb +1 -1
- data/lib/cxf/controllers/concerns/cxf_clients.rb +4 -4
- data/lib/cxf/helpers/contact_auth_helper.rb +1 -1
- data/lib/pub/config/config.rb +6 -6
- data/lib/pub/content/assets.rb +2 -2
- data/lib/pub/content/content.rb +13 -9
- data/lib/pub/content/content_prints.rb +95 -0
- data/lib/pub/content/print_versions.rb +98 -0
- data/lib/pub/ecommerce/ecommerce.rb +6 -6
- data/lib/pub.rb +1 -0
- data/lib/user/config/config.rb +10 -0
- data/lib/user/config/docs.rb +11 -0
- data/lib/user/config/exports.rb +43 -0
- data/lib/user/config/logs.rb +85 -0
- data/lib/user/config/password.rb +7 -0
- data/lib/user/config/relationships.rb +17 -31
- data/lib/user/config/seeds.rb +4 -48
- data/lib/user/config/system_settings.rb +5 -5
- data/lib/user/config/views.rb +24 -0
- data/lib/user/content/assets.rb +27 -221
- data/lib/user/content/bundles.rb +96 -0
- data/lib/user/content/content.rb +12 -6
- data/lib/user/content/instances.rb +37 -0
- data/lib/user/content/message_templates.rb +114 -0
- data/lib/user/content/print_versions.rb +18 -0
- data/lib/user/content/prints.rb +96 -0
- data/lib/user/content/templates.rb +28 -0
- data/lib/user/{crm → customer-data}/companies.rb +6 -6
- data/lib/user/{crm → customer-data}/contacts.rb +43 -18
- data/lib/user/customer-data/customer_data.rb +17 -0
- data/lib/user/customer-data/profiles.rb +93 -0
- data/lib/user/customer-data/segments.rb +93 -0
- data/lib/user/customer-data/workflow_steps.rb +127 -0
- data/lib/user/customer-data/workflows.rb +115 -0
- data/lib/user/ecommerce/ecommerce.rb +6 -24
- data/lib/user/ecommerce/item_codes.rb +89 -0
- data/lib/user/ecommerce/order_templates.rb +89 -0
- data/lib/user/ecommerce/orders.rb +205 -0
- data/lib/user/helpers/helpers.rb +0 -96
- data/lib/user.rb +2 -3
- metadata +22 -24
- data/lib/user/contacts/contacts.rb +0 -22
- data/lib/user/content/stories.rb +0 -110
- data/lib/user/content/story_templates.rb +0 -97
- data/lib/user/crm/crm.rb +0 -9
- data/lib/user/ecommerce/item_prices.rb +0 -89
- data/lib/user/ecommerce/locations.rb +0 -171
- data/lib/user/ecommerce/price_lists.rb +0 -75
- data/lib/user/ecommerce/product_templates.rb +0 -106
- data/lib/user/ecommerce/product_variations.rb +0 -133
- data/lib/user/ecommerce/product_versions.rb +0 -107
- data/lib/user/ecommerce/products.rb +0 -156
- data/lib/user/ecommerce/skus.rb +0 -90
- data/lib/user/ecommerce/taxes.rb +0 -84
- data/lib/user/ecommerce/variant_options.rb +0 -71
- data/lib/user/ecommerce/variant_values.rb +0 -74
- data/lib/user/ecommerce/vouchers.rb +0 -90
- data/lib/user/helpers/object_activities.rb +0 -85
- data/lib/user/helpers/object_folders.rb +0 -84
- data/lib/user/helpers/user_folders.rb +0 -85
@@ -0,0 +1,205 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Orders
|
4
|
+
##
|
5
|
+
# == Item Prices
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get item codes.
|
9
|
+
# Get a collection of item codes.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
13
|
+
#
|
14
|
+
# ==== First Example
|
15
|
+
# @data = @cxf_user.get_orders
|
16
|
+
#
|
17
|
+
# ==== Second Example
|
18
|
+
# options = { fields: 'code_cents' }
|
19
|
+
# @data = @cxf_user.get_orders(options)
|
20
|
+
def get_orders(options = nil)
|
21
|
+
@client.raw('get', '/ecommerce/orders', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
# === Get item code.
|
25
|
+
# Get a item code info.
|
26
|
+
#
|
27
|
+
# ==== Parameters
|
28
|
+
# id:: (Integer) -- Item code id.
|
29
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
30
|
+
#
|
31
|
+
# ==== First Example
|
32
|
+
# @data = @cxf_user.get_order(1)
|
33
|
+
#
|
34
|
+
# ==== Second Example
|
35
|
+
# options = { fields: 'code_cents' }
|
36
|
+
# @data = @cxf_user.get_order(1, options)
|
37
|
+
def get_order(id, options = nil)
|
38
|
+
@client.raw('get', "/ecommerce/orders/#{id}", options)
|
39
|
+
end
|
40
|
+
|
41
|
+
# === Create item code.
|
42
|
+
# Create a item code with data.
|
43
|
+
#
|
44
|
+
# ==== Parameters
|
45
|
+
# data:: (Hash) -- Data to be submitted.
|
46
|
+
#
|
47
|
+
# ==== Example
|
48
|
+
# data = {
|
49
|
+
# code_list: [
|
50
|
+
# { id: 1 },
|
51
|
+
# { id: 2 }
|
52
|
+
# ],
|
53
|
+
# code_list_id: 1,
|
54
|
+
# title: 'New Item Price'
|
55
|
+
# }
|
56
|
+
# @data = @cxf_user.create_order(data)
|
57
|
+
def create_order(data)
|
58
|
+
# FIXME: Api send sku_id as null and DB doesnt allow that.
|
59
|
+
@client.raw('post', '/ecommerce/orders', nil, data_transform(data))
|
60
|
+
end
|
61
|
+
|
62
|
+
# === Update item code.
|
63
|
+
# Update a item code info.
|
64
|
+
#
|
65
|
+
# ==== Parameters
|
66
|
+
# id:: (Integer) -- Order item code id.
|
67
|
+
# data:: (Hash) -- Data to be submitted.
|
68
|
+
#
|
69
|
+
# ==== Example
|
70
|
+
# data = {
|
71
|
+
# code: 12345
|
72
|
+
# }
|
73
|
+
# @data = @cxf_user.update_order(1, data)
|
74
|
+
def update_order(id, data)
|
75
|
+
@client.raw('put', "/ecommerce/orders/#{id}", nil, data_transform(data))
|
76
|
+
end
|
77
|
+
|
78
|
+
# === Delete item code.
|
79
|
+
# Delete a item code.
|
80
|
+
#
|
81
|
+
# ==== Parameters
|
82
|
+
# id:: (Integer) -- Item code id.
|
83
|
+
#
|
84
|
+
# ==== Example
|
85
|
+
# @data = @cxf_user.delete_order(803)
|
86
|
+
def delete_order(id)
|
87
|
+
@client.raw('delete', "/ecommerce/orders/#{id}")
|
88
|
+
end
|
89
|
+
|
90
|
+
# === Add order line item.
|
91
|
+
# Add a line item to an order.
|
92
|
+
#
|
93
|
+
# ==== Parameters
|
94
|
+
# order_id:: (Integer) -- Order id.
|
95
|
+
# data:: (Hash) -- Data to be submitted.
|
96
|
+
#
|
97
|
+
# ==== Example
|
98
|
+
# data = {
|
99
|
+
# product_id: 1,
|
100
|
+
# price: 10.99,
|
101
|
+
# quantity: 2
|
102
|
+
# }
|
103
|
+
# @data = @cxf_user.add_order_line_item(1, data)
|
104
|
+
def add_order_line_item(order_id, data)
|
105
|
+
@client.raw('post', "/ecommerce/orders/#{order_id}/line-item", nil, data_transform(data))
|
106
|
+
end
|
107
|
+
|
108
|
+
# === Delete order line item.
|
109
|
+
# Delete a line item from an order.
|
110
|
+
#
|
111
|
+
# ==== Parameters
|
112
|
+
# order_id:: (Integer) -- Order id.
|
113
|
+
#
|
114
|
+
# ==== Example
|
115
|
+
# @data = @cxf_user.delete_order_line_item(1)
|
116
|
+
def delete_order_line_item(order_id)
|
117
|
+
@client.raw('delete', "/ecommerce/orders/#{order_id}/line-item")
|
118
|
+
end
|
119
|
+
|
120
|
+
# === Update order line item.
|
121
|
+
# Update a specific line item within an order.
|
122
|
+
#
|
123
|
+
# ==== Parameters
|
124
|
+
# order_id:: (Integer) -- Order id.
|
125
|
+
# data:: (Hash) -- Data to be submitted.
|
126
|
+
#
|
127
|
+
# ==== Example
|
128
|
+
# data = {
|
129
|
+
# item_id: 123,
|
130
|
+
# quantity: 2,
|
131
|
+
# price: 1000
|
132
|
+
# }
|
133
|
+
# @data = @cxf_user.update_order_line_item(1, data)
|
134
|
+
def update_order_line_item(order_id, data)
|
135
|
+
@client.raw('put', "/ecommerce/orders/#{order_id}/line-item", nil, data_transform(data))
|
136
|
+
end
|
137
|
+
|
138
|
+
# === Update order unit line item.
|
139
|
+
# Update a specific unit line item within an order.
|
140
|
+
#
|
141
|
+
# ==== Parameters
|
142
|
+
# order_id:: (Integer) -- Order id.
|
143
|
+
# data:: (Hash) -- Data to be submitted.
|
144
|
+
#
|
145
|
+
# ==== Example
|
146
|
+
# data = {
|
147
|
+
# unit_id: 3,
|
148
|
+
# quantity: 5
|
149
|
+
# }
|
150
|
+
# @data = @cxf_user.update_order_unit_line_item(1, data)
|
151
|
+
def update_order_unit_line_item(order_id, data)
|
152
|
+
@client.raw('put', "/ecommerce/orders/#{order_id}/unit-line-item", nil, data_transform(data))
|
153
|
+
end
|
154
|
+
|
155
|
+
# === Reorder order line items.
|
156
|
+
# Reorder order line items.
|
157
|
+
#
|
158
|
+
# ==== Parameters
|
159
|
+
# order_id:: (Integer) -- Order id.
|
160
|
+
# data:: (Hash) -- Data to be submitted.
|
161
|
+
#
|
162
|
+
# ==== Example
|
163
|
+
# data = {
|
164
|
+
# line_items: [
|
165
|
+
# { id: 1, position: 1 },
|
166
|
+
# { id: 2, position: 2 }
|
167
|
+
# ]
|
168
|
+
# }
|
169
|
+
# @data = @cxf_user.reorder_order_line_item(1, data)
|
170
|
+
def reorder_order_line_item(order_id, data)
|
171
|
+
@client.raw('put', "/ecommerce/orders/#{order_id}/reorder-line-items", nil, data_transform(data))
|
172
|
+
end
|
173
|
+
|
174
|
+
# === Change order status.
|
175
|
+
# Change order status.
|
176
|
+
#
|
177
|
+
# ==== Parameters
|
178
|
+
# order_id:: (Integer) -- Order id.
|
179
|
+
# data:: (Hash) -- Data to be submitted.
|
180
|
+
#
|
181
|
+
# ==== Example
|
182
|
+
# data = {
|
183
|
+
# order_status_id: 2
|
184
|
+
# }
|
185
|
+
# @data = @cxf_user.change_order_status(1, data)
|
186
|
+
def change_order_status(order_id, data)
|
187
|
+
@client.raw('put', "/ecommerce/orders/#{order_id}/status", nil, data_transform(data))
|
188
|
+
end
|
189
|
+
|
190
|
+
# === Create child order.
|
191
|
+
# Create a child order from a parent order.
|
192
|
+
#
|
193
|
+
# ==== Parameters
|
194
|
+
# order_id:: (Integer) -- Parent order id.
|
195
|
+
# data:: (Hash) -- Data to be submitted.
|
196
|
+
#
|
197
|
+
# ==== Example
|
198
|
+
# data = {
|
199
|
+
# order_status_id: 2
|
200
|
+
# }
|
201
|
+
# @data = @cxf_user.create_child_order(1, data)
|
202
|
+
def create_child_order(order_id, data)
|
203
|
+
@client.raw('post', "/ecommerce/orders/#{order_id}/child-order", nil, data_transform(data))
|
204
|
+
end
|
205
|
+
end
|
data/lib/user/helpers/helpers.rb
CHANGED
@@ -1,13 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative './object_activities'
|
4
|
-
require_relative './object_folders'
|
5
|
-
require_relative './user_folders'
|
6
|
-
|
7
3
|
module Helpers
|
8
|
-
include ObjectActivities
|
9
|
-
include ObjectFolders
|
10
|
-
include UserFolders
|
11
4
|
|
12
5
|
##
|
13
6
|
# == Helpers
|
@@ -22,95 +15,6 @@ module Helpers
|
|
22
15
|
# ==== Example
|
23
16
|
#
|
24
17
|
def slugify(data)
|
25
|
-
# TODO: Research use of variable polymorphicObjectType
|
26
18
|
@client.raw('post', '/helpers/slugify', nil, data_transform(data))
|
27
19
|
end
|
28
|
-
|
29
|
-
# === Get available types from usage.
|
30
|
-
# Get available types by usage.
|
31
|
-
#
|
32
|
-
# ==== Parameters
|
33
|
-
# usage:: () -- ...
|
34
|
-
#
|
35
|
-
def get_available_types_from_usage(usage)
|
36
|
-
# TODO: Research use
|
37
|
-
@client.raw('get', "/helpers/available-types/#{usage}")
|
38
|
-
end
|
39
|
-
|
40
|
-
# === Get magic link config.
|
41
|
-
# Get config used in magic links.
|
42
|
-
#
|
43
|
-
# ==== Example
|
44
|
-
# @data = @cxf_user.get_magic_link_config
|
45
|
-
def get_magic_link_config
|
46
|
-
@client.raw('get', '/helpers/magic-link-config')
|
47
|
-
end
|
48
|
-
|
49
|
-
##
|
50
|
-
# == Activities
|
51
|
-
#
|
52
|
-
|
53
|
-
# === Get activities by object type and id.
|
54
|
-
# Get activities using an object type and object type id.
|
55
|
-
#
|
56
|
-
# ==== Parameters
|
57
|
-
# object_type:: (String) -- Object type.
|
58
|
-
# id:: (Integer) -- Object type id.
|
59
|
-
#
|
60
|
-
# ==== Example
|
61
|
-
# @data = @cxf_user.get_activities_by_object_type_and_id('contacts', 1)
|
62
|
-
def get_activities_by_object_type_and_id(object_type, id)
|
63
|
-
@client.raw('get', "/helpers/activities/#{object_type}/#{id}")
|
64
|
-
end
|
65
|
-
|
66
|
-
##
|
67
|
-
# == Dice Coefficient
|
68
|
-
#
|
69
|
-
|
70
|
-
# === Get dice coefficient.
|
71
|
-
# Get dice coefficient.
|
72
|
-
#
|
73
|
-
# ==== Parameters
|
74
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
75
|
-
#
|
76
|
-
# ==== Example
|
77
|
-
# options = {
|
78
|
-
# table: 'contacts',
|
79
|
-
# field: 'id',
|
80
|
-
# word: '1'
|
81
|
-
# }
|
82
|
-
# @data = @cxf_user.get_dice_coefficient(options)
|
83
|
-
def get_dice_coefficient(options)
|
84
|
-
@client.raw('get', '/helpers/dice-coefficient', options)
|
85
|
-
end
|
86
|
-
|
87
|
-
##
|
88
|
-
# == Permission
|
89
|
-
#
|
90
|
-
|
91
|
-
# === Get permission menu.
|
92
|
-
# Get permission menu.
|
93
|
-
#
|
94
|
-
# ==== Example
|
95
|
-
# @data = @cxf_user.get_permission_menu
|
96
|
-
def get_permission_menu
|
97
|
-
@client.raw('get', '/helpers/menu')
|
98
|
-
end
|
99
|
-
|
100
|
-
##
|
101
|
-
# == Seed
|
102
|
-
#
|
103
|
-
|
104
|
-
# === Generate seed.
|
105
|
-
# Generate seed using object type and object type id.
|
106
|
-
#
|
107
|
-
# ==== Parameters
|
108
|
-
# objectType:: (String) -- Object type.
|
109
|
-
# id:: (Integer) -- Object type id.
|
110
|
-
#
|
111
|
-
# ==== Example
|
112
|
-
# @data = @cxf_user.generate_seed('contacts', 1)
|
113
|
-
def generate_seed(object_type, id)
|
114
|
-
@client.raw('get', "/helpers/seeds/#{object_type}/#{id}")
|
115
|
-
end
|
116
20
|
end
|
data/lib/user.rb
CHANGED
@@ -3,14 +3,13 @@
|
|
3
3
|
require_relative './client'
|
4
4
|
require_relative './cxf/helpers/cxf_helper'
|
5
5
|
require_relative './cxf/helpers/threads_helper'
|
6
|
-
require_relative './user/
|
6
|
+
require_relative './user/customer-data/customer_data'
|
7
7
|
require_relative './user/content/content'
|
8
8
|
require_relative './user/marketing/marketing'
|
9
9
|
require_relative './user/ecommerce/ecommerce'
|
10
10
|
require_relative './user/config/config'
|
11
11
|
require_relative './user/profile/profile'
|
12
12
|
require_relative './user/helpers/helpers'
|
13
|
-
require_relative './user/contacts/contacts'
|
14
13
|
|
15
14
|
module Cxf
|
16
15
|
##
|
@@ -38,7 +37,7 @@ module Cxf
|
|
38
37
|
# * +sort+ - [String] indicates the columns that will be selected
|
39
38
|
|
40
39
|
class User
|
41
|
-
include
|
40
|
+
include CustomerData
|
42
41
|
include Content
|
43
42
|
include Marketing
|
44
43
|
include Ecommerce
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cxf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Ruben Gomez Garcia, Omar Mora, Luis Payan, Oscar Castillo, Fabian Garcia
|
7
|
+
- Ruben Gomez Garcia, Omar Mora, Luis Payan, Oscar Castillo, Fabian Garcia, Luis Hesiquio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -156,12 +156,18 @@ files:
|
|
156
156
|
- lib/pub/config/config.rb
|
157
157
|
- lib/pub/content/assets.rb
|
158
158
|
- lib/pub/content/content.rb
|
159
|
+
- lib/pub/content/content_prints.rb
|
160
|
+
- lib/pub/content/print_versions.rb
|
159
161
|
- lib/pub/ecommerce/ecommerce.rb
|
160
162
|
- lib/user.rb
|
161
163
|
- lib/user/config/attribute_groups.rb
|
162
164
|
- lib/user/config/attributes.rb
|
163
165
|
- lib/user/config/calendars.rb
|
164
166
|
- lib/user/config/config.rb
|
167
|
+
- lib/user/config/docs.rb
|
168
|
+
- lib/user/config/exports.rb
|
169
|
+
- lib/user/config/logs.rb
|
170
|
+
- lib/user/config/password.rb
|
165
171
|
- lib/user/config/relationships.rb
|
166
172
|
- lib/user/config/seeds.rb
|
167
173
|
- lib/user/config/system_settings.rb
|
@@ -169,38 +175,30 @@ files:
|
|
169
175
|
- lib/user/config/taxonomies.rb
|
170
176
|
- lib/user/config/users.rb
|
171
177
|
- lib/user/config/views.rb
|
172
|
-
- lib/user/contacts/contacts.rb
|
173
178
|
- lib/user/content/assets.rb
|
174
179
|
- lib/user/content/block_templates.rb
|
175
180
|
- lib/user/content/blocks.rb
|
181
|
+
- lib/user/content/bundles.rb
|
176
182
|
- lib/user/content/content.rb
|
177
183
|
- lib/user/content/content_bundles.rb
|
178
184
|
- lib/user/content/content_prints.rb
|
179
185
|
- lib/user/content/instances.rb
|
186
|
+
- lib/user/content/message_templates.rb
|
180
187
|
- lib/user/content/print_versions.rb
|
181
|
-
- lib/user/content/
|
182
|
-
- lib/user/content/story_templates.rb
|
188
|
+
- lib/user/content/prints.rb
|
183
189
|
- lib/user/content/templates.rb
|
184
|
-
- lib/user/
|
185
|
-
- lib/user/
|
186
|
-
- lib/user/
|
190
|
+
- lib/user/customer-data/companies.rb
|
191
|
+
- lib/user/customer-data/contacts.rb
|
192
|
+
- lib/user/customer-data/customer_data.rb
|
193
|
+
- lib/user/customer-data/profiles.rb
|
194
|
+
- lib/user/customer-data/segments.rb
|
195
|
+
- lib/user/customer-data/workflow_steps.rb
|
196
|
+
- lib/user/customer-data/workflows.rb
|
187
197
|
- lib/user/ecommerce/ecommerce.rb
|
188
|
-
- lib/user/ecommerce/
|
189
|
-
- lib/user/ecommerce/
|
190
|
-
- lib/user/ecommerce/
|
191
|
-
- lib/user/ecommerce/product_templates.rb
|
192
|
-
- lib/user/ecommerce/product_variations.rb
|
193
|
-
- lib/user/ecommerce/product_versions.rb
|
194
|
-
- lib/user/ecommerce/products.rb
|
195
|
-
- lib/user/ecommerce/skus.rb
|
196
|
-
- lib/user/ecommerce/taxes.rb
|
197
|
-
- lib/user/ecommerce/variant_options.rb
|
198
|
-
- lib/user/ecommerce/variant_values.rb
|
199
|
-
- lib/user/ecommerce/vouchers.rb
|
198
|
+
- lib/user/ecommerce/item_codes.rb
|
199
|
+
- lib/user/ecommerce/order_templates.rb
|
200
|
+
- lib/user/ecommerce/orders.rb
|
200
201
|
- lib/user/helpers/helpers.rb
|
201
|
-
- lib/user/helpers/object_activities.rb
|
202
|
-
- lib/user/helpers/object_folders.rb
|
203
|
-
- lib/user/helpers/user_folders.rb
|
204
202
|
- lib/user/marketing/marketing.rb
|
205
203
|
- lib/user/profile/profile.rb
|
206
204
|
homepage: https://github.com/rubengomez/cxf-ruby-sdk
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Contacts
|
4
|
-
##
|
5
|
-
# == Contact Auth
|
6
|
-
#
|
7
|
-
# === Change password no auth.
|
8
|
-
# Change password to an email without auth.
|
9
|
-
#
|
10
|
-
# ==== Parameters
|
11
|
-
# data:: (Hash) -- Data to be submitted.
|
12
|
-
#
|
13
|
-
# ==== Example
|
14
|
-
# data = {
|
15
|
-
# password: '12345678',
|
16
|
-
# email: 'email@example.com'
|
17
|
-
# }
|
18
|
-
# @data = @cxf_user.change_password_no_auth(data)
|
19
|
-
def change_password_no_auth(data)
|
20
|
-
@client.raw('post', '/contacts/change-password-no-auth', nil, data_transform(data))
|
21
|
-
end
|
22
|
-
end
|
data/lib/user/content/stories.rb
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Stories
|
4
|
-
# === Duplicate story.
|
5
|
-
# Duplicate a story.
|
6
|
-
#
|
7
|
-
# ==== Parameters
|
8
|
-
# id:: (Integer) -- Story id.
|
9
|
-
# data:: (Hash) -- Data to be submitted.
|
10
|
-
#
|
11
|
-
# ==== Example
|
12
|
-
# data = { options: [] }
|
13
|
-
# @data = @cxf_user.duplicate_story(1, data.to_json)
|
14
|
-
def duplicate_story(id, data)
|
15
|
-
@client.raw('post', "/content/stories/#{id}/duplicate", nil, data)
|
16
|
-
end
|
17
|
-
|
18
|
-
# === Get stories.
|
19
|
-
# Get a collection of stories.
|
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_stories
|
27
|
-
#
|
28
|
-
# ==== Second Example
|
29
|
-
# options = {
|
30
|
-
# fields: 'id, slug'
|
31
|
-
# }
|
32
|
-
# @data = @cxf_user.get_stories(options)
|
33
|
-
#
|
34
|
-
# ==== Third Example
|
35
|
-
# options = {
|
36
|
-
# fields: 'id, slug'
|
37
|
-
# }
|
38
|
-
# @data = @cxf_user.get_stories(options, true)
|
39
|
-
def get_stories(options = nil, use_post = true)
|
40
|
-
get_query_results('/content/stories', options, use_post)
|
41
|
-
end
|
42
|
-
|
43
|
-
# === Get story.
|
44
|
-
# Get a story info.
|
45
|
-
#
|
46
|
-
# ==== Parameters
|
47
|
-
# id:: (Integer) -- Story id.
|
48
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
49
|
-
#
|
50
|
-
# ==== First Example
|
51
|
-
# @data = @cxf_user.get_story(1)
|
52
|
-
#
|
53
|
-
# ==== Second Example
|
54
|
-
# options = {
|
55
|
-
# fields: 'id, slug'
|
56
|
-
# }
|
57
|
-
# @data = @cxf_user.get_story(1, options)
|
58
|
-
def get_story(id, options = nil)
|
59
|
-
@client.raw('get', "/content/stories/#{id}", options)
|
60
|
-
end
|
61
|
-
|
62
|
-
# === Create story.
|
63
|
-
# Create a story with data.
|
64
|
-
#
|
65
|
-
# ==== Parameters
|
66
|
-
# data:: (Hash) -- Data to be submitted.
|
67
|
-
#
|
68
|
-
# ==== Example
|
69
|
-
# data = {
|
70
|
-
# user_id: 1,
|
71
|
-
# slug: "new-story",
|
72
|
-
# story_template_id: 1
|
73
|
-
# }
|
74
|
-
#
|
75
|
-
# options = { fields: 'id,slug' }
|
76
|
-
#
|
77
|
-
# @data = @cxf_user.create_story(data, options)
|
78
|
-
def create_story(data, options = nil)
|
79
|
-
@client.raw('post', '/content/stories', options, data_transform(data))
|
80
|
-
end
|
81
|
-
|
82
|
-
# === Update story.
|
83
|
-
# Update a story info.
|
84
|
-
#
|
85
|
-
# ==== Parameters
|
86
|
-
# id:: (Integer) -- Story id.
|
87
|
-
# data:: (Hash) -- Data to be submitted.
|
88
|
-
#
|
89
|
-
# ==== Example
|
90
|
-
# data = {
|
91
|
-
# user_id: 1,
|
92
|
-
# slug: 'new-story'
|
93
|
-
# }
|
94
|
-
# @data = @cxf_user.update_story(5, data)
|
95
|
-
def update_story(id, data, options = nil)
|
96
|
-
@client.raw('put', "/content/stories/#{id}", options, data_transform(data))
|
97
|
-
end
|
98
|
-
|
99
|
-
# === Delete story.
|
100
|
-
# Delete a story.
|
101
|
-
#
|
102
|
-
# ==== Parameters
|
103
|
-
# id:: (Integer) -- Story id.
|
104
|
-
#
|
105
|
-
# ==== Example
|
106
|
-
# @data = @cxf_user.delete_story(6)
|
107
|
-
def delete_story(id)
|
108
|
-
@client.raw('delete', "/content/stories/#{id}")
|
109
|
-
end
|
110
|
-
end
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module StoryTemplates
|
4
|
-
##
|
5
|
-
# == Story Template
|
6
|
-
#
|
7
|
-
|
8
|
-
# === Get support data of story template.
|
9
|
-
# Get support data used in a story template.
|
10
|
-
#
|
11
|
-
# ==== Parameters
|
12
|
-
# id:: (Integer) -- Story template id.
|
13
|
-
#
|
14
|
-
# ==== Example
|
15
|
-
# @data = @cxf_user.get_story_template_support_data(1)
|
16
|
-
def get_story_template_support_data(id)
|
17
|
-
@client.raw('get', "/content/story-templates/support-data/stories/#{id}")
|
18
|
-
end
|
19
|
-
|
20
|
-
# === Get support data of story templates.
|
21
|
-
# Get support data used in story templates.
|
22
|
-
#
|
23
|
-
# ==== Example
|
24
|
-
# @data = @cxf_user.get_story_templates_support_data
|
25
|
-
def get_story_templates_support_data
|
26
|
-
@client.raw('get', '/content/story-templates/support-data')
|
27
|
-
end
|
28
|
-
|
29
|
-
# === Get story templates.
|
30
|
-
# Get a collection of story templates.
|
31
|
-
#
|
32
|
-
# ==== Parameters
|
33
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
34
|
-
#
|
35
|
-
# ==== First Example
|
36
|
-
# @data = @cxf_user.get_story_templates
|
37
|
-
#
|
38
|
-
# ==== Second Example
|
39
|
-
# options = {
|
40
|
-
# fields: 'id, title'
|
41
|
-
# }
|
42
|
-
# @data = @cxf_user.get_story_templates(options)
|
43
|
-
def get_story_templates(options = nil)
|
44
|
-
@client.raw('get', '/content/story-templates', options)
|
45
|
-
end
|
46
|
-
|
47
|
-
# === Get story template.
|
48
|
-
# Get a story template info.
|
49
|
-
#
|
50
|
-
# ==== Parameters
|
51
|
-
# id:: (Integer) -- Story template id.
|
52
|
-
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
53
|
-
#
|
54
|
-
# ==== First Example
|
55
|
-
# @data = @cxf_user.get_story_template(2)
|
56
|
-
#
|
57
|
-
# ==== Second Example
|
58
|
-
# options = {
|
59
|
-
# fields: 'title'
|
60
|
-
# }
|
61
|
-
# @data = @cxf_user.get_story_template(1, options)
|
62
|
-
def get_story_template(id, options = nil)
|
63
|
-
@client.raw('get', "/content/story-templates/#{id}", options)
|
64
|
-
end
|
65
|
-
|
66
|
-
# === Create story template.
|
67
|
-
# Create a story template with data.
|
68
|
-
#
|
69
|
-
# ==== Parameters
|
70
|
-
# data:: (Hash) -- Data to be submitted.
|
71
|
-
#
|
72
|
-
# ==== Example
|
73
|
-
# data = {
|
74
|
-
# title: 'New Story Template',
|
75
|
-
# slug: 'new-story-template-slug'
|
76
|
-
# }
|
77
|
-
# @data = @cxf_user.create_story_template(data)
|
78
|
-
def create_story_template(data, options = nil)
|
79
|
-
@client.raw('post', '/content/story-templates', options, data_transform(data))
|
80
|
-
end
|
81
|
-
|
82
|
-
# === Update story template.
|
83
|
-
# Update a story template info.
|
84
|
-
#
|
85
|
-
# ==== Parameters
|
86
|
-
# id:: (Integer) -- Story template id.
|
87
|
-
# data:: (Hash) -- Data to be submitted.
|
88
|
-
#
|
89
|
-
# ==== Example
|
90
|
-
# data = {
|
91
|
-
# title: 'New Story Template Modified'
|
92
|
-
# }
|
93
|
-
# @data = @cxf_user.update_story_template(3, data)
|
94
|
-
def update_story_template(id, data)
|
95
|
-
@client.raw('put', "/content/story-templates/#{id}", nil, data_transform(data))
|
96
|
-
end
|
97
|
-
end
|