@adobe/acc-js-sdk 1.1.56 → 1.1.58

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.
@@ -2,7 +2,32 @@
2
2
  layout: page
3
3
  title: Change Log
4
4
  ---
5
- <section class="changelog"><h1>Version 1.1.55</h1>
5
+
6
+ <section class="changelog"><h1>Version 1.1.58</h1>
7
+ <h2>2025/06/24</h2>
8
+ <li>
9
+ Bumped dependencies version to fix vulnerabilities
10
+ </li>
11
+ <li>
12
+ Improved resource upload so that a custom resource id can be passed
13
+ </li>
14
+ </section>
15
+
16
+ <section class="changelog"><h1>Version 1.1.57</h1>
17
+ <h2>2025/06/24</h2>
18
+ <li>
19
+ Bumped dependencies version to fix vulnerabilities
20
+ </li>
21
+ <li>
22
+ Update getSchema function to support XDM schemas (without caching)
23
+ </li>
24
+ <li>
25
+ New "instanceKey" connection parameter can be used to configure the cache key
26
+ </li>
27
+ </section>
28
+
29
+
30
+ <section class="changelog"><h1>Version 1.1.56</h1>
6
31
  <h2>2025/01/27</h2>
7
32
  <li>
8
33
  Bumped dependencies version to fix vulnerabilities
@@ -104,6 +104,16 @@ const connectionParameters = sdk.ConnectionParameters.ofUserAndPassword(
104
104
  <td>number</td>
105
105
  <td>Can be used to set the APIs call timeout (in ms)</td>
106
106
  </tr>
107
+ <tr>
108
+ <td>cacheRootKey</td>
109
+ <td>"default" or "none"</td>
110
+ <td>Determine the prefix to use for the keys in the caches of schemas, options, etc.<p>The value "default" means that cached keys are prefixed with "acc.js.sdk.${this.sdk.getSDKVersion().version}.${instanceKey}.cache."</p></td>
111
+ </tr>
112
+ <tr>
113
+ <td>instanceKey</td>
114
+ <td>string</td>
115
+ <td>An optional value to override the instance key which is used for the caches of schemas, options, etc.</td>
116
+ </tr>
107
117
  </tbody>
108
118
  </table>
109
119
 
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.56",
3
+ "version": "1.1.58",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@adobe/acc-js-sdk",
9
- "version": "1.1.56",
9
+ "version": "1.1.58",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "axios": "^1.7.8",
@@ -1275,9 +1275,10 @@
1275
1275
  "license": "MIT"
1276
1276
  },
1277
1277
  "node_modules/brace-expansion": {
1278
- "version": "1.1.11",
1278
+ "version": "1.1.12",
1279
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
1280
+ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
1279
1281
  "dev": true,
1280
- "license": "MIT",
1281
1282
  "dependencies": {
1282
1283
  "balanced-match": "^1.0.0",
1283
1284
  "concat-map": "0.0.1"
@@ -1335,6 +1336,18 @@
1335
1336
  "dev": true,
1336
1337
  "license": "MIT"
1337
1338
  },
1339
+ "node_modules/call-bind-apply-helpers": {
1340
+ "version": "1.0.2",
1341
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
1342
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
1343
+ "dependencies": {
1344
+ "es-errors": "^1.3.0",
1345
+ "function-bind": "^1.1.2"
1346
+ },
1347
+ "engines": {
1348
+ "node": ">= 0.4"
1349
+ }
1350
+ },
1338
1351
  "node_modules/callsites": {
1339
1352
  "version": "3.1.0",
1340
1353
  "dev": true,
@@ -1676,6 +1689,19 @@
1676
1689
  "domelementtype": "1"
1677
1690
  }
1678
1691
  },
1692
+ "node_modules/dunder-proto": {
1693
+ "version": "1.0.1",
1694
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
1695
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
1696
+ "dependencies": {
1697
+ "call-bind-apply-helpers": "^1.0.1",
1698
+ "es-errors": "^1.3.0",
1699
+ "gopd": "^1.2.0"
1700
+ },
1701
+ "engines": {
1702
+ "node": ">= 0.4"
1703
+ }
1704
+ },
1679
1705
  "node_modules/electron-to-chromium": {
1680
1706
  "version": "1.4.284",
1681
1707
  "dev": true,
@@ -1710,6 +1736,47 @@
1710
1736
  "is-arrayish": "^0.2.1"
1711
1737
  }
