forest_liana 1.5.24 → 1.5.25

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
  SHA1:
3
- metadata.gz: 6cc550679b0d1373ea2d56a14fb0e633dd3a4654
4
- data.tar.gz: 2de1b2d6a258880709fc6dbd32e0c5b9d5383024
3
+ metadata.gz: 4545833279c4d1a547dc247f027202905333d2a1
4
+ data.tar.gz: 1ae312dd09108112142502d61db0440c2b6c256b
5
5
  SHA512:
6
- metadata.gz: 0850225c2706025b1c39dc5f59f3e11f6dad123196feffdafd5422018181070db442bf35533b2d224886a08fef1ffd9d692f6fdd28b6fe55a148649217ba9ccd
7
- data.tar.gz: 31d14bcdc9e58b0691cdf9766960bdf7d4c255efdfc0cd4207b8fb1718c13ac7c1789daa885f9ed3264e2ec8738b1bf96415f07baf382b9fba3456f4247c769f
6
+ metadata.gz: 922d4395f379c92d8e100fd7b6855f33eed1903d8749f9a5ca8a02fbf8f7e6e4114669e6c7045e6273e6101cd4676fe8f1d0f330c51542df3243eaa1c891b569
7
+ data.tar.gz: 135fa379ce6b4ef756f5667cb922e319de9e9c82d40fcddd305bd9dd978dbe404d26f30a3da41b4439336cc12ccdc21097eb94db317e673d93a880415482a277
@@ -6,7 +6,7 @@ class ForestLiana::Model::Collection
6
6
 
7
7
  attr_accessor :name, :fields, :actions, :segments, :only_for_relationships,
8
8
  :is_virtual, :is_read_only, :is_searchable, :display_name, :icon,
9
- :pagination_type
9
+ :integration, :pagination_type
10
10
 
11
11
  def initialize(attributes = {})
12
12
  @actions = []
@@ -6,6 +6,7 @@ class ForestLiana::CollectionSerializer
6
6
  attribute :name
7
7
  attribute :display_name
8
8
  attribute :icon
9
+ attribute :integration
9
10
  attribute :fields
10
11
  attribute :only_for_relationships
11
12
  attribute :is_virtual
@@ -150,23 +150,28 @@ module ForestLiana
150
150
  request['forest-secret-key'] = ForestLiana.env_secret
151
151
  response = client.request(request)
152
152
 
153
- unless response.body.blank?
154
- warning = JSON.parse(response.body)['warning']
155
- end
156
-
157
- if response.is_a?(Net::HTTPNotFound) # NOTICE: HTTP 404 Error
158
- FOREST_LOGGER.error "Cannot find the project related to the " \
159
- "env_secret you configured. Can you check on Forest that you " \
160
- "copied it properly in the forest_liana initializer?"
161
- elsif response.is_a?(Net::HTTPBadRequest) # NOTICE: HTTP 400 Error
162
- FOREST_LOGGER.error "An error occured with the apimap sent to " \
163
- "Forest. Please contact support@forestadmin.com for further " \
164
- "investigations."
165
- elsif warning
166
- FOREST_LOGGER.warn warning
153
+ if ['200', '202', '204', '400', '404'].include? response.code
154
+ unless response.body.blank?
155
+ warning = JSON.parse(response.body)['warning']
156
+ end
157
+
158
+ if response.is_a?(Net::HTTPNotFound) # NOTICE: HTTP 404 Error
159
+ FOREST_LOGGER.error "Cannot find the project related to the " \
160
+ "env_secret you configured. Can you check on Forest that " \
161
+ "you copied it properly in the forest_liana initializer?"
162
+ elsif response.is_a?(Net::HTTPBadRequest) # NOTICE: HTTP 400 Error
163
+ FOREST_LOGGER.error "An error occured with the apimap sent " \
164
+ "to Forest. Please contact support@forestadmin.com for " \
165
+ "further investigations."
166
+ elsif warning
167
+ FOREST_LOGGER.warn warning
168
+ end
169
+ else
170
+ FOREST_LOGGER.error "Forest seems to be down right now. Please " \
171
+ "contact support@forestadmin.com for further investigations."
167
172
  end
168
173
  end
169
- rescue Errno::ECONNREFUSED
174
+ rescue Errno::ECONNREFUSED, SocketError
170
175
  FOREST_LOGGER.warn "Cannot send the apimap to Forest. Are you online?"
171
176
  end
172
177
  end
@@ -180,6 +185,7 @@ module ForestLiana
180
185
  name: "#{model_name}_intercom_conversations",
181
186
  display_name: collection_display_name + ' Conversations',
182
187
  icon: 'intercom',
188
+ integration: 'intercom',
183
189
  only_for_relationships: true,
184
190
  is_virtual: true,
185
191
  fields: [
@@ -195,6 +201,7 @@ module ForestLiana
195
201
  name: "#{model_name}_intercom_attributes",
196
202
  display_name: collection_display_name + ' Attributes',
197
203
  icon: 'intercom',
204
+ integration: 'intercom',
198
205
  only_for_relationships: true,
199
206
  is_virtual: true,
200
207
  fields: [
@@ -257,6 +264,7 @@ module ForestLiana
257
264
  name: "#{model_name}_stripe_payments",
258
265
  display_name: collection_display_name + ' Payments',
259
266
  icon: 'stripe',
267
+ integration: 'stripe',
260
268
  is_virtual: true,
261
269
  is_read_only: true,
262
270
  pagination_type: 'cursor',
@@ -288,6 +296,7 @@ module ForestLiana
288
296
  name: "#{model_name}_stripe_invoices",
289
297
  display_name: collection_display_name + ' Invoices',
290
298
  icon: 'stripe',
299
+ integration: 'stripe',
291
300
  is_virtual: true,
292
301
  is_read_only: true,
293
302
  pagination_type: 'cursor',
@@ -320,6 +329,7 @@ module ForestLiana
320
329
  name: "#{model_name}_stripe_cards",
321
330
  display_name: collection_display_name + ' Cards',
322
331
  icon: 'stripe',
332
+ integration: 'stripe',
323
333
  is_virtual: true,
324
334
  is_read_only: true,
325
335
  only_for_relationships: true,
@@ -353,6 +363,7 @@ module ForestLiana
353
363
  name: "#{model_name}_stripe_subscriptions",
354
364
  display_name: collection_display_name + ' Subscriptions',
355
365
  icon: 'stripe',
366
+ integration: 'stripe',
356
367
  is_virtual: true,
357
368
  is_read_only: true,
358
369
  pagination_type: 'cursor',
@@ -384,6 +395,7 @@ module ForestLiana
384
395
  name: "#{model_name}_stripe_bank_accounts",
385
396
  display_name: collection_display_name + ' Bank Accounts',
386
397
  icon: 'stripe',
398
+ integration: 'stripe',
387
399
  is_virtual: true,
388
400
  is_read_only: true,
389
401
  only_for_relationships: true,
@@ -71,6 +71,7 @@ module ForestLiana::Collection
71
71
  name: self.collection_name.to_s,
72
72
  is_read_only: self.is_read_only,
73
73
  is_searchable: self.is_searchable,
74
+ is_virtual: true,
74
75
  fields: []
75
76
  })
76
77
 
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "1.5.24"
2
+ VERSION = "1.5.25"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.24
4
+ version: 1.5.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-06 00:00:00.000000000 Z
11
+ date: 2017-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails