File tree Expand file tree Collapse file tree 10 files changed +42
-23
lines changed Expand file tree Collapse file tree 10 files changed +42
-23
lines changed Original file line number Diff line number Diff line change 8
8
build :
9
9
runs-on : ubuntu-latest
10
10
steps :
11
- - uses : actions/checkout@v2
12
- - uses : actions/setup-node@v1
11
+ - uses : actions/checkout@v4
12
+ - uses : actions/setup-node@v4
13
13
with :
14
- node-version : " 16 .x"
14
+ node-version : " 22 .x"
15
15
- run : npm install
16
16
17
17
- name : get-package-details
28
28
tag_prefix : " v"
29
29
- name : Create Release
30
30
if : steps.update_tag.outputs.tagname
31
- uses : actions/create-release@v1
31
+ uses : actions/create-release@v4
32
32
id : create_release
33
33
env :
34
34
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
40
40
- name : Upload Release Asset
41
41
if : steps.update_tag.outputs.tagname
42
42
id : upload-release-asset
43
- uses : actions/upload-release-asset@v1
43
+ uses : actions/upload-release-asset@v4
44
44
env :
45
45
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46
46
with :
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Contentstack is a headless CMS with an API-first approach. It is a CMS that deve
8
8
9
9
### Prerequisite
10
10
11
- - Nodejs, v8 +
11
+ - Nodejs, v20 +
12
12
- MongoDB, v3.6 or higher
13
13
- You should have the data synced through [ Contentstack DataSync] ( https://www.contentstack.com/docs/guide/synchronization/contentstack-datasync )
14
14
Original file line number Diff line number Diff line change 4
4
< meta charset ="utf-8 ">
5
5
< title > JSDoc: Global</ title >
6
6
7
- < script src ="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js "> </ script >
8
- < script src ="scripts/prettify/lang-css.js "> </ script >
7
+ < script src ="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js " integrity =" coVkbqHWSAomtcPWb3XtrGNqZkue+Eu9X7YxIgZbtmg=% " crossorigin =" anonymous " > </ script >
8
+ < script src ="scripts/prettify/lang-css.js " integrity =" m2rEgwM7AlcnFOtNN+4ZkYXEEAjrKz9GoAqw685qIMU=% " crossorigin =" anonymous " > </ script >
9
9
<!--[if lt IE 9]>
10
10
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js" integrity="sha384-hDHlUtmnjnJimeAhT+DpLqjLdp8vFgSFHhZO1zq2EtqpwFsNM7H5cpSUYqT1Uh2E" crossorigin="anonymous"></script>
11
11
<![endif]-->
@@ -7515,6 +7515,6 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="global.ht
7515
7515
</ footer >
7516
7516
7517
7517
< script > prettyPrint ( ) ; </ script >
7518
- < script src ="scripts/linenumber.js "> </ script >
7518
+ < script src ="scripts/linenumber.js " integrity =" gjKEaAtJoBN94tFHTJO/QMWm2iZN7DSXY/EAGrHzx30=% " crossorigin =" anonymous " > </ script >
7519
7519
</ body >
7520
7520
</ html >
Original file line number Diff line number Diff line change 1065
1065
</footer>
1066
1066
1067
1067
<script> prettyPrint(); </script>
1068
- <script src="scripts/linenumber.js"> </script>
1068
+ <script src="scripts/linenumber.js" integrity="gjKEaAtJoBN94tFHTJO/QMWm2iZN7DSXY/EAGrHzx30=%" crossorigin="anonymous" > </script>
1069
1069
</body>
1070
1070
</html>
Original file line number Diff line number Diff line change @@ -286,6 +286,6 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="global.ht
286
286
</ footer >
287
287
288
288
< script > prettyPrint ( ) ; </ script >
289
- < script src ="scripts/linenumber.js "> </ script >
289
+ < script src ="scripts/linenumber.js " integrity =" gjKEaAtJoBN94tFHTJO/QMWm2iZN7DSXY/EAGrHzx30=% " crossorigin =" anonymous " > </ script >
290
290
</ body >
291
291
</ html >
Original file line number Diff line number Diff line change @@ -87,6 +87,6 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="global.ht
87
87
</ footer >
88
88
89
89
< script > prettyPrint ( ) ; </ script >
90
- < script src ="scripts/linenumber.js "> </ script >
90
+ < script src ="scripts/linenumber.js " integrity =" gjKEaAtJoBN94tFHTJO/QMWm2iZN7DSXY/EAGrHzx30=% " crossorigin =" anonymous " > </ script >
91
91
</ body >
92
92
</ html >
Original file line number Diff line number Diff line change @@ -2239,6 +2239,6 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="global.ht
2239
2239
</ footer >
2240
2240
2241
2241
< script > prettyPrint ( ) ; </ script >
2242
- < script src ="scripts/linenumber.js "> </ script >
2242
+ < script src ="scripts/linenumber.js " integrity =" gjKEaAtJoBN94tFHTJO/QMWm2iZN7DSXY/EAGrHzx30=% " crossorigin =" anonymous " > </ script >
2243
2243
</ body >
2244
2244
</ html >
Original file line number Diff line number Diff line change 1
1
{
2
2
"author" :
" Contentstack Ecosystem <[email protected] >" ,
3
3
"name" : " datasync-mongodb-sdk" ,
4
- "version" : " 1.0.8 " ,
4
+ "version" : " 1.0.9 " ,
5
5
"description" : " Mongodb query wrapper around contents synced via @contentstack/content-store-mongodb" ,
6
6
"main" : " dist/index.js" ,
7
7
"scripts" : {
Original file line number Diff line number Diff line change @@ -2391,19 +2391,38 @@ export class Stack {
2391
2391
}
2392
2392
2393
2393
private sanitizeIQuery ( query : IQuery ) : boolean {
2394
+ const allowedKeys = {
2395
+ _content_type_uid : 'string' ,
2396
+ uid : 'string' ,
2397
+ _version : {
2398
+ $exists : 'boolean'
2399
+ } ,
2400
+ locale : 'string'
2401
+ } ;
2402
+
2403
+ const validateObject = ( obj : any , schema : any ) : boolean => {
2404
+ for ( const key in obj ) {
2405
+ if ( ! schema . hasOwnProperty ( key ) ) {
2406
+ return false ;
2407
+ }
2408
+ if ( typeof schema [ key ] === 'object' ) {
2409
+ if ( ! validateObject ( obj [ key ] , schema [ key ] ) ) {
2410
+ return false ;
2411
+ }
2412
+ } else if ( typeof obj [ key ] !== schema [ key ] ) {
2413
+ return false ;
2414
+ }
2415
+ }
2416
+ return true ;
2417
+ } ;
2394
2418
if ( ! query || typeof query !== 'object' || Array . isArray ( query ) ) {
2395
2419
return false ;
2396
2420
}
2397
- if ( ! query || ! Array . isArray ( query . $or ) ) {
2421
+ if ( ! query . $or || ! Array . isArray ( query . $or ) ) {
2398
2422
return false ;
2399
2423
}
2400
2424
for ( const item of query . $or ) {
2401
- if (
2402
- typeof item . _content_type_uid !== 'string' ||
2403
- typeof item . uid !== 'string' ||
2404
- ( item . _version && typeof item . _version . $exists !== 'boolean' ) ||
2405
- ( item . locale && typeof item . locale !== 'string' )
2406
- ) {
2425
+ if ( ! validateObject ( item , allowedKeys ) ) {
2407
2426
return false ;
2408
2427
}
2409
2428
}
You can’t perform that action at this time.
0 commit comments