contentful-scheduler-custom 1.6.7.5274 → 1.6.7.5275

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
  SHA256:
3
- metadata.gz: e9a2f2734bb823b421e10feaef3a7d987714c6f9ce518975b900f54f65819ea8
4
- data.tar.gz: edb6fd00fcfb22bbbc349543446d3415ad0315ebea7144494261869e6db4493c
3
+ metadata.gz: 5b9d1c96d807f43718d820ddd4c8e52bf610f5bd87d6752a3374db94929b0623
4
+ data.tar.gz: 22e216939b31e1bdbbe9b018f0a3ff1bc6782aee6960923b9f6d1cb33c3fa854
5
5
  SHA512:
6
- metadata.gz: f69c011b6af4a1a3184ab693d25ae944059c1a93f402bbc0616464a2209d0d87213da64878bb328a1c54c3fd4fa6a9a7defc519b45e006fef20a335432f10896
7
- data.tar.gz: f887b03fbb6e557f6bf9901824d5011dcb58516ac67835ff50bc9ed9e4537e9710f0c92dcc097a6a8f26cac3a3e656cb0790cc965e0aa0bca8868114c72c6117
6
+ metadata.gz: 2de8eb070dbf0360b3fb75fa01d30c354df455a63964abd1b86a389d418c72afbae261e304559eb4ee818a1f04239deb5bed123b8c7bab5c069612ac238b084b
7
+ data.tar.gz: 5d74311c2766b955ebefab2b12595f57510157789d28e19709a684f64383296183ec6dd8df75aa6a2905b4e2193d9728f00670db47ad41df7dc9ea8830afc2c9
data/12.json ADDED
@@ -0,0 +1 @@
1
+ {"Entry"=>[{"sys"=>{"space"=>{"sys"=>{"type"=>"Link", "linkType"=>"Space", "id"=>"qbra4qai2ti2"}}, "id"=>"2d5d3ekoU4EqG2YyGWIqgW", "type"=>"Entry", "createdAt"=>"2018-10-11T08:01:05.167Z", "updatedAt"=>"2019-03-13T16:34:47.794Z", "environment"=>{"sys"=>{"id"=>"master", "type"=>"Link", "linkType"=>"Environment"}}, "revision"=>6, "contentType"=>{"sys"=>{"type"=>"Link", "linkType"=>"ContentType", "id"=>"cbForm"}}, "locale"=>"fi-FI"}, "fields"=>{"id"=>"Test Form 134 asd", "title"=>"Test Form 2", "button"=>{"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"3RGJc25XBSsSMGkYGuA224"}}, "fields"=>[{"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"5LWmHVo5MWUQAyCo0IYAKe"}}, {"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"4ZDGs4Zv7Gyko0om8csUKI"}}]}}, {"sys"=>{"space"=>{"sys"=>{"type"=>"Link", "linkType"=>"Space", "id"=>"qbra4qai2ti2"}}, "id"=>"5Pul1SC8Qw3awarTLUtnRN", "type"=>"Entry", "createdAt"=>"2019-03-07T13:21:05.311Z", "updatedAt"=>"2019-03-13T16:34:49.609Z", "environment"=>{"sys"=>{"id"=>"master", "type"=>"Link", "linkType"=>"Environment"}}, "revision"=>4, "contentType"=>{"sys"=>{"type"=>"Link", "linkType"=>"ContentType", "id"=>"cbMarketingSquares"}}, "locale"=>"fi-FI"}, "fields"=>{"id"=>"Marketing Squares Abhilash testasasasd", "marketingSquares"=>[{"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"3vGzmRtzx3YLQvTdl1cA2r"}}]}}, {"sys"=>{"space"=>{"sys"=>{"type"=>"Link", "linkType"=>"Space", "id"=>"qbra4qai2ti2"}}, "id"=>"5ySzHkTjBcNQLnC1JC0mcv", "type"=>"Entry", "createdAt"=>"2019-03-07T12:31:04.377Z", "updatedAt"=>"2019-03-13T16:34:46.334Z", "environment"=>{"sys"=>{"id"=>"master", "type"=>"Link", "linkType"=>"Environment"}}, "revision"=>4, "contentType"=>{"sys"=>{"type"=>"Link", "linkType"=>"ContentType", "id"=>"cbAccordion"}}, "locale"=>"fi-FI"}, "fields"=>{"id"=>"testcvxc678678asd", "title"=>"test", "accordionElements"=>[{"sys"=>{"type"=>"Link", "linkType"=>"Entry", "id"=>"7Jvuq8Wpi92pgEYGAza2U0"}}]}}]}
@@ -9,6 +9,32 @@ module Contentful
9
9
  class Publish
10
10
  @queue = :publish
11
11
 
12
+ def recursive_flatten(array, results = [])
13
+ array.each do |element|
14
+ if element.class == Array
15
+ recursive_flatten(element, results)
16
+ else
17
+ results << element
18
+ end
19
+ end
20
+ results
21
+ end
22
+
23
+ def all_keys(hash)
24
+ hash.flat_map { |k, v| [k] + (v.is_a?(Hash) ? all_keys(v) : [v]) }
25
+ end
26
+
27
+ all_keys(t).each do |key|
28
+ if key.is_a? Array
29
+ key.each do |t|
30
+ sys = t.select{|k,v| k == "sys"}["sys"]
31
+ if !sys.select{|k,v| k == "linkType" && v == "Entry"}.nil?
32
+ puts sys
33
+ end
34
+ end
35
+ end
36
+ end
37
+
12
38
  def self.perform(space_id, entry_id, token)
13
39
  logger = Logger.new(STDOUT)
14
40
  client1 = Contentful::Client.new(
@@ -27,7 +53,7 @@ module Contentful
27
53
 
28
54
  linked_enteries = client1.entries(links_to_entry: entry_id)
29
55
 
30
-
56
+ logger.info "Ruby raw element is ==> #{linked_enteries.items.raw}"
31
57
 
32
58
  linked_enteries.items.each do |entry|
33
59
  entry.fields.each do |fields|
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Scheduler
3
- VERSION = "1.6.7.5274"
3
+ VERSION = "1.6.7.5275"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-scheduler-custom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.7.5274
4
+ version: 1.6.7.5275
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (David Litvak Bruno0
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-15 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contentful
@@ -202,6 +202,7 @@ files:
202
202
  - ".gitignore"
203
203
  - ".rspec"
204
204
  - ".travis.yml"
205
+ - 12.json
205
206
  - 3.json
206
207
  - CHANGELOG.md
207
208
  - CODE_OF_CONDUCT.md