@azure-tools/typespec-ts 0.55.0-dev.7 → 0.55.0-dev.9

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.
Files changed (174) hide show
  1. package/README.md +1 -77
  2. package/dist/src/index.d.ts.map +1 -1
  3. package/dist/src/index.js +24 -80
  4. package/dist/src/index.js.map +1 -1
  5. package/dist/src/lib.d.ts +2 -12
  6. package/dist/src/lib.d.ts.map +1 -1
  7. package/dist/src/lib.js +0 -65
  8. package/dist/src/lib.js.map +1 -1
  9. package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +1 -1
  10. package/dist/src/rlc-common/helpers/name-constructors.js +1 -7
  11. package/dist/src/rlc-common/helpers/name-constructors.js.map +1 -1
  12. package/dist/src/rlc-common/index.d.ts +0 -16
  13. package/dist/src/rlc-common/index.d.ts.map +1 -1
  14. package/dist/src/rlc-common/index.js +0 -16
  15. package/dist/src/rlc-common/index.js.map +1 -1
  16. package/dist/src/rlc-common/interfaces.d.ts +0 -10
  17. package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
  18. package/dist/src/rlc-common/interfaces.js.map +1 -1
  19. package/dist/src/rlc-common/metadata/build-package-file.d.ts.map +1 -1
  20. package/dist/src/rlc-common/metadata/build-package-file.js +0 -12
  21. package/dist/src/rlc-common/metadata/build-package-file.js.map +1 -1
  22. package/dist/src/rlc-common/metadata/build-readme-file.d.ts.map +1 -1
  23. package/dist/src/rlc-common/metadata/build-readme-file.js +4 -89
  24. package/dist/src/rlc-common/metadata/build-readme-file.js.map +1 -1
  25. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts +0 -1
  26. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -1
  27. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js +2 -2
  28. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js.map +1 -1
  29. package/dist/src/rlc-common/metadata/package-json/package-common.d.ts +0 -1
  30. package/dist/src/rlc-common/metadata/package-json/package-common.d.ts.map +1 -1
  31. package/dist/src/rlc-common/metadata/package-json/package-common.js +1 -1
  32. package/dist/src/rlc-common/metadata/package-json/package-common.js.map +1 -1
  33. package/dist/src/rlc-common/test/build-snippets.d.ts.map +1 -1
  34. package/dist/src/rlc-common/test/build-snippets.js +0 -1
  35. package/dist/src/rlc-common/test/build-snippets.js.map +1 -1
  36. package/dist/src/rlc-common/test/template.d.ts +1 -1
  37. package/dist/src/rlc-common/test/template.d.ts.map +1 -1
  38. package/dist/src/rlc-common/test/template.js +0 -4
  39. package/dist/src/rlc-common/test/template.js.map +1 -1
  40. package/dist/src/transform/transform-schemas.js +1 -1
  41. package/dist/src/transform/transform-schemas.js.map +1 -1
  42. package/dist/src/transform/transform.d.ts.map +1 -1
  43. package/dist/src/transform/transform.js +5 -11
  44. package/dist/src/transform/transform.js.map +1 -1
  45. package/dist/src/transform/transfrom-rlc-options.d.ts +2 -2
  46. package/dist/src/transform/transfrom-rlc-options.d.ts.map +1 -1
  47. package/dist/src/transform/transfrom-rlc-options.js +19 -39
  48. package/dist/src/transform/transfrom-rlc-options.js.map +1 -1
  49. package/dist/src/utils/client-utils.d.ts +1 -1
  50. package/dist/src/utils/client-utils.d.ts.map +1 -1
  51. package/dist/src/utils/client-utils.js +4 -5
  52. package/dist/src/utils/client-utils.js.map +1 -1
  53. package/dist/src/utils/emit-util.d.ts +0 -1
  54. package/dist/src/utils/emit-util.d.ts.map +1 -1
  55. package/dist/src/utils/emit-util.js +0 -13
  56. package/dist/src/utils/emit-util.js.map +1 -1
  57. package/dist/src/utils/model-utils.d.ts +1 -1
  58. package/dist/src/utils/model-utils.d.ts.map +1 -1
  59. package/dist/src/utils/model-utils.js +4 -11
  60. package/dist/src/utils/model-utils.js.map +1 -1
  61. package/dist/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +9 -15
  63. package/src/index.ts +27 -105
  64. package/src/lib.ts +1 -77
  65. package/src/rlc-common/helpers/name-constructors.ts +1 -8
  66. package/src/rlc-common/index.ts +0 -16
  67. package/src/rlc-common/interfaces.ts +0 -11
  68. package/src/rlc-common/metadata/build-package-file.ts +0 -13
  69. package/src/rlc-common/metadata/build-readme-file.ts +4 -99
  70. package/src/rlc-common/metadata/package-json/build-azure-monorepo-package.ts +2 -3
  71. package/src/rlc-common/metadata/package-json/package-common.ts +1 -2
  72. package/src/rlc-common/test/build-snippets.ts +0 -1
  73. package/src/rlc-common/test/template.ts +0 -4
  74. package/src/transform/transform-schemas.ts +1 -1
  75. package/src/transform/transform.ts +4 -14
  76. package/src/transform/transfrom-rlc-options.ts +19 -63
  77. package/src/utils/client-utils.ts +4 -5
  78. package/src/utils/emit-util.ts +1 -14
  79. package/src/utils/model-utils.ts +4 -17
  80. package/dist/src/rlc-common/build-client-definitions.d.ts +0 -6
  81. package/dist/src/rlc-common/build-client-definitions.d.ts.map +0 -1
  82. package/dist/src/rlc-common/build-client-definitions.js +0 -157
  83. package/dist/src/rlc-common/build-client-definitions.js.map +0 -1
  84. package/dist/src/rlc-common/build-client.d.ts +0 -9
  85. package/dist/src/rlc-common/build-client.d.ts.map +0 -1
  86. package/dist/src/rlc-common/build-client.js +0 -375
  87. package/dist/src/rlc-common/build-client.js.map +0 -1
  88. package/dist/src/rlc-common/build-index-file.d.ts +0 -6
  89. package/dist/src/rlc-common/build-index-file.d.ts.map +0 -1
  90. package/dist/src/rlc-common/build-index-file.js +0 -180
  91. package/dist/src/rlc-common/build-index-file.js.map +0 -1
  92. package/dist/src/rlc-common/build-is-unexpected-helper.d.ts +0 -6
  93. package/dist/src/rlc-common/build-is-unexpected-helper.d.ts.map +0 -1
  94. package/dist/src/rlc-common/build-is-unexpected-helper.js +0 -219
  95. package/dist/src/rlc-common/build-is-unexpected-helper.js.map +0 -1
  96. package/dist/src/rlc-common/build-logger.d.ts +0 -6
  97. package/dist/src/rlc-common/build-logger.d.ts.map +0 -1
  98. package/dist/src/rlc-common/build-logger.js +0 -23
  99. package/dist/src/rlc-common/build-logger.js.map +0 -1
  100. package/dist/src/rlc-common/build-method-shortcuts.d.ts +0 -5
  101. package/dist/src/rlc-common/build-method-shortcuts.d.ts.map +0 -1
  102. package/dist/src/rlc-common/build-method-shortcuts.js +0 -54
  103. package/dist/src/rlc-common/build-method-shortcuts.js.map +0 -1
  104. package/dist/src/rlc-common/build-object-types.d.ts +0 -29
  105. package/dist/src/rlc-common/build-object-types.d.ts.map +0 -1
  106. package/dist/src/rlc-common/build-object-types.js +0 -410
  107. package/dist/src/rlc-common/build-object-types.js.map +0 -1
  108. package/dist/src/rlc-common/build-paginate-helper.d.ts +0 -6
  109. package/dist/src/rlc-common/build-paginate-helper.d.ts.map +0 -1
  110. package/dist/src/rlc-common/build-paginate-helper.js +0 -27
  111. package/dist/src/rlc-common/build-paginate-helper.js.map +0 -1
  112. package/dist/src/rlc-common/build-parameter-types.d.ts +0 -14
  113. package/dist/src/rlc-common/build-parameter-types.d.ts.map +0 -1
  114. package/dist/src/rlc-common/build-parameter-types.js +0 -338
  115. package/dist/src/rlc-common/build-parameter-types.js.map +0 -1
  116. package/dist/src/rlc-common/build-polling-helper.d.ts +0 -6
  117. package/dist/src/rlc-common/build-polling-helper.d.ts.map +0 -1
  118. package/dist/src/rlc-common/build-polling-helper.js +0 -59
  119. package/dist/src/rlc-common/build-polling-helper.js.map +0 -1
  120. package/dist/src/rlc-common/build-response-types.d.ts +0 -6
  121. package/dist/src/rlc-common/build-response-types.d.ts.map +0 -1
  122. package/dist/src/rlc-common/build-response-types.js +0 -140
  123. package/dist/src/rlc-common/build-response-types.js.map +0 -1
  124. package/dist/src/rlc-common/build-samples.d.ts +0 -3
  125. package/dist/src/rlc-common/build-samples.d.ts.map +0 -1
  126. package/dist/src/rlc-common/build-samples.js +0 -30
  127. package/dist/src/rlc-common/build-samples.js.map +0 -1
  128. package/dist/src/rlc-common/build-schema-type.d.ts +0 -20
  129. package/dist/src/rlc-common/build-schema-type.d.ts.map +0 -1
  130. package/dist/src/rlc-common/build-schema-type.js +0 -64
  131. package/dist/src/rlc-common/build-schema-type.js.map +0 -1
  132. package/dist/src/rlc-common/build-serialize-helper.d.ts +0 -6
  133. package/dist/src/rlc-common/build-serialize-helper.d.ts.map +0 -1
  134. package/dist/src/rlc-common/build-serialize-helper.js +0 -36
  135. package/dist/src/rlc-common/build-serialize-helper.js.map +0 -1
  136. package/dist/src/rlc-common/build-top-level-index-file.d.ts +0 -6
  137. package/dist/src/rlc-common/build-top-level-index-file.d.ts.map +0 -1
  138. package/dist/src/rlc-common/build-top-level-index-file.js +0 -44
  139. package/dist/src/rlc-common/build-top-level-index-file.js.map +0 -1
  140. package/dist/src/rlc-common/helpers/path-utils.d.ts +0 -2
  141. package/dist/src/rlc-common/helpers/path-utils.d.ts.map +0 -1
  142. package/dist/src/rlc-common/helpers/path-utils.js +0 -9
  143. package/dist/src/rlc-common/helpers/path-utils.js.map +0 -1
  144. package/dist/src/rlc-common/helpers/shortcut-methods.d.ts +0 -4
  145. package/dist/src/rlc-common/helpers/shortcut-methods.d.ts.map +0 -1
  146. package/dist/src/rlc-common/helpers/shortcut-methods.js +0 -49
  147. package/dist/src/rlc-common/helpers/shortcut-methods.js.map +0 -1
  148. package/dist/src/rlc-common/helpers/value-generation-util.d.ts +0 -12
  149. package/dist/src/rlc-common/helpers/value-generation-util.d.ts.map +0 -1
  150. package/dist/src/rlc-common/helpers/value-generation-util.js +0 -161
  151. package/dist/src/rlc-common/helpers/value-generation-util.js.map +0 -1
  152. package/dist/src/rlc-common/transform-sample-groups.d.ts +0 -9
  153. package/dist/src/rlc-common/transform-sample-groups.d.ts.map +0 -1
  154. package/dist/src/rlc-common/transform-sample-groups.js +0 -298
  155. package/dist/src/rlc-common/transform-sample-groups.js.map +0 -1
  156. package/src/rlc-common/build-client-definitions.ts +0 -226
  157. package/src/rlc-common/build-client.ts +0 -463
  158. package/src/rlc-common/build-index-file.ts +0 -220
  159. package/src/rlc-common/build-is-unexpected-helper.ts +0 -241
  160. package/src/rlc-common/build-logger.ts +0 -29
  161. package/src/rlc-common/build-method-shortcuts.ts +0 -71
  162. package/src/rlc-common/build-object-types.ts +0 -591
  163. package/src/rlc-common/build-paginate-helper.ts +0 -31
  164. package/src/rlc-common/build-parameter-types.ts +0 -460
  165. package/src/rlc-common/build-polling-helper.ts +0 -80
  166. package/src/rlc-common/build-response-types.ts +0 -170
  167. package/src/rlc-common/build-samples.ts +0 -32
  168. package/src/rlc-common/build-schema-type.ts +0 -79
  169. package/src/rlc-common/build-serialize-helper.ts +0 -49
  170. package/src/rlc-common/build-top-level-index-file.ts +0 -51
  171. package/src/rlc-common/helpers/path-utils.ts +0 -8
  172. package/src/rlc-common/helpers/shortcut-methods.ts +0 -58
  173. package/src/rlc-common/helpers/value-generation-util.ts +0 -234
  174. package/src/rlc-common/transform-sample-groups.ts +0 -383