1712
1738
  },
1739
+ "node_modules/es-define-property": {
1740
+ "version": "1.0.1",
1741
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
1742
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
1743
+ "engines": {
1744
+ "node": ">= 0.4"
1745
+ }
1746
+ },
1747
+ "node_modules/es-errors": {
1748
+ "version": "1.3.0",
1749
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
1750
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
1751
+ "engines": {
1752
+ "node": ">= 0.4"
1753
+ }
1754
+ },
1755
+ "node_modules/es-object-atoms": {
1756
+ "version": "1.1.1",
1757
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
1758
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
1759
+ "dependencies": {
1760
+ "es-errors": "^1.3.0"
1761
+ },
1762
+ "engines": {
1763
+ "node": ">= 0.4"
1764
+ }
1765
+ },
1766
+ "node_modules/es-set-tostringtag": {
1767
+ "version": "2.1.0",
1768
+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
1769
+ "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
1770
+ "dependencies": {
1771
+ "es-errors": "^1.3.0",
1772
+ "get-intrinsic": "^1.2.6",
1773
+ "has-tostringtag": "^1.0.2",
1774
+ "hasown": "^2.0.2"
1775
+ },
1776
+ "engines": {
1777
+ "node": ">= 0.4"
1778
+ }
1779
+ },
1713
1780
  "node_modules/escalade": {
1714
1781
  "version": "3.1.1",
1715
1782
  "dev": true,
@@ -2088,11 +2155,14 @@
2088
2155
  }
2089
2156
  },
2090
2157
  "node_modules/form-data": {
2091
- "version": "4.0.0",
2092
- "license": "MIT",
2158
+ "version": "4.0.4",
2159
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
2160
+ "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
2093
2161
  "dependencies": {
2094
2162
  "asynckit": "^0.4.0",
2095
2163
  "combined-stream": "^1.0.8",
2164
+ "es-set-tostringtag": "^2.1.0",
2165
+ "hasown": "^2.0.2",
2096
2166
  "mime-types": "^2.1.12"
2097
2167
  },
2098
2168
  "engines": {
@@ -2117,9 +2187,12 @@
2117
2187
  }
2118
2188
  },
2119
2189
  "node_modules/function-bind": {
2120
- "version": "1.1.1",
2121
- "dev": true,
2122
- "license": "MIT"
2190
+ "version": "1.1.2",
2191
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
2192
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
2193
+ "funding": {
2194
+ "url": "https://github.com/sponsors/ljharb"
2195
+ }
2123
2196
  },
2124
2197
  "node_modules/functional-red-black-tree": {
2125
2198
  "version": "1.0.1",
@@ -2142,6 +2215,29 @@
2142
2215
  "node": "6.* || 8.* || >= 10.*"
2143
2216
  }
2144
2217
  },
2218
+ "node_modules/get-intrinsic": {
2219
+ "version": "1.3.0",
2220
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
2221
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
2222
+ "dependencies": {
2223
+ "call-bind-apply-helpers": "^1.0.2",
2224
+ "es-define-property": "^1.0.1",
2225
+ "es-errors": "^1.3.0",
2226
+ "es-object-atoms": "^1.1.1",
2227
+ "function-bind": "^1.1.2",
2228
+ "get-proto": "^1.0.1",
2229
+ "gopd": "^1.2.0",
2230
+ "has-symbols": "^1.1.0",
2231
+ "hasown": "^2.0.2",
2232
+ "math-intrinsics": "^1.1.0"
2233
+ },
2234
+ "engines": {
2235
+ "node": ">= 0.4"
2236
+ },
2237
+ "funding": {
2238
+ "url": "https://github.com/sponsors/ljharb"
2239
+ }
2240
+ },
2145
2241
  "node_modules/get-package-type": {
2146
2242
  "version": "0.1.0",
2147
2243
  "dev": true,
@@ -2150,6 +2246,18 @@
2150
2246
  "node": ">=8.0.0"
2151
2247
  }
2152
2248
  },
