@contentstack/datasync-manager 1.2.2 → 1.2.3

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,68 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ pull_request:
16
+ # The branches below must be a subset of the branches above
17
+ branches: '*'
18
+
19
+ jobs:
20
+ analyze:
21
+ name: Analyze
22
+ runs-on: ubuntu-latest
23
+ permissions:
24
+ actions: read
25
+ contents: read
26
+ security-events: write
27
+
28
+ strategy:
29
+ fail-fast: false
30
+ matrix:
31
+ language: [ 'javascript' ]
32
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
33
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
34
+
35
+ steps:
36
+ - name: Checkout repository
37
+ uses: actions/checkout@v3
38
+
39
+ # Initializes the CodeQL tools for scanning.
40
+ - name: Initialize CodeQL
41
+ uses: github/codeql-action/init@v2
42
+ with:
43
+ languages: ${{ matrix.language }}
44
+ # If you wish to specify custom queries, you can do so here or in a config file.
45
+ # By default, queries listed here will override any specified in a config file.
46
+ # Prefix the list here with "+" to use these queries and those in the config file.
47
+
48
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
49
+ # queries: security-extended,security-and-quality
50
+
51
+
52
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
53
+ # If this step fails, then you should remove it and run the build manually (see below)
54
+ - name: Autobuild
55
+ uses: github/codeql-action/autobuild@v2
56
+
57
+ # ℹ️ Command-line programs to run using the OS shell.
58
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
59
+
60
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
61
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
62
+
63
+ # - run: |
64
+ # echo "Run, Build Application using script"
65
+ # ./location_of_script_within_repo/buildscript.sh
66
+
67
+ - name: Perform CodeQL Analysis
68
+ uses: github/codeql-action/analyze@v2
@@ -0,0 +1,27 @@
1
+ name: Create JIRA ISSUE
2
+ on:
3
+ pull_request:
4
+ types: [opened]
5
+ jobs:
6
+ security:
7
+ if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'snyk-bot' || contains(github.event.pull_request.head.ref, 'snyk-fix-') || contains(github.event.pull_request.head.ref, 'snyk-upgrade-')}}
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - name: Login into JIRA
12
+ uses: atlassian/gajira-login@master
13
+ env:
14
+ JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
15
+ JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
16
+ JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
17
+ - name: Create a JIRA Issue
18
+ id: create
19
+ uses: atlassian/gajira-create@master
20
+ with:
21
+ project: ${{ secrets.JIRA_PROJECT }}
22
+ issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
23
+ summary: |
24
+ ${{ github.event.pull_request.title }}
25
+ description: |
26
+ PR: ${{ github.event.pull_request.html_url }}
27
+
@@ -0,0 +1,11 @@
1
+ name: SAST Scan
2
+ on:
3
+ pull_request:
4
+ types: [opened, synchronize, reopened]
5
+ jobs:
6
+ security:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Horusec Scan
11
+ run: docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/src horuszup/horusec-cli:latest horusec start -p /src -P $(pwd)
@@ -0,0 +1,15 @@
1
+ name: Source Composition Analysis Scan
2
+ on:
3
+ pull_request:
4
+ types: [opened, synchronize, reopened]
5
+ jobs:
6
+ security:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@master
10
+ - name: Run Snyk to check for vulnerabilities
11
+ uses: snyk/actions/node@master
12
+ env:
13
+ SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
14
+ with:
15
+ args: --all-projects
@@ -0,0 +1,11 @@
1
+ name: Secrets Scan
2
+ on:
3
+ pull_request:
4
+ types: [opened, synchronize, reopened]
5
+ jobs:
6
+ security:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Gittyleaks
11
+ uses: gupy-io/gittyleaks-action@v0.1
package/.talismanrc CHANGED
@@ -1,4 +1,4 @@
1
1
  fileignoreconfig:
2
2
  - filename: package-lock.json
3
- checksum: 76a27656058da49643e4472f06eb6e9d4418f4192f07089d47afcdb59afedd14
3
+ checksum: c95ab8723f7a15c72d1e6f2f6b2eb173ce46b14e4bcd864cc47119b60e1866de
4
4
  version: ""
package/CODEOWNERS CHANGED
@@ -1 +1 @@
1
- * @contentstack/security-admin @contentstack/ecosystem-admin
1
+ * @contentstack/security-admin @contentstack/cli-admin
package/dist/core/inet.js CHANGED
@@ -65,10 +65,7 @@ exports.checkNetConnectivity = () => {
65
65
  });
66
66
  };
