@adobe/aio-cli-plugin-api-mesh 2.3.2 → 2.3.3
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__/delete.test.js +2 -2
- package/src/commands/api-mesh/__tests__/get.test.js +2 -2
- package/src/commands/api-mesh/__tests__/init.test.js +17 -17
- package/src/commands/api-mesh/__tests__/update.test.js +15 -15
- package/src/commands/api-mesh/create.js +13 -6
- package/src/commands/api-mesh/describe.js +9 -3
- package/src/constants.js +7 -2
- package/src/utils.js +1 -1
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.3.
|
|
1
|
+
{"version":"2.3.3","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"}},"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: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"}},"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
|
@@ -112,7 +112,7 @@ describe('delete command tests', () => {
|
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
test('should fail if mesh id is missing', async () => {
|
|
115
|
-
getMeshId.
|
|
115
|
+
getMeshId.mockResolvedValueOnce(null);
|
|
116
116
|
const runResult = DeleteCommand.run();
|
|
117
117
|
|
|
118
118
|
return runResult.catch(err => {
|
|
@@ -147,7 +147,7 @@ describe('delete command tests', () => {
|
|
|
147
147
|
});
|
|
148
148
|
|
|
149
149
|
test('should not ask for prompt if autoConfirmAction is set', async () => {
|
|
150
|
-
parseSpy.
|
|
150
|
+
parseSpy.mockResolvedValueOnce({
|
|
151
151
|
args: {},
|
|
152
152
|
flags: {
|
|
153
153
|
ignoreCache: mockIgnoreCacheFlag,
|
|
@@ -109,7 +109,7 @@ describe('get command tests', () => {
|
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
test('should fail if mesh id is missing', async () => {
|
|
112
|
-
getMeshId.
|
|
112
|
+
getMeshId.mockResolvedValueOnce(null);
|
|
113
113
|
const runResult = GetCommand.run();
|
|
114
114
|
|
|
115
115
|
return runResult.catch(err => {
|
|
@@ -128,7 +128,7 @@ describe('get command tests', () => {
|
|
|
128
128
|
});
|
|
129
129
|
|
|
130
130
|
test('should fail if getMeshId failed', async () => {
|
|
131
|
-
getMeshId.
|
|
131
|
+
getMeshId.mockRejectedValueOnce(new Error('getMeshId failed'));
|
|
132
132
|
const runResult = GetCommand.run();
|
|
133
133
|
|
|
134
134
|
return runResult.catch(err => {
|
|
@@ -95,7 +95,7 @@ describe('Workspace init command tests', () => {
|
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
test('Command should pass with no flags', async () => {
|
|
98
|
-
parseSpy.
|
|
98
|
+
parseSpy.mockResolvedValueOnce({
|
|
99
99
|
args: {
|
|
100
100
|
projectName: mockProjectName,
|
|
101
101
|
},
|
|
@@ -103,7 +103,7 @@ describe('Workspace init command tests', () => {
|
|
|
103
103
|
path: './template',
|
|
104
104
|
},
|
|
105
105
|
});
|
|
106
|
-
promptSelect.
|
|
106
|
+
promptSelect.mockResolvedValueOnce('yarn');
|
|
107
107
|
await InitCommand.run();
|
|
108
108
|
expect(promptConfirm).toHaveBeenCalled();
|
|
109
109
|
expect(promptSelect).toHaveBeenCalled();
|
|
@@ -121,7 +121,7 @@ describe('Workspace init command tests', () => {
|
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
test('Command should pass and create git project if git flag is provided', async () => {
|
|
124
|
-
parseSpy.
|
|
124
|
+
parseSpy.mockResolvedValueOnce({
|
|
125
125
|
args: {
|
|
126
126
|
projectName: mockProjectName,
|
|
127
127
|
},
|
|
@@ -149,7 +149,7 @@ describe('Workspace init command tests', () => {
|
|
|
149
149
|
});
|
|
150
150
|
|
|
151
151
|
test('Command should fail if git flag is provided and git init fails', async () => {
|
|
152
|
-
parseSpy.
|
|
152
|
+
parseSpy.mockResolvedValueOnce({
|
|
153
153
|
args: {
|
|
154
154
|
projectName: mockProjectName,
|
|
155
155
|
},
|
|
@@ -178,7 +178,7 @@ describe('Workspace init command tests', () => {
|
|
|
178
178
|
});
|
|
179
179
|
|
|
180
180
|
test('Command should pass and create yarn project if yarn is package manager', async () => {
|
|
181
|
-
parseSpy.
|
|
181
|
+
parseSpy.mockResolvedValueOnce({
|
|
182
182
|
args: {
|
|
183
183
|
projectName: mockProjectName,
|
|
184
184
|
},
|
|
@@ -203,7 +203,7 @@ describe('Workspace init command tests', () => {
|
|
|
203
203
|
});
|
|
204
204
|
|
|
205
205
|
test('Command should pass and create yarn + git project if yarn is package manager and git flag is set', async () => {
|
|
206
|
-
parseSpy.
|
|
206
|
+
parseSpy.mockResolvedValueOnce({
|
|
207
207
|
args: {
|
|
208
208
|
projectName: mockProjectName,
|
|
209
209
|
},
|
|
@@ -227,7 +227,7 @@ describe('Workspace init command tests', () => {
|
|
|
227
227
|
});
|
|
228
228
|
|
|
229
229
|
test('Command should pass with creating the sub directory if the directory already exists', async () => {
|
|
230
|
-
parseSpy.
|
|
230
|
+
parseSpy.mockResolvedValueOnce({
|
|
231
231
|
args: {
|
|
232
232
|
projectName: mockProjectName,
|
|
233
233
|
},
|
|
@@ -237,7 +237,7 @@ describe('Workspace init command tests', () => {
|
|
|
237
237
|
packageManager: mockPMDefaultFlag,
|
|
238
238
|
},
|
|
239
239
|
});
|
|
240
|
-
access.
|
|
240
|
+
access.mockResolvedValueOnce({});
|
|
241
241
|
|
|
242
242
|
await InitCommand.run();
|
|
243
243
|
|
|
@@ -252,7 +252,7 @@ describe('Workspace init command tests', () => {
|
|
|
252
252
|
});
|
|
253
253
|
|
|
254
254
|
test('Command should fail if the directory already exists and sub directory of project name exists', async () => {
|
|
255
|
-
parseSpy.
|
|
255
|
+
parseSpy.mockResolvedValueOnce({
|
|
256
256
|
args: {
|
|
257
257
|
projectName: mockProjectName,
|
|
258
258
|
},
|
|
@@ -262,7 +262,7 @@ describe('Workspace init command tests', () => {
|
|
|
262
262
|
packageManager: mockPMDefaultFlag,
|
|
263
263
|
},
|
|
264
264
|
});
|
|
265
|
-
access.
|
|
265
|
+
access.mockResolvedValueOnce({});
|
|
266
266
|
mkdir.mockRejectedValue(new Error());
|
|
267
267
|
|
|
268
268
|
await expect(InitCommand.run()).rejects.toThrow();
|
|
@@ -280,7 +280,7 @@ describe('Workspace init command tests', () => {
|
|
|
280
280
|
});
|
|
281
281
|
|
|
282
282
|
test('Command should fail if directory creation fails', async () => {
|
|
283
|
-
parseSpy.
|
|
283
|
+
parseSpy.mockResolvedValueOnce({
|
|
284
284
|
args: {
|
|
285
285
|
projectName: mockProjectName,
|
|
286
286
|
},
|
|
@@ -306,7 +306,7 @@ describe('Workspace init command tests', () => {
|
|
|
306
306
|
});
|
|
307
307
|
|
|
308
308
|
test('Command should fail if npm install fails', async () => {
|
|
309
|
-
parseSpy.
|
|
309
|
+
parseSpy.mockResolvedValueOnce({
|
|
310
310
|
args: {
|
|
311
311
|
projectName: mockProjectName,
|
|
312
312
|
},
|
|
@@ -333,7 +333,7 @@ describe('Workspace init command tests', () => {
|
|
|
333
333
|
});
|
|
334
334
|
|
|
335
335
|
test('Command should fail if yarn install fails', async () => {
|
|
336
|
-
parseSpy.
|
|
336
|
+
parseSpy.mockResolvedValueOnce({
|
|
337
337
|
args: {
|
|
338
338
|
projectName: mockProjectName,
|
|
339
339
|
},
|
|
@@ -360,7 +360,7 @@ describe('Workspace init command tests', () => {
|
|
|
360
360
|
});
|
|
361
361
|
|
|
362
362
|
test('Command should exit if sub directory prompt is provided with no', async () => {
|
|
363
|
-
parseSpy.
|
|
363
|
+
parseSpy.mockResolvedValueOnce({
|
|
364
364
|
args: {
|
|
365
365
|
projectName: mockProjectName,
|
|
366
366
|
},
|
|
@@ -373,7 +373,7 @@ describe('Workspace init command tests', () => {
|
|
|
373
373
|
// create workspace prompt
|
|
374
374
|
promptConfirm.mockResolvedValueOnce(true);
|
|
375
375
|
// access passes
|
|
376
|
-
access.
|
|
376
|
+
access.mockResolvedValueOnce({});
|
|
377
377
|
// create in sub directory prompt
|
|
378
378
|
promptConfirm.mockResolvedValueOnce(false);
|
|
379
379
|
await InitCommand.run();
|
|
@@ -383,8 +383,8 @@ describe('Workspace init command tests', () => {
|
|
|
383
383
|
});
|
|
384
384
|
|
|
385
385
|
test('test createPackageJson', async () => {
|
|
386
|
-
jest.spyOn(fs, 'readFile').
|
|
387
|
-
jest.spyOn(fs, 'writeFile').
|
|
386
|
+
jest.spyOn(fs, 'readFile').mockResolvedValueOnce({});
|
|
387
|
+
jest.spyOn(fs, 'writeFile').mockResolvedValueOnce({});
|
|
388
388
|
|
|
389
389
|
await expect(InitCommand.prototype.createPackageJson()).resolves;
|
|
390
390
|
});
|
|
@@ -89,7 +89,7 @@ describe('update command tests', () => {
|
|
|
89
89
|
],
|
|
90
90
|
},
|
|
91
91
|
};
|
|
92
|
-
readFile.
|
|
92
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
93
93
|
|
|
94
94
|
parseSpy.mockResolvedValueOnce({
|
|
95
95
|
args: { file: 'src/commands/__fixtures__/sample_mesh.json' },
|
|
@@ -148,7 +148,7 @@ describe('update command tests', () => {
|
|
|
148
148
|
],
|
|
149
149
|
},
|
|
150
150
|
};
|
|
151
|
-
readFile.
|
|
151
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
152
152
|
|
|
153
153
|
parseSpy.mockResolvedValueOnce({
|
|
154
154
|
args: { file: 'src/commands/__fixtures__/sample_mesh.json' },
|
|
@@ -207,7 +207,7 @@ describe('update command tests', () => {
|
|
|
207
207
|
],
|
|
208
208
|
},
|
|
209
209
|
};
|
|
210
|
-
readFile.
|
|
210
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
211
211
|
|
|
212
212
|
parseSpy.mockResolvedValueOnce({
|
|
213
213
|
args: { file: 'src/commands/__fixtures__/sample_mesh.json' },
|
|
@@ -267,7 +267,7 @@ describe('update command tests', () => {
|
|
|
267
267
|
],
|
|
268
268
|
},
|
|
269
269
|
};
|
|
270
|
-
readFile.
|
|
270
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
271
271
|
|
|
272
272
|
parseSpy.mockResolvedValueOnce({
|
|
273
273
|
args: { file: 'src/commands/__fixtures__/sample_mesh.json' },
|
|
@@ -277,7 +277,7 @@ describe('update command tests', () => {
|
|
|
277
277
|
},
|
|
278
278
|
});
|
|
279
279
|
|
|
280
|
-
getMeshId.
|
|
280
|
+
getMeshId.mockResolvedValueOnce(null);
|
|
281
281
|
const runResult = UpdateCommand.run();
|
|
282
282
|
|
|
283
283
|
await expect(runResult).rejects.toMatchInlineSnapshot(
|
|
@@ -308,7 +308,7 @@ describe('update command tests', () => {
|
|
|
308
308
|
],
|
|
309
309
|
},
|
|
310
310
|
};
|
|
311
|
-
readFile.
|
|
311
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
312
312
|
|
|
313
313
|
parseSpy.mockResolvedValueOnce({
|
|
314
314
|
args: { file: 'src/commands/__fixtures__/sample_mesh.json' },
|
|
@@ -349,7 +349,7 @@ describe('update command tests', () => {
|
|
|
349
349
|
],
|
|
350
350
|
},
|
|
351
351
|
};
|
|
352
|
-
readFile.
|
|
352
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
353
353
|
|
|
354
354
|
parseSpy.mockResolvedValueOnce({
|
|
355
355
|
args: { file: 'src/commands/__fixtures__/sample_mesh.json' },
|
|
@@ -451,7 +451,7 @@ describe('update command tests', () => {
|
|
|
451
451
|
],
|
|
452
452
|
},
|
|
453
453
|
};
|
|
454
|
-
readFile.
|
|
454
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
455
455
|
|
|
456
456
|
parseSpy.mockResolvedValueOnce({
|
|
457
457
|
args: { file: 'src/commands/__fixtures__/sample_mesh.json' },
|
|
@@ -500,7 +500,7 @@ describe('update command tests', () => {
|
|
|
500
500
|
],
|
|
501
501
|
},
|
|
502
502
|
};
|
|
503
|
-
readFile.
|
|
503
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
504
504
|
|
|
505
505
|
let meshConfig = {
|
|
506
506
|
sources: [
|
|
@@ -530,12 +530,12 @@ describe('update command tests', () => {
|
|
|
530
530
|
],
|
|
531
531
|
};
|
|
532
532
|
|
|
533
|
-
updateMesh.
|
|
533
|
+
updateMesh.mockResolvedValueOnce({
|
|
534
534
|
meshId: 'dummy_mesh_id',
|
|
535
535
|
meshConfig: meshConfig,
|
|
536
536
|
});
|
|
537
537
|
|
|
538
|
-
parseSpy.
|
|
538
|
+
parseSpy.mockResolvedValueOnce({
|
|
539
539
|
args: { file: 'src/commands/__fixtures__/sample_mesh_files.json' },
|
|
540
540
|
flags: {
|
|
541
541
|
autoConfirmAction: mockAutoApproveAction,
|
|
@@ -645,9 +645,9 @@ describe('update command tests', () => {
|
|
|
645
645
|
],
|
|
646
646
|
},
|
|
647
647
|
};
|
|
648
|
-
readFile.
|
|
648
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
649
649
|
|
|
650
|
-
parseSpy.
|
|
650
|
+
parseSpy.mockResolvedValueOnce({
|
|
651
651
|
args: { file: 'src/commands/__fixtures__/sample_mesh_invalid_file_name.json' },
|
|
652
652
|
flags: {
|
|
653
653
|
ignoreCache: mockIgnoreCacheFlag,
|
|
@@ -700,9 +700,9 @@ describe('update command tests', () => {
|
|
|
700
700
|
],
|
|
701
701
|
},
|
|
702
702
|
};
|
|
703
|
-
readFile.
|
|
703
|
+
readFile.mockResolvedValueOnce(JSON.stringify(sampleMesh));
|
|
704
704
|
|
|
705
|
-
parseSpy.
|
|
705
|
+
parseSpy.mockResolvedValueOnce({
|
|
706
706
|
args: { file: 'src/commands/__fixtures__/sample_mesh_files.json' },
|
|
707
707
|
flags: {
|
|
708
708
|
ignoreCache: mockIgnoreCacheFlag,
|
|
@@ -10,7 +10,6 @@ governing permissions and limitations under the License.
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
const { Command } = require('@oclif/core');
|
|
13
|
-
|
|
14
13
|
const { initSdk, initRequestId, promptConfirm, importFiles } = require('../../helpers');
|
|
15
14
|
const logger = require('../../classes/logger');
|
|
16
15
|
const CONSTANTS = require('../../constants');
|
|
@@ -31,7 +30,7 @@ const {
|
|
|
31
30
|
subscribeCredentialToMeshService,
|
|
32
31
|
} = require('../../lib/devConsole');
|
|
33
32
|
|
|
34
|
-
const { MULTITENANT_GRAPHQL_SERVER_BASE_URL } = CONSTANTS;
|
|
33
|
+
const { MULTITENANT_GRAPHQL_SERVER_BASE_URL, TMOConstants } = CONSTANTS;
|
|
35
34
|
|
|
36
35
|
class CreateCommand extends Command {
|
|
37
36
|
static args = [{ name: 'file' }];
|
|
@@ -157,10 +156,18 @@ class CreateCommand extends Command {
|
|
|
157
156
|
? MULTITENANT_GRAPHQL_SERVER_BASE_URL
|
|
158
157
|
: meshURL;
|
|
159
158
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
if (
|
|
160
|
+
meshUrl === TMOConstants.TMO_STAGE_URL ||
|
|
161
|
+
meshUrl === TMOConstants.TMO_SANDBOX_URL ||
|
|
162
|
+
meshUrl === TMOConstants.TMO_PROD_URL
|
|
163
|
+
) {
|
|
164
|
+
this.log('Mesh Endpoint: %s\n', `${meshUrl}/${mesh.meshId}/graphql`);
|
|
165
|
+
} else {
|
|
166
|
+
this.log(
|
|
167
|
+
'Mesh Endpoint: %s\n',
|
|
168
|
+
`${meshUrl}/${mesh.meshId}/graphql?api_key=${adobeIdIntegrationsForWorkspace.apiKey}`,
|
|
169
|
+
);
|
|
170
|
+
}
|
|
164
171
|
} else {
|
|
165
172
|
this.log(
|
|
166
173
|
'Unable to subscribe API Key %s to API Mesh service',
|
|
@@ -19,7 +19,7 @@ const { describeMesh, getMesh } = require('../../lib/devConsole');
|
|
|
19
19
|
|
|
20
20
|
require('dotenv').config();
|
|
21
21
|
|
|
22
|
-
const { MULTITENANT_GRAPHQL_SERVER_BASE_URL } = CONSTANTS;
|
|
22
|
+
const { MULTITENANT_GRAPHQL_SERVER_BASE_URL, TMOConstants } = CONSTANTS;
|
|
23
23
|
|
|
24
24
|
class DescribeCommand extends Command {
|
|
25
25
|
static flags = {
|
|
@@ -55,11 +55,17 @@ class DescribeCommand extends Command {
|
|
|
55
55
|
const { meshURL } = await getMesh(imsOrgId, projectId, workspaceId, meshId);
|
|
56
56
|
const meshUrl = meshURL === '' ? MULTITENANT_GRAPHQL_SERVER_BASE_URL : meshURL;
|
|
57
57
|
|
|
58
|
-
if (
|
|
58
|
+
if (
|
|
59
|
+
apiKey &&
|
|
60
|
+
(meshUrl === TMOConstants.TMO_STAGE_URL ||
|
|
61
|
+
meshUrl === TMOConstants.TMO_SANDBOX_URL ||
|
|
62
|
+
meshUrl === TMOConstants.TMO_PROD_URL)
|
|
63
|
+
) {
|
|
64
|
+
this.log('Mesh Endpoint: %s\n', `${meshUrl}/${meshId}/graphql`);
|
|
65
|
+
} else if (apiKey) {
|
|
59
66
|
this.log('API Key: %s', apiKey);
|
|
60
67
|
this.log('Mesh Endpoint: %s\n', `${meshUrl}/${meshId}/graphql?api_key=${apiKey}`);
|
|
61
68
|
}
|
|
62
|
-
|
|
63
69
|
return meshDetails;
|
|
64
70
|
} else {
|
|
65
71
|
logger.error(
|
package/src/constants.js
CHANGED
|
@@ -19,5 +19,10 @@ const ProdConstants = {
|
|
|
19
19
|
AIO_CLI_API_KEY: 'aio-cli-console-auth',
|
|
20
20
|
SMS_BASE_URL: 'https://graph.adobe.io/api-admin',
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const TMOConstants = {
|
|
23
|
+
TMO_STAGE_URL: 'https://tigraph-dev.adobe.io/api',
|
|
24
|
+
TMO_SANDBOX_URL: 'https://tigraph-sandbox.adobe.io/api',
|
|
25
|
+
TMO_PROD_URL: 'https://tigraph.adobe.io/api',
|
|
26
|
+
};
|
|
27
|
+
const envConstants = clientEnv === 'stage' ? StageConstants : ProdConstants;
|
|
28
|
+
module.exports = { ...envConstants, TMOConstants };
|
package/src/utils.js
CHANGED
|
@@ -79,7 +79,7 @@ function getFilesInMeshConfig(data, meshConfigName) {
|
|
|
79
79
|
|
|
80
80
|
// Additional Resolvers
|
|
81
81
|
data.meshConfig.additionalResolvers?.forEach(additionalResolver => {
|
|
82
|
-
if (!fileURLRegex.test(additionalResolver)) {
|
|
82
|
+
if (typeof additionalResolver === 'string' && !fileURLRegex.test(additionalResolver)) {
|
|
83
83
|
filesList.push(additionalResolver);
|
|
84
84
|
}
|
|
85
85
|
});
|