@boltic/cli 1.0.10 → 1.0.12

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.
package/package.json CHANGED
@@ -1,35 +1,89 @@
1
1
  {
2
2
  "name": "@boltic/cli",
3
- "version": "1.0.10",
4
- "description": "A powerful CLI tool for managing Boltic Workflow integrations",
3
+ "version": "1.0.12",
4
+ "description": "A powerful CLI tool for managing Boltic Workflow integrations - create, sync, test, and publish integrations with ease",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "boltic": "index.js"
8
8
  },
9
- "author": "Ahmed Sakri <ahmedsakri@gofynd.com>",
9
+ "engines": {
10
+ "node": ">=18.0.0",
11
+ "npm": ">=8.0.0"
12
+ },
13
+ "files": [
14
+ "index.js",
15
+ "cli.js",
16
+ "commands/",
17
+ "api/",
18
+ "helper/",
19
+ "utils/",
20
+ "config/",
21
+ "templates/",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
25
+ "author": {
26
+ "name": "Ahmed Sakri",
27
+ "email": "ahmedsakri@gofynd.com",
28
+ "url": "https://github.com/ahmedsakri"
29
+ },
30
+ "contributors": [
31
+ {
32
+ "name": "Boltic Team",
33
+ "url": "https://www.boltic.io"
34
+ }
35
+ ],
10
36
  "repository": {
11
37
  "type": "git",
12
- "url": "https://github.com/bolticio/cli.git"
38
+ "url": "https://github.com/bolticio/cli.git",
39
+ "directory": "."
13
40
  },
14
41
  "homepage": "https://github.com/bolticio/cli#readme",
15
42
  "bugs": {
16
- "url": "https://github.com/bolticio/cli/issues"
43
+ "url": "https://github.com/bolticio/cli/issues",
44
+ "email": "support@boltic.io"
17
45
  },
46
+ "funding": [
47
+ {
48
+ "type": "github",
49
+ "url": "https://github.com/sponsors/bolticio"
50
+ }
51
+ ],
18
52
  "scripts": {
19
53
  "start": "node index.js",
20
54
  "dev": "nodemon index.js",
21
55
  "test": "jest",
56
+ "test:watch": "jest --watch",
57
+ "test:coverage": "jest --coverage",
22
58
  "prepare": "husky",
23
- "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
59
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
60
+ "lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
61
+ "format": "prettier --write .",
62
+ "format:check": "prettier --check .",
63
+ "preversion": "npm run lint && npm run test",
64
+ "postversion": "git push && git push --tags",
65
+ "prepublishOnly": "npm run lint && npm run test"
24
66
  },
25
67
  "keywords": [
26
68
  "cli",
27
69
  "boltic",
28
- "developer-tools",
29
- "integration",
30
70
  "workflow",
71
+ "integration",
31
72
  "automation",
32
- "fynd"
73
+ "developer-tools",
74
+ "fynd",
75
+ "integration-builder",
76
+ "workflow-automation",
77
+ "api-integration",
78
+ "no-code",
79
+ "low-code",
80
+ "enterprise",
81
+ "saas",
82
+ "productivity",
83
+ "development-tools",
84
+ "command-line",
85
+ "javascript",
86
+ "nodejs"
33
87
  ],
34
88
  "license": "ISC",
35
89
  "type": "module",
@@ -37,6 +91,24 @@
37
91
  "access": "public",
38
92
  "registry": "https://registry.npmjs.org/"
39
93
  },
