@adobe/aio-cli-plugin-api-mesh 4.1.0 → 5.0.0-alpha

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.
Files changed (39) hide show
  1. package/oclif.manifest.json +1 -1
  2. package/package.json +3 -7
  3. package/src/commands/api-mesh/__tests__/create.test.js +217 -293
  4. package/src/commands/api-mesh/__tests__/delete.test.js +6 -6
  5. package/src/commands/api-mesh/__tests__/describe.test.js +2 -17
  6. package/src/commands/api-mesh/__tests__/get.test.js +9 -78
  7. package/src/commands/api-mesh/__tests__/log-get-bulk.test.js +1 -1
  8. package/src/commands/api-mesh/__tests__/run.test.js +22 -25
  9. package/src/commands/api-mesh/__tests__/status.test.js +1 -1
  10. package/src/commands/api-mesh/__tests__/update.test.js +8 -9
  11. package/src/commands/api-mesh/create.js +6 -9
  12. package/src/commands/api-mesh/delete.js +5 -5
  13. package/src/commands/api-mesh/describe.js +3 -3
  14. package/src/commands/api-mesh/get.js +8 -11
  15. package/src/commands/api-mesh/init.js +0 -2
  16. package/src/commands/api-mesh/log-get-bulk.js +2 -2
  17. package/src/commands/api-mesh/log-get.js +2 -2
  18. package/src/commands/api-mesh/log-list.js +1 -1
  19. package/src/commands/api-mesh/run.js +9 -35
  20. package/src/commands/api-mesh/source/install.js +3 -2
  21. package/src/commands/api-mesh/status.js +4 -6
  22. package/src/commands/api-mesh/update.js +7 -9
  23. package/src/constants.js +2 -0
  24. package/src/lib/devConsole.js +38 -32
  25. package/src/server.js +198 -36
  26. package/src/serverUtils.js +3 -3
  27. package/src/cors.js +0 -28
  28. package/src/fixPlugins.js +0 -28
  29. package/src/index.js +0 -44
  30. package/src/plugins/complianceHeaders/complianceHeaders.js +0 -55
  31. package/src/plugins/complianceHeaders/index.js +0 -2
  32. package/src/plugins/httpDetailsExtensions/LICENSE +0 -21
  33. package/src/plugins/httpDetailsExtensions/index.js +0 -81
  34. package/src/secrets.js +0 -34
  35. package/src/served.js +0 -22
  36. package/src/templates/wrangler.toml +0 -14
  37. package/src/utils/logger.js +0 -42
  38. package/src/utils/requestId.js +0 -26
  39. package/src/wranglerServer.js +0 -80
@@ -159,28 +159,8 @@ describe('create command tests', () => {
159
159
  },
160
160
  });
161
161
  const output = await CreateCommand.run();
162
- expect(output).toMatchInlineSnapshot(`
163
- {
164
- "imsOrgId": "1234",
165
- "meshConfig": {
166
- "sources": [
167
- {
168
- "handler": {
169
- "graphql": {
170
- "endpoint": "<gql_endpoint>",
171
- },
172
- },
173
- "name": "<api_name>",
174
- },
175
- ],
176
- },
177
- "meshId": "dummy_mesh_id",
178
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
179
- "projectId": "5678",
180
- "workspaceId": "123456789",
181
- "workspaceName": "Workspace01",
182
- }
183
- `);
162
+ expect(output).toHaveProperty('mesh');
163
+ expect(output.mesh).toEqual(expect.objectContaining({ meshId: 'dummy_mesh_id' }));
184
164
  });
185
165
 
