From c0e077abadc2cb6a423f817db74043538fca16ee Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 9 Jan 2024 19:19:08 +0530 Subject: [PATCH] sre fixes --- LICENSE | 2 +- README.md | 42 +++++++++++++++++++++++++++++++++++------- package-lock.json | 12 ++++++------ src/messages/index.ts | 3 ++- 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/LICENSE b/LICENSE index a48530c..f99e9ee 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Contentstack +Copyright (c) 2024 Contentstack Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 725e13d..a8e486d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ $ npm install -g @contentstack/apps-cli $ csdx COMMAND running command... $ csdx (--version|-v) -@contentstack/apps-cli/1.0.3 darwin-arm64 node-v20.3.1 +@contentstack/apps-cli/1.0.4 darwin-arm64 node-v20.10.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND @@ -30,6 +30,7 @@ USAGE # Commands +* [`csdx app`](#csdx-app) * [`csdx app:create`](#csdx-appcreate) * [`csdx app:delete`](#csdx-appdelete) * [`csdx app:get`](#csdx-appget) @@ -37,6 +38,33 @@ USAGE * [`csdx app:uninstall`](#csdx-appuninstall) * [`csdx app:update`](#csdx-appupdate) +## `csdx app` + +Apps CLI plugin + +``` +USAGE + $ csdx app + +DESCRIPTION + Apps CLI plugin + +EXAMPLES + $ csdx app:create + + $ csdx app:get + + $ csdx app:update + + $ csdx app:delete + + $ csdx app:install + + $ csdx app:uninstall +``` + +_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.0.4/src/commands/app/index.ts)_ + ## `csdx app:create` Create a new app in Developer Hub and optionally clone a boilerplate locally. @@ -66,7 +94,7 @@ EXAMPLES $ csdx app:create --name App-3 --app-type organization --org -d ./boilerplate -c ./external-config.json ``` -_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.0.3/src/commands/app/create.ts)_ +_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.0.4/src/commands/app/create.ts)_ ## `csdx app:delete` @@ -91,7 +119,7 @@ EXAMPLES $ csdx app:delete --app-uid --org -d ./boilerplate ``` -_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.0.3/src/commands/app/delete.ts)_ +_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.0.4/src/commands/app/delete.ts)_ ## `csdx app:get` @@ -121,7 +149,7 @@ EXAMPLES $ csdx app:get --org --app-uid --app-type organization ``` -_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.0.3/src/commands/app/get.ts)_ +_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.0.4/src/commands/app/get.ts)_ ## `csdx app:install` @@ -147,7 +175,7 @@ EXAMPLES $ csdx app:install --org --app-uid --stack-api-key ``` -_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.0.3/src/commands/app/install.ts)_ +_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.0.4/src/commands/app/install.ts)_ ## `csdx app:uninstall` @@ -174,7 +202,7 @@ EXAMPLES $ csdx app:uninstall --org --app-uid --installation-uid ``` -_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.0.3/src/commands/app/uninstall.ts)_ +_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.0.4/src/commands/app/uninstall.ts)_ ## `csdx app:update` @@ -197,5 +225,5 @@ EXAMPLES $ csdx app:update --app-manifest ./boilerplate/manifest.json ``` -_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.0.3/src/commands/app/update.ts)_ +_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.0.4/src/commands/app/update.ts)_ diff --git a/package-lock.json b/package-lock.json index 4ae65c3..bd687c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5114,9 +5114,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "funding": [ { "type": "individual", @@ -16923,9 +16923,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==" }, "for-each": { "version": "0.3.3", diff --git a/src/messages/index.ts b/src/messages/index.ts index 6e0f533..98d47d9 100644 --- a/src/messages/index.ts +++ b/src/messages/index.ts @@ -122,7 +122,8 @@ const $t = (msg: string, args: Record): 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;