Skip to content

Commit 2aafa23

Browse files
Update Node.js dependencies and prepare patch release 0.38.3 (#3267)
* Initial plan * Update core submodule to latest from upstream * Update Node.js dependencies in typespec-extension and typespec-tests Co-authored-by: weidongxu-microsoft <[email protected]> * Sync tests from core submodule Co-authored-by: weidongxu-microsoft <[email protected]> * Bump version to 0.38.3 and update changelog Co-authored-by: weidongxu-microsoft <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: weidongxu-microsoft <[email protected]>
1 parent 025e4fc commit 2aafa23

File tree

15 files changed

+335
-22
lines changed

15 files changed

+335
-22
lines changed

core

Submodule core updated 62 files

typespec-extension/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 0.38.3 (2026-01-15)
4+
5+
Compatible with compiler 1.8.0.
6+
7+
- Updated package dependencies to latest versions.
8+
39
## 0.38.2 (2026-01-14)
410

511
Compatible with compiler 1.8.0.

typespec-extension/package-lock.json

Lines changed: 43 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typespec-extension/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure-tools/typespec-java",
3-
"version": "0.38.2",
3+
"version": "0.38.3",
44
"description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding",
55
"keywords": [
66
"TypeSpec"
@@ -51,7 +51,7 @@
5151
"@azure-tools/typespec-azure-core": ">=0.64.0 <1.0.0",
5252
"@azure-tools/typespec-azure-resource-manager": ">=0.64.0 <1.0.0",
5353
"@azure-tools/typespec-azure-rulesets": ">=0.64.0 <1.0.0",
54-
"@azure-tools/typespec-client-generator-core": ">=0.64.0 <1.0.0",
54+
"@azure-tools/typespec-client-generator-core": ">=0.64.1 <1.0.0",
5555
"@azure-tools/typespec-liftr-base": ">=0.11.0 <1.0.0",
5656
"@typespec/compiler": "^1.8.0",
5757
"@typespec/http": "^1.8.0",
@@ -70,7 +70,7 @@
7070
"@azure-tools/typespec-azure-core": "0.64.0",
7171
"@azure-tools/typespec-azure-resource-manager": "0.64.0",
7272
"@azure-tools/typespec-azure-rulesets": "0.64.0",
73-
"@azure-tools/typespec-client-generator-core": "0.64.0",
73+
"@azure-tools/typespec-client-generator-core": "0.64.1",
7474
"@azure-tools/typespec-liftr-base": "0.11.0",
7575
"@microsoft/api-extractor": "^7.55.2",
7676
"@types/js-yaml": "~4.0.9",
@@ -95,7 +95,7 @@
9595
"eslint-plugin-deprecation": "~3.0.0",
9696
"eslint-plugin-import": "^2.32.0",
9797
"eslint-plugin-unicorn": "^62.0.0",
98-
"prettier": "~3.7.4",
98+
"prettier": "~3.8.0",
9999
"rimraf": "~6.1.2",
100100
"typescript": "~5.9.3",
101101
"typescript-eslint": "^8.53.0",

typespec-tests/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"dependencies": {
1212
"@typespec/spec-api": "0.1.0-alpha.12",
1313
"@typespec/spector": "0.1.0-alpha.22",
14-
"@typespec/http-specs": "0.1.0-alpha.30",
15-
"@azure-tools/azure-http-specs": "0.1.0-alpha.35",
16-
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.38.2.tgz"
14+
"@typespec/http-specs": "0.1.0-alpha.31",
15+
"@azure-tools/azure-http-specs": "0.1.0-alpha.36",
16+
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.38.3.tgz"
1717
},
1818
"devDependencies": {
1919
"@typespec/prettier-plugin-typespec": "^1.8.0",
2020
"prettier-plugin-organize-imports": "^4.3.0",
21-
"prettier": "^3.7.4"
21+
"prettier": "^3.8.0"
2222
},
2323
"overrides": {
2424
"@typespec/compiler": "1.8.0",
@@ -31,7 +31,7 @@
3131
"@typespec/sse": "0.78.0",
3232
"@typespec/streams": "0.78.0",
3333
"@azure-tools/typespec-azure-core": "0.64.0",
34-
"@azure-tools/typespec-client-generator-core": "0.64.0",
34+
"@azure-tools/typespec-client-generator-core": "0.64.1",
3535
"@azure-tools/typespec-azure-resource-manager": "0.64.0",
3636
"@azure-tools/typespec-autorest": "0.64.0",
3737
"@azure-tools/typespec-liftr-base": "0.11.0"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
package authentication.noauth.union;
5+
6+
import authentication.util.BearerTokenAuthenticationPolicy;
7+
import com.azure.core.credential.AccessToken;
8+
import com.azure.core.exception.HttpResponseException;
9+
import java.time.OffsetDateTime;
10+
import org.junit.jupiter.api.Assertions;
11+
import org.junit.jupiter.api.Test;
12+
import reactor.core.publisher.Mono;
13+
14+
public class UnionTests {
15+
16+
private static final String EXPECTED_TOKEN = "https://security.microsoft.com/.default";
17+
18+
private static UnionClientBuilder createClientBuilder() {
19+
return new UnionClientBuilder();
20+
}
21+
22+
private static BearerTokenAuthenticationPolicy createBearerPolicy() {
23+
return new BearerTokenAuthenticationPolicy(
24+
tokenRequestContext -> Mono.just(new AccessToken(EXPECTED_TOKEN, OffsetDateTime.now().plusHours(1))));
25+
}
26+
27+
@Test
28+
public void validNoAuthAllowsRequestsWithoutAuthentication() {
29+
UnionClient client = createClientBuilder().buildClient();
30+
31+
Assertions.assertDoesNotThrow(() -> client.validNoAuth());
32+
}
33+
34+
@Test
35+
public void validTokenFailsWhenAuthorizationMissing() {
36+
UnionClient client = createClientBuilder().buildClient();
37+
38+
Assertions.assertThrows(HttpResponseException.class, client::validToken);
39+
}
40+
41+
@Test
42+
public void validTokenSucceedsWithBearerToken() {
43+
UnionClient client = createClientBuilder().addPolicy(createBearerPolicy()).buildClient();
44+
45+
Assertions.assertDoesNotThrow(() -> client.validToken());
46+
}
47+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
package azure.clientgenerator.core.clientlocation;
5+
6+
import azure.clientgenerator.core.clientlocation.newsubclient.ArchiveOperationsClient;
7+
import azure.clientgenerator.core.clientlocation.newsubclient.MoveToNewSubClientBuilder;
8+
import azure.clientgenerator.core.clientlocation.newsubclient.ProductOperationsClient;
9+
import org.junit.jupiter.api.Test;
10+
11+
public class NewSubClientTests {
12+
13+
private final MoveToNewSubClientBuilder builder = new MoveToNewSubClientBuilder();
14+
15+
@Test
16+
public void testProductOperations() {
17+
ProductOperationsClient productClient = builder.buildProductOperationsClient();
18+
productClient.listProducts();
19+
}
20+
21+
@Test
22+
public void testArchiveOperations() {
23+
ArchiveOperationsClient archiveClient = builder.buildArchiveOperationsClient();
24+
archiveClient.archiveProduct();
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
package azure.clientgenerator.core.clientlocation;
5+
6+
import azure.clientgenerator.core.clientlocation.parameter.MoveMethodParameterToClient;
7+
import azure.clientgenerator.core.clientlocation.parameter.MoveMethodParameterToClientBuilder;
8+
import azure.clientgenerator.core.clientlocation.parameter.models.Blob;
9+
import org.junit.jupiter.api.Assertions;
10+
import org.junit.jupiter.api.Test;
11+
12+
public class ParameterTests {
13+
14+
private final MoveMethodParameterToClient client
15+
= new MoveMethodParameterToClientBuilder().storageAccount("testaccount").buildClient();
16+
17+
@Test
18+
public void testGetBlob() {
19+
Blob blob = client.getBlob("testcontainer", "testblob.txt");
20+
Assertions.assertNotNull(blob);
21+
Assertions.assertEquals("blob-001", blob.getId());
22+
Assertions.assertEquals("testblob.txt", blob.getName());
23+
Assertions.assertEquals(1024, blob.getSize());
24+
Assertions.assertEquals("/testcontainer/testblob.txt", blob.getPath());
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
package azure.clientgenerator.core.clientlocation;
5+
6+
import azure.clientgenerator.core.clientlocation.rootclient.MoveToRootClient;
7+
import azure.clientgenerator.core.clientlocation.rootclient.MoveToRootClientBuilder;
8+
import azure.clientgenerator.core.clientlocation.rootclient.ResourceOperationsClient;
9+
import org.junit.jupiter.api.Test;
10+
11+
public class RootClientTests {
12+
13+
private final MoveToRootClientBuilder builder = new MoveToRootClientBuilder();
14+
15+
@Test
16+
public void testRootClient() {
17+
MoveToRootClient rootClient = builder.buildClient();
18+
rootClient.getHealthStatus();
19+
}
20+
21+
@Test
22+
public void testResourceOperations() {
23+
ResourceOperationsClient resourceClient = builder.buildResourceOperationsClient();
24+
resourceClient.getResource();
25+
}
26+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
package azure.clientgenerator.core.clientlocation;
5+
6+
import azure.clientgenerator.core.clientlocation.subclient.AdminOperationsClient;
7+
import azure.clientgenerator.core.clientlocation.subclient.MoveToExistingSubClientBuilder;
8+
import azure.clientgenerator.core.clientlocation.subclient.UserOperationsClient;
9+
import org.junit.jupiter.api.Test;
10+
11+
public class SubClientTests {
12+
13+
private final MoveToExistingSubClientBuilder builder = new MoveToExistingSubClientBuilder();
14+
15+
@Test
16+
public void testAdminOperations() {
17+
AdminOperationsClient adminClient = builder.buildAdminOperationsClient();
18+
adminClient.getAdminInfo();
19+
adminClient.deleteUser();
20+
}
21+
22+
@Test
23+
public void testUserOperations() {
24+
UserOperationsClient userClient = builder.buildUserOperationsClient();
25+
userClient.getUser();
26+
}
27+
}

0 commit comments

Comments
 (0)