186
166
  test('snapshot create command description', () => {
@@ -262,52 +242,49 @@ describe('create command tests', () => {
262
242
 
263
243
  expect(output).toMatchInlineSnapshot(`
264
244
  {
265
- "imsOrgId": "1234",
266
- "meshConfig": {
267
- "files": [
268
- {
269
- "content": "{"type":"dummyContent"}",
270
- "path": "./requestParams.json",
271
- },
272
- {
273
- "content": "module.exports.functionName = () => { console.log('beforeAll hook'); }",
274
- "path": "./hooks.js",
275
- },
276
- ],
277
- "plugins": [
278
- {
279
- "hooks": {
280
- "beforeAll": {
281
- "composer": "./hooks.js#functionName",
245
+ "mesh": {
246
+ "meshConfig": {
247
+ "files": [
248
+ {
249
+ "content": "{"type":"dummyContent"}",
250
+ "path": "./requestParams.json",
251
+ },
252
+ {
253
+ "content": "module.exports.functionName = () => { console.log('beforeAll hook'); }",
254
+ "path": "./hooks.js",
255
+ },
256
+ ],
257
+ "plugins": [
258
+ {
259
+ "hooks": {
260
+ "beforeAll": {
261
+ "composer": "./hooks.js#functionName",
262
+ },
282
263
  },
283
264
  },
284
- },
285
- ],
286
- "sources": [
287
- {
288
- "handler": {
289
- "JsonSchema": {
290
- "baseUrl": "<json_source__baseurl>",
291
- "operations": [
292
- {
293
- "field": "<query>",
294
- "method": "POST",
295
- "path": "<query_path>",
296
- "requestSchema": "./requestParams.json",
297
- "type": "Query",
298
- },
299
- ],
265
+ ],
266
+ "sources": [
267
+ {
268
+ "handler": {
269
+ "JsonSchema": {
270
+ "baseUrl": "<json_source__baseurl>",
271
+ "operations": [
272
+ {
273
+ "field": "<query>",
274
+ "method": "POST",
275
+ "path": "<query_path>",
276
+ "requestSchema": "./requestParams.json",
277
+ "type": "Query",
278
+ },
279
+ ],
280
+ },
300
281
  },
282
+ "name": "<json_source_name>",
301
283
  },
302
- "name": "<json_source_name>",
303
- },
304
- ],
284
+ ],
285
+ },
286
+ "meshId": "dummy_mesh_id",
305
287
  },
306
- "meshId": "dummy_mesh_id",
307
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
308
- "projectId": "5678",
309
- "workspaceId": "123456789",
310
- "workspaceName": "Workspace01",
311
288
  }
312
289
  `);
313
290
  });
@@ -318,7 +295,7 @@ describe('create command tests', () => {
318
295
  const runResult = CreateCommand.run();
319
296
  await expect(runResult).rejects.toEqual(
320
297
  new Error(
321
- 'Unable to create a mesh. Please check the mesh configuration file and try again. If the error persists please contact support. RequestId: dummy_request_id',
298
+ 'Unable to create a mesh. Check the mesh configuration file and try again. If the error persists please contact support. RequestId: dummy_request_id',
322
299
  ),
323
300
  );
324
301
  expect(logSpy.mock.calls).toMatchInlineSnapshot(`
@@ -331,7 +308,7 @@ describe('create command tests', () => {
331
308
  expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`
332
309
  [
333
310
  [
334
- "Unable to create a mesh. Please check the mesh configuration file and try again. If the error persists please contact support. RequestId: dummy_request_id",
311
+ "Unable to create a mesh. Check the mesh configuration file and try again. If the error persists please contact support. RequestId: dummy_request_id",
335
312
  ],
336
313
  ]
337
314
  `);
@@ -343,7 +320,7 @@ describe('create command tests', () => {
343
320
  expect(initRequestId).toHaveBeenCalled();
344
321
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
345
322
  [
346
- "1234",
323
+ "CODE1234@AdobeOrg",
347
324
  "5678",
348
325
  "123456789",
349
326
  "Workspace01",
@@ -367,24 +344,21 @@ describe('create command tests', () => {
367
344
  `);
368
345
  expect(runResult).toMatchInlineSnapshot(`
369
346
  {
370
- "imsOrgId": "1234",
371
- "meshConfig": {
372
- "sources": [
373
- {
374
- "handler": {
375
- "graphql": {
376
- "endpoint": "<gql_endpoint>",
347
+ "mesh": {
348
+ "meshConfig": {
349
+ "sources": [
350
+ {
351
+ "handler": {
352
+ "graphql": {
353
+ "endpoint": "<gql_endpoint>",
354
+ },
377
355
  },
356
+ "name": "<api_name>",
378
357
  },
379
- "name": "<api_name>",
380
- },
381
- ],
358
+ ],
359
+ },
360
+ "meshId": "dummy_mesh_id",
382
361
  },
383
- "meshId": "dummy_mesh_id",
384
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
385
- "projectId": "5678",
386
- "workspaceId": "123456789",
387
- "workspaceName": "Workspace01",
388
362
  }
389
363
  `);
390
364
  expect(logSpy.mock.calls).toMatchInlineSnapshot(`
@@ -425,7 +399,7 @@ describe('create command tests', () => {
425
399
  expect(initRequestId).toHaveBeenCalled();
426
400
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
427
401
  [
428
- "1234",
402
+ "CODE1234@AdobeOrg",
429
403
  "5678",
430
404
  "123456789",
431
405
  "Workspace01",
@@ -450,24 +424,21 @@ describe('create command tests', () => {
450
424
 
451
425
  expect(runResult).toMatchInlineSnapshot(`
452
426
  {
453
- "imsOrgId": "1234",
454
- "meshConfig": {
455
- "sources": [
456
- {
457
- "handler": {
458
- "graphql": {
459
- "endpoint": "<gql_endpoint>",
427
+ "mesh": {
428
+ "meshConfig": {
429
+ "sources": [
430
+ {
431
+ "handler": {
432
+ "graphql": {
433
+ "endpoint": "<gql_endpoint>",
434
+ },
460
435
  },
436
+ "name": "<api_name>",
461
437
  },
462
- "name": "<api_name>",
463
- },
464
- ],
438
+ ],
439
+ },
440
+ "meshId": "dummy_mesh_id",
465
441
  },
466
- "meshId": "dummy_mesh_id",
467
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
468
- "projectId": "5678",
469
- "workspaceId": "123456789",
470
- "workspaceName": "Workspace01",
471
442
  }
472
443
  `);
473
444
  expect(logSpy.mock.calls).toMatchInlineSnapshot(`
@@ -617,28 +588,8 @@ describe('create command tests', () => {
617
588
  },
618
589
  });
619
590
  const output = await CreateCommand.run();
620
- expect(output).toMatchInlineSnapshot(`
621
- {
622
- "imsOrgId": "1234",
623
- "meshConfig": {
624
- "sources": [
625
- {
626
- "handler": {
627
- "graphql": {
628
- "endpoint": "<gql_endpoint>",
629
- },
630
- },
631
- "name": "<api_name>",
632
- },
633
- ],
634
- },
635
- "meshId": "dummy_mesh_id",
636
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
637
- "projectId": "5678",
638
- "workspaceId": "123456789",
639
- "workspaceName": "Workspace01",
640
- }
641
- `);
591
+ expect(output).toHaveProperty('mesh');
592
+ expect(output.mesh).toEqual(expect.objectContaining({ meshId: 'dummy_mesh_id' }));
642
593
  });
643
594
 
644
595
  test('should return error if the mesh has placeholders and env file provided using --env flag is not found', async () => {
@@ -806,24 +757,21 @@ describe('create command tests', () => {
806
757
  expect(promptConfirm).toHaveBeenCalledWith('Are you sure you want to create a mesh?');
807
758
  expect(runResult).toMatchInlineSnapshot(`
808
759
  {
809
- "imsOrgId": "1234",
810
- "meshConfig": {
811
- "sources": [
812
- {
813
- "handler": {
814
- "graphql": {
815
- "endpoint": "<gql_endpoint>",
760
+ "mesh": {
761
+ "meshConfig": {
762
+ "sources": [
763
+ {
764
+ "handler": {
765
+ "graphql": {
766
+ "endpoint": "<gql_endpoint>",
767
+ },
816
768
  },
769
+ "name": "<api_name>",
817
770
  },
818
- "name": "<api_name>",
819
- },
820
- ],
771
+ ],
772
+ },
773
+ "meshId": "dummy_mesh_id",
821
774
  },
822
- "meshId": "dummy_mesh_id",
823
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
824
- "projectId": "5678",
825
- "workspaceId": "123456789",
826
- "workspaceName": "Workspace01",
827
775
  }
828
776
  `);
829
777
  });
@@ -839,13 +787,13 @@ describe('create command tests', () => {
839
787
 
840
788
  const runResult = CreateCommand.run();
841
789
  await expect(runResult).rejects.toEqual(
842
- new Error('Input mesh file is not a valid JSON. Please check the file provided.'),
790
+ new Error('Input mesh file is not a valid JSON. Check the file provided.'),
843
791
  );
844
792
 
845
793
  await expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`
846
794
  [
847
795
  [
848
- "Input mesh file is not a valid JSON. Please check the file provided.",
796
+ "Input mesh file is not a valid JSON. Check the file provided.",
849
797
  ],
850
798
  ]
851
799
  `);
@@ -903,7 +851,7 @@ describe('create command tests', () => {
903
851
  expect(initRequestId).toHaveBeenCalled();
904
852
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
905
853
  [
906
- "1234",
854
+ "CODE1234@AdobeOrg",
907
855
  "5678",
908
856
  "123456789",
909
857
  "Workspace01",
@@ -943,39 +891,36 @@ describe('create command tests', () => {
943
891
 
944
892
  expect(output).toMatchInlineSnapshot(`
945
893
  {
946
- "imsOrgId": "1234",
947
- "meshConfig": {
948
- "files": [
949
- {
950
- "content": "{"type":"updatedContent"}",
951
- "path": "./requestParams.json",
952
- },
953
- ],
954
- "sources": [
955
- {
956
- "handler": {
957
- "JsonSchema": {
958
- "baseUrl": "<json_source__baseurl>",
959
- "operations": [
960
- {
961
- "field": "<query>",
962
- "method": "POST",
963
- "path": "<query_path>",
964
- "requestSchema": "./requestParams.json",
965
- "type": "Query",
966
- },
967
- ],
894
+ "mesh": {
895
+ "meshConfig": {
896
+ "files": [
897
+ {
898
+ "content": "{"type":"updatedContent"}",
899
+ "path": "./requestParams.json",
900
+ },
901
+ ],
902
+ "sources": [
903
+ {
904
+ "handler": {
905
+ "JsonSchema": {
906
+ "baseUrl": "<json_source__baseurl>",
907
+ "operations": [
908
+ {
909
+ "field": "<query>",
910
+ "method": "POST",
911
+ "path": "<query_path>",
912
+ "requestSchema": "./requestParams.json",
913
+ "type": "Query",
914
+ },
915
+ ],
916
+ },
968
917
  },
918
+ "name": "<json_source_name>",
969
919
  },
970
- "name": "<json_source_name>",
971
- },
972
- ],
920
+ ],
921
+ },
922
+ "meshId": "dummy_mesh_id",
973
923
  },
974
- "meshId": "dummy_mesh_id",
975
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
976
- "projectId": "5678",
977
- "workspaceId": "123456789",
978
- "workspaceName": "Workspace01",
979
924
  }
980
925
  `);
981
926
  });
@@ -1053,9 +998,7 @@ describe('create command tests', () => {
1053
998
 
1054
999
  const output = CreateCommand.run();
1055
1000
  await expect(output).rejects.toEqual(
1056
- new Error(
1057
- 'Unable to import the files in the mesh config. Please check the file and try again.',
1058
- ),
1001
+ new Error('Unable to import the files in the mesh config. Check the file and try again.'),
1059
1002
  );
1060
1003
 
1061
1004
  expect(logSpy.mock.calls).toMatchInlineSnapshot(`
@@ -1069,7 +1012,7 @@ describe('create command tests', () => {
1069
1012
  expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`
1070
1013
  [
1071
1014
  [
1072
- "Unable to import the files in the mesh config. Please check the file and try again.",
1015
+ "Unable to import the files in the mesh config. Check the file and try again.",
1073
1016
  ],
1074
1017
  ]
1075
1018
  `);
@@ -1090,9 +1033,7 @@ describe('create command tests', () => {
1090
1033
  const output = CreateCommand.run();
1091
1034
 
1092
1035
  await expect(output).rejects.toEqual(
1093
- new Error(
1094
- 'Unable to import the files in the mesh config. Please check the file and try again.',
1095
- ),
1036
+ new Error('Unable to import the files in the mesh config. Check the file and try again.'),
1096
1037
  );
1097
1038
 
1098
1039
  expect(logSpy.mock.calls).toMatchInlineSnapshot(`
@@ -1106,7 +1047,7 @@ describe('create command tests', () => {
1106
1047
  expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`
1107
1048
  [
1108
1049
  [
1109
- "Unable to import the files in the mesh config. Please check the file and try again.",
1050
+ "Unable to import the files in the mesh config. Check the file and try again.",
1110
1051
  ],
1111
1052
  ]
1112
1053
  `);
@@ -1419,7 +1360,7 @@ describe('create command tests', () => {
1419
1360
  expect(initRequestId).toHaveBeenCalled();
1420
1361
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
1421
1362
  [
1422
- "1234",
1363
+ "CODE1234@AdobeOrg",
1423
1364
  "5678",
1424
1365
  "123456789",
1425
1366
  "Workspace01",
@@ -1458,39 +1399,36 @@ describe('create command tests', () => {
1458
1399
  `);
1459
1400
  expect(output).toMatchInlineSnapshot(`
1460
1401
  {
1461
- "imsOrgId": "1234",
1462
- "meshConfig": {
1463
- "files": [
1464
- {
1465
- "content": "{"type":"dummyContent"}",
1466
- "path": "./schemaBody.json",
1467
- },
1468
- ],
1469
- "sources": [
1470
- {
1471
- "handler": {
1472
- "JsonSchema": {
1473
- "baseUrl": "<json_source__baseurl>",
1474
- "operations": [
1475
- {
1476
- "field": "<query>",
1477
- "method": "POST",
1478
- "path": "<query_path>",
1479
- "requestSchema": "./schemaBody.json",
1480
- "type": "Query",
1481
- },
1482
- ],
1402
+ "mesh": {
1403
+ "meshConfig": {
1404
+ "files": [
1405
+ {
1406
+ "content": "{"type":"dummyContent"}",
1407
+ "path": "./schemaBody.json",
1408
+ },
1409
+ ],
1410
+ "sources": [
1411
+ {
1412
+ "handler": {
1413
+ "JsonSchema": {
1414
+ "baseUrl": "<json_source__baseurl>",
1415
+ "operations": [
1416
+ {
1417
+ "field": "<query>",
1418
+ "method": "POST",
1419
+ "path": "<query_path>",
1420
+ "requestSchema": "./schemaBody.json",
1421
+ "type": "Query",
1422
+ },
1423
+ ],
1424
+ },
1483
1425
  },
1426
+ "name": "<json_source_name>",
1484
1427
  },
1485
- "name": "<json_source_name>",
1486
- },
1487
- ],
1428
+ ],
1429
+ },
1430
+ "meshId": "dummy_mesh_id",
1488
1431
  },
1489
- "meshId": "dummy_mesh_id",
1490
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
1491
- "projectId": "5678",
1492
- "workspaceId": "123456789",
1493
- "workspaceName": "Workspace01",
1494
1432
  }
1495
1433
  `);
1496
1434
  });
@@ -1547,7 +1485,7 @@ describe('create command tests', () => {
1547
1485
  expect(initRequestId).toHaveBeenCalled();
1548
1486
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
1549
1487
  [
1550
- "1234",
1488
+ "CODE1234@AdobeOrg",
1551
1489
  "5678",
1552
1490
  "123456789",
1553
1491
  "Workspace01",
@@ -1586,39 +1524,36 @@ describe('create command tests', () => {
1586
1524
  `);
1587
1525
  expect(output).toMatchInlineSnapshot(`
1588
1526
  {
1589
- "imsOrgId": "1234",
1590
- "meshConfig": {
1591
- "files": [
1592
- {
1593
- "content": "{"type":"updatedContent"}",
1594
- "path": "./files/requestParams.json",
1595
- },
1596
- ],
1597
- "sources": [
1598
- {
1599
- "handler": {
1600
- "JsonSchema": {
1601
- "baseUrl": "<json_source__baseurl>",
1602
- "operations": [
1603
- {
1604
- "field": "<query>",
1605
- "method": "POST",
1606
- "path": "<query_path>",
1607
- "requestSchema": "./files/requestParams.json",
1608
- "type": "Query",
1609
- },
1610
- ],
1527
+ "mesh": {
1528
+ "meshConfig": {
1529
+ "files": [
1530
+ {
1531
+ "content": "{"type":"updatedContent"}",
1532
+ "path": "./files/requestParams.json",
1533
+ },
1534
+ ],
1535
+ "sources": [
1536
+ {
1537
+ "handler": {
1538
+ "JsonSchema": {
1539
+ "baseUrl": "<json_source__baseurl>",
1540
+ "operations": [
1541
+ {
1542
+ "field": "<query>",
1543
+ "method": "POST",
1544
+ "path": "<query_path>",
1545
+ "requestSchema": "./files/requestParams.json",
1546
+ "type": "Query",
1547
+ },
1548
+ ],
1549
+ },
1611
1550
  },
1551
+ "name": "<json_source_name>",
1612
1552
  },
1613
- "name": "<json_source_name>",
1614
- },
1615
- ],
1553
+ ],
1554
+ },
1555
+ "meshId": "dummy_mesh_id",
1616
1556
  },
1617
- "meshId": "dummy_mesh_id",
1618
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
1619
- "projectId": "5678",
1620
- "workspaceId": "123456789",
1621
- "workspaceName": "Workspace01",
1622
1557
  }
1623
1558
  `);
1624
1559
  });
@@ -1665,9 +1600,7 @@ describe('create command tests', () => {
1665
1600
  const output = CreateCommand.run();
1666
1601
 
1667
1602
  await expect(output).rejects.toEqual(
1668
- new Error(
1669
- 'Unable to import the files in the mesh config. Please check the file and try again.',
1670
- ),
1603
+ new Error('Unable to import the files in the mesh config. Check the file and try again.'),
1671
1604
  );
1672
1605
 
1673
1606
  expect(logSpy.mock.calls).toMatchInlineSnapshot(`
@@ -1681,7 +1614,7 @@ describe('create command tests', () => {
1681
1614
  expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`
1682
1615
  [
1683
1616
  [
1684
- "Unable to import the files in the mesh config. Please check the file and try again.",
1617
+ "Unable to import the files in the mesh config. Check the file and try again.",
1685
1618
  ],
1686
1619
  ]
1687
1620
  `);
@@ -1767,13 +1700,13 @@ describe('create command tests', () => {
1767
1700
  const runResult = CreateCommand.run();
1768
1701
 
1769
1702
  await expect(runResult).rejects.toEqual(
1770
- new Error('Unable to import secrets. Please check the file and try again.'),
1703
+ new Error('Unable to import secrets. Check the file and try again.'),
1771
1704
  );
1772
1705
 
1773
1706
  expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`
1774
1707
  [
1775
1708
  [
1776
- "Unable to import secrets. Please check the file and try again.",
1709
+ "Unable to import secrets. Check the file and try again.",
1777
1710
  ],
1778
1711
  ]
1779
1712
  `);
@@ -1792,7 +1725,7 @@ describe('create command tests', () => {
1792
1725
  const runResult = CreateCommand.run();
1793
1726
 
1794
1727
  await expect(runResult).rejects.toEqual(
1795
- new Error('Unable to import secrets. Please check the file and try again.'),
1728
+ new Error('Unable to import secrets. Check the file and try again.'),
1796
1729
  );
1797
1730
 
1798
1731
  expect(logSpy.mock.calls).toMatchInlineSnapshot(`
@@ -1806,7 +1739,7 @@ describe('create command tests', () => {
1806
1739
  expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`
1807
1740
  [
1808
1741
  [
1809
- "Unable to import secrets. Please check the file and try again.",
1742
+ "Unable to import secrets. Check the file and try again.",
1810
1743
  ],
1811
1744
  ]
1812
1745
  `);
@@ -1829,24 +1762,21 @@ describe('create command tests', () => {
1829
1762
  const runResult = await CreateCommand.run();
1830
1763
  expect(runResult).toMatchInlineSnapshot(`
1831
1764
  {
1832
- "imsOrgId": "1234",
1833
- "meshConfig": {
1834
- "sources": [
1835
- {
1836
- "handler": {
1837
- "graphql": {
1838
- "endpoint": "<gql_endpoint>",
1765
+ "mesh": {
1766
+ "meshConfig": {
1767
+ "sources": [
1768
+ {
1769
+ "handler": {
1770
+ "graphql": {
1771
+ "endpoint": "<gql_endpoint>",
1772
+ },
1839
1773
  },
1774
+ "name": "<api_name>",
1840
1775
  },
1841
- "name": "<api_name>",
1842
- },
1843
- ],
1776
+ ],
1777
+ },
1778
+ "meshId": "dummy_mesh_id",
1844
1779
  },
1845
- "meshId": "dummy_mesh_id",
1846
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
1847
- "projectId": "5678",
1848
- "workspaceId": "123456789",
1849
- "workspaceName": "Workspace01",
1850
1780
  }
1851
1781
  `);
1852
1782
  });
@@ -1865,7 +1795,7 @@ describe('create command tests', () => {
1865
1795
  const runResult = CreateCommand.run();
1866
1796
 
1867
1797
  await expect(runResult).rejects.toEqual(
1868
- new Error('Unable to import secrets. Please check the file and try again.'),
1798
+ new Error('Unable to import secrets. Check the file and try again.'),
1869
1799
  );
1870
1800
 
1871
1801
  expect(logSpy.mock.calls).toMatchInlineSnapshot(`
@@ -1878,7 +1808,7 @@ describe('create command tests', () => {
1878
1808
  expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`
1879
1809
  [
1880
1810
  [
1881
- "Unable to import secrets. Please check the file and try again.",
1811
+ "Unable to import secrets. Check the file and try again.",
1882
1812
  ],
1883
1813
  ]
1884
1814
  `);
@@ -1902,24 +1832,21 @@ describe('create command tests', () => {
1902
1832
  const runResult = await CreateCommand.run();
1903
1833
  expect(runResult).toMatchInlineSnapshot(`
1904
1834
  {
1905
- "imsOrgId": "1234",
1906
- "meshConfig": {
1907
- "sources": [
1908
- {
1909
- "handler": {
1910
- "graphql": {
1911
- "endpoint": "<gql_endpoint>",
1835
+ "mesh": {
1836
+ "meshConfig": {
1837
+ "sources": [
1838
+ {
1839
+ "handler": {
1840
+ "graphql": {
1841
+ "endpoint": "<gql_endpoint>",
1842
+ },
1912
1843
  },
1844
+ "name": "<api_name>",
1913
1845
  },
1914
- "name": "<api_name>",
1915
- },
1916
- ],
1846
+ ],
1847
+ },
1848
+ "meshId": "dummy_mesh_id",
1917
1849
  },
1918
- "meshId": "dummy_mesh_id",
1919
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
1920
- "projectId": "5678",
1921
- "workspaceId": "123456789",
1922
- "workspaceName": "Workspace01",
1923
1850
  }
1924
1851
  `);
1925
1852
  });
@@ -1942,24 +1869,21 @@ describe('create command tests', () => {
1942
1869
  const runResult = await CreateCommand.run();
1943
1870
  expect(runResult).toMatchInlineSnapshot(`
1944
1871
  {
1945
- "imsOrgId": "1234",
1946
- "meshConfig": {
1947
- "sources": [
1948
- {
1949
- "handler": {
1950
- "graphql": {
1951
- "endpoint": "<gql_endpoint>",
1872
+ "mesh": {
1873
+ "meshConfig": {
1874
+ "sources": [
1875
+ {
1876
+ "handler": {
1877
+ "graphql": {
1878
+ "endpoint": "<gql_endpoint>",
1879
+ },
1952
1880
  },
1881
+ "name": "<api_name>",
1953
1882
  },
1954
- "name": "<api_name>",
1955
- },
1956
- ],
1883
+ ],
1884
+ },
1885
+ "meshId": "dummy_mesh_id",
1957
1886
  },
1958
- "meshId": "dummy_mesh_id",
1959
- "meshUrl": "https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
1960
- "projectId": "5678",
1961
- "workspaceId": "123456789",
1962
- "workspaceName": "Workspace01",
1963
1887
  }
1964
1888
  `);
1965
1889
  });
@@ -1980,7 +1904,7 @@ describe('create command tests', () => {
1980
1904
 
1981
1905
  const runResult = CreateCommand.run();
1982
1906
  await expect(runResult).rejects.toEqual(
1983
- new Error('Unable to import secrets. Please check the file and try again.'),
1907
+ new Error('Unable to import secrets. Check the file and try again.'),
1984
1908
  );
1985
1909
  expect(logSpy.mock.calls).toMatchInlineSnapshot(`
1986
1910
  [