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

[KeyVault] - Update API Extractor version #17702

Closed
wants to merge 1 commit into from
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
8,433 changes: 4,201 additions & 4,232 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"@azure/keyvault-keys": "^4.2.1",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-recorder": "^1.0.0",
"@microsoft/api-extractor": "7.7.11",
"@microsoft/api-extractor": "^7.18.7",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-multi-entry": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion sdk/keyvault/keyvault-admin/review/keyvault-admin.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

```ts

/// <reference lib="esnext.asynciterable" />

import { CommonClientOptions } from '@azure/core-client';
import { OperationOptions } from '@azure/core-client';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
Expand Down Expand Up @@ -242,7 +244,6 @@ export interface SetRoleDefinitionOptions extends OperationOptions {
// @public
export type SUPPORTED_API_VERSIONS = "7.2" | "7.3-preview";


// (No @packageDocumentation comment for this package)

```
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-certificates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"@azure/keyvault-secrets": "^4.2.0",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-recorder": "^1.0.0",
"@microsoft/api-extractor": "7.7.11",
"@microsoft/api-extractor": "^7.18.7",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-multi-entry": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

```ts

/// <reference lib="esnext.asynciterable" />

import { AzureLogger } from '@azure/logger';
import * as coreHttp from '@azure/core-http';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { PipelineOptions } from '@azure/core-http';
Expand Down Expand Up @@ -419,7 +422,7 @@ export type ListPropertiesOfCertificateVersionsOptions = coreHttp.OperationOptio
export type ListPropertiesOfIssuersOptions = coreHttp.OperationOptions;

// @public
export const logger: import("@azure/logger").AzureLogger;
export const logger: AzureLogger;

// @public
export type MergeCertificateOptions = coreHttp.OperationOptions;
Expand Down Expand Up @@ -491,7 +494,6 @@ export interface X509CertificateProperties {
validityInMonths?: number;
}


// (No @packageDocumentation comment for this package)

```
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"@azure/identity": "2.0.0-beta.7",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-recorder": "^1.0.0",
"@microsoft/api-extractor": "7.7.11",
"@microsoft/api-extractor": "^7.18.7",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-multi-entry": "^3.0.0",
Expand Down
28 changes: 16 additions & 12 deletions sdk/keyvault/keyvault-keys/review/keyvault-keys.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

