Skip to content

Commit

Permalink
Sync the latest main to feature lro v3 (#2381)
Browse files Browse the repository at this point in the history
* deprecate-baseurl-in-favor-of-endpoint (#2246)

* deprecate-baseurl-in-favor-of-endpoint

* codegen change

* fix integration test and unit test

* update smoke-test && merge main

* revert smoke-test-list

* update

* revert change

* update

* update

* update

* update

* Revert "update"

This reverts commit 02967a1.

* update

* fix ci

* rename endpoint parameter

* update (#15)

* update test

---------

Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>

* Support usage and access (#2356)

* support-usage-and-access

* add generate orphan models options

* test push code to pr

* add test case for clientGeneratorCore access and usage

* rename public as operation name for now

* fix integration test

* add modular test case and remove duplicate case

* regenerate all test

* regenerate rlc test

* fix ci

---------

Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>

* Support server versions in modular and add cadl-ranch test cases (#2261)

* add modular server versions

* fix version param global calculation

* fix api version in operation logic

* fix versioned test

* fix ci

* fix ci

* add rlc server versions in this pr

* revert smoke test

* should only have client side api version if api version exists in all operations

* fix batch

* fix ut

* unify api version when it exists in all operations

* fix smoke test

* fix ci

* fix parameters

* fix ci

* add ut for api version in modular

* Update packages/typespec-ts/test/modularUnit/apiOperations.spec.ts

* fix ut

* reserve work

* generate client level required apiVersion

* handle api-version in both url and query

* fix ci

* should not export apiVersion in operation level signature when it has default value

* Update packages/typespec-ts/src/modular/helpers/operationHelpers.ts

* fix integration test

* fix smoke-test

* regen smoke-test

* regen cadl test case

* add ut and fix smoke test

* resolve comments

---------

Co-authored-by: qiaozha <qiaozha@microsoft.com>
Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>

* Add coverage cases for Server NotDefined in cadl-ranch (#2370)

* Supplement server endpoint not-defined

* update cadl-ranch version

* bump cadl ranch version regen code

* Add coverage cases for Azure Core Scalar in cadl-ranch (#2369)

* Supplement azure core scalar

* update test case

* remove .only in test case

* update test case

* Fix cadl-ranch test

* Fix the un-used reference issue

* Fix name conflict issues

* fix ci smoke test error

---------

Co-authored-by: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com>
Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>
Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>
Co-authored-by: qiaozha <qiaozha@microsoft.com>
  • Loading branch information
5 people committed Mar 26, 2024
1 parent 7af03fe commit b12beae
Show file tree
Hide file tree
Showing 480 changed files with 8,472 additions and 888 deletions.
16 changes: 8 additions & 8 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 @@ -12,7 +12,8 @@ import { BodyComplexRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): BodyComplexRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-body-complex-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as BodyComplexRestClient;
const client = getClient(endpointUrl, options) as BodyComplexRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { BodyFileClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): BodyFileClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-body-file-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as BodyFileClient;
const client = getClient(endpointUrl, options) as BodyFileClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { BodyFormDataClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): BodyFormDataClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-body-formdata-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as BodyFormDataClient;
const client = getClient(endpointUrl, options) as BodyFormDataClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { BodyStringRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): BodyStringRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-body-string-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as BodyStringRestClient;
const client = getClient(endpointUrl, options) as BodyStringRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export default function createClient(
host: string,
options: ClientOptions = {},
): CustomUrlRestClient {
const baseUrl = options.baseUrl ?? `http://{accountName}${host}`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://{accountName}${host}`;
const userAgentInfo = `azsdk-js-custom-url-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -30,7 +31,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as CustomUrlRestClient;
const client = getClient(endpointUrl, options) as CustomUrlRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { DPGCustomizationClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): DPGCustomizationClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-dpg-customization-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as DPGCustomizationClient;
const client = getClient(endpointUrl, options) as DPGCustomizationClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { HeaderRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): HeaderRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-header-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as HeaderRestClient;
const client = getClient(endpointUrl, options) as HeaderRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { HttpInfrastructureRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): HttpInfrastructureRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-http-infrastructure-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,10 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as HttpInfrastructureRestClient;
const client = getClient(
endpointUrl,
options,
) as HttpInfrastructureRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { LRORestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): LRORestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-lro-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as LRORestClient;
const client = getClient(endpointUrl, options) as LRORestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { MediaTypesClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): MediaTypesClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-media-types-service-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as MediaTypesClient;
const client = getClient(endpointUrl, options) as MediaTypesClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { MultipleInheritanceRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): MultipleInheritanceRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-multiple-inheritance-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,10 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as MultipleInheritanceRestClient;
const client = getClient(
endpointUrl,
options,
) as MultipleInheritanceRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export default function createClient(
credentials: TokenCredential,
options: ClientOptions = {},
): MultipleUrlParameterRestClient {
const baseUrl =
const endpointUrl =
options.endpoint ??
options.baseUrl ??
`${endpoint}/catalog/api/atlas/${serviceVersion}/{accountName}`;

Expand All @@ -42,7 +43,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as MultipleUrlParameterRestClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { PagingClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): PagingClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-paging-service-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as PagingClient;
const client = getClient(endpointUrl, options) as PagingClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default function createClient(
credentials: TokenCredential,
options: ClientOptions = {},
): SecurityAADRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-security-aad-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -37,7 +38,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as SecurityAADRestClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default function createClient(
credentials: KeyCredential,
options: ClientOptions = {},
): SecurityKeyRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-security-key-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -35,7 +36,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as SecurityKeyRestClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { UrlRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): UrlRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-url-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as UrlRestClient;
const client = getClient(endpointUrl, options) as UrlRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function createClient(
credentials: KeyCredential,
options: ClientOptions = {},
): AzureAgriFoodPlatformDataPlaneServiceClient {
const baseUrl = options.baseUrl ?? `${endpoint}`;
const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}`;

const userAgentInfo = `azsdk-js-agrifood-data-plane-rest/1.0.0-beta.1`;
const userAgentPrefix =
Expand All @@ -39,7 +39,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as AzureAgriFoodPlatformDataPlaneServiceClient;
Expand Down
Loading

0 comments on commit b12beae

Please sign in to comment.