@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.
Files changed (62) 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 +34 -0
  28. package/docs/checkList.html +2 -2
  29. package/docs/connectionParameters.html +5 -0
  30. package/docs/quickstart.html +2 -1
  31. package/docs/release.html +1 -1
  32. package/openspec/config.yaml +20 -0
  33. package/package-lock.json +7437 -3924
  34. package/package.json +9 -7
  35. package/src/AGENTS.md +98 -0
  36. package/src/CLAUDE.md +2 -0
  37. package/src/application.js +637 -637
  38. package/src/cache.js +133 -133
  39. package/src/cacheRefresher.js +190 -190
  40. package/src/campaign.js +532 -532
  41. package/src/client.js +1539 -1532
  42. package/src/crypto.js +52 -52
  43. package/src/domUtil.js +346 -346
  44. package/src/entityAccessor.js +61 -61
  45. package/src/index.js +83 -83
  46. package/src/methodCache.js +69 -69
  47. package/src/optionCache.js +26 -26
  48. package/src/soap.js +321 -322
  49. package/src/testUtil.js +13 -13
  50. package/src/transport.js +70 -70
  51. package/src/util.js +147 -147
  52. package/src/web/bundler.js +5 -5
  53. package/src/xtkCaster.js +258 -258
  54. package/src/xtkEntityCache.js +34 -34
  55. package/src/xtkJob.js +185 -185
  56. package/test/AGENTS.md +37 -0
  57. package/test/CLAUDE.md +2 -0
  58. package/test/cacheRefresher.test.js +7 -0
  59. package/test/client.test.js +123 -81
  60. package/test/jest.config.js +6 -0
  61. package/test/observability.test.js +6 -1
  62. package/test/xtkJob.test.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.61",
3
+ "version": "1.2.0",
4
4
  "description": "ACC Javascript SDK",
5
5
  "main": "src/index.js",
6
6
  "homepage": "https://github.com/adobe/acc-js-sdk#readme",
@@ -11,24 +11,26 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "axios": "^1.7.8",
14
- "jsdom": "^20.0.3",
14
+ "jsdom": "^29.0.1",
15
15
  "qs-stringify": "^1.2.1"
16
16
  },
17
17
  "devDependencies": {
18
+ "@babel/core": "^7.29.0",
19
+ "@babel/preset-env": "^7.29.2",
18
20
  "docdash": "^2.0.0",
19
21
  "eslint": "^8.7.0",
20
22
  "jest": "^29.3.1",
21
23
  "jest-junit": "^15.0.0",
22
- "jsdoc": "^4.0.0",
23
- "jshint": "^2.13.6"
24
+ "jsdoc": "^4.0.0"
25
+ },
26
+ "engines": {
27
+ "node": ">=20"
24
28
  },
25
29
  "author": "",
26
30
  "scripts": {
27
31
  "publish:npm": "npm publish --access public",
28
32
  "unit-tests": "jest --config test/jest.config.js --maxWorkers=2",
33
+ "lint": "eslint src/",
29
34
  "jsdoc": "jsdoc -a all -c jsdoc.json -r -R README.md src/*.js -d docs/jsdoc"
30
- },
31
- "jshintConfig": {
32
- "esversion": 8
33
35
  }
34
36
  }
