@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
|
@@ -17,6 +17,7 @@ on:
|
|
|
17
17
|
pull_request:
|
|
18
18
|
# The branches below must be a subset of the branches above
|
|
19
19
|
branches: [ master ]
|
|
20
|
+
workflow_dispatch:
|
|
20
21
|
schedule:
|
|
21
22
|
- cron: '34 13 * * 4'
|
|
22
23
|
|
|
@@ -38,11 +39,11 @@ jobs:
|
|
|
38
39
|
|
|
39
40
|
steps:
|
|
40
41
|
- name: Checkout repository
|
|
41
|
-
uses: actions/checkout@
|
|
42
|
+
uses: actions/checkout@v4
|
|
42
43
|
|
|
43
44
|
# Initializes the CodeQL tools for scanning.
|
|
44
45
|
- name: Initialize CodeQL
|
|
45
|
-
uses: github/codeql-action/init@
|
|
46
|
+
uses: github/codeql-action/init@v3
|
|
46
47
|
with:
|
|
47
48
|
languages: ${{ matrix.language }}
|
|
48
49
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
@@ -53,7 +54,7 @@ jobs:
|
|
|
53
54
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
54
55
|
# If this step fails, then you should remove it and run the build manually (see below)
|
|
55
56
|
- name: Autobuild
|
|
56
|
-
uses: github/codeql-action/autobuild@
|
|
57
|
+
uses: github/codeql-action/autobuild@v3
|
|
57
58
|
|
|
58
59
|
# ℹ️ Command-line programs to run using the OS shell.
|
|
59
60
|
# 📚 https://git.io/JvXDl
|
|
@@ -67,4 +68,4 @@ jobs:
|
|
|
67
68
|
# make release
|
|
68
69
|
|
|
69
70
|
- name: Perform CodeQL Analysis
|
|
70
|
-
uses: github/codeql-action/analyze@
|
|
71
|
+
uses: github/codeql-action/analyze@v3
|
|
@@ -9,11 +9,11 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
steps:
|
|
11
11
|
- name: Checkout repository
|
|
12
|
-
uses: actions/checkout@
|
|
12
|
+
uses: actions/checkout@v4
|
|
13
13
|
- name: Set up Node.js
|
|
14
|
-
uses: actions/setup-node@
|
|
14
|
+
uses: actions/setup-node@v4
|
|
15
15
|
with:
|
|
16
|
-
node-version:
|
|
16
|
+
node-version: 20
|
|
17
17
|
- name: Publish if version has been updated
|
|
18
18
|
#uses: pascalgn/npm-publish-action@06e0830ea83eea10ed4a62654eeaedafb8bf50fc
|
|
19
19
|
uses: mkiki/npm-publish-action@52879298d00c0a02781e1f02c9e917e01cff1bc7
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
last_compiled_date: 2026-04-04
|
|
3
|
+
version: 1.0
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AGENTS.md — acc-js-sdk
|
|
7
|
+
|
|
8
|
+
> Guide for AI coding agents. Module-specific rules live in `src/AGENTS.md` and `test/AGENTS.md`.
|
|
9
|
+
> Nearest file to your edit takes precedence. Explicit user prompts override all files.
|
|
10
|
+
|
|
11
|
+
## 1. Project Overview
|
|
12
|
+
|
|
13
|
+
Adobe Campaign Classic JavaScript SDK. Provides a JavaScript-idiomatic async API over Campaign's SOAP/XML interface. Isomorphic — runs in Node.js (>=20) and browsers.
|
|
14
|
+
|
|
15
|
+
### Entry Points
|
|
16
|
+
- `src/index.js::SDK` — Public API surface: `init()`, `escapeXtk()`, `getSDKVersion()`
|
|
17
|
+
- `src/client.js::Client` — Campaign client: NLWS Proxy, session management, SOAP dispatch
|
|
18
|
+
|
|
19
|
+
### Project Structure
|
|
20
|
+
|
|
21
|
+
| Module | Purpose | AGENTS.md |
|
|
22
|
+
|--------|---------|-----------|
|
|
23
|
+
| `src/` | Core SDK source (SOAP, caching, schemas, transport) | [`src/AGENTS.md`](src/AGENTS.md) |
|
|
24
|
+
| `test/` | Unit tests (100% coverage, transport mocking) | [`test/AGENTS.md`](test/AGENTS.md) |
|
|
25
|
+
| `samples/` | Usage examples (Node.js and browser) | — |
|
|
26
|
+
| `docs/` | Jekyll documentation site (GitHub Pages) | — |
|
|
27
|
+
| `ai-docs/` | Developer & AI agent reference docs (coding rules, tech stack) | — |
|
|
28
|
+
| `openspec/` | OpenSpec change workflow artifacts | — |
|
|
29
|
+
|
|
30
|
+
## 2. Architecture
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
User Code
|
|
34
|
+
└─ sdk.init(connectionParams) → Client
|
|
35
|
+
└─ client.NLWS.<namespace>.<method>() (JS Proxy)
|
|
36
|
+
├─ Schema lookup + method resolution
|
|
37
|
+
├─ SoapMethodCall (build SOAP envelope)
|
|
38
|
+
├─ Transport (axios on Node / fetch in browser)
|
|
39
|
+
├─ Response parsing (XML → JSON via representation)
|
|
40
|
+
└─ Caching (schemas, methods, options, entities)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The SDK is **isomorphic**: `src/transport.js` branches on `Util.isBrowser()` to use axios (Node) or fetch (browser). The browser build is produced by `compile.js` which concatenates source files into `dist/bundle.js` using a custom module system (`src/web/bundler.js`).
|
|
44
|
+
|
|
45
|
+
## 3. Technology Stack
|
|
46
|
+
|
|
47
|
+
**Core Stack:**
|
|
48
|
+
- **Language**: JavaScript (ES6/CommonJS modules, IIFE pattern)
|
|
49
|
+
- **Runtime**: Node.js >= 20 + Browser (custom bundler)
|
|
50
|
+
- **Protocol**: SOAP/XML over HTTP to Adobe Campaign Classic
|
|
51
|
+
|
|
52
|
+
**Detailed tech stack:** See `ai-docs/tech-stack.md`
|
|
53
|
+
|
|
54
|
+
## 4. Build and Development Commands
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm install # Install dependencies
|
|
58
|
+
npm run unit-tests # Jest tests with 100% coverage enforcement
|
|
59
|
+
npm run lint # ESLint on src/
|
|
60
|
+
npm run jsdoc # Generate API docs in docs/jsdoc
|
|
61
|
+
node compile.js # Build browser bundle (dist/bundle.js)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 5. Testing
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run unit-tests # Full test suite
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Test structure:**
|
|
71
|
+
- Unit tests: `test/<module>.test.js` — transport mocked via `test/mock.js`
|
|
72
|
+
- Coverage target: 100% (branches, lines, statements)
|
|
73
|
+
- See `test/AGENTS.md` for mock patterns
|
|
74
|
+
|
|
75
|
+
**Verify before commit:**
|
|
76
|
+
- Tests pass: `npm run unit-tests`
|
|
77
|
+
- Linting clean: `npm run lint`
|
|
78
|
+
|
|
79
|
+
## 6. Critical Coding Rules
|
|
80
|
+
|
|
81
|
+
- **IIFE + CommonJS only** — no ES modules; browser bundler requires this exact pattern
|
|
82
|
+
- **Isomorphic safety** — guard Node-only APIs with `Util.isBrowser()`; guard browser-only APIs in `else` block
|
|
83
|
+
- **Register new files in `compile.js`** — `resources` array, correct dependency order
|
|
84
|
+
- **No new dependencies without approval** — only 3 runtime deps allowed (`axios`, `jsdom`, `qs-stringify`)
|
|
85
|
+
- **100% test coverage** — every branch, line, and statement must be covered
|
|
86
|
+
- **Adobe license header** on every source file
|
|
87
|
+
|
|
88
|
+
**Full coding standards:** `ai-docs/coding-rules.md`
|
|
89
|
+
|
|
90
|
+
## 7. Boundaries and Safety Gates
|
|
91
|
+
|
|
92
|
+
- ✅ Safe to run: `npm run lint`, `npm run unit-tests`, `npm run jsdoc`, reading any file
|
|
93
|
+
- ⚠️ Ask first: adding dependencies, modifying `compile.js` resource order, changing public API surface in `index.js`
|
|
94
|
+
- 🚫 Never do: use ES modules (`import`/`export`), modify `package-lock.json` directly, push to npm without approval
|
|
95
|
+
|
|
96
|
+
### Files Agents Should Not Modify
|
|
97
|
+
- `dist/bundle.js` — auto-generated by `compile.js`
|
|
98
|
+
- `package-lock.json` — managed by npm
|
|
99
|
+
- `docs/jsdoc/` — auto-generated by JSDoc
|
|
100
|
+
- `coverage/` — auto-generated by Jest
|
|
101
|
+
|
|
102
|
+
## 8. Decision-Making Guidance
|
|
103
|
+
|
|
104
|
+
| If you need to... | Do this |
|
|
105
|
+
|---|---|
|
|
106
|
+
| Add a new SOAP API wrapper | Check if NLWS Proxy handles it automatically; only add intercept in `clientHandler` if special logic needed |
|
|
107
|
+
| Add a new source file | Follow IIFE pattern, register in `compile.js`, add tests for 100% coverage |
|
|
108
|
+
| Handle XML/DOM | Use `DomUtil` methods from `src/domUtil.js`, never raw DOM APIs |
|
|
109
|
+
| Cast between JS and XTK types | Use `XtkCaster` from `src/xtkCaster.js` |
|
|
110
|
+
| Add platform-specific code | Follow `src/transport.js` pattern: `if (!Util.isBrowser()) { ... } else { ... }` |
|
|
111
|
+
|
|
112
|
+
## 9. Anti-Patterns and Tribal Knowledge
|
|
113
|
+
|
|
114
|
+
- The NLWS Proxy auto-capitalizes method names — `client.NLWS.xtkSession.getServerTime()` calls `GetServerTime`. Don't manually capitalize.
|
|
115
|
+
- `CampaignException` redacts sensitive data via `Util.trim()` — never log raw SOAP responses containing session tokens
|
|
116
|
+
- The browser bundler is not webpack/rollup — it's a simple concatenation script. Module load order in `compile.js` matters.
|
|
117
|
+
- `var` still appears in older code but `const`/`let` should be used in new code
|
package/CLAUDE.md
ADDED
package/MIGRATION.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Migration guide
|
|
2
2
|
|
|
3
|
+
# Version 1.2.0
|
|
4
|
+
|
|
5
|
+
In version 1.2.0, dependencies have been bumped to their latest versions to fix vulnerabilities. As a consequence, **Node.js version 20 or above is now required** to use the SDK.
|
|
6
|
+
|
|
7
|
+
The following potentially breaking changes were introduced
|
|
8
|
+
|
|
9
|
+
* The minimum supported Node.js version is now 20 (previously 14+)
|
|
10
|
+
* Updated `jsdom` to version 29.x which requires Node.js 20+
|
|
11
|
+
* Updated `@babel/core` and `@babel/preset-env` to version 7.29.x
|
|
12
|
+
|
|
3
13
|
# Version 1.1.0
|
|
4
14
|
|
|
5
15
|
In version 1.1.0, changes were made in the metadata API. The SDK lets you access schema as JSON objects (method `client.getSchema`) or provides an object model around schemas with typed objects, as in https://experienceleague.adobe.com/developer/campaign-api/api/c-Schema.html, which can be accessed with `application.getSchema`.
|
package/README.md
CHANGED
|
@@ -9,6 +9,10 @@ The API is fully asynchronous using promises and works as well on the server sid
|
|
|
9
9
|
> **Extensive documentation is available**: https://opensource.adobe.com/acc-js-sdk/
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
# Prerequisites
|
|
13
|
+
|
|
14
|
+
The SDK requires **Node.js version 20** or above.
|
|
15
|
+
|
|
12
16
|
# QuickStart
|
|
13
17
|
|
|
14
18
|
|
|
@@ -32,7 +36,7 @@ console.log(sdk.getSDKVersion());
|
|
|
32
36
|
which will return the SDK name and version (the actual name and version number will depend on the version you have installed)
|
|
33
37
|
```
|
|
34
38
|
{
|
|
35
|
-
version: "1.
|
|
39
|
+
version: "1.2.0",
|
|
36
40
|
name: "@adobe/acc-js-sdk",
|
|
37
41
|
description: "ACC Javascript SDK",
|
|
38
42
|
}
|
|
@@ -94,7 +98,7 @@ node index.js
|
|
|
94
98
|
|
|
95
99
|
It will display something like this
|
|
96
100
|
```
|
|
97
|
-
ACC Javascript SDK version 1.
|
|
101
|
+
ACC Javascript SDK version 1.2.0
|
|
98
102
|
Target mappings: {"deliveryMapping":[{"id":"1747","label":"Recipients","name":"mapRecipient","schema":"nms:recipient"},{"id":"1826","label":"Subscriptions","name":"mapSubscribe","schema":"nms:subscription"},{"id":"1827","label":"Operators","name":"mapOperator","schema":"xtk:operator"},{"id":"1828","label":"External file","name":"mapAny","schema":""},{"id":"1830","label":"Visitors","name":"mapVisitor","schema":"nms:visitor"},{"id":"2035","label":"Real time event","name":"mapRtEvent","schema":"nms:rtEvent"},{"id":"2036","label":"Batch event","name":"mapBatchEvent","schema":"nms:batchEvent"},{"id":"2070","label":"Subscriber applications","name":"mapAppSubscriptionRcp","schema":"nms:appSubscriptionRcp"}]}
|
|
99
103
|
````
|
|
100
104
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
last_compiled_date: 2026-04-04
|
|
3
|
+
version: 1.0
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Coding Rules — acc-js-sdk
|
|
7
|
+
|
|
8
|
+
## 1. Module Pattern (Critical)
|
|
9
|
+
|
|
10
|
+
Every source file in `src/` uses the IIFE + CommonJS pattern. Never use ES modules (`import`/`export`).
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
(function() {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
const Foo = require('./foo.js').Foo;
|
|
17
|
+
|
|
18
|
+
class Bar { /* ... */ }
|
|
19
|
+
|
|
20
|
+
exports.Bar = Bar;
|
|
21
|
+
// or: module.exports = bar;
|
|
22
|
+
})();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Why**: The SDK is isomorphic. The custom browser bundler (`compile.js`) expects this exact pattern — it wraps each file in a synthetic CommonJS module scope. ES modules would break the browser build.
|
|
26
|
+
|
|
27
|
+
## 2. Isomorphic Constraints (Critical)
|
|
28
|
+
|
|
29
|
+
The SDK runs in **Node.js** (server) and **browsers** (via `compile.js` → `dist/bundle.js`).
|
|
30
|
+
|
|
31
|
+
- Use `Util.isBrowser()` to branch platform-specific code (see `src/transport.js` for the canonical example)
|
|
32
|
+
- Never use Node-only APIs (e.g., `fs`, `path`, `Buffer`) without a browser guard
|
|
33
|
+
- Never use browser-only APIs (e.g., `fetch`, `Headers`, `Request`) without a Node guard
|
|
34
|
+
- `axios` is the Node HTTP client; `fetch` is the browser equivalent
|
|
35
|
+
- The `qs-stringify` package is bundled for browser use (`compile.js` resources list)
|
|
36
|
+
|
|
37
|
+
## 3. Browser Bundler Registration (Critical)
|
|
38
|
+
|
|
39
|
+
When adding a new source file, it **must** be registered in `compile.js` → `resources` array in the correct dependency order. Files are bundled sequentially — a file can only `require()` files listed above it.
|
|
40
|
+
|
|
41
|
+
## 4. ESLint & Formatting
|
|
42
|
+
|
|
43
|
+
- **Indent**: 2 spaces (enforced by ESLint)
|
|
44
|
+
- **Unused vars**: Error, except args prefixed with `_` (pattern: `argsIgnorePattern: "^_"`)
|
|
45
|
+
- **Environments**: `browser`, `commonjs`, `es2021`, `node`, `jest`
|
|
46
|
+
- **Extends**: `eslint:recommended`
|
|
47
|
+
- Run: `npm run lint`
|
|
48
|
+
|
|
49
|
+
## 5. Testing
|
|
50
|
+
|
|
51
|
+
- **Framework**: Jest with `babel-jest` transform
|
|
52
|
+
- **Coverage**: 100% branches, lines, and statements (enforced in `test/jest.config.js`)
|
|
53
|
+
- **Test naming**: `test/<module>.test.js` mirrors `src/<module>.js`
|
|
54
|
+
- **Transport mocking**: Use `Mock.makeClient()` from `test/mock.js`, which creates a client with `client._transport = jest.fn()`. Mock responses with `client._transport.mockReturnValueOnce(...)`.
|
|
55
|
+
- **Console mocking**: Use `Mock.withMockConsole(async () => { ... })` to capture `console.log` calls
|
|
56
|
+
- **Run**: `npm run unit-tests`
|
|
57
|
+
|
|
58
|
+
## 6. License Header
|
|
59
|
+
|
|
60
|
+
Every source file must start with the Adobe Apache 2.0 license header:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
/*
|
|
64
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
65
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
66
|
+
...
|
|
67
|
+
*/
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 7. JSDoc
|
|
71
|
+
|
|
72
|
+
Use JSDoc annotations for all public APIs. The project uses the `@namespace Campaign` convention for SDK-level types and `@memberof Campaign` to associate types/methods.
|
|
73
|
+
|
|
74
|
+
Generate docs with: `npm run jsdoc`
|
|
75
|
+
|
|
76
|
+
## 8. Error Handling
|
|
77
|
+
|
|
78
|
+
- Use `CampaignException` / `makeCampaignException` from `src/campaign.js` for Campaign-specific errors
|
|
79
|
+
- Use `HttpError` from `src/transport.js` for HTTP-level errors
|
|
80
|
+
- Always include meaningful error messages; the SDK is used by third-party developers
|
|
81
|
+
|
|
82
|
+
## 9. XML / SOAP
|
|
83
|
+
|
|
84
|
+
- DOM utilities live in `src/domUtil.js` (`DomUtil` class) — use these, not raw DOM APIs
|
|
85
|
+
- SOAP calls go through `src/soap.js` (`SoapMethodCall` class)
|
|
86
|
+
- Type casting between JS and XTK types uses `src/xtkCaster.js` (`XtkCaster` class)
|
|
87
|
+
- The SDK converts XML ↔ JSON using configurable representations (SimpleJson, BadgerFish, xml)
|
|
88
|
+
|
|
89
|
+
## 10. Dependency Policy (Critical)
|
|
90
|
+
|
|
91
|
+
External dependencies must be strictly limited. The SDK has only 3 runtime dependencies (`axios`, `jsdom`, `qs-stringify`). Never add a new dependency without explicit user confirmation. Prefer implementing functionality inline or using built-in Node.js/browser APIs over pulling in a new package.
|
|
92
|
+
|
|
93
|
+
## 11. Sensitive Data
|
|
94
|
+
|
|
95
|
+
Use `Util.trim()` to sanitize objects before logging — it redacts session tokens, passwords, and security tokens from SOAP payloads and objects.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
last_compiled_date: 2026-04-04
|
|
3
|
+
version: 1.0
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Technology Stack
|
|
7
|
+
|
|
8
|
+
## Core
|
|
9
|
+
- **Language**: JavaScript (ES6/ES2021, CommonJS modules)
|
|
10
|
+
- **Runtime**: Node.js >= 20 (server) + Browser (via custom bundler)
|
|
11
|
+
- **Framework**: None (standalone SDK library)
|
|
12
|
+
- **Database**: N/A — SDK is a client library for Adobe Campaign Classic
|
|
13
|
+
|
|
14
|
+
## Libraries & Tools
|
|
15
|
+
|
|
16
|
+
| Technology | Category | Role in this repo | Files |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| axios ^1.7.8 | Web | HTTP client for Node.js transport | `src/transport.js` |
|
|
19
|
+
| jsdom ^29.0.1 | Web | DOM/XML parsing in Node.js | `src/domUtil.js` |
|
|
20
|
+
| qs-stringify ^1.2.1 | Web | Query string encoding (isomorphic) | `src/client.js` |
|
|
21
|
+
| Jest ^29.3.1 | Testing | Unit test framework, 100% coverage | `test/` |
|
|
22
|
+
| jest-junit ^15.0.0 | Testing | JUnit XML reporter for CI | `test/jest.config.js` |
|
|
23
|
+
| Babel ^7.29.0 | Testing | Transpilation for Jest (preset-env) | `babel.config.js` |
|
|
24
|
+
| ESLint ^8.7.0 | Quality | Linter (eslint:recommended + custom) | `.eslintrc.js` |
|
|
25
|
+
| JSDoc ^4.0.0 | Docs | API documentation generation | `jsdoc.json` |
|
|
26
|
+
| docdash ^2.0.0 | Docs | JSDoc template | `jsdoc.json` |
|
|
27
|
+
|
|
28
|
+
**Inclusion criteria:**
|
|
29
|
+
- Must be imported in application code (not just in manifest)
|
|
30
|
+
- Cite >=1 file where it's used
|
|
31
|
+
|
|
32
|
+
**Dependency policy:** External dependencies are strictly limited. Never add a new dependency without explicit user confirmation. Only 3 runtime dependencies exist.
|
|
33
|
+
|
|
34
|
+
**Categories**: Web, Testing, Quality, Docs
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## How to Update
|
|
39
|
+
|
|
40
|
+
1. Add new dependency to `package.json` (requires explicit approval)
|
|
41
|
+
2. Import and use in application code
|
|
42
|
+
3. If used in browser, register in `compile.js` resources array
|
|
43
|
+
4. Update `ai-docs/tech-stack.md` to reflect the new dependency
|
package/babel.config.js
ADDED
package/docs/changeLog.html
CHANGED
|
@@ -3,6 +3,40 @@ layout: page
|
|
|
3
3
|
title: Change Log
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<section class="changelog"><h1>Version 1.2.0</h1>
|
|
7
|
+
<h2>2026/04/04</h2>
|
|
8
|
+
<li>
|
|
9
|
+
<b>Breaking change</b>: the minimum supported Node.js version is now <b>20</b>
|
|
10
|
+
</li>
|
|
11
|
+
<li>
|
|
12
|
+
Bumped <b>jsdom</b> from 20.x to 29.x to fix vulnerabilities (this is the dependency that requires Node.js 20)
|
|
13
|
+
</li>
|
|
14
|
+
<li>
|
|
15
|
+
Added <b>@babel/core</b> and <b>@babel/preset-env</b> to transpile ES module dependencies used by jsdom 29
|
|
16
|
+
</li>
|
|
17
|
+
<li>
|
|
18
|
+
Removed <b>jshint</b> dependency; linting is now done exclusively with ESLint (<b>npm run lint</b>)
|
|
19
|
+
</li>
|
|
20
|
+
<li>
|
|
21
|
+
Updated ESLint configuration to flag unused variables (with underscore-prefixed exceptions)
|
|
22
|
+
</li>
|
|
23
|
+
<li>
|
|
24
|
+
Fixed all warnings and log noise during test runs
|
|
25
|
+
</li>
|
|
26
|
+
<li>
|
|
27
|
+
AI-Enabled the repository with OpenSpec framework
|
|
28
|
+
</li>
|
|
29
|
+
</section>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<section class="changelog"><h1>Version 1.1.62</h1>
|
|
34
|
+
<h2>2026/04/03</h2>
|
|
35
|
+
<li>
|
|
36
|
+
Add enableRequestId option to connection parameters to pass the x-request-id parameter. This was passed by default and causing the SDK to be incompatible with older campaign instances
|
|
37
|
+
</li>
|
|
38
|
+
</section>
|
|
39
|
+
|
|
6
40
|
<section class="changelog"><h1>Version 1.1.61</h1>
|
|
7
41
|
<h2>2025/09/16</h2>
|
|
8
42
|
<li>
|
package/docs/checkList.html
CHANGED
|
@@ -20,7 +20,7 @@ title: Commit Checklist
|
|
|
20
20
|
npm i
|
|
21
21
|
npm run unit-tests
|
|
22
22
|
npm audit
|
|
23
|
-
|
|
23
|
+
npm run lint
|
|
24
24
|
npm run jsdoc
|
|
25
25
|
open ./docs/jsdoc/index.html
|
|
26
26
|
node ./compile.js
|
|
@@ -131,7 +131,7 @@ npm audit
|
|
|
131
131
|
<p></p>
|
|
132
132
|
|
|
133
133
|
<pre class="code">
|
|
134
|
-
|
|
134
|
+
npm run lint
|
|
135
135
|
</pre>
|
|
136
136
|
|
|
137
137
|
<p>
|
|
@@ -114,6 +114,11 @@ const connectionParameters = sdk.ConnectionParameters.ofUserAndPassword(
|
|
|
114
114
|
<td>string</td>
|
|
115
115
|
<td>An optional value to override the instance key which is used for the caches of schemas, options, etc.</td>
|
|
116
116
|
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td>enableRequestIdHeader</td>
|
|
119
|
+
<td>boolean</td>
|
|
120
|
+
<td>Enable the request ID header for SOAP API calls</td>
|
|
121
|
+
</tr>
|
|
117
122
|
</tbody>
|
|
118
123
|
</table>
|
|
119
124
|
|
package/docs/quickstart.html
CHANGED
|
@@ -5,6 +5,7 @@ title: Quick Start
|
|
|
5
5
|
|
|
6
6
|
Here's a small node.js application which displays all the target mappings in Campaign.
|
|
7
7
|
|
|
8
|
+
<p class="info">The SDK requires <b>Node.js version 20</b> or above.</p>
|
|
8
9
|
|
|
9
10
|
<p>Create a new node.js application</p>
|
|
10
11
|
<pre class="code">
|
|
@@ -63,7 +64,7 @@ node index.js
|
|
|
63
64
|
|
|
64
65
|
<p>It will display something like this</p>
|
|
65
66
|
<pre class="code">
|
|
66
|
-
ACC Javascript SDK version 1.
|
|
67
|
+
ACC Javascript SDK version 1.2.0
|
|
67
68
|
Target mappings: {"deliveryMapping":[{"id":"1747","label":"Recipients","name":"mapRecipient","schema":"nms:recipient"},{"id":"1826","label":"Subscriptions","name":"mapSubscribe","schema":"nms:subscription"},{"id":"1827","label":"Operators","name":"mapOperator","schema":"xtk:operator"},{"id":"1828","label":"External file","name":"mapAny","schema":""},{"id":"1830","label":"Visitors","name":"mapVisitor","schema":"nms:visitor"},{"id":"2035","label":"Real time event","name":"mapRtEvent","schema":"nms:rtEvent"},{"id":"2036","label":"Batch event","name":"mapBatchEvent","schema":"nms:batchEvent"},{"id":"2070","label":"Subscriber applications","name":"mapAppSubscriptionRcp","schema":"nms:appSubscriptionRcp"}]}
|
|
68
69
|
</pre>
|
|
69
70
|
|
package/docs/release.html
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
schema: spec-driven
|
|
2
|
+
|
|
3
|
+
# Project context (optional)
|
|
4
|
+
# This is shown to AI when creating artifacts.
|
|
5
|
+
# Add your tech stack, conventions, style guides, domain knowledge, etc.
|
|
6
|
+
# Example:
|
|
7
|
+
# context: |
|
|
8
|
+
# Tech stack: TypeScript, React, Node.js
|
|
9
|
+
# We use conventional commits
|
|
10
|
+
# Domain: e-commerce platform
|
|
11
|
+
|
|
12
|
+
# Per-artifact rules (optional)
|
|
13
|
+
# Add custom rules for specific artifacts.
|
|
14
|
+
# Example:
|
|
15
|
+
# rules:
|
|
16
|
+
# proposal:
|
|
17
|
+
# - Keep proposals under 500 words
|
|
18
|
+
# - Always include a "Non-goals" section
|
|
19
|
+
# tasks:
|
|
20
|
+
# - Break tasks into chunks of max 2 hours
|