@adobe/acc-js-sdk 1.1.60 → 1.1.61
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 +10 -0
- package/package-lock.json +10 -10
- package/package.json +1 -1
- package/src/client.js +12 -1
- package/test/client.test.js +62 -1
package/docs/changeLog.html
CHANGED
|
@@ -3,6 +3,16 @@ layout: page
|
|
|
3
3
|
title: Change Log
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<section class="changelog"><h1>Version 1.1.61</h1>
|
|
7
|
+
<h2>2025/09/16</h2>
|
|
8
|
+
<li>
|
|
9
|
+
Add request id to SOAP calls
|
|
10
|
+
</li>
|
|
11
|
+
<li>
|
|
12
|
+
Bumped dependencies version to fix vulnerabilities
|
|
13
|
+
</li>
|
|
14
|
+
</section>
|
|
15
|
+
|
|
6
16
|
<section class="changelog"><h1>Version 1.1.60</h1>
|
|
7
17
|
<h2>2025/09/04</h2>
|
|
8
18
|
<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.61",
|
|
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.61",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "^1.7.8",
|
|
@@ -1169,12 +1169,12 @@
|
|
|
1169
1169
|
"license": "MIT"
|
|
1170
1170
|
},
|
|
1171
1171
|
"node_modules/axios": {
|
|
1172
|
-
"version": "1.
|
|
1173
|
-
"resolved": "https://registry.npmjs.org/axios/-/axios-1.
|
|
1174
|
-
"integrity": "sha512-
|
|
1172
|
+
"version": "1.12.2",
|
|
1173
|
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz",
|
|
1174
|
+
"integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==",
|
|
1175
1175
|
"dependencies": {
|
|
1176
1176
|
"follow-redirects": "^1.15.6",
|
|
1177
|
-
"form-data": "^4.0.
|
|
1177
|
+
"form-data": "^4.0.4",
|
|
1178
1178
|
"proxy-from-env": "^1.1.0"
|
|
1179
1179
|
}
|
|
1180
1180
|
},
|
|
@@ -5488,12 +5488,12 @@
|
|
|
5488
5488
|
"version": "0.4.0"
|
|
5489
5489
|
},
|
|
5490
5490
|
"axios": {
|
|
5491
|
-
"version": "1.
|
|
5492
|
-
"resolved": "https://registry.npmjs.org/axios/-/axios-1.
|
|
5493
|
-
"integrity": "sha512-
|
|
5491
|
+
"version": "1.12.2",
|
|
5492
|
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz",
|
|
5493
|
+
"integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==",
|
|
5494
5494
|
"requires": {
|
|
5495
5495
|
"follow-redirects": "^1.15.6",
|
|
5496
|
-
"form-data": "^4.0.
|
|
5496
|
+
"form-data": "^4.0.4",
|
|
5497
5497
|
"proxy-from-env": "^1.1.0"
|
|
5498
5498
|
}
|
|
5499
5499
|
},
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -1178,11 +1178,22 @@ class Client {
|
|
|
1178
1178
|
* parameters should be set
|
|
1179
1179
|
*/
|
|
1180
1180
|
_prepareSoapCall(urn, method, isStatic, internal, extraHttpHeaders, pushDownOptions) {
|
|
1181
|
+
// Generate unique request ID for every SOAP call
|
|
1182
|
+
let requestId;
|
|
1183
|
+
try {
|
|
1184
|
+
requestId = Util.getUUID();
|
|
1185
|
+
} catch (error) {
|
|
1186
|
+
console.error("Failed to generate request ID", error);
|
|
1187
|
+
}
|
|
1188
|
+
const updatedExtraHttpHeaders = requestId ? Object.assign({}, extraHttpHeaders, {
|
|
1189
|
+
"x-request-id": requestId,
|
|
1190
|
+
})
|
|
1191
|
+
: extraHttpHeaders;
|
|
1181
1192
|
const soapCall = new SoapMethodCall(this._transport, urn, method,
|
|
1182
1193
|
this._sessionToken, this._securityToken,
|
|
1183
1194
|
this._getUserAgentString(),
|
|
1184
1195
|
Object.assign({}, this._connectionParameters._options, pushDownOptions),
|
|
1185
|
-
|
|
1196
|
+
updatedExtraHttpHeaders,
|
|
1186
1197
|
this._bearerToken);
|
|
1187
1198
|
soapCall.internal = !!internal;
|
|
1188
1199
|
soapCall.isStatic = isStatic;
|
package/test/client.test.js
CHANGED
|
@@ -3446,6 +3446,67 @@ describe('ACC Client', function () {
|
|
|
3446
3446
|
"X-Query-Source": `${sdk.getSDKVersion().name} ${sdk.getSDKVersion().version},Test client app`,
|
|
3447
3447
|
});
|
|
3448
3448
|
});
|
|
3449
|
+
|
|
3450
|
+
it("Should add x-request-id header to every SOAP call", async () => {
|
|
3451
|
+
const client = await Mock.makeClient();
|
|
3452
|
+
client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
|
|
3453
|
+
await client.NLWS.xtkSession.logon();
|
|
3454
|
+
|
|
3455
|
+
const mockGetUUID = jest.spyOn(Util, 'getUUID').mockImplementation(() => { return 'test-uuid'; });
|
|
3456
|
+
|
|
3457
|
+
client._transport.mockReturnValueOnce(Mock.GET_XTK_QUERY_SCHEMA_RESPONSE);
|
|
3458
|
+
client._transport.mockReturnValueOnce(Mock.GET_QUERY_EXECUTE_RESPONSE);
|
|
3459
|
+
|
|
3460
|
+
const queryDef = {
|
|
3461
|
+
"schema": "nms:extAccount",
|
|
3462
|
+
"operation": "select",
|
|
3463
|
+
"select": {
|
|
3464
|
+
"node": [
|
|
3465
|
+
{ "expr": "@id" },
|
|
3466
|
+
{ "expr": "@name" }
|
|
3467
|
+
]
|
|
3468
|
+
}
|
|
3469
|
+
};
|
|
3470
|
+
const query = client.NLWS.xtkQueryDef.create(queryDef);
|
|
3471
|
+
|
|
3472
|
+
const headers = await collectHeaders(client, async() => {
|
|
3473
|
+
await query.executeQuery();
|
|
3474
|
+
});
|
|
3475
|
+
|
|
3476
|
+
expect(headers["x-request-id"]).toBe('test-uuid');
|
|
3477
|
+
|
|
3478
|
+
// Restore the mock
|
|
3479
|
+
mockGetUUID.mockRestore();
|
|
3480
|
+
});
|
|
3481
|
+
|
|
3482
|
+
it("Should call SOAP call on request ID generation failure", async () => {
|
|
3483
|
+
const client = await Mock.makeClient();
|
|
3484
|
+
client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
|
|
3485
|
+
await client.NLWS.xtkSession.logon();
|
|
3486
|
+
|
|
3487
|
+
const mockGetUUID = jest.spyOn(Util, 'getUUID').mockImplementation(() => { throw new Error('UUID error'); });
|
|
3488
|
+
|
|
3489
|
+
client._transport.mockReturnValueOnce(Mock.GET_XTK_QUERY_SCHEMA_RESPONSE);
|
|
3490
|
+
client._transport.mockReturnValueOnce(Mock.GET_QUERY_EXECUTE_RESPONSE);
|
|
3491
|
+
const queryDef = {
|
|
3492
|
+
"schema": "nms:extAccount",
|
|
3493
|
+
"operation": "select",
|
|
3494
|
+
"select": {
|
|
3495
|
+
"node": [{ "expr": "@id" }]
|
|
3496
|
+
}
|
|
3497
|
+
};
|
|
3498
|
+
|
|
3499
|
+
const query = client.NLWS.xtkQueryDef.create(queryDef);
|
|
3500
|
+
|
|
3501
|
+
const headers = await collectHeaders(client, async() => {
|
|
3502
|
+
await query.executeQuery();
|
|
3503
|
+
});
|
|
3504
|
+
|
|
3505
|
+
expect(headers["x-request-id"]).toBeUndefined();
|
|
3506
|
+
|
|
3507
|
+
// Restore the mock
|
|
3508
|
+
mockGetUUID.mockRestore();
|
|
3509
|
+
});
|
|
3449
3510
|
});
|
|
3450
3511
|
|
|
3451
3512
|
describe("Pushdown parameters", () => {
|
|
@@ -4354,7 +4415,7 @@ describe('ACC Client', function () {
|
|
|
4354
4415
|
type: "text/html",
|
|
4355
4416
|
size: 12345,
|
|
4356
4417
|
}, undefined, 'PREFIX');
|
|
4357
|
-
expect(Util.getUUID).toHaveBeenCalledTimes(
|
|
4418
|
+
expect(Util.getUUID).toHaveBeenCalledTimes(8);
|
|
4358
4419
|
});
|
|
4359
4420
|
}); // "File uploader - on browser"
|
|
4360
4421
|
}); // 'upload'
|