@azure-tools/rlc-common 0.11.0
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/.eslintrc.json +23 -0
- package/.prettierignore +1 -0
- package/.prettierrc +7 -0
- package/.rush/temp/package-deps_build.json +53 -0
- package/.rush/temp/shrinkwrap-deps.json +147 -0
- package/CHANGELOG.md +61 -0
- package/CONTRIBUTING.md +30 -0
- package/README.md +3 -0
- package/dist/buildClient.js +268 -0
- package/dist/buildClient.js.map +1 -0
- package/dist/buildClientDefinitions.js +160 -0
- package/dist/buildClientDefinitions.js.map +1 -0
- package/dist/buildIndexFile.js +170 -0
- package/dist/buildIndexFile.js.map +1 -0
- package/dist/buildIsUnexpectedHelper.js +220 -0
- package/dist/buildIsUnexpectedHelper.js.map +1 -0
- package/dist/buildMethodShortcuts.js +50 -0
- package/dist/buildMethodShortcuts.js.map +1 -0
- package/dist/buildObjectTypes.js +286 -0
- package/dist/buildObjectTypes.js.map +1 -0
- package/dist/buildPaginateHelper.js +30 -0
- package/dist/buildPaginateHelper.js.map +1 -0
- package/dist/buildParameterTypes.js +315 -0
- package/dist/buildParameterTypes.js.map +1 -0
- package/dist/buildPollingHelper.js +21 -0
- package/dist/buildPollingHelper.js.map +1 -0
- package/dist/buildResponseTypes.js +135 -0
- package/dist/buildResponseTypes.js.map +1 -0
- package/dist/buildSchemaType.js +65 -0
- package/dist/buildSchemaType.js.map +1 -0
- package/dist/buildSerializeHelper.js +35 -0
- package/dist/buildSerializeHelper.js.map +1 -0
- package/dist/buildTopLevelIndexFile.js +48 -0
- package/dist/buildTopLevelIndexFile.js.map +1 -0
- package/dist/helpers/nameConstructors.js +41 -0
- package/dist/helpers/nameConstructors.js.map +1 -0
- package/dist/helpers/nameUtils.js +196 -0
- package/dist/helpers/nameUtils.js.map +1 -0
- package/dist/helpers/operationHelpers.js +103 -0
- package/dist/helpers/operationHelpers.js.map +1 -0
- package/dist/helpers/pathUtils.js +13 -0
- package/dist/helpers/pathUtils.js.map +1 -0
- package/dist/helpers/schemaHelpers.js +27 -0
- package/dist/helpers/schemaHelpers.js.map +1 -0
- package/dist/helpers/shortcutMethods.js +46 -0
- package/dist/helpers/shortcutMethods.js.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.js +18 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/metadata/buildApiExtractorConfig.js +56 -0
- package/dist/metadata/buildApiExtractorConfig.js.map +1 -0
- package/dist/metadata/buildESLintConfig.js +33 -0
- package/dist/metadata/buildESLintConfig.js.map +1 -0
- package/dist/metadata/buildLicenseFile.js +41 -0
- package/dist/metadata/buildLicenseFile.js.map +1 -0
- package/dist/metadata/buildPackageFile.js +274 -0
- package/dist/metadata/buildPackageFile.js.map +1 -0
- package/dist/metadata/buildReadmeFile.js +170 -0
- package/dist/metadata/buildReadmeFile.js.map +1 -0
- package/dist/metadata/buildRollupConfig.js +144 -0
- package/dist/metadata/buildRollupConfig.js.map +1 -0
- package/dist/metadata/buildTsConfig.js +72 -0
- package/dist/metadata/buildTsConfig.js.map +1 -0
- package/dist/package.json +1 -0
- package/dist/static/paginateContent.js +214 -0
- package/dist/static/paginateContent.js.map +1 -0
- package/dist/static/pollingContent.js +98 -0
- package/dist/static/pollingContent.js.map +1 -0
- package/dist/static/serializeHelper.js +30 -0
- package/dist/static/serializeHelper.js.map +1 -0
- package/dist/test/buildEnvFile.js +31 -0
- package/dist/test/buildEnvFile.js.map +1 -0
- package/dist/test/buildKarmaConfig.js +19 -0
- package/dist/test/buildKarmaConfig.js.map +1 -0
- package/dist/test/buildRecordedClient.js +22 -0
- package/dist/test/buildRecordedClient.js.map +1 -0
- package/dist/test/buildSampleTest.js +19 -0
- package/dist/test/buildSampleTest.js.map +1 -0
- package/dist/test/template.js +191 -0
- package/dist/test/template.js.map +1 -0
- package/dist-esm/buildClient.js +261 -0
- package/dist-esm/buildClient.js.map +1 -0
- package/dist-esm/buildClientDefinitions.js +155 -0
- package/dist-esm/buildClientDefinitions.js.map +1 -0
- package/dist-esm/buildIndexFile.js +165 -0
- package/dist-esm/buildIndexFile.js.map +1 -0
- package/dist-esm/buildIsUnexpectedHelper.js +216 -0
- package/dist-esm/buildIsUnexpectedHelper.js.map +1 -0
- package/dist-esm/buildMethodShortcuts.js +46 -0
- package/dist-esm/buildMethodShortcuts.js.map +1 -0
- package/dist-esm/buildObjectTypes.js +288 -0
- package/dist-esm/buildObjectTypes.js.map +1 -0
- package/dist-esm/buildPaginateHelper.js +26 -0
- package/dist-esm/buildPaginateHelper.js.map +1 -0
- package/dist-esm/buildParameterTypes.js +321 -0
- package/dist-esm/buildParameterTypes.js.map +1 -0
- package/dist-esm/buildPollingHelper.js +17 -0
- package/dist-esm/buildPollingHelper.js.map +1 -0
- package/dist-esm/buildResponseTypes.js +140 -0
- package/dist-esm/buildResponseTypes.js.map +1 -0
- package/dist-esm/buildSchemaType.js +60 -0
- package/dist-esm/buildSchemaType.js.map +1 -0
- package/dist-esm/buildSerializeHelper.js +31 -0
- package/dist-esm/buildSerializeHelper.js.map +1 -0
- package/dist-esm/buildTopLevelIndexFile.js +44 -0
- package/dist-esm/buildTopLevelIndexFile.js.map +1 -0
- package/dist-esm/helpers/nameConstructors.js +34 -0
- package/dist-esm/helpers/nameConstructors.js.map +1 -0
- package/dist-esm/helpers/nameUtils.js +187 -0
- package/dist-esm/helpers/nameUtils.js.map +1 -0
- package/dist-esm/helpers/operationHelpers.js +84 -0
- package/dist-esm/helpers/operationHelpers.js.map +1 -0
- package/dist-esm/helpers/pathUtils.js +9 -0
- package/dist-esm/helpers/pathUtils.js.map +1 -0
- package/dist-esm/helpers/schemaHelpers.js +21 -0
- package/dist-esm/helpers/schemaHelpers.js.map +1 -0
- package/dist-esm/helpers/shortcutMethods.js +42 -0
- package/dist-esm/helpers/shortcutMethods.js.map +1 -0
- package/dist-esm/index.js +29 -0
- package/dist-esm/index.js.map +1 -0
- package/dist-esm/interfaces.js +15 -0
- package/dist-esm/interfaces.js.map +1 -0
- package/dist-esm/metadata/buildApiExtractorConfig.js +51 -0
- package/dist-esm/metadata/buildApiExtractorConfig.js.map +1 -0
- package/dist-esm/metadata/buildESLintConfig.js +28 -0
- package/dist-esm/metadata/buildESLintConfig.js.map +1 -0
- package/dist-esm/metadata/buildLicenseFile.js +36 -0
- package/dist-esm/metadata/buildLicenseFile.js.map +1 -0
- package/dist-esm/metadata/buildPackageFile.js +276 -0
- package/dist-esm/metadata/buildPackageFile.js.map +1 -0
- package/dist-esm/metadata/buildReadmeFile.js +167 -0
- package/dist-esm/metadata/buildReadmeFile.js.map +1 -0
- package/dist-esm/metadata/buildRollupConfig.js +139 -0
- package/dist-esm/metadata/buildRollupConfig.js.map +1 -0
- package/dist-esm/metadata/buildTsConfig.js +67 -0
- package/dist-esm/metadata/buildTsConfig.js.map +1 -0
- package/dist-esm/package.json +1 -0
- package/dist-esm/static/paginateContent.js +211 -0
- package/dist-esm/static/paginateContent.js.map +1 -0
- package/dist-esm/static/pollingContent.js +95 -0
- package/dist-esm/static/pollingContent.js.map +1 -0
- package/dist-esm/static/serializeHelper.js +27 -0
- package/dist-esm/static/serializeHelper.js.map +1 -0
- package/dist-esm/test/buildEnvFile.js +24 -0
- package/dist-esm/test/buildEnvFile.js.map +1 -0
- package/dist-esm/test/buildKarmaConfig.js +14 -0
- package/dist-esm/test/buildKarmaConfig.js.map +1 -0
- package/dist-esm/test/buildRecordedClient.js +17 -0
- package/dist-esm/test/buildRecordedClient.js.map +1 -0
- package/dist-esm/test/buildSampleTest.js +14 -0
- package/dist-esm/test/buildSampleTest.js.map +1 -0
- package/dist-esm/test/template.js +188 -0
- package/dist-esm/test/template.js.map +1 -0
- package/package.json +46 -0
- package/publishPackage.js +11 -0
- package/rlc-common.build.log +2 -0
- package/src/buildClient.ts +353 -0
- package/src/buildClientDefinitions.ts +235 -0
- package/src/buildIndexFile.ts +202 -0
- package/src/buildIsUnexpectedHelper.ts +240 -0
- package/src/buildMethodShortcuts.ts +75 -0
- package/src/buildObjectTypes.ts +449 -0
- package/src/buildPaginateHelper.ts +33 -0
- package/src/buildParameterTypes.ts +477 -0
- package/src/buildPollingHelper.ts +18 -0
- package/src/buildResponseTypes.ts +186 -0
- package/src/buildSchemaType.ts +85 -0
- package/src/buildSerializeHelper.ts +42 -0
- package/src/buildTopLevelIndexFile.ts +52 -0
- package/src/helpers/nameConstructors.ts +93 -0
- package/src/helpers/nameUtils.ts +227 -0
- package/src/helpers/operationHelpers.ts +119 -0
- package/src/helpers/pathUtils.ts +9 -0
- package/src/helpers/schemaHelpers.ts +25 -0
- package/src/helpers/shortcutMethods.ts +60 -0
- package/src/index.ts +29 -0
- package/src/interfaces.ts +227 -0
- package/src/metadata/buildApiExtractorConfig.ts +59 -0
- package/src/metadata/buildESLintConfig.ts +34 -0
- package/src/metadata/buildLicenseFile.ts +39 -0
- package/src/metadata/buildPackageFile.ts +334 -0
- package/src/metadata/buildReadmeFile.ts +231 -0
- package/src/metadata/buildRollupConfig.ts +147 -0
- package/src/metadata/buildTsConfig.ts +79 -0
- package/src/static/paginateContent.ts +210 -0
- package/src/static/pollingContent.ts +94 -0
- package/src/static/serializeHelper.ts +29 -0
- package/src/test/buildEnvFile.ts +26 -0
- package/src/test/buildKarmaConfig.ts +15 -0
- package/src/test/buildRecordedClient.ts +18 -0
- package/src/test/buildSampleTest.ts +15 -0
- package/src/test/template.ts +191 -0
- package/tsconfig-cjs.json +9 -0
- package/tsconfig-common.json +13 -0
- package/tsconfig.json +13 -0
- package/types/buildClient.d.ts +2 -0
- package/types/buildClientDefinitions.d.ts +5 -0
- package/types/buildIndexFile.d.ts +5 -0
- package/types/buildIsUnexpectedHelper.d.ts +5 -0
- package/types/buildMethodShortcuts.d.ts +4 -0
- package/types/buildObjectTypes.d.ts +15 -0
- package/types/buildPaginateHelper.d.ts +5 -0
- package/types/buildParameterTypes.d.ts +13 -0
- package/types/buildPollingHelper.d.ts +5 -0
- package/types/buildResponseTypes.d.ts +5 -0
- package/types/buildSchemaType.d.ts +19 -0
- package/types/buildSerializeHelper.d.ts +5 -0
- package/types/buildTopLevelIndexFile.d.ts +5 -0
- package/types/helpers/nameConstructors.d.ts +28 -0
- package/types/helpers/nameUtils.d.ts +25 -0
- package/types/helpers/operationHelpers.d.ts +13 -0
- package/types/helpers/pathUtils.d.ts +1 -0
- package/types/helpers/schemaHelpers.d.ts +4 -0
- package/types/helpers/shortcutMethods.d.ts +3 -0
- package/types/index.d.ts +26 -0
- package/types/interfaces.d.ts +200 -0
- package/types/metadata/buildApiExtractorConfig.d.ts +5 -0
- package/types/metadata/buildESLintConfig.d.ts +5 -0
- package/types/metadata/buildLicenseFile.d.ts +5 -0
- package/types/metadata/buildPackageFile.d.ts +5 -0
- package/types/metadata/buildReadmeFile.d.ts +5 -0
- package/types/metadata/buildRollupConfig.d.ts +5 -0
- package/types/metadata/buildTsConfig.d.ts +5 -0
- package/types/static/paginateContent.d.ts +1 -0
- package/types/static/pollingContent.d.ts +1 -0
- package/types/static/serializeHelper.d.ts +4 -0
- package/types/test/buildEnvFile.d.ts +9 -0
- package/types/test/buildKarmaConfig.d.ts +5 -0
- package/types/test/buildRecordedClient.d.ts +5 -0
- package/types/test/buildSampleTest.d.ts +5 -0
- package/types/test/template.d.ts +5 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.hasOutputModels = exports.hasInputModels = exports.hasUnexpectedHelper = exports.hasTsvCollection = exports.hasSsvCollection = exports.hasPipeCollection = exports.hasMultiCollection = exports.hasPollingOperations = exports.hasPagingOperations = exports.getPathParamDefinitions = exports.buildMethodDefinitions = void 0;
|
|
6
|
+
const interfaces_js_1 = require("../interfaces.js");
|
|
7
|
+
const nameUtils_js_1 = require("./nameUtils.js");
|
|
8
|
+
const schemaHelpers_js_1 = require("./schemaHelpers.js");
|
|
9
|
+
function buildMethodDefinitions(methods, pathParams = []) {
|
|
10
|
+
const methodDefinitions = [];
|
|
11
|
+
for (const key of Object.keys(methods)) {
|
|
12
|
+
const verbMethods = methods[key];
|
|
13
|
+
for (const method of verbMethods) {
|
|
14
|
+
const description = method.description;
|
|
15
|
+
const areAllOptional = method.hasOptionalOptions;
|
|
16
|
+
methodDefinitions.push(Object.assign(Object.assign({ name: key }, (description && { docs: [{ description }] })), { parameters: [
|
|
17
|
+
...getPathParamDefinitions(pathParams),
|
|
18
|
+
{
|
|
19
|
+
name: "options",
|
|
20
|
+
hasQuestionToken: areAllOptional,
|
|
21
|
+
type: (0, nameUtils_js_1.pascalCase)(method.optionsName)
|
|
22
|
+
}
|
|
23
|
+
], returnType: `StreamableMethod<${method.returnType}>` }));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return methodDefinitions;
|
|
27
|
+
}
|
|
28
|
+
exports.buildMethodDefinitions = buildMethodDefinitions;
|
|
29
|
+
function getPathParamDefinitions(pathParams) {
|
|
30
|
+
return pathParams.map(({ name, type, description }) => {
|
|
31
|
+
return {
|
|
32
|
+
name: (0, nameUtils_js_1.normalizeName)(name, nameUtils_js_1.NameType.Parameter),
|
|
33
|
+
type,
|
|
34
|
+
description
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
exports.getPathParamDefinitions = getPathParamDefinitions;
|
|
39
|
+
function hasPagingOperations(model) {
|
|
40
|
+
var _a;
|
|
41
|
+
return Boolean((_a = model.annotations) === null || _a === void 0 ? void 0 : _a.hasPaging);
|
|
42
|
+
}
|
|
43
|
+
exports.hasPagingOperations = hasPagingOperations;
|
|
44
|
+
function hasPollingOperations(model) {
|
|
45
|
+
var _a;
|
|
46
|
+
return Boolean((_a = model.annotations) === null || _a === void 0 ? void 0 : _a.hasLongRunning);
|
|
47
|
+
}
|
|
48
|
+
exports.hasPollingOperations = hasPollingOperations;
|
|
49
|
+
function hasMultiCollection(model) {
|
|
50
|
+
var _a;
|
|
51
|
+
return Boolean((_a = model.annotations) === null || _a === void 0 ? void 0 : _a.hasMultiCollection);
|
|
52
|
+
}
|
|
53
|
+
exports.hasMultiCollection = hasMultiCollection;
|
|
54
|
+
function hasPipeCollection(model) {
|
|
55
|
+
var _a;
|
|
56
|
+
return Boolean((_a = model.annotations) === null || _a === void 0 ? void 0 : _a.hasPipeCollection);
|
|
57
|
+
}
|
|
58
|
+
exports.hasPipeCollection = hasPipeCollection;
|
|
59
|
+
function hasSsvCollection(model) {
|
|
60
|
+
var _a;
|
|
61
|
+
return Boolean((_a = model.annotations) === null || _a === void 0 ? void 0 : _a.hasSsvCollection);
|
|
62
|
+
}
|
|
63
|
+
exports.hasSsvCollection = hasSsvCollection;
|
|
64
|
+
function hasTsvCollection(model) {
|
|
65
|
+
var _a;
|
|
66
|
+
return Boolean((_a = model.annotations) === null || _a === void 0 ? void 0 : _a.hasTsvCollection);
|
|
67
|
+
}
|
|
68
|
+
exports.hasTsvCollection = hasTsvCollection;
|
|
69
|
+
function hasUnexpectedHelper(model) {
|
|
70
|
+
const pathDictionary = model.paths;
|
|
71
|
+
for (const details of Object.values(pathDictionary)) {
|
|
72
|
+
for (const methodDetails of Object.values(details.methods)) {
|
|
73
|
+
const successTypes = methodDetails[0].responseTypes.success;
|
|
74
|
+
const errorTypes = methodDetails[0].responseTypes.error;
|
|
75
|
+
if (successTypes.length > 0 && errorTypes.length > 0 && !!errorTypes[0]) {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
exports.hasUnexpectedHelper = hasUnexpectedHelper;
|
|
83
|
+
function hasInputModels(model) {
|
|
84
|
+
return hasSchemaContextObject(model, [interfaces_js_1.SchemaContext.Input]);
|
|
85
|
+
}
|
|
86
|
+
exports.hasInputModels = hasInputModels;
|
|
87
|
+
function hasOutputModels(model) {
|
|
88
|
+
return hasSchemaContextObject(model, [
|
|
89
|
+
interfaces_js_1.SchemaContext.Output,
|
|
90
|
+
interfaces_js_1.SchemaContext.Exception
|
|
91
|
+
]);
|
|
92
|
+
}
|
|
93
|
+
exports.hasOutputModels = hasOutputModels;
|
|
94
|
+
function hasSchemaContextObject(model, schemaUsage) {
|
|
95
|
+
var _a;
|
|
96
|
+
const objectSchemas = ((_a = model.schemas) !== null && _a !== void 0 ? _a : []).filter((o) => {
|
|
97
|
+
var _a;
|
|
98
|
+
return (0, schemaHelpers_js_1.isObjectSchema)(o) &&
|
|
99
|
+
((_a = o.usage) === null || _a === void 0 ? void 0 : _a.some((u) => schemaUsage.includes(u)));
|
|
100
|
+
});
|
|
101
|
+
return objectSchemas.length > 0;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=operationHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operationHelpers.js","sourceRoot":"","sources":["../../src/helpers/operationHelpers.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRelativePartFromSrcPath = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
function getRelativePartFromSrcPath(srcPath) {
|
|
6
|
+
const sep = srcPath.includes(path.sep + "src") ? path.sep : "/";
|
|
7
|
+
const relativePart = srcPath.substring(srcPath.indexOf(sep + "src") + 4);
|
|
8
|
+
return relativePart.startsWith(sep)
|
|
9
|
+
? relativePart.substring(1)
|
|
10
|
+
: relativePart;
|
|
11
|
+
}
|
|
12
|
+
exports.getRelativePartFromSrcPath = getRelativePartFromSrcPath;
|
|
13
|
+
//# sourceMappingURL=pathUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathUtils.js","sourceRoot":"","sources":["../../src/helpers/pathUtils.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAE7B,SAAgB,0BAA0B,CAAC,OAAe;IACxD,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAChE,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,OAAO,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC;QACjC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;QAC3B,CAAC,CAAC,YAAY,CAAC;AACnB,CAAC;AAND,gEAMC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.isConstantSchema = exports.isObjectSchema = exports.isDictionarySchema = void 0;
|
|
6
|
+
function isDictionarySchema(schema) {
|
|
7
|
+
if (schema.type === "dictionary") {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
exports.isDictionarySchema = isDictionarySchema;
|
|
13
|
+
function isObjectSchema(schema) {
|
|
14
|
+
if (schema.type === "object") {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
exports.isObjectSchema = isObjectSchema;
|
|
20
|
+
function isConstantSchema(schema) {
|
|
21
|
+
if (schema.type === "constant") {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
exports.isConstantSchema = isConstantSchema;
|
|
27
|
+
//# sourceMappingURL=schemaHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaHelpers.js","sourceRoot":"","sources":["../../src/helpers/schemaHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAIlC,SAAgB,kBAAkB,CAAC,MAAc;IAC/C,IAAI,MAAM,CAAC,IAAI,KAAK,YAAY,EAAE;QAChC,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,gDAKC;AAED,SAAgB,cAAc,CAAC,MAAc;IAC3C,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,wCAKC;AAED,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,4CAKC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.generateMethodShortcuts = void 0;
|
|
6
|
+
const operationHelpers_js_1 = require("./operationHelpers.js");
|
|
7
|
+
const nameUtils_js_1 = require("./nameUtils.js");
|
|
8
|
+
function generateMethodShortcuts(paths) {
|
|
9
|
+
const keys = {};
|
|
10
|
+
for (const path in paths) {
|
|
11
|
+
const groupName = paths[path].operationGroupName;
|
|
12
|
+
const definitions = buildOperationDefinitions(paths[path]);
|
|
13
|
+
if (!keys[groupName]) {
|
|
14
|
+
keys[groupName] = definitions;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
keys[groupName] = [...keys[groupName], ...definitions];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const interfaces = [];
|
|
21
|
+
for (const interfaceName in keys) {
|
|
22
|
+
const methods = keys[interfaceName];
|
|
23
|
+
interfaces.push({
|
|
24
|
+
name: `${interfaceName}Operations`,
|
|
25
|
+
methods: methods,
|
|
26
|
+
isExported: true,
|
|
27
|
+
docs: [`Contains operations for ${interfaceName} operations`]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return interfaces;
|
|
31
|
+
}
|
|
32
|
+
exports.generateMethodShortcuts = generateMethodShortcuts;
|
|
33
|
+
function buildOperationDefinitions(path) {
|
|
34
|
+
let ops = [];
|
|
35
|
+
for (const verb in path.methods) {
|
|
36
|
+
const methods = path.methods[verb];
|
|
37
|
+
for (const method of methods) {
|
|
38
|
+
const name = (0, nameUtils_js_1.normalizeName)(method.operationName, nameUtils_js_1.NameType.Property);
|
|
39
|
+
const pathParams = path.pathParameters;
|
|
40
|
+
const methodDefinitions = (0, operationHelpers_js_1.buildMethodDefinitions)({ [name]: [method] }, pathParams);
|
|
41
|
+
ops = [...ops, ...methodDefinitions];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return ops;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=shortcutMethods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shortcutMethods.js","sourceRoot":"","sources":["../../src/helpers/shortcutMethods.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAQlC,+DAA+D;AAC/D,iDAAyD;AAEzD,SAAgB,uBAAuB,CACrC,KAAY;IAEZ,MAAM,IAAI,GAA6D,EAAE,CAAC;IAC1E,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC;QACjD,MAAM,WAAW,GAAG,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YACpB,IAAI,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC;SAC/B;aAAM;YACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC;SACxD;KACF;IAED,MAAM,UAAU,GAAkD,EAAE,CAAC;IAErE,KAAK,MAAM,aAAa,IAAI,IAAI,EAAE;QAChC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;QACpC,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,GAAG,aAAa,YAAY;YAClC,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,CAAC,2BAA2B,aAAa,aAAa,CAAC;SAC9D,CAAC,CAAC;KACJ;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AA3BD,0DA2BC;AAED,SAAS,yBAAyB,CAChC,IAAkB;IAElB,IAAI,GAAG,GAA6C,EAAE,CAAC;IAEvD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,MAAM,IAAI,GAAG,IAAA,4BAAa,EAAC,MAAM,CAAC,aAAa,EAAE,uBAAQ,CAAC,QAAQ,CAAC,CAAC;YACpE,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC;YACvC,MAAM,iBAAiB,GAAG,IAAA,4CAAsB,EAC9C,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EACpB,UAAU,CACX,CAAC;YACF,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,iBAAiB,CAAC,CAAC;SACtC;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
__exportStar(require("./interfaces.js"), exports);
|
|
20
|
+
__exportStar(require("./buildClientDefinitions.js"), exports);
|
|
21
|
+
__exportStar(require("./buildSchemaType.js"), exports);
|
|
22
|
+
__exportStar(require("./buildClient.js"), exports);
|
|
23
|
+
__exportStar(require("./helpers/nameConstructors.js"), exports);
|
|
24
|
+
__exportStar(require("./buildResponseTypes.js"), exports);
|
|
25
|
+
__exportStar(require("./helpers/shortcutMethods.js"), exports);
|
|
26
|
+
__exportStar(require("./helpers/nameUtils.js"), exports);
|
|
27
|
+
__exportStar(require("./buildParameterTypes.js"), exports);
|
|
28
|
+
__exportStar(require("./buildIsUnexpectedHelper.js"), exports);
|
|
29
|
+
__exportStar(require("./buildTopLevelIndexFile.js"), exports);
|
|
30
|
+
__exportStar(require("./buildIndexFile.js"), exports);
|
|
31
|
+
__exportStar(require("./buildPaginateHelper.js"), exports);
|
|
32
|
+
__exportStar(require("./buildPollingHelper.js"), exports);
|
|
33
|
+
__exportStar(require("./test/buildKarmaConfig.js"), exports);
|
|
34
|
+
__exportStar(require("./test/buildEnvFile.js"), exports);
|
|
35
|
+
__exportStar(require("./test/buildRecordedClient.js"), exports);
|
|
36
|
+
__exportStar(require("./test/buildSampleTest.js"), exports);
|
|
37
|
+
__exportStar(require("./metadata/buildReadmeFile.js"), exports);
|
|
38
|
+
__exportStar(require("./metadata/buildApiExtractorConfig.js"), exports);
|
|
39
|
+
__exportStar(require("./metadata/buildPackageFile.js"), exports);
|
|
40
|
+
__exportStar(require("./metadata/buildRollupConfig.js"), exports);
|
|
41
|
+
__exportStar(require("./metadata/buildTsConfig.js"), exports);
|
|
42
|
+
__exportStar(require("./metadata/buildESLintConfig.js"), exports);
|
|
43
|
+
__exportStar(require("./metadata/buildLicenseFile.js"), exports);
|
|
44
|
+
__exportStar(require("./buildSerializeHelper.js"), exports);
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;AAElC,kDAAgC;AAChC,8DAA4C;AAC5C,uDAAqC;AACrC,mDAAiC;AACjC,gEAA8C;AAC9C,0DAAwC;AACxC,+DAA6C;AAC7C,yDAAuC;AACvC,2DAAyC;AACzC,+DAA6C;AAC7C,8DAA4C;AAC5C,sDAAoC;AACpC,2DAAyC;AACzC,0DAAwC;AACxC,6DAA2C;AAC3C,yDAAuC;AACvC,gEAA8C;AAC9C,4DAA0C;AAC1C,gEAA8C;AAC9C,wEAAsD;AACtD,iEAA+C;AAC/C,kEAAgD;AAChD,8DAA4C;AAC5C,kEAAgD;AAChD,iEAA+C;AAC/C,4DAA0C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SchemaContext = exports.ImportKind = void 0;
|
|
4
|
+
var ImportKind;
|
|
5
|
+
(function (ImportKind) {
|
|
6
|
+
ImportKind[ImportKind["ResponseOutput"] = 0] = "ResponseOutput";
|
|
7
|
+
ImportKind[ImportKind["ParameterInput"] = 1] = "ParameterInput";
|
|
8
|
+
})(ImportKind = exports.ImportKind || (exports.ImportKind = {}));
|
|
9
|
+
var SchemaContext;
|
|
10
|
+
(function (SchemaContext) {
|
|
11
|
+
/** Schema is used as an input to an operation. */
|
|
12
|
+
SchemaContext["Input"] = "input";
|
|
13
|
+
/** Schema is used as an output from an operation. */
|
|
14
|
+
SchemaContext["Output"] = "output";
|
|
15
|
+
/** Schema is used as an exception from an operation. */
|
|
16
|
+
SchemaContext["Exception"] = "exception";
|
|
17
|
+
})(SchemaContext = exports.SchemaContext || (exports.SchemaContext = {}));
|
|
18
|
+
//# sourceMappingURL=interfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;AAmHA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,+DAAc,CAAA;IACd,+DAAc,CAAA;AAChB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAMD,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,kDAAkD;IAClD,gCAAe,CAAA;IACf,qDAAqD;IACrD,kCAAiB,CAAA;IACjB,wDAAwD;IACxD,wCAAuB,CAAA;AACzB,CAAC,EAPW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAOxB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.buildApiExtractorConfig = void 0;
|
|
6
|
+
const ts_morph_1 = require("ts-morph");
|
|
7
|
+
function buildApiExtractorConfig(model) {
|
|
8
|
+
var _a;
|
|
9
|
+
const generateMetadata = Boolean((_a = model.options) === null || _a === void 0 ? void 0 : _a.generateMetadata);
|
|
10
|
+
if (!generateMetadata) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const { generateTest, packageDetails } = model.options || {};
|
|
14
|
+
const project = new ts_morph_1.Project();
|
|
15
|
+
const config = {
|
|
16
|
+
$schema: "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
17
|
+
mainEntryPointFilePath: `./types${generateTest ? "/src" : ""}/index.d.ts`,
|
|
18
|
+
docModel: {
|
|
19
|
+
enabled: true
|
|
20
|
+
},
|
|
21
|
+
apiReport: {
|
|
22
|
+
enabled: true,
|
|
23
|
+
reportFolder: "./review"
|
|
24
|
+
},
|
|
25
|
+
dtsRollup: {
|
|
26
|
+
enabled: true,
|
|
27
|
+
untrimmedFilePath: "",
|
|
28
|
+
publicTrimmedFilePath: `./types/${packageDetails === null || packageDetails === void 0 ? void 0 : packageDetails.nameWithoutScope}.d.ts`
|
|
29
|
+
},
|
|
30
|
+
messages: {
|
|
31
|
+
tsdocMessageReporting: {
|
|
32
|
+
default: {
|
|
33
|
+
logLevel: "none"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
extractorMessageReporting: {
|
|
37
|
+
"ae-missing-release-tag": {
|
|
38
|
+
logLevel: "none"
|
|
39
|
+
},
|
|
40
|
+
"ae-unresolved-link": {
|
|
41
|
+
logLevel: "none"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const filePath = "api-extractor.json";
|
|
47
|
+
const configFile = project.createSourceFile(filePath, JSON.stringify(config), {
|
|
48
|
+
overwrite: true
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
path: filePath,
|
|
52
|
+
content: configFile.getFullText()
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
exports.buildApiExtractorConfig = buildApiExtractorConfig;
|
|
56
|
+
//# sourceMappingURL=buildApiExtractorConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildApiExtractorConfig.js","sourceRoot":"","sources":["../../src/metadata/buildApiExtractorConfig.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,uCAAmC;AAGnC,SAAgB,uBAAuB,CAAC,KAAe;;IACrD,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAA,KAAK,CAAC,OAAO,0CAAE,gBAAgB,CAAC,CAAC;IAClE,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO;KACR;IACD,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;IAC7D,MAAM,OAAO,GAAG,IAAI,kBAAO,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG;QACb,OAAO,EACL,yFAAyF;QAC3F,sBAAsB,EAAE,UAAU,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa;QACzE,QAAQ,EAAE;YACR,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,OAAO,EAAE,IAAI;YACb,YAAY,EAAE,UAAU;SACzB;QACD,SAAS,EAAE;YACT,OAAO,EAAE,IAAI;YACb,iBAAiB,EAAE,EAAE;YACrB,qBAAqB,EAAE,WAAW,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,gBAAgB,OAAO;SAC1E;QACD,QAAQ,EAAE;YACR,qBAAqB,EAAE;gBACrB,OAAO,EAAE;oBACP,QAAQ,EAAE,MAAM;iBACjB;aACF;YACD,yBAAyB,EAAE;gBACzB,wBAAwB,EAAE;oBACxB,QAAQ,EAAE,MAAM;iBACjB;gBACD,oBAAoB,EAAE;oBACpB,QAAQ,EAAE,MAAM;iBACjB;aACF;SACF;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG,oBAAoB,CAAC;IACtC,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CACzC,QAAQ,EACR,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EACtB;QACE,SAAS,EAAE,IAAI;KAChB,CACF,CAAC;IACF,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,UAAU,CAAC,WAAW,EAAE;KAClC,CAAC;AACJ,CAAC;AApDD,0DAoDC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildEsLintConfig = void 0;
|
|
4
|
+
const ts_morph_1 = require("ts-morph");
|
|
5
|
+
const esLintConfig = {
|
|
6
|
+
plugins: ["@azure/azure-sdk"],
|
|
7
|
+
extends: ["plugin:@azure/azure-sdk/azure-sdk-base"],
|
|
8
|
+
rules: {
|
|
9
|
+
"@azure/azure-sdk/ts-modules-only-named": "warn",
|
|
10
|
+
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
|
|
11
|
+
"@azure/azure-sdk/ts-package-json-types": "warn",
|
|
12
|
+
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
|
|
13
|
+
"tsdoc/syntax": "warn"
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
function buildEsLintConfig(model) {
|
|
17
|
+
var _a;
|
|
18
|
+
const generateMetadata = Boolean((_a = model.options) === null || _a === void 0 ? void 0 : _a.generateMetadata);
|
|
19
|
+
if (!generateMetadata) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const project = new ts_morph_1.Project();
|
|
23
|
+
const filePath = ".eslintrc.json";
|
|
24
|
+
const configFile = project.createSourceFile(".eslintrc.json", JSON.stringify(esLintConfig), {
|
|
25
|
+
overwrite: true
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
path: filePath,
|
|
29
|
+
content: configFile.getFullText()
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.buildEsLintConfig = buildEsLintConfig;
|
|
33
|
+
//# sourceMappingURL=buildESLintConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildESLintConfig.js","sourceRoot":"","sources":["../../src/metadata/buildESLintConfig.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAGnC,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,CAAC,kBAAkB,CAAC;IAC7B,OAAO,EAAE,CAAC,wCAAwC,CAAC;IACnD,KAAK,EAAE;QACL,wCAAwC,EAAE,MAAM;QAChD,6CAA6C,EAAE,MAAM;QACrD,wCAAwC,EAAE,MAAM;QAChD,oDAAoD,EAAE,MAAM;QAC5D,cAAc,EAAE,MAAM;KACvB;CACF,CAAC;AAEF,SAAgB,iBAAiB,CAAC,KAAe;;IAC/C,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAA,KAAK,CAAC,OAAO,0CAAE,gBAAgB,CAAC,CAAC;IAClE,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO;KACR;IACD,MAAM,OAAO,GAAG,IAAI,kBAAO,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,gBAAgB,CAAC;IAClC,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CACzC,gBAAgB,EAChB,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAC5B;QACE,SAAS,EAAE,IAAI;KAChB,CACF,CAAC;IACF,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,UAAU,CAAC,WAAW,EAAE;KAClC,CAAC;AACJ,CAAC;AAlBD,8CAkBC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.buildLicenseFile = void 0;
|
|
6
|
+
const mitLicenseText = `
|
|
7
|
+
The MIT License (MIT)
|
|
8
|
+
|
|
9
|
+
Copyright (c) ${new Date().getFullYear()} Microsoft
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
`;
|
|
29
|
+
function buildLicenseFile(model) {
|
|
30
|
+
var _a;
|
|
31
|
+
const generateMetadata = Boolean((_a = model.options) === null || _a === void 0 ? void 0 : _a.generateMetadata);
|
|
32
|
+
if (!generateMetadata) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
path: "LICENSE",
|
|
37
|
+
content: mitLicenseText.trim()
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.buildLicenseFile = buildLicenseFile;
|
|
41
|
+
//# sourceMappingURL=buildLicenseFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildLicenseFile.js","sourceRoot":"","sources":["../../src/metadata/buildLicenseFile.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAIlC,MAAM,cAAc,GAAG;;;gBAGP,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;CAmBvC,CAAC;AAEF,SAAgB,gBAAgB,CAAC,KAAe;;IAC9C,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAA,KAAK,CAAC,OAAO,0CAAE,gBAAgB,CAAC,CAAC;IAClE,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO;KACR;IACD,OAAO;QACL,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,cAAc,CAAC,IAAI,EAAE;KAC/B,CAAC;AACJ,CAAC;AATD,4CASC"}
|