@azure-tools/typespec-ts 0.36.0 → 0.37.0-alpha.20241230.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/CHANGELOG.md +14 -0
- package/dist/src/contextManager.d.ts +1 -2
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +2 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +17 -0
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +31 -29
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.js +1 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +0 -5
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +3 -2
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +64 -62
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +3 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +35 -27
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +4 -3
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +84 -35
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +7 -0
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -0
- package/dist/src/modular/buildModularOptions.js +16 -0
- package/dist/src/modular/buildModularOptions.js.map +1 -0
- package/dist/src/modular/buildOperations.d.ts +6 -4
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +56 -55
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +3 -2
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +18 -16
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +4 -2
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +22 -18
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +4 -3
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +40 -31
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts +4 -2
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +8 -5
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts +2 -3
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +4 -4
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -2
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +10 -3
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +3 -24
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +10 -86
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.js +2 -1
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +3 -3
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +40 -50
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +11 -8
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +87 -60
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +4 -7
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +3 -26
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +21 -20
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +336 -291
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +4 -25
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +6 -218
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/interfaces.d.ts +15 -8
- package/dist/src/modular/interfaces.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +1 -2
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +1 -2
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts +8 -5
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +22 -22
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +3 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +10 -0
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +6 -2
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +66 -7
- package/dist/src/utils/operationUtil.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/contextManager.ts +1 -2
- package/src/framework/load-static-helpers.ts +24 -1
- package/src/index.ts +65 -37
- package/src/lib.ts +1 -1
- package/src/metaTree.ts +0 -6
- package/src/modular/buildClassicalClient.ts +97 -99
- package/src/modular/buildClassicalOperationGroups.ts +53 -47
- package/src/modular/buildClientContext.ts +101 -44
- package/src/modular/buildModularOptions.ts +27 -0
- package/src/modular/buildOperations.ts +91 -78
- package/src/modular/buildProjectFiles.ts +24 -21
- package/src/modular/buildRestorePoller.ts +39 -23
- package/src/modular/buildRootIndex.ts +51 -42
- package/src/modular/buildSubpathIndex.ts +16 -7
- package/src/modular/emitLoggerFile.ts +12 -10
- package/src/modular/emitModels.ts +15 -7
- package/src/modular/emitModelsOptions.ts +18 -125
- package/src/modular/emitSamples.ts +2 -3
- package/src/modular/helpers/classicalOperationHelpers.ts +50 -75
- package/src/modular/helpers/clientHelpers.ts +107 -73
- package/src/modular/helpers/namingHelpers.ts +6 -65
- package/src/modular/helpers/operationHelpers.ts +506 -384
- package/src/modular/helpers/typeHelpers.ts +11 -267
- package/src/modular/interfaces.ts +16 -8
- package/src/modular/serialization/buildDeserializerFunction.ts +1 -6
- package/src/modular/serialization/buildSerializerFunction.ts +1 -2
- package/src/modular/serialization/serializeUtils.ts +31 -30
- package/src/utils/clientUtils.ts +23 -1
- package/src/utils/operationUtil.ts +106 -14
- package/dist/src/modular/buildCodeModel.d.ts +0 -34
- package/dist/src/modular/buildCodeModel.d.ts.map +0 -1
- package/dist/src/modular/buildCodeModel.js +0 -1489
- package/dist/src/modular/buildCodeModel.js.map +0 -1
- package/dist/src/modular/modularCodeModel.d.ts +0 -166
- package/dist/src/modular/modularCodeModel.d.ts.map +0 -1
- package/dist/src/modular/modularCodeModel.js +0 -2
- package/dist/src/modular/modularCodeModel.js.map +0 -1
- package/src/modular/buildCodeModel.ts +0 -1965
- package/src/modular/modularCodeModel.ts +0 -211
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildClientContext.js","sourceRoot":"","sources":["../../../src/modular/buildClientContext.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,8BAA8B,EAC/B,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"buildClientContext.js","sourceRoot":"","sources":["../../../src/modular/buildClientContext.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,8BAA8B,EAC/B,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,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,CAAC,oBAAoB,EAAE,CAAC;IACzC,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,SAAS,uBAAuB,CAC9B,UAAsB,EACtB,KAAsC;IAEtC,MAAM,IAAI,GAAG,sBAAsB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/C,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,cAAc,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACrD,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACxE,IAAI,CAAC,IAAI,CACP,0BAA0B,eAAe,CAAC,IAAI,6BAA6B,CAC5E,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ModularEmitterOptions } from "./interfaces.js";
|
|
2
|
+
import { Project } from "ts-morph";
|
|
3
|
+
import { SdkContext } from "../utils/interfaces.js";
|
|
4
|
+
export declare function transformModularEmitterOptions(dpgContext: SdkContext, modularSourcesRoot: string, project: Project, options?: {
|
|
5
|
+
casing: "snake" | "camel";
|
|
6
|
+
}): ModularEmitterOptions;
|
|
7
|
+
//# sourceMappingURL=buildModularOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildModularOptions.d.ts","sourceRoot":"","sources":["../../../src/modular/buildModularOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIpD,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE;IAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAA;CAAwB,GAC3D,qBAAqB,CAcvB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let CASING = "snake";
|
|
2
|
+
export function transformModularEmitterOptions(dpgContext, modularSourcesRoot, project, options = { casing: "snake" }) {
|
|
3
|
+
var _a, _b, _c, _d;
|
|
4
|
+
CASING = (_a = options.casing) !== null && _a !== void 0 ? _a : CASING;
|
|
5
|
+
const emitterOptions = {
|
|
6
|
+
options: (_b = dpgContext.rlcOptions) !== null && _b !== void 0 ? _b : {},
|
|
7
|
+
modularOptions: {
|
|
8
|
+
sourceRoot: modularSourcesRoot,
|
|
9
|
+
compatibilityMode: !!((_c = dpgContext.rlcOptions) === null || _c === void 0 ? void 0 : _c.compatibilityMode),
|
|
10
|
+
experimentalExtensibleEnums: !!((_d = dpgContext.rlcOptions) === null || _d === void 0 ? void 0 : _d.experimentalExtensibleEnums)
|
|
11
|
+
},
|
|
12
|
+
project
|
|
13
|
+
};
|
|
14
|
+
return emitterOptions;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=buildModularOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildModularOptions.js","sourceRoot":"","sources":["../../../src/modular/buildModularOptions.ts"],"names":[],"mappings":"AAKA,IAAI,MAAM,GAAsB,OAAO,CAAC;AAExC,MAAM,UAAU,8BAA8B,CAC5C,UAAsB,EACtB,kBAA0B,EAC1B,OAAgB,EAChB,UAAyC,EAAE,MAAM,EAAE,OAAO,EAAE;;IAE5D,MAAM,GAAG,MAAA,OAAO,CAAC,MAAM,mCAAI,MAAM,CAAC;IAClC,MAAM,cAAc,GAA0B;QAC5C,OAAO,EAAE,MAAA,UAAU,CAAC,UAAU,mCAAI,EAAE;QACpC,cAAc,EAAE;YACd,UAAU,EAAE,kBAAkB;YAC9B,iBAAiB,EAAE,CAAC,CAAC,CAAA,MAAA,UAAU,CAAC,UAAU,0CAAE,iBAAiB,CAAA;YAC7D,2BAA2B,EACzB,CAAC,CAAC,CAAA,MAAA,UAAU,CAAC,UAAU,0CAAE,2BAA2B,CAAA;SACvD;QACD,OAAO;KACR,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModularEmitterOptions } from "./interfaces.js";
|
|
2
2
|
import { Project, SourceFile } from "ts-morph";
|
|
3
3
|
import { OperationPathAndDeserDetails } from "./interfaces.js";
|
|
4
4
|
import { SdkContext } from "../utils/interfaces.js";
|
|
5
|
+
import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
6
|
+
import { ServiceOperation } from "../utils/operationUtil.js";
|
|
5
7
|
/**
|
|
6
8
|
* This function creates a file under /api for each operation group.
|
|
7
9
|
* If there is no operation group in the TypeSpec program, we create a single
|
|
8
10
|
* file called operations.ts where all operations are generated.
|
|
9
11
|
*/
|
|
10
|
-
export declare function buildOperationFiles(
|
|
12
|
+
export declare function buildOperationFiles(dpgContext: SdkContext, client: SdkClientType<SdkServiceOperation>, emitterOptions: ModularEmitterOptions): SourceFile[];
|
|
11
13
|
export declare function importDeserializeUtils(srcPath: string, sourceFile: SourceFile, project: Project, serializeType: string, subfolder?: string, importLayer?: number): void;
|
|
12
14
|
/**
|
|
13
15
|
* This function generates the interfaces for each operation options
|
|
14
16
|
*/
|
|
15
|
-
export declare function buildOperationOptions(context: SdkContext,
|
|
17
|
+
export declare function buildOperationOptions(context: SdkContext, method: [string[], ServiceOperation], sourceFile: SourceFile): void;
|
|
16
18
|
/**
|
|
17
19
|
* This function creates a map of operation file path to operation names.
|
|
18
20
|
*/
|
|
19
|
-
export declare function buildLroDeserDetailMap(client:
|
|
21
|
+
export declare function buildLroDeserDetailMap(context: SdkContext, client: SdkClientType<SdkServiceOperation>): Map<string, OperationPathAndDeserDetails[]>;
|
|
20
22
|
//# sourceMappingURL=buildOperations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildOperations.d.ts","sourceRoot":"","sources":["../../../src/modular/buildOperations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"buildOperations.d.ts","sourceRoot":"","sources":["../../../src/modular/buildOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAU/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AASpD,OAAO,EACL,aAAa,EAEb,mBAAmB,EACpB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAEL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAInC;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAC1C,cAAc,EAAE,qBAAqB,gBAqFtC;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,SAAS,GAAE,MAAW,EACtB,WAAW,GAAE,MAAU,QAwBxB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,EACpC,UAAU,EAAE,UAAU,QAgDvB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,+CA+C3C"}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { NameType,
|
|
1
|
+
import { NameType, normalizeName } from "@azure-tools/rlc-common";
|
|
2
2
|
import { getDeserializePrivateFunction, getExpectedStatuses, getOperationFunction, getOperationOptionsName, getSendPrivateFunction, isLroOnlyOperation } from "./helpers/operationHelpers.js";
|
|
3
3
|
import { addImportBySymbol } from "../utils/importHelper.js";
|
|
4
4
|
import { getDocsFromDescription } from "./helpers/docsHelpers.js";
|
|
5
5
|
import { getOperationName } from "./helpers/namingHelpers.js";
|
|
6
|
-
import { isRLCMultiEndpoint } from "../utils/clientUtils.js";
|
|
6
|
+
import { getModularClientOptions, isRLCMultiEndpoint } from "../utils/clientUtils.js";
|
|
7
7
|
import { getTypeExpression } from "./type-expressions/get-type-expression.js";
|
|
8
|
-
import {
|
|
8
|
+
import { getMethodHierarchiesMap } from "../utils/operationUtil.js";
|
|
9
|
+
import { resolveReference } from "../framework/reference.js";
|
|
10
|
+
import { useDependencies } from "../framework/hooks/useDependencies.js";
|
|
9
11
|
/**
|
|
10
12
|
* This function creates a file under /api for each operation group.
|
|
11
13
|
* If there is no operation group in the TypeSpec program, we create a single
|
|
12
14
|
* file called operations.ts where all operations are generated.
|
|
13
15
|
*/
|
|
14
|
-
export function buildOperationFiles(
|
|
15
|
-
const operationFiles =
|
|
16
|
+
export function buildOperationFiles(dpgContext, client, emitterOptions) {
|
|
17
|
+
const operationFiles = new Set();
|
|
18
|
+
const { subfolder, rlcClientName } = getModularClientOptions(dpgContext, client);
|
|
16
19
|
const isMultiEndpoint = isRLCMultiEndpoint(dpgContext);
|
|
17
|
-
const clientType = isMultiEndpoint
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
? `${operationGroup.namespaceHierarchies
|
|
20
|
+
const clientType = isMultiEndpoint ? `Client.${rlcClientName}` : "Client";
|
|
21
|
+
const methodMap = getMethodHierarchiesMap(dpgContext, client);
|
|
22
|
+
for (const [prefixKey, operations] of methodMap) {
|
|
23
|
+
const prefixes = prefixKey.split("/");
|
|
24
|
+
const operationFileName = prefixes.length > 0 && prefixKey !== ""
|
|
25
|
+
? `${prefixes
|
|
24
26
|
.map((hierarchy) => {
|
|
25
27
|
return normalizeName(hierarchy, NameType.File);
|
|
26
28
|
})
|
|
@@ -28,34 +30,33 @@ export function buildOperationFiles(client, dpgContext, codeModel) {
|
|
|
28
30
|
: // When the program has no operation groups defined all operations are put
|
|
29
31
|
// into a nameless operation group. We'll call this operations.
|
|
30
32
|
"operations";
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const operationGroupFile =
|
|
33
|
+
const srcPath = emitterOptions.modularOptions.sourceRoot;
|
|
34
|
+
const filepath = `${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}api/${operationFileName}.ts`;
|
|
35
|
+
const operationGroupFile = emitterOptions.project.createSourceFile(filepath);
|
|
34
36
|
// Import the deserializeUtils
|
|
35
|
-
importDeserializeUtils(srcPath, operationGroupFile,
|
|
37
|
+
importDeserializeUtils(srcPath, operationGroupFile, emitterOptions.project, "deserialize", subfolder, prefixes.length);
|
|
36
38
|
// Import the serializeUtils
|
|
37
|
-
importDeserializeUtils(srcPath, operationGroupFile,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
43
|
-
operationGroup.operations.forEach((o) => {
|
|
44
|
-
const operationDeclaration = getOperationFunction(dpgContext, o, clientType);
|
|
45
|
-
const sendOperationDeclaration = getSendPrivateFunction(dpgContext, o, clientType);
|
|
46
|
-
const deserializeOperationDeclaration = getDeserializePrivateFunction(dpgContext, o);
|
|
39
|
+
importDeserializeUtils(srcPath, operationGroupFile, emitterOptions.project, "serialize", subfolder, prefixes.length);
|
|
40
|
+
operations.forEach((op) => {
|
|
41
|
+
const operationDeclaration = getOperationFunction(dpgContext, [prefixes, op], clientType);
|
|
42
|
+
const sendOperationDeclaration = getSendPrivateFunction(dpgContext, client, [prefixes, op], clientType);
|
|
43
|
+
const deserializeOperationDeclaration = getDeserializePrivateFunction(dpgContext, op);
|
|
47
44
|
operationGroupFile.addFunctions([
|
|
48
45
|
sendOperationDeclaration,
|
|
49
46
|
deserializeOperationDeclaration,
|
|
50
47
|
operationDeclaration
|
|
51
48
|
]);
|
|
52
49
|
});
|
|
53
|
-
|
|
54
|
-
operationGroupFile.
|
|
50
|
+
const indexPathPrefix = "../".repeat(prefixKey === "" ? 0 : prefixes.length) || "./";
|
|
51
|
+
operationGroupFile.addImportDeclaration({
|
|
52
|
+
namedImports: [`${rlcClientName} as Client`],
|
|
53
|
+
moduleSpecifier: `${indexPathPrefix}index.js`
|
|
54
|
+
});
|
|
55
55
|
addImportBySymbol("serializeRecord", operationGroupFile);
|
|
56
|
-
|
|
56
|
+
operationGroupFile.fixUnusedIdentifiers();
|
|
57
|
+
operationFiles.add(operationGroupFile);
|
|
57
58
|
}
|
|
58
|
-
return operationFiles;
|
|
59
|
+
return Array.from(operationFiles);
|
|
59
60
|
}
|
|
60
61
|
export function importDeserializeUtils(srcPath, sourceFile, project, serializeType, subfolder = "", importLayer = 0) {
|
|
61
62
|
var _a;
|
|
@@ -77,13 +78,16 @@ export function importDeserializeUtils(srcPath, sourceFile, project, serializeTy
|
|
|
77
78
|
/**
|
|
78
79
|
* This function generates the interfaces for each operation options
|
|
79
80
|
*/
|
|
80
|
-
export function buildOperationOptions(context,
|
|
81
|
-
|
|
81
|
+
export function buildOperationOptions(context, method, sourceFile) {
|
|
82
|
+
const dependencies = useDependencies();
|
|
83
|
+
const operation = method[1];
|
|
82
84
|
const optionalParameters = operation.parameters
|
|
83
|
-
.filter((p) => p.
|
|
85
|
+
.filter((p) => p.onClient === false &&
|
|
86
|
+
!(p.isGeneratedName &&
|
|
87
|
+
(p.name === "contentType" || p.name !== "accept")))
|
|
84
88
|
.filter((p) => p.optional || p.clientDefaultValue);
|
|
85
89
|
const options = [...optionalParameters];
|
|
86
|
-
const name = getOperationOptionsName(
|
|
90
|
+
const name = getOperationOptionsName(method, true);
|
|
87
91
|
const lroOptions = {
|
|
88
92
|
name: "updateIntervalInMs",
|
|
89
93
|
type: "number",
|
|
@@ -91,25 +95,20 @@ export function buildOperationOptions(context, operation, sourceFile) {
|
|
|
91
95
|
docs: ["Delay to wait until next poll, in milliseconds."]
|
|
92
96
|
};
|
|
93
97
|
// handle optional body parameter
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
}
|
|
98
|
+
// if (operation.operation.bodyParam?.optional === true) {
|
|
99
|
+
// options.push(operation.operation.bodyParam);
|
|
100
|
+
// }
|
|
101
|
+
const operationOptionsReference = resolveReference(dependencies.OperationOptions);
|
|
97
102
|
sourceFile.addInterface({
|
|
98
103
|
name,
|
|
99
104
|
isExported: true,
|
|
100
|
-
extends: [
|
|
105
|
+
extends: [operationOptionsReference],
|
|
101
106
|
properties: (isLroOnlyOperation(operation) ? [lroOptions] : []).concat(options.map((p) => {
|
|
102
107
|
return {
|
|
103
|
-
docs: getDocsFromDescription(p.
|
|
108
|
+
docs: getDocsFromDescription(p.doc),
|
|
104
109
|
hasQuestionToken: true,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
type: getTypeExpression(context, p.type.tcgcType),
|
|
108
|
-
name: p.clientName
|
|
109
|
-
}
|
|
110
|
-
: {
|
|
111
|
-
...buildType(p.clientName, p.type, p.format)
|
|
112
|
-
})
|
|
110
|
+
type: getTypeExpression(context, p.type),
|
|
111
|
+
name: normalizeName(p.name, NameType.Parameter)
|
|
113
112
|
};
|
|
114
113
|
})),
|
|
115
114
|
docs: [`Optional parameters.`]
|
|
@@ -118,17 +117,19 @@ export function buildOperationOptions(context, operation, sourceFile) {
|
|
|
118
117
|
/**
|
|
119
118
|
* This function creates a map of operation file path to operation names.
|
|
120
119
|
*/
|
|
121
|
-
export function buildLroDeserDetailMap(client) {
|
|
120
|
+
export function buildLroDeserDetailMap(context, client) {
|
|
122
121
|
const map = new Map();
|
|
123
122
|
const existingNames = new Set();
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
const methodMap = getMethodHierarchiesMap(context, client);
|
|
124
|
+
for (const [prefixKey, operations] of methodMap) {
|
|
125
|
+
const prefixes = prefixKey.split("/");
|
|
126
|
+
const lroOperations = operations.filter((o) => isLroOnlyOperation(o));
|
|
126
127
|
// skip this operation group if it has no LRO operations
|
|
127
|
-
if (
|
|
128
|
+
if (lroOperations.length === 0) {
|
|
128
129
|
continue;
|
|
129
130
|
}
|
|
130
|
-
const operationFileName =
|
|
131
|
-
? `${
|
|
131
|
+
const operationFileName = prefixes.length > 0 && prefixKey !== ""
|
|
132
|
+
? `${prefixes
|
|
132
133
|
.map((hierarchy) => {
|
|
133
134
|
return normalizeName(hierarchy, NameType.File);
|
|
134
135
|
})
|
|
@@ -136,7 +137,7 @@ export function buildLroDeserDetailMap(client) {
|
|
|
136
137
|
: // When the program has no operation groups defined all operations are put
|
|
137
138
|
// into a nameless operation group. We'll call this operations.
|
|
138
139
|
"operations";
|
|
139
|
-
map.set(`./api/${operationFileName}.js`,
|
|
140
|
+
map.set(`./api/${operationFileName}.js`, lroOperations.map((o) => {
|
|
140
141
|
const { name } = getOperationName(o);
|
|
141
142
|
const deserName = `_${name}Deserialize`;
|
|
142
143
|
let renamedDeserName = undefined;
|
|
@@ -149,7 +150,7 @@ export function buildLroDeserDetailMap(client) {
|
|
|
149
150
|
}
|
|
150
151
|
existingNames.add(deserName);
|
|
151
152
|
return {
|
|
152
|
-
path: `${o.
|
|
153
|
+
path: `${o.operation.verb.toUpperCase()} ${o.operation.path}`,
|
|
153
154
|
expectedStatusesExpression: getExpectedStatuses(o),
|
|
154
155
|
deserName,
|
|
155
156
|
renamedDeserName
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildOperations.js","sourceRoot":"","sources":["../../../src/modular/buildOperations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildOperations.js","sourceRoot":"","sources":["../../../src/modular/buildOperations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,M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CAAC,CAAC,CAAC;gBAClD,SAAS;gBACT,gBAAgB;aACjB,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ModularEmitterOptions } from "./interfaces.js";
|
|
2
|
+
import { SdkContext } from "@azure-tools/typespec-client-generator-core";
|
|
3
|
+
export declare function getModuleExports(context: SdkContext, emitterOptions: ModularEmitterOptions): any;
|
|
3
4
|
//# sourceMappingURL=buildProjectFiles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildProjectFiles.d.ts","sourceRoot":"","sources":["../../../src/modular/buildProjectFiles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"buildProjectFiles.d.ts","sourceRoot":"","sources":["../../../src/modular/buildProjectFiles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AA8CzE,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,UAAU,EACnB,cAAc,EAAE,qBAAqB,OAatC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { NameType
|
|
1
|
+
import { NameType } from "@azure-tools/rlc-common";
|
|
2
2
|
import { getClassicalLayerPrefix } from "./helpers/namingHelpers.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { getModularClientOptions } from "../utils/clientUtils.js";
|
|
4
|
+
import { getMethodHierarchiesMap } from "../utils/operationUtil.js";
|
|
5
|
+
function buildExportsForMultiClient(context, emitterOptions, packageInfo) {
|
|
6
|
+
if (context.sdkPackage.clients.length > 1) {
|
|
5
7
|
delete packageInfo.exports["./api"];
|
|
6
8
|
delete packageInfo.exports["./models"];
|
|
7
|
-
for (const client of
|
|
8
|
-
const subfolder =
|
|
9
|
+
for (const client of context.sdkPackage.clients) {
|
|
10
|
+
const { subfolder } = getModularClientOptions(context, client);
|
|
9
11
|
packageInfo.exports[`./${subfolder}`] = `./src/${subfolder}/index.ts`;
|
|
10
12
|
packageInfo.exports[`./${subfolder}/api`] =
|
|
11
13
|
`./src/${subfolder}/api/index.ts`;
|
|
@@ -13,32 +15,32 @@ function buildExportsForMultiClient(codeModel, packageInfo) {
|
|
|
13
15
|
`./src/${subfolder}/models/index.ts`;
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
|
-
if (
|
|
17
|
-
for (const client of
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
if (emitterOptions.options.hierarchyClient) {
|
|
19
|
+
for (const client of context.sdkPackage.clients) {
|
|
20
|
+
const { subfolder } = getModularClientOptions(context, client);
|
|
21
|
+
const methodMap = getMethodHierarchiesMap(context, client);
|
|
22
|
+
for (const [prefixKey, _] of methodMap) {
|
|
23
|
+
const prefixes = prefixKey.split("/");
|
|
24
|
+
if (prefixKey === "") {
|
|
20
25
|
continue;
|
|
21
26
|
}
|
|
22
|
-
const
|
|
23
|
-
? normalizeName(client.name.replace("Client", ""), NameType.File)
|
|
24
|
-
: undefined;
|
|
25
|
-
const subApiPath = `api/${getClassicalLayerPrefix(operationGroup, NameType.File, "/")}`;
|
|
27
|
+
const subApiPath = `api/${getClassicalLayerPrefix(prefixes, NameType.File, "/")}`;
|
|
26
28
|
packageInfo.exports[`./${subfolder ? subfolder + "/" : ""}${subApiPath}`] = `src/${subfolder ? subfolder + "/" : ""}${subApiPath}/index.ts`;
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
return packageInfo.exports;
|
|
31
33
|
}
|
|
32
|
-
export function getModuleExports(
|
|
34
|
+
export function getModuleExports(context, emitterOptions) {
|
|
33
35
|
const exports = {
|
|
34
36
|
exports: {
|
|
35
37
|
".": "./src/index.ts",
|
|
36
38
|
"./models": "./src/models/index.ts"
|
|
37
39
|
}
|
|
38
40
|
};
|
|
39
|
-
if (!
|
|
41
|
+
if (!emitterOptions.options.azureArm) {
|
|
40
42
|
exports["exports"]["./api"] = "./src/api/index.ts";
|
|
41
43
|
}
|
|
42
|
-
return buildExportsForMultiClient(
|
|
44
|
+
return buildExportsForMultiClient(context, emitterOptions, exports);
|
|
43
45
|
}
|
|
44
46
|
//# sourceMappingURL=buildProjectFiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildProjectFiles.js","sourceRoot":"","sources":["../../../src/modular/buildProjectFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"buildProjectFiles.js","sourceRoot":"","sources":["../../../src/modular/buildProjectFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,SAAS,0BAA0B,CACjC,OAAmB,EACnB,cAAqC,EACrC,WAAgB;IAEhB,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACvC,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM,EAAE,SAAS,EAAE,GAAG,uBAAuB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC/D,WAAW,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC,GAAG,SAAS,SAAS,WAAW,CAAC;YAEtE,WAAW,CAAC,OAAO,CAAC,KAAK,SAA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IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,oBAAoB,CAAC;IACrD,CAAC;IAED,OAAO,0BAA0B,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ModularEmitterOptions } from "./interfaces.js";
|
|
2
|
+
import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
3
|
+
import { SdkContext } from "../utils/interfaces.js";
|
|
4
|
+
export declare function buildRestorePoller(context: SdkContext, client: SdkClientType<SdkServiceOperation>, emitterOptions: ModularEmitterOptions): void;
|
|
3
5
|
//# sourceMappingURL=buildRestorePoller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRestorePoller.d.ts","sourceRoot":"","sources":["../../../src/modular/buildRestorePoller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"buildRestorePoller.d.ts","sourceRoot":"","sources":["../../../src/modular/buildRestorePoller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAQxD,OAAO,EACL,aAAa,EACb,mBAAmB,EACpB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAC1C,cAAc,EAAE,qBAAqB,QAiMtC"}
|
|
@@ -4,28 +4,32 @@ import { buildLroDeserDetailMap } from "./buildOperations.js";
|
|
|
4
4
|
import { getClientName } from "./helpers/namingHelpers.js";
|
|
5
5
|
import { NameType, normalizeName } from "@azure-tools/rlc-common";
|
|
6
6
|
import { resolveReference } from "../framework/reference.js";
|
|
7
|
-
import {
|
|
7
|
+
import { AzurePollingDependencies } from "./external-dependencies.js";
|
|
8
8
|
import { PollingHelpers } from "./static-helpers-metadata.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import { getMethodHierarchiesMap } from "../utils/operationUtil.js";
|
|
10
|
+
import { getModularClientOptions } from "../utils/clientUtils.js";
|
|
11
|
+
import { useDependencies } from "../framework/hooks/useDependencies.js";
|
|
12
|
+
export function buildRestorePoller(context, client, emitterOptions) {
|
|
13
|
+
const dependencies = useDependencies();
|
|
14
|
+
const { subfolder } = getModularClientOptions(context, client);
|
|
15
|
+
const methodMap = getMethodHierarchiesMap(context, client);
|
|
16
|
+
const hasLro = Array.from(methodMap.values()).some((operations) => {
|
|
17
|
+
return operations.some(isLroOnlyOperation);
|
|
18
|
+
});
|
|
19
|
+
if (!hasLro) {
|
|
15
20
|
return;
|
|
16
21
|
}
|
|
17
|
-
const srcPath =
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const restorePollerFile = codeModel.project.createSourceFile(filePath, undefined, {
|
|
22
|
+
const srcPath = emitterOptions.modularOptions.sourceRoot;
|
|
23
|
+
const filePath = path.join(`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}restorePollerHelpers.ts`);
|
|
24
|
+
const restorePollerFile = emitterOptions.project.createSourceFile(filePath, undefined, {
|
|
21
25
|
overwrite: true
|
|
22
26
|
});
|
|
23
27
|
const clientNames = importClassicalClient(client, restorePollerFile);
|
|
24
|
-
const deserializeMap = importDeserializeHelpers(client, restorePollerFile);
|
|
25
|
-
const pathUncheckedReference = resolveReference(
|
|
28
|
+
const deserializeMap = importDeserializeHelpers(context, client, restorePollerFile);
|
|
29
|
+
const pathUncheckedReference = resolveReference(dependencies.PathUncheckedResponse);
|
|
26
30
|
const pollerLikeReference = resolveReference(AzurePollingDependencies.PollerLike);
|
|
27
31
|
const operationStateReference = resolveReference(AzurePollingDependencies.OperationState);
|
|
28
|
-
const operationOptionsReference = resolveReference(
|
|
32
|
+
const operationOptionsReference = resolveReference(dependencies.OperationOptions);
|
|
29
33
|
const deserializeStateReference = resolveReference(AzurePollingDependencies.DeserializeState);
|
|
30
34
|
const restorePollerHelperContent = `
|
|
31
35
|
export interface RestorePollerOptions<
|
|
@@ -37,7 +41,7 @@ export function buildRestorePoller(codeModel, client) {
|
|
|
37
41
|
/**
|
|
38
42
|
* The signal which can be used to abort requests.
|
|
39
43
|
*/
|
|
40
|
-
abortSignal?: ${resolveReference(
|
|
44
|
+
abortSignal?: ${resolveReference(dependencies.AbortSignalLike)};
|
|
41
45
|
/** Deserialization function for raw response body */
|
|
42
46
|
processResponseBody?: (result: TResponse) => Promise<TResult>;
|
|
43
47
|
}
|
|
@@ -175,8 +179,8 @@ export function buildRestorePoller(codeModel, client) {
|
|
|
175
179
|
`;
|
|
176
180
|
restorePollerFile.addStatements(restorePollerHelperContent);
|
|
177
181
|
}
|
|
178
|
-
function importDeserializeHelpers(client, sourceFile) {
|
|
179
|
-
const deserializeDetails = buildLroDeserDetailMap(client);
|
|
182
|
+
function importDeserializeHelpers(context, client, sourceFile) {
|
|
183
|
+
const deserializeDetails = buildLroDeserDetailMap(context, client);
|
|
180
184
|
const deserializeMap = [];
|
|
181
185
|
for (const [key, value] of deserializeDetails.entries()) {
|
|
182
186
|
sourceFile.addImportDeclaration({
|
|
@@ -193,7 +197,7 @@ function importDeserializeHelpers(client, sourceFile) {
|
|
|
193
197
|
return deserializeMap;
|
|
194
198
|
}
|
|
195
199
|
function importClassicalClient(client, sourceFile) {
|
|
196
|
-
const classicalClientName = `${getClientName(client
|
|
200
|
+
const classicalClientName = `${getClientName(client)}Client`;
|
|
197
201
|
sourceFile.addImportDeclaration({
|
|
198
202
|
namedImports: [`${classicalClientName}`],
|
|
199
203
|
moduleSpecifier: `./${normalizeName(classicalClientName, NameType.File)}.js`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRestorePoller.js","sourceRoot":"","sources":["../../../src/modular/buildRestorePoller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"buildRestorePoller.js","sourceRoot":"","sources":["../../../src/modular/buildRestorePoller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,MAAM,UAAU,kBAAkB,CAChC,OAAmB,EACnB,MAA0C,EAC1C,cAAqC;IAErC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,EAAE,SAAS,EAAE,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K,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;;YACvB,cAAc,CAAC,IAAI,CACjB,IAAI,MAAM,CAAC,IAAI,sBACb,MAAA,MAAM,CAAC,gBAAgB,mCAAI,MAAM,CAAC,SACpC,uBAAuB,MAAM,CAAC,0BAA0B,IAAI,CAC7D,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,SAAS,qBAAqB,CAC5B,MAA0C,EAC1C,UAAsB;IAEtB,MAAM,mBAAmB,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC7D,UAAU,CAAC,oBAAoB,CAAC;QAC9B,YAAY,EAAE,CAAC,GAAG,mBAAmB,EAAE,CAAC;QACxC,eAAe,EAAE,KAAK,aAAa,CAAC,mBAAmB,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;KAC7E,CAAC,CAAC;IACH,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SourceFile } from "ts-morph";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ModularEmitterOptions } from "./interfaces.js";
|
|
3
|
+
import { SdkClientType, SdkContext, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
4
|
+
export declare function buildRootIndex(context: SdkContext, client: SdkClientType<SdkServiceOperation>, emitterOptions: ModularEmitterOptions, rootIndexFile: SourceFile): void;
|
|
4
5
|
export interface ExportModulesOptions {
|
|
5
6
|
interfaceOnly?: boolean;
|
|
6
7
|
isTopLevel?: boolean;
|
|
7
8
|
subfolder?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare function buildSubClientIndexFile(
|
|
10
|
+
export declare function buildSubClientIndexFile(context: SdkContext, client: SdkClientType<SdkServiceOperation>, emitterOptions: ModularEmitterOptions): void;
|
|
10
11
|
//# sourceMappingURL=buildRootIndex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRootIndex.d.ts","sourceRoot":"","sources":["../../../src/modular/buildRootIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,UAAU,EAAE,MAAM,UAAU,CAAC;AAK/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"buildRootIndex.d.ts","sourceRoot":"","sources":["../../../src/modular/buildRootIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,UAAU,EAAE,MAAM,UAAU,CAAC;AAK/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,EACL,aAAa,EACb,UAAU,EACV,mBAAmB,EACpB,MAAM,6CAA6C,CAAC;AAIrD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAC1C,cAAc,EAAE,qBAAqB,EACrC,aAAa,EAAE,UAAU,QAoD1B;AAmHD,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAC1C,cAAc,EAAE,qBAAqB,QA8CtC"}
|