Skip to content

Commit

Permalink
fix: added SRE fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikram Kalta authored and Vikram Kalta committed Oct 31, 2023
1 parent f3b43e0 commit fed04d7
Show file tree
Hide file tree
Showing 15 changed files with 4,120 additions and 5,939 deletions.
8,381 changes: 2,853 additions & 5,528 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-audit",
"version": "1.2.0",
"version": "1.2.1",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand Down Expand Up @@ -38,7 +38,7 @@
"chai": "^4.3.7",
"eslint": "^8.43.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^1.0.3",
"eslint-config-oclif-typescript": "^3.0.8",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"oclif": "^3.10.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/contentstack-audit/src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ function $t(msg: string, args: Record<string, string>): string {
if (!msg) return '';

for (const key of Object.keys(args)) {
msg = msg.replace(new RegExp(`{${key}}`, 'g'), args[key]);
const escapedKey = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
msg = msg.replace(new RegExp(`{${escapedKey}}`, 'g'), args[key]);
}

return msg;
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-auth",
"description": "Contentstack CLI plugin for authentication activities",
"version": "1.3.15",
"version": "1.3.16",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand Down Expand Up @@ -43,7 +43,7 @@
"dotenv": "^16.0.3",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^0.1.0",
"eslint-config-oclif-typescript": "^3.0.8",
"globby": "^10.0.2",
"mocha": "10.1.0",
"nyc": "^15.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bootstrap",
"description": "Bootstrap contentstack apps",
"version": "1.6.0",
"version": "1.6.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand Down Expand Up @@ -33,7 +33,7 @@
"chai": "^4.3.4",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^0.1.0",
"eslint-config-oclif-typescript": "^3.0.8",
"globby": "^10.0.2",
"mocha": "10.1.0",
"nyc": "^15.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-command/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-command",
"description": "Contentstack CLI plugin for configuration",
"version": "1.2.14",
"version": "1.2.15",
"author": "Contentstack",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -30,7 +30,7 @@
"chai": "^4.3.4",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^0.1.0",
"eslint-config-oclif-typescript": "^3.0.8",
"mocha": "10.1.0",
"nyc": "^15.1.0",
"rimraf": "^2.7.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-config",
"description": "Contentstack CLI plugin for configuration",
"version": "1.4.13",
"version": "1.4.14",
"author": "Contentstack",
"scripts": {
"build": "npm run clean && npm run compile",
Expand Down Expand Up @@ -41,7 +41,7 @@
"chai": "^4.3.4",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^0.1.0",
"eslint-config-oclif-typescript": "^3.0.8",
"globby": "^10.0.2",
"mocha": "10.1.0",
"nyc": "^15.1.0",
Expand Down
6 changes: 4 additions & 2 deletions packages/contentstack-import/src/utils/asset-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ export const lookupAssets = function (
assetUrls.forEach(function (assetUrl: any) {
let mappedAssetUrl = mappedAssetUrls[assetUrl];
if (typeof mappedAssetUrl !== 'undefined') {
entry = entry.replace(new RegExp(assetUrl, 'img'), mappedAssetUrl);
const escapedAssetUrl = assetUrl.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
entry = entry.replace(new RegExp(escapedAssetUrl, 'img'), mappedAssetUrl);
matchedUrls.push(mappedAssetUrl);
} else {
unmatchedUrls.push(assetUrl);
Expand All @@ -259,7 +260,8 @@ export const lookupAssets = function (
assetUids.forEach(function (assetUid: any) {
let uid = mappedAssetUids[assetUid];
if (typeof uid !== 'undefined') {
entry = entry.replace(new RegExp(assetUid, 'img'), uid);
const escapedAssetUid = assetUid.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
entry = entry.replace(new RegExp(escapedAssetUid, 'img'), uid);
matchedUids.push(assetUid);
} else {
unmatchedUids.push(assetUid);
Expand Down
3 changes: 2 additions & 1 deletion packages/contentstack-import/src/utils/entries-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ export const lookupEntries = function (
let entry = JSON.stringify(data.entry);
uids.forEach(function (uid: any) {
if (mappedUids.hasOwnProperty(uid)) {
entry = entry.replace(new RegExp(uid, 'img'), mappedUids[uid]);
const escapedUid = uid.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
entry = entry.replace(new RegExp(escapedUid, 'img'), mappedUids[uid]);
mapped.push(uid);
} else {
unmapped.push(uid);
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-launch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-launch",
"version": "1.0.13",
"version": "1.0.14",
"description": "Launch related operations",
"author": "Contentstack CLI",
"bin": {
Expand Down Expand Up @@ -49,7 +49,7 @@
"chai": "^4",
"eslint": "^7.32.0",
"eslint-config-oclif": "^4",
"eslint-config-oclif-typescript": "^1.0.3",
"eslint-config-oclif-typescript": "^3.0.8",
"oclif": "^3.11.3",
"shx": "^0.3.3",
"ts-node": "^10.9.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-seed/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-seed",
"description": "create a Stack from existing content types, entries, assets, etc.",
"version": "1.6.1",
"version": "1.6.2",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand All @@ -25,7 +25,7 @@
"axios": "^1.6.0",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^0.1.0",
"eslint-config-oclif-typescript": "^3.0.8",
"globby": "^10.0.2",
"jest": "^29.4.2",
"oclif": "^3.8.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-utilities",
"version": "1.5.4",
"version": "1.5.5",
"description": "Utilities for contentstack projects",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -68,7 +68,7 @@
"chai": "^4.3.4",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^0.2.0",
"eslint-config-oclif-typescript": "^3.0.8",
"fancy-test": "^2.0.0",
"globby": "^10.0.2",
"mocha": "10.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-utilities/src/auth-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import HttpClient from './http-client';
import configHandler from './config-handler';
import * as ContentstackManagementSDK from '@contentstack/management';
import messageHandler from './message-handler';
const http = require('http');
const https = require('https');
const url = require('url');
import open from 'open';
import {LoggerService} from './logger';
Expand Down Expand Up @@ -117,7 +117,7 @@ class AuthHandler {
async createHTTPServer(): Promise<object> {
return new Promise((resolve, reject) => {
try {
const server = http.createServer((req, res) => {
const server = https.createServer((req, res) => {
const reqURL = req.url;
const queryObject = url.parse(reqURL, true).query;
if (queryObject.code) {
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli",
"description": "Command-line tool (CLI) to interact with Contentstack",
"version": "1.10.0",
"version": "1.10.1",
"author": "Contentstack",
"bin": {
"csdx": "./bin/run"
Expand Down Expand Up @@ -64,7 +64,7 @@
"chai": "^4.3.4",
"eslint": "^8.18.0",
"eslint-config-oclif": "^4.0.0",
"eslint-config-oclif-typescript": "^0.1.0",
"eslint-config-oclif-typescript": "^3.0.8",
"globby": "^10.0.2",
"mocha": "10.1.0",
"nock": "^13.1.0",
Expand Down Expand Up @@ -160,4 +160,4 @@
}
},
"repository": "https://github.com/contentstack/cli"
}
}
Loading

0 comments on commit fed04d7

Please sign in to comment.