@adobe/aio-cli-plugin-api-mesh 3.0.0 → 3.1.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 +13 -5
- package/src/commands/api-mesh/__tests__/create.test.js +9 -1
- package/src/commands/api-mesh/__tests__/describe.test.js +9 -9
- package/src/commands/api-mesh/__tests__/get.test.js +1 -0
- package/src/commands/api-mesh/__tests__/run.test.js +783 -0
- package/src/commands/api-mesh/create.js +19 -11
- package/src/commands/api-mesh/describe.js +15 -14
- package/src/commands/api-mesh/get.js +3 -3
- package/src/commands/api-mesh/init.js +8 -0
- package/src/commands/api-mesh/run.js +156 -0
- package/src/commands/api-mesh/source/__tests__/install.test.js +2 -0
- package/src/commands/api-mesh/source/install.js +4 -4
- package/src/commands/api-mesh/status.js +3 -3
- package/src/constants.js +2 -6
- package/src/helpers.js +59 -5
- package/src/lib/devConsole.js +7 -5
- package/src/server.js +168 -0
- package/src/serverUtils.js +323 -0
- package/src/templates/package.json +29 -19
- package/src/utils.js +12 -0
- package/src/uuid.js +21 -0
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"3.0.
|
|
1
|
+
{"version":"3.1.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"}},"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}},"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"}},"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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aio-cli-plugin-api-mesh",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.1.0-beta.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -14,17 +14,25 @@
|
|
|
14
14
|
"@oclif/config": "^1.15.1",
|
|
15
15
|
"@oclif/core": "^1.14.1",
|
|
16
16
|
"@oclif/errors": "^1.1.2",
|
|
17
|
+
"@adobe-apimesh/mesh-builder": "^1.0.3",
|
|
17
18
|
"axios": "^1.2.0",
|
|
18
19
|
"chalk": "^4.1.0",
|
|
19
20
|
"dotenv": "^16.0.3",
|
|
21
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
22
|
+
"eslint-plugin-security": "^1.5.0",
|
|
23
|
+
"eslint-plugin-sonarjs": "^0.16.0",
|
|
24
|
+
"eslint-plugin-standard": "^5.0.0",
|
|
25
|
+
"fastify": "^4.23.2",
|
|
20
26
|
"fs-extra": "^11.1.0",
|
|
21
27
|
"inquirer": "^8.2.4",
|
|
28
|
+
"jsmin": "1.0.1",
|
|
22
29
|
"json-interpolate": "^1.0.3",
|
|
30
|
+
"lru-cache": "^7.14.1",
|
|
23
31
|
"node-clipboardy": "^1.0.3",
|
|
32
|
+
"node-fetch": "2.6.1",
|
|
24
33
|
"pino": "^7.9.2",
|
|
25
34
|
"pino-pretty": "^7.6.0",
|
|
26
35
|
"pupa": "^3.1.0",
|
|
27
|
-
"jsmin": "1.0.1",
|
|
28
36
|
"source-registry-storage-adapter": "github:devx-services/source-registry-storage-adapter#main",
|
|
29
37
|
"uuid": "^8.3.2"
|
|
30
38
|
},
|
|
@@ -40,10 +48,10 @@
|
|
|
40
48
|
"eslint-config-standard": "^17.0.0",
|
|
41
49
|
"eslint-plugin-import": "^2.21.2",
|
|
42
50
|
"eslint-plugin-jest": "^23.13.2",
|
|
43
|
-
"eslint-plugin-
|
|
51
|
+
"eslint-plugin-json": "^3.1.0",
|
|
52
|
+
"eslint-plugin-no-loops": "^0.3.0",
|
|
53
|
+
"eslint-plugin-node": "^11.1.0",
|
|
44
54
|
"eslint-plugin-prettier": "^4.0.0",
|
|
45
|
-
"eslint-plugin-promise": "^6.0.0",
|
|
46
|
-
"eslint-plugin-standard": "^5.0.0",
|
|
47
55
|
"execa": "4.1.0",
|
|
48
56
|
"husky": "7.0.4",
|
|
49
57
|
"jest": "^29.2.2",
|
|
@@ -67,6 +67,7 @@ describe('create command tests', () => {
|
|
|
67
67
|
imsOrgId: selectedOrg.id,
|
|
68
68
|
projectId: selectedProject.id,
|
|
69
69
|
workspaceId: selectedWorkspace.id,
|
|
70
|
+
workspaceName: selectedWorkspace.title,
|
|
70
71
|
});
|
|
71
72
|
|
|
72
73
|
global.requestId = 'dummy_request_id';
|
|
@@ -278,6 +279,7 @@ describe('create command tests', () => {
|
|
|
278
279
|
"1234",
|
|
279
280
|
"5678",
|
|
280
281
|
"123456789",
|
|
282
|
+
"Workspace01",
|
|
281
283
|
{
|
|
282
284
|
"meshConfig": {
|
|
283
285
|
"sources": [
|
|
@@ -367,6 +369,7 @@ describe('create command tests', () => {
|
|
|
367
369
|
"1234",
|
|
368
370
|
"5678",
|
|
369
371
|
"123456789",
|
|
372
|
+
"Workspace01",
|
|
370
373
|
{
|
|
371
374
|
"meshConfig": {
|
|
372
375
|
"sources": [
|
|
@@ -436,7 +439,7 @@ describe('create command tests', () => {
|
|
|
436
439
|
[
|
|
437
440
|
"Mesh Endpoint: %s
|
|
438
441
|
",
|
|
439
|
-
"https://tigraph.adobe.io/dummy_mesh_id/graphql
|
|
442
|
+
"https://tigraph.adobe.io/dummy_mesh_id/graphql",
|
|
440
443
|
],
|
|
441
444
|
]
|
|
442
445
|
`);
|
|
@@ -925,6 +928,7 @@ describe('create command tests', () => {
|
|
|
925
928
|
"1234",
|
|
926
929
|
"5678",
|
|
927
930
|
"123456789",
|
|
931
|
+
"Workspace01",
|
|
928
932
|
{
|
|
929
933
|
"meshConfig": {
|
|
930
934
|
"files": [
|
|
@@ -1186,6 +1190,7 @@ describe('create command tests', () => {
|
|
|
1186
1190
|
"1234",
|
|
1187
1191
|
"5678",
|
|
1188
1192
|
"123456789",
|
|
1193
|
+
"Workspace01",
|
|
1189
1194
|
{
|
|
1190
1195
|
"files": [
|
|
1191
1196
|
{
|
|
@@ -1314,6 +1319,7 @@ describe('create command tests', () => {
|
|
|
1314
1319
|
"1234",
|
|
1315
1320
|
"5678",
|
|
1316
1321
|
"123456789",
|
|
1322
|
+
"Workspace01",
|
|
1317
1323
|
{
|
|
1318
1324
|
"meshConfig": {
|
|
1319
1325
|
"files": [
|
|
@@ -1445,6 +1451,7 @@ describe('create command tests', () => {
|
|
|
1445
1451
|
"1234",
|
|
1446
1452
|
"5678",
|
|
1447
1453
|
"123456789",
|
|
1454
|
+
"Workspace01",
|
|
1448
1455
|
{
|
|
1449
1456
|
"meshConfig": {
|
|
1450
1457
|
"files": [
|
|
@@ -1573,6 +1580,7 @@ describe('create command tests', () => {
|
|
|
1573
1580
|
"1234",
|
|
1574
1581
|
"5678",
|
|
1575
1582
|
"123456789",
|
|
1583
|
+
"Workspace01",
|
|
1576
1584
|
{
|
|
1577
1585
|
"meshConfig": {
|
|
1578
1586
|
"files": [
|
|
@@ -52,6 +52,7 @@ describe('describe command tests', () => {
|
|
|
52
52
|
imsOrgId: selectedOrg.id,
|
|
53
53
|
projectId: selectedProject.id,
|
|
54
54
|
workspaceId: selectedWorkspace.id,
|
|
55
|
+
workspaceName: selectedWorkspace.title,
|
|
55
56
|
});
|
|
56
57
|
|
|
57
58
|
global.requestId = 'dummy_request_id';
|
|
@@ -174,6 +175,11 @@ describe('describe command tests', () => {
|
|
|
174
175
|
"Mesh ID: %s",
|
|
175
176
|
"dummy_meshId",
|
|
176
177
|
],
|
|
178
|
+
[
|
|
179
|
+
"Mesh Endpoint: %s
|
|
180
|
+
",
|
|
181
|
+
"https://graph.adobe.io/api/dummy_meshId/graphql",
|
|
182
|
+
],
|
|
177
183
|
]
|
|
178
184
|
`);
|
|
179
185
|
expect(errorLogSpy.mock.calls).toMatchInlineSnapshot(`[]`);
|
|
@@ -187,6 +193,7 @@ describe('describe command tests', () => {
|
|
|
187
193
|
selectedOrg.id,
|
|
188
194
|
selectedProject.id,
|
|
189
195
|
selectedWorkspace.id,
|
|
196
|
+
selectedWorkspace.title,
|
|
190
197
|
);
|
|
191
198
|
expect(runResult).toMatchInlineSnapshot(`
|
|
192
199
|
{
|
|
@@ -216,10 +223,6 @@ describe('describe command tests', () => {
|
|
|
216
223
|
"Mesh ID: %s",
|
|
217
224
|
"dummy_meshId",
|
|
218
225
|
],
|
|
219
|
-
[
|
|
220
|
-
"API Key: %s",
|
|
221
|
-
"dummy_apiKey",
|
|
222
|
-
],
|
|
223
226
|
[
|
|
224
227
|
"Mesh Endpoint: %s
|
|
225
228
|
",
|
|
@@ -242,6 +245,7 @@ describe('describe command tests', () => {
|
|
|
242
245
|
selectedOrg.id,
|
|
243
246
|
selectedProject.id,
|
|
244
247
|
selectedWorkspace.id,
|
|
248
|
+
selectedWorkspace.title,
|
|
245
249
|
);
|
|
246
250
|
expect(runResult).toMatchInlineSnapshot(`
|
|
247
251
|
{
|
|
@@ -271,14 +275,10 @@ describe('describe command tests', () => {
|
|
|
271
275
|
"Mesh ID: %s",
|
|
272
276
|
"dummy_meshId",
|
|
273
277
|
],
|
|
274
|
-
[
|
|
275
|
-
"API Key: %s",
|
|
276
|
-
"dummy_apiKey",
|
|
277
|
-
],
|
|
278
278
|
[
|
|
279
279
|
"Mesh Endpoint: %s
|
|
280
280
|
",
|
|
281
|
-
"https://tigraph.adobe.io/dummy_meshId/graphql
|
|
281
|
+
"https://tigraph.adobe.io/dummy_meshId/graphql",
|
|
282
282
|
],
|
|
283
283
|
]
|
|
284
284
|
`);
|