2249
+ "node_modules/get-proto": {
2250
+ "version": "1.0.1",
2251
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
2252
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
2253
+ "dependencies": {
2254
+ "dunder-proto": "^1.0.1",
2255
+ "es-object-atoms": "^1.0.0"
2256
+ },
2257
+ "engines": {
2258
+ "node": ">= 0.4"
2259
+ }
2260
+ },
2153
2261
  "node_modules/get-stream": {
2154
2262
  "version": "6.0.1",
2155
2263
  "dev": true,
@@ -2205,6 +2313,17 @@
2205
2313
  "url": "https://github.com/sponsors/sindresorhus"
2206
2314
  }
2207
2315
  },
2316
+ "node_modules/gopd": {
2317
+ "version": "1.2.0",
2318
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
2319
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
2320
+ "engines": {
2321
+ "node": ">= 0.4"
2322
+ },
2323
+ "funding": {
2324
+ "url": "https://github.com/sponsors/ljharb"
2325
+ }
2326
+ },
2208
2327
  "node_modules/graceful-fs": {
2209
2328
  "version": "4.2.10",
2210
2329
  "dev": true,
@@ -2229,6 +2348,42 @@
2229
2348
  "node": ">=8"
2230
2349
  }
2231
2350
  },
2351
+ "node_modules/has-symbols": {
2352
+ "version": "1.1.0",
2353
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
2354
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
2355
+ "engines": {
2356
+ "node": ">= 0.4"
2357
+ },
2358
+ "funding": {
2359
+ "url": "https://github.com/sponsors/ljharb"
2360
+ }
2361
+ },
2362
+ "node_modules/has-tostringtag": {
2363
+ "version": "1.0.2",
2364
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
2365
+ "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
2366
+ "dependencies": {
2367
+ "has-symbols": "^1.0.3"
2368
+ },
2369
+ "engines": {
2370
+ "node": ">= 0.4"
2371
+ },
2372
+ "funding": {
2373
+ "url": "https://github.com/sponsors/ljharb"
2374
+ }
2375
+ },
2376
+ "node_modules/hasown": {
2377
+ "version": "2.0.2",
2378
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
2379
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
2380
+ "dependencies": {
2381
+ "function-bind": "^1.1.2"
2382
+ },
2383
+ "engines": {
2384
+ "node": ">= 0.4"
2385
+ }
2386
+ },
2232
2387
  "node_modules/html-encoding-sniffer": {
2233
2388
  "version": "3.0.0",
2234
2389
  "license": "MIT",
@@ -3505,6 +3660,14 @@
3505
3660
  "node": ">= 12"
3506
3661
  }
3507
3662
  },
3663
+ "node_modules/math-intrinsics": {
3664
+ "version": "1.1.0",
3665
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
3666
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
3667
+ "engines": {
3668
+ "node": ">= 0.4"
3669
+ }
3670
+ },
3508
3671
  "node_modules/mdurl": {
3509
3672
  "version": "1.0.1",
3510
3673
  "dev": true,
@@ -5403,7 +5566,9 @@
5403
5566
  "dev": true
5404
5567
  },
5405
5568
  "brace-expansion": {
5406
- "version": "1.1.11",
5569
+ "version": "1.1.12",
5570
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
5571
+ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
5407
5572
  "dev": true,
5408
5573
  "requires": {
5409
5574
  "balanced-match": "^1.0.0",
@@ -5440,6 +5605,15 @@
5440
5605
  "version": "1.1.2",
5441
5606
  "dev": true
5442
5607
  },
5608
+ "call-bind-apply-helpers": {
5609
+ "version": "1.0.2",
5610
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
5611
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
5612
+ "requires": {
5613
+ "es-errors": "^1.3.0",
5614
+ "function-bind": "^1.1.2"
5615
+ }
5616
+ },
5443
5617
  "callsites": {
5444
5618
  "version": "3.1.0",
5445
5619
  "dev": true
@@ -5663,6 +5837,16 @@
5663
5837
  "domelementtype": "1"
5664
5838
  }
5665
5839
  },
