Skip to content

Commit 918d416

Browse files
authored
Merge pull request #64 from contentstack/bug/security
Bug/security
2 parents b59c954 + 00feee1 commit 918d416

33 files changed

+286
-1736
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ typescript-html-report
1313
webpack
1414
jest.config.js
1515
coverage
16+
CODEOWNERS

.talismanrc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
fileignoreconfig:
2-
- filename: dist/react-native/contentstack.js
3-
checksum: 6ec0482ba61056b8d079e776719164924e3ecd6c8123f03fd6dc01a727013d95
4-
- filename: dist/node/contentstack.js
5-
checksum: 31877d4663fa195f8dd581279dbf4784567b5ed0a1923487ef1851cecbd5254f
6-
- filename: dist/nativescript/contentstack.js
7-
checksum: 8acfc161d1a7fdaec02fc378e00cdd381d89dd19dedc25e7ee2b32be9a40f2a1
8-
- filename: dist/web/contentstack.js
9-
checksum: 50454530e51fd6235680fe980cd411091ec052fb8d94b151c40dd9e1ed8c0e3f
2+
- filename: test/automation-script.js
3+
checksum: dd31ccc9f78dbcfb48eafa5d7ab80d480776c70bc36d6a10eb86229fb79443af

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
## Change log
2+
### Version: 3.15.0
3+
#### Date: Oct-29-2021
4+
##### New Features:
5+
- Content branching feature support added
6+
7+
28
### Version: 3.14.0
39
#### Date: Oct-19-2021
410
##### New Features:

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22

33

4-
Copyright (c) 2016-2020 Contentstack
4+
Copyright (c) 2016-2021 Contentstack
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const config = {
99
entries: "/entries/",
1010
assets: "/assets/",
1111
environments: "/environments/"
12+
},
13+
live_preview: {
14+
enable: false,
15+
host: 'api.contentstack.io'
1216
}
1317
};
1418

contentstack-templates/publish.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var util = require('util');
1313
var htmlsafe = helper.htmlsafe;
1414
var linkto = helper.linkto;
1515
var resolveAuthorLinks = helper.resolveAuthorLinks;
16-
var scopeToPunc = helper.scopeToPunc;
1716
var hasOwnProp = Object.prototype.hasOwnProperty;
1817

