@saidulbadhon/jssm-cli 1.8.0 → 1.9.0

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4173,23 +4173,25 @@ async function getProjects(host, apiKey) {
4173
4173
  return apiRequest(url, apiKey);
4174
4174
  }
4175
4175
  async function pushEnvFile(host, apiKey, project, content, filename = ".env") {
4176
- const url = `${host}/projects/${project}/files/push`;
4176
+ const url = `${host}/projects/${encodeURIComponent(project)}/files/push`;
4177
4177
  return apiRequest(url, apiKey, {
4178
4178
  method: "POST",
4179
4179
  body: JSON.stringify({ content, filename })
4180
4180
  });
4181
4181
  }
4182
4182
  async function pullEnvFile(host, apiKey, project, filename = ".env") {
4183
- const url = `${host}/projects/${project}/files/pull?filename=${encodeURIComponent(
4183
+ const url = `${host}/projects/${encodeURIComponent(project)}/files/pull?filename=${encodeURIComponent(
4184
4184
  filename
4185
4185
  )}`;
4186
4186
  const data = await apiRequest(url, apiKey);
4187
4187
  return data.content;
4188
4188
  }
4189
4189
  async function listEnvFiles(host, apiKey, project) {
4190
- const url = `${host}/projects/${project}/files/list`;
4190
+ const url = `${host}/projects/${encodeURIComponent(project)}/files/list`;
4191
4191
  const data = await apiRequest(url, apiKey);
4192
- return data.files;
4192
+ return data.files.map(
4193
+ (file) => typeof file === "string" ? file : file.filename
4194
+ );
4193
4195
  }
4194
4196
 
4195
4197
  // src/utils/repoDetector.ts
@@ -5724,7 +5726,7 @@ async function createToken(args2) {
5724
5726
  );
5725
5727
  try {
5726
5728
  const response = await fetch(
5727
- `${host}/api/projects/${project}/envs/${environment}/tokens`,
5729
+ `${host}/api/projects/${encodeURIComponent(project)}/envs/${encodeURIComponent(environment)}/tokens`,
5728
5730
  {
5729
5731
  method: "POST",
5730
5732
  headers: {
@@ -5800,7 +5802,7 @@ async function listTokens(args2) {
5800
5802
  }
5801
5803
  try {
5802
5804
  const response = await fetch(
5803
- `${host}/api/projects/${project}/envs/${environment}/tokens`,
5805
+ `${host}/api/projects/${encodeURIComponent(project)}/envs/${encodeURIComponent(environment)}/tokens`,
5804
5806
  {
5805
5807
  headers: { Authorization: `Bearer ${auth.token}` }
5806
5808
  }
@@ -5888,7 +5890,7 @@ async function revokeToken(args2) {
5888
5890
  }
5889
5891
  try {
5890
5892
  const response = await fetch(
5891
- `${host}/api/projects/${project}/envs/${environment}/tokens/${tokenId}`,
5893
+ `${host}/api/projects/${encodeURIComponent(project)}/envs/${encodeURIComponent(environment)}/tokens/${encodeURIComponent(tokenId)}`,
5892
5894
  {
5893
5895
  method: "DELETE",
5894
5896
  headers: { Authorization: `Bearer ${auth.token}` }
@@ -5948,7 +5950,7 @@ ${import_chalk.default.bold("Usage in Docker:")}
5948
5950
 
5949
5951
  // src/utils/versionCheck.ts
5950
5952
  var PACKAGE_NAME = "@saidulbadhon/jssm-cli";
5951
- var CURRENT_VERSION = "1.8.0";
5953
+ var CURRENT_VERSION = "1.9.0";
5952
5954
  async function getLatestVersion() {
5953
5955
  try {
5954
5956
  const response = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saidulbadhon/jssm-cli",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "private": false,
5
5
  "description": "CLI for JSSM - Simple environment variable manager",
6
6
  "author": "Saidul Badhon",