campaign-cli 0.7.7 → 0.7.9
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/README.md +12 -32
- package/package.json +1 -1
- package/src/CampaignInstance.js +10 -1
- package/src/main.js +8 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
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
|
-
Full
|
|
5
|
+
Full documentation available on [Getting started with acc](https://myrosblog.com/adobe-campaign/acc-cli?utm_campaign=readme)
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -15,21 +15,25 @@ Full article in the blog post [Getting started with acc](https://myrosblog.com/a
|
|
|
15
15
|
|
|
16
16
|
## 🚀 Quick Start
|
|
17
17
|
|
|
18
|
-
###
|
|
18
|
+
### Installation
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
|
|
21
|
+
npm install -g campaign-cli
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Usage
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
```bash
|
|
27
|
+
acc auth init --host https://instance.com --user username --pass --alias staging
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
acc instance pull --alias staging
|
|
26
30
|
# Downloaded /Administration/Configuration/Form rendering
|
|
27
31
|
# Doanloaded /Administration/Configuration/Dynamic Javascript pages
|
|
28
32
|
```
|
|
29
33
|
|
|
30
34
|
### 🔧 Advanced Configuration
|
|
31
35
|
|
|
32
|
-
[Advanced
|
|
36
|
+
Read the [Advanced Use Cases documentation](https://myrosblog.com/adobe-campaign/acc-cli-use-cases?utm_campaign=readme)
|
|
33
37
|
|
|
34
38
|
## 🤝 Contributing
|
|
35
39
|
|
|
@@ -43,34 +47,10 @@ git clone https://github.com/myrosblog/acc-cli.git && cd acc-cli
|
|
|
43
47
|
npm install && npm test
|
|
44
48
|
```
|
|
45
49
|
|
|
46
|
-
### Project Structure
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
src/
|
|
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
|
|
54
|
-
|
|
55
|
-
test/
|
|
56
|
-
├── CampaignAuth.spec.js # Authentication tests
|
|
57
|
-
├── CampaignInstance.spec.js # Data operation tests
|
|
58
|
-
└── CampaignError.spec.js # Error handling tests
|
|
59
|
-
|
|
60
|
-
bin/
|
|
61
|
-
└── acc # Executable wrapper
|
|
62
|
-
|
|
63
|
-
config/
|
|
64
|
-
└── acc.config.json # Default configuration template
|
|
65
|
-
```
|
|
66
|
-
|
|
67
50
|
## Roadmap
|
|
68
51
|
|
|
69
52
|
- `acc instance push`
|
|
70
53
|
|
|
71
|
-
## 🔒 Security
|
|
54
|
+
## 🔒 Architecture & Security
|
|
72
55
|
|
|
73
|
-
|
|
74
|
-
- No credentials are logged or transmitted unnecessarily
|
|
75
|
-
- All network communications use the official ACC JS SDK
|
|
76
|
-
- All sensitive information are trimmed by the official ACC JS SDK (headers `x-security-token` and `x-session-token`, session tokens) via `_removeBetween`
|
|
56
|
+
Read the [Architecture & Security documentation](https://myrosblog.com/adobe-campaign/acc-cli-architecture?utm_campaign=readme).
|
package/package.json
CHANGED
package/src/CampaignInstance.js
CHANGED
|
@@ -38,11 +38,12 @@ class CampaignInstance {
|
|
|
38
38
|
* { schemaId: "nms:recipient", filename: "recipient_%name%.xml" }
|
|
39
39
|
* ]});
|
|
40
40
|
*/
|
|
41
|
-
constructor(client, accConfig, options
|
|
41
|
+
constructor(client, accConfig, options) {
|
|
42
42
|
this.client = client;
|
|
43
43
|
this.accConfig = accConfig;
|
|
44
44
|
this.verbose = options.verbose;
|
|
45
45
|
this.downloadPath = options.path;
|
|
46
|
+
this.metadata = options.metadata;
|
|
46
47
|
/**
|
|
47
48
|
* Array of schema names to process (excluding default config)
|
|
48
49
|
* @type {string[]}
|
|
@@ -99,6 +100,14 @@ class CampaignInstance {
|
|
|
99
100
|
);
|
|
100
101
|
|
|
101
102
|
for (const schemaConfig of this.accConfig.schemas) {
|
|
103
|
+
// skip if metadata option was included and not matching
|
|
104
|
+
if (this.metadata && !this.metadata.includes(schemaConfig.schemaId)) {
|
|
105
|
+
if (this.verbose) {
|
|
106
|
+
this.log(`Skipping ${schemaConfig.schemaId}`);
|
|
107
|
+
}
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
// downalod and parse
|
|
102
111
|
const lineCount = schemaConfig.queryDef?.lineCount || 10;
|
|
103
112
|
let startLine = 1;
|
|
104
113
|
let recordsLengthTotal = 0;
|
package/src/main.js
CHANGED
|
@@ -117,6 +117,10 @@ program
|
|
|
117
117
|
"Path to the configuration file. Defaults ./config/acc.config.json.",
|
|
118
118
|
defaultConfigPath,
|
|
119
119
|
)
|
|
120
|
+
.option(
|
|
121
|
+
"--metadata <schemasIds>",
|
|
122
|
+
"Comma-separated list of schema ids to retrieve, e.g. nms:delivery,nms:operation",
|
|
123
|
+
)
|
|
120
124
|
.option(
|
|
121
125
|
"--verbose",
|
|
122
126
|
"Verbose output with details on each configuration item. Defaults to false.",
|
|
@@ -148,6 +152,10 @@ program
|
|
|
148
152
|
"Path to the configuration file. Defaults ./config/acc.config.json.",
|
|
149
153
|
defaultConfigPath,
|
|
150
154
|
)
|
|
155
|
+
.option(
|
|
156
|
+
"--metadata <schemasIds>",
|
|
157
|
+
"Comma-separated list of schema ids to retrieve, e.g. nms:delivery,nms:operation",
|
|
158
|
+
)
|
|
151
159
|
.option(
|
|
152
160
|
"--verbose",
|
|
153
161
|
"Verbose output with details on each configuration item. Defaults to false.",
|