@adobe/acc-js-sdk 1.1.38 → 1.1.39

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.
@@ -3,6 +3,13 @@ layout: page
3
3
  title: Change Log
4
4
  ---
5
5
 
6
+ <section class="changelog"><h1>Version 1.1.39</h1>
7
+ <h2>2023/09/20</h2>
8
+ <li>
9
+ Fixed the name of the returned object when querying a temporary schema and when the result of the query is empty.
10
+ </li>
11
+ </section>
12
+
6
13
  <section class="changelog"><h1>Version 1.1.38</h1>
7
14
  <h2>2023/09/06</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.38",
3
+ "version": "1.1.39",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@adobe/acc-js-sdk",
9
- "version": "1.1.38",
9
+ "version": "1.1.39",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
12
  "axios": "^1.2.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/acc-js-sdk",
3
- "version": "1.1.38",
3
+ "version": "1.1.39",
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
@@ -1345,7 +1345,7 @@ class Client {
1345
1345
  else if (operation == "select" && emptyResult) {
1346
1346
  const querySchemaId = EntityAccessor.getAttributeAsString(object, "schema");
1347
1347
  const index = querySchemaId.indexOf(':');
1348
- const querySchemaName = querySchemaId.substr(index + 1);
1348
+ const querySchemaName = querySchemaId.substr(index + 1).replace(':', '_');
1349
1349
  outputParams[1].value[querySchemaName] = [];
1350
1350
  }
1351
1351
  }
@@ -1334,6 +1334,80 @@ describe('ACC Client', function () {
1334
1334
  expect(extAccount).toEqual({ extAccount: [] });
1335
1335
  });
1336
1336
 
1337
+ it("select with empty result - temporary schema", async () => {
1338
+ const client = await Mock.makeClient();
1339
+ client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
1340
+ await client.NLWS.xtkSession.logon();
1341
+
1342
+ client._transport.mockReturnValueOnce(Mock.GET_XTK_QUERY_SCHEMA_RESPONSE);
1343
+
1344
+ client._transport.mockReturnValueOnce(Promise.resolve(`<?xml version='1.0'?>
1345
+ <SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:queryDef' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
1346
+ <SOAP-ENV:Body>
1347
+ <ExecuteQueryResponse xmlns='urn:xtk:queryDef' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
1348
+ <pdomOutput xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'>
1349
+ <workflow_1047471_query2_result-collection/>
1350
+ </pdomOutput>
1351
+ </ExecuteQueryResponse>
1352
+ </SOAP-ENV:Body></SOAP-ENV:Envelope>`));
1353
+
1354
+ var queryDef = {
1355
+ "schema": "temp:workflow:1047471_query2_result",
1356
+ "operation": "select",
1357
+ "select": {
1358
+ "node": [
1359
+ { "expr": "@id" },
1360
+ { "expr": "@name" }
1361
+ ]
1362
+ }
1363
+ };
1364
+
1365
+ // Select should return empty array
1366
+ var query = client.NLWS.xtkQueryDef.create(queryDef);
1367
+ var temp = await query.executeQuery();
1368
+ expect(temp).toEqual({ 'workflow_1047471_query2_result': [] });
1369
+ });
1370
+
1371
+ it("select with results - temporary schema", async () => {
1372
+ const client = await Mock.makeClient();
1373
+ client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);
1374
+ await client.NLWS.xtkSession.logon();
1375
+
1376
+ client._transport.mockReturnValueOnce(Mock.GET_XTK_QUERY_SCHEMA_RESPONSE);
1377
+
1378
+ client._transport.mockReturnValueOnce(Promise.resolve(`<?xml version='1.0'?>
1379
+ <SOAP-ENV:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ns='urn:xtk:queryDef' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>
1380
+ <SOAP-ENV:Body>
1381
+ <ExecuteQueryResponse xmlns='urn:xtk:queryDef' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
1382
+ <pdomOutput xsi:type='ns:Element' SOAP-ENV:encodingStyle='http://xml.apache.org/xml-soap/literalxml'>
1383
+ <workflow_1047471_query2_result-collection>
1384
+ <workflow_1047471_query3_result _keyfield0="1195" id="1195">
1385
+ <target _cs="rner20 joewar (joewarner20@fake_domain.com)"></target>
1386
+ </workflow_1047471_query3_result>
1387
+ <workflow_1047471_query3_result _keyfield0="1198" id="1198">
1388
+ <target _cs="aliberte23 troyla (troylaliberte23@fake_domain.com)"></target>
1389
+ </workflow_1047471_query3_result>
1390
+ </workflow_1047471_query2_result-collection>
1391
+ </pdomOutput>
1392
+ </ExecuteQueryResponse>
1393
+ </SOAP-ENV:Body></SOAP-ENV:Envelope>`));
1394
+
1395
+ var queryDef = {
1396
+ "schema": "temp:workflow:1047471_query2_result",
1397
+ "operation": "select",
1398
+ "select": {
1399
+ "node": [
1400
+ { "expr": "@id" },
1401
+ { "expr": "target"}
1402
+ ]
1403
+ }
1404
+ };
1405
+
1406
+ var query = client.NLWS.xtkQueryDef.create(queryDef);
1407
+ var temp = await query.executeQuery();
1408
+ expect(temp.workflow_1047471_query3_result.length).toBe(2);
1409
+ });
1410
+
1337
1411
  it("getIfExists with a result of exactly one element", async () => {
1338
1412
  const client = await Mock.makeClient();
1339
1413
  client._transport.mockReturnValueOnce(Mock.LOGON_RESPONSE);