contentstack_utils 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/CODEOWNERS +1 -0
- data/Gemfile.lock +13 -13
- data/LICENSE +1 -1
- data/SECURITY.md +27 -0
- data/lib/contentstack_utils/model/options.rb +3 -3
- data/lib/contentstack_utils/version.rb +1 -1
- data/spec/lib/model/metadata_spec.rb +4 -4
- data/spec/lib/model/option_spec.rb +7 -0
- data/spec/mock/json_to_html_mock.rb +28 -27
- data/spec/spec_helper.rb +1 -2
- data/spec/support/constant.rb +116 -116
- metadata +14 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45608729d00c39aa34058014c55b5704af78a59d1296b3c2edfe28469d85787d
|
4
|
+
data.tar.gz: 5fefcde66ac69b48c7185dd9625dcf71b7b4fbd9921578ba6cf728f28d5ca938
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10901b878dd07194d11ff7c712c47c4ccd3dfe5d549f988d69bb30298d917f18bd1f8f93638f0b527fb60d5bc236d37f992224570b9ac70ae8a97aaaf32350c4
|
7
|
+
data.tar.gz: 6488de4c8ed0da29acc7fc1c2396dc6f645608a6cca60dc60973719baa5fc0cdb50ca8efc1395de8c1aa58edead695c4f4cbeca8c35cf8538b39a365439a297c
|
data/.gitignore
CHANGED
data/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @contentstack/security-admin @contentstack/sdk-admin
|
data/Gemfile.lock
CHANGED
@@ -1,36 +1,36 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
contentstack_utils (1.0
|
4
|
+
contentstack_utils (1.1.0)
|
5
5
|
activesupport (>= 3.2, < 6.2)
|
6
|
-
nokogiri (~> 1.11.0)
|
6
|
+
nokogiri (~> 1.11, >= 1.11.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (6.1.
|
11
|
+
activesupport (6.1.5)
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
13
|
i18n (>= 1.6, < 2)
|
14
14
|
minitest (>= 5.1)
|
15
15
|
tzinfo (~> 2.0)
|
16
16
|
zeitwerk (~> 2.3)
|
17
|
-
addressable (2.
|
17
|
+
addressable (2.8.0)
|
18
18
|
public_suffix (>= 2.0.2, < 5.0)
|
19
|
-
concurrent-ruby (1.1.
|
19
|
+
concurrent-ruby (1.1.10)
|
20
20
|
crack (0.4.5)
|
21
21
|
rexml
|
22
22
|
diff-lcs (1.4.4)
|
23
23
|
docile (1.4.0)
|
24
24
|
hashdiff (1.0.1)
|
25
|
-
i18n (1.
|
25
|
+
i18n (1.10.0)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
|
-
mini_portile2 (2.
|
28
|
-
minitest (5.
|
29
|
-
nokogiri (1.
|
30
|
-
mini_portile2 (~> 2.
|
27
|
+
mini_portile2 (2.8.0)
|
28
|
+
minitest (5.15.0)
|
29
|
+
nokogiri (1.13.4)
|
30
|
+
mini_portile2 (~> 2.8.0)
|
31
31
|
racc (~> 1.4)
|
32
|
-
public_suffix (4.0.
|
33
|
-
racc (1.
|
32
|
+
public_suffix (4.0.7)
|
33
|
+
racc (1.6.0)
|
34
34
|
rake (13.0.3)
|
35
35
|
rexml (3.2.5)
|
36
36
|
rspec (3.10.0)
|
@@ -59,7 +59,7 @@ GEM
|
|
59
59
|
crack (>= 0.3.2)
|
60
60
|
hashdiff (>= 0.4.0, < 2.0.0)
|
61
61
|
yard (0.9.26)
|
62
|
-
zeitwerk (2.4
|
62
|
+
zeitwerk (2.5.4)
|
63
63
|
|
64
64
|
PLATFORMS
|
65
65
|
ruby
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2012-
|
3
|
+
Copyright (c) 2012-2022 Contentstack. All Rights Reserved
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/SECURITY.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
## Security
|
2
|
+
|
3
|
+
Contentstack takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.
|
4
|
+
|
5
|
+
If you believe you have found a security vulnerability in any Contentstack-owned repository, please report it to us as described below.
|
6
|
+
|
7
|
+
## Reporting Security Issues
|
8
|
+
|
9
|
+
**Please do not report security vulnerabilities through public GitHub issues.**
|
10
|
+
|
11
|
+
Send email to [security@contentstack.com](mailto:security@contentstack.com).
|
12
|
+
|
13
|
+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
|
14
|
+
|
15
|
+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
16
|
+
|
17
|
+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
18
|
+
* Full paths of source file(s) related to the manifestation of the issue
|
19
|
+
* The location of the affected source code (tag/branch/commit or direct URL)
|
20
|
+
* Any special configuration required to reproduce the issue
|
21
|
+
* Step-by-step instructions to reproduce the issue
|
22
|
+
* Proof-of-concept or exploit code (if possible)
|
23
|
+
* Impact of the issue, including how an attacker might exploit the issue
|
24
|
+
|
25
|
+
This information will help us triage your report more quickly.
|
26
|
+
|
27
|
+
[https://www.contentstack.com/trust/](https://www.contentstack.com/trust/)
|
@@ -60,11 +60,11 @@ module ContentstackUtils
|
|
60
60
|
when 'p'
|
61
61
|
renderString = "<p>#{inner_html}</p>"
|
62
62
|
when 'a'
|
63
|
-
renderString = "<a href='#{node["attrs"]["href"] || ""}'>#{inner_html}</a>"
|
63
|
+
renderString = "<a href='#{node["attrs"]["href"] || node["attrs"]["url"] || ""}'>#{inner_html}</a>"
|
64
64
|
when 'img'
|
65
|
-
renderString = "<img src='#{node["attrs"]["src"] || ""}' />#{inner_html}"
|
65
|
+
renderString = "<img src='#{node["attrs"]["src"] || node["attrs"]["url"] || ""}' />#{inner_html}"
|
66
66
|
when 'embed'
|
67
|
-
renderString = "<iframe src='#{node["attrs"]["src"] || ""}'></iframe>"
|
67
|
+
renderString = "<iframe src='#{node["attrs"]["src"] || node["attrs"]["url"] || ""}'></iframe>"
|
68
68
|
when 'h1'
|
69
69
|
renderString = "<h1>#{inner_html}</h1>"
|
70
70
|
when 'h2'
|
@@ -57,7 +57,7 @@ RSpec.describe ContentstackUtils::Model::Metadata do
|
|
57
57
|
metadata = ContentstackUtils::Model::Metadata.new(doc["children"][0])
|
58
58
|
expect(metadata.item_type).to eq "asset"
|
59
59
|
expect(metadata.style_type).to eq "display"
|
60
|
-
expect(metadata.item_uid).to eq "
|
60
|
+
expect(metadata.item_uid).to eq "asset_uid_1"
|
61
61
|
expect(metadata.content_type_uid).to eq 'sys_assets'
|
62
62
|
expect(metadata.text).to eq ''
|
63
63
|
end
|
@@ -67,7 +67,7 @@ RSpec.describe ContentstackUtils::Model::Metadata do
|
|
67
67
|
metadata = ContentstackUtils::Model::Metadata.new(doc["children"][0])
|
68
68
|
expect(metadata.item_type).to eq "entry"
|
69
69
|
expect(metadata.style_type).to eq "block"
|
70
|
-
expect(metadata.item_uid).to eq "
|
70
|
+
expect(metadata.item_uid).to eq "entry_uid_1"
|
71
71
|
expect(metadata.content_type_uid).to eq 'content_block'
|
72
72
|
expect(metadata.text).to eq ''
|
73
73
|
end
|
@@ -77,7 +77,7 @@ RSpec.describe ContentstackUtils::Model::Metadata do
|
|
77
77
|
metadata = ContentstackUtils::Model::Metadata.new(doc["children"][0])
|
78
78
|
expect(metadata.item_type).to eq "entry"
|
79
79
|
expect(metadata.style_type).to eq "link"
|
80
|
-
expect(metadata.item_uid).to eq "
|
80
|
+
expect(metadata.item_uid).to eq "entry_uid_2"
|
81
81
|
expect(metadata.content_type_uid).to eq 'embeddedrte'
|
82
82
|
expect(metadata.text).to eq "/copy-of-entry-final-02"
|
83
83
|
end
|
@@ -87,7 +87,7 @@ RSpec.describe ContentstackUtils::Model::Metadata do
|
|
87
87
|
metadata = ContentstackUtils::Model::Metadata.new(doc["children"][0])
|
88
88
|
expect(metadata.item_type).to eq "entry"
|
89
89
|
expect(metadata.style_type).to eq "inline"
|
90
|
-
expect(metadata.item_uid).to eq "
|
90
|
+
expect(metadata.item_uid).to eq "entry_uid_3"
|
91
91
|
expect(metadata.content_type_uid).to eq 'embeddedrte'
|
92
92
|
expect(metadata.text).to eq ''
|
93
93
|
end
|
@@ -144,6 +144,13 @@ RSpec.describe ContentstackUtils::Model::Options do
|
|
144
144
|
expect(result).to eq "<img src='#{doc["attrs"]["src"]}' />#{linkText}"
|
145
145
|
end
|
146
146
|
|
147
|
+
it 'Should return link string for link node type' do
|
148
|
+
doc = getJson(ImgJsonURL)["children"][0]
|
149
|
+
|
150
|
+
result = subject.render_node('img', doc, linkText)
|
151
|
+
expect(result).to eq "<img src='#{doc["attrs"]["url"]}' />#{linkText}"
|
152
|
+
end
|
153
|
+
|
147
154
|
it 'Should return embed string with blank src for embed node type' do
|
148
155
|
doc = getJson(BlankDocument)
|
149
156
|
|
@@ -9,13 +9,13 @@ H5Html = "<h5>Mauris venenatis dui id massa sollicitudin, non bibendum nunc dict
|
|
9
9
|
H6Html = "<h6>Nunc porta diam vitae purus semper, ut consequat lorem vehicula.</h6>"
|
10
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
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/
|
12
|
+
ImgHtml = "<img src='https://images.contentstack.com/v3/Donald.jog.png' />"
|
13
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
14
|
BlockquoteHtml = "<blockquote>Praesent eu ex sed nibh venenatis pretium.</blockquote>"
|
15
15
|
CodeHtml = "<code>Code template.</code>"
|
16
16
|
LinkInPHtml = "<p><strong><em><u><sub></sub></u></em></strong><a href='LINK.com'>LINK</a></p>"
|
17
17
|
EmbedHtml = "<iframe src='https://www.youtube.com/watch?v=AOP0yARiW8U'></iframe>"
|
18
|
-
AssetReferenceHtml = "<img src='/v3/
|
18
|
+
AssetReferenceHtml = "<img src='/v3/dummy.pdf' alt='dummy.pdf' />"
|
19
19
|
EntryReferenceBlockHtml = "<div><p>Update this title</p><p>Content type: <span>content_block</span></p></div>"
|
20
20
|
EntryReferenceLinkHtml = "<a href='/copy-of-entry-final-02'>/copy-of-entry-final-02</a>"
|
21
21
|
EntryReferenceInlineHtml = "<span>updated title</span>"
|
@@ -30,17 +30,18 @@ H5Json = '{ "uid": "06e381190849dacd", "_version": 13, "attrs": { }, "children":
|
|
30
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
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
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/
|
33
|
+
ImgJson = '{ "uid":"06e34a7a4849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"f3be74be3b64646e626","type":"img","attrs":{"src":"https://images.contentstack.com/v3/Donald.jog.png","width":33.69418132611637,"height":"auto","redactor-attributes":{"asset_uid":"47f1aa5ae422cd1"}},"children":[{"text":""}]}],"type":"doc"}'
|
34
|
+
ImgJsonURL = '{ "uid":"06e34a7a4849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"f3be74be3b64646e626","type":"img","attrs":{"url":"https://images.contentstack.com/v3/Donald.jog.png","width":33.69418132611637,"height":"auto","redactor-attributes":{"asset_uid":"47f1aa5ae422cd1"}},"children":[{"text":""}]}],"type":"doc"}'
|
34
35
|
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
36
|
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
37
|
CodeJson = '{ "uid":"06ea490849d7fc2acd", "_version":13, "attrs":{ }, "children":[{"uid":"83fba92c91b30002b","type":"code","attrs":{},"children":[{"text":"Code template."}]}],"type":"doc"}'
|
37
38
|
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
39
|
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
40
|
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":"
|
41
|
-
EntryReferenceBlockJson = '{ "uid":"06e34a7 5e4 e549d ", "_version":1, "attrs":{ }, "children":[{"uid":"70f9b 325075d43 128c0d0 aa3eb7f291f","type":"reference","attrs":{"display-type":"block","entry-uid":"
|
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":"
|
43
|
-
EntryReferenceInlineJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"506 4878f3f46 s21f0cbc aff","type":"reference","attrs":{"display-type":"inline","entry-uid":"
|
41
|
+
AssetReferenceJson = '{"uid":"06e34a7 5e4 e549d ", "_version":1, "attrs":{}, "children":[{ "uid": "4f7e33 3390a955 de10c1 c836", "type":"reference","attrs":{"display-type":"display","asset-uid":"asset_uid_1","content-type-uid":"sys_assets","asset-link":"https://images.contentstack.com/v3/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"}'
|
42
|
+
EntryReferenceBlockJson = '{ "uid":"06e34a7 5e4 e549d ", "_version":1, "attrs":{ }, "children":[{"uid":"70f9b 325075d43 128c0d0 aa3eb7f291f","type":"reference","attrs":{"display-type":"block","entry-uid":"entry_uid_1","content-type-uid":"content_block","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":""}]}],"type":"doc"}'
|
43
|
+
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":"entry_uid_2","content-type-uid":"embeddedrte","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":"/copy-of-entry-final-02"}]}],"type":"doc"}'
|
44
|
+
EntryReferenceInlineJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"506 4878f3f46 s21f0cbc aff","type":"reference","attrs":{"display-type":"inline","entry-uid":"entry_uid_3","content-type-uid":"embeddedrte","locale":"en-us","type":"entry","class-name":"embedded-entry"},"children":[{"text":""}]}],"type":"doc"}'
|
44
45
|
HRJson = '{ "uid":"06e34a7 5e4 e549d", "_version":1, "attrs":{ }, "children":[{"uid":"f5a7b57 40a8a5c3 576828276b","type":"hr","children":[{"text":""}],"attrs":{ }}],"type":"doc"}'
|
45
46
|
H1NonChildJson = '{ "uid":"06e34a7a449d7fc2acd","_version":13,"attrs":{ },"children":[{ "type":"h1","attrs":{ },"uid":"c2dfed70 4d7030c65e2e1"}],"type":"doc"}'
|
46
47
|
|
@@ -48,9 +49,9 @@ JSON_EMBEDDED_ITEMS_ENTRY= {
|
|
48
49
|
"title"=> 'one',
|
49
50
|
"url"=> '/one',
|
50
51
|
"locale"=> 'en-us',
|
51
|
-
"uid"=> '
|
52
|
-
"created_by"=> '
|
53
|
-
"updated_by"=> '
|
52
|
+
"uid"=> 'entry_uid_4',
|
53
|
+
"created_by"=> 'created_at_date',
|
54
|
+
"updated_by"=> 'created_at_date',
|
54
55
|
"created_at"=> '2020-08-13T06:18:18.989Z',
|
55
56
|
"updated_at"=> '2020-08-31T06:06:31.258Z',
|
56
57
|
"markdown"=> '',
|
@@ -58,15 +59,15 @@ JSON_EMBEDDED_ITEMS_ENTRY= {
|
|
58
59
|
"rich_text_editor"=> [
|
59
60
|
{
|
60
61
|
"_content_type_uid"=> 'sys_assets',
|
61
|
-
"uid"=> '
|
62
|
+
"uid"=> 'asset_uid_1',
|
62
63
|
"created_at"=> '2020-08-19T09:13:32.785Z',
|
63
64
|
"updated_at"=> '2020-08-19T09:13:32.785Z',
|
64
|
-
"created_by"=> '
|
65
|
-
"updated_by"=> '
|
65
|
+
"created_by"=> 'created_at_date',
|
66
|
+
"updated_by"=> 'created_at_date',
|
66
67
|
"content_type"=> 'application/pdf',
|
67
68
|
"file_size"=> '13264',
|
68
69
|
"filename"=> 'dummy.pdf',
|
69
|
-
"url"=> '/v3/
|
70
|
+
"url"=> '/v3/dummy.pdf',
|
70
71
|
"_version"=> 1,
|
71
72
|
"title"=> 'dummy.pdf'
|
72
73
|
},
|
@@ -74,7 +75,7 @@ JSON_EMBEDDED_ITEMS_ENTRY= {
|
|
74
75
|
"title"=> 'Update this title',
|
75
76
|
"url"=> '',
|
76
77
|
"locale"=> 'en-us',
|
77
|
-
"uid"=> '
|
78
|
+
"uid"=> 'entry_uid_1',
|
78
79
|
"_content_type_uid"=> 'content_block',
|
79
80
|
"_version"=> 5,
|
80
81
|
"_in_progress"=> false,
|
@@ -82,31 +83,31 @@ JSON_EMBEDDED_ITEMS_ENTRY= {
|
|
82
83
|
"_embedded_items"=> {
|
83
84
|
"rich_text_editor"=> [
|
84
85
|
{
|
85
|
-
"uid"=> '
|
86
|
+
"uid"=> 'entry_uid_1',
|
86
87
|
"_content_type_uid"=> 'content_block'
|
87
88
|
}
|
88
89
|
]
|
89
90
|
},
|
90
|
-
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="
|
91
|
+
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"></figure>',
|
91
92
|
},
|
92
93
|
{
|
93
94
|
"title"=> 'updated title',
|
94
95
|
"rich_text_editor"=> [
|
95
|
-
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/DIABETICDIET-800x600.jpg" data-sys-asset-uid="
|
96
|
+
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/DIABETICDIET-800x600.jpg" data-sys-asset-uid="asset_uid_2" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
|
96
97
|
],
|
97
98
|
"locale"=> 'en-us',
|
98
|
-
"uid"=> '
|
99
|
+
"uid"=> 'entry_uid_3',
|
99
100
|
"_content_type_uid"=> 'embeddedrte',
|
100
101
|
"_in_progress"=> false,
|
101
102
|
"_embedded_items"=> {
|
102
103
|
"rich_text_editor"=>[
|
103
104
|
{
|
104
105
|
"_content_type_uid"=> 'sys_assets',
|
105
|
-
"uid"=> '
|
106
|
+
"uid"=> 'asset_uid_2',
|
106
107
|
"content_type"=> 'image/png',
|
107
108
|
"file_size"=> '36743',
|
108
109
|
"filename"=> 'svg-logo-text.png',
|
109
|
-
"url"=> '/v3/
|
110
|
+
"url"=> '/v3/svg-logo-text.png',
|
110
111
|
"title"=> 'svg-logo-text.png',
|
111
112
|
"description"=> ''
|
112
113
|
}
|
@@ -116,24 +117,24 @@ JSON_EMBEDDED_ITEMS_ENTRY= {
|
|
116
117
|
{
|
117
118
|
"title"=> 'Entry with embedded entry',
|
118
119
|
"rich_text_editor"=> [
|
119
|
-
'<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
120
|
+
'<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_4" 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/html5.png" data-sys-asset-uid="asset_uid_3" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
|
120
121
|
],
|
121
122
|
"locale"=> 'en-us',
|
122
|
-
"uid"=> '
|
123
|
+
"uid"=> 'entry_uid_2',
|
123
124
|
"_content_type_uid"=> 'embeddedrte',
|
124
125
|
"_in_progress"=> false,
|
125
126
|
"_embedded_items"=> {
|
126
127
|
"rich_text_editor"=>[
|
127
128
|
{
|
128
|
-
"uid"=> '
|
129
|
+
"uid"=> 'entry_uid_4',
|
129
130
|
"_content_type_uid"=> '1234'
|
130
131
|
},
|
131
132
|
{
|
132
|
-
"uid"=> '
|
133
|
+
"uid"=> 'entry_uid_4',
|
133
134
|
"_content_type_uid"=> '1234'
|
134
135
|
},
|
135
136
|
{
|
136
|
-
"uid"=> '
|
137
|
+
"uid"=> 'asset_uid_3',
|
137
138
|
"_content_type_uid"=> 'sys_assets'
|
138
139
|
}
|
139
140
|
]
|
@@ -143,4 +144,4 @@ JSON_EMBEDDED_ITEMS_ENTRY= {
|
|
143
144
|
}
|
144
145
|
}
|
145
146
|
|
146
|
-
EmbedEdges = '{"edges":[{"node":{"system":{"content_type_uid":"sys_assets","uid":"
|
147
|
+
EmbedEdges = '{"edges":[{"node":{"system":{"content_type_uid":"sys_assets","uid":"entry_uid_5"},"created_at":"2020-08-19T09:13:05.864Z","updated_at":"2020-09-10T09:35:28.393Z","created_by":"created_at_date","updated_by":"created_at_date","content_type":"image/png","file_size":"36743","filename":"svg-logo-text.png","url":"/v3/svg-logo-text.png","_version":7,"title":"svg-logo-text.png","description":""}},{"node":{"system":{"content_type_uid":"sys_assets","uid":"asset_uid_1"},"created_at":"2020-08-19T09:13:32.785Z","updated_at":"2020-08-19T09:13:32.785Z","created_by":"created_at_date","updated_by":"created_at_date","content_type":"application/pdf","file_size":"13264","filename":"title","url":"/v3/dummy.pdf","_version":1,"title":"dummy.pdf"}},{"node":{"title":"Update this title","url":"","locale":"en-us","system":{"uid":"entry_uid_1","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":"entry_uid_3","content_type_uid":"embeddedrte"},"_in_progress":false}},{"node":{"title":"Entry with embedded entry","rich_text_editor":[""],"locale":"en-us","system":{"uid":"entry_uid_2","content_type_uid":"embeddedrte"},"_in_progress":false}},{"node":{"system":{"uid":"entry_uid_6","content_type_uid":"sys_assets"},"content_type":"image/png","file_size":"36743","filename":"svg-logo-text.png","url":"/v3/svg-logo-text.png","title":"svg-logo-text.png","description":""}},{"node":{"title":"Update this title","url":"","locale":"en-us","system":{"uid":"entry_uid_1","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":"entry_uid_3","content_type_uid":"embeddedrte"},"_in_progress":false}},{"node":{"title":"Entry with embedded entry","rich_text_editor":[""],"locale":"en-us","system":{"uid":"entry_uid_2","content_type_uid":"embeddedrte"},"_in_progress":false}}]}'
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
require 'simplecov'
|
2
|
-
SimpleCov.start unless RUBY_PLATFORM == 'java'
|
3
2
|
SimpleCov.add_filter ["spec/", "lib/contentstack_utils/support"]
|
4
3
|
require 'nokogiri'
|
5
4
|
require 'rspec'
|
6
5
|
require 'contentstack_utils'
|
7
|
-
|
6
|
+
require_relative './mock/custom_render_option'
|
8
7
|
Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }
|
9
8
|
Dir[File.dirname(__FILE__) + '/mock/**/*.rb'].each { |f| require f }
|
data/spec/support/constant.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
NO_HTML = 'non html string'
|
2
2
|
SIMPLE_HTML = '<h1>Hello</h1> World'
|
3
3
|
|
4
|
-
ENTRY_BLOCK = '<figure class="embedded-entry block-entry" data-redactor-type="embed" type="entry" data-sys-entry-uid="
|
5
|
-
ENTRY_INLINE = '<figure class="embedded-entry inline-entry" data-redactor-type="embed" type="entry" data-sys-entry-uid="
|
4
|
+
ENTRY_BLOCK = '<figure class="embedded-entry block-entry" data-redactor-type="embed" type="entry" data-sys-entry-uid="entry_uid_7" data-sys-entry-locale="en-us" data-sys-content-type-uid="article" sys-style-type="block">{{title}}</figure>'
|
5
|
+
ENTRY_INLINE = '<figure class="embedded-entry inline-entry" data-redactor-type="embed" type="entry" data-sys-entry-uid="entry_uid_7" data-sys-entry-locale="en-us" data-sys-content-type-uid="article" style="display:inline;" sys-style-type="inline">{{title}}
|
6
6
|
</figure>'
|
7
|
-
ENTRY_LINK ='<figure class="embedded-entry link-entry" type="entry" data-sys-entry-locale="en-us" data-sys-entry-uid="
|
7
|
+
ENTRY_LINK ='<figure class="embedded-entry link-entry" type="entry" data-sys-entry-locale="en-us" data-sys-entry-uid="entry_uid_7" href="/this-is-unique-title" data-sys-content-type-uid="article" style="display:inline;" sys-style-type="link">{{title}}
|
8
8
|
</figure>'
|
9
9
|
|
10
|
-
ASSET_DISPLAY = '<figure class="embedded-asset" alt="{{object.title}}" data-redactor-type="embed" data-sys-asset-filelink="{{url}}" data-sys-asset-filename="Cuvier-67_Autruche_d_Afrique.jpg" data-sys-asset-contenttype="image/png" type="asset" data-sys-asset-uid="
|
10
|
+
ASSET_DISPLAY = '<figure class="embedded-asset" alt="{{object.title}}" data-redactor-type="embed" data-sys-asset-filelink="{{url}}" data-sys-asset-filename="Cuvier-67_Autruche_d_Afrique.jpg" data-sys-asset-contenttype="image/png" type="asset" data-sys-asset-uid="entry_uid_7" style="display:inline;" sys-style-type="display">
|
11
11
|
</figure>'
|
12
|
-
ASSET_DOWNLOAD = '<figure class="embedded-asset" data-redactor-type="embed" data-sys-asset-filelink="{{url}}" data-sys-asset-uid="
|
12
|
+
ASSET_DOWNLOAD = '<figure class="embedded-asset" data-redactor-type="embed" data-sys-asset-filelink="{{url}}" data-sys-asset-uid="entry_uid_8" data-sys-asset-filename="iphone-mockup.png" data-sys-asset-contenttype="image/png" data-sys-asset-alt="iphone-mockup.png" data-sys-asset-caption="Caption" data-sys-asset-link="{{link}}" data-sys-asset-position="center" data-sys-asset-isnewtab="true" type="asset" sys-style-type="download"></figure>'
|
13
13
|
|
14
14
|
ENTRY_CONTENT_BLANK = {
|
15
15
|
"uid"=> "uid",
|
@@ -45,11 +45,11 @@ ENTRY_CONTENT_TITLE_URL = {
|
|
45
45
|
ENTRY_EMBEDDED_ASSET = {
|
46
46
|
"title"=> 'one',
|
47
47
|
"url"=> '/one',
|
48
|
-
"rich_text_editor"=> '<p></p><figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.asset/v3/
|
48
|
+
"rich_text_editor"=> '<p></p><figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.asset/v3/dummy.pdf" data-sys-asset-uid="asset_uid_1" data-sys-asset-filename="dummy.pdf" data-sys-asset-contenttype="application/pdf" type="asset" sys-style-type="display"></figure>\n<img data-image="236uaymkloww" src="https://contentstack.image/v3/html5.png" data-sys-asset-uid="entry_uid_9" alt="html5.png">\n<p></p>\n<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/svg-logo-text.png" data-sys-asset-uid="entry_uid_5" data-sys-asset-filename="svg-logo-text.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>',
|
49
49
|
"locale"=> 'en-us',
|
50
|
-
"uid"=> '
|
51
|
-
"created_by"=> '
|
52
|
-
"updated_by"=> '
|
50
|
+
"uid"=> 'entry_uid_4',
|
51
|
+
"created_by"=> 'created_at_date',
|
52
|
+
"updated_by"=> 'created_at_date',
|
53
53
|
"created_at"=> '2020-08-13T06:18:18.989Z',
|
54
54
|
"updated_at"=> '2020-08-31T06:06:31.258Z',
|
55
55
|
"markdown"=> '',
|
@@ -57,29 +57,29 @@ ENTRY_EMBEDDED_ASSET = {
|
|
57
57
|
"rich_text_editor"=> [
|
58
58
|
{
|
59
59
|
"_content_type_uid"=> 'sys_assets',
|
60
|
-
"uid"=> '
|
60
|
+
"uid"=> 'asset_uid_1',
|
61
61
|
"created_at"=> '2020-08-19T09:13:32.785Z',
|
62
62
|
"updated_at"=> '2020-08-19T09:13:32.785Z',
|
63
|
-
"created_by"=> '
|
64
|
-
"updated_by"=> '
|
63
|
+
"created_by"=> 'created_at_date',
|
64
|
+
"updated_by"=> 'created_at_date',
|
65
65
|
"content_type"=> 'application/pdf',
|
66
66
|
"file_size"=> '13264',
|
67
67
|
"filename"=> 'dummy.pdf',
|
68
|
-
"url"=> '/v3/
|
68
|
+
"url"=> '/v3/dummy.pdf',
|
69
69
|
"_version"=> 1,
|
70
70
|
"title"=> 'dummy.pdf'
|
71
71
|
},
|
72
72
|
{
|
73
73
|
"_content_type_uid"=> 'sys_assets',
|
74
|
-
"uid"=> '
|
74
|
+
"uid"=> 'entry_uid_5',
|
75
75
|
"created_at"=> '2020-08-19T09:13:05.864Z',
|
76
76
|
"updated_at"=> '2020-09-10T09:35:28.393Z',
|
77
|
-
"created_by"=> '
|
78
|
-
"updated_by"=> '
|
77
|
+
"created_by"=> 'created_at_date',
|
78
|
+
"updated_by"=> 'created_at_date',
|
79
79
|
"content_type"=> 'image/png',
|
80
80
|
"file_size"=> '36743',
|
81
81
|
"filename"=> 'svg-logo-text.png',
|
82
|
-
"url"=> '/v3/
|
82
|
+
"url"=> '/v3/svg-logo-text.png',
|
83
83
|
"_version"=> 7,
|
84
84
|
"title"=> 'svg-logo-text.png',
|
85
85
|
"description"=> '',
|
@@ -91,11 +91,11 @@ ENTRY_EMBEDDED_ASSET = {
|
|
91
91
|
ENTRY_ASSET_EMBED_BLANK = {
|
92
92
|
"title"=> 'one',
|
93
93
|
"url"=> '/one',
|
94
|
-
"rich_text_editor"=> '<p> </p><figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.asset/v3/
|
94
|
+
"rich_text_editor"=> '<p> </p><figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.asset/v3/dummy.pdf" data-sys-asset-uid="asset_uid_1" data-sys-asset-filename="dummy.pdf" data-sys-asset-contenttype="application/pdf" type="asset" sys-style-type="display"></figure>\n<img data-image="236uaymkloww" src="https://contentstack.image/v3/html5.png" data-sys-asset-uid="entry_uid_9" alt="html5.png">\n<p></p>\n<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/svg-logo-text.png" data-sys-asset-uid="entry_uid_5" data-sys-asset-filename="svg-logo-text.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>',
|
95
95
|
"locale"=> 'en-us',
|
96
|
-
"uid"=> '
|
97
|
-
"created_by"=> '
|
98
|
-
"updated_by"=> '
|
96
|
+
"uid"=> 'entry_uid_4',
|
97
|
+
"created_by"=> 'created_at_date',
|
98
|
+
"updated_by"=> 'created_at_date',
|
99
99
|
"created_at"=> '2020-08-13T06:18:18.989Z',
|
100
100
|
"updated_at"=> '2020-08-31T06:06:31.258Z',
|
101
101
|
"markdown"=> '',
|
@@ -104,18 +104,18 @@ ENTRY_ASSET_EMBED_BLANK = {
|
|
104
104
|
ENTRY_EMBEDDED_ENTRIES = {
|
105
105
|
"title"=> 'entry and assets',
|
106
106
|
"url"=> '/entry-and-assets',
|
107
|
-
"rich_text_editor"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
107
|
+
"rich_text_editor"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_3" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="embeddedrte" sys-style-type="block" type="entry"></figure>\n<p></p>\n<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/html5.png" data-sys-asset-uid="entry_uid_6" data-sys-asset-filename="svg-logo-text.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>',
|
108
108
|
"locale"=> 'en-us',
|
109
109
|
"_in_progress"=> false,
|
110
|
-
"uid"=> '
|
111
|
-
"rte"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
110
|
+
"uid"=> 'entry_uid_4',
|
111
|
+
"rte"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_2" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="embeddedrte" sys-style-type="inline" type="entry"></figure>\n<p></p>',
|
112
112
|
"_embedded_items"=> {
|
113
113
|
"rich_text_editor"=> [
|
114
114
|
{
|
115
115
|
"title"=> 'Update this title',
|
116
116
|
"url"=> '',
|
117
117
|
"locale"=> 'en-us',
|
118
|
-
"uid"=> '
|
118
|
+
"uid"=> 'entry_uid_1',
|
119
119
|
"_content_type_uid"=> 'content_block',
|
120
120
|
"_version"=> 5,
|
121
121
|
"_in_progress"=> false,
|
@@ -123,26 +123,26 @@ ENTRY_EMBEDDED_ENTRIES = {
|
|
123
123
|
"_embedded_items"=> {
|
124
124
|
"rich_text_editor"=> [
|
125
125
|
{
|
126
|
-
"uid"=> '
|
126
|
+
"uid"=> 'entry_uid_1',
|
127
127
|
"_content_type_uid"=> 'content_block'
|
128
128
|
}
|
129
129
|
]
|
130
130
|
},
|
131
|
-
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="
|
131
|
+
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"> asfsaf </figure>',
|
132
132
|
},
|
133
133
|
{
|
134
134
|
"title"=> 'updated title',
|
135
135
|
"rich_text_editor"=> [
|
136
|
-
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/
|
136
|
+
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/DIABETICDIET-800x600.jpg" data-sys-asset-uid="asset_uid_2" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
|
137
137
|
],
|
138
138
|
"locale"=> 'en-us',
|
139
|
-
"uid"=> '
|
139
|
+
"uid"=> 'entry_uid_3',
|
140
140
|
"_content_type_uid"=> 'embeddedrte',
|
141
141
|
"_in_progress"=> false,
|
142
142
|
"_embedded_items"=> {
|
143
143
|
"rich_text_editor"=> [
|
144
144
|
{
|
145
|
-
"uid"=> '
|
145
|
+
"uid"=> 'asset_uid_2',
|
146
146
|
"_content_type_uid"=> 'sys_assets',
|
147
147
|
}
|
148
148
|
]
|
@@ -151,48 +151,48 @@ ENTRY_EMBEDDED_ENTRIES = {
|
|
151
151
|
{
|
152
152
|
"title"=> 'Entry with embedded entry',
|
153
153
|
"rich_text_editor"=> [
|
154
|
-
'<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
154
|
+
'<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_4" 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/html5.png" data-sys-asset-uid="asset_uid_3" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
|
155
155
|
],
|
156
156
|
"locale"=> 'en-us',
|
157
|
-
"uid"=> '
|
157
|
+
"uid"=> 'entry_uid_2',
|
158
158
|
"_content_type_uid"=> 'embeddedrte',
|
159
159
|
"_in_progress"=> false,
|
160
160
|
"_embedded_items"=> {
|
161
161
|
"rich_text_editor"=> [
|
162
162
|
{
|
163
|
-
"uid"=> '
|
163
|
+
"uid"=> 'entry_uid_4',
|
164
164
|
"_content_type_uid"=> '1234'
|
165
165
|
},
|
166
166
|
{
|
167
|
-
"uid"=> '
|
167
|
+
"uid"=> 'entry_uid_4',
|
168
168
|
"_content_type_uid"=> '1234'
|
169
169
|
},
|
170
170
|
{
|
171
|
-
"uid"=> '
|
171
|
+
"uid"=> 'asset_uid_3',
|
172
172
|
"_content_type_uid"=> 'sys_assets'
|
173
173
|
}
|
174
174
|
]
|
175
175
|
}
|
176
176
|
},
|
177
177
|
{
|
178
|
-
"uid"=> '
|
178
|
+
"uid"=> 'entry_uid_6',
|
179
179
|
"_content_type_uid"=> 'sys_assets',
|
180
180
|
"content_type"=> 'image/png',
|
181
181
|
"file_size"=> '36743',
|
182
182
|
"filename"=> 'svg-logo-text.png',
|
183
|
-
"url"=> '/v3/
|
183
|
+
"url"=> '/v3/svg-logo-text.png',
|
184
184
|
"title"=> 'svg-logo-text.png',
|
185
185
|
"description"=> ''
|
186
186
|
}
|
187
187
|
],
|
188
188
|
"rte"=> [
|
189
189
|
{
|
190
|
-
"uid"=> '
|
190
|
+
"uid"=> 'entry_uid_6',
|
191
191
|
"content_type"=> 'image/png',
|
192
192
|
"_content_type_uid"=> 'sys_assets',
|
193
193
|
"file_size"=> '36743',
|
194
194
|
"filename"=> 'svg-logo-text.png',
|
195
|
-
"url"=> '/v3/
|
195
|
+
"url"=> '/v3/svg-logo-text.png',
|
196
196
|
"title"=> 'svg-logo-text.png',
|
197
197
|
"description"=> ''
|
198
198
|
},
|
@@ -200,7 +200,7 @@ ENTRY_EMBEDDED_ENTRIES = {
|
|
200
200
|
"title"=> 'Update this title',
|
201
201
|
"url"=> '',
|
202
202
|
"locale"=> 'en-us',
|
203
|
-
"uid"=> '
|
203
|
+
"uid"=> 'entry_uid_1',
|
204
204
|
"_content_type_uid"=> 'content_block',
|
205
205
|
"_version"=> 5,
|
206
206
|
"_in_progress"=> false,
|
@@ -208,27 +208,27 @@ ENTRY_EMBEDDED_ENTRIES = {
|
|
208
208
|
"_embedded_items"=> {
|
209
209
|
"rich_text_editor"=> [
|
210
210
|
{
|
211
|
-
"uid"=> '
|
211
|
+
"uid"=> 'entry_uid_1',
|
212
212
|
"_content_type_uid"=> 'content_block'
|
213
213
|
}
|
214
214
|
]
|
215
215
|
},
|
216
|
-
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="
|
216
|
+
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"> asfsaf </figure>',
|
217
217
|
},
|
218
218
|
{
|
219
219
|
"title"=> 'updated title',
|
220
220
|
"rich_text_editor"=> [
|
221
|
-
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/
|
221
|
+
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/DIABETICDIET-800x600.jpg" data-sys-asset-uid="asset_uid_2" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
|
222
222
|
],
|
223
223
|
"locale"=> 'en-us',
|
224
|
-
"uid"=> '
|
224
|
+
"uid"=> 'entry_uid_3',
|
225
225
|
"_content_type_uid"=> 'embeddedrte',
|
226
226
|
"_in_progress"=> false,
|
227
227
|
"_embedded_items"=> {
|
228
228
|
"rich_text_editor"=>
|
229
229
|
[
|
230
230
|
{
|
231
|
-
"uid"=> '
|
231
|
+
"uid"=> 'asset_uid_2',
|
232
232
|
"_content_type_uid"=> 'sys_assets'
|
233
233
|
}
|
234
234
|
]
|
@@ -237,24 +237,24 @@ ENTRY_EMBEDDED_ENTRIES = {
|
|
237
237
|
{
|
238
238
|
"title"=> 'Entry with embedded entry',
|
239
239
|
"rich_text_editor"=> [
|
240
|
-
'<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
240
|
+
'<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_4" 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/html5.png" data-sys-asset-uid="asset_uid_3" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
|
241
241
|
],
|
242
242
|
"locale"=> 'en-us',
|
243
|
-
"uid"=> '
|
243
|
+
"uid"=> 'entry_uid_2',
|
244
244
|
"_content_type_uid"=> 'embeddedrte',
|
245
245
|
"_in_progress"=> false,
|
246
246
|
"_embedded_items"=> {
|
247
247
|
"rich_text_editor"=>[
|
248
248
|
{
|
249
|
-
"uid"=> '
|
249
|
+
"uid"=> 'entry_uid_4',
|
250
250
|
"_content_type_uid"=> '1234'
|
251
251
|
},
|
252
252
|
{
|
253
|
-
"uid"=> '
|
253
|
+
"uid"=> 'entry_uid_4',
|
254
254
|
"_content_type_uid"=> '1234'
|
255
255
|
},
|
256
256
|
{
|
257
|
-
"uid"=> '
|
257
|
+
"uid"=> 'asset_uid_3',
|
258
258
|
"_content_type_uid"=> 'sys_assets'
|
259
259
|
}
|
260
260
|
]
|
@@ -267,19 +267,19 @@ ENTRY_EMBEDDED_ENTRIES = {
|
|
267
267
|
ENTRY_EMBEDDED_OBJECTS = {
|
268
268
|
"title"=> 'entry and assets',
|
269
269
|
"url"=> '/entry-and-assets',
|
270
|
-
"rich_text_editor"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
270
|
+
"rich_text_editor"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_3" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="embeddedrte" sys-style-type="block" type="entry"></figure>\n<p></p>\n<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/html5.png" data-sys-asset-uid="entry_uid_6" data-sys-asset-filename="svg-logo-text.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>',
|
271
271
|
"locale"=> 'en-us',
|
272
272
|
"_in_progress"=> false,
|
273
|
-
"uid"=> '
|
274
|
-
"rte"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
273
|
+
"uid"=> 'entry_uid_4',
|
274
|
+
"rte"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_2" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="embeddedrte" sys-style-type="inline" type="entry"></figure>\n<p></p>',
|
275
275
|
"_embedded_items"=> {
|
276
276
|
"rich_text_editor"=> [
|
277
277
|
{
|
278
|
-
"uid"=> '
|
278
|
+
"uid"=> 'entry_uid_6',
|
279
279
|
"content_type"=> 'image/png',
|
280
280
|
"file_size"=> '36743',
|
281
281
|
"filename"=> 'svg-logo-text.png',
|
282
|
-
"url"=> '/v3/
|
282
|
+
"url"=> '/v3/svg-logo-text.png',
|
283
283
|
"title"=> 'svg-logo-text.png',
|
284
284
|
"description"=> '',
|
285
285
|
"_content_type_uid"=> 'sys_assets',
|
@@ -288,7 +288,7 @@ ENTRY_EMBEDDED_OBJECTS = {
|
|
288
288
|
"title"=> 'Update this title',
|
289
289
|
"url"=> '',
|
290
290
|
"locale"=> 'en-us',
|
291
|
-
"uid"=> '
|
291
|
+
"uid"=> 'entry_uid_1',
|
292
292
|
"_content_type_uid"=> 'content_block',
|
293
293
|
"_version"=> 5,
|
294
294
|
"_in_progress"=> false,
|
@@ -296,27 +296,27 @@ ENTRY_EMBEDDED_OBJECTS = {
|
|
296
296
|
"_embedded_items"=> {
|
297
297
|
"rich_text_editor"=> [
|
298
298
|
{
|
299
|
-
"uid"=> '
|
299
|
+
"uid"=> 'entry_uid_1',
|
300
300
|
"_content_type_uid"=> 'content_block'
|
301
301
|
}
|
302
302
|
]
|
303
303
|
},
|
304
|
-
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="
|
304
|
+
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"></figure>',
|
305
305
|
},
|
306
306
|
{
|
307
307
|
"title"=> 'updated title',
|
308
308
|
"rich_text_editor"=> [
|
309
|
-
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/
|
309
|
+
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/DIABETICDIET-800x600.jpg" data-sys-asset-uid="asset_uid_2" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
|
310
310
|
],
|
311
311
|
"locale"=> 'en-us',
|
312
|
-
"uid"=> '
|
312
|
+
"uid"=> 'entry_uid_3',
|
313
313
|
"_content_type_uid"=> 'embeddedrte',
|
314
314
|
"_in_progress"=> false,
|
315
315
|
"_embedded_items"=> {
|
316
316
|
"rich_text_editor"=>
|
317
317
|
[
|
318
318
|
{
|
319
|
-
"uid"=> '
|
319
|
+
"uid"=> 'asset_uid_2',
|
320
320
|
"_content_type_uid"=> 'sys_assets'
|
321
321
|
}
|
322
322
|
]
|
@@ -325,24 +325,24 @@ ENTRY_EMBEDDED_OBJECTS = {
|
|
325
325
|
{
|
326
326
|
"title"=> 'Entry with embedded entry',
|
327
327
|
"rich_text_editor"=> [
|
328
|
-
'<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
328
|
+
'<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_4" 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/html5.png" data-sys-asset-uid="asset_uid_3" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
|
329
329
|
],
|
330
330
|
"locale"=> 'en-us',
|
331
|
-
"uid"=> '
|
331
|
+
"uid"=> 'entry_uid_2',
|
332
332
|
"_content_type_uid"=> 'embeddedrte',
|
333
333
|
"_in_progress"=> false,
|
334
334
|
"_embedded_items"=> {
|
335
335
|
"rich_text_editor"=> [
|
336
336
|
{
|
337
|
-
"uid"=> '
|
337
|
+
"uid"=> 'entry_uid_4',
|
338
338
|
"_content_type_uid"=> '1234'
|
339
339
|
},
|
340
340
|
{
|
341
|
-
"uid"=> '
|
341
|
+
"uid"=> 'entry_uid_4',
|
342
342
|
"_content_type_uid"=> '1234'
|
343
343
|
},
|
344
344
|
{
|
345
|
-
"uid"=> '
|
345
|
+
"uid"=> 'asset_uid_3',
|
346
346
|
"_content_type_uid"=> 'sys_assets'
|
347
347
|
}
|
348
348
|
]
|
@@ -354,7 +354,7 @@ ENTRY_EMBEDDED_OBJECTS = {
|
|
354
354
|
"title"=> 'Update this title',
|
355
355
|
"url"=> '',
|
356
356
|
"locale"=> 'en-us',
|
357
|
-
"uid"=> '
|
357
|
+
"uid"=> 'entry_uid_1',
|
358
358
|
"_content_type_uid"=> 'content_block',
|
359
359
|
"_version"=> 5,
|
360
360
|
"_in_progress"=> false,
|
@@ -362,27 +362,27 @@ ENTRY_EMBEDDED_OBJECTS = {
|
|
362
362
|
"_embedded_items"=> {
|
363
363
|
"rich_text_editor"=>[
|
364
364
|
{
|
365
|
-
"uid"=> '
|
365
|
+
"uid"=> 'entry_uid_1',
|
366
366
|
"_content_type_uid"=> 'content_block'
|
367
367
|
}
|
368
368
|
]
|
369
369
|
},
|
370
|
-
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="
|
370
|
+
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"></figure>',
|
371
371
|
},
|
372
372
|
{
|
373
373
|
"title"=> 'updated title',
|
374
374
|
"rich_text_editor"=> [
|
375
|
-
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/
|
375
|
+
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/DIABETICDIET-800x600.jpg" data-sys-asset-uid="asset_uid_2" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
|
376
376
|
],
|
377
377
|
"locale"=> 'en-us',
|
378
|
-
"uid"=> '
|
378
|
+
"uid"=> 'entry_uid_3',
|
379
379
|
"_content_type_uid"=> 'embeddedrte',
|
380
380
|
"_in_progress"=> false,
|
381
381
|
"_embedded_items"=> {
|
382
382
|
"rich_text_editor"=>
|
383
383
|
[
|
384
384
|
{
|
385
|
-
"uid"=> '
|
385
|
+
"uid"=> 'asset_uid_2',
|
386
386
|
"_content_type_uid"=> 'sys_assets',
|
387
387
|
}
|
388
388
|
]
|
@@ -391,24 +391,24 @@ ENTRY_EMBEDDED_OBJECTS = {
|
|
391
391
|
{
|
392
392
|
"title"=> 'Entry with embedded entry',
|
393
393
|
"rich_text_editor"=> [
|
394
|
-
'<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
394
|
+
'<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_4" 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/html5.png" data-sys-asset-uid="asset_uid_3" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
|
395
395
|
],
|
396
396
|
"locale"=> 'en-us',
|
397
|
-
"uid"=> '
|
397
|
+
"uid"=> 'entry_uid_2',
|
398
398
|
"_content_type_uid"=> 'embeddedrte',
|
399
399
|
"_in_progress"=> false,
|
400
400
|
"_embedded_items"=> {
|
401
401
|
"rich_text_editor"=>[
|
402
402
|
{
|
403
|
-
"uid"=> '
|
403
|
+
"uid"=> 'entry_uid_4',
|
404
404
|
"_content_type_uid"=> '1234'
|
405
405
|
},
|
406
406
|
{
|
407
|
-
"uid"=> '
|
407
|
+
"uid"=> 'entry_uid_4',
|
408
408
|
"_content_type_uid"=> '1234'
|
409
409
|
},
|
410
410
|
{
|
411
|
-
"uid"=> '
|
411
|
+
"uid"=> 'asset_uid_3',
|
412
412
|
"_content_type_uid"=> 'sys_assets'
|
413
413
|
}
|
414
414
|
]
|
@@ -420,19 +420,19 @@ ENTRY_EMBEDDED_OBJECTS = {
|
|
420
420
|
ENNTRY_MULTIPLE_EMBED = {
|
421
421
|
"title"=> 'entry and assets',
|
422
422
|
"url"=> '/entry-and-assets',
|
423
|
-
"rich_text_editor"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
423
|
+
"rich_text_editor"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_3" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="embeddedrte" sys-style-type="block" type="entry"></figure>\n<p></p>\n<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/html5.png" data-sys-asset-uid="entry_uid_6" data-sys-asset-filename="svg-logo-text.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>',
|
424
424
|
"locale"=> 'en-us',
|
425
425
|
"_in_progress"=> false,
|
426
|
-
"uid"=> '
|
427
|
-
"rte"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
426
|
+
"uid"=> 'entry_uid_4',
|
427
|
+
"rte"=> '<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_2" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="embeddedrte" sys-style-type="inline" type="entry"></figure>\n<p></p>',
|
428
428
|
"_embedded_items"=> {
|
429
429
|
"rich_text_editor"=> [
|
430
430
|
{
|
431
|
-
"uid"=> '
|
431
|
+
"uid"=> 'entry_uid_6',
|
432
432
|
"content_type"=> 'image/png',
|
433
433
|
"file_size"=> '36743',
|
434
434
|
"filename"=> 'svg-logo-text.png',
|
435
|
-
"url"=> '/v3/
|
435
|
+
"url"=> '/v3/svg-logo-text.png',
|
436
436
|
"title"=> 'svg-logo-text.png',
|
437
437
|
"description"=> '',
|
438
438
|
"_content_type_uid"=> 'sys_assets',
|
@@ -441,7 +441,7 @@ ENNTRY_MULTIPLE_EMBED = {
|
|
441
441
|
"title"=> 'Update this title',
|
442
442
|
"url"=> '',
|
443
443
|
"locale"=> 'en-us',
|
444
|
-
"uid"=> '
|
444
|
+
"uid"=> 'entry_uid_1',
|
445
445
|
"_content_type_uid"=> 'content_block',
|
446
446
|
"_version"=> 5,
|
447
447
|
"_in_progress"=> false,
|
@@ -449,31 +449,31 @@ ENNTRY_MULTIPLE_EMBED = {
|
|
449
449
|
"_embedded_items"=> {
|
450
450
|
"rich_text_editor"=> [
|
451
451
|
{
|
452
|
-
"uid"=> '
|
452
|
+
"uid"=> 'entry_uid_1',
|
453
453
|
"_content_type_uid"=> 'content_block'
|
454
454
|
}
|
455
455
|
]
|
456
456
|
},
|
457
|
-
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="
|
457
|
+
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"></figure>',
|
458
458
|
},
|
459
459
|
{
|
460
460
|
"title"=> 'updated title',
|
461
461
|
"rich_text_editor"=> [
|
462
|
-
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/
|
462
|
+
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/DIABETICDIET-800x600.jpg" data-sys-asset-uid="asset_uid_2" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
|
463
463
|
],
|
464
464
|
"locale"=> 'en-us',
|
465
|
-
"uid"=> '
|
465
|
+
"uid"=> 'entry_uid_3',
|
466
466
|
"_content_type_uid"=> 'embeddedrte',
|
467
467
|
"_in_progress"=> false,
|
468
468
|
"_embedded_items"=> {
|
469
469
|
"rich_text_editor"=>[
|
470
470
|
{
|
471
471
|
"_content_type_uid"=> 'sys_assets',
|
472
|
-
"uid"=> '
|
472
|
+
"uid"=> 'asset_uid_2',
|
473
473
|
"content_type"=> 'image/png',
|
474
474
|
"file_size"=> '36743',
|
475
475
|
"filename"=> 'svg-logo-text.png',
|
476
|
-
"url"=> '/v3/
|
476
|
+
"url"=> '/v3/svg-logo-text.png',
|
477
477
|
"title"=> 'svg-logo-text.png',
|
478
478
|
"description"=> ''
|
479
479
|
}
|
@@ -483,24 +483,24 @@ ENNTRY_MULTIPLE_EMBED = {
|
|
483
483
|
{
|
484
484
|
"title"=> 'Entry with embedded entry',
|
485
485
|
"rich_text_editor"=> [
|
486
|
-
'<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
486
|
+
'<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_4" 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/html5.png" data-sys-asset-uid="asset_uid_3" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
|
487
487
|
],
|
488
488
|
"locale"=> 'en-us',
|
489
|
-
"uid"=> '
|
489
|
+
"uid"=> 'entry_uid_2',
|
490
490
|
"_content_type_uid"=> 'embeddedrte',
|
491
491
|
"_in_progress"=> false,
|
492
492
|
"_embedded_items"=> {
|
493
493
|
"rich_text_editor"=>[
|
494
494
|
{
|
495
|
-
"uid"=> '
|
495
|
+
"uid"=> 'entry_uid_4',
|
496
496
|
"_content_type_uid"=> '1234'
|
497
497
|
},
|
498
498
|
{
|
499
|
-
"uid"=> '
|
499
|
+
"uid"=> 'entry_uid_4',
|
500
500
|
"_content_type_uid"=> '1234'
|
501
501
|
},
|
502
502
|
{
|
503
|
-
"uid"=> '
|
503
|
+
"uid"=> 'asset_uid_3',
|
504
504
|
"_content_type_uid"=> 'sys_assets'
|
505
505
|
}
|
506
506
|
]
|
@@ -509,12 +509,12 @@ ENNTRY_MULTIPLE_EMBED = {
|
|
509
509
|
],
|
510
510
|
"rte"=> [
|
511
511
|
{
|
512
|
-
"uid"=> '
|
512
|
+
"uid"=> 'entry_uid_6',
|
513
513
|
"content_type"=> 'image/png',
|
514
514
|
"_content_type_uid"=> 'sys_assets',
|
515
515
|
"file_size"=> '36743',
|
516
516
|
"filename"=> 'svg-logo-text.png',
|
517
|
-
"url"=> '/v3/
|
517
|
+
"url"=> '/v3/svg-logo-text.png',
|
518
518
|
"title"=> 'svg-logo-text.png',
|
519
519
|
"description"=> ''
|
520
520
|
},
|
@@ -522,7 +522,7 @@ ENNTRY_MULTIPLE_EMBED = {
|
|
522
522
|
"title"=> 'Update this title',
|
523
523
|
"url"=> '',
|
524
524
|
"locale"=> 'en-us',
|
525
|
-
"uid"=> '
|
525
|
+
"uid"=> 'entry_uid_1',
|
526
526
|
"_content_type_uid"=> 'content_block',
|
527
527
|
"_version"=> 5,
|
528
528
|
"_in_progress"=> false,
|
@@ -530,30 +530,30 @@ ENNTRY_MULTIPLE_EMBED = {
|
|
530
530
|
"_embedded_items"=> {
|
531
531
|
"rich_text_editor"=>[
|
532
532
|
{
|
533
|
-
"uid"=> '
|
533
|
+
"uid"=> 'entry_uid_1',
|
534
534
|
"_content_type_uid"=> 'content_block'
|
535
535
|
}
|
536
536
|
]
|
537
537
|
},
|
538
|
-
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="
|
538
|
+
"rich_text_editor"=> '<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_1" data-sys-entry-"locale"="en-us" data-sys-content-type-uid="content_block" sys-style-type="inline" type="entry"></figure>',
|
539
539
|
},
|
540
540
|
{
|
541
541
|
"title"=> 'updated title',
|
542
542
|
"rich_text_editor"=> [
|
543
|
-
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/
|
543
|
+
'<figure class="embedded-asset" data-sys-asset-filelink="https://contentstack.image/v3/DIABETICDIET-800x600.jpg" data-sys-asset-uid="asset_uid_2" data-sys-asset-filename="DIABETICDIET-800x600.jpg" data-sys-asset-contenttype="image/jpeg" type="asset" sys-style-type="display"></figure>'
|
544
544
|
],
|
545
545
|
"locale"=> 'en-us',
|
546
|
-
"uid"=> '
|
546
|
+
"uid"=> 'entry_uid_3',
|
547
547
|
"_content_type_uid"=> 'embeddedrte',
|
548
548
|
"_in_progress"=> false,
|
549
549
|
"_embedded_items"=> {
|
550
550
|
"rich_text_editor"=>[
|
551
551
|
{
|
552
|
-
"uid"=> '
|
552
|
+
"uid"=> 'asset_uid_2',
|
553
553
|
"content_type"=> 'image/png',
|
554
554
|
"file_size"=> '36743',
|
555
555
|
"filename"=> 'svg-logo-text.png',
|
556
|
-
"url"=> '/v3/
|
556
|
+
"url"=> '/v3/svg-logo-text.png',
|
557
557
|
"title"=> 'svg-logo-text.png',
|
558
558
|
"description"=> '',
|
559
559
|
"_content_type_uid"=> 'sys_assets',
|
@@ -564,24 +564,24 @@ ENNTRY_MULTIPLE_EMBED = {
|
|
564
564
|
{
|
565
565
|
"title"=> 'Entry with embedded entry',
|
566
566
|
"rich_text_editor"=> [
|
567
|
-
'<figure class="embedded-entry block-entry" data-sys-entry-uid="
|
567
|
+
'<figure class="embedded-entry block-entry" data-sys-entry-uid="entry_uid_4" data-sys-content-type-uid="1234" sys-style-type="block" type="entry"></figure>\n<figure class="embedded-entry inline-entry" data-sys-entry-uid="entry_uid_4" 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/html5.png" data-sys-asset-uid="asset_uid_3" data-sys-asset-filename="html5.png" data-sys-asset-contenttype="image/png" type="asset" sys-style-type="display"></figure>'
|
568
568
|
],
|
569
569
|
"locale"=> 'en-us',
|
570
|
-
"uid"=> '
|
570
|
+
"uid"=> 'entry_uid_2',
|
571
571
|
"_content_type_uid"=> 'embeddedrte',
|
572
572
|
"_in_progress"=> false,
|
573
573
|
"_embedded_items"=> {
|
574
574
|
"rich_text_editor"=> [
|
575
575
|
{
|
576
|
-
"uid"=> '
|
576
|
+
"uid"=> 'entry_uid_4',
|
577
577
|
"_content_type_uid"=> '1234'
|
578
578
|
},
|
579
579
|
{
|
580
|
-
"uid"=> '
|
580
|
+
"uid"=> 'entry_uid_4',
|
581
581
|
"_content_type_uid"=> '1234'
|
582
582
|
},
|
583
583
|
{
|
584
|
-
"uid"=> '
|
584
|
+
"uid"=> 'asset_uid_3',
|
585
585
|
"_content_type_uid"=> 'sys_assets',
|
586
586
|
}
|
587
587
|
]
|
@@ -592,12 +592,12 @@ ENNTRY_MULTIPLE_EMBED = {
|
|
592
592
|
}
|
593
593
|
|
594
594
|
ENTRY_ASSET_RICH_TEXT = "<p></p>
|
595
|
-
<img src='/v3/
|
595
|
+
<img src='/v3/dummy.pdf' alt='dummy.pdf' />\\n<img data-image=\"236uaymkloww\" src=\"https://contentstack.image/v3/html5.png\" data-sys-asset-uid=\"entry_uid_9\" alt=\"html5.png\">\\n<p></p>\\n<img src='/v3/svg-logo-text.png' alt='svg-logo-text.png' />"
|
596
596
|
|
597
597
|
ENTRY_ASSET_RICH_TEXT_RENDER_OPTION = "<p></p>
|
598
|
-
<img src=\"/v3/
|
598
|
+
<img src=\"/v3/dummy.pdf\" alt=\"Alternet Text\" />\\n<img data-image=\"236uaymkloww\" src=\"https://contentstack.image/v3/html5.png\" data-sys-asset-uid=\"entry_uid_9\" alt=\"html5.png\">\\n<p></p>\\n<img src=\"/v3/svg-logo-text.png\" alt=\"Alternet Text\" />"
|
599
599
|
|
600
|
-
ENTRY_MULTIPLE_RICH_TEXT = "<div><p>updated title</p><p>Content type: <span>embeddedrte</span></p></div>\\n<p></p>\\n<img src='/v3/
|
600
|
+
ENTRY_MULTIPLE_RICH_TEXT = "<div><p>updated title</p><p>Content type: <span>embeddedrte</span></p></div>\\n<p></p>\\n<img src='/v3/svg-logo-text.png' alt='svg-logo-text.png' />"
|
601
601
|
|
602
602
|
entrymultipleRTE = "<div><p>Update this title</p><p>Content type=> <span>content_block</span></p></div>
|
603
603
|
<span>Entry with embedded entry</span>
|
@@ -605,13 +605,13 @@ entrymultipleRTE = "<div><p>Update this title</p><p>Content type=> <span>content
|
|
605
605
|
|
606
606
|
entrymultipleRTERenderOption = "<div>
|
607
607
|
<div>Update this title</div>
|
608
|
-
<div><span>
|
608
|
+
<div><span>entry_uid_1</span>
|
609
609
|
</div>
|
610
610
|
<div>
|
611
|
-
<div>
|
612
|
-
<MYCONTENT><div><p>
|
613
|
-
<span>
|
611
|
+
<div>entry_uid_2</div>
|
612
|
+
<MYCONTENT><div><p>entry_uid_4</p><p>Content type=> <span>1234</span></p></div>
|
613
|
+
<span>entry_uid_4</span>
|
614
614
|
<p><br><br></p>
|
615
|
-
<img src='undefined' alt='
|
615
|
+
<img src='undefined' alt='asset_uid_3' /></MYCONTENT>
|
616
616
|
</div>
|
617
617
|
<p></p>"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentstack_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contentstack
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -34,22 +34,22 @@ dependencies:
|
|
34
34
|
name: nokogiri
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ">="
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: 1.11.0
|
40
37
|
- - "~>"
|
41
38
|
- !ruby/object:Gem::Version
|
42
39
|
version: '1.11'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.11.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 1.11.0
|
50
47
|
- - "~>"
|
51
48
|
- !ruby/object:Gem::Version
|
52
49
|
version: '1.11'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 1.11.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: rake
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -131,11 +131,13 @@ files:
|
|
131
131
|
- ".ruby-version"
|
132
132
|
- ".yardopts"
|
133
133
|
- CHANGELOG.md
|
134
|
+
- CODEOWNERS
|
134
135
|
- Gemfile
|
135
136
|
- Gemfile.lock
|
136
137
|
- LICENSE
|
137
138
|
- README.md
|
138
139
|
- Rakefile
|
140
|
+
- SECURITY.md
|
139
141
|
- contentstack_utils.gemspec
|
140
142
|
- lib/contentstack_utils.rb
|
141
143
|
- lib/contentstack_utils/interface/renderable.rb
|
@@ -157,7 +159,7 @@ homepage: https://github.com/contentstack/contentstack-utils-ruby
|
|
157
159
|
licenses:
|
158
160
|
- MIT
|
159
161
|
metadata: {}
|
160
|
-
post_install_message:
|
162
|
+
post_install_message:
|
161
163
|
rdoc_options: []
|
162
164
|
require_paths:
|
163
165
|
- lib
|
@@ -172,8 +174,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
174
|
- !ruby/object:Gem::Version
|
173
175
|
version: '0'
|
174
176
|
requirements: []
|
175
|
-
rubygems_version: 3.
|
176
|
-
signing_key:
|
177
|
+
rubygems_version: 3.3.7
|
178
|
+
signing_key:
|
177
179
|
specification_version: 4
|
178
180
|
summary: Contentstack Ruby Utils for
|
179
181
|
test_files:
|