@axinom/mosaic-cli 0.19.0-rc.1 → 0.19.0-rc.16
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/dist/commands/hosting/index.js +4 -67
- package/dist/commands/hosting/index.js.map +1 -1
- package/dist/commands/hosting/manifest/manifest-commands.d.ts +2 -0
- package/dist/commands/hosting/manifest/manifest-commands.js +65 -0
- package/dist/commands/hosting/manifest/manifest-commands.js.map +1 -0
- package/dist/commands/hosting/manifest/upload-manifest-options.d.ts +12 -0
- package/dist/commands/hosting/manifest/upload-manifest-options.js +3 -0
- package/dist/commands/hosting/manifest/upload-manifest-options.js.map +1 -0
- package/dist/commands/hosting/manifest/upload-manifest.d.ts +10 -0
- package/dist/commands/hosting/manifest/upload-manifest.js +144 -0
- package/dist/commands/hosting/manifest/upload-manifest.js.map +1 -0
- package/dist/commands/hosting/pilet/pilet-commands.d.ts +2 -0
- package/dist/commands/hosting/pilet/pilet-commands.js +70 -0
- package/dist/commands/hosting/pilet/pilet-commands.js.map +1 -0
- package/dist/commands/hosting/pilet/register-pilet-options.js.map +1 -0
- package/dist/commands/hosting/{register-pilet.js → pilet/register-pilet.js} +6 -6
- package/dist/commands/hosting/pilet/register-pilet.js.map +1 -0
- package/dist/commands/msg-codegen/codegen.js +8 -6
- package/dist/commands/msg-codegen/codegen.js.map +1 -1
- package/dist/commands/msg-codegen/utils.d.ts +1 -0
- package/dist/commands/msg-codegen/utils.js +9 -1
- package/dist/commands/msg-codegen/utils.js.map +1 -1
- package/package.json +5 -4
- package/src/commands/hosting/index.ts +7 -73
- package/src/commands/hosting/manifest/manifest-commands.ts +68 -0
- package/src/commands/hosting/manifest/upload-manifest-options.ts +12 -0
- package/src/commands/hosting/manifest/upload-manifest.ts +179 -0
- package/src/commands/hosting/pilet/pilet-commands.ts +74 -0
- package/src/commands/hosting/{register-pilet.ts → pilet/register-pilet.ts} +6 -6
- package/src/commands/msg-codegen/codegen.ts +10 -6
- package/src/commands/msg-codegen/utils.ts +8 -0
- package/dist/commands/hosting/register-pilet-options.js.map +0 -1
- package/dist/commands/hosting/register-pilet.js.map +0 -1
- /package/dist/commands/hosting/{register-pilet-options.d.ts → pilet/register-pilet-options.d.ts} +0 -0
- /package/dist/commands/hosting/{register-pilet-options.js → pilet/register-pilet-options.js} +0 -0
- /package/dist/commands/hosting/{register-pilet.d.ts → pilet/register-pilet.d.ts} +0 -0
- /package/src/commands/hosting/{register-pilet-options.ts → pilet/register-pilet-options.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/commands/msg-codegen/utils.ts"],"names":[],"mappings":";;;AAAA,iDAM4B;AAO5B,yBAAyB;AACzB,6BAA6B;AAE7B,SAAgB,cAAc,CAAC,IAAY,EAAE,EAAU;IACrD,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;QAC7B,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAJD,wCAIC;AAED,SAAgB,eAAe,CAAC,OAAyB;;IACvD,MAAM,YAAY,GAChB,MAAA,MAAA,MAAA,OAAO,CAAC,OAAO,EAAE,0CAAE,KAAK,EAAE,mCAC1B,MAAA,OAAO,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,uBAAuB,CAAC,0CAAE,KAAK,EAAE,mCAC1D,MAAA,MAAA,OAAO,CAAC,OAAO,EAAE,0CAAE,UAAU,GAAG,GAAG,CAAC,oBAAoB,CAAC,0CAAE,KAAK,EAAE,CAAC;IAErE,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACvD;IAED,OAAO,YAAY,CAAC;AAC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AAC,CAAC,EAAE;QACrC,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;KACrC;IACD,IAAI,qBAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;QACrC,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;KACrC;IACD,IAAI,qBAAqB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;QACrC,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;KACrC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC;AAbD,4DAaC;AAED,SAAgB,cAAc,CAAC,IAAY,EAAE,KAAa;IACxD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE;QAC1B,KAAK,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;KACrD;SAAM;QACL,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KAChC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AARD,wCAQC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-cli",
|
|
3
|
-
"version": "0.19.0-rc.
|
|
3
|
+
"version": "0.19.0-rc.16",
|
|
4
4
|
"description": "The Axinom Mosaic CLI",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@asyncapi/diff": "^0.4.1",
|
|
34
34
|
"@asyncapi/modelina": "^1.8.4",
|
|
35
35
|
"@asyncapi/parser": "^2.0.2",
|
|
36
|
-
"@axinom/mosaic-id-link-be": "^0.13.3-rc.
|
|
37
|
-
"@axinom/mosaic-service-common": "^0.34.0-rc.
|
|
36
|
+
"@axinom/mosaic-id-link-be": "^0.13.3-rc.19",
|
|
37
|
+
"@axinom/mosaic-service-common": "^0.34.0-rc.19",
|
|
38
38
|
"@graphql-inspector/core": "^3.1.2",
|
|
39
39
|
"@stoplight/spectral": "^5.9.1",
|
|
40
40
|
"axios": "^0.19.2",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"glob": "^7.1.6",
|
|
49
49
|
"graphile-utils": "^4.13.0",
|
|
50
50
|
"graphql": "^15.4.0",
|
|
51
|
+
"js-yaml": "^4.1.0",
|
|
51
52
|
"json-schema": "^0.4.0",
|
|
52
53
|
"json-schema-diff": "^0.17.1",
|
|
53
54
|
"json-schema-ref-parser": "^9.0.7",
|
|
@@ -67,5 +68,5 @@
|
|
|
67
68
|
"publishConfig": {
|
|
68
69
|
"access": "public"
|
|
69
70
|
},
|
|
70
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "0f3039c90160e439e04093e4e66d711523530e08"
|
|
71
72
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommandModule } from 'yargs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { manifestCommands } from './manifest/manifest-commands';
|
|
3
|
+
import { piletCommands } from './pilet/pilet-commands';
|
|
4
4
|
|
|
5
5
|
export const hosting: CommandModule<unknown, unknown> = {
|
|
6
6
|
command: 'hosting',
|
|
@@ -8,79 +8,13 @@ export const hosting: CommandModule<unknown, unknown> = {
|
|
|
8
8
|
builder: (yargs) =>
|
|
9
9
|
yargs
|
|
10
10
|
.command('pilet', 'Pilet related actions', piletCommands)
|
|
11
|
-
.demandCommand(),
|
|
12
|
-
handler: (_args) => {
|
|
13
|
-
console.log('Please pick a sub command related to hosting.');
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const piletCommands: CommandModule<unknown, unknown> = {
|
|
18
|
-
builder: (yargs) =>
|
|
19
|
-
yargs
|
|
20
11
|
.command(
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
|
|
12
|
+
'manifest',
|
|
13
|
+
'Deployment Manifest related actions',
|
|
14
|
+
manifestCommands,
|
|
24
15
|
)
|
|
25
16
|
.demandCommand(),
|
|
26
|
-
handler: () => {
|
|
27
|
-
console.log('Please pick
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const piletRegister: CommandModule<unknown, GetRegisterPiletOptions> = {
|
|
32
|
-
builder: (yargs) => {
|
|
33
|
-
return yargs
|
|
34
|
-
.option('serviceId', {
|
|
35
|
-
describe: 'Service ID the pilet should be registered to',
|
|
36
|
-
alias: 'i',
|
|
37
|
-
string: true,
|
|
38
|
-
})
|
|
39
|
-
.option('mosaicHostingClientId', {
|
|
40
|
-
describe: 'Client ID to authenticate',
|
|
41
|
-
alias: 'c',
|
|
42
|
-
string: true,
|
|
43
|
-
})
|
|
44
|
-
.option('mosaicHostingClientSecret', {
|
|
45
|
-
describe: 'Client Secret to authenticate',
|
|
46
|
-
alias: 's',
|
|
47
|
-
string: true,
|
|
48
|
-
})
|
|
49
|
-
.option('tenantId', {
|
|
50
|
-
describe: 'Tenant ID',
|
|
51
|
-
alias: 't',
|
|
52
|
-
string: true,
|
|
53
|
-
})
|
|
54
|
-
.option('environmentId', {
|
|
55
|
-
describe: 'Environment ID',
|
|
56
|
-
alias: 'e',
|
|
57
|
-
string: true,
|
|
58
|
-
})
|
|
59
|
-
.option('piletArtifactPath', {
|
|
60
|
-
describe: 'Pilet Artifact Path',
|
|
61
|
-
alias: 'p',
|
|
62
|
-
string: true,
|
|
63
|
-
})
|
|
64
|
-
.option('idServiceAuthBaseURL', {
|
|
65
|
-
describe: 'ID Service Authentication Endpoint Base URL',
|
|
66
|
-
alias: 'a',
|
|
67
|
-
string: true,
|
|
68
|
-
})
|
|
69
|
-
.option('microFrontendServiceBaseURL', {
|
|
70
|
-
describe: 'Micro Frontend Service Base URL',
|
|
71
|
-
alias: 'm',
|
|
72
|
-
string: true,
|
|
73
|
-
})
|
|
74
|
-
.option('overrideRegistration', {
|
|
75
|
-
describe: 'Override registration',
|
|
76
|
-
alias: 'm',
|
|
77
|
-
default: false,
|
|
78
|
-
boolean: true,
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
handler: async (args) => {
|
|
82
|
-
// Validate arguments and read any arguments that are coming from environment variables.
|
|
83
|
-
const validatedArgs = validateArgs(args);
|
|
84
|
-
await registerPilet(validatedArgs);
|
|
17
|
+
handler: (_args) => {
|
|
18
|
+
console.log('Please pick a sub command related to hosting.');
|
|
85
19
|
},
|
|
86
20
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CommandModule } from 'yargs';
|
|
2
|
+
import { uploadDeploymentManifest, validateArgs } from './upload-manifest';
|
|
3
|
+
import { GetUploadManifestOptions } from './upload-manifest-options';
|
|
4
|
+
|
|
5
|
+
export const manifestCommands: CommandModule<unknown, unknown> = {
|
|
6
|
+
builder: (yargs) =>
|
|
7
|
+
yargs
|
|
8
|
+
.command(
|
|
9
|
+
'upload',
|
|
10
|
+
'Upload a Deployment Manifest against a Service ID to the Hosting Service.',
|
|
11
|
+
manifestUpload,
|
|
12
|
+
)
|
|
13
|
+
.demandCommand(),
|
|
14
|
+
handler: () => {
|
|
15
|
+
console.log('Please pick an action related to hosting manifest command.');
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const manifestUpload: CommandModule<unknown, GetUploadManifestOptions> = {
|
|
20
|
+
builder: (yargs) => {
|
|
21
|
+
return yargs
|
|
22
|
+
.option('name', {
|
|
23
|
+
describe: 'Name of the Deployment Manifest',
|
|
24
|
+
alias: 'n',
|
|
25
|
+
string: true,
|
|
26
|
+
demandOption: true,
|
|
27
|
+
})
|
|
28
|
+
.option('serviceId', {
|
|
29
|
+
describe: 'Service ID the Deployment Manifest should be registered to',
|
|
30
|
+
alias: 'i',
|
|
31
|
+
string: true,
|
|
32
|
+
})
|
|
33
|
+
.option('mosaicHostingClientId', {
|
|
34
|
+
describe: 'Service Account Client ID to authenticate',
|
|
35
|
+
alias: 'c',
|
|
36
|
+
string: true,
|
|
37
|
+
})
|
|
38
|
+
.option('mosaicHostingClientSecret', {
|
|
39
|
+
describe: 'Service Account Client Secret to authenticate',
|
|
40
|
+
alias: 's',
|
|
41
|
+
string: true,
|
|
42
|
+
})
|
|
43
|
+
.option('deploymentManifestPath', {
|
|
44
|
+
describe: 'Deployment Manifest Path',
|
|
45
|
+
alias: 'p',
|
|
46
|
+
string: true,
|
|
47
|
+
default: './mosaic-hosting-deployment-manifest.yaml',
|
|
48
|
+
})
|
|
49
|
+
.option('idServiceAuthBaseURL', {
|
|
50
|
+
describe: 'ID Service Authentication Endpoint Base URL',
|
|
51
|
+
alias: 'a',
|
|
52
|
+
string: true,
|
|
53
|
+
})
|
|
54
|
+
.option('hostingServiceBaseURL', {
|
|
55
|
+
describe: 'Hosting Service Base URL',
|
|
56
|
+
alias: 'h',
|
|
57
|
+
string: true,
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
handler: async (args) => {
|
|
61
|
+
const [validatedArgs, errorMessages] = validateArgs(args);
|
|
62
|
+
if (errorMessages.length > 0) {
|
|
63
|
+
console.log(errorMessages);
|
|
64
|
+
} else {
|
|
65
|
+
await uploadDeploymentManifest(validatedArgs);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for Upload Deployment Manifest
|
|
3
|
+
*/
|
|
4
|
+
export interface GetUploadManifestOptions {
|
|
5
|
+
name: string;
|
|
6
|
+
serviceId?: string;
|
|
7
|
+
mosaicHostingClientId?: string;
|
|
8
|
+
mosaicHostingClientSecret?: string;
|
|
9
|
+
deploymentManifestPath?: string;
|
|
10
|
+
idServiceAuthBaseURL?: string;
|
|
11
|
+
hostingServiceBaseURL?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { getServiceAccountToken } from '@axinom/mosaic-id-link-be';
|
|
2
|
+
import { isNullOrWhitespace } from '@axinom/mosaic-service-common';
|
|
3
|
+
import axios, { AxiosError, AxiosInstance } from 'axios';
|
|
4
|
+
import { existsSync, lstatSync, readFileSync } from 'fs';
|
|
5
|
+
import * as yaml from 'js-yaml';
|
|
6
|
+
import * as path from 'path';
|
|
7
|
+
import { GetUploadManifestOptions } from './upload-manifest-options';
|
|
8
|
+
|
|
9
|
+
const getAxiosInstance = (
|
|
10
|
+
hostingServiceBaseUrl: string,
|
|
11
|
+
serviceAccountToken: string,
|
|
12
|
+
): AxiosInstance => {
|
|
13
|
+
return axios.create({
|
|
14
|
+
baseURL: new URL(hostingServiceBaseUrl).toString(),
|
|
15
|
+
headers: {
|
|
16
|
+
Authorization: `Bearer ${serviceAccountToken}`,
|
|
17
|
+
'content-type': 'application/json',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const uploadDeploymentManifest = async (
|
|
23
|
+
args: Required<GetUploadManifestOptions>,
|
|
24
|
+
): Promise<void> => {
|
|
25
|
+
const serviceAccountToken = await getServiceAccountToken(
|
|
26
|
+
args.idServiceAuthBaseURL,
|
|
27
|
+
args.mosaicHostingClientId,
|
|
28
|
+
args.mosaicHostingClientSecret,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
let manifestToUpload;
|
|
32
|
+
try {
|
|
33
|
+
manifestToUpload = findManifestToUpload(args.deploymentManifestPath);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.log(
|
|
36
|
+
`Error occurred while trying to read the Deployment Manifest at ${args.deploymentManifestPath}.`,
|
|
37
|
+
);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const axiosInstance: AxiosInstance = getAxiosInstance(
|
|
42
|
+
args.hostingServiceBaseURL,
|
|
43
|
+
serviceAccountToken.accessToken,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const data = JSON.stringify({
|
|
47
|
+
query: `mutation CreateServiceDeploymentManifest($serviceId: String!, $name: String, $configMap: DeploymentConfigMap!) {
|
|
48
|
+
createServiceDeploymentManifest(
|
|
49
|
+
input: {configMap: $configMap, name: $name, serviceId: $serviceId}
|
|
50
|
+
) {
|
|
51
|
+
serviceDeploymentManifest {
|
|
52
|
+
id
|
|
53
|
+
name
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}`,
|
|
57
|
+
variables: {
|
|
58
|
+
serviceId: args.serviceId,
|
|
59
|
+
name: args.name === '' ? undefined : args.name,
|
|
60
|
+
configMap: manifestToUpload,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
const response = await axiosInstance.post('graphql', data);
|
|
66
|
+
if (response.data.errors !== undefined && response.data.errors.length > 0) {
|
|
67
|
+
console.log('Upload of Deployment Manifest failed.');
|
|
68
|
+
console.log(response.data.errors[0].message);
|
|
69
|
+
console.log();
|
|
70
|
+
if (response.data.errors[0].details?.validateErrors?.length > 0) {
|
|
71
|
+
console.log('Schema Validation Errors:');
|
|
72
|
+
for (const detail of response.data.errors[0].details.validateErrors) {
|
|
73
|
+
console.log(detail);
|
|
74
|
+
}
|
|
75
|
+
console.log();
|
|
76
|
+
}
|
|
77
|
+
if (response.data.errors[0].details?.validationErrors?.length > 0) {
|
|
78
|
+
console.log('Deployment Manifest Syntax Validation Errors:');
|
|
79
|
+
const validationErrors: string[] = [];
|
|
80
|
+
for (const detail of response.data.errors[0].details.validationErrors) {
|
|
81
|
+
validationErrors.push(detail);
|
|
82
|
+
}
|
|
83
|
+
console.log(validationErrors);
|
|
84
|
+
console.log();
|
|
85
|
+
}
|
|
86
|
+
console.log(
|
|
87
|
+
`The Deployment Manifest Schema can be found at ${args.hostingServiceBaseURL}/.well-known.`,
|
|
88
|
+
);
|
|
89
|
+
} else {
|
|
90
|
+
console.log('Upload of Deployment Manifest successful.');
|
|
91
|
+
console.log(
|
|
92
|
+
response.data.data?.createServiceDeploymentManifest
|
|
93
|
+
.serviceDeploymentManifest,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.log('Error while uploading the Deployment Manifest.');
|
|
98
|
+
console.log(JSON.stringify((error as AxiosError).message));
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Method that validates the arguments.
|
|
104
|
+
* We're using this to allow both input arguments and environment variables.
|
|
105
|
+
*
|
|
106
|
+
* @param args
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
export const validateArgs = (
|
|
110
|
+
args: GetUploadManifestOptions,
|
|
111
|
+
): [Required<GetUploadManifestOptions>, string[]] => {
|
|
112
|
+
const errorMessages: string[] = [];
|
|
113
|
+
|
|
114
|
+
const idServiceAuthBaseURL =
|
|
115
|
+
args.idServiceAuthBaseURL ?? process.env.ID_SERVICE_AUTH_BASE_URL ?? '';
|
|
116
|
+
const mosaicHostingClientId =
|
|
117
|
+
args.mosaicHostingClientId ?? process.env.MOSAIC_HOSTING_CLIENT_ID ?? '';
|
|
118
|
+
const mosaicHostingClientSecret =
|
|
119
|
+
args.mosaicHostingClientSecret ??
|
|
120
|
+
process.env.MOSAIC_HOSTING_CLIENT_SECRET ??
|
|
121
|
+
'';
|
|
122
|
+
const serviceId = args.serviceId ?? process.env.SERVICE_ID ?? '';
|
|
123
|
+
const hostingServiceBaseURL =
|
|
124
|
+
args.hostingServiceBaseURL ?? process.env.HOSTING_SERVICE_BASE_URL ?? '';
|
|
125
|
+
|
|
126
|
+
if (isNullOrWhitespace(idServiceAuthBaseURL)) {
|
|
127
|
+
errorMessages.push('[idServiceAuthBaseURL] is required.');
|
|
128
|
+
}
|
|
129
|
+
if (isNullOrWhitespace(mosaicHostingClientId)) {
|
|
130
|
+
errorMessages.push('[clientId] is required.');
|
|
131
|
+
}
|
|
132
|
+
if (isNullOrWhitespace(mosaicHostingClientSecret)) {
|
|
133
|
+
errorMessages.push('[clientSecret] is required.');
|
|
134
|
+
}
|
|
135
|
+
if (isNullOrWhitespace(serviceId)) {
|
|
136
|
+
errorMessages.push('[serviceId] is required.');
|
|
137
|
+
}
|
|
138
|
+
if (isNullOrWhitespace(hostingServiceBaseURL)) {
|
|
139
|
+
errorMessages.push('[hostingServiceBaseURL] is required.');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return [
|
|
143
|
+
{
|
|
144
|
+
name: args.name,
|
|
145
|
+
idServiceAuthBaseURL,
|
|
146
|
+
mosaicHostingClientId,
|
|
147
|
+
mosaicHostingClientSecret,
|
|
148
|
+
serviceId,
|
|
149
|
+
deploymentManifestPath:
|
|
150
|
+
args.deploymentManifestPath ??
|
|
151
|
+
'./mosaic-hosting-deployment-manifest.yaml',
|
|
152
|
+
hostingServiceBaseURL,
|
|
153
|
+
},
|
|
154
|
+
errorMessages,
|
|
155
|
+
];
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const findManifestToUpload = (deploymentManifestPath: string): unknown => {
|
|
159
|
+
if (!existsSync(deploymentManifestPath)) {
|
|
160
|
+
throw new Error(`No directory found at ${deploymentManifestPath}`);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const stat = lstatSync(deploymentManifestPath);
|
|
164
|
+
|
|
165
|
+
let manifestFile: string;
|
|
166
|
+
if (stat.isDirectory()) {
|
|
167
|
+
manifestFile = path.join(
|
|
168
|
+
deploymentManifestPath,
|
|
169
|
+
'mosaic-hosting-deployment-manifest.yaml',
|
|
170
|
+
);
|
|
171
|
+
} else {
|
|
172
|
+
manifestFile = deploymentManifestPath;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const doc = yaml.load(readFileSync(manifestFile, 'utf8'));
|
|
176
|
+
console.log(`Deployment Manifest found at ${manifestFile}.`);
|
|
177
|
+
|
|
178
|
+
return doc;
|
|
179
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { CommandModule } from 'yargs';
|
|
2
|
+
import { registerPilet, validateArgs } from './register-pilet';
|
|
3
|
+
import { GetRegisterPiletOptions } from './register-pilet-options';
|
|
4
|
+
|
|
5
|
+
export const piletCommands: CommandModule<unknown, unknown> = {
|
|
6
|
+
builder: (yargs) =>
|
|
7
|
+
yargs
|
|
8
|
+
.command(
|
|
9
|
+
'register',
|
|
10
|
+
'Register a pilet in Mosaic Micro Frontend Service.',
|
|
11
|
+
piletRegister,
|
|
12
|
+
)
|
|
13
|
+
.demandCommand(),
|
|
14
|
+
handler: () => {
|
|
15
|
+
console.log('Please pick an action related to hosting pilet command.');
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const piletRegister: CommandModule<unknown, GetRegisterPiletOptions> = {
|
|
20
|
+
builder: (yargs) => {
|
|
21
|
+
return yargs
|
|
22
|
+
.option('serviceId', {
|
|
23
|
+
describe: 'Service ID the pilet should be registered to',
|
|
24
|
+
alias: 'i',
|
|
25
|
+
string: true,
|
|
26
|
+
})
|
|
27
|
+
.option('mosaicHostingClientId', {
|
|
28
|
+
describe: 'Client ID to authenticate',
|
|
29
|
+
alias: 'c',
|
|
30
|
+
string: true,
|
|
31
|
+
})
|
|
32
|
+
.option('mosaicHostingClientSecret', {
|
|
33
|
+
describe: 'Client Secret to authenticate',
|
|
34
|
+
alias: 's',
|
|
35
|
+
string: true,
|
|
36
|
+
})
|
|
37
|
+
.option('tenantId', {
|
|
38
|
+
describe: 'Tenant ID',
|
|
39
|
+
alias: 't',
|
|
40
|
+
string: true,
|
|
41
|
+
})
|
|
42
|
+
.option('environmentId', {
|
|
43
|
+
describe: 'Environment ID',
|
|
44
|
+
alias: 'e',
|
|
45
|
+
string: true,
|
|
46
|
+
})
|
|
47
|
+
.option('piletArtifactPath', {
|
|
48
|
+
describe: 'Pilet Artifact Path',
|
|
49
|
+
alias: 'p',
|
|
50
|
+
string: true,
|
|
51
|
+
})
|
|
52
|
+
.option('idServiceAuthBaseURL', {
|
|
53
|
+
describe: 'ID Service Authentication Endpoint Base URL',
|
|
54
|
+
alias: 'a',
|
|
55
|
+
string: true,
|
|
56
|
+
})
|
|
57
|
+
.option('microFrontendServiceBaseURL', {
|
|
58
|
+
describe: 'Micro Frontend Service Base URL',
|
|
59
|
+
alias: 'm',
|
|
60
|
+
string: true,
|
|
61
|
+
})
|
|
62
|
+
.option('overrideRegistration', {
|
|
63
|
+
describe: 'Override registration',
|
|
64
|
+
alias: 'm',
|
|
65
|
+
default: false,
|
|
66
|
+
boolean: true,
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
handler: async (args) => {
|
|
70
|
+
// Validate arguments and read any arguments that are coming from environment variables.
|
|
71
|
+
const validatedArgs = validateArgs(args);
|
|
72
|
+
await registerPilet(validatedArgs);
|
|
73
|
+
},
|
|
74
|
+
};
|
|
@@ -67,9 +67,9 @@ export const validateArgs = (
|
|
|
67
67
|
): Required<GetRegisterPiletOptions> => {
|
|
68
68
|
const idServiceAuthBaseURL =
|
|
69
69
|
args.idServiceAuthBaseURL ?? process.env.ID_SERVICE_AUTH_BASE_URL;
|
|
70
|
-
const
|
|
70
|
+
const mosaicHostingClientId =
|
|
71
71
|
args.mosaicHostingClientId ?? process.env.MOSAIC_HOSTING_CLIENT_ID;
|
|
72
|
-
const
|
|
72
|
+
const mosaicHostingClientSecret =
|
|
73
73
|
args.mosaicHostingClientSecret ?? process.env.MOSAIC_HOSTING_CLIENT_SECRET;
|
|
74
74
|
const tenantId = args.tenantId ?? process.env.TENANT_ID;
|
|
75
75
|
const environmentId = args.environmentId ?? process.env.ENVIRONMENT_ID;
|
|
@@ -82,10 +82,10 @@ export const validateArgs = (
|
|
|
82
82
|
if (isNullOrWhitespace(idServiceAuthBaseURL)) {
|
|
83
83
|
throw new Error('idServiceAuthBaseURL is required.');
|
|
84
84
|
}
|
|
85
|
-
if (isNullOrWhitespace(
|
|
85
|
+
if (isNullOrWhitespace(mosaicHostingClientId)) {
|
|
86
86
|
throw new Error('clientId is required.');
|
|
87
87
|
}
|
|
88
|
-
if (isNullOrWhitespace(
|
|
88
|
+
if (isNullOrWhitespace(mosaicHostingClientSecret)) {
|
|
89
89
|
throw new Error('clientSecret is required.');
|
|
90
90
|
}
|
|
91
91
|
if (isNullOrWhitespace(tenantId)) {
|
|
@@ -106,8 +106,8 @@ export const validateArgs = (
|
|
|
106
106
|
|
|
107
107
|
return {
|
|
108
108
|
idServiceAuthBaseURL,
|
|
109
|
-
mosaicHostingClientId
|
|
110
|
-
mosaicHostingClientSecret
|
|
109
|
+
mosaicHostingClientId,
|
|
110
|
+
mosaicHostingClientSecret,
|
|
111
111
|
tenantId,
|
|
112
112
|
environmentId,
|
|
113
113
|
serviceId,
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
FormatHelpers,
|
|
5
5
|
OutputModel,
|
|
6
6
|
TS_DESCRIPTION_PRESET,
|
|
7
|
+
typeScriptDefaultModelNameConstraints,
|
|
7
8
|
typeScriptDefaultPropertyKeyConstraints,
|
|
8
9
|
TypeScriptGenerator,
|
|
9
10
|
} from '@asyncapi/modelina';
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
NULLABLE_PROPERTY_TO_UNION_PRESET,
|
|
25
26
|
} from './presets';
|
|
26
27
|
import {
|
|
28
|
+
createDummyReservedKeywordsChecker,
|
|
27
29
|
getChannelAction,
|
|
28
30
|
getMessageTitle,
|
|
29
31
|
getModelPathPrefix,
|
|
@@ -224,11 +226,10 @@ export class Codegen {
|
|
|
224
226
|
constraints: {
|
|
225
227
|
propertyKey: typeScriptDefaultPropertyKeyConstraints({
|
|
226
228
|
NAMING_FORMATTER: (name) => FormatHelpers.toSnakeCase(name),
|
|
227
|
-
NO_RESERVED_KEYWORDS: (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
},
|
|
229
|
+
NO_RESERVED_KEYWORDS: createDummyReservedKeywordsChecker(),
|
|
230
|
+
}),
|
|
231
|
+
modelName: typeScriptDefaultModelNameConstraints({
|
|
232
|
+
NO_RESERVED_KEYWORDS: createDummyReservedKeywordsChecker(),
|
|
232
233
|
}),
|
|
233
234
|
},
|
|
234
235
|
// Order of presets matters!
|
|
@@ -300,7 +301,7 @@ export class Codegen {
|
|
|
300
301
|
): Promise<void> {
|
|
301
302
|
const groupedSchemas: { [key: string]: MessageInterface[] } = {};
|
|
302
303
|
|
|
303
|
-
for (const message of asyncAPIDocument.
|
|
304
|
+
for (const message of asyncAPIDocument.allMessages()) {
|
|
304
305
|
const schemaPathPrefix = getModelPathPrefix(getMessageTitle(message));
|
|
305
306
|
if (groupedSchemas[schemaPathPrefix] === undefined) {
|
|
306
307
|
groupedSchemas[schemaPathPrefix] = [];
|
|
@@ -725,3 +726,6 @@ interface ChannelData {
|
|
|
725
726
|
/** Channel multi tenancy */
|
|
726
727
|
isMultiTenant: boolean;
|
|
727
728
|
}
|
|
729
|
+
function dummyReservedKeywordsChecker(value: string): string {
|
|
730
|
+
throw new Error('Function not implemented.');
|
|
731
|
+
}
|
|
@@ -33,6 +33,14 @@ export function getMessageTitle(message: MessageInterface): string {
|
|
|
33
33
|
return messageTitle;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
// TODO: This is a hack to avoid reserved keywords in property names.
|
|
37
|
+
// Currently many non-reserved keywords are also being replaced: https://github.com/asyncapi/modelina/issues/1053
|
|
38
|
+
export function createDummyReservedKeywordsChecker(): (name: string) => string {
|
|
39
|
+
return (name: string): string => {
|
|
40
|
+
return name;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
/**
|
|
37
45
|
* Retrieve Service Title from AsyncAPI document.
|
|
38
46
|
* As Title returned value set in info.title property of document.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-pilet-options.js","sourceRoot":"","sources":["../../../src/commands/hosting/register-pilet-options.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"register-pilet.js","sourceRoot":"","sources":["../../../src/commands/hosting/register-pilet.ts"],"names":[],"mappings":";;;;AAAA,iEAAmE;AACnE,yEAAmE;AACnE,iCAA0C;AAC1C,sCAAsC;AACtC,2BAA0E;AAC1E,6BAA6B;AAGtB,MAAM,aAAa,GAAG,CAC3B,IAAuC,EACxB,EAAE;;IACjB,MAAM,mBAAmB,GAAG,MAAM,IAAA,0CAAsB,EACtD,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,yBAAyB,CAC/B,CAAC;IAEF,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;IAE5B,MAAM,MAAM,GAAG;QACb,aAAa,EAAE,QAAQ;QACvB,OAAO,kBACL,aAAa,EAAE,UAAU,mBAAmB,CAAC,WAAW,EAAE,IACvD,IAAI,CAAC,UAAU,EAAE,CACrB;KACF,CAAC;IAEF,IAAI;QACF,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACxE,IAAI,iBAAiB,EAAE;YACrB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAA,qBAAgB,EAAC,iBAAiB,CAAC,CAAC,CAAC;SACtD;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;SAC1E;KACF;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,6DAA6D,IAAI,CAAC,iBAAiB,GAAG,CACvF,CAAC;KACH;IAED,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,eAAK,CAAC,IAAI,CAC7B,GAAG,IAAI,CAAC,2BAA2B,cAAc,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,SAAS,sBAAsB,IAAI,CAAC,oBAAoB,EAAE,EACvJ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D;IAED,MAAM,KAAK,GAAG,IAAA,gBAAW,EAAC,SAAS,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,IAAA,cAAS,EAAC,QAAQ,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YACpD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACzB;KACF;IAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,MAAM,IAAI,KAAK,CACb,gDAAgD,SAAS,8CAA8C,CACxG,CAAC;KACH;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,2BAA2B,SAAS,GAAG,CAAC,CAAC;KAC1D;IAED,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC,CAAC"}
|
/package/dist/commands/hosting/{register-pilet-options.d.ts → pilet/register-pilet-options.d.ts}
RENAMED
|
File without changes
|
/package/dist/commands/hosting/{register-pilet-options.js → pilet/register-pilet-options.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|