1918
var data;
@@ -295,7 +294,6 @@ function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) {
295294

296295
items.forEach(function(item) {
297296
var methods = find({kind:'function', memberof: item.longname});
298-
var members = find({kind:'member', memberof: item.longname});
299297

300298
if ( !hasOwnProp.call(item, 'longname') ) {
301299
itemsNav += '<li>' + linktoFn('', item.name);

contentstack-templates/static/styles/jsdoc-default.css

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ p, ul, ol, blockquote {
3636

3737
h1, h2, h3, h4, h5, h6 {
3838
font-family: 'Montserrat', sans-serif;
39-
}
40-
41-
h1, h2, h3, h4, h5, h6 {
4239
color: #000;
4340
font-weight: 400;
4441
margin: 0;
@@ -140,7 +137,6 @@ nav {
140137
}
141138

142139
nav h3 {
143-
margin-top: 12px;
144140
font-size: 13px;
145141
text-transform: uppercase;
146142
letter-spacing: 1px;
@@ -265,11 +261,8 @@ footer {
265261
}
266262

267263
.details ul {
268-
margin: 0
269-
}
270-
271-
.details ul {
272-
list-style-type: none
264+
margin: 0;
265+
list-style-type: none;
273266
}
274267

275268
.details li {

contentstack-templates/static/styles/prettify-tomorrow.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,14 @@ li.L6,
121121
li.L7,
122122
li.L8,
123123
li.L9 {
124-
/* */ }
124+
125+
}
125126

126127
/* Alternate shading for lines */
127128
li.L1,
128129
li.L3,
129130
li.L5,
130131
li.L7,
131132
li.L9 {
132-
/* */ }
133+
134+
}

contentstack-templates/tmpl/layout.tmpl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</head>
2424
<body>
2525
<!-- Google Tag Manager (noscript) -->
26-
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WGP99J7" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
26+
<noscript><iframe title="Google Tag Manager" src="https://www.googletagmanager.com/ns.html?id=GTM-WGP99J7" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
2727
<!-- End Google Tag Manager (noscript) -->
2828
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
2929
<label for="nav-trigger" class="navicon-button x">
@@ -54,11 +54,11 @@
5454
<pre class="prettyprint"><code>&lt;script type="text/javascript" src="/path/to/contentstack.min.js"&gt;&lt;/script&gt;;
5555
</code></pre>
5656
<p>To initialize the SDK, you will need to specify the API Key, Delivery Token, and Environment Name of your stack.</p>
57-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("api_key", "delivery_token", "environment_name");
57+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
5858
</code></pre>
5959

6060
<p>To initialize the SDK for European Region you want to set and use European region, refer to the code below:</p>
61-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("api_key", "delivery_token", "environment_name", Contentstack.Region.EU);
61+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment", "region": Contentstack.Region.EU });
6262
</code></pre>
6363

6464
<h4><a id="For_Nodejs_25"></a>For Node.js</h4>
@@ -69,10 +69,10 @@
6969
<pre class="prettyprint"><code>import contentstack from ‘contentstack’
7070
</code></pre>
7171
<p>To initialize the SDK, you will need to specify the API Key, Delivery Token, and Environment Name of your stack.</p>
72-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("api_key","delivery_token","environment_name");
72+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment");
7373
</code></pre>
7474
<p>To initialize the SDK for European Region you want to set and use European region, refer to the code below:</p>
75-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("api_key", "delivery_token", "environment_name", Contentstack.Region.EU);
75+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment", "region": Contentstack.Region.EU });
7676
</code></pre>
7777
<h4><a id="For_React_Native_39"></a>For React Native</h4>
7878
<p>React Native uses the Javascript SDK to create apps. To use the JavaScript Delivery SDK, download it from <a href="https://www.contentstack.com/docs/platforms/javascript-browser/javascript_sdk_latest">here</a>, OR install ist via npm:</p>
@@ -82,10 +82,10 @@
8282
<pre class="prettyprint" class="prettyprint"><code>import contentstack from `contentstack/react-native`
8383
</code></pre>
8484
<p>To initialize the SDK, you will need to specify the API Key, Delivery Token, and Environment Name of your stack.</p>
85-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("api_key", "delivery_token", "environment_name");
85+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
8686
</code></pre>
8787
<p>To initialize the SDK for European Region you want to set and use European region, refer to the code below:</p>
88-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("api_key", "delivery_token", "environment_name", Contentstack.Region.EU);
88+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment", "region": Contentstack.Region.EU };
8989
</code></pre>
9090
<h3><a id="Key_Concepts_for_using_Contentstack_54"></a>Key Concepts for using Contentstack</h3>
9191
<h4><a id="Stack_56"></a>Stack</h4>
@@ -101,14 +101,14 @@
101101
<h3><a id="Contentstack_JavaScript_SDK_5minute_Quickstart_78"></a>Contentstack JavaScript Delivery SDK: 5-minute Quickstart</h3>
102102
<h4><a id="Initializing_your_SDK_80"></a>Initializing your SDK</h4>
103103
<p>You will need to specify the API key, Access token, and Environment Name of your stack to initialize the SDK:</p>
104-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("api_key", "delivery_token", "environment_name");
104+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
105105
</code></pre>
106106
<p>Once you have initialized the SDK, you can start getting content in your app.</p>
107107
<h4><a id="Querying_content_from_your_stack_90"></a>Querying content from your stack</h4>
108108
<p>To get a single entry, you need to specify the content type as well as the ID of the entry.</p>
109-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("stack_api_key", "delivery_token", "environment_name");
109+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
110110

111-
const Query = Stack.ContentType('blog').Entry("blt123something");
111+
const Query = Stack.ContentType('blog').Entry("entry_uid");
112112

113113
Query.fetch()
114114
.then(function success(entry) {
@@ -122,7 +122,7 @@ Query.fetch()
122122
<pre class="prettyprint"><code>Stack.ContentType(type).Query().language('fr-fr').toJSON().find()</code></pre>
123123
It will provide all entries of a content type published on the French locale.</p>
124124
<p>To retrieve multiple entries of a content type, you need to specify the content type uid. You can also specify search parameters to filter results.</p>
125-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("stack_api_key", "delivery_token", "environment_name");
125+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
126126

127127
const Query = Stack.ContentType('blog').Query();
128128

@@ -146,7 +146,7 @@ Query
146146
<h4><a id="Paginating_Responses"></a>Paginating Responses</h4>
147147
<p>In a single instance, the Get Multiple Entries query will retrieve only the first 100 items of the specified content type. You can paginate and retrieve the rest of the items in batches using the <a href="/docs/platforms/javascript-browser/api-reference/Query.html#skip">skip</a> and <a href="/docs/platforms/javascript-browser/api-reference/Query.html#limit">limit</a> parameters in subsequent requests.</p>
148148

149-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("stack_api_key", "delivery_token", "environment_name");
149+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
150150
let blogQuery = Stack.ContentType('example').Query();
151151
let data = blogQuery.skip(20).limit(20).find()
152152
data.then(function(result) {
@@ -158,9 +158,9 @@ data.then(function(result) {
158158

159159
<h4><a id="Querying_content_from_your_stack_90"></a>Querying Assets from your stack</h4>
160160
<p>To get a single asset, you need to specify the UID of the asset.</p>
161-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("stack_api_key", "delivery_token", "environment_name");
161+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
162162

163-
const Asset = Stack.Asset("blt123something");
163+
const Asset = Stack.Asset("<asset_uid>");
164164

165165
Asset.fetch()
166166
.then(function success(asset) {
@@ -171,7 +171,7 @@ Asset.fetch()
171171
});
172172
</code></pre>
173173
<p>To retrieve multiple assets. You can also specify search parameters to filter results.</p>
174-
<pre class="prettyprint"><code>const Stack = Contentstack.Stack("stack_api_key", "delivery_token", "environment_name");
174+
<pre class="prettyprint"><code>const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
175175

176176
const Query = Stack.Asset().Query();
177177

@@ -212,15 +212,15 @@ Query.setCachePolicy(Contentstack.CachePolicy.CACHE_THEN_NETWORK)
212212
<p>Following are Image Delivery API examples.</p>
213213
<pre class="prettyprint"><code>
214214
// Set the quality 100
215-
const Stack = Contentstack.Stack("stack_api_key", "delivery_token", "environment_name");
215+
const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
216216

217217
const imageUrl = Stack.imageTransform(imageUrl, {
218218
'quality': 100
219219
})
220220
</code></pre>
221221
<pre class="prettyprint"><code>
222222
// set the quality to 100, auto optimization, width and height
223-
const Stack = Contentstack.Stack("stack_api_key", "delivery_token", "environment_name");
223+
const Stack = Contentstack.Stack({ "api_key": "api_key", "delivery_token": "delivery_token", "environment": "environment" });
224224

225225
const imageUrl = Stack.imageTransform(imageUrl, {
226226
'quality': 100,

contentstack-templates/tmpl/params.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@
5050
});
5151
?>
5252

53-
<table class="params">
53+
<table class="params" aria-describedby="params">
5454
<thead>
5555
<tr>
5656
<?js if (params.hasName) {?>
57-
<th>Name</th>
57+
<th id="name">Name</th>
5858
<?js } ?>
5959

6060
<?js if (params.hasAttributes) {?>
61-
<th>Attributes</th>
61+
<th id="attributes">Attributes</th>
6262
<?js } ?>
6363

6464
<?js if (params.hasDefault) {?>
65-
<th>Default</th>
65+
<th id="default">Default</th>
6666
<?js } ?>
6767

6868
<th class="last">Description</th>

0 commit comments

Comments
 (0)