@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/acc-js-sdk",
|
|
3
|
-
"version": "1.
|
|
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": "^
|
|
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
|
-
|
|
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