5840
+ "dunder-proto": {
5841
+ "version": "1.0.1",
5842
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
5843
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
5844
+ "requires": {
5845
+ "call-bind-apply-helpers": "^1.0.1",
5846
+ "es-errors": "^1.3.0",
5847
+ "gopd": "^1.2.0"
5848
+ }
5849
+ },
5666
5850
  "electron-to-chromium": {
5667
5851
  "version": "1.4.284",
5668
5852
  "dev": true
@@ -5686,6 +5870,35 @@
5686
5870
  "is-arrayish": "^0.2.1"
5687
5871
  }
5688
5872
  },
5873
+ "es-define-property": {
5874
+ "version": "1.0.1",
5875
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
5876
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="
5877
+ },
5878
+ "es-errors": {
5879
+ "version": "1.3.0",
5880
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
5881
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="
5882
+ },
5883
+ "es-object-atoms": {
5884
+ "version": "1.1.1",
5885
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
5886
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
5887
+ "requires": {
5888
+ "es-errors": "^1.3.0"
5889
+ }
5890
+ },
5891
+ "es-set-tostringtag": {
5892
+ "version": "2.1.0",
5893
+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
5894
+ "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
5895
+ "requires": {
5896
+ "es-errors": "^1.3.0",
5897
+ "get-intrinsic": "^1.2.6",
5898
+ "has-tostringtag": "^1.0.2",
5899
+ "hasown": "^2.0.2"
5900
+ }
5901
+ },
5689
5902
  "escalade": {
5690
5903
  "version": "3.1.1",
5691
5904
  "dev": true
@@ -5921,10 +6134,14 @@
5921
6134
  "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA=="
5922
6135
  },
5923
6136
  "form-data": {
5924
- "version": "4.0.0",
6137
+ "version": "4.0.4",
6138
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
6139
+ "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
5925
6140
  "requires": {
5926
6141
  "asynckit": "^0.4.0",
5927
6142
  "combined-stream": "^1.0.8",
6143
+ "es-set-tostringtag": "^2.1.0",
6144
+ "hasown": "^2.0.2",
5928
6145
  "mime-types": "^2.1.12"
5929
6146
  }
5930
6147
  },
@@ -5938,8 +6155,9 @@
5938
6155
  "optional": true
5939
6156
  },
5940
6157
  "function-bind": {
5941
- "version": "1.1.1",
5942
- "dev": true
6158
+ "version": "1.1.2",
6159
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
6160
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="
5943
6161
  },
5944
6162
  "functional-red-black-tree": {
5945
6163
  "version": "1.0.1",
@@ -5953,10 +6171,36 @@
5953
6171
  "version": "2.0.5",
5954
6172
  "dev": true
5955
6173
  },
6174
+ "get-intrinsic": {
6175
+ "version": "1.3.0",
6176
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
6177
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
6178
+ "requires": {
6179
+ "call-bind-apply-helpers": "^1.0.2",
6180
+ "es-define-property": "^1.0.1",
6181
+ "es-errors": "^1.3.0",
6182
+ "es-object-atoms": "^1.1.1",
6183
+ "function-bind": "^1.1.2",
6184
+ "get-proto": "^1.0.1",
6185
+ "gopd": "^1.2.0",
6186
+ "has-symbols": "^1.1.0",
6187
+ "hasown": "^2.0.2",
6188
+ "math-intrinsics": "^1.1.0"
6189
+ }
6190
+ },
5956
6191
  "get-package-type": {
5957
6192
  "version": "0.1.0",
5958
6193
  "dev": true
5959
6194
  },
6195
+ "get-proto": {
6196
+ "version": "1.0.1",
6197
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
6198
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
6199
+ "requires": {
6200
+ "dunder-proto": "^1.0.1",
6201
+ "es-object-atoms": "^1.0.0"
6202
+ }
6203
+ },
5960
6204
  "get-stream": {
5961
6205
  "version": "6.0.1",
5962
6206
  "dev": true
@@ -5987,6 +6231,11 @@
5987
6231
  "type-fest": "^0.20.2"
5988
6232
  }
5989
6233
  },
6234
+ "gopd": {
6235
+ "version": "1.2.0",
6236
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
6237
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="
6238
+ },
5990
6239
  "graceful-fs": {
5991
6240
  "version": "4.2.10",
5992
6241
  "dev": true
@@ -6002,6 +6251,27 @@
6002
6251
  "version": "4.0.0",
6003
6252
  "dev": true
6004
6253
  },
