Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core
Submodule core updated 54 files
+5 −4 .github/skills/csharp-spector-coverage-gaps/SKILL.md
+1 −0 AGENTS.md
+2 −1 eng/common/scripts/labels/policy.ts
+7 −0 eng/tsp-core/pipelines/jobs/build-packages.yml
+1 −1 package.json
+1 −3 packages/asset-emitter/src/builders/object-builder.ts
+1 −7 packages/asset-emitter/src/types.ts
+4 −4 packages/compiler/src/core/checker.ts
+1 −2 packages/compiler/src/core/name-resolver.ts
+1 −3 packages/compiler/src/core/scanner.ts
+3 −16 packages/compiler/src/core/types.ts
+1 −3 packages/compiler/src/experimental/mutators.ts
+1 −3 packages/compiler/src/server/serverlib.ts
+2 −6 packages/compiler/src/server/tmlanguage.ts
+9 −3 packages/compiler/src/testing/test-server-host.ts
+1 −2 packages/emitter-framework/src/python/components/class-declaration/class-method.tsx
+1 −2 packages/emitter-framework/src/python/components/class-declaration/pydantic-class-declaration.tsx
+1 −2 packages/emitter-framework/src/python/components/function-declaration/function-declaration.tsx
+1 −0 packages/emitter-framework/src/testing/index.ts
+1 −2 packages/emitter-framework/src/typescript/components/function-declaration.tsx
+1 −2 packages/emitter-framework/src/typescript/components/interface-declaration.tsx
+2 −8 packages/html-program-viewer/src/react/type-config.ts
+2 −0 packages/http-canonicalization/package.json
+4 −9 packages/http-canonicalization/src/operation.ts
+1 −7 packages/http-canonicalization/src/options.ts
+1 −2 packages/http-client-csharp/emitter/src/lib/type-converter.ts
+1 −4 packages/http-client-csharp/emitter/src/type/input-type.ts
+1 −2 packages/http-client-csharp/emitter/test/Unit/client-initialization.test.ts
+1 −0 packages/http-client-js/src/testing/index.ts
+1 −3 packages/http-client-js/test/e2e/http/payload/multipart/main.test.ts
+1 −0 packages/http-client/src/testing/index.ts
+1 −2 packages/http-server-js/src/util/differentiate.ts
+2 −2 packages/http-specs/spec-summary.md
+6 −10 packages/http/src/private.decorators.ts
+3 −9 packages/http/src/types.ts
+1 −5 packages/openapi3/src/cli/actions/convert/interfaces.ts
+3 −17 packages/openapi3/src/types.ts
+4 −3 packages/playground/src/services.ts
+2 −7 packages/protobuf/src/ast.ts
+10 −21 packages/protobuf/src/transform/index.ts
+1 −7 packages/rest/src/rest.ts
+1 −3 packages/tmlanguage-generator/src/tmlanguage-generator.ts
+1 −2 packages/tsp-integration/src/find-packages.ts
+16 −18 packages/tspd/src/gen-extern-signatures/components/decorator-signature-type.tsx
+16 −18 packages/tspd/src/gen-extern-signatures/components/function-signature-type.tsx
+2 −1 packages/tspd/src/ref-doc/api-docs.ts
+2 −2 packages/typespec-vscode/ThirdPartyNotices.txt
+2 −2 packages/typespec-vscode/src/typespec-utils.ts
+2 −2 packages/versioning/test/versioning-timeline.test.ts
+2,900 −3,737 pnpm-lock.yaml
+35 −12 pnpm-workspace.yaml
+15 −15 website/src/content/docs/docs/emitters/protobuf/reference/data-types.md
+3 −3 website/src/content/docs/docs/handbook/configuration/configuration.mdx
+1 −1 website/src/content/docs/docs/libraries/rest/reference/data-types.md
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"type": "module",
"packageManager": "pnpm@10.30.2",
"packageManager": "pnpm@11.10.0",
"scripts": {
"run-all": "turbo --filter=!@typespec/monorepo",
"run-azure-only": "turbo --filter=!{./core/**}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ export type JsonSchema = {
export type ResolvedJsonSchemaType = Exclude<JsonSchemaType, JsonSchemaRef>;

export type JsonSchemaType =
| JsonSchemaObject
| JsonSchemaArray
| JsonSchemaPrimitive
| JsonSchemaRef;
JsonSchemaObject | JsonSchemaArray | JsonSchemaPrimitive | JsonSchemaRef;

export interface JsonSchemaBase {
$id?: string;
Expand Down
3 changes: 1 addition & 2 deletions packages/typespec-autorest/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import type {
* a particular service definition.
*/
export type AutorestServiceRecord =
| AutorestUnversionedServiceRecord
| AutorestVersionedServiceRecord;
AutorestUnversionedServiceRecord | AutorestVersionedServiceRecord;

export interface AutorestUnversionedServiceRecord extends AutorestEmitterResult {
/** The service that generated this OpenAPI document */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ export interface ArmResourceIdentifierConfig {
}

export type ArmResourceDeploymentScope =
| "Tenant"
| "Subscription"
| "ResourceGroup"
| "ManagementGroup"
| "ServiceGroup"
| "Extension";
"Tenant" | "Subscription" | "ResourceGroup" | "ManagementGroup" | "ServiceGroup" | "Extension";

export interface ArmResourceIdentifierAllowedResource {
/** The type of resource that is being referred to. For example Microsoft.Network/virtualNetworks or Microsoft.Network/virtualNetworks/subnets. See Example Types for more examples. */
Expand Down
10 changes: 3 additions & 7 deletions packages/typespec-azure-core/src/lro-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,7 @@ export interface NextOperationReference extends LogicalOperationStep {
* getting to a success result
*/
export type FinalOperationStep =
| FinalOperationLink
| FinalOperationReference
| PollingSuccessProperty
| NoPollingSuccessProperty;
FinalOperationLink | FinalOperationReference | PollingSuccessProperty | NoPollingSuccessProperty;

/**
* For long-running operations, the resource link to the final result
Expand Down Expand Up @@ -296,9 +293,8 @@ export function getLroMetadata(program: Program, operation: Operation): LroMetad
processFinalReference(program, operation, context);
processFinalLink(program, operation, context);
const nextReference:
| NextOperationReference
| (NextOperationLink & { operation: Operation })
| undefined = processStatusMonitorReference(program, operation, context);
NextOperationReference | (NextOperationLink & { operation: Operation }) | undefined =
processStatusMonitorReference(program, operation, context);
if (nextReference !== undefined && nextReference.responseModel.kind === "Model") {
context.statusMonitorStep = nextReference;
const linkedOperation =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,7 @@ export type LegacyResourceOperationDecorator = (
target: Operation,
resourceType: Model,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
resourceName?: string,
) => DecoratorValidatorCallbacks | void;

Expand All @@ -264,13 +258,7 @@ export type ExtensionResourceOperationDecorator = (
targetResourceType: Model,
extensionResourceType: Model,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
resourceName?: string,
) => DecoratorValidatorCallbacks | void;

Expand All @@ -289,13 +277,7 @@ export type BuiltInResourceOperationDecorator = (
parentResourceType: Model,
builtInResourceType: Model,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
resourceName?: string,
) => DecoratorValidatorCallbacks | void;

Expand All @@ -312,13 +294,7 @@ export type LegacyExtensionResourceOperationDecorator = (
target: Operation,
resourceType: Model,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
resourceName?: string,
) => DecoratorValidatorCallbacks | void;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ import {
import { ArmStateKeys } from "./state.js";

export type ArmLifecycleOperationKind =
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "checkExistence";
"read" | "createOrUpdate" | "update" | "delete" | "checkExistence";
export type ArmOperationKind = ArmLifecycleOperationKind | "list" | "action" | "other";

export interface ArmResourceOperation extends ArmResourceOperationData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,13 +768,7 @@ function callOperationDecorator(
resourceType: Model,
resourceName: string,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
): void {
switch (operationType) {
case "read":
Expand Down Expand Up @@ -806,13 +800,7 @@ function callLifecycleDecorator(
target: Operation,
resourceType: Model,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
): void {
switch (operationType) {
case "read":
Expand Down Expand Up @@ -842,13 +830,7 @@ const $extensionResourceOperation: ExtensionResourceOperationDecorator = (
targetResourceType: Model,
extensionResourceType: Model,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
resourceName?: string,
) => {
if (
Expand Down Expand Up @@ -879,13 +861,7 @@ const $builtInResourceOperation: BuiltInResourceOperationDecorator = (
parentResourceType: Model,
builtInResourceType: Model,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
resourceName?: string,
) => {
if (
Expand All @@ -907,13 +883,7 @@ const $legacyResourceOperation: LegacyResourceOperationDecorator = (
target: Operation,
resourceType: Model,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
resourceName?: string,
) => {
if (
Expand Down Expand Up @@ -979,13 +949,7 @@ const $legacyExtensionResourceOperation: LegacyExtensionResourceOperationDecorat
target: Operation,
resourceType: Model,
operationType:
| "read"
| "createOrUpdate"
| "update"
| "delete"
| "list"
| "action"
| "checkExistence",
"read" | "createOrUpdate" | "update" | "delete" | "list" | "action" | "checkExistence",
resourceName?: string,
) => {
if (
Expand Down
8 changes: 1 addition & 7 deletions packages/typespec-azure-resource-manager/src/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,7 @@ import { getArmResource, listArmResources, registerArmResource } from "./private
import { ArmStateKeys } from "./state.js";

export type ArmResourceKind =
| "Tracked"
| "Proxy"
| "Extension"
| "Virtual"
| "Custom"
| "BuiltIn"
| "Generic";
"Tracked" | "Proxy" | "Extension" | "Virtual" | "Custom" | "BuiltIn" | "Generic";

/**
* The base details for all kinds of resources
Expand Down
1 change: 1 addition & 0 deletions packages/typespec-client-generator-core/src/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function getEndpointTypeFromSingleServer<
allowReserved: true,
optional: false,
serializedName: "endpoint",
// eslint-disable-next-line @typescript-eslint/no-deprecated
correspondingMethodParams: [],
methodParameterSegments: [],
type: getSdkBuiltInType(context, $(context.program).builtin.url),
Expand Down
9 changes: 3 additions & 6 deletions packages/typespec-client-generator-core/src/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1884,17 +1884,15 @@ export function getClientOptionValue(
): unknown | undefined {
// Check operation directly
const opOption = getScopedDecoratorData(context, clientOptionKey, target) as
| { name: string; value: unknown }
| undefined;
{ name: string; value: unknown } | undefined;
if (opOption?.name === optionName) {
return opOption.value;
}

// Check interface if operation is in one
if (target.interface) {
const ifaceOption = getScopedDecoratorData(context, clientOptionKey, target.interface) as
| { name: string; value: unknown }
| undefined;
{ name: string; value: unknown } | undefined;
if (ifaceOption?.name === optionName) {
return ifaceOption.value;
}
Expand All @@ -1904,8 +1902,7 @@ export function getClientOptionValue(
let ns = target.namespace;
while (ns) {
const nsOption = getScopedDecoratorData(context, clientOptionKey, ns) as
| { name: string; value: unknown }
| undefined;
{ name: string; value: unknown } | undefined;
if (nsOption?.name === optionName) {
return nsOption.value;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/typespec-client-generator-core/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ function getSdkHttpParameters(
...contentTypeBase,
kind: "header",
serializedName: "Content-Type",
// eslint-disable-next-line @typescript-eslint/no-deprecated
correspondingMethodParams: [methodParameter],
methodParameterSegments: [[methodParameter]],
});
Expand All @@ -396,6 +397,7 @@ function getSdkHttpParameters(
...acceptBase,
kind: "header",
serializedName: "Accept",
// eslint-disable-next-line @typescript-eslint/no-deprecated
correspondingMethodParams: [methodParameter],
methodParameterSegments: [[methodParameter]],
});
Expand Down
11 changes: 2 additions & 9 deletions packages/typespec-client-generator-core/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,7 @@ export interface SdkModelPropertyTypeBase<
}

export type ArrayKnownEncoding =
| "pipeDelimited"
| "spaceDelimited"
| "commaDelimited"
| "newlineDelimited";
"pipeDelimited" | "spaceDelimited" | "commaDelimited" | "newlineDelimited";

/**
* Options to show how to serialize a model/property.
Expand Down Expand Up @@ -920,11 +917,7 @@ export interface SdkBodyParameter extends SdkModelPropertyTypeBase {
}

export type SdkHttpParameter =
| SdkQueryParameter
| SdkPathParameter
| SdkBodyParameter
| SdkHeaderParameter
| SdkCookieParameter;
SdkQueryParameter | SdkPathParameter | SdkBodyParameter | SdkHeaderParameter | SdkCookieParameter;

export interface SdkMethodParameter extends SdkModelPropertyTypeBase {
kind: "method";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,7 @@ export function getTypeDecorators(
function getDecoratorArgValue(
context: TCGCContext,
arg:
| Type
| Record<string, unknown>
| Value
| unknown[]
| string
| number
| boolean
| Numeric
| null,
Type | Record<string, unknown> | Value | unknown[] | string | number | boolean | Numeric | null,
type: Type,
decoratorName: string,
): [any, readonly Diagnostic[]] {
Expand Down
19 changes: 9 additions & 10 deletions packages/typespec-client-generator-core/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ function getSdkPagingServiceMethod<TServiceOperation extends SdkServiceOperation
baseServiceMethod.response,
);

baseServiceMethod.response.resultSegments = resultSegments?.map(
(resultSegment) => context.__modelPropertyCache.get(resultSegment)!,
baseServiceMethod.response.resultSegments = resultSegments?.map((resultSegment) =>
context.__modelPropertyCache.get(resultSegment)!,
);

context.__pagedResultSet.add(responseType);
Expand Down Expand Up @@ -254,14 +254,13 @@ function getSdkPagingServiceMethod<TServiceOperation extends SdkServiceOperation
context.program,
pagingMetadata.output.nextLink.property.type,
) ?? []
).map(
(t: ModelProperty) =>
getPropertySegmentsFromModelOrParameters(
baseServiceMethod.parameters,
(p) =>
p.__raw?.kind === "ModelProperty" &&
findRootSourceProperty(p.__raw) === findRootSourceProperty(t),
)!,
).map((t: ModelProperty) =>
getPropertySegmentsFromModelOrParameters(
baseServiceMethod.parameters,
(p) =>
p.__raw?.kind === "ModelProperty" &&
findRootSourceProperty(p.__raw) === findRootSourceProperty(t),
)!,
)
: undefined,
},
Expand Down
1 change: 1 addition & 0 deletions packages/typespec-client-generator-core/src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export async function createSdkPackage<TServiceOperation extends SdkServiceOpera
namespaces: [],
licenseInfo: getLicenseInfo(context),
metadata: {
// eslint-disable-next-line @typescript-eslint/no-deprecated
apiVersion:
context.apiVersion === "all" && versions.size === 1
? "all"
Expand Down
Loading
Loading