campaign-cli 0.7.3 β†’ 0.7.5

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 (3) hide show
  1. package/README.md +32 -194
  2. package/package.json +4 -3
  3. package/src/main.js +2 -1
package/README.md CHANGED
@@ -1,238 +1,76 @@
1
- # Campaign CLI
1
+ **acc, the command line interface for Adobe Campaign developers**
2
2
 
3
- **A command-line interface for ACC (Campaign Classic) developers**
3
+ Save time, reduce risk, and improve code health with `acc`! This CLI tool helps you build on Adobe Campaign Classic platform. It quickly downloads Adobe Campaign **configuration, campaigns and online resources**. You can also use it to automate many common development tasks.
4
4
 
5
- [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
6
- [![Node.js](https://img.shields.io/badge/Node.js-22+-green.svg)](https://nodejs.org)
7
- [![npm](https://img.shields.io/badge/npm-CLI-blue.svg)](https://www.npmjs.com/)
5
+ Full article in the blog post [Getting started with acc](https://myrosblog.com/adobe-campaign/acc-cli-use-cases?utm_campaign=readme)
8
6
 
9
- ## πŸš€ Quick Start
7
+ ## Features
10
8
 
11
- ### Quick usage
9
+ - Download all Marketing content: Campaigns, Deliveries, Web apps, and more!
10
+ - Download all Technical content: Data schemas, Javascript codes & pages, Workflows and more!
11
+ - Replace manual exports with scriptable, auditable, and repeatable operations
12
+ - Decompose sources into codes (JS, HTML, CSS) and metadata (fields @created, @lastModified…)
13
+ - Allow local code checkers, highlighters and linters
14
+ - Work on any instance: local, staging, production ; and any OS: Windows, macOS, Linux
12
15
 
13
- ```bash
14
- acc auth init --host https://instance.com --user username --password --alias staging
15
-
16
- acc instance pull --alias staging
17
- # Downloaded /Administration/Configuration/Form rendering
18
- # Downloaded /Administration/Configuration/Dynamic Javascript pages
19
- ```
16
+ ## πŸš€ Quick Start
20
17
 
21
- ### Quick installation
18
+ ### Quick usage
22
19
 
23
20
  ```bash
24
21
  $ npm install -g campaign-cli
25
- $ acc # check installation
26
- ```
27
-
28
- ### Basic Usage
29
-
30
- Folder structure recommendation, under a local folder, i.e. `Downloads`
31
-
32
- ```bash
33
- /Downloads/
34
- β”œβ”€β”€ campaign-cli/ # Clone of this source code
35
- β”‚
36
- β”œβ”€β”€ instance1-staging/ # Staging Instance 1
37
- β”‚ β”œβ”€β”€ config/ # Instance-specific config => automatically created with acc check
38
- β”‚ β”‚ └── acc.config.json
39
- β”‚ └── Administration/Configuration/ # Downloaded schemas => automatically downloaded with acc pull
40
- β”‚ β”œβ”€β”€ schema1.xml
41
- β”‚ └── schema2.xml
42
- β”‚
43
- └── instance1-production/ # Production Instance 2
44
- β”œβ”€β”€ config/
45
- β”‚ └── acc.config.json
46
- └── Administration/Configuration/
47
- β”œβ”€β”€ schema1.xml
48
- └── schema2.xml
49
- ```
50
-
51
- #### Step 1: Configure an ACC Instance
52
-
53
- ```bash
54
- acc auth init \
55
- --host http://localhost:8080 \
56
- --user admin \
57
- --password admin \
58
- --alias local
59
- ```
60
-
61
- This command:
62
-
63
- - Saves credentials securely in your config store
64
- - Tests the connection to your ACC instance
65
- - Lists available schemas and record counts
66
-
67
- #### Step 2: Pull Data from Your Instance with default configuration
68
-
69
- ```bash
70
- acc instance check --alias local
71
- acc instance pull --alias local
72
- ```
73
-
74
- This command:
75
-
76
- - Creates a local directory structure
77
- - Downloads schema definitions as XML files
78
- - Preserves original naming conventions
79
- - Implements pagination for large datasets
80
22
 
81
- #### Step 2-bis: Pull Data from Your Instance with custom configuration
23
+ $ acc auth init --host https://instance.com --user username --password --alias staging
82
24
 
83
- Create
84
-
85
- ```bash
86
-
87
- ```
88
-
89
- ## πŸ“š Features
90
-
91
- ### Authentication Management
92
-
93
- ```bash
94
- # List all configured instances
95
- acc auth list
96
-
97
- # Troubleshoot IP via https://api.db-ip.com/v2/free/self @see https://opensource.adobe.com/acc-js-sdk/connecting.html
98
- acc auth ip
99
-
100
- # Login to an existing instance
101
- acc auth login --alias prod
102
-
103
- # Initialize a new instance
104
- acc auth init --alias staging --host https://staging.example.com
105
- ```
106
-
107
- ### Data Operations
108
-
109
- ```bash
110
- # Check instance (count records without downloading)
111
- acc instance check --alias prod
112
-
113
- # Pull data with custom config
114
- acc instance pull \
115
- --alias prod \
116
- --path ./my-project/data \
117
- --config ./config/acc.config.json
118
- ```
119
-
120
- ### Configuration Management
121
-
122
- Create a `acc.config.json` file to customize data pulling:
123
-
124
- ```json
125
- {
126
- "nms:delivery": {
127
- "filename": "Deliveries/{%name%}.xml",
128
- "queryDef": {
129
- "where": {
130
- "condition": [{ "expr": "@builtIn = false AND @isModel = true" }]
131
- }
132
- }
133
- }
134
- }
135
- ```
136
-
137
- ## 🎯 Use Cases
138
-
139
- ### For ACC Developers
140
-
141
- ```bash
142
- # Setup development environment
143
- acc auth init --alias dev --host http://localhost:8080
144
-
145
- # Pull specific schemas
146
- acc instance pull --alias dev
147
-
148
- # Regular data refresh
149
- acc instance pull --alias prod --path ./backup/$(date +%Y-%m-%d)
150
- ```
151
-
152
- ### For DevOps Teams
153
-
154
- ```bash
155
- # CI/CD integration
156
- acc auth init --alias ci --host $ACC_HOST --user $ACC_USER --password $ACC_PASSWORD
157
- acc instance check --alias ci || exit 1
158
-
159
- # Automated backups
160
- acc instance pull --alias prod --path /backups/acc/$(date +%Y-%m-%d)
161
- ```
162
-
163
- ### For Data Analysts
164
-
165
- ```bash
166
- # Quick data extraction
167
- acc instance pull --alias analytics --config ./config/analytics.config.json
168
-
169
- # Schema documentation
170
- acc instance check --alias prod > schema_report.txt
171
- ```
172
-
173
- ## πŸ”§ Advanced Configuration
174
-
175
- ### Custom Paths and Configs
176
-
177
- ```bash
178
- acc instance pull \
179
- --alias staging \
180
- --path /projects/acc-migration/data \
181
- --config ./config/migration.config.json
25
+ $ acc instance pull --alias staging
26
+ # Downloaded /Administration/Configuration/Form rendering
27
+ # Doanloaded /Administration/Configuration/Dynamic Javascript pages
182
28
  ```
183
29
 
184
- ### Filename Patterns
185
-
186
- Available variables for filename patterns:
30
+ ### πŸ”§ Advanced Configuration
187
31
 
188
- - `%schema%` - Schema name (e.g., `nms_recipient`)
189
- - `%namespace%` - Schema namespace
190
- - `%name%` - Schema display name
191
- - `%internalName%` - Internal schema name
32
+ [Advanced use cases with acc](https://myrosblog.com/adobe-campaign/acc-cli-use-cases?utm_campaign=readme)
192
33
 
193
34
  ## 🀝 Contributing
194
35
 
195
- Contributions are welcome! Please open a Pull Request!
36
+ Contributions are welcome! Please open a Github Pull Request!
196
37
 
197
38
  ### Local development
198
39
 
199
40
  ```bash
200
41
  # Clone repository
201
- git clone https://github.com/myrosblog/acc-cli.git
202
- cd acc-cli
203
- npm install
204
- npm link
205
- npm test
42
+ git clone https://github.com/myrosblog/acc-cli.git && cd acc-cli
43
+ npm install && npm test
206
44
  ```
207
45
 
208
46
  ### Project Structure
209
47
 
210
48
  ```
211
49
  src/
212
- β”œβ”€β”€ main.js # CLI entry point
213
- β”œβ”€β”€ CampaignAuth.js # Authentication and instance management
214
- β”œβ”€β”€ CampaignInstance.js # Data operations (check, pull, download)
215
- └── CampaignError.js # Custom error handling
50
+ β”œβ”€β”€ main.js # CLI entry point
51
+ β”œβ”€β”€ CampaignAuth.js # Authentication and instance management
52
+ β”œβ”€β”€ CampaignInstance.js # Data operations (check, pull, download)
53
+ └── CampaignError.js # Custom error handling
216
54
 
217
55
  test/
218
- β”œβ”€β”€ CampaignAuth.spec.js # Authentication tests
56
+ β”œβ”€β”€ CampaignAuth.spec.js # Authentication tests
219
57
  β”œβ”€β”€ CampaignInstance.spec.js # Data operation tests
220
- └── CampaignError.spec.js # Error handling tests
58
+ └── CampaignError.spec.js # Error handling tests
221
59
 
222
60
  bin/
223
- └── acc # Executable wrapper
61
+ └── acc # Executable wrapper
224
62
 
225
63
  config/
226
- └── acc.config.json # Default configuration template
64
+ └── acc.config.json # Default configuration template
227
65
  ```
228
66
 
229
67
  ## Roadmap
230
68
 
231
- - Publish to npm
69
+ - `acc instance push`
232
70
 
233
71
  ## πŸ”’ Security
234
72
 
235
- - Credentials are stored securely using `configstore`
73
+ - Credentials are stored securely using `configstore` outside of version controlled folders
236
74
  - No credentials are logged or transmitted unnecessarily
237
75
  - All network communications use the official ACC JS SDK
238
- - Regular dependency updates for security patches
76
+ - All sensitive information are trimmed by the official ACC JS SDK (headers `x-security-token` and `x-session-token`, session tokens) via `_removeBetween`
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "campaign-cli",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "description": "Save time, reduce risk and improve code health with acc CLI",
5
5
  "keywords": [
6
6
  "adobe",
7
7
  "adobe campaign",
8
8
  "adobe campaign classic",
9
- "acc"
9
+ "acc",
10
+ "devops"
10
11
  ],
11
12
  "bin": {
12
- "acc": "./bin/acc"
13
+ "acc": "bin/acc"
13
14
  },
14
15
  "preferGlobal": true,
15
16
  "files": [
package/src/main.js CHANGED
@@ -26,11 +26,12 @@ const pathConfig = "config.path";
26
26
  console.log(
27
27
  `🏠 acc ${vAcc} initialized with Adobe acc-js-sdk ${vSdk} and authentication from ${pathConfig}`,
28
28
  );
29
+ const homepage = packageJson.homepage.replace('utm_campaign=acc-cli', 'utm_campaign=package-json')
29
30
 
30
31
  program
31
32
  .name("acc")
32
33
  .description(
33
- `${packageJson.description}. Documentation on ${packageJson.homepage}`,
34
+ `${packageJson.description}. Documentation on ${homepage}`,
34
35
  )
35
36
  .version(vAcc);
36
37