@adobe/aio-cli-plugin-api-mesh 3.6.1 → 3.7.0-beta.1
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/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/commands/api-mesh/__tests__/create.test.js +46 -23
- package/src/commands/api-mesh/__tests__/describe.test.js +61 -23
- package/src/commands/api-mesh/create.js +14 -10
- package/src/commands/api-mesh/describe.js +20 -11
- package/src/commands/api-mesh/status.js +13 -11
- package/src/server.js +1 -0
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"3.
|
|
1
|
+
{"version":"3.7.0-beta.1","commands":{"PLUGINNAME":{"id":"PLUGINNAME","description":"Your description here","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio PLUGINNAME:some_command"],"flags":{"someflag":{"name":"someflag","type":"option","char":"f","description":"this is some flag"}},"args":[]},"api-mesh:create":{"id":"api-mesh:create","description":"Create a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:delete":{"id":"api-mesh:delete","description":"Delete the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false}},"args":[]},"api-mesh:describe":{"id":"api-mesh:describe","description":"Get details of a mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:get":{"id":"api-mesh:get","description":"Get the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[{"name":"file"}]},"api-mesh:init":{"id":"api-mesh:init","description":"This command will create a workspace where you can organise your API mesh configuration and other files","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[{"description":"API mesh workspace init","command":"aio api-mesh init commerce-mesh"},{"description":"API mesh workspace init with flags","command":"aio api-mesh init commerce-mesh --path ./mesh_projects/test_mesh --git y --packageManager yarn"}],"flags":{"path":{"name":"path","type":"option","char":"p","default":"."},"packageManager":{"name":"packageManager","type":"option","char":"m","options":["npm","yarn"]},"git":{"name":"git","type":"option","char":"g","options":["y","n"]}},"args":[{"name":"projectName","description":"Project name","required":true}]},"api-mesh:run":{"id":"api-mesh:run","description":"Run a local development server that builds and compiles a mesh locally","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"Port number for the local dev server"},"debug":{"name":"debug","type":"boolean","description":"Enable debugging mode","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"select":{"name":"select","type":"boolean","description":"Retrieve existing artifacts from the mesh","allowNo":false},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file","description":"Mesh File"}]},"api-mesh:status":{"id":"api-mesh:status","description":"Get a mesh status with a given meshid.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:update":{"id":"api-mesh:update","description":"Update a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:source:discover":{"id":"api-mesh:source:discover","description":"Return the list of avaliable sources","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm install action prompt. CLI will not check ask user to install source.","allowNo":false}},"args":[]},"api-mesh:source:get":{"id":"api-mesh:source:get","description":"Command returns the content of a specific source.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:get -s=<version>@<source_name>","$ aio api-mesh:source:get -s<source_name>","$ aio api-mesh:source:get -m"],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm print action prompt. CLI will not check ask user to print source.","allowNo":false},"source":{"name":"source","type":"option","char":"s","description":"Source name"},"multiple":{"name":"multiple","type":"boolean","char":"m","description":"Select multiple sources","allowNo":false}},"args":[]},"api-mesh:source:install":{"id":"api-mesh:source:install","description":"Command to install the source to your API mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:install <version>@<source_name>","$ aio api-mesh:source:install <source_name> -v <variable_name>=<variable_value>","$ aio api-mesh:source:install <source_name> -f <path_to_variables_file>"],"flags":{"source":{"name":"source","type":"option","char":"s","description":"Source name"},"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm override action prompt. CLI will not check ask user to override source.","allowNo":false},"variable":{"name":"variable","type":"option","char":"v","description":"Variables required for the source"},"variable-file":{"name":"variable-file","type":"option","char":"f","description":"Variables file path"},"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[{"name":"source"}]}}}
|
package/package.json
CHANGED
|
@@ -75,6 +75,10 @@ jest.mock('../../../lib/devConsole');
|
|
|
75
75
|
jest.mock('chalk', () => ({
|
|
76
76
|
red: jest.fn(text => text), // Return the input text without any color formatting
|
|
77
77
|
bold: jest.fn(text => text),
|
|
78
|
+
underline: {
|
|
79
|
+
blue: jest.fn(text => text),
|
|
80
|
+
},
|
|
81
|
+
bgYellow: jest.fn(text => text),
|
|
78
82
|
}));
|
|
79
83
|
jest.mock('crypto');
|
|
80
84
|
|
|
@@ -409,10 +413,23 @@ describe('create command tests', () => {
|
|
|
409
413
|
"dummy_api_key",
|
|
410
414
|
],
|
|
411
415
|
[
|
|
412
|
-
"
|
|
416
|
+
"
|
|
417
|
+
API Mesh now runs at the edge and legacy mesh URLs will be deprecated.
|
|
418
|
+
Use the following link to find more information on how to migrate your mesh:",
|
|
419
|
+
],
|
|
420
|
+
[
|
|
421
|
+
"https://developer.adobe.com/graphql-mesh-gateway/mesh/release/migration
|
|
413
422
|
",
|
|
423
|
+
],
|
|
424
|
+
[
|
|
425
|
+
"Legacy Mesh Endpoint: %s",
|
|
414
426
|
"https://graph.adobe.io/api/dummy_mesh_id/graphql?api_key=dummy_api_key",
|
|
415
427
|
],
|
|
428
|
+
[
|
|
429
|
+
"Edge Mesh Endpoint: %s
|
|
430
|
+
",
|
|
431
|
+
"https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
|
|
432
|
+
],
|
|
416
433
|
]
|
|
417
434
|
`);
|
|
418
435
|
expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`[]`);
|
|
@@ -502,10 +519,23 @@ describe('create command tests', () => {
|
|
|
502
519
|
"dummy_api_key",
|
|
503
520
|
],
|
|
504
521
|
[
|
|
505
|
-
"
|
|
522
|
+
"
|
|
523
|
+
API Mesh now runs at the edge and legacy mesh URLs will be deprecated.
|
|
524
|
+
Use the following link to find more information on how to migrate your mesh:",
|
|
525
|
+
],
|
|
526
|
+
[
|
|
527
|
+
"https://developer.adobe.com/graphql-mesh-gateway/mesh/release/migration
|
|
506
528
|
",
|
|
529
|
+
],
|
|
530
|
+
[
|
|
531
|
+
"Legacy Mesh Endpoint: %s",
|
|
507
532
|
"https://tigraph.adobe.io/dummy_mesh_id/graphql",
|
|
508
533
|
],
|
|
534
|
+
[
|
|
535
|
+
"Edge Mesh Endpoint: %s
|
|
536
|
+
",
|
|
537
|
+
"https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
|
|
538
|
+
],
|
|
509
539
|
]
|
|
510
540
|
`);
|
|
511
541
|
expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`[]`);
|
|
@@ -693,10 +723,23 @@ describe('create command tests', () => {
|
|
|
693
723
|
"dummy_api_key",
|
|
694
724
|
],
|
|
695
725
|
[
|
|
696
|
-
"
|
|
726
|
+
"
|
|
727
|
+
API Mesh now runs at the edge and legacy mesh URLs will be deprecated.
|
|
728
|
+
Use the following link to find more information on how to migrate your mesh:",
|
|
729
|
+
],
|
|
730
|
+
[
|
|
731
|
+
"https://developer.adobe.com/graphql-mesh-gateway/mesh/release/migration
|
|
697
732
|
",
|
|
733
|
+
],
|
|
734
|
+
[
|
|
735
|
+
"Legacy Mesh Endpoint: %s",
|
|
698
736
|
"https://graph.adobe.io/api/dummy_mesh_id/graphql?api_key=dummy_api_key",
|
|
699
737
|
],
|
|
738
|
+
[
|
|
739
|
+
"Edge Mesh Endpoint: %s
|
|
740
|
+
",
|
|
741
|
+
"https://edge-sandbox-graph.adobe.io/api/dummy_mesh_id/graphql",
|
|
742
|
+
],
|
|
700
743
|
]
|
|
701
744
|
`);
|
|
702
745
|
expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`[]`);
|
|
@@ -1883,26 +1926,6 @@ describe('create command tests', () => {
|
|
|
1883
1926
|
);
|
|
1884
1927
|
});
|
|
1885
1928
|
|
|
1886
|
-
test('should not show edge mesh url if feature is disabled', async () => {
|
|
1887
|
-
// mock the edge mesh url feature to be disabled
|
|
1888
|
-
getTenantFeatures.mockResolvedValueOnce({
|
|
1889
|
-
imsOrgId: selectedOrg.code,
|
|
1890
|
-
showCloudflareURL: false,
|
|
1891
|
-
});
|
|
1892
|
-
|
|
1893
|
-
await CreateCommand.run();
|
|
1894
|
-
|
|
1895
|
-
expect(logSpy).not.toHaveBeenCalledWith(
|
|
1896
|
-
expect.stringContaining('Edge Mesh Endpoint:'),
|
|
1897
|
-
expect.any(String),
|
|
1898
|
-
);
|
|
1899
|
-
|
|
1900
|
-
expect(logSpy).toHaveBeenCalledWith(
|
|
1901
|
-
expect.stringContaining('Mesh Endpoint:'),
|
|
1902
|
-
'https://graph.adobe.io/api/dummy_mesh_id/graphql?api_key=dummy_api_key',
|
|
1903
|
-
);
|
|
1904
|
-
});
|
|
1905
|
-
|
|
1906
1929
|
test('should return error if mesh has placeholders and the provided secrets file is invalid', async () => {
|
|
1907
1930
|
parseSpy.mockResolvedValueOnce({
|
|
1908
1931
|
args: { file: 'src/commands/__fixtures__/sample_secrets_mesh.json' },
|
|
@@ -24,6 +24,13 @@ jest.mock('@adobe/aio-cli-lib-console', () => ({
|
|
|
24
24
|
cleanStdOut: jest.fn(),
|
|
25
25
|
}));
|
|
26
26
|
jest.mock('../../../lib/devConsole');
|
|
27
|
+
jest.mock('chalk', () => ({
|
|
28
|
+
bold: jest.fn(text => text), // Return the input text without any color formatting
|
|
29
|
+
underline: {
|
|
30
|
+
blue: jest.fn(text => text),
|
|
31
|
+
},
|
|
32
|
+
bgYellow: jest.fn(text => text),
|
|
33
|
+
}));
|
|
27
34
|
|
|
28
35
|
const DescribeCommand = require('../describe');
|
|
29
36
|
const { initSdk, initRequestId } = require('../../../helpers');
|
|
@@ -179,10 +186,27 @@ describe('describe command tests', () => {
|
|
|
179
186
|
"dummy_meshId",
|
|
180
187
|
],
|
|
181
188
|
[
|
|
182
|
-
"
|
|
189
|
+
"
|
|
190
|
+
API Mesh now runs at the edge and legacy mesh URLs will be deprecated.
|
|
191
|
+
Use the following link to find more information on how to migrate your mesh:",
|
|
192
|
+
],
|
|
193
|
+
[
|
|
194
|
+
"https://developer.adobe.com/graphql-mesh-gateway/mesh/release/migration
|
|
183
195
|
",
|
|
196
|
+
],
|
|
197
|
+
[
|
|
198
|
+
"Legacy Mesh Endpoint: %s",
|
|
184
199
|
"https://graph.adobe.io/api/dummy_meshId/graphql",
|
|
185
200
|
],
|
|
201
|
+
[
|
|
202
|
+
"Edge Mesh Endpoint: %s
|
|
203
|
+
",
|
|
204
|
+
"https://edge-sandbox-graph.adobe.io/api/dummy_meshId/graphql",
|
|
205
|
+
],
|
|
206
|
+
[
|
|
207
|
+
"Update your mesh before using the edge mesh endpoint.
|
|
208
|
+
You can validate your edge mesh status using the aio api-mesh status command.",
|
|
209
|
+
],
|
|
186
210
|
]
|
|
187
211
|
`);
|
|
188
212
|
expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`[]`);
|
|
@@ -227,10 +251,27 @@ describe('describe command tests', () => {
|
|
|
227
251
|
"dummy_meshId",
|
|
228
252
|
],
|
|
229
253
|
[
|
|
230
|
-
"
|
|
254
|
+
"
|
|
255
|
+
API Mesh now runs at the edge and legacy mesh URLs will be deprecated.
|
|
256
|
+
Use the following link to find more information on how to migrate your mesh:",
|
|
257
|
+
],
|
|
258
|
+
[
|
|
259
|
+
"https://developer.adobe.com/graphql-mesh-gateway/mesh/release/migration
|
|
231
260
|
",
|
|
261
|
+
],
|
|
262
|
+
[
|
|
263
|
+
"Legacy Mesh Endpoint: %s",
|
|
232
264
|
"https://graph.adobe.io/api/dummy_meshId/graphql?api_key=dummy_apiKey",
|
|
233
265
|
],
|
|
266
|
+
[
|
|
267
|
+
"Edge Mesh Endpoint: %s
|
|
268
|
+
",
|
|
269
|
+
"https://edge-sandbox-graph.adobe.io/api/dummy_meshId/graphql",
|
|
270
|
+
],
|
|
271
|
+
[
|
|
272
|
+
"Update your mesh before using the edge mesh endpoint.
|
|
273
|
+
You can validate your edge mesh status using the aio api-mesh status command.",
|
|
274
|
+
],
|
|
234
275
|
]
|
|
235
276
|
`);
|
|
236
277
|
});
|
|
@@ -279,10 +320,27 @@ describe('describe command tests', () => {
|
|
|
279
320
|
"dummy_meshId",
|
|
280
321
|
],
|
|
281
322
|
[
|
|
282
|
-
"
|
|
323
|
+
"
|
|
324
|
+
API Mesh now runs at the edge and legacy mesh URLs will be deprecated.
|
|
325
|
+
Use the following link to find more information on how to migrate your mesh:",
|
|
326
|
+
],
|
|
327
|
+
[
|
|
328
|
+
"https://developer.adobe.com/graphql-mesh-gateway/mesh/release/migration
|
|
283
329
|
",
|
|
330
|
+
],
|
|
331
|
+
[
|
|
332
|
+
"Legacy Mesh Endpoint: %s",
|
|
284
333
|
"https://tigraph.adobe.io/dummy_meshId/graphql",
|
|
285
334
|
],
|
|
335
|
+
[
|
|
336
|
+
"Edge Mesh Endpoint: %s
|
|
337
|
+
",
|
|
338
|
+
"https://edge-sandbox-graph.adobe.io/api/dummy_meshId/graphql",
|
|
339
|
+
],
|
|
340
|
+
[
|
|
341
|
+
"Update your mesh before using the edge mesh endpoint.
|
|
342
|
+
You can validate your edge mesh status using the aio api-mesh status command.",
|
|
343
|
+
],
|
|
286
344
|
]
|
|
287
345
|
`);
|
|
288
346
|
expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`[]`);
|
|
@@ -337,24 +395,4 @@ describe('describe command tests', () => {
|
|
|
337
395
|
'https://edge-sandbox-graph.adobe.io/api/dummy_meshId/graphql',
|
|
338
396
|
);
|
|
339
397
|
});
|
|
340
|
-
|
|
341
|
-
test('should not show edge mesh url if feature is disabled', async () => {
|
|
342
|
-
// mock the edge mesh url feature to be disabled
|
|
343
|
-
getTenantFeatures.mockResolvedValueOnce({
|
|
344
|
-
imsOrgId: selectedOrg.code,
|
|
345
|
-
showCloudflareURL: false,
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
await DescribeCommand.run();
|
|
349
|
-
|
|
350
|
-
expect(logSpy).not.toHaveBeenCalledWith(
|
|
351
|
-
expect.stringContaining('Edge Mesh Endpoint:'),
|
|
352
|
-
expect.any(String),
|
|
353
|
-
);
|
|
354
|
-
|
|
355
|
-
expect(logSpy).toHaveBeenCalledWith(
|
|
356
|
-
expect.stringContaining('Mesh Endpoint:'),
|
|
357
|
-
'https://graph.adobe.io/api/dummy_meshId/graphql?api_key=dummy_apiKey',
|
|
358
|
-
);
|
|
359
|
-
});
|
|
360
398
|
});
|
|
@@ -27,7 +27,7 @@ const {
|
|
|
27
27
|
validateSecretsFile,
|
|
28
28
|
encryptSecrets,
|
|
29
29
|
} = require('../../utils');
|
|
30
|
-
const { createMesh,
|
|
30
|
+
const { createMesh, getPublicEncryptionKey } = require('../../lib/devConsole');
|
|
31
31
|
const { buildEdgeMeshUrl, buildMeshUrl } = require('../../urlBuilder');
|
|
32
32
|
|
|
33
33
|
class CreateCommand extends Command {
|
|
@@ -170,15 +170,19 @@ class CreateCommand extends Command {
|
|
|
170
170
|
apiKey,
|
|
171
171
|
);
|
|
172
172
|
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
173
|
+
const edgeMeshUrl = buildEdgeMeshUrl(mesh.meshId, workspaceName);
|
|
174
|
+
this.log(
|
|
175
|
+
chalk.bgYellow(
|
|
176
|
+
`\nAPI Mesh now runs at the edge and legacy mesh URLs will be deprecated.\nUse the following link to find more information on how to migrate your mesh:`,
|
|
177
|
+
),
|
|
178
|
+
);
|
|
179
|
+
this.log(
|
|
180
|
+
chalk.underline.blue(
|
|
181
|
+
'https://developer.adobe.com/graphql-mesh-gateway/mesh/release/migration\n',
|
|
182
|
+
),
|
|
183
|
+
);
|
|
184
|
+
this.log('Legacy Mesh Endpoint: %s', meshUrl);
|
|
185
|
+
this.log(chalk.bold('Edge Mesh Endpoint: %s\n'), edgeMeshUrl);
|
|
182
186
|
} else {
|
|
183
187
|
this.log('Unable to subscribe API Key %s to API Mesh service', apiKey);
|
|
184
188
|
}
|
|
@@ -15,7 +15,7 @@ const chalk = require('chalk');
|
|
|
15
15
|
const logger = require('../../classes/logger');
|
|
16
16
|
const { initSdk, initRequestId } = require('../../helpers');
|
|
17
17
|
const { ignoreCacheFlag } = require('../../utils');
|
|
18
|
-
const { describeMesh
|
|
18
|
+
const { describeMesh } = require('../../lib/devConsole');
|
|
19
19
|
const { buildMeshUrl, buildEdgeMeshUrl } = require('../../urlBuilder');
|
|
20
20
|
|
|
21
21
|
require('dotenv').config();
|
|
@@ -32,7 +32,7 @@ class DescribeCommand extends Command {
|
|
|
32
32
|
|
|
33
33
|
const { flags } = await this.parse(DescribeCommand);
|
|
34
34
|
const ignoreCache = await flags.ignoreCache;
|
|
35
|
-
const { imsOrgId,
|
|
35
|
+
const { imsOrgId, projectId, workspaceId, workspaceName } = await initSdk({
|
|
36
36
|
ignoreCache,
|
|
37
37
|
});
|
|
38
38
|
|
|
@@ -41,7 +41,6 @@ class DescribeCommand extends Command {
|
|
|
41
41
|
|
|
42
42
|
if (meshDetails) {
|
|
43
43
|
const { meshId, apiKey } = meshDetails;
|
|
44
|
-
const { showCloudflareURL: showEdgeMeshUrl } = await getTenantFeatures(imsOrgCode);
|
|
45
44
|
|
|
46
45
|
if (meshId) {
|
|
47
46
|
const meshUrl = await buildMeshUrl(
|
|
@@ -59,14 +58,24 @@ class DescribeCommand extends Command {
|
|
|
59
58
|
this.log('Workspace ID: %s', workspaceId);
|
|
60
59
|
this.log('Mesh ID: %s', meshId);
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
const edgeMeshUrl = buildEdgeMeshUrl(meshId, workspaceName);
|
|
62
|
+
this.log(
|
|
63
|
+
chalk.bgYellow(
|
|
64
|
+
`\nAPI Mesh now runs at the edge and legacy mesh URLs will be deprecated.\nUse the following link to find more information on how to migrate your mesh:`,
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
this.log(
|
|
68
|
+
chalk.underline.blue(
|
|
69
|
+
'https://developer.adobe.com/graphql-mesh-gateway/mesh/release/migration\n',
|
|
70
|
+
),
|
|
71
|
+
);
|
|
72
|
+
this.log('Legacy Mesh Endpoint: %s', meshUrl);
|
|
73
|
+
this.log(chalk.bold('Edge Mesh Endpoint: %s\n'), edgeMeshUrl);
|
|
74
|
+
this.log(
|
|
75
|
+
chalk.bgYellow(
|
|
76
|
+
'Update your mesh before using the edge mesh endpoint.\nYou can validate your edge mesh status using the aio api-mesh status command.',
|
|
77
|
+
),
|
|
78
|
+
);
|
|
70
79
|
return meshDetails;
|
|
71
80
|
} else {
|
|
72
81
|
logger.error(
|
|
@@ -3,12 +3,7 @@ const chalk = require('chalk');
|
|
|
3
3
|
|
|
4
4
|
const logger = require('../../classes/logger');
|
|
5
5
|
const { initRequestId, initSdk } = require('../../helpers');
|
|
6
|
-
const {
|
|
7
|
-
getMeshId,
|
|
8
|
-
getMesh,
|
|
9
|
-
getTenantFeatures,
|
|
10
|
-
getMeshDeployments,
|
|
11
|
-
} = require('../../lib/devConsole');
|
|
6
|
+
const { getMeshId, getMesh, getMeshDeployments } = require('../../lib/devConsole');
|
|
12
7
|
const { ignoreCacheFlag } = require('../../utils');
|
|
13
8
|
|
|
14
9
|
require('dotenv').config();
|
|
@@ -41,15 +36,22 @@ class StatusCommand extends Command {
|
|
|
41
36
|
|
|
42
37
|
if (meshId) {
|
|
43
38
|
try {
|
|
44
|
-
const { showCloudflareURL: showEdgeMeshUrl } = await getTenantFeatures(imsOrgCode);
|
|
45
39
|
const mesh = await getMesh(imsOrgId, projectId, workspaceId, workspaceName, meshId);
|
|
46
|
-
|
|
40
|
+
this.log(
|
|
41
|
+
chalk.bgYellow(
|
|
42
|
+
`\nAPI Mesh now runs at the edge and legacy mesh URLs will be deprecated.\nUse the following link to find more information on how to migrate your mesh:`,
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
this.log(
|
|
46
|
+
chalk.underline.blue(
|
|
47
|
+
'https://developer.adobe.com/graphql-mesh-gateway/mesh/release/migration\n',
|
|
48
|
+
),
|
|
49
|
+
);
|
|
50
|
+
const meshLabel = chalk.bold(`Legacy Mesh:`);
|
|
47
51
|
|
|
48
52
|
this.log(''.padEnd(102, '*'));
|
|
49
53
|
this.displayMeshStatus(mesh, meshLabel);
|
|
50
|
-
|
|
51
|
-
await this.displayEdgeMeshStatus(mesh, imsOrgCode, projectId, workspaceId);
|
|
52
|
-
}
|
|
54
|
+
await this.displayEdgeMeshStatus(mesh, imsOrgCode, projectId, workspaceId);
|
|
53
55
|
this.log(''.padEnd(102, '*'));
|
|
54
56
|
} catch (err) {
|
|
55
57
|
this.log(err.message);
|