contentstack_utils 0.1.0.pre.beta.1 → 1.1.0

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.
@@ -0,0 +1,146 @@
1
+
2
+ PlainTextHtml = "<strong>Aliquam sit amet libero dapibus, eleifend ligula at, varius justo</strong><strong><em>Lorem ipsum</em></strong><strong><em><u>dolor sit amet</u></em></strong><strong><em><u><strike>consectetur adipiscing elit.</strike></u></em></strong><strong><em><u><span>Sed condimentum iaculis magna in vehicula. </span></u></em></strong><strong><em><u><sup>Vestibulum vitae convallis </sup></u></em></strong><strong><em><u><sub> lacus. </sub></u></em></strong>"
3
+ ParagraphHtml = "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum iaculis magna in vehicula. Vestibulum vitae convallis lacus. Praesent a diam iaculis turpis rhoncus faucibus. Aliquam sed pulvinar sem.</p>"
4
+ H1Html = "<h1><strong><em><u><sub>Lorem ipsum dolor sit amet.</sub></u></em></strong></h1>"
5
+ H2Html = "<h2><strong><em><u><sub>Vestibulum a ligula eget massa sagittis aliquam sit amet quis tortor. </sub></u></em></strong></h2>"
6
+ H3Html = "<h3><strong><em><u><sub>Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum.</sub></u></em></strong></h3>"
7
+ H4Html = "<h4><strong><em><u><sub>MaNullam feugiat turpis quis elit interdum, vitae laoreet quam viverra</sub></u></em></strong></h4>"
8
+ H5Html = "<h5>Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum.</h5>"
9
+ H6Html = "<h6>Nunc porta diam vitae purus semper, ut consequat lorem vehicula.</h6>"
10
+ OrderListHtml = "<ol><li>Morbi in quam molestie, fermentum diam vitae, bibendum ipsum.</li><li>Pellentesque mattis lacus in quam aliquam congue</li><li>Integer feugiat leo dignissim, lobortis enim vitae, mollis lectus.</li><li>Sed in ante lacinia, molestie metus eu, fringilla sapien.</li></ol>"
11
+ UnorderListHtml = "<ul><li>Sed quis metus sed mi hendrerit mollis vel et odio.</li><li>Integer vitae sem dignissim, elementum libero vel, fringilla massa.</li><li>Integer imperdiet arcu sit amet tortor faucibus aliquet.</li><li>Aenean scelerisque velit vitae dui vehicula, at congue massa sagittis.</li></ul>"
12
+ ImgHtml = "<img src='https://images.contentstack.com/v3/assets/blt7726e6b/bltb42cd1/5fa3be959bedb6b/Donald.jog.png' />"
13
+ TableHtml = "<table><thead><tr><th><p>Header 1</p></th><th><p>Header 2</p></th></tr></thead><tbody><tr><td><p>Body row 1 data 1</p></td><td><p>Body row 1 data 2</p></td></tr><tr><td><p>Body row 2 data 1</p></td><td><p>Body row 2 data 2</p></td></tr></tbody></table>"
14
+ BlockquoteHtml = "<blockquote>Praesent eu ex sed nibh venenatis pretium.</blockquote>"
15
+ CodeHtml = "<code>Code template.</code>"
16
+ LinkInPHtml = "<p><strong><em><u><sub></sub></u></em></strong><a href='LINK.com'>LINK</a></p>"
17
+ EmbedHtml = "<iframe src='https://www.youtube.com/watch?v=AOP0yARiW8U'></iframe>"
18
+ AssetReferenceHtml = "<img src='/v3/assets/blt333/blt44asset/dummy.pdf' alt='dummy.pdf' />"
19
+ EntryReferenceBlockHtml = "<div><p>Update this title</p><p>Content type: <span>content_block</span></p></div>"
20
+ EntryReferenceLinkHtml = "<a href='/copy-of-entry-final-02'>/copy-of-entry-final-02</a>"
21
+ EntryReferenceInlineHtml = "<span>updated title</span>"
22
+
23
+ BlankDocument = '{ "uid":"06e34a7a4e5d7fc2acd", "_version":13, "attrs":{ }, "children":[],"type":"doc"}'
24
+ PlainTextJson = '{ "uid":"06e34a7a4e5d7fc2acd", "_version":13, "attrs":{ }, "children":[{"text":"Aliquam sit amet libero dapibus, eleifend ligula at, varius justo","bold":true},{ "text":"Lorem ipsum","bold":true,"italic":true},{ "text":"dolor sit amet","bold":true,"italic":true,"underline":true},{ "text":"consectetur adipiscing elit.","bold":true,"italic":true,"underline":true,"strikethrough":true},{ "text":"Sed condimentum iaculis magna in vehicula. ","bold":true,"italic":true,"underline":true,"inlineCode":true},{ "text":"Vestibulum vitae convallis ","bold":true,"italic":true,"underline":true,"superscript":true},{ "text":" lacus. ","bold":true,"italic":true,"underline":true,"subscript":true}],"type":"doc"}'
25
+ H1Json = '{ "uid":"06e34a7a449d7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h1","attrs":{ },"uid":"c2dfed70 4d7030c65e2e1","children":[{ "text":"Lorem ipsum dolor sit amet.","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
26
+ H2Json = '{ "uid":"06e34a7a4e2acd","_version":13,"attrs":{ },"children":[{ "type":"h2","attrs":{ },"uid":"c2dfed9a7030c65e2e1","children":[{ "text":"Vestibulum a ligula eget massa sagittis aliquam sit amet quis tortor. ","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
27
+ H3Json = '{ "uid":"06e34ad7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h3","attrs":{ },"uid":"c2df42cfb70 4d7030c65e2e1","children":[{ "text":"Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum.","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
28
+ H4Json = '{ "uid":"06e34a7a4e54cd", "_version":13, "attrs":{ "style":{ "text-align":"center" }, "redactor-attributes":{ } }, "children":[{"type":"h4","attrs":{},"uid":"c2dfed4d7030c65e2e1","children":[{"text":"MaNullam feugiat turpis quis elit interdum, vitae laoreet quam viverra","bold":true,"italic":true,"underline":true,"subscript":true}]}],"type":"doc"}'
29
+ H5Json = '{ "uid": "06e381190849dacd", "_version": 13, "attrs": { }, "children": [ { "type": "h5", "attrs": {}, "uid": "c2d672242cfb7045e2e1", "children": [ { "text": "Mauris venenatis dui id massa sollicitudin, non bibendum nunc dictum." } ] } ], "type": "doc" }'
30
+ H6Json = '{ "uid": "06e34a71190849d7fcd", "_version": 13, "attrs": { }, "children": [ { "type": "h6", "attrs": {}, "uid": "c2dfa672242cfb7e2e1", "children": [ { "text": "Nunc porta diam vitae purus semper, ut consequat lorem vehicula." } ] } ], "type": "doc" }'
31
+ OrderListJson = '{ "uid":"06e35 48119084 9d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"2b5b4acbb3cfce02d3e","type":"ol","children":[{"type":"li","attrs":{"style":{"text-align":"justify"},"redactor-attributes":{ }},"uid":"160bbd7430b98bd3d996","children":[{"text":"Morbi in quam molestie, fermentum diam vitae, bibendum ipsum."}]},{ "type":"li","attrs":{ "style":{ "text-align":"justify"},"redactor-attributes":{ } },"uid":"a15f4d749bc2903d","children":[{ "text":"Pellentesque mattis lacus in quam aliquam congue"}]},{ "type":"li","attrs":{ "style":{ "text-align":"justify"},"redactor-attributes":{ } },"uid":"e54224bbcb6f9e8f1e43","children":[{ "text":"Integer feugiat leo dignissim, lobortis enim vitae, mollis lectus."}]},{ "type":"li","attrs":{ "style":{ "text-align":"justify"},"redactor-attributes":{ } },"uid":"c0148bab9af758784","children":[{ "text":"Sed in ante lacinia, molestie metus eu, fringilla sapien."}]}],"id":"7f413d448a","attrs":{ }}],"type":"doc"}'
32
+ UnorderListJson = '{ "uid":"0e5481190849a", "_version":13, "attrs":{ }, "children":[{"uid":"a3a2b443ebffc867b","type":"ul","children":[{"uid":"f67354d4eed64451922","type":"li","children":[{"text":"Sed quis metus sed mi hendrerit mollis vel et odio."}],"attrs":{ }},{ "uid":"5 50cba5 bea92f23e36fd1","type":"li","children":[{ "text":"Integer vitae sem dignissim, elementum libero vel, fringilla massa."}],"attrs":{ } },{ "uid":"0e5c9b4cd983e8fd543","type":"li","children":[{ "text":"Integer imperdiet arcu sit amet tortor faucibus aliquet."}],"attrs":{ } },{ "uid":"6d9a43a3816bd83a9a","type":"li","children":[{ "text":"Aenean scelerisque velit vitae dui vehicula, at congue massa sagittis."}],"attrs":{ } }],"id":"b083fa46ef899420ab19","attrs":{ }}],"type":"doc"}'
33
+ ImgJson = '{ "uid":"06e34a7a4849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"f3be74be3b64646e626","type":"img","attrs":{"src":"https://images.contentstack.com/v3/assets/blt7726e6b/bltb42cd1/5fa3be959bedb6b/Donald.jog.png","width":33.69418132611637,"height":"auto","redactor-attributes":{"asset_uid":"47f1aa5ae422cd1"}},"children":[{"text":""}]}],"type":"doc"}'
34
+ ParagraphJson = '{ "uid":"0d7fd", "_version":13, "attrs":{ }, "children":[{"type":"p","attrs":{},"uid":"0a1b5676aa510e5a","children":[{"text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum iaculis magna in vehicula. Vestibulum vitae convallis lacus. Praesent a diam iaculis turpis rhoncus faucibus. Aliquam sed pulvinar sem."}]}],"type":"doc"}'
35
+ BlockquoteJson = '{ "uid":"06084d7fd", "_version":13, "attrs":{ }, "children":[{"uid":"503f9cc97534db55","type":"blockquote","id":"431f78e567161460","children":[{"text":"Praesent eu ex sed nibh venenatis pretium."}],"attrs":{ }}],"type":"doc"}'
36
+ CodeJson = '{ "uid":"06ea490849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"83fba92c91b30002b","type":"code","attrs":{},"children":[{"text":"Code template."}]}],"type":"doc"}'
37
+ TableJson = '{ "uid": "06e481190849d7fcd", "_version": 13, "attrs": { }, "children": [ { "uid": "6dd64343bf634bfadd4", "type": "table", "attrs": { "rows": 4, "cols": 2, "colWidths": [ 250, 250 ] }, "children": [ { "uid": "b9082", "type": "thead", "attrs": {}, "children": [ { "type": "tr", "attrs": {}, "children": [ { "type": "th", "attrs": {}, "children": [ { "type": "p", "attrs": {}, "children": [ { "text": "Header 1" } ], "uid": "daa3ef" } ], "uid": "4b3124414a3" }, { "type": "th", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Header 2" } ], "uid": "eae83c5797d" } ], "uid": "bca9b6f037a04fb485" } ], "uid": "b91ae7a48ef2e9da1" } ] }, { "type": "tbody", "attrs": { }, "children": [ { "type": "tr", "attrs": { }, "children": [ { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 1 data 1" } ], "uid": "ec674ccc5ce70b7cab" } ], "uid": "2a70bdeeb99a" }, { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 1 data 2" } ], "uid": "769a 3f9db34 ce8ec 10486d50" } ], "uid": "d6407 34a5c6 1ab1e5f7d1" } ], "uid": "77f6 b951c68 7f9eb397c5" }, { "type": "tr", "attrs": { }, "children": [ { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 2 data 1" } ], "uid": "a6bf 11bb48 630e87d721c0" } ], "uid": "3da39838b0feaf" }, { "type": "td", "attrs": { }, "children": [ { "type": "p", "attrs": { }, "children": [ { "text": "Body row 2 data 2" } ], "uid": "3b7d12 1f694202 49029e86313" } ], "uid": "95b38b04abcbc25e94f" } ], "uid": "b 227fea 8d247013 4f1e1e8" } ], "uid": "fd5ab86aa642798451b" } ] } ], "type": "doc" }'
38
+ LinkInPJson = '{ "uid":"06e34a7190849d7f2acd", "_version":13, "attrs":{ }, "children":[{"type":"p","attrs":{"style":{"text-align":"left"},"redactor-attributes":{ }},"uid":"d88dcdf4590dff2d","children":[{"text":"","bold":true,"italic":true,"underline":true,"subscript":true},{ "uid":"0d06598201aa8b47","type":"a","attrs":{ "href":"LINK.com","target":"_self"},"children":[{ "text":"LINK"}]},{ "text":""}]}],"type":"doc"}'
39
+ EmbedJson = '{ "uid":"06e34a7190849d7f2acd", "_version":13, "attrs":{ }, "children":[{"uid":"251017315905c35d42c9","type":"embed","attrs":{"src":"https://www.youtube.com/watch?v=AOP0yARiW8U"},"children":[{"text":""}]}],"type":"doc"}'
40
+ AssetReferenceJson = '{"uid":"06e34a7 5e4 e549d ", "_version":1, "attrs":{}, "children":[{ "uid": "4f7e33 3390a955 de10c1 c836", "type":"reference","attrs":{"display-type":"display","asset-uid":"blt44asset","content-type-uid":"sys_assets","asset-link":"https://images.contentstack.com/v3/assets/blt77263d3e6b/blt73403ee7281/51807f919e0e4/11.jpg","asset-name":"11.jpg","asset-type":"image/jpeg","type":"asset","class-name":"embedded-asset","width":25.16914749661705,"className":"dsd","id":"sdf"},"children":[{"text":""}]}],"type":"doc"}'
41
+ EntryReferenceBlockJson = '{ "uid":"06e34a7 5e4 e549d ", "_version":1, "attrs":{ }, "children":[{"uid":"70f9b 325075d43 128c0d0 aa3eb7f291f","type":"reference","attrs":{"display-type":"block","entry-uid":"blttitleuid","content-type-uid":"content_block","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":""}]}],"type":"doc"}'
42
+ EntryReferenceLinkJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"7626ea98e0e95d602210","type":"reference","attrs":{"target":"_self","href":"/copy-of-entry-final-02","display-type":"link","entry-uid":"bltemmbedEntryuid","content-type-uid":"embeddedrte","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":"/copy-of-entry-final-02"}]}],"type":"doc"}'
43
+ EntryReferenceInlineJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"506 4878f3f46 s21f0cbc aff","type":"reference","attrs":{"display-type":"inline","entry-uid":"blttitleUpdateuid","content-type-uid":"embeddedrte","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":""}]}],"type":"doc"}'
44
+ HRJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"f5a7b57 40a8a5c3 576828276b","type":"hr","children":[{"text":""}],"attrs":{ }}],"type":"doc"}'
45
+ H1NonChildJson = '{ "uid":"06e34a7a449d7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h1","attrs":{ },"uid":"c2dfed70 4d7030c65e2e1"}],"type":"doc"}'
46
+
47
+ JSON_EMBEDDED_ITEMS_ENTRY= {
48
+ "title"=> 'one',
49
+ "url"=> '/one',
50
+ "locale"=> 'en-us',
51
+ "uid"=> 'blt88jn',
52
+ "created_by"=> 'bltcreate',
53
+ "updated_by"=> 'bltcreate',
54
+ "created_at"=> '2020-08-13T06:18:18.989Z',
55
+ "updated_at"=> '2020-08-31T06:06:31.258Z',
56
+ "markdown"=> '',
57
+ "_embedded_items"=> {
58
+ "rich_text_editor"=> [
59
+ {
60
+ "_content_type_uid"=> 'sys_assets',
61
+ "uid"=> 'blt44asset',
62
+ "created_at"=> '2020-08-19T09:13:32.785Z',
63
+ "updated_at"=> '2020-08-19T09:13:32.785Z',
64
+ "created_by"=> 'bltcreate',
65
+ "updated_by"=> 'bltcreate',
66
+ "content_type"=> 'application/pdf',
67
+ "file_size"=> '13264',
68
+ "filename"=> 'dummy.pdf',
69
+ "url"=> '/v3/assets/blt333/blt44asset/dummy.pdf',
70
+ "_version"=> 1,
71
+ "title"=> 'dummy.pdf'
72
+ },
73
+ {
74
+ "title"=> 'Update this title',
75
+ "url"=> '',
76
+ "locale"=> 'en-us',
77
+ "uid"=> 'blttitleuid',
78
+ "_content_type_uid"=> 'content_block',
79
+ "_version"=> 5,
80
+ "_in_progress"=> false,
81
+ "multi_line"=> '',
82
+ "_embedded_items"=> {
83
+ "rich_text_editor"=> [
84
+ {
85
+ "uid"=> 'blttitleuid',
86
+ "_content_type_uid"=> 'content_block'
87
+ }
88
+ ]
89
+ },
90
+ "rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="blttitleuid" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"></figure>',
91
+ },
92
+ {
93
+ "title"=> 'updated title',
94
+ "rich_text_editor"=> [
95
+ '<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/DIABETICDIET-800x600.jpg" data-sys-asset-uid="bltassetUID" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
96
+ ],
97
+ "locale"=> 'en-us',
98
+ "uid"=> 'blttitleUpdateuid',
99
+ "_content_type_uid"=> 'embeddedrte',
100
+ "_in_progress"=> false,
101
+ "_embedded_items"=> {
102
+ "rich_text_editor"=>[
103
+ {
104
+ "_content_type_uid"=> 'sys_assets',
105
+ "uid"=> 'bltassetUID',
106
+ "content_type"=> 'image/png',
107
+ "file_size"=> '36743',
108
+ "filename"=> 'svg-logo-text.png',
109
+ "url"=> '/v3/assets/blturl/bltassetEmbuid/svg-logo-text.png',
110
+ "title"=> 'svg-logo-text.png',
111
+ "description"=> ''
112
+ }
113
+ ]
114
+ }
115
+ },
116
+ {
117
+ "title"=> 'Entry with embedded entry',
118
+ "rich_text_editor"=> [
119
+ '<figure class="embedded-entry block-entry" data-sys-entry-uid="blt1234CtUID" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="blt1234CtUID" data-sys-content-type-uid="1234" sys-style-type="inline" type="entry"></figure>\n<p><br><br></p>\n<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/assets/blt/html5.png" data-sys-asset-uid="blt1234AssetUID" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
120
+ ],
121
+ "locale"=> 'en-us',
122
+ "uid"=> 'bltemmbedEntryuid',
123
+ "_content_type_uid"=> 'embeddedrte',
124
+ "_in_progress"=> false,
125
+ "_embedded_items"=> {
126
+ "rich_text_editor"=>[
127
+ {
128
+ "uid"=> 'blt1234CtUID',
129
+ "_content_type_uid"=> '1234'
130
+ },
131
+ {
132
+ "uid"=> 'blt1234CtUID',
133
+ "_content_type_uid"=> '1234'
134
+ },
135
+ {
136
+ "uid"=> 'blt1234AssetUID',
137
+ "_content_type_uid"=> 'sys_assets'
138
+ }
139
+ ]
140
+ },
141
+ }
142
+ ]
143
+ }
144
+ }
145
+
146
+ EmbedEdges = '{"edges":[{"node":{"system":{"content_type_uid":"sys_assets","uid":"blt9844"},"created_at":"2020-08-19T09:13:05.864Z","updated_at":"2020-09-10T09:35:28.393Z","created_by":"bltcreate","updated_by":"bltcreate","content_type":"image/png","file_size":"36743","filename":"svg-logo-text.png","url":"/v3/assets/svg-logo-text.png","_version":7,"title":"svg-logo-text.png","description":""}},{"node":{"system":{"content_type_uid":"sys_assets","uid":"blt44asset"},"created_at":"2020-08-19T09:13:32.785Z","updated_at":"2020-08-19T09:13:32.785Z","created_by":"bltcreate","updated_by":"bltcreate","content_type":"application/pdf","file_size":"13264","filename":"title","url":"/v3/assets/blt333/blt44asset/dummy.pdf","_version":1,"title":"dummy.pdf"}},{"node":{"title":"Update this title","url":"","locale":"en-us","system":{"uid":"blttitleuid","content_type_uid":"content_block"},"_version":5,"_in_progress":false,"multi_line":"","rich_text_editor":""}},{"node":{"title":"updated title","rich_text_editor":[""],"locale":"en-us","system":{"uid":"blttitleUpdateuid","content_type_uid":"embeddedrte"},"_in_progress":false}},{"node":{"title":"Entry with embedded entry","rich_text_editor":[""],"locale":"en-us","system":{"uid":"bltemmbedEntryuid","content_type_uid":"embeddedrte"},"_in_progress":false}},{"node":{"system":{"uid":"bltassetEmbuid","content_type_uid":"sys_assets"},"content_type":"image/png","file_size":"36743","filename":"svg-logo-text.png","url":"/v3/assets/blturl/bltassetEmbuid/svg-logo-text.png","title":"svg-logo-text.png","description":""}},{"node":{"title":"Update this title","url":"","locale":"en-us","system":{"uid":"blttitleuid","content_type_uid":"content_block"},"_version":5,"_in_progress":false,"multi_line":"","rich_text_editor":""}},{"node":{"title":"updated title","rich_text_editor":[""],"locale":"en-us","system":{"uid":"blttitleUpdateUID","content_type_uid":"embeddedrte"},"_in_progress":false}},{"node":{"title":"Entry with embedded entry","rich_text_editor":[""],"locale":"en-us","system":{"uid":"bltemmbedEntryUID","content_type_uid":"embeddedrte"},"_in_progress":false}}]}'
@@ -10,4 +10,22 @@ end
10
10
  def getHTML(xml)