6254
+ "has-symbols": {
6255
+ "version": "1.1.0",
6256
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
6257
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="
6258
+ },
6259
+ "has-tostringtag": {
6260
+ "version": "1.0.2",
6261
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
6262
+ "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
6263
+ "requires": {
6264
+ "has-symbols": "^1.0.3"
6265
+ }
6266
+ },
6267
+ "hasown": {
6268
+ "version": "2.0.2",
6269
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
6270
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
6271
+ "requires": {
6272
+ "function-bind": "^1.1.2"
6273
+ }
6274
+ },
6005
6275
  "html-encoding-sniffer": {
6006
6276
  "version": "3.0.0",
6007
6277
  "requires": {
@@ -6864,6 +7134,11 @@
6864
7134
  "version": "4.2.3",
6865
7135
  "dev": true
6866
7136
  },
7137
+ "math-intrinsics": {
7138
+ "version": "1.1.0",
7139
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
7140
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="
7141
+ },
6867
7142
  "mdurl": {
6868
7143
  "version": "1.0.1",
6869
7144
  "dev": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.56",
3
+ "version": "1.1.58",
4
4
  "description": "ACC Javascript SDK",
5
5
  "main": "src/index.js",
6
6
  "homepage": "https://github.com/adobe/acc-js-sdk#readme",
package/src/client.js CHANGED
@@ -38,7 +38,7 @@ const EntityAccessor = require('./entityAccessor.js').EntityAccessor;
38
38
  const { Util } = require('./util.js');
39
39
  const { XtkJobInterface } = require('./xtkJob.js');
40
40
  const qsStringify = require('qs-stringify');
41
-
41
+ const crypto = require('crypto');
42
42
  /**
43
43
  * @namespace Campaign
44
44
  *
@@ -308,6 +308,7 @@ class Credentials {
308
308
  * @property {boolean} noMethodInURL - Can be set to true to remove the method name from the URL
309
309
  * @property {number} timeout - Can be set to change the HTTP call timeout. Value is passed in ms.
310
310
  * @property {string} cacheRootKey - "default" or "none" - determine the prefix to use for the keys in the caches of schemas, options, etc.
311
+ * @property {string} instanceKey - an optional value to override the instance key which is used for the caches of schemas, options, etc.
311
312
  * @memberOf Campaign
312
313
  */
313
314
 
@@ -582,7 +583,7 @@ const fileUploader = (client) => {
582
583
  * @param {FileUploadOptions|undefined} options
583
584
  * @returns {Promise<{name: string, md5: string, type: string, size: string, url: string}>}
584
585
  */
585
- upload: (file, options) => {
586
+ upload: (file, options, fileResPrefix) => {
586
587
  console.log(`fileuploader.upload is an experimental feature and is not currently fully functional. It is work in progress and will change in the future.`);
587
588
  return new Promise((resolve, reject) => {
588
589
  const action = (options && options.action) ? options.action : "publishIfNeeded";
@@ -630,12 +631,19 @@ const fileUploader = (client) => {
630
631
  };
631
632
  if (action === "publishIfNeeded") {
632
633
  try {
633
- const counter =
634
- await client.NLWS.xtkCounter.increaseValue(
635
- { name: 'xtkResource' }
636
- );
634
+ // Following https://jira.corp.adobe.com/browse/NEO-88828 the fileRes internal name is defined as is:
635
+ // If a prefix is not provided, we keep the old behavior which is to use the prefix 'RES' and the xtkResource counter (i.e.'RES1'...)
636
+ // If a prefix is provided, we use it with a UUID (i.e. 'customPrefix-123e4567-e89b-12d3-a456-426614174000')
637
+ const oldBehaviorPrefix = 'RES';
638
+ const prefix = Util.validateFileResPrefix(fileResPrefix, oldBehaviorPrefix);
639
+
640
+ const suffix = (prefix === oldBehaviorPrefix) ?
641
+ await client.NLWS.xtkCounter.increaseValue({ name: 'xtkResource' }) : crypto.randomUUID();
642
+
643
+ const internalName = (prefix === oldBehaviorPrefix) ? `${prefix}${suffix}` : `${prefix}_${suffix}`;
644
+
637
645
  const fileRes = {
638
- internalName: 'RES' + counter,
646
+ internalName,
639
647
  md5: data[0].md5,
640
648
  label: data[0].fileName,
641
649
  fileName: data[0].fileName,
@@ -829,8 +837,10 @@ class Client {
829
837
  this._secretKeyCipher = undefined;
830
838
 
831
839
  this._storage = connectionParameters._options._storage;
832
- // TODO late cache initiallzation because need XtkDatabaseId / instance name
833
- var instanceKey = connectionParameters._endpoint || "";
840
+
841
+ var instanceKey = connectionParameters._options.instanceKey;
842
+ if (!instanceKey)
843
+ instanceKey = connectionParameters._endpoint || "";
834
844
  if (instanceKey.startsWith("http://")) instanceKey = instanceKey.substr(7);
835
845
  if (instanceKey.startsWith("https://")) instanceKey = instanceKey.substr(8);
836
846
 
@@ -894,6 +904,7 @@ class Client {
894
904
  endpoint: this._connectionParameters._endpoint,
895
905
  createdAt: Date.now(),
896
906
  clientApp: this._connectionParameters._options.clientApp,
907
+ instanceKey: instanceKey
897
908
  }
898
909
  };
899
910
  if (this._connectionParameters._credentials) {
@@ -1928,6 +1939,14 @@ class Client {
1928
1939
  * @returns {XML.XtkObject} the schema definition, as either a DOM document or a JSON object
1929
1940
  */
1930
1941
  async getSchema(schemaId, representation, internal) {
1942
+ // Support for Orchestrated Campaign XDM schemas (do not use cache)
1943
+ const pipeIndex = schemaId.indexOf("|");
1944
+ if( pipeIndex != -1 && schemaId.startsWith("xdm:") ) {
1945
+ const entityType = schemaId.substring(0, pipeIndex);
1946
+ schemaId = schemaId.substring(pipeIndex + 1);
1947
+ const entity = await this.getEntityIfMoreRecent(entityType, schemaId, representation, internal);
1948
+ return entity;
1949
+ }
1931
1950
  var entity = await this._entityCache.get("xtk:schema", schemaId);
1932
1951
  if (!entity) {
1933
1952
  // special case of "temp:group:*" schemas for nms:group
package/src/util.js CHANGED
@@ -143,6 +143,16 @@ class Util {
143
143
  return schemaId;
144
144
  }
145
145
 
146
+ static validateFileResPrefix(prefix, defaultPrefix = "RES") {
147
+ const regex = /^[A-Za-z_][A-Za-z0-9_]*$/;
148
+
149
+ if (typeof prefix !== "string" || !regex.test(prefix)) {
150
+ return defaultPrefix;
151
+ }
152
+
153
+ return prefix;
154
+ }
155
+
146
156
  /**
147
157
  * Test if an object is a promise
148
158
  * @param {*} object the object to test
@@ -27,6 +27,7 @@ const { EntityAccessor } = require('../src/entityAccessor.js');
27
27
  const { JSDOM } = require('jsdom');
28
28
  const dom = new JSDOM();
29
29
  const { CampaignException } = require('../src/campaign.js');
30
+ const { Util } = require('../src/util');
30
31
 
31
32
  describe('ACC Client', function () {
32
33
 
@@ -435,6 +436,20 @@ describe('ACC Client', function () {
435
436
  await client.NLWS.xtkSession.logoff();
436
437
  });
437
438
 
439
+ it("Should return XDM schema definition", async () => {
440
+ const client = await Mock.makeClient();
441
+ client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
442
+ await client.NLWS.xtkSession.logon();
443
+
444
+ client._transport.mockReturnValueOnce(Mock.GET_UNION_PROFILE_SCHEMA_RESPONSE);
445
+ var schema = await client.getSchema("xdm:tenant:unions|_xdm.context.profile__union");
446
+ expect(schema["namespace"]).toBe("xdm");
447
+ expect(schema["name"]).toBe("profile__union");
448
+
449
+ client._transport.mockReturnValueOnce(Mock.LOGOFF_RESPONSE);
450
+ await client.NLWS.xtkSession.logoff();
451
+ });
452
+
438
453
  it("Should return temp group schema definition", async () => {
439
454
  const client = await Mock.makeClient();
440
455
  client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
@@ -2741,6 +2756,15 @@ describe('ACC Client', function () {
2741
2756
  expect(client._optionCache._storage._rootKey).toBe(`OptionCache$`);
2742
2757
  });
2743
2758
 
2759
+ it("Should support instanceKey", async () => {
2760
+ // Default has version & instance name
2761
+ const version = sdk.getSDKVersion().version; // "${version}" or similar
2762
+ connectionParameters = sdk.ConnectionParameters.ofUserAndPassword("http://acc-sdk:8080", "admin", "admin");
2763
+ connectionParameters = sdk.ConnectionParameters.ofUserAndPassword("http://acc-sdk:8080", "admin", "admin", { instanceKey: "hello" });
2764
+ var client = await sdk.init(connectionParameters);
2765
+ expect(client._optionCache._storage._rootKey).toBe(`acc.js.sdk.${version}.hello.cache.OptionCache$`);
2766
+ });
2767
+
2744
2768
  describe("Should simulate the Shell Cache API", () => {
2745
2769
  // See https://github.com/AdobeDocs/exc-app/blob/master/docs/modules/cache.md#sample-code
2746
2770
  it("Sould get cached option", async () => {
@@ -4195,6 +4219,54 @@ describe('ACC Client', function () {
4195
4219
  });
4196
4220
  });
4197
4221
  });
4222
+
4223
+ it("Test uploads by specifying a file prefix", async () => {
4224
+ // Create a mock client and logon
4225
+ const client = await Mock.makeClient();
4226
+ client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
4227
+ await client.NLWS.xtkSession.logon();
4228
+
4229
+ // Mock the upload protocol
4230
+ // - the upload.jsp (which returns the content of an iframe and JS to eval)
4231
+ // - call to xtk:session#Write
4232
+ // - call to xtk:fileRes#PublishIfNeeded
4233
+ // - call to xtk:fileRes#GetURL
4234
+
4235
+ client._transport.mockReturnValueOnce(
4236
+ Promise.resolve(`Ok
4237
+ <html xmlns="http://www.w3.org/1999/xhtml">
4238
+ <head>
4239
+ <script type="text/javascript">if(window.parent&&window.parent.document.controller&&"function"==typeof window.parent.document.controller.uploadFileCallBack){var aFilesInfo=new Array;aFilesInfo.push({paramName:"file",fileName:"test.txt",newFileName:"d8e8fca2dc0f896fd7cb4cb0031ba249.txt",md5:"d8e8fca2dc0f896fd7cb4cb0031ba249"}),window.parent.document.controller.uploadFileCallBack(aFilesInfo)}</script>
4240
+ </head>
4241
+ <body></body>
4242
+ </html>`)
4243
+ ); // upload.jsp
4244
+
4245
+ client._transport.mockReturnValueOnce(
4246
+ Mock.GET_XTK_SESSION_SCHEMA_RESPONSE
4247
+ ); // GetEntityIfMoreRecentResponse - session
4248
+
4249
+ client._transport.mockReturnValueOnce(Mock.FILE_RES_WRITE_RESPONSE); // xtk:session#Write
4250
+ jest.spyOn(Util, 'validateFileResPrefix').mockImplementation((param) => param);
4251
+
4252
+ client._transport.mockReturnValueOnce(
4253
+ Promise.resolve(Mock.GET_FILERES_QUERY_SCHEMA_RESPONSE)
4254
+ ); // GetEntityIfMoreRecentResponse - fileRes
4255
+ client._transport.mockReturnValueOnce(
4256
+ Promise.resolve(Mock.PUBLISH_IF_NEEDED_RESPONSE)
4257
+ ); // xtk:fileRes#PublishIfNeeded
4258
+
4259
+ client._transport.mockReturnValueOnce(
4260
+ Promise.resolve(Mock.GET_URL_RESPONSE)
4261
+ ); // xtk:fileRes#GetURL
4262
+
4263
+ // Call upload
4264
+ const result = await client.fileUploader.upload({
4265
+ type: "text/html",
4266
+ size: 12345,
4267
+ }, undefined, 'PREFIX');
4268
+ expect(Util.validateFileResPrefix).toHaveBeenLastCalledWith('PREFIX', 'RES');
4269
+ });
4198
4270
  });
4199
4271
 
4200
4272
  describe('uploadAemAsset', () => {
package/test/mock.js CHANGED
@@ -455,6 +455,28 @@ const GET_XTK_QUERY_SCHEMA_RESPONSE = Promise.resolve(`<?xml version='1.0'?>
455
455
  </SOAP-ENV:Body>
456
456
  </SOAP-ENV:Envelope>`);
457
457
 
458
+ const GET_UNION_PROFILE_SCHEMA_RESPONSE = Promise.resolve(`<?xml version='1.0'?>
459
+ <SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:wpp:default' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
460
+ <SOAP-ENV:Body>
461
+ <GetEntityIfMoreRecentResponse xmlns='urn:wpp:default' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
462
+ <pdomDoc xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'>
463
+
464
+ <schema label="XDM Individual Profile" labelSingular="XDM Individual Profile" library="true" name="profile__union" namespace="xdm" xtkschema="xtk:schema">
465
+ <element autopk="false" label="XDM Individual Profile" name="profile__union" pkgStatus="never">
466
+ <element name="_ajobatchjourneystage" type="">
467
+ <attribute label="email" length="255" name="email" type="string"/>
468
+ <attribute label="Loyalty Member" name="loyaltyMember" type="boolean"/>
469
+ <attribute label="Use Case ID" length="255" name="useCaseInstanceId" type="string"/>
470
+ </element>
471
+ <attribute label="Identifier" length="255" name="_id" type="string"/>
472
+ </element>
473
+ </schema>
474
+
475
+ </pdomDoc>
476
+ </GetEntityIfMoreRecentResponse>
477
+ </SOAP-ENV:Body>
478
+ </SOAP-ENV:Envelope>`);
479
+
458
480
  const GET_NMS_DELIVERY_SCHEMA_RESPONSE = Promise.resolve(`<?xml version='1.0'?>
459
481
  <SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:wpp:default' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
460
482
  <SOAP-ENV:Body>
@@ -1127,6 +1149,7 @@ exports.Mock = {
1127
1149
  GET_OPTION_NOTFOUND_RESPONSE: GET_OPTION_NOTFOUND_RESPONSE,
1128
1150
  GET_OPTION_MISSING_DATA_RESPONSE: GET_OPTION_MISSING_DATA_RESPONSE,
1129
1151
  GET_XTK_QUERY_SCHEMA_RESPONSE: GET_XTK_QUERY_SCHEMA_RESPONSE,
1152
+ GET_UNION_PROFILE_SCHEMA_RESPONSE: GET_UNION_PROFILE_SCHEMA_RESPONSE,
1130
1153
  GET_NMS_DELIVERY_SCHEMA_RESPONSE: GET_NMS_DELIVERY_SCHEMA_RESPONSE,
1131
1154
  GET_DELIVERY_TEST_RESPONSE: GET_DELIVERY_TEST_RESPONSE,
1132
1155
  GET_MID_EXT_ACCOUNT_RESPONSE: GET_MID_EXT_ACCOUNT_RESPONSE,
package/test/util.test.js CHANGED
@@ -446,5 +446,17 @@ describe('Util', function() {
446
446
  await expect(Util.asPromise(Promise.resolve(3))).resolves.toBe(3);
447
447
  });
448
448
  });
449
+
450
+ describe("Validate file res prefix", () => {
451
+ it("Should return the correct prefix", () => {
452
+ expect(Util.validateFileResPrefix("customPrefix")).toBe("customPrefix");
453
+ expect(Util.validateFileResPrefix("1invalidPrefix")).toBe("RES");
454
+ expect(Util.validateFileResPrefix("anotherInvalidPrefix!")).toBe("RES");
455
+ expect(Util.validateFileResPrefix("valid_prefix_2")).toBe("valid_prefix_2");
456
+
457
+ expect(Util.validateFileResPrefix("valid_prefix_3", "customDefault")).toBe("valid_prefix_3");
458
+ expect(Util.validateFileResPrefix("132Invalid", "customDefault")).toBe("customDefault");
459
+ });
460
+ });
449
461
  });
450
462