```ts

/// <reference lib="esnext.asynciterable" />

import { AzureLogger } from '@azure/logger';
import * as coreHttp from '@azure/core-http';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { PageSettings } from '@azure/core-paging';
Expand Down Expand Up @@ -92,7 +95,7 @@ export interface CreateRsaKeyOptions extends CreateKeyOptions {
// @public
export class CryptographyClient {
constructor(key: string | KeyVaultKey, credential: TokenCredential, pipelineOptions?: CryptographyClientOptions);
constructor(key: JsonWebKey);
constructor(key: JsonWebKey_2);
decrypt(decryptParameters: DecryptParameters, options?: DecryptOptions): Promise<DecryptResult>;
// @deprecated
decrypt(algorithm: EncryptionAlgorithm, ciphertext: Uint8Array, options?: DecryptOptions): Promise<DecryptResult>;
Expand Down Expand Up @@ -134,9 +137,9 @@ export interface DecryptResult {
// @public
export interface DeletedKey {
id?: string;
key?: JsonWebKey;
key?: JsonWebKey_2;
keyOperations?: KeyOperation[];
keyType?: KeyType;
keyType?: KeyType_2;
name: string;
properties: KeyProperties & {
readonly recoveryId?: string;
Expand Down Expand Up @@ -200,7 +203,7 @@ export interface ImportKeyOptions extends coreHttp.OperationOptions {
}

// @public
export interface JsonWebKey {
interface JsonWebKey_2 {
crv?: KeyCurveName;
d?: Uint8Array;
dp?: Uint8Array;
Expand All @@ -209,7 +212,7 @@ export interface JsonWebKey {
k?: Uint8Array;
keyOps?: KeyOperation[];
kid?: string;
kty?: KeyType;
kty?: KeyType_2;
n?: Uint8Array;
p?: Uint8Array;
q?: Uint8Array;
Expand All @@ -218,6 +221,7 @@ export interface JsonWebKey {
x?: Uint8Array;
y?: Uint8Array;
}
export { JsonWebKey_2 as JsonWebKey }
Copy link
Member

Choose a reason for hiding this comment

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

this is bizarre to me

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not a bug, but it is the reason #9410 is stalled... I believe this is the change that introduced this microsoft/rushstack#1767

My understanding is that names that will conflict / shadow declarations in dom.d.ts, etc will be renamed as such

Copy link
Member Author

Choose a reason for hiding this comment

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

#9410 (comment)

But it's super pervasive - any clash will cause this noise...

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/microsoft/TypeScript/blob/cec2fda9a53620dc545a2c4d7b0156446ab145b4/lib/lib.webworker.d.ts looks like it's getting declared here, which makes me wonder if this is a common browser type, should we even be exporting this? Or simply declaring a shim?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

It's unfortunately not that simple - this JsonWebKey type that we declare here is not conformant with IETF standard for JWK... I believe since the full set is all optional the difference for us is keyOps instead of key_ops... other languages have more differences but for us I think that's what we would need.

But we already GA'd with this shape...

Copy link
Member

Choose a reason for hiding this comment

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

since this is just the interface name, can we maybe rename it so it doesn't conflict anymore, but still export the conflict as deprecated alias?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can, sure. But I do want to call out that if we want to upgrade api-extractor for everyone we will keep bumping into this. Some are already showing this issue (like Error_2, Location_2, etc) so I'm not sure what the answer would be globally. Any thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #17710 to address this


// @public
export class KeyClient {
Expand All @@ -226,14 +230,14 @@ export class KeyClient {
beginDeleteKey(name: string, options?: BeginDeleteKeyOptions): Promise<PollerLike<PollOperationState<DeletedKey>, DeletedKey>>;
beginRecoverDeletedKey(name: string, options?: BeginRecoverDeletedKeyOptions): Promise<PollerLike<PollOperationState<DeletedKey>, DeletedKey>>;
createEcKey(name: string, options?: CreateEcKeyOptions): Promise<KeyVaultKey>;
createKey(name: string, keyType: KeyType, options?: CreateKeyOptions): Promise<KeyVaultKey>;
createKey(name: string, keyType: KeyType_2, options?: CreateKeyOptions): Promise<KeyVaultKey>;
createOctKey(name: string, options?: CreateOctKeyOptions): Promise<KeyVaultKey>;
createRsaKey(name: string, options?: CreateRsaKeyOptions): Promise<KeyVaultKey>;
getCryptographyClient(keyName: string, options?: GetCryptographyClientOptions): CryptographyClient;
getDeletedKey(name: string, options?: GetDeletedKeyOptions): Promise<DeletedKey>;
getKey(name: string, options?: GetKeyOptions): Promise<KeyVaultKey>;
getRandomBytes(count: number, options?: GetRandomBytesOptions): Promise<RandomBytes>;
importKey(name: string, key: JsonWebKey, options?: ImportKeyOptions): Promise<KeyVaultKey>;
importKey(name: string, key: JsonWebKey_2, options?: ImportKeyOptions): Promise<KeyVaultKey>;
listDeletedKeys(options?: ListDeletedKeysOptions): PagedAsyncIterableIterator<DeletedKey>;
listPropertiesOfKeys(options?: ListPropertiesOfKeysOptions): PagedAsyncIterableIterator<KeyProperties>;
listPropertiesOfKeyVersions(name: string, options?: ListPropertiesOfKeyVersionsOptions): PagedAsyncIterableIterator<KeyProperties>;
Expand Down Expand Up @@ -293,14 +297,15 @@ export interface KeyReleasePolicy {
}

// @public
export type KeyType = string;
type KeyType_2 = string;
export { KeyType_2 as KeyType }
Comment on lines +300 to +301
Copy link
Member

Choose a reason for hiding this comment

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

this has to be some kind of bug, right?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Speaking of differences - KeyType for us does not mean the same as keyType in node crypto - for us it's the kty (EC, RSA, etc). I think globally it's defined as "private" | "public" | "secret"


// @public
export interface KeyVaultKey {
id?: string;
key?: JsonWebKey;
key?: JsonWebKey_2;
keyOperations?: KeyOperation[];
keyType?: KeyType;
keyType?: KeyType_2;
name: string;
properties: KeyProperties;
}
Expand Down Expand Up @@ -403,7 +408,7 @@ export interface ListPropertiesOfKeyVersionsOptions extends coreHttp.OperationOp
}

// @public
export const logger: import("@azure/logger").AzureLogger;
export const logger: AzureLogger;

export { PagedAsyncIterableIterator }

Expand Down Expand Up @@ -520,7 +525,6 @@ export interface WrapResult {
result: Uint8Array;
}


// (No @packageDocumentation comment for this package)

```
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-secrets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"@azure/identity": "2.0.0-beta.7",
"@azure/test-utils": "^1.0.0",
"@azure-tools/test-recorder": "^1.0.0",
"@microsoft/api-extractor": "7.7.11",
"@microsoft/api-extractor": "^7.18.7",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-multi-entry": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

```ts

/// <reference lib="esnext.asynciterable" />

import { AzureLogger } from '@azure/logger';
import * as coreHttp from '@azure/core-http';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { PageSettings } from '@azure/core-paging';
Expand Down Expand Up @@ -89,7 +92,7 @@ export interface ListPropertiesOfSecretVersionsOptions extends coreHttp.Operatio
}

// @public
export const logger: import("@azure/logger").AzureLogger;
export const logger: AzureLogger;

export { PagedAsyncIterableIterator }

Expand Down Expand Up @@ -186,7 +189,6 @@ export interface UpdateSecretPropertiesOptions extends coreHttp.OperationOptions
};
}


// (No @packageDocumentation comment for this package)

```