94
+ "badges": {
95
+ "npm": "https://img.shields.io/npm/v/@boltic/cli",
96
+ "downloads": "https://img.shields.io/npm/dm/@boltic/cli",
97
+ "license": "https://img.shields.io/npm/l/@boltic/cli",
98
+ "build": "https://github.com/bolticio/cli/actions/workflows/npm-publish.yml/badge.svg",
99
+ "coverage": "https://img.shields.io/codecov/c/github/bolticio/cli"
100
+ },
101
+ "social": {
102
+ "website": "https://boltic.io",
103
+ "documentation": "https://docs.boltic.io",
104
+ "twitter": "https://twitter.com/bolticHQ",
105
+ "blog": "https://boltic.io/blog"
106
+ },
107
+ "config": {
108
+ "commitizen": {
109
+ "path": "./node_modules/cz-conventional-changelog"
110
+ }
111
+ },
40
112
  "dependencies": {
41
113
  "@inquirer/prompts": "^7.3.2",
42
114
  "axios": "^1.8.2",
@@ -62,5 +134,17 @@
62
134
  "lint-staged": "^15.4.3",
63
135
  "nodemon": "^3.1.9",
64
136
  "prettier": "^3.5.3"
65
- }
137
+ },
138
+ "peerDependencies": {
139
+ "node": ">=18.0.0"
140
+ },
141
+ "os": [
142
+ "darwin",
143
+ "linux",
144
+ "win32"
145
+ ],
146
+ "cpu": [
147
+ "x64",
148
+ "arm64"
149
+ ]
66
150
  }