67
67
  exports.netConnectivityIssues = (error) => {
68
- if (error.code === 'ENOTFOUND') {
69
- return true;
70
- }
71
- else if (error.code === 'ETIMEDOUT') {
68
+ if (error.code === 'ENOTFOUND' || error.code === 'ETIMEDOUT') {
72
69
  return true;
73
70
  }
74
71
  return false;
package/dist/core/q.js CHANGED
@@ -142,17 +142,7 @@ class Q extends events_1.EventEmitter {
142
142
  */
143
143
  process(data) {
144
144
  notify(data._type, data);
145
- switch (data._type) {
146
- case 'publish':
147
- this.exec(data, data._type);
148
- break;
149
- case 'unpublish':
150
- this.exec(data, data._type);
151
- break;
152
- default:
153
- this.exec(data, data._type);
154
- break;
155
- }
145
+ this.exec(data, data._type);
156
146
  }
157
147
  /**
158
148
  * @description Execute and manager current processing item. Calling 'before' and 'after' hooks appropriately
@@ -57,7 +57,7 @@ exports.buildReferencePaths = (schema, entryReferences = {}, assetReferences = {
57
57
  this.buildReferencePaths(field.schema, entryReferences, assetReferences, ((parent) ? `${parent}.${field.uid}` : field.uid));
58
58
  }
59
59
  else if (field.data_type === fieldType.BLOCKS && Array.isArray(field.blocks)) {
60
- const blockParent = ((parent)) ? `${parent}.${field.uid}` : `${field.uid}`;
60
+ const blockParent = parent ? `${parent}.${field.uid}` : `${field.uid}`;
61
61
  field.blocks.forEach((block) => {
62
62
  if (block && block.schema && Array.isArray(block.schema)) {
63
63
  let subBlockParent = `${blockParent}.${block.uid}`;
@@ -3,7 +3,6 @@ const helper = require('../helper');
3
3
  const index = require('../../index');
4
4
  const util = require('../../util/index');
5
5
  module.exports = function SaveRteMarkdownAssets() {
6
- const options = SaveRteMarkdownAssets.options;
7
6
  SaveRteMarkdownAssets.beforeSync = (action, data, schema) => {
8
7
  return new Promise((resolve, reject) => {
9
8
  try {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  const helper = require('../helper');
3
3
  module.exports = function TransformEntries() {
4
- const options = TransformEntries.options;
5
4
  TransformEntries.beforeSync = (action, data, schema) => {
6
5
  return new Promise((resolve, reject) => {
7
6
  try {
@@ -260,7 +260,7 @@ const findAssets = (parentEntry, key, schema, entry, bucket, isFindNotReplace) =
260
260
  let matches;
261
261
  let convertedText;
262
262
  if (isMarkdown) {
263
- convertedText = marked_1.default(entry);
263
+ convertedText = marked_1.default.marked(entry);
264
264
  }
265
265
  else {
266
266
  convertedText = entry;
@@ -312,7 +312,7 @@ const iterate = (schema, entry, bucket, findNoteReplace, parentKeys) => {
312
312
  const parentKey = parentKeys[index];
313
313
  const subEntry = entry[parentKey];
314
314
  if (subEntry && !(lodash_1.isEmpty(subEntry)) && index === (parentKeys.length - 1)) {
315
- if (subEntry && subEntry instanceof Array && subEntry.length) {
315
+ if (subEntry && subEntry.length) {
316
316
  subEntry.forEach((subEntryItem, idx) => {
317
317
  // tricky!
318
318
  if (!(lodash_1.isEmpty(subEntryItem))) {
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@contentstack/datasync-manager",
3
3
  "author": "Contentstack LLC <support@contentstack.com>",
4
- "version": "1.2.2",
4
+ "version": "1.2.3",
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
- "debug": "4.1.1",
9
- "dns-socket": "4.2.0",
8
+ "debug": "^4.3.4",
9
+ "dns-socket": "^4.2.2",
10
10
  "lodash": "^4.17.21",
11
- "marked": "^2.1.3",
12
- "write-file-atomic": "2.4.2"
11
+ "marked": "^4.1.0",
12
+ "write-file-atomic": "4.0.2"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@semantic-release/commit-analyzer": "^9.0.2",
@@ -19,21 +19,22 @@
19
19
  "@types/debug": "0.0.31",
20
20
  "@types/jest": "23.3.11",
21
21
  "@types/lodash": "4.14.119",
22
+ "@types/marked": "^4.0.7",
22
23
  "@types/mkdirp": "0.5.2",
23
24
  "@types/nock": "9.3.0",
24
25
  "@types/node": "10.12.12",
25
26
  "@types/rimraf": "2.0.2",
26
27
  "@types/write-file-atomic": "2.1.1",
27
28
  "eslint": "^8.14.0",
28
- "jest": "24.8.0",
29
+ "jest": "^29.0.3",
29
30
  "jest-html-reporter": "^2.5.0",
30
- "mkdirp": "0.5.1",
31
- "nock": "10.0.6",
32
- "rimraf": "2.6.2",
33
- "semantic-release": "^19.0.2",
34
- "ts-jest": "24.0.2",
35
- "tslint": "5.18.0",
36
- "typescript": "3.5.2"
31
+ "mkdirp": "^1.0.4",
32
+ "nock": "^10.0.6",
33
+ "rimraf": "^2.6.2",
34
+ "semantic-release": "^19.0.5",
35
+ "ts-jest": "^29.0.1",
36
+ "tslint": "^5.18.0",
37
+ "typescript": "^3.5.2"
37
38
  },
38
39
  "scripts": {
39
40
  "clean": "rimraf dist typings coverage .tokens .ledger .checkpoint",
@@ -65,4 +66,4 @@
65
66
  "url": "https://github.com/contentstack/datasync-manager/issues"
66
67
  },
67
68
  "homepage": "https://www.contentstack.com/docs/guide/synchronization/contentstack-datasync"
68
- }
69
+ }
@@ -1,5 +1,4 @@
1
1
  module.exports = function Myplugin1 () {
2
- const options = Myplugin1.options
3
2
 
4
3
  Myplugin1.beforeSync = (action, data, schema) => {
5
4
  return new Promise((resolve) => {
@@ -1,5 +1,4 @@
1
1
  module.exports = function Myplugin1 () {
2
- const options = Myplugin1.options
3
2
 
4
3
  Myplugin1.beforeSync = (action, data, schema) => {
5
4
  return new Promise((resolve) => {