@adobe/acc-js-sdk 1.1.36 → 1.1.37
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/docs/changeLog.html +7 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/src/application.js +4 -1
- package/test/application.test.js +9 -1
- package/test/client.test.js +24 -5
package/docs/changeLog.html
CHANGED
|
@@ -3,6 +3,13 @@ layout: page
|
|
|
3
3
|
title: Change Log
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<section class="changelog"><h1>Version 1.1.37</h1>
|
|
7
|
+
<h2>2023/08/07</h2>
|
|
8
|
+
<li>
|
|
9
|
+
Fix missing schema localisation for description id when description is empty in the source schema
|
|
10
|
+
</li>
|
|
11
|
+
</section>
|
|
12
|
+
|
|
6
13
|
<section class="changelog"><h1>Version 1.1.36</h1>
|
|
7
14
|
<h2>2023/07/28</h2>
|
|
8
15
|
<li>
|
package/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/acc-js-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.37",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@adobe/acc-js-sdk",
|
|
9
|
-
"version": "1.1.
|
|
9
|
+
"version": "1.1.37",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "^1.2.1",
|
package/package.json
CHANGED
package/src/application.js
CHANGED
|
@@ -62,7 +62,10 @@ function propagateImplicitValues(xtkDesc, labelOnly) {
|
|
|
62
62
|
// Force first letter as uppercase
|
|
63
63
|
xtkDesc.label = xtkDesc.label.substring(0, 1).toUpperCase() + xtkDesc.label.substring(1);
|
|
64
64
|
}
|
|
65
|
-
if (!labelOnly && !xtkDesc.description)
|
|
65
|
+
if (!labelOnly && !xtkDesc.description) {
|
|
66
|
+
xtkDesc.description = xtkDesc.label;
|
|
67
|
+
xtkDesc.descriptionLocalizationId = xtkDesc.labelLocalizationId;
|
|
68
|
+
}
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
// ========================================================================================
|
package/test/application.test.js
CHANGED
|
@@ -2400,7 +2400,15 @@ describe('Application', () => {
|
|
|
2400
2400
|
expect(root.labelLocalizationId).toBe('nms__recipient__e____recipient__@label');
|
|
2401
2401
|
expect(root.descriptionLocalizationId).toBe('nms__recipient__e____recipient__@desc');
|
|
2402
2402
|
});
|
|
2403
|
-
|
|
2403
|
+
|
|
2404
|
+
it("root node should have the label localization id when label exist but description does not exist", () => {
|
|
2405
|
+
const xml = DomUtil.parse("<schema namespace='nms' name='recipient'><element name='recipient' label='Recipients' /></schema>");
|
|
2406
|
+
const schema = newSchema(xml);
|
|
2407
|
+
const root = schema.root;
|
|
2408
|
+
expect(root.labelLocalizationId).toBe('nms__recipient__e____recipient__@label');
|
|
2409
|
+
expect(root.descriptionLocalizationId).toBe('nms__recipient__e____recipient__@label');
|
|
2410
|
+
});
|
|
2411
|
+
|
|
2404
2412
|
it("child node should have a correct label localization id", () => {
|
|
2405
2413
|
const xml = DomUtil.parse("<schema namespace='nms' name='recipient'><element name='lib' label='library' desc='library'/><element name='recipient' label='Recipients'/></schema>");
|
|
2406
2414
|
const schema = newSchema(xml);
|
package/test/client.test.js
CHANGED
|
@@ -1756,11 +1756,11 @@ describe('ACC Client', function () {
|
|
|
1756
1756
|
await client.NLWS.xtkSession.logon();
|
|
1757
1757
|
|
|
1758
1758
|
const mockResponse = {
|
|
1759
|
-
"publishedURL" : "http://trk-inst-xyz.
|
|
1759
|
+
"publishedURL" : "http://trk-inst-xyz.camp.adobe.com/res/trk-inst/409afb8798180a36591456e152b6c406.jpeg"
|
|
1760
1760
|
};
|
|
1761
1761
|
client._bearerToken = 'Bearer 1234567890';
|
|
1762
1762
|
client._transport.mockReturnValueOnce(mockResponse);
|
|
1763
|
-
const response = await client.fileUploader.uploadAemAsset("https://author-
|
|
1763
|
+
const response = await client.fileUploader.uploadAemAsset("https://author-stg.aem.adobe.com/adobe/repository/content/dam/projects/children-kids-group-eating-ice-cream-funny-party-72701973%20%281%29%20%2812%29%20%282%29%20%283%29.jpg;api=block_download");
|
|
1764
1764
|
expect(response).toBe(mockResponse);
|
|
1765
1765
|
|
|
1766
1766
|
client._transport.mockReturnValueOnce(Mock.LOGOFF_RESPONSE);
|
|
@@ -1773,7 +1773,7 @@ describe('ACC Client', function () {
|
|
|
1773
1773
|
client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
|
|
1774
1774
|
await client.NLWS.xtkSession.logon();
|
|
1775
1775
|
|
|
1776
|
-
await (client.fileUploader.uploadAemAsset("https://author-
|
|
1776
|
+
await (client.fileUploader.uploadAemAsset("https://author-stg.aem.adobe.com/adobe/repository/content/dam/projects/children-kids-group-eating-ice-cream-funny-party-72701973%20%281%29%20%2812%29%20%282%29%20%283%29.jpg;api=block_download"))
|
|
1777
1777
|
.catch( e => { expect(e).toMatchObject(CampaignException.AEM_ASSET_UPLOAD_FAILED('Bearer token is missing'))});
|
|
1778
1778
|
|
|
1779
1779
|
client._transport.mockReturnValueOnce(Mock.LOGOFF_RESPONSE);
|
|
@@ -1791,7 +1791,7 @@ describe('ACC Client', function () {
|
|
|
1791
1791
|
client._transport.mockReturnValueOnce(mockResponse);
|
|
1792
1792
|
client._bearerToken = 'Bearer 1234567890';
|
|
1793
1793
|
|
|
1794
|
-
await (client.fileUploader.uploadAemAsset("https://author-
|
|
1794
|
+
await (client.fileUploader.uploadAemAsset("https://author-stg.aem.adobe.com/adobe/repository/content/dam/projects/children-kids-group-eating-ice-cream-funny-party-72701973%20%281%29%20%2812%29%20%282%29%20%283%29.jpg;api=block_download"))
|
|
1795
1795
|
.catch( e => { console.log(e); expect(e).toMatchObject(CampaignException.AEM_ASSET_UPLOAD_FAILED('Publishing failed'))});
|
|
1796
1796
|
|
|
1797
1797
|
client._transport.mockReturnValueOnce(Mock.LOGOFF_RESPONSE);
|
|
@@ -1814,13 +1814,32 @@ describe('ACC Client', function () {
|
|
|
1814
1814
|
client._bearerToken = 'Bearer 1234567890';
|
|
1815
1815
|
|
|
1816
1816
|
var ex = CampaignException.AEM_ASSET_UPLOAD_FAILED('The requested content does not exist', 400);
|
|
1817
|
-
await (client.fileUploader.uploadAemAsset("https://author-
|
|
1817
|
+
await (client.fileUploader.uploadAemAsset("https://author-stg.aem.adobe.com/adobe/repository/content/dam/projects/children-kids-group-eating-ice-cream-funny-party-72701973%20%281%29%20%2812%29%20%282%29%20%283%29.jpg;api=block_download"))
|
|
1818
1818
|
.catch( e => { console.log(e); expect(e).toMatchObject(ex)});
|
|
1819
1819
|
|
|
1820
1820
|
client._transport.mockReturnValueOnce(Mock.LOGOFF_RESPONSE);
|
|
1821
1821
|
await client.NLWS.xtkSession.logoff();
|
|
1822
1822
|
});
|
|
1823
1823
|
|
|
1824
|
+
// Case 5: transport layer returns response as string instead of json when sdk
|
|
1825
|
+
// used as package inside browser(Fetch API is used in browser while axios in node).
|
|
1826
|
+
it("Should return correct response", async () => {
|
|
1827
|
+
const client = await Mock.makeClient();
|
|
1828
|
+
client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
|
|
1829
|
+
await client.NLWS.xtkSession.logon();
|
|
1830
|
+
|
|
1831
|
+
const mockResponse = {
|
|
1832
|
+
"publishedURL" : "http://trk-inst-xyz.camp.adobe.com/res/trk-inst/409afb8798180a36591456e152b6c406.jpeg"
|
|
1833
|
+
};
|
|
1834
|
+
const mockResponseString = JSON.stringify(mockResponse);
|
|
1835
|
+
client._bearerToken = 'Bearer 1234567890';
|
|
1836
|
+
client._transport.mockReturnValueOnce(mockResponseString);
|
|
1837
|
+
const response = await client.fileUploader.uploadAemAsset("https://author-stg.aem.adobe.com/adobe/repository/content/dam/projects/children-kids-group-eating-ice-cream-funny-party-72701973%20%281%29%20%2812%29%20%282%29%20%283%29.jpg;api=block_download");
|
|
1838
|
+
expect(response).toMatchObject(mockResponse);
|
|
1839
|
+
|
|
1840
|
+
client._transport.mockReturnValueOnce(Mock.LOGOFF_RESPONSE);
|
|
1841
|
+
await client.NLWS.xtkSession.logoff();
|
|
1842
|
+
});
|
|
1824
1843
|
});
|
|
1825
1844
|
|
|
1826
1845
|
|