Skip to content

Commit

Permalink
remove core-http dependency (#2874)
Browse files Browse the repository at this point in the history
* remove core-http dependency

* update

---------

Co-authored-by: Qiaoqiao Zhang <[email protected]>
  • Loading branch information
kazrael2119 and qiaozha authored Oct 29, 2024
1 parent b25ffb0 commit 1bcf946
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 19 deletions.
8 changes: 3 additions & 5 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,8 @@ function regularAutorestPackage(
...(hasLro && { "@azure/core-lro": "^2.5.4" }),
...(hasLro && { "@azure/abort-controller": "^2.1.2" }),
...(hasAsyncIterators && { "@azure/core-paging": "^1.2.0" }),
...(!useCoreV2 && { "@azure/core-http": "^3.0.0" }),
...(useCoreV2 && { "@azure/core-client": "^1.7.0" }),
...(useCoreV2 && addCredentials && { "@azure/core-auth": "^1.6.0" }),
...(useCoreV2 &&
coreHttpCompatMode && { "@azure/core-http-compat": "^1.2.0" }),
...(useCoreV2 && {
"@azure/core-rest-pipeline": "^1.14.0"
}),
Expand Down
14 changes: 7 additions & 7 deletions packages/autorest.typescript/src/transforms/mapperTransforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const primitiveSchemaTypes = [
*/
const pipe =
(...fns: Array<(pipelineValue: PipelineValue) => PipelineValue>) =>
(x: PipelineValue) =>
fns.reduce((v, f) => (!v.isHandled ? f(v) : v), x);
(x: PipelineValue) =>
fns.reduce((v, f) => (!v.isHandled ? f(v) : v), x);

export type ModelProperties = { [propertyName: string]: Mapper | string[] };

Expand Down Expand Up @@ -306,10 +306,10 @@ function buildAdditionalProperties(
const additionalProperties = getAdditionalProperties(objectSchema);
return additionalProperties
? {
type: {
name: MapperType.Object
}
type: {
name: MapperType.Object
}
}
: undefined;
}

Expand Down Expand Up @@ -360,8 +360,8 @@ function transformObjectMapper(pipelineValue: PipelineValue) {
(p as ObjectSchema).discriminator &&
uberParents.includes(getMapperClassName(p))
) ||
parents.find((p) => uberParents.includes(getMapperClassName(p))) ||
schema
parents.find((p) => uberParents.includes(getMapperClassName(p))) ||
schema
);

if (objectSchema.parents?.immediate[0]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"dependencies": {
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-http-compat": "^1.2.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"engines": { "node": ">=18.0.0" },
"dependencies": {
"@azure/core-client": "^1.7.0",
"@azure/core-http-compat": "^1.2.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"engines": { "node": ">=18.0.0" },
"dependencies": {
"@azure/core-client": "^1.7.0",
"@azure/core-http-compat": "^1.2.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "A generated SDK for UserAgentCoreV1Client.",
"version": "1.0.0-preview1",
"engines": { "node": ">=18.0.0" },
"dependencies": { "@azure/core-http": "^3.0.0", "tslib": "^2.2.0" },
"dependencies": { "tslib": "^2.2.0" },
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
"license": "MIT",
"main": "./dist/index.js",
Expand Down

0 comments on commit 1bcf946

Please sign in to comment.