@contentstack/datasync-manager 1.1.0 → 1.2.2

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,53 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ jobs:
7
+ build:
8
+ name: Build and upload
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout
12
+ uses: actions/checkout@v2
13
+ with:
14
+ fetch-depth: 0
15
+ - name: Setup Node.js
16
+ uses: actions/setup-node@v1
17
+ with:
18
+ node-version: 12
19
+ - name: Install dependencies
20
+ run: npm install
21
+ - name: Build
22
+ run: npm run build-ts
23
+ - name: Upload dist
24
+ uses: actions/upload-artifact@v3
25
+ with:
26
+ name: dist
27
+ path: dist
28
+
29
+ release:
30
+ name: Download dist and release
31
+ runs-on: ubuntu-latest
32
+ needs: build
33
+ steps:
34
+ - name: Checkout
35
+ uses: actions/checkout@v2
36
+ with:
37
+ fetch-depth: 0
38
+ - name: Setup Node.js
39
+ uses: actions/setup-node@v1
40
+ with:
41
+ node-version: 12
42
+ - name: Install dependencies
43
+ run: npm install
44
+ - name: Download dist
45
+ uses: actions/download-artifact@v3
46
+ with:
47
+ name: dist
48
+ run: ls dist
49
+ - name: Release
50
+ env:
51
+ GH_TOKEN: ${{ secrets.GH_TOKEN }}
52
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53
+ run: npx semantic-release
package/.releaserc ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "branches": ["master"],
3
+ "plugins": [
4
+ "@semantic-release/commit-analyzer",
5
+ "@semantic-release/release-notes-generator",
6
+ "@semantic-release/npm",
7
+ "@semantic-release/git"
8
+ ]
9
+ }
package/.talismanrc ADDED
@@ -0,0 +1,4 @@
1
+ fileignoreconfig:
2
+ - filename: package-lock.json
3
+ checksum: 76a27656058da49643e4472f06eb6e9d4418f4192f07089d47afcdb59afedd14
4
+ version: ""
package/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @contentstack/security-admin @contentstack/ecosystem-admin
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2019 Contentstack LLC <https://www.contentstack.com/>
3
+ Copyright (c) 2022 Contentstack LLC <https://www.contentstack.com/>
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
package/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/)
@@ -127,7 +127,7 @@ exports.hasRteOrMarkdown = (schema) => {
127
127
  continue;
128
128
  }
129
129
  else if (field && field.data_type === fieldType.BLOCKS && field.blocks) {
130
- for (let x = 0, y = field.blocks; x < y; x++) {
130
+ for (let x = 0, y = field.blocks.length; x < y; x++) {
131
131
  if (this.hasRteOrMarkdown(field.blocks[x].schema)) {
132
132
  return true;
133
133
  }
@@ -166,7 +166,7 @@ const checkReferences = (schema, key) => {
166
166
  continue;
167
167
  }
168
168
  else if (field && field.data_type === fieldType.BLOCKS && field.blocks) {
169
- for (let x = 0, y = field.blocks; x < y; x++) {
169
+ for (let x = 0, y = field.blocks.length; x < y; x++) {
170
170
  if (checkReferences(field.blocks[x].schema, key)) {
171
171
  return true;
172
172
  }
package/package.json CHANGED
@@ -1,17 +1,21 @@
1
1
  {
2
2
  "name": "@contentstack/datasync-manager",
3
3
  "author": "Contentstack LLC <support@contentstack.com>",
4
- "version": "1.1.0",
4
+ "version": "1.2.2",
5
5
  "description": "The primary module of Contentstack DataSync. Syncs Contentstack data with your server using Contentstack Sync API",
6
6
  "main": "dist/index.js",
7
7
  "dependencies": {
8
8
  "debug": "4.1.1",
9
9
  "dns-socket": "4.2.0",
10
- "lodash": "4.17.15",
11
- "marked": "0.6.3",
10
+ "lodash": "^4.17.21",
11
+ "marked": "^2.1.3",
12
12
  "write-file-atomic": "2.4.2"
13
13
  },
14
14
  "devDependencies": {
15
+ "@semantic-release/commit-analyzer": "^9.0.2",
16
+ "@semantic-release/git": "^10.0.1",
17
+ "@semantic-release/npm": "^9.0.1",
18
+ "@semantic-release/release-notes-generator": "^10.0.3",
15
19
  "@types/debug": "0.0.31",
16
20
  "@types/jest": "23.3.11",
17
21
  "@types/lodash": "4.14.119",
@@ -20,11 +24,13 @@
20
24
  "@types/node": "10.12.12",
21
25
  "@types/rimraf": "2.0.2",
22
26
  "@types/write-file-atomic": "2.1.1",
27
+ "eslint": "^8.14.0",
23
28
  "jest": "24.8.0",
24
29
  "jest-html-reporter": "^2.5.0",
25
30
  "mkdirp": "0.5.1",
26
31
  "nock": "10.0.6",
27
32
  "rimraf": "2.6.2",
33
+ "semantic-release": "^19.0.2",
28
34
  "ts-jest": "24.0.2",
29
35
  "tslint": "5.18.0",
30
36
  "typescript": "3.5.2"
@@ -37,7 +43,9 @@
37
43
  "prepare": "npm run compile",
38
44
  "start": "dist",
39
45
  "tslint": "npx tslint -c tslint.json 'src/**/*.ts' --fix",
40
- "test": "PLUGIN_PATH=./test/dummy jest --colors --coverage --verbose"
46
+ "test": "PLUGIN_PATH=./test/dummy jest --colors --coverage --verbose",
47
+ "lint": "eslint",
48
+ "semantic-release": "semantic-release"
41
49
  },
42
50
  "engines": {
43
51
  "node": ">=8"