@adobe/acc-js-sdk 1.1.62 → 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.
Files changed (61) hide show
  1. package/.cursor/commands/opsx-apply.md +152 -0
  2. package/.cursor/commands/opsx-archive.md +157 -0
  3. package/.cursor/commands/opsx-explore.md +173 -0
  4. package/.cursor/commands/opsx-propose.md +106 -0
  5. package/.cursor/skills/openspec-apply-change/SKILL.md +156 -0
  6. package/.cursor/skills/openspec-archive-change/SKILL.md +114 -0
  7. package/.cursor/skills/openspec-explore/SKILL.md +288 -0
  8. package/.cursor/skills/openspec-propose/SKILL.md +110 -0
  9. package/.eslintrc.js +2 -2
  10. package/.github/prompts/opsx-apply.prompt.md +149 -0
  11. package/.github/prompts/opsx-archive.prompt.md +154 -0
  12. package/.github/prompts/opsx-explore.prompt.md +170 -0
  13. package/.github/prompts/opsx-propose.prompt.md +103 -0
  14. package/.github/skills/openspec-apply-change/SKILL.md +156 -0
  15. package/.github/skills/openspec-archive-change/SKILL.md +114 -0
  16. package/.github/skills/openspec-explore/SKILL.md +288 -0
  17. package/.github/skills/openspec-propose/SKILL.md +110 -0
  18. package/.github/workflows/codeql-analysis.yml +5 -4
  19. package/.github/workflows/npm-publish.yml +3 -3
  20. package/AGENTS.md +117 -0
  21. package/CLAUDE.md +2 -0
  22. package/MIGRATION.md +10 -0
  23. package/README.md +6 -2
  24. package/ai-docs/coding-rules.md +95 -0
  25. package/ai-docs/tech-stack.md +43 -0
  26. package/babel.config.js +5 -0
  27. package/docs/changeLog.html +28 -2
  28. package/docs/checkList.html +2 -2
  29. package/docs/quickstart.html +2 -1
  30. package/docs/release.html +1 -1
  31. package/openspec/config.yaml +20 -0
  32. package/package-lock.json +6055 -4036
  33. package/package.json +9 -7
  34. package/src/AGENTS.md +98 -0
  35. package/src/CLAUDE.md +2 -0
  36. package/src/application.js +637 -637
  37. package/src/cache.js +133 -133
  38. package/src/cacheRefresher.js +190 -190
  39. package/src/campaign.js +532 -532
  40. package/src/client.js +1539 -1537
  41. package/src/crypto.js +52 -52
  42. package/src/domUtil.js +346 -346
  43. package/src/entityAccessor.js +61 -61
  44. package/src/index.js +83 -83
  45. package/src/methodCache.js +69 -69
  46. package/src/optionCache.js +26 -26
  47. package/src/soap.js +321 -322
  48. package/src/testUtil.js +13 -13
  49. package/src/transport.js +70 -70
  50. package/src/util.js +147 -147
  51. package/src/web/bundler.js +5 -5
  52. package/src/xtkCaster.js +258 -258
  53. package/src/xtkEntityCache.js +34 -34
  54. package/src/xtkJob.js +185 -185
  55. package/test/AGENTS.md +37 -0
  56. package/test/CLAUDE.md +2 -0
  57. package/test/cacheRefresher.test.js +7 -0
  58. package/test/client.test.js +90 -78
  59. package/test/jest.config.js +6 -0
  60. package/test/observability.test.js +6 -1
  61. 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
- // Expose browser exports for unit testing
35
- exports.__browser = { crypto: exports.crypto };
36
- delete exports.crypto;
34
+ // Expose browser exports for unit testing
35
+ exports.__browser = { crypto: exports.crypto };
36
+ delete exports.crypto;
37
37
 
38
- var crypto = require('crypto');
39
- const { CampaignException } = require('./campaign.js');
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
- class Cipher {
55
+ class Cipher {
56
56
 
57
57
  constructor(key) {
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 ]);
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
- 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;
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
- if (password === null || password === undefined || password === "")
102
- return "";
103
- if (password.substr(0, 13) === '__PLAINTEXT__')
104
- return password.substr(13);
101
+ if (password === null || password === undefined || password === "")
102
+ return "";
103
+ if (password.substr(0, 13) === '__PLAINTEXT__')
104
+ return password.substr(13);
105
105
 
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);
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
- dec = dec.toString('utf-8');
123
- return dec;
122
+ dec = dec.toString('utf-8');
123
+ return dec;
124
124
  }
125
125
 
126
- }
126
+ }
127
127
 
128
- // Public exports
129
- exports.Cipher = Cipher;
130
- }
128
+ // Public exports
129
+ exports.Cipher = Cipher;
130
+ }
131
131
 
132
132
 
133
133
  })();