Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the required-read-only property for e2e demo #2990

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
149 changes: 8 additions & 141 deletions packages/typespec-test/test/ai/generated/typespec-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,19 @@
".": "./src/index.ts",
"./models": "./src/models/index.ts",
"./api": "./src/api/index.ts",
"./api/evaluations": "./src/api/evaluations/index.ts",
"./api/connections": "./src/api/connections/index.ts",
"./api/agents": "./src/api/agents/index.ts"
"./api/evaluations": "src/api/evaluations/index.ts",
"./api/connections": "src/api/connections/index.ts",
"./api/agents": "src/api/agents/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"dialects": ["esm", "commonjs"],
"esmDialects": ["browser", "react-native"],
"selfLink": false
},
"type": "module",
"keywords": [
"node",
"azure",
"cloud",
"typescript",
"browser",
"isomorphic"
],
"keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"],
"author": "Microsoft Corporation",
"license": "MIT",
"files": [
"dist",
"README.md",
"LICENSE",
"review/*",
"CHANGELOG.md"
],
"files": ["dist", "README.md", "LICENSE", "review/*", "CHANGELOG.md"],
"dependencies": {
"@azure/core-util": "^1.9.2",
"@azure-rest/core-client": "^2.3.1",
Expand All @@ -70,119 +51,5 @@
"lint": "eslint package.json api-extractor.json src",
"lint:fix": "eslint package.json api-extractor.json src --fix --fix-type [problem,suggestion]",
"build": "npm run clean && tshy && npm run extract-api"
},
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
},
"./models": {
"browser": {
"types": "./dist/browser/models/index.d.ts",
"default": "./dist/browser/models/index.js"
},
"react-native": {
"types": "./dist/react-native/models/index.d.ts",
"default": "./dist/react-native/models/index.js"
},
"import": {
"types": "./dist/esm/models/index.d.ts",
"default": "./dist/esm/models/index.js"
},
"require": {
"types": "./dist/commonjs/models/index.d.ts",
"default": "./dist/commonjs/models/index.js"
}
},
"./api": {
"browser": {
"types": "./dist/browser/api/index.d.ts",
"default": "./dist/browser/api/index.js"
},
"react-native": {
"types": "./dist/react-native/api/index.d.ts",
"default": "./dist/react-native/api/index.js"
},
"import": {
"types": "./dist/esm/api/index.d.ts",
"default": "./dist/esm/api/index.js"
},
"require": {
"types": "./dist/commonjs/api/index.d.ts",
"default": "./dist/commonjs/api/index.js"
}
},
"./api/evaluations": {
"browser": {
"types": "./dist/browser/api/evaluations/index.d.ts",
"default": "./dist/browser/api/evaluations/index.js"
},
"react-native": {
"types": "./dist/react-native/api/evaluations/index.d.ts",
"default": "./dist/react-native/api/evaluations/index.js"
},
"import": {
"types": "./dist/esm/api/evaluations/index.d.ts",
"default": "./dist/esm/api/evaluations/index.js"
},
"require": {
"types": "./dist/commonjs/api/evaluations/index.d.ts",
"default": "./dist/commonjs/api/evaluations/index.js"
}
},
"./api/connections": {
"browser": {
"types": "./dist/browser/api/connections/index.d.ts",
"default": "./dist/browser/api/connections/index.js"
},
"react-native": {
"types": "./dist/react-native/api/connections/index.d.ts",
"default": "./dist/react-native/api/connections/index.js"
},
"import": {
"types": "./dist/esm/api/connections/index.d.ts",
"default": "./dist/esm/api/connections/index.js"
},
"require": {
"types": "./dist/commonjs/api/connections/index.d.ts",
"default": "./dist/commonjs/api/connections/index.js"
}
},
"./api/agents": {
"browser": {
"types": "./dist/browser/api/agents/index.d.ts",
"default": "./dist/browser/api/agents/index.js"
},
"react-native": {
"types": "./dist/react-native/api/agents/index.d.ts",
"default": "./dist/react-native/api/agents/index.js"
},
"import": {
"types": "./dist/esm/api/agents/index.d.ts",
"default": "./dist/esm/api/agents/index.js"
},
"require": {
"types": "./dist/commonjs/api/agents/index.d.ts",
"default": "./dist/commonjs/api/agents/index.js"
}
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { stringToUint8Array } from "@azure/core-util";
/** Evaluation Definition */
export interface Evaluation {
/** Identifier of the evaluation. */
readonly id: string;
readonly id?: string;
/** Data for evaluation. */
data: InputDataUnion;
/** Display Name for evaluation. It helps to find evaluation easily in AI Studio. It does not need to be unique. */
Expand Down Expand Up @@ -104,7 +104,7 @@ export function inputDataUnionDeserializer(item: any): InputDataUnion {

/** Data Source for Application Insight. */
export interface AppInsightsConfiguration extends InputData {
readonly type: "app_insights";
readonly type?: "app_insights";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failure caused by prerant property is not marked with readonly.

/** LogAnalytic Workspace resourceID associated with AppInsights */
resourceId: string;
/** Query to fetch the data. */
Expand Down Expand Up @@ -136,7 +136,7 @@ export function appInsightsConfigurationDeserializer(

/** Dataset as source for evaluation. */
export interface Dataset extends InputData {
readonly type: "dataset";
readonly type?: "dataset";
/** Evaluation input data */
id: string;
}
Expand Down Expand Up @@ -261,7 +261,7 @@ export function evaluationArrayDeserializer(result: Array<Evaluation>): any[] {
/** Evaluation Schedule Definition */
export interface EvaluationSchedule {
/** Identifier of the evaluation. */
readonly id: string;
readonly id?: string;
/** Data for evaluation. */
data: InputDataUnion;
/** Display Name for evaluation. It helps to find evaluation easily in AI Studio. It does not need to be unique. */
Expand Down Expand Up @@ -363,7 +363,7 @@ export function triggerUnionDeserializer(item: any): TriggerUnion {

/** Recurrence Trigger Definition */
export interface RecurrenceTrigger extends Trigger {
readonly type: "Recurrence";
readonly type?: "Recurrence";
/** The frequency to trigger schedule. */
frequency: Frequency;
/** Specifies schedule interval in conjunction with frequency */
Expand Down Expand Up @@ -450,7 +450,7 @@ export type WeekDays =

/** Cron Trigger Definition */
export interface CronTrigger extends Trigger {
readonly type: "Cron";
readonly type?: "Cron";
/** Cron expression for the trigger. */
expression: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ export interface TodoFileAttachment {
export interface TodoItem {
assignedTo?: number;
readonly completedAt?: Date;
readonly createdAt: Date;
readonly createdBy: number;
readonly createdAt?: Date;
readonly createdBy?: number;
description?: string;
// (undocumented)
dummy?: string;
readonly id: number;
readonly id?: number;
// (undocumented)
labels?: TodoLabels;
status: "NotStarted" | "InProgress" | "Completed";
title: string;
readonly updatedAt: Date;
readonly updatedAt?: Date;
}

// @public
Expand Down Expand Up @@ -121,43 +121,43 @@ export interface TodoItemsOperations {
attachments: TodoItemsAttachmentsOperations;
// (undocumented)
create: (item: TodoItem, options?: TodoItemsCreateOptionalParams) => Promise<{
id: number;
id?: number;
title: string;
createdBy: number;
createdBy?: number;
assignedTo?: number;
description?: string;
status: "NotStarted" | "InProgress" | "Completed";
createdAt: Date;
updatedAt: Date;
createdAt?: Date;
updatedAt?: Date;
completedAt?: Date;
labels?: TodoLabels;
}>;
delete: (id: number, options?: TodoItemsDeleteOptionalParams) => Promise<void>;
// (undocumented)
get: (id: number, options?: TodoItemsGetOptionalParams) => Promise<{
id: number;
id?: number;
title: string;
createdBy: number;
createdBy?: number;
assignedTo?: number;
description?: string;
status: "NotStarted" | "InProgress" | "Completed";
createdAt: Date;
updatedAt: Date;
createdAt?: Date;
updatedAt?: Date;
completedAt?: Date;
labels?: TodoLabels;
}>;
// (undocumented)
list: (options?: TodoItemsListOptionalParams) => PagedAsyncIterableIterator<TodoItem>;
// (undocumented)
update: (id: number, patch: TodoItemPatch, options?: TodoItemsUpdateOptionalParams) => Promise<{
id: number;
id?: number;
title: string;
createdBy: number;
createdBy?: number;
assignedTo?: number;
description?: string;
status: "NotStarted" | "InProgress" | "Completed";
createdAt: Date;
updatedAt: Date;
createdAt?: Date;
updatedAt?: Date;
completedAt?: Date;
labels?: TodoLabels;
}>;
Expand Down Expand Up @@ -196,7 +196,7 @@ export interface TodoUrlAttachment {
// @public
export interface User {
email: string;
readonly id: number;
readonly id?: number;
password: string;
username: string;
}
Expand All @@ -209,7 +209,7 @@ export interface UsersCreateOptionalParams extends OperationOptions {
export interface UsersOperations {
// (undocumented)
create: (user: User, options?: UsersCreateOptionalParams) => Promise<{
id: number;
id?: number;
username: string;
email: string;
token: string;
Expand Down
Loading
Loading