11
11
  xml_doc = Nokogiri::XML(appendFrame(xml))
12
12
  xml_doc.xpath('//documentfragmentcontainer').inner_html
13
+ end
14
+
15
+ def getJson(text)
16
+ JSON.parse(text)
17
+ end
18
+
19
+ def getGQLJSONRTE(node, item = '""')
20
+ entry = "{
21
+ \"single_rte\": {
22
+ \"json\": #{node},
23
+ \"embedded_itemsConnection\": #{item}
24
+ },
25
+ \"multiple_rte\": {
26
+ \"json\": [#{node}],
27
+ \"embedded_itemsConnection\": #{item}
28
+ }
29
+ }"
30
+ getJson(entry)
13
31
  end
metadata CHANGED
@@ -1,43 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentstack_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.beta.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentstack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-02 00:00:00.000000000 Z
11
+ date: 2021-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.2'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: 6.1.0
22
+ version: '6.2'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: 6.1.0
29
+ version: '3.2'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6.2'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: nokogiri
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - "~>"
37
+ - - ">="
32
38
  - !ruby/object:Gem::Version
33
39
  version: 1.11.0
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '1.11'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - "~>"
47
+ - - ">="
39
48
  - !ruby/object:Gem::Version
40
49
  version: 1.11.0
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '1.11'
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: rake
43
55
  requirement: !ruby/object:Gem::Requirement
@@ -137,6 +149,7 @@ files:
137
149
  - spec/lib/utils_spec.rb
138
150
  - spec/mock/constant_render_options.rb
139
151
  - spec/mock/custom_render_option.rb
152
+ - spec/mock/json_to_html_mock.rb
140
153
  - spec/spec_helper.rb
141
154
  - spec/support/constant.rb
142
155
  - spec/support/xml_parse.rb
@@ -155,9 +168,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
168
  version: '2.0'
156
169
  required_rubygems_version: !ruby/object:Gem::Requirement
157
170
  requirements:
158
- - - ">"
171
+ - - ">="
159
172
  - !ruby/object:Gem::Version
160
- version: 1.3.1
173
+ version: '0'
161
174
  requirements: []
162
175
  rubygems_version: 3.0.3
163
176
  signing_key:
@@ -169,6 +182,7 @@ test_files:
169
182
  - spec/lib/utils_spec.rb
170
183
  - spec/mock/constant_render_options.rb
171
184
  - spec/mock/custom_render_option.rb
185
+ - spec/mock/json_to_html_mock.rb
172
186
  - spec/spec_helper.rb
173
187
  - spec/support/constant.rb
174
188
  - spec/support/xml_parse.rb