package/src/AGENTS.md ADDED
@@ -0,0 +1,98 @@
1
+ ---
2
+ last_compiled_date: 2026-04-04
3
+ version: 1.0
4
+ ---
5
+
6
+ # src/AGENTS.md
7
+
8
+ ## Scope
9
+
10
+ - Core SDK source: SOAP/XML communication with Adobe Campaign Classic servers
11
+ - Isomorphic JavaScript — every file must work in Node.js AND browser
12
+ - Campaign API client with JS Proxy-based `NLWS` interface
13
+ - Schema/metadata object model, type casting, caching layers
14
+
15
+ ## Architecture
16
+
17
+ ```
18
+ index.js (SDK entrypoint — public API surface)
19
+ └─ client.js (Client class — NLWS Proxy, session, API dispatch)
20
+ ├─ soap.js (SoapMethodCall — SOAP envelope build/parse)
21
+ │ ├─ domUtil.js (DOM/XML utilities, JSDOM in Node)
22
+ │ └─ xtkCaster.js (XTK ↔ JS type conversions)
23
+ ├─ transport.js (axios in Node, fetch in browser)
24
+ ├─ application.js (XtkSchema object model)
25
+ ├─ campaign.js (CampaignException — SDK-0000xx error codes)
26
+ ├─ cache.js → methodCache.js, optionCache.js, xtkEntityCache.js
27
+ ├─ cacheRefresher.js (background cache refresh)
28
+ ├─ entityAccessor.js (representation-agnostic entity traversal)
29
+ ├─ xtkJob.js (async job interface)
30
+ └─ crypto.js (encryption — Node crypto / browser stub)
31
+ ```
32
+
33
+ ### Key Files
34
+
35
+ - `client.js` (core) — 2400+ lines. Heart of the SDK: `Client` class, NLWS Proxy handlers (`clientHandler`, `xtkObjectHandler`), session management, all API method dispatch via `_callMethod()`
36
+ - `index.js` (entrypoint) — `SDK` class. Public API surface: `init()`, `escapeXtk()`, `getSDKVersion()`. Wires exports
37
+ - `transport.js` (isomorphic) — Canonical isomorphic pattern: `Util.isBrowser()` guard with axios (Node) vs fetch (browser)
38
+ - `campaign.js` (errors) — `CampaignException` with static factory methods using `SDK-0000xx` error codes
39
+
40
+ ## Patterns
41
+
42
+ ### Adding a New Source File
43
+
44
+ 1. Create file using the IIFE + CommonJS pattern:
45
+ ```js
46
+ (function() { "use strict"; /* ... */ exports.MyClass = MyClass; })();
47
+ ```
48
+ 2. Add the Adobe license header at the top
49
+ 3. Register in `compile.js` → `resources` array in correct dependency order
50
+ 4. Import via `require('./myFile.js')` from consuming modules
51
+ 5. Verify: `npm run lint && npm run unit-tests && node compile.js`
52
+
53
+ ### Adding a New SOAP API Method
54
+
55
+ API methods are dispatched through the NLWS Proxy in `client.js`. The Proxy dynamically resolves `client.NLWS.<namespace>.<method>()` calls — no registration needed for standard SOAP methods. The flow:
56
+
57
+ 1. `clientHandler` resolves namespace → schema ID via `Util.schemaIdFromNamespace()`
58
+ 2. Method name is capitalized and routed to `client._callMethod()`
59
+ 3. `_callMethod()` looks up the SOAP method definition, marshals parameters via `SoapMethodCall`
60
+ 4. Special-cased methods (logon, logoff, getOption) are intercepted in `clientHandler`
61
+
62
+ To add a **new special-cased method**, add an intercept in `clientHandler.get()` in `client.js`.
63
+
64
+ ## Testing
65
+
66
+ - Test files: `test/<module>.test.js` (convention; some tests are cross-cutting by feature)
67
+ - Run: `npm run unit-tests`
68
+ - Coverage: **100% branches, lines, statements** (enforced)
69
+ - See `test/AGENTS.md` for mock patterns and test utilities
70
+
71
+ ## Boundaries
72
+
73
+ ### Common Mistakes
74
+
75
+ - Adding a file without registering in `compile.js` — browser build silently excludes it
76
+ - Using Node-only APIs (`fs`, `path`, `Buffer`, `crypto`) without `Util.isBrowser()` guard
77
+ - Using `import`/`export` instead of IIFE + CommonJS — breaks browser bundler
78
+ - Adding a dependency without user approval — only 3 runtime deps allowed
79
+
80
+ ### Exceptions
81
+
82
+ | Exception | Code | When raised |
83
+ |---|---|---|
84
+ | `CampaignException` | SDK-000000–000018 | All Campaign-level errors (auth, SOAP, upload, etc.) |
85
+ | `HttpError` | HTTP status codes | Transport-level HTTP failures |
86
+ | `DomException` | N/A | XML parsing/DOM errors |
87
+
88
+ ## Related
89
+
90
+ - `test/` — test suite with transport mocking; see `test/AGENTS.md`
91
+ - `compile.js` (root) — browser bundler that reads the `resources` list
92
+ - `src/web/bundler.js` — lightweight `require`/`define` shim for browser runtime
93
+
94
+ ## Conventions
95
+
96
+ - Every file uses `(function() { "use strict"; ... })();` IIFE wrapper — no exceptions
97
+ - Error codes follow `SDK-0000xx` format with static factory methods on `CampaignException`
98
+ - Isomorphic branching uses `Util.isBrowser()` with Node code first, browser code in `else` block
package/src/CLAUDE.md ADDED
@@ -0,0 +1,2 @@
1
+ <!-- Bridge file for Claude Code. Keep shared instructions in the sibling AGENTS.md unless they are Claude-specific. -->
2
+ @AGENTS.md