@boltic/cli 1.0.6-beta.1 → 1.0.6-beta.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.
@@ -8,7 +8,8 @@
8
8
  "Bash(npx jest:*)",
9
9
  "Bash(rm:*)",
10
10
  "Bash(grep:*)",
11
- "Bash(touch:*)"
11
+ "Bash(touch:*)",
12
+ "Bash(npm run lint)"
12
13
  ],
13
14
  "deny": []
14
15
  }
package/cli.js CHANGED
@@ -114,7 +114,7 @@ async function showHelp(commands) {
114
114
  packageJson = JSON.parse(
115
115
  fs.readFileSync(path.join(process.cwd(), "package.json"))
116
116
  );
117
- } catch (_) {
117
+ } catch {
118
118
  // Fallback version if package.json not found
119
119
  packageJson = { version: "1.0.0" };
120
120
  }
@@ -141,17 +141,25 @@ async function handleEnvironment(args) {
141
141
  }
142
142
 
143
143
  async function showVersion() {
144
- let packageJson;
144
+ let version = "1.0.0"; // default fallback
145
145
  try {
146
- // Try to read package.json from current directory
147
- packageJson = JSON.parse(
148
- fs.readFileSync(path.join(process.cwd(), "package.json"))
146
+ let packageJsonPath;
147
+ if (typeof import.meta !== "undefined" && import.meta.url) {
148
+ // ES modules in Node.js
149
+ const currentDir = path.dirname(new URL(import.meta.url).pathname);
150
+ packageJsonPath = path.join(currentDir, "package.json");
151
+ } else {
152
+ // Jest or other environments
153
+ packageJsonPath = path.join(process.cwd(), "package.json");
154
+ }
155
+
156
+ const packageJson = JSON.parse(
157
+ fs.readFileSync(packageJsonPath, "utf-8")
149
158
  );
150
- } catch (_) {
151
- // Fallback version if package.json not found
152
- packageJson = { version: "1.0.0" };
159
+ version = packageJson.version;
160
+ } catch {
161
+ // fallback already defined
153
162
  }
154
- const version = packageJson.version;
155
163
  console.log(`Boltic CLI Version: ${version}`);
156
164
  }
157
165
 
@@ -638,7 +638,12 @@ async function handleEdit() {
638
638
  const choices =
639
639
  integrations
640
640
  .filter((integration) =>
641
- ["customActivity", "CloudTrigger"].includes(
641
+ [
642
+ "customActivity",
643
+ "CloudTrigger",
644
+ "applicationFdkActivity",
645
+ "platformFdkActivity",
646
+ ].includes(
642
647
  integration.activity_type || integration.trigger_type
643
648
  )
644
649
  )
@@ -793,7 +798,12 @@ async function handlePull(args) {
793
798
  const choices =
794
799
  integrations
795
800
  .filter((integration) =>
796
- ["customActivity", "CloudTrigger"].includes(
801
+ [
802
+ "customActivity",
803
+ "CloudTrigger",
804
+ "applicationFdkActivity",
805
+ "platformFdkActivity",
806
+ ].includes(
797
807
  integration.activity_type ||
798
808
  integration.trigger_type
799
809
  )
@@ -899,7 +909,12 @@ async function handleStatus() {
899
909
  const choices =
900
910
  integrations
901
911
  .filter((integration) =>
902
- ["customActivity", "CloudTrigger"].includes(
912
+ [
913
+ "customActivity",
914
+ "CloudTrigger",
915
+ "applicationFdkActivity",
916
+ "platformFdkActivity",
917
+ ].includes(
903
918
  integration.activity_type || integration.trigger_type
904
919
  )
905
920
  )
package/commands/login.js CHANGED
@@ -40,7 +40,7 @@ function showHelp() {
40
40
  }
41
41
 
42
42
  // Handle login command
43
- async function handleLogin(args) {
43
+ async function handleLogin() {
44
44
  const { apiUrl, loginUrl, clientId, frontendUrl, name } =
45
45
  await getCurrentEnv();
46
46
 
package/helper/env.js CHANGED
@@ -11,7 +11,7 @@ export const getCurrentEnv = async () => {
11
11
 
12
12
  try {
13
13
  secrets = await getAllSecrets();
14
- } catch (_) {
14
+ } catch {
15
15
  // If getAllSecrets fails, use default bolt environment
16
16
  secrets = null;
17
17
  }
@@ -154,6 +154,23 @@ const validateResources = (resourcesDir, resourceFields, errors) => {
154
154
  });
155
155
  };
156
156
 
157
+ // const validateParametersScema = (schema, errors) => {
158
+ // if (!schema || !Array.isArray(schema.parameters)) {
159
+ // errors.add(
160
+ // `Schema is missing or parameters are not defined as an array.`
161
+ // );
162
+ // return;
163
+ // }
164
+ // schema.parameters.forEach((param) => {
165
+ // const { meta } = param;
166
+ // if (!param.name) {
167
+ // errors.add(
168
+ // `Parameter in schema is missing a name. Ensure all parameters have a "name" field.`
169
+ // );
170
+ // }
171
+ // });
172
+ // };
173
+
157
174
  // ─────────────────────────────────────────────────────────────────────────────
158
175
  // MAIN FUNCTION
159
176
  // ─────────────────────────────────────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boltic/cli",
3
- "version": "1.0.6-beta.1",
3
+ "version": "1.0.6-beta.2",
4
4
  "description": "A powerful CLI tool for managing Boltic Workflow integrations",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -12,7 +12,8 @@
12
12
  "start": "node index.js",
13
13
  "dev": "nodemon index.js",
14
14
  "test": "jest",
15
- "prepare": "husky"
15
+ "prepare": "husky",
16
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
16
17
  },
17
18
  "keywords": [
18
19
  "cli",
@@ -39,7 +39,7 @@ async function pickSvgFile() {
39
39
  console.error("Unsupported platform for file picker");
40
40
  return null;
41
41
  }
42
- } catch (_) {
42
+ } catch {
43
43
  return null;
44
44
  }
45
45
  }