@@ -110,6 +110,7 @@ const select = {
110
110
  url: "/api/options",
111
111
  labelKey: "label",
112
112
  valueKey: "value",
113
+ condition: "{{sample-condition}}",
113
114
  body: {
114
115
  secret: "secret",
115
116
  loadOptionsMethod: "get",
@@ -199,6 +200,7 @@ const autocomplete = {
199
200
  url: "/api/autocomplete",
200
201
  labelKey: "label",
201
202
  valueKey: "value",
203
+ condition: "{{sample-condition}}",
202
204
  body: {},
203
205
  multiple: false,
204
206
  limitTags: 3,
@@ -675,6 +677,7 @@ const multiselect = {
675
677
  url: "/api/options",
676
678
  labelKey: "label",
677
679
  valueKey: "value",
680
+ condition: "{{sample-condition}}",
678
681
  body: {},
679
682
  },
680
683
  validation: {
@@ -785,21 +788,10 @@ const multitext = {
785
788
  displayName: "Name",
786
789
  displayType: "multitext",
787
790
  description: "Multiple field container",
791
+ placeholder: "Enter text",
788
792
  value: [],
789
793
  readOnly: false,
790
794
  isDisabled: false,
791
- children: [
792
- {
793
- name: "field1",
794
- meta: {
795
- displayType: "text",
796
- displayName: "Field 1",
797
- validation: {
798
- required: true,
799
- },
800
- },
801
- },
802
- ],
803
795
  htmlProps: {
804
796
  allowAdd: true,
805
797
  allowRemove: true,
@@ -1 +0,0 @@
1
- # Ahmed_Test_Cases_Test Authentication
@@ -1 +0,0 @@
1
- # Ahmed_Test_Cases_Test Documentation
@@ -1,45 +0,0 @@
1
- {
2
- "parameters": [
3
- {
4
- "name": "type",
5
- "meta": {
6
- "displayName": "Authentication Type",
7
- "displayType": "select",
8
- "placeholder": "Select an authentication type",
9
- "description": "Choose the type of authentication you want to use.",
10
- "options": [
11
- {
12
- "label": "API Key",
13
- "value": "api_key"
14
- }
15
- ],
16
- "value": "api_key",
17
- "validation": {
18
- "required": true,
19
- "requiredDetail": {
20
- "errorMsg": "Authentication type is required"
21
- }
22
- }
23
- }
24
- }
25
- ],
26
- "api_key": {
27
- "parameters": [
28
- {
29
- "name": "api_key",
30
- "meta": {
31
- "displayName": "API Key",
32
- "displayType": "password",
33
- "placeholder": "Enter API Key",
34
- "description": "Your API key for authentication",
35
- "validation": {
36
- "required": true,
37
- "requiredDetail": {
38
- "errorMsg": "API key is required"
39
- }
40
- }
41
- }
42
- }
43
- ]
44
- }
45
- }
@@ -1,56 +0,0 @@
1
- {
2
- "parameters": [
3
- {
4
- "name": "secret",
5
- "meta": {
6
- "displayName": "Service Account",
7
- "displayType": "autocomplete",
8
- "placeholder": "Select Service Account",
9
- "description": "Your service account credentials are encrypted & can be removed at any time.",
10
- "options": [],
11
- "config": {
12
- "urlType": "secret",
13
- "method": "get",
14
- "url": "/AHMED_TEST_CASES_TEST?current_page=1&page_size=999",
15
- "labelKey": "name",
16
- "valueKey": "_id"
17
- },
18
- "htmlProps": {
19
- "showAddNew": true
20
- },
21
- "value": "",
22
- "validation": {
23
- "required": true
24
- }
25
- }
26
- },
27
- {
28
- "name": "resource",
29
- "meta": {
30
- "displayName": "Resource",
31
- "displayType": "select",
32
- "placeholder": "Select a resource",
33
- "description": "Select the resource you want to work with.",
34
- "options": [
35
- {
36
- "label": "Resource 1",
37
- "value": "resource1",
38
- "description": "Description for Resource 1"
39
- }
40
- ],
41
- "value": "",
42
- "validation": {
43
- "required": true
44
- },
45
- "dependencies": {
46
- "conditions": [
47
- {
48
- "field": "secret",
49
- "operator": "NOT_EMPTY"
50
- }
51
- ]
52
- }
53
- }
54
- }
55
- ]
56
- }
@@ -1,134 +0,0 @@
1
- {
2
- "parameters": [
3
- {
4
- "name": "operation",
5
- "meta": {
6
- "displayName": "Operation",
7
- "displayType": "select",
8
- "placeholder": "Select an operation",
9
- "description": "Select the operation you want to perform.",
10
- "options": [
11
- {
12
- "label": "Create Account",
13
- "value": "resource1.create",
14
- "description": "Create a new account."
15
- },
16
- {
17
- "label": "Delete Account",
18
- "value": "resource1.delete",
19
- "description": "Delete an existing account."
20
- }
21
- ],
22
- "validation": {
23
- "required": true
24
- },
25
- "dependencies": {
26
- "conditions": [
27
- {
28
- "field": "resource",
29
- "operator": "EQUALS",
30
- "value": "resource1"
31
- }
32
- ]
33
- }
34
- }
35
- }
36
- ],
37
- "create": {
38
- "definition": {
39
- "method": "post",
40
- "url": "https://dummyjson.com/products",
41
- "headers": {
42
- "ContentType": "application/json"
43
- },
44
- "body": "{{parameters}}",
45
- "response": {
46
- "output": "{{response.data}}",
47
- "error": {
48
- "message": "{{response.data.errors.message}}",
49
- "code": "{{response.data.errors.code}}"
50
- }
51
- }
52
- },
53
- "parameters": [
54
- {
55
- "name": "name",
56
- "meta": {
57
- "displayName": "Product Name",
58
- "displayType": "text",
59
- "placeholder": "Enter the name of the product",
60
- "description": "Enter the name of the product you want to create.",
61
- "validation": {
62
- "required": true
63
- }
64
- }
65
- },
66
- {
67
- "name": "description",
68
- "meta": {
69
- "displayName": "Product Description",
70
- "displayType": "text",
71
- "placeholder": "Enter the description of the product",
72
- "description": "Enter the description of the product you want to create.",
73
- "validation": {
74
- "required": true
75
- }
76
- }
77
- },
78
- {
79
- "name": "price",
80
- "meta": {
81
- "displayName": "Product Price",
82
- "displayType": "number",
83
- "placeholder": "Enter the price of the product",
84
- "description": "Enter the price of the product you want to create.",
85
- "validation": {
86
- "required": true
87
- }
88
- }
89
- },
90
- {
91
- "name": "discountPercentage",
92
- "meta": {
93
- "displayName": "Discount Percentage",
94
- "displayType": "number",
95
- "placeholder": "Enter the discount percentage",
96
- "description": "Enter the discount percentage for the product you want to create.",
97
- "validation": {
98
- "required": true
99
- }
100
- }
101
- }
102
- ]
103
- },
104
- "delete": {
105
- "parameters": [
106
- {
107
- "name": "id",
108
- "meta": {
109
- "displayName": "Account ID",
110
- "displayType": "text",
111
- "placeholder": "Enter the Account ID",
112
- "description": "Enter the ID of the account you want to delete.",
113
- "validation": {
114
- "required": true
115
- }
116
- }
117
- }
118
- ],
119
- "definition": {
120
- "method": "delete",
121
- "url": "https://dummyjson.com/products/{{parameters.id}}",
122
- "headers": {
123
- "ContentType": "application/json"
124
- },
125
- "response": {
126
- "output": "{{response.data}}",
127
- "error": {
128
- "message": "{{response.data.errors.message}}",
129
- "code": "{{response.data.errors.code}}"
130
- }
131
- }
132
- }
133
- }
134
- }
@@ -1,17 +0,0 @@
1
- {
2
- "id": "766689c4-e6c9-4adf-8b21-f69c3a281307",
3
- "name": "Ahmed_Test_Cases_Test",
4
- "description": {
5
- "trigger": "",
6
- "integration": "Sample Test Case Integration"
7
- },
8
- "icon": "https://cdn.pixelbin.io/v2/fyndcloud/original/Temporal/Uploads/bolt/e8b51f71-6062-4c30-958e-f87351ed13bf/images/Paddle_1752734761014.svg",
9
- "activity_type": "customActivity",
10
- "trigger_type": null,
11
- "meta": {
12
- "ai_description": {
13
- "trigger": "",
14
- "integration": "Sample AI Test Case Integration"
15
- }
16
- }
17
- }
package/llm.txt DELETED
@@ -1,295 +0,0 @@
1
- # Boltic CLI - Developer Documentation for AI Assistants
2
-
3
- ## Overview
4
- The Boltic CLI is a Node.js command-line interface for managing Boltic Workflow integrations. It provides tools for creating, editing, syncing, and publishing integrations to the Boltic platform.
5
-
6
- **Package**: @boltic/cli
7
- **Repository**: https://github.com/bolticio/cli
8
- **License**: ISC
9
-
10
- ## Core Architecture
11
-
12
- ### Entry Point
13
- - `index.js` - Main entry point and binary executable
14
- - `cli.js` - Core CLI module with command routing and execution
15
-
16
- ### Command Structure
17
- The CLI follows a modular command structure:
18
-
19
- ```
20
- boltic [command] [subcommand] [options]
21
- ```
22
-
23
- ### Main Commands
24
-
25
- #### Authentication Commands (`commands/login.js`)
26
- - `boltic login` - Authenticate with Boltic platform
27
- - `boltic logout` - Clear authentication tokens
28
-
29
- #### Integration Commands (`commands/integration.js`)
30
- - `boltic integration create` - Create new integration
31
- - `boltic integration edit` - Edit existing integration
32
- - `boltic integration sync` - Sync changes to draft
33
- - `boltic integration submit` - Submit for review
34
- - `boltic integration publish` - Submit for review (deprecated, use submit)
35
- - `boltic integration pull` - Pull latest changes
36
- - `boltic integration status` - Show integration details
37
-
38
- #### Environment Commands (`commands/env.js`)
39
- - `boltic env list` - List available environments
40
- - `boltic env set` - Set current environment
41
- - `boltic env show` - Show current environment
42
-
43
- ### API Layer (`api/`)
44
- - `integration.js` - Integration management API calls
45
- - `login.js` - Authentication API calls
46
- - `environment.js` - Environment management API calls
47
-
48
- ### Helper Modules (`helper/`)
49
- - `validation.js` - Schema validation for integrations
50
- - `folder.js` - File system operations for integration folders
51
- - `secure-storage.js` - Secure credential storage using keytar
52
- - `env.js` - Environment configuration management
53
- - `error.js` - Error handling and formatting
54
- - `command-suggestions.js` - Command similarity suggestions
55
- - `verbose.js` - Verbose logging control
56
-
57
- ### Templates (`templates/`)
58
- - `schemas.js` - Schema templates for integrations
59
-
60
- ### Utilities (`utils/`)
61
- - `integration.js` - Integration utility functions
62
-
63
- ## Key Features
64
-
65
- ### Authentication
66
- - OAuth-based authentication with secure token storage
67
- - Multiple environment support (bolt, fcz0, fcz5)
68
- - Automatic token refresh and session management
69
-
70
- ### Integration Management
71
- - **Create**: Interactive creation wizard with prompts for:
72
- - Integration name (letters and underscores only)
73
- - SVG icon upload
74
- - Integration type (Activity, Trigger, or both)
75
- - Descriptions (human and AI-generated)
76
- - Integration group selection
77
- - **Edit**: Modify existing integrations
78
- - **Sync**: Upload changes to draft version
79
- - **Submit**: Submit integration for review
80
- - **Publish**: Submit integration for review (deprecated, use submit)
81
- - **Pull**: Download latest changes from cloud
82
- - **Status**: View integration details and metadata
83
-
84
- ### Validation System
85
- The validation system (`helper/validation.js`) ensures integration schemas are correct:
86
-
87
- #### Required Files
88
- - `Documentation.mdx` - Integration documentation
89
- - `spec.json` - Integration specification
90
- - `schemas/base.json` - Base schema configuration
91
- - `schemas/resources/*.json` - Resource-specific schemas
92
- - `schemas/webhook.json` - Webhook configuration (if trigger_type defined)
93
-
94
- #### Schema Structure
95
- All option objects must include:
96
- - `label` - Human-readable label
97
- - `value` - Machine-readable value
98
- - `description` - Detailed description
99
-
100
- #### Validation Rules
101
- - Resource fields must reference existing resource files
102
- - Operation fields must reference valid operations in resource files
103
- - Operations must have both `parameters` and `definition` properties
104
- - Webhook configuration must match trigger_type in spec.json
105
-
106
- ### Environment Configuration
107
- Three supported environments defined in `config/environments.js`:
108
- - **bolt** (production): console.boltic.io
109
- - **fcz0** (staging): fcz0.de
110
- - **fcz5** (UAT): uat.fcz0.de
111
-
112
- ### File System Operations
113
- - Automatic folder structure creation
114
- - JSON file parsing and validation
115
- - SVG file handling for icons
116
- - Resource file management
117
-
118
- ## Development Workflow
119
-
120
- ### Testing
121
- - **Framework**: Jest with comprehensive test coverage
122
- - **Coverage**: 96.45% statement coverage, 91.68% branch coverage
123
- - **Test Files**: Located in `__tests__/` directory
124
- - **Run Tests**: `npm test`
125
-
126
- ### Code Quality
127
- - **Linting**: ESLint with Prettier integration
128
- - **Pre-commit**: Husky hooks with lint-staged
129
- - **Standards**: ES6+ modules, async/await patterns
130
-
131
- ### Dependencies
132
- **Production**:
133
- - `@inquirer/prompts` - Interactive CLI prompts
134
- - `axios` - HTTP client for API calls
135
- - `chalk` - Terminal string styling
136
- - `keytar` - Secure credential storage
137
- - `open` - Browser launching
138
- - `uuid` - Unique identifier generation
139
- - `lodash.isempty` - Empty value checking
140
-
141
- **Development**:
142
- - `jest` - Testing framework
143
- - `eslint` - Code linting
144
- - `prettier` - Code formatting
145
- - `husky` - Git hooks
146
- - `nodemon` - Development server
147
-
148
- ## Common Patterns
149
-
150
- ### Error Handling
151
- - Centralized error handling in `helper/error.js`
152
- - Axios error interception and formatting
153
- - User-friendly error messages with suggestions
154
-
155
- ### Async Operations
156
- - Consistent async/await usage
157
- - Promise-based API calls
158
- - Proper error propagation
159
-
160
- ### User Interaction
161
- - Interactive prompts using @inquirer/prompts
162
- - Progress indicators for long operations
163
- - Color-coded output using chalk
164
-
165
- ### File Operations
166
- - Safe JSON parsing with error handling
167
- - Atomic file operations
168
- - Directory existence checking
169
-
170
- ## Configuration
171
-
172
- ### Schema Templates
173
- Integration schemas are generated from templates in `templates/schemas.js`:
174
- - **Authentication**: API key-based authentication
175
- - **Base**: Core integration configuration
176
- - **Webhook**: Trigger configuration
177
- - **Resource**: Resource-specific operations
178
-
179
- ### Environment Variables
180
- - Environment selection stored in secure storage
181
- - API endpoints configured per environment
182
- - OAuth client IDs per environment
183
-
184
- ## Security Considerations
185
-
186
- ### Credential Storage
187
- - Secure token storage using keytar (OS keychain)
188
- - No plaintext credential storage
189
- - Automatic token cleanup on logout
190
-
191
- ### API Security
192
- - OAuth 2.0 authentication flow
193
- - Bearer token authentication
194
- - Environment-specific API endpoints
195
-
196
- ### Input Validation
197
- - Schema validation for all integration files
198
- - SVG file validation for icons
199
- - Input sanitization for user prompts
200
-
201
- ## Troubleshooting
202
-
203
- ### Common Issues
204
- 1. **Authentication Errors**: Check network connectivity and credentials
205
- 2. **Validation Errors**: Ensure all required schema fields are present
206
- 3. **File System Errors**: Verify file permissions and paths
207
- 4. **API Errors**: Check environment configuration and network
208
-
209
- ### Debug Mode
210
- Use `--verbose` flag for detailed logging:
211
- ```bash
212
- boltic --verbose integration create
213
- ```
214
-
215
- ### Log Files
216
- - API calls logged in verbose mode
217
- - Error stack traces available in debug mode
218
- - Progress indicators for long operations
219
-
220
- ## Contributing
221
-
222
- ### Code Style
223
- - ES6+ modules with import/export
224
- - Async/await for asynchronous operations
225
- - Functional programming patterns where applicable
226
- - Comprehensive error handling
227
-
228
- ### Testing Requirements
229
- - Unit tests for all new features
230
- - Integration tests for API calls
231
- - Mocking external dependencies
232
- - Minimum 95% code coverage
233
-
234
- ### Documentation
235
- - JSDoc comments for complex functions
236
- - README updates for new features
237
- - Schema documentation for integration formats
238
- - API documentation for external integrations
239
-
240
- ## Integration Schema Format
241
-
242
- ### Base Schema Structure
243
- ```json
244
- {
245
- "parameters": [
246
- {
247
- "name": "resource",
248
- "meta": {
249
- "options": [
250
- {
251
- "value": "users",
252
- "label": "Users",
253
- "description": "Manage users"
254
- }
255
- ]
256
- }
257
- }
258
- ]
259
- }
260
- ```
261
-
262
- ### Resource Schema Structure
263
- ```json
264
- {
265
- "parameters": [
266
- {
267
- "name": "operation",
268
- "meta": {
269
- "options": [
270
- {
271
- "value": "users.list",
272
- "label": "List Users",
273
- "description": "List all users"
274
- }
275
- ]
276
- }
277
- }
278
- ],
279
- "list": {
280
- "parameters": [],
281
- "definition": {}
282
- }
283
- }
284
- ```
285
-
286
- ### Spec.json Format
287
- ```json
288
- {
289
- "name": "Integration Name",
290
- "activity_type": "customActivity",
291
- "trigger_type": "webhook" // optional
292
- }
293
- ```
294
-
295
- This documentation provides a comprehensive guide for AI assistants working with the Boltic CLI codebase, covering architecture, features, development practices, and troubleshooting procedures.