@@ -6,7 +6,6 @@ import { getCommonPackageScripts, getPackageCommonInfo } from "./package-common.
6
6
 
7
7
  export interface AzureMonorepoInfoConfig extends AzurePackageInfoConfig {
8
8
  monorepoPackageDirectory?: string;
9
- clientFilePaths: string[];
10
9
  clientContextPaths?: string[];
11
10
  }
12
11
 
@@ -128,7 +127,7 @@ function getSampleMetadata({ name, version, withSamples }: AzureMonorepoInfoConf
128
127
 
129
128
  function getAzureMonorepoScripts(config: AzureMonorepoInfoConfig) {
130
129
  const esmScripts = getEsmScripts();
131
- const skipLinting = config.azureArm && config.isModularLibrary;
130
+ const skipLinting = config.azureArm;
132
131
  const buildSampleScripts = config.azureArm
133
132
  ? "tsc -p config/tsconfig.samples.json && dev-tool samples publish -f"
134
133
  : "tsc -p config/tsconfig.samples.json";
@@ -168,7 +167,7 @@ function getMetadataInfo(config: AzureMonorepoInfoConfig) {
168
167
  const metadata: Record<string, any> = {
169
168
  constantPaths: [],
170
169
  };
171
- const paths = config.isModularLibrary ? config.clientContextPaths : config.clientFilePaths;
170
+ const paths = config.clientContextPaths;
172
171
  for (const path of paths ?? []) {
173
172
  metadata["constantPaths"].push({
174
173
  path: path,
@@ -11,7 +11,6 @@ export interface PackageCommonInfoConfig {
11
11
  exports?: Record<string, any>;
12
12
  dependencies?: Record<string, string>;
13
13
  azureArm?: boolean;
14
- isModularLibrary?: boolean;
15
14
  /**
16
15
  * When true, generates React Native build targets (dist/react-native, exports condition).
17
16
  * Defaults to false.
@@ -30,7 +29,7 @@ export function getPackageCommonInfo(config: PackageCommonInfoConfig) {
30
29
  version,
31
30
  description,
32
31
  engines: {
33
- node: ">=20.0.0",
32
+ node: ">=22.0.0",
34
33
  },
35
34
  sideEffects: false,
36
35
  autoPublish: false,
@@ -17,7 +17,6 @@ export function buildSnippets(model: RLCModel, clientName?: string) {
17
17
  content: hbs.compile(snippetsContent, { noEscape: true })({
18
18
  clientClassName: clientName ? clientName : getClientName(model),
19
19
  azureArm: model.options?.azureArm,
20
- isModularLibrary: model.options.isModularLibrary,
21
20
  hasSubscriptionId: model.options.hasSubscriptionId,
22
21
  }),
23
22
  };
@@ -182,15 +182,12 @@ describe("My test", () => {
182
182
  `;
183
183
 
184
184
  export const snippetsContent = `
185
- {{#if isModularLibrary}}
186
185
  import { {{ clientClassName }} } from "../src/index.js";
187
186
  import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity";
188
- {{/if}}
189
187
  import { setLogLevel } from "@azure/logger";
190
188
  import { describe, it } from "vitest";
191
189
 
192
190
  describe("snippets", () => {
193
- {{#if isModularLibrary}}
194
191
  it("ReadmeSampleCreateClient_Node", async () => {
195
192
  {{#if azureArm}}
196
193
  {{#if hasSubscriptionId}}
@@ -224,7 +221,6 @@ describe("snippets", () => {
224
221
  const client = new {{ clientClassName }}("<endpoint>", credential);
225
222
  {{/if}}
226
223
  });
227
- {{/if}}
228
224
 
229
225
  it("SetLogLevel", async () => {
230
226
  setLogLevel("info");
@@ -78,7 +78,7 @@ export function transformSchemas(client: SdkClient, dpgContext: SdkContext) {
78
78
  }
79
79
  }
80
80
  function transformHostParameters() {
81
- const serviceNs = getDefaultService(program, dpgContext.rlcOptions?.isModularLibrary)?.type;
81
+ const serviceNs = getDefaultService(program)?.type;
82
82
  if (serviceNs) {
83
83
  const host = getServers(program, serviceNs);
84
84
  if (host && host?.[0] && host?.[0]?.parameters) {
@@ -18,7 +18,6 @@ import {
18
18
  RLCOptions,
19
19
  Schema,
20
20
  SchemaContext,
21
- transformSampleGroups,
22
21
  UrlInfo,
23
22
  } from "../rlc-common/index.js";
24
23
  import { SdkContext } from "../utils/interfaces.js";
@@ -53,12 +52,7 @@ export async function transformRLCModel(
53
52
  : "",
54
53
  );
55
54
  const libraryName = normalizeName(
56
- options.batch && (options.isModularLibrary || options.batch.length > 1)
57
- ? client.name
58
- : (options?.title ??
59
- client.name ??
60
- getDefaultService(program, options.isModularLibrary)?.title ??
61
- ""),
55
+ options.batch ? client.name : (client.name ?? getDefaultService(program)?.title ?? ""),
62
56
  NameType.Class,
63
57
  );
64
58
  const importSet = initInternalImports();
@@ -95,13 +89,9 @@ export async function transformRLCModel(
95
89
  },
96
90
  rlcSourceDir,
97
91
  };
98
- model.sampleGroups = transformSampleGroups(
99
- model,
100
- options?.generateSample === true /* Enable mock sample content if generateSample === true */,
101
- );
102
- options.generateSample =
103
- (options.generateSample === true || options.generateSample === undefined) &&
104
- (model.sampleGroups ?? []).length > 0;
92
+ // RLC sample generation has been removed; modular samples are emitted separately,
93
+ // so the RLC model never carries sample groups.
94
+ options.generateSample = false;
105
95
  return model;
106
96
  }
107
97
 
@@ -28,7 +28,7 @@ export function transformRLCOptions(
28
28
  emitterOptions,
29
29
  dpgContext.generationPathDetail?.rootDir ?? "",
30
30
  );
31
- const batch = getRLCClients(dpgContext, options.isModularLibrary);
31
+ const batch = getRLCClients(dpgContext);
32
32
  options.batch = batch;
33
33
  return options;
34
34
  }
@@ -38,30 +38,19 @@ function extractRLCOptions(
38
38
  generationRootDir: string,
39
39
  ): RLCOptions {
40
40
  const program = dpgContext.program;
41
- // Compute isModularLibrary early - defaults to true unless explicitly set to false
42
- const isModularLibrary = emitterOptions["is-modular-library"] !== false;
43
- const includeShortcuts = getIncludeShortcuts(emitterOptions);
44
- const packageDetails = getPackageDetails(program, emitterOptions, isModularLibrary);
45
- const serviceInfo = getServiceInfo(program, isModularLibrary);
41
+ const packageDetails = getPackageDetails(program, emitterOptions);
42
+ const serviceInfo = getServiceInfo(program);
46
43
  const includeHeadersInResponse = emitterOptions["include-headers-in-response"] === true;
47
44
  const generateMetadata = getGenerateMetadata(emitterOptions);
48
45
  const generateTest = getGenerateTest(emitterOptions);
49
46
  const generateSample = getGenerateSample(dpgContext, emitterOptions);
50
- const credentialInfo = getCredentialInfo(program, emitterOptions, isModularLibrary);
47
+ const credentialInfo = getCredentialInfo(program, emitterOptions);
51
48
  const azureOutputDirectory = getAzureOutputDirectory(generationRootDir);
52
- const enableOperationGroup = getEnableOperationGroup(
53
- dpgContext,
54
- emitterOptions,
55
- isModularLibrary,
56
- );
49
+ const enableOperationGroup = getEnableOperationGroup(dpgContext, emitterOptions);
57
50
  const enableModelNamespace = getEnableModelNamespace(dpgContext, emitterOptions);
58
51
  const hierarchyClient = getHierarchyClient(emitterOptions);
59
52
  const clearOutputFolder = getClearOutputFolder(emitterOptions);
60
- const multiClient = emitterOptions["multi-client"];
61
53
  const isTypeSpecTest = emitterOptions["is-typespec-test"];
62
- const title = emitterOptions.title;
63
- const dependencyInfo = emitterOptions["dependency-info"];
64
- const productDocLink = emitterOptions["product-doc-link"];
65
54
  const compatibilityMode = emitterOptions["compatibility-mode"];
66
55
  const compatibilityLro = emitterOptions["compatibility-lro"];
67
56
  const experimentalExtensibleEnums = emitterOptions["experimental-extensible-enums"];
@@ -80,7 +69,6 @@ function extractRLCOptions(
80
69
  return {
81
70
  ...credentialInfo,
82
71
  includeHeadersInResponse,
83
- includeShortcuts,
84
72
  packageDetails,
85
73
  generateMetadata,
86
74
  generateTest,
@@ -92,12 +80,7 @@ function extractRLCOptions(
92
80
  hierarchyClient,
93
81
  azureArm: dpgContext.arm,
94
82
  clearOutputFolder,
95
- multiClient,
96
83
  isTypeSpecTest,
97
- title,
98
- dependencyInfo,
99
- productDocLink,
100
- isModularLibrary,
101
84
  compatibilityMode,
102
85
  compatibilityLro,
103
86
  experimentalExtensibleEnums,
@@ -115,8 +98,8 @@ function extractRLCOptions(
115
98
  };
116
99
  }
117
100
 
118
- function processAuth(program: Program, isModularLibrary: boolean) {
119
- const serviceNs = getDefaultService(program, isModularLibrary)?.type;
101
+ function processAuth(program: Program) {
102
+ const serviceNs = getDefaultService(program)?.type;
120
103
  if (!serviceNs) {
121
104
  return undefined;
122
105
  }
@@ -181,11 +164,7 @@ function processAuth(program: Program, isModularLibrary: boolean) {
181
164
  return securityInfo;
182
165
  }
183
166
 
184
- function getEnableOperationGroup(
185
- dpgContext: SdkContext,
186
- emitterOptions: EmitterOptions,
187
- isModularLibrary: boolean,
188
- ) {
167
+ function getEnableOperationGroup(dpgContext: SdkContext, emitterOptions: EmitterOptions) {
189
168
  if (
190
169
  emitterOptions["enable-operation-group"] === true ||
191
170
  emitterOptions["enable-operation-group"] === false
@@ -193,7 +172,7 @@ function getEnableOperationGroup(
193
172
  return emitterOptions["enable-operation-group"];
194
173
  }
195
174
  // Only detect if existing name conflicts if customers don't set hierarchyClient to true
196
- return detectIfNameConflicts(dpgContext, isModularLibrary);
175
+ return detectIfNameConflicts(dpgContext);
197
176
  }
198
177
 
199
178
  function getEnableModelNamespace(dpgContext: SdkContext, emitterOptions: EmitterOptions) {
@@ -219,8 +198,8 @@ function getClearOutputFolder(emitterOptions: EmitterOptions) {
219
198
  return emitterOptions["clear-output-folder"] ? true : false;
220
199
  }
221
200
 
222
- function detectIfNameConflicts(dpgContext: SdkContext, isModularLibrary: boolean) {
223
- const clients = getRLCClients(dpgContext, isModularLibrary);
201
+ function detectIfNameConflicts(dpgContext: SdkContext) {
202
+ const clients = getRLCClients(dpgContext);
224
203
  for (const client of clients) {
225
204
  // only consider it's conflict when there are conflicts in the same client
226
205
  const nameSet = new Set<string>();
@@ -257,15 +236,7 @@ function getWrapNonModelReturn(emitterOptions: EmitterOptions): boolean {
257
236
  return true;
258
237
  }
259
238
 
260
- function getIncludeShortcuts(emitterOptions: EmitterOptions) {
261
- return Boolean(emitterOptions["include-shortcuts"]);
262
- }
263
-
264
- function buildPackageDetails(
265
- program: Program,
266
- emitterOptions: EmitterOptions,
267
- isModularLibrary: boolean,
268
- ): PackageDetails {
239
+ function buildPackageDetails(program: Program, emitterOptions: EmitterOptions): PackageDetails {
269
240
  const defaultDetail = {
270
241
  name: "@msinternal/unamedpackage",
271
242
  nameWithoutScope: "unamedpackage",
@@ -276,10 +247,7 @@ function buildPackageDetails(
276
247
  ...emitterOptions["package-details"],
277
248
  name:
278
249
  emitterOptions["package-details"]?.name ??
279
- normalizeName(
280
- emitterOptions?.title ?? getDefaultService(program, isModularLibrary)?.title ?? "",
281
- NameType.Class,
282
- ),
250
+ normalizeName(getDefaultService(program)?.title ?? "", NameType.Class),
283
251
  version: emitterOptions["package-details"]?.version ?? "1.0.0-beta.1",
284
252
  isVersionUserProvided,
285
253
  };
@@ -293,16 +261,12 @@ function buildPackageDetails(
293
261
  return packageDetails ?? defaultDetail;
294
262
  }
295
263
 
296
- function getPackageDetails(
297
- program: Program,
298
- emitterOptions: EmitterOptions,
299
- isModularLibrary: boolean,
300
- ): PackageDetails {
301
- return buildPackageDetails(program, emitterOptions, isModularLibrary);
264
+ function getPackageDetails(program: Program, emitterOptions: EmitterOptions): PackageDetails {
265
+ return buildPackageDetails(program, emitterOptions);
302
266
  }
303
267
 
304
- function getServiceInfo(program: Program, isModularLibrary: boolean): ServiceInfo {
305
- const defaultService = getDefaultService(program, isModularLibrary);
268
+ function getServiceInfo(program: Program): ServiceInfo {
269
+ const defaultService = getDefaultService(program);
306
270
  return {
307
271
  title: defaultService?.title,
308
272
  description: defaultService && getDoc(program, defaultService.type),
@@ -346,12 +310,8 @@ function getGenerateSample(dpgContext: SdkContext, emitterOptions: EmitterOption
346
310
  return Boolean(emitterOptions["generate-sample"]);
347
311
  }
348
312
 
349
- export function getCredentialInfo(
350
- program: Program,
351
- emitterOptions: EmitterOptions,
352
- isModularLibrary: boolean = true,
353
- ) {
354
- const securityInfo = processAuth(program, isModularLibrary);
313
+ export function getCredentialInfo(program: Program, emitterOptions: EmitterOptions) {
314
+ const securityInfo = processAuth(program);
355
315
  const addCredentials =
356
316
  emitterOptions["add-credentials"] === false
357
317
  ? false
@@ -390,10 +350,6 @@ function getAzureOutputDirectory(emitterOutputDir: string): string | undefined {
390
350
  }
391
351
 
392
352
  export function getSubscriptionId(dpgContext: SdkContext) {
393
- //TODO Need consider multi-client cases, skip multi-client cases check for now
394
- if (dpgContext.rlcOptions?.multiClient) {
395
- return;
396
- }
397
353
  for (const client of dpgContext.sdkPackage.clients) {
398
354
  if (
399
355
  getClientParameters(client, dpgContext)
@@ -18,14 +18,13 @@ import { ModularClientOptions } from "../modular/interfaces.js";
18
18
  import { NameType, normalizeName } from "../rlc-common/index.js";
19
19
  import { SdkContext } from "./interfaces.js";
20
20
 
21
- export function getRLCClients(dpgContext: SdkContext, isModularLibrary?: boolean): SdkClient[] {
22
- const modular = isModularLibrary ?? dpgContext.rlcOptions?.isModularLibrary ?? false;
21
+ export function getRLCClients(dpgContext: SdkContext): SdkClient[] {
23
22
  const clients = listClients(dpgContext);
24
23
  const rawServiceNamespaces =
25
24
  dpgContext.allServiceNamespaces ?? listAllServiceNamespaces(dpgContext);
26
25
 
27
- // For one client in Modular: Return the client from listClients with multi-service support
28
- if (modular && clients.length === 1) {
26
+ // For one client: Return the client from listClients with multi-service support
27
+ if (clients.length === 1) {
29
28
  return clients.map((client) => {
30
29
  const services = client.services;
31
30
  return {
@@ -35,7 +34,7 @@ export function getRLCClients(dpgContext: SdkContext, isModularLibrary?: boolean
35
34
  };
36
35
  });
37
36
  } else {
38
- // For RLC and multiple clients in Modular:
37
+ // For multiple clients:
39
38
  // Flatten all services and return one client per service
40
39
  const services = new Set<Namespace>();
41
40
  clients.forEach((c) => {
@@ -4,20 +4,7 @@ import prettierPluginBabel from "prettier/plugins/babel";
4
4
  import prettierPluginEstree from "prettier/plugins/estree";
5
5
  import prettierPluginTypescript from "prettier/plugins/typescript";
6
6
  import { prettierJSONOptions, prettierTypeScriptOptions, reportDiagnostic } from "../lib.js";
7
- import { buildSchemaTypes, ContentBuilder, File, RLCModel } from "../rlc-common/index.js";
8
-
9
- export async function emitModels(rlcModels: RLCModel, program: Program) {
10
- const schemaOutput = buildSchemaTypes(rlcModels);
11
- if (schemaOutput) {
12
- const { inputModelFile, outputModelFile } = schemaOutput;
13
- if (inputModelFile) {
14
- await emitFile(inputModelFile, program);
15
- }
16
- if (outputModelFile) {
17
- await emitFile(outputModelFile, program);
18
- }
19
- }
20
- }
7
+ import { ContentBuilder, File, RLCModel } from "../rlc-common/index.js";
21
8
 
22
9
  export async function emitContentByBuilder(
23
10
  program: Program,
@@ -1492,10 +1492,7 @@ export function predictDefaultValue(dpgContext: SdkContext, param?: ModelPropert
1492
1492
  }
1493
1493
  return specificDefault;
1494
1494
  }
1495
- const serviceNamespace = getDefaultService(
1496
- program,
1497
- dpgContext.rlcOptions?.isModularLibrary,
1498
- )?.type;
1495
+ const serviceNamespace = getDefaultService(program)?.type;
1499
1496
  if (!serviceNamespace) {
1500
1497
  return;
1501
1498
  }
@@ -1506,10 +1503,7 @@ export function predictDefaultValue(dpgContext: SdkContext, param?: ModelPropert
1506
1503
  return;
1507
1504
  }
1508
1505
 
1509
- export function getDefaultService(
1510
- program: Program,
1511
- isModularLibrary: boolean = true,
1512
- ): Service | undefined {
1506
+ export function getDefaultService(program: Program): Service | undefined {
1513
1507
  const services = listServices(program);
1514
1508
  if (!services || services.length === 0) {
1515
1509
  reportDiagnostic(program, {
@@ -1517,12 +1511,6 @@ export function getDefaultService(
1517
1511
  target: NoTarget,
1518
1512
  });
1519
1513
  }
1520
- if (services.length > 1 && !isModularLibrary) {
1521
- reportDiagnostic(program, {
1522
- code: "more-than-one-service",
1523
- target: NoTarget,
1524
- });
1525
- }
1526
1514
  return services[0];
1527
1515
  }
1528
1516
  /**
@@ -1530,9 +1518,8 @@ export function getDefaultService(
1530
1518
  */
1531
1519
  export function getDefaultApiVersionString(dpgContext: SdkContext): string | undefined {
1532
1520
  const program = dpgContext.program;
1533
- const isModularLibrary = dpgContext.rlcOptions?.isModularLibrary;
1534
- return getDefaultService(program, isModularLibrary)
1535
- ? getDefaultApiVersion(dpgContext, getDefaultService(program, isModularLibrary)!.type)?.value
1521
+ return getDefaultService(program)
1522
+ ? getDefaultApiVersion(dpgContext, getDefaultService(program)!.type)?.value
1536
1523
  : undefined;
1537
1524
  }
1538
1525
 
@@ -1,6 +0,0 @@
1
- import { RLCModel } from "./interfaces.js";
2
- export declare function buildClientDefinitions(model: RLCModel): {
3
- path: string;
4
- content: string;
5
- };
6
- //# sourceMappingURL=build-client-definitions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-client-definitions.d.ts","sourceRoot":"","sources":["../../../src/rlc-common/build-client-definitions.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAuB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,QAAQ;;;EA0FrD"}
@@ -1,157 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { joinPaths } from "@typespec/compiler";
4
- import { Project, StructureKind, Writers, } from "ts-morph";
5
- import { REST_CLIENT_RESERVED } from "./build-method-shortcuts.js";
6
- import { getImportSpecifier } from "./helpers/imports-util.js";
7
- import { getClientName } from "./helpers/name-constructors.js";
8
- import { CasingConvention, NameType, normalizeName, pascalCase } from "./helpers/name-utils.js";
9
- import { buildMethodDefinitions, getGeneratedWrapperTypes, getPathParamDefinitions, } from "./helpers/operation-helpers.js";
10
- import { generateMethodShortcuts } from "./helpers/shortcut-methods.js";
11
- export function buildClientDefinitions(model) {
12
- const options = {
13
- importedParameters: new Set(),
14
- importedResponses: new Set(),
15
- clientImports: new Set(),
16
- };
17
- const project = new Project({ useInMemoryFileSystem: true });
18
- const srcPath = model.srcPath;
19
- const filePath = joinPaths(srcPath, `clientDefinitions.ts`);
20
- const clientDefinitionsFile = project.createSourceFile(filePath, undefined, {
21
- overwrite: true,
22
- });
23
- // Get all paths
24
- const pathDictionary = model.paths;
25
- let shortcuts = [];
26
- // There may be operations without an operation group, those shortcut
27
- // methods need to be handled differently.
28
- let shortcutsInOperationGroup = [];
29
- if (model.options?.includeShortcuts) {
30
- shortcuts = generateMethodShortcuts(model.paths);
31
- clientDefinitionsFile.addInterfaces(shortcuts);
32
- shortcutsInOperationGroup = shortcuts
33
- .filter((s) => s.name !== "ClientOperations")
34
- .map((s) => getShortcutName(s.name));
35
- }
36
- clientDefinitionsFile.addInterface({
37
- name: "Routes",
38
- isExported: true,
39
- callSignatures: getPathFirstRoutesInterfaceDefinition(pathDictionary, clientDefinitionsFile, options),
40
- });
41
- const clientInterfaceName = getClientName(model);
42
- clientDefinitionsFile.addTypeAlias({
43
- isExported: true,
44
- name: clientInterfaceName,
45
- type: Writers.intersectionType("Client", Writers.objectType({
46
- properties: [{ name: "path", type: "Routes" }, ...shortcutsInOperationGroup],
47
- }),
48
- // If the length of shortcuts in operation group and all shortcutsInOperationGroup
49
- // is the same, then we don't have any operations at the client level
50
- // Otherwise we need to make the client interface name an union with the
51
- // definition of all client level shortcut methods
52
- ...(shortcutsInOperationGroup.length !== shortcuts.length ? [`ClientOperations`] : [])),
53
- });
54
- if (options.importedParameters.size) {
55
- clientDefinitionsFile.addImportDeclaration({
56
- isTypeOnly: true,
57
- namedImports: [...options.importedParameters],
58
- moduleSpecifier: "./parameters.js",
59
- });
60
- }
61
- if (options.importedResponses.size) {
62
- clientDefinitionsFile.addImportDeclaration({
63
- isTypeOnly: true,
64
- namedImports: [...options.importedResponses],
65
- moduleSpecifier: "./responses.js",
66
- });
67
- }
68
- if ((model.importInfo.internalImports.rlcClientDefinition.importsSet?.size ?? 0) > 0) {
69
- clientDefinitionsFile.addImportDeclaration({
70
- isTypeOnly: true,
71
- namedImports: Array.from(model.importInfo.internalImports.rlcClientDefinition.importsSet),
72
- moduleSpecifier: "./models.js",
73
- });
74
- }
75
- options.clientImports.add("Client");
76
- options.clientImports.add("StreamableMethod");
77
- clientDefinitionsFile.addImportDeclarations([
78
- {
79
- isTypeOnly: true,
80
- namedImports: [...options.clientImports],
81
- moduleSpecifier: getImportSpecifier("restClient", model.importInfo.runtimeImports),
82
- },
83
- ]);
84
- return { path: filePath, content: clientDefinitionsFile.getFullText() };
85
- }
86
- function getPathFirstRoutesInterfaceDefinition(paths, sourcefile, options) {
87
- const operationGroupCount = getOperationGroupCount(paths);
88
- const signatures = [];
89
- for (const key of Object.keys(paths)) {
90
- const pathMetadata = paths[key];
91
- if (!pathMetadata) {
92
- continue;
93
- }
94
- for (const verb of Object.keys(pathMetadata.methods)) {
95
- const methods = pathMetadata.methods[verb];
96
- if (!methods) {
97
- continue;
98
- }
99
- for (const method of methods) {
100
- options.importedParameters.add(method.optionsName);
101
- method.returnType.split(" | ").forEach((item) => options.importedResponses.add(item));
102
- }
103
- }
104
- generatePathFirstRouteMethodsDefinition(pathMetadata, operationGroupCount, sourcefile);
105
- const pathParams = pathMetadata.pathParameters;
106
- getGeneratedWrapperTypes(pathParams).forEach((p) => options.importedParameters.add(p.name ?? p.type));
107
- signatures.push({
108
- docs: [
109
- `Resource for '${key
110
- .replace(/\\/g, "\\\\")
111
- .replace(/}/g, "\\}")
112
- .replace(/{/g, "\\{")}' has methods for the following verbs: ${Object.keys(pathMetadata.methods).join(", ")}`,
113
- ],
114
- parameters: [{ name: "path", type: `"${key}"` }, ...getPathParamDefinitions(pathParams)],
115
- returnType: getOperationReturnTypeName(pathMetadata, getOperationGroupCount(paths)),
116
- kind: StructureKind.CallSignature,
117
- });
118
- }
119
- return signatures;
120
- }
121
- function getOperationGroupCount(paths) {
122
- const operationGroups = Object.keys(paths)
123
- .map((p) => paths[p]?.operationGroupName)
124
- .filter((p) => p && p !== "Client");
125
- const uniqueNames = new Set(operationGroups);
126
- return uniqueNames.size;
127
- }
128
- function getOperationReturnTypeName({ operationGroupName, name }, operationGroupCount) {
129
- if (operationGroupCount > 1 && operationGroupName && operationGroupName !== "Client") {
130
- return normalizeName(`${pascalCase(operationGroupName)}${pascalCase(name)}`, NameType.Interface);
131
- }
132
- return pascalCase(name);
133
- }
134
- function generatePathFirstRouteMethodsDefinition(path, operationGroupCount, file) {
135
- const methodDefinitions = buildMethodDefinitions(path.methods);
136
- const interfaceDef = {
137
- methods: methodDefinitions,
138
- name: getOperationReturnTypeName(path, operationGroupCount),
139
- isExported: true,
140
- };
141
- file.addInterface(interfaceDef);
142
- }
143
- function getShortcutName(interfaceName) {
144
- const endIndex = shouldKeepSuffix(interfaceName)
145
- ? undefined
146
- : interfaceName.length - "Operations".length;
147
- const clientProperty = normalizeName(interfaceName.substring(0, endIndex), NameType.OperationGroup, true, REST_CLIENT_RESERVED, CasingConvention.Camel);
148
- return {
149
- name: clientProperty,
150
- type: interfaceName,
151
- };
152
- }
153
- function shouldKeepSuffix(name) {
154
- const reservedNames = ["pipelineOperations", "pathOperations", "pathUncheckedOperations"];
155
- return reservedNames.some((r) => r.toLowerCase() === name.toLowerCase());
156
- }
157
- //# sourceMappingURL=build-client-definitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-client-definitions.js","sourceRoot":"","sources":["../../../src/rlc-common/build-client-definitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAIL,OAAO,EAEP,aAAa,EACb,OAAO,GACR,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,E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,MAAM,QAAQ,GAAG,gBAAgB,CAAC,aAAa,CAAC;QAC9C,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,aAAa,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IAC/C,MAAM,cAAc,GAAG,aAAa,CAClC,aAAa,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,EACpC,QAAQ,CAAC,cAAc,EACvB,IAAI,EACJ,oBAAoB,EACpB,gBAAgB,CAAC,KAAK,CACvB,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,aAAa;KACpB,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,aAAa,GAAG,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,yBAAyB,CAAC,CAAC;IAC1F,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AAC3E,CAAC"}
@@ -1,9 +0,0 @@
1
- import { StatementStructures, WriterFunction } from "ts-morph";
2
- import { File, RLCModel } from "./interfaces.js";
3
- export declare function buildClient(model: RLCModel): File | undefined;
4
- interface GetClientFactoryOptions {
5
- isMultipleCredential: boolean;
6
- }
7
- export declare function getClientFactoryBody(model: RLCModel, clientTypeName: string, options?: GetClientFactoryOptions): string | WriterFunction | (string | WriterFunction | StatementStructures)[];
8
- export {};
9
- //# sourceMappingURL=build-client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-client.d.ts","sourceRoot":"","sources":["../../../src/rlc-common/build-client.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,mBAAmB,EAInB,cAAc,EACf,MAAM,UAAU,CAAC;AAKlB,OAAO,EAAE,IAAI,EAAiB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AA0ChE,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,CAsL7D;AAUD,UAAU,uBAAuB;IAC/B,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,QAAQ,EACf,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,uBAAyD,GACjE,MAAM,GAAG,cAAc,GAAG,CAAC,MAAM,GAAG,cAAc,GAAG,mBAAmB,CAAC,EAAE,CAkL7E"}