@adobe/acc-js-sdk 1.1.61 → 1.2.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.
- package/.cursor/commands/opsx-apply.md +152 -0
- package/.cursor/commands/opsx-archive.md +157 -0
- package/.cursor/commands/opsx-explore.md +173 -0
- package/.cursor/commands/opsx-propose.md +106 -0
- package/.cursor/skills/openspec-apply-change/SKILL.md +156 -0
- package/.cursor/skills/openspec-archive-change/SKILL.md +114 -0
- package/.cursor/skills/openspec-explore/SKILL.md +288 -0
- package/.cursor/skills/openspec-propose/SKILL.md +110 -0
- package/.eslintrc.js +2 -2
- package/.github/prompts/opsx-apply.prompt.md +149 -0
- package/.github/prompts/opsx-archive.prompt.md +154 -0
- package/.github/prompts/opsx-explore.prompt.md +170 -0
- package/.github/prompts/opsx-propose.prompt.md +103 -0
- package/.github/skills/openspec-apply-change/SKILL.md +156 -0
- package/.github/skills/openspec-archive-change/SKILL.md +114 -0
- package/.github/skills/openspec-explore/SKILL.md +288 -0
- package/.github/skills/openspec-propose/SKILL.md +110 -0
- package/.github/workflows/codeql-analysis.yml +5 -4
- package/.github/workflows/npm-publish.yml +3 -3
- package/AGENTS.md +117 -0
- package/CLAUDE.md +2 -0
- package/MIGRATION.md +10 -0
- package/README.md +6 -2
- package/ai-docs/coding-rules.md +95 -0
- package/ai-docs/tech-stack.md +43 -0
- package/babel.config.js +5 -0
- package/docs/changeLog.html +34 -0
- package/docs/checkList.html +2 -2
- package/docs/connectionParameters.html +5 -0
- package/docs/quickstart.html +2 -1
- package/docs/release.html +1 -1
- package/openspec/config.yaml +20 -0
- package/package-lock.json +7437 -3924
- package/package.json +9 -7
- package/src/AGENTS.md +98 -0
- package/src/CLAUDE.md +2 -0
- package/src/application.js +637 -637
- package/src/cache.js +133 -133
- package/src/cacheRefresher.js +190 -190
- package/src/campaign.js +532 -532
- package/src/client.js +1539 -1532
- package/src/crypto.js +52 -52
- package/src/domUtil.js +346 -346
- package/src/entityAccessor.js +61 -61
- package/src/index.js +83 -83
- package/src/methodCache.js +69 -69
- package/src/optionCache.js +26 -26
- package/src/soap.js +321 -322
- package/src/testUtil.js +13 -13
- package/src/transport.js +70 -70
- package/src/util.js +147 -147
- package/src/web/bundler.js +5 -5
- package/src/xtkCaster.js +258 -258
- package/src/xtkEntityCache.js +34 -34
- package/src/xtkJob.js +185 -185
- package/test/AGENTS.md +37 -0
- package/test/CLAUDE.md +2 -0
- package/test/cacheRefresher.test.js +7 -0
- package/test/client.test.js +123 -81
- package/test/jest.config.js +6 -0
- package/test/observability.test.js +6 -1
- package/test/xtkJob.test.js +2 -2
package/src/crypto.js
CHANGED
|
@@ -10,39 +10,39 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
(function() {
|
|
13
|
-
"use strict";
|
|
13
|
+
"use strict";
|
|
14
14
|
|
|
15
|
-
const { Util } = require('./util.js');
|
|
15
|
+
const { Util } = require('./util.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
/**********************************************************************************
|
|
18
|
+
/**********************************************************************************
|
|
19
19
|
*
|
|
20
20
|
* Browser-side implementation of nodejs crypto module
|
|
21
21
|
*
|
|
22
22
|
*********************************************************************************/
|
|
23
|
-
exports.crypto = {};
|
|
23
|
+
exports.crypto = {};
|
|
24
24
|
|
|
25
|
-
/**********************************************************************************
|
|
25
|
+
/**********************************************************************************
|
|
26
26
|
*
|
|
27
27
|
* Encryption / Decryption functions
|
|
28
28
|
* Node implementation
|
|
29
29
|
*
|
|
30
30
|
*********************************************************************************/
|
|
31
|
-
/* istanbul ignore else */
|
|
32
|
-
if (!Util.isBrowser()) {
|
|
31
|
+
/* istanbul ignore else */
|
|
32
|
+
if (!Util.isBrowser()) {
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
// Expose browser exports for unit testing
|
|
35
|
+
exports.__browser = { crypto: exports.crypto };
|
|
36
|
+
delete exports.crypto;
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
var crypto = require('crypto');
|
|
39
|
+
const { CampaignException } = require('./campaign.js');
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
/**
|
|
42
42
|
* @namespace Campaign
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
/**
|
|
46
46
|
* Creates the encryption/decryption object
|
|
47
47
|
*
|
|
48
48
|
* @private
|
|
@@ -52,12 +52,12 @@ if (!Util.isBrowser()) {
|
|
|
52
52
|
* @param {string} key is the encryption key, coming from the XtkSecretKey or XtkKey option
|
|
53
53
|
* @memberof Campaign
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
class Cipher {
|
|
56
56
|
|
|
57
57
|
constructor(key) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
// ex: "llL97E5mAvLTxgT1fsAH2kjLqZXKCGHfDyR9q0C6Ivs="
|
|
59
|
+
this.key = Buffer.from(key, 'base64');
|
|
60
|
+
this.iv = Buffer.from([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
@@ -69,15 +69,15 @@ if (!Util.isBrowser()) {
|
|
|
69
69
|
* @returns {string} the encrypted password
|
|
70
70
|
*/
|
|
71
71
|
encryptPassword(password) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
const cipher = crypto.createCipheriv('aes-256-cbc', this.key, this.iv);
|
|
73
|
+
var buf = Buffer.from(password, 'utf8');
|
|
74
|
+
var pad = Buffer.alloc(3);
|
|
75
|
+
buf = Buffer.concat([buf, pad]);
|
|
76
|
+
var dec1 = cipher.update(buf);
|
|
77
|
+
var dec2 = cipher.final();
|
|
78
|
+
var dec = Buffer.concat([dec1, dec2]);
|
|
79
|
+
dec = "@" + dec.toString('base64');
|
|
80
|
+
return dec;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
|
|
@@ -98,36 +98,36 @@ if (!Util.isBrowser()) {
|
|
|
98
98
|
* {crc} 1 byte
|
|
99
99
|
*/
|
|
100
100
|
decryptPassword(password) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
if (password === null || password === undefined || password === "")
|
|
102
|
+
return "";
|
|
103
|
+
if (password.substr(0, 13) === '__PLAINTEXT__')
|
|
104
|
+
return password.substr(13);
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
106
|
+
// remove marker
|
|
107
|
+
if (password[0] !== '@')
|
|
108
|
+
throw CampaignException.DECRYPT_ERROR();
|
|
109
|
+
password = password.substr(1);
|
|
110
|
+
|
|
111
|
+
const decipher = crypto.createDecipheriv('aes-256-cbc', this.key, this.iv);
|
|
112
|
+
const buf = Buffer.from(password, 'base64');
|
|
113
|
+
var dec1 = decipher.update(buf);
|
|
114
|
+
var dec2 = decipher.final();
|
|
115
|
+
var dec = Buffer.concat([dec1, dec2]);
|
|
116
|
+
|
|
117
|
+
// last byte is CRC (check and remove)
|
|
118
|
+
dec = dec.slice(0, dec.length - 1);
|
|
119
|
+
// last 2 bytes are salt
|
|
120
|
+
dec = dec.slice(0, dec.length - 2);
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
dec = dec.toString('utf-8');
|
|
123
|
+
return dec;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
}
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
128
|
+
// Public exports
|
|
129
|
+
exports.Cipher = Cipher;
|
|
130
|
+
}
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
})();
|