diff --git a/sdk/planetarycomputer/arm-planetarycomputer/CHANGELOG.md b/sdk/planetarycomputer/arm-planetarycomputer/CHANGELOG.md index dd0f67ec8ee5..4970c0b0aa6d 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/CHANGELOG.md +++ b/sdk/planetarycomputer/arm-planetarycomputer/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.0.0-beta.1 (2025-05-26) +## 1.0.0 (2026-03-25) ### Features Added -Initial release of @azure/arm-planetarycomputer +This is the first stable version with the package of @azure/arm-planetarycomputer diff --git a/sdk/planetarycomputer/arm-planetarycomputer/README.md b/sdk/planetarycomputer/arm-planetarycomputer/README.md index 27cf398eb285..1bdd4580964d 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/README.md +++ b/sdk/planetarycomputer/arm-planetarycomputer/README.md @@ -8,7 +8,7 @@ Key links: - [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/planetarycomputer/arm-planetarycomputer) - [Package (NPM)](https://www.npmjs.com/package/@azure/arm-planetarycomputer) -- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-planetarycomputer?view=azure-node-preview) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-planetarycomputer) - [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/planetarycomputer/arm-planetarycomputer/samples) ## Getting started diff --git a/sdk/planetarycomputer/arm-planetarycomputer/assets.json b/sdk/planetarycomputer/arm-planetarycomputer/assets.json index 97ac733cd736..6f3e520e0fb4 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/assets.json +++ b/sdk/planetarycomputer/arm-planetarycomputer/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/planetarycomputer/arm-planetarycomputer", - "Tag": "js/planetarycomputer/arm-planetarycomputer_ddc9f59344" + "Tag": "js/planetarycomputer/arm-planetarycomputer_7cf4485ab0" } diff --git a/sdk/planetarycomputer/arm-planetarycomputer/metadata.json b/sdk/planetarycomputer/arm-planetarycomputer/metadata.json new file mode 100644 index 000000000000..1c2a4acb40ea --- /dev/null +++ b/sdk/planetarycomputer/arm-planetarycomputer/metadata.json @@ -0,0 +1,39 @@ +{ + "apiVersions": { + "Microsoft.Spatio": "2026-04-15" + }, + "emitterVersion": "0.51.0", + "crossLanguageDefinitions": { + "CrossLanguagePackageId": "Microsoft.Spatio", + "CrossLanguageDefinitionId": { + "@azure/arm-planetarycomputer!GeoCatalog:interface": "Microsoft.Spatio.GeoCatalog", + "@azure/arm-planetarycomputer!GeoCatalogProperties:interface": "Microsoft.Spatio.GeoCatalogProperties", + "@azure/arm-planetarycomputer!ManagedServiceIdentity:interface": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "@azure/arm-planetarycomputer!UserAssignedIdentity:interface": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "@azure/arm-planetarycomputer!TrackedResource:interface": "Azure.ResourceManager.CommonTypes.TrackedResource", + "@azure/arm-planetarycomputer!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", + "@azure/arm-planetarycomputer!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", + "@azure/arm-planetarycomputer!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "@azure/arm-planetarycomputer!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "@azure/arm-planetarycomputer!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "@azure/arm-planetarycomputer!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", + "@azure/arm-planetarycomputer!GeoCatalogUpdate:interface": "Microsoft.Spatio.GeoCatalogUpdate", + "@azure/arm-planetarycomputer!ManagedServiceIdentityUpdate:interface": "Microsoft.Spatio.ManagedServiceIdentityUpdate", + "@azure/arm-planetarycomputer!GeoCatalogListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-planetarycomputer!KnownCatalogTier:enum": "Microsoft.Spatio.CatalogTier", + "@azure/arm-planetarycomputer!KnownProvisioningState:enum": "Microsoft.Spatio.ProvisioningState", + "@azure/arm-planetarycomputer!KnownAutoGeneratedDomainNameLabelScope:enum": "Microsoft.Spatio.AutoGeneratedDomainNameLabelScope", + "@azure/arm-planetarycomputer!KnownManagedServiceIdentityType:enum": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "@azure/arm-planetarycomputer!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", + "@azure/arm-planetarycomputer!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", + "@azure/arm-planetarycomputer!KnownVersions:enum": "Microsoft.Spatio.Versions", + "@azure/arm-planetarycomputer!ManagedServiceIdentityUserAssignedIdentity:type": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentity.anonymous", + "@azure/arm-planetarycomputer!GeoCatalogsOperations#listBySubscription:member": "Microsoft.Spatio.GeoCatalogs.listBySubscription", + "@azure/arm-planetarycomputer!GeoCatalogsOperations#listByResourceGroup:member": "Microsoft.Spatio.GeoCatalogs.listByResourceGroup", + "@azure/arm-planetarycomputer!GeoCatalogsOperations#delete:member": "Microsoft.Spatio.GeoCatalogs.delete", + "@azure/arm-planetarycomputer!GeoCatalogsOperations#update:member": "Microsoft.Spatio.GeoCatalogs.update", + "@azure/arm-planetarycomputer!GeoCatalogsOperations#create:member": "Microsoft.Spatio.GeoCatalogs.create", + "@azure/arm-planetarycomputer!GeoCatalogsOperations#get:member": "Microsoft.Spatio.GeoCatalogs.get" + } + } +} diff --git a/sdk/planetarycomputer/arm-planetarycomputer/package.json b/sdk/planetarycomputer/arm-planetarycomputer/package.json index 3fa58c57717a..4b3b2e9de78a 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/package.json +++ b/sdk/planetarycomputer/arm-planetarycomputer/package.json @@ -1,6 +1,6 @@ { "name": "@azure/arm-planetarycomputer", - "version": "1.0.0-beta.1", + "version": "1.0.0", "description": "A generated SDK for SpatioClient.", "engines": { "node": ">=20.0.0" diff --git a/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-api-geoCatalogs-node.api.md b/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-api-geoCatalogs-node.api.md index 0c409330be41..ce6511b05ed7 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-api-geoCatalogs-node.api.md +++ b/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-api-geoCatalogs-node.api.md @@ -4,10 +4,10 @@ ```ts -import { Client } from '@azure-rest/core-client'; -import { OperationOptions } from '@azure-rest/core-client'; -import { OperationState } from '@azure/core-lro'; -import { PollerLike } from '@azure/core-lro'; +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; // @public export function $delete(context: SpatioContext, resourceGroupName: string, catalogName: string, options?: GeoCatalogsDeleteOptionalParams): PollerLike, void>; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-api-node.api.md b/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-api-node.api.md index 412e0b536fad..4fcd8bed2810 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-api-node.api.md +++ b/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-api-node.api.md @@ -4,9 +4,9 @@ ```ts -import { Client } from '@azure-rest/core-client'; -import { ClientOptions } from '@azure-rest/core-client'; -import { TokenCredential } from '@azure/core-auth'; +import type { Client } from '@azure-rest/core-client'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { TokenCredential } from '@azure/core-auth'; // @public export function createSpatio(credential: TokenCredential, subscriptionId: string, options?: SpatioClientOptionalParams): SpatioContext; @@ -14,11 +14,12 @@ export function createSpatio(credential: TokenCredential, subscriptionId: string // @public export interface SpatioClientOptionalParams extends ClientOptions { apiVersion?: string; + cloudSetting?: AzureSupportedClouds; } // @public export interface SpatioContext extends Client { - apiVersion: string; + apiVersion?: string; subscriptionId: string; } diff --git a/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-models-node.api.md b/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-models-node.api.md index dc44dc283125..8e741dc2b937 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-models-node.api.md +++ b/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-models-node.api.md @@ -15,7 +15,7 @@ export type CreatedByType = string; // @public export interface ErrorAdditionalInfo { - readonly info?: Record; + readonly info?: any; readonly type?: string; } @@ -95,10 +95,7 @@ export enum KnownProvisioningState { // @public export enum KnownVersions { - // (undocumented) - V20240131Preview = "2024-01-31-preview", - // (undocumented) - V20250211Preview = "2025-02-11-preview" + _20260415 = "2026-04-15" } // @public @@ -106,7 +103,7 @@ export interface ManagedServiceIdentity { readonly principalId?: string; readonly tenantId?: string; type: ManagedServiceIdentityType; - userAssignedIdentities?: Record; + userAssignedIdentities?: Record; } // @public @@ -115,7 +112,7 @@ export type ManagedServiceIdentityType = string; // @public export interface ManagedServiceIdentityUpdate { type?: ManagedServiceIdentityType; - userAssignedIdentities?: Record; + userAssignedIdentities?: Record; } // @public diff --git a/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-node.api.md b/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-node.api.md index e87b873cff2a..69dd3adc798d 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-node.api.md +++ b/sdk/planetarycomputer/arm-planetarycomputer/review/arm-planetarycomputer-node.api.md @@ -4,18 +4,28 @@ ```ts -import { AbortSignalLike } from '@azure/abort-controller'; -import { ClientOptions } from '@azure-rest/core-client'; -import { OperationOptions } from '@azure-rest/core-client'; -import { OperationState } from '@azure/core-lro'; -import { PathUncheckedResponse } from '@azure-rest/core-client'; -import { Pipeline } from '@azure/core-rest-pipeline'; -import { PollerLike } from '@azure/core-lro'; -import { TokenCredential } from '@azure/core-auth'; +import type { AbortSignalLike } from '@azure/abort-controller'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PathUncheckedResponse } from '@azure-rest/core-client'; +import type { Pipeline } from '@azure/core-rest-pipeline'; +import type { PollerLike } from '@azure/core-lro'; +import type { TokenCredential } from '@azure/core-auth'; // @public export type AutoGeneratedDomainNameLabelScope = string; +// @public +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" +} + +// @public +export type AzureSupportedClouds = `${AzureClouds}`; + // @public export type CatalogTier = string; @@ -29,7 +39,7 @@ export type CreatedByType = string; // @public export interface ErrorAdditionalInfo { - readonly info?: Record; + readonly info?: any; readonly type?: string; } @@ -146,10 +156,7 @@ export enum KnownProvisioningState { // @public export enum KnownVersions { - // (undocumented) - V20240131Preview = "2024-01-31-preview", - // (undocumented) - V20250211Preview = "2025-02-11-preview" + _20260415 = "2026-04-15" } // @public @@ -157,7 +164,7 @@ export interface ManagedServiceIdentity { readonly principalId?: string; readonly tenantId?: string; type: ManagedServiceIdentityType; - userAssignedIdentities?: Record; + userAssignedIdentities?: Record; } // @public @@ -166,7 +173,7 @@ export type ManagedServiceIdentityType = string; // @public export interface ManagedServiceIdentityUpdate { type?: ManagedServiceIdentityType; - userAssignedIdentities?: Record; + userAssignedIdentities?: Record; } // @public @@ -212,6 +219,7 @@ export class SpatioClient { // @public export interface SpatioClientOptionalParams extends ClientOptions { apiVersion?: string; + cloudSetting?: AzureSupportedClouds; } // @public diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsCreateSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsCreateSample.ts index e082b6e48c7a..66ccef931fa2 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsCreateSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsCreateSample.ts @@ -1,25 +1,21 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { SpatioClient } from "@azure/arm-planetarycomputer"; +import { DefaultAzureCredential } from "@azure/identity"; + /** * This sample demonstrates how to create a GeoCatalog * * @summary create a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Create.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Create.json */ - -import { SpatioClient } from "@azure/arm-planetarycomputer"; -import { DefaultAzureCredential } from "@azure/identity"; - async function geoCatalogsCreate(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; const client = new SpatioClient(credential, subscriptionId); const result = await client.geoCatalogs.create("MyResourceGroup", "MyCatalog", { - properties: { - tier: "Basic", - autoGeneratedDomainNameLabelScope: "NoReuse", - }, + properties: { tier: "Basic", autoGeneratedDomainNameLabelScope: "NoReuse" }, identity: { type: "UserAssigned", userAssignedIdentities: { diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsDeleteSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsDeleteSample.ts index 6b95f6919cc9..eddb50cdb793 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsDeleteSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsDeleteSample.ts @@ -1,16 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { SpatioClient } from "@azure/arm-planetarycomputer"; +import { DefaultAzureCredential } from "@azure/identity"; + /** * This sample demonstrates how to delete a GeoCatalog * * @summary delete a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Delete.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Delete.json */ - -import { SpatioClient } from "@azure/arm-planetarycomputer"; -import { DefaultAzureCredential } from "@azure/identity"; - async function geoCatalogsDelete(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsGetSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsGetSample.ts index 0f68aadb5baf..6d0ca78be650 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsGetSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsGetSample.ts @@ -1,16 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { SpatioClient } from "@azure/arm-planetarycomputer"; +import { DefaultAzureCredential } from "@azure/identity"; + /** * This sample demonstrates how to get a GeoCatalog * * @summary get a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Get.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Get.json */ - -import { SpatioClient } from "@azure/arm-planetarycomputer"; -import { DefaultAzureCredential } from "@azure/identity"; - async function geoCatalogsGet(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsListByResourceGroupSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsListByResourceGroupSample.ts index c95eb98ea38e..881b46fe77ca 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsListByResourceGroupSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsListByResourceGroupSample.ts @@ -1,16 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { SpatioClient } from "@azure/arm-planetarycomputer"; +import { DefaultAzureCredential } from "@azure/identity"; + /** * This sample demonstrates how to list GeoCatalog resources by resource group * * @summary list GeoCatalog resources by resource group - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListByResourceGroup.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_ListByResourceGroup.json */ - -import { SpatioClient } from "@azure/arm-planetarycomputer"; -import { DefaultAzureCredential } from "@azure/identity"; - async function geoCatalogsListByResourceGroup(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsListBySubscriptionSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsListBySubscriptionSample.ts index c1880cab5601..eb95cd38215c 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsListBySubscriptionSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsListBySubscriptionSample.ts @@ -1,16 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { SpatioClient } from "@azure/arm-planetarycomputer"; +import { DefaultAzureCredential } from "@azure/identity"; + /** * This sample demonstrates how to list GeoCatalog resources by subscription ID * * @summary list GeoCatalog resources by subscription ID - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_ListBySubscription.json */ - -import { SpatioClient } from "@azure/arm-planetarycomputer"; -import { DefaultAzureCredential } from "@azure/identity"; - async function geoCatalogsListBySubscription(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsUpdateSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsUpdateSample.ts index d9e633b177c4..ce53d2600f8e 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsUpdateSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples-dev/geoCatalogsUpdateSample.ts @@ -1,16 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { SpatioClient } from "@azure/arm-planetarycomputer"; +import { DefaultAzureCredential } from "@azure/identity"; + /** * This sample demonstrates how to update a GeoCatalog * * @summary update a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Update.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Update.json */ - -import { SpatioClient } from "@azure/arm-planetarycomputer"; -import { DefaultAzureCredential } from "@azure/identity"; - async function geoCatalogsUpdate(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/README.md b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/README.md similarity index 72% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/README.md rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/README.md index 742e5ee40040..9d1282493b09 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/README.md +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/README.md @@ -1,15 +1,15 @@ -# @azure/arm-planetarycomputer client library samples for JavaScript (Beta) +# @azure/arm-planetarycomputer client library samples for JavaScript These sample programs show how to use the JavaScript client libraries for @azure/arm-planetarycomputer in some common scenarios. -| **File Name** | **Description** | -| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| [geoCatalogsCreateSample.js][geocatalogscreatesample] | create a GeoCatalog x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Create.json | -| [geoCatalogsDeleteSample.js][geocatalogsdeletesample] | delete a GeoCatalog x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Delete.json | -| [geoCatalogsGetSample.js][geocatalogsgetsample] | get a GeoCatalog x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Get.json | -| [geoCatalogsListByResourceGroupSample.js][geocatalogslistbyresourcegroupsample] | list GeoCatalog resources by resource group x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListByResourceGroup.json | -| [geoCatalogsListBySubscriptionSample.js][geocatalogslistbysubscriptionsample] | list GeoCatalog resources by subscription ID x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json | -| [geoCatalogsUpdateSample.js][geocatalogsupdatesample] | update a GeoCatalog x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Update.json | +| **File Name** | **Description** | +| ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| [geoCatalogsCreateSample.js][geocatalogscreatesample] | create a GeoCatalog x-ms-original-file: 2026-04-15/GeoCatalogs_Create.json | +| [geoCatalogsDeleteSample.js][geocatalogsdeletesample] | delete a GeoCatalog x-ms-original-file: 2026-04-15/GeoCatalogs_Delete.json | +| [geoCatalogsGetSample.js][geocatalogsgetsample] | get a GeoCatalog x-ms-original-file: 2026-04-15/GeoCatalogs_Get.json | +| [geoCatalogsListByResourceGroupSample.js][geocatalogslistbyresourcegroupsample] | list GeoCatalog resources by resource group x-ms-original-file: 2026-04-15/GeoCatalogs_ListByResourceGroup.json | +| [geoCatalogsListBySubscriptionSample.js][geocatalogslistbysubscriptionsample] | list GeoCatalog resources by subscription ID x-ms-original-file: 2026-04-15/GeoCatalogs_ListBySubscription.json | +| [geoCatalogsUpdateSample.js][geocatalogsupdatesample] | update a GeoCatalog x-ms-original-file: 2026-04-15/GeoCatalogs_Update.json | ## Prerequisites @@ -39,22 +39,22 @@ npm install node geoCatalogsCreateSample.js ``` -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -cross-env node geoCatalogsCreateSample.js +node geoCatalogsCreateSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[geocatalogscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsCreateSample.js -[geocatalogsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsDeleteSample.js -[geocatalogsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsGetSample.js -[geocatalogslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsListByResourceGroupSample.js -[geocatalogslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsListBySubscriptionSample.js -[geocatalogsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsUpdateSample.js +[geocatalogscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsCreateSample.js +[geocatalogsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsDeleteSample.js +[geocatalogsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsGetSample.js +[geocatalogslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsListByResourceGroupSample.js +[geocatalogslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsListBySubscriptionSample.js +[geocatalogsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsUpdateSample.js [apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-planetarycomputer?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/planetarycomputer/arm-planetarycomputer/README.md diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsCreateSample.js b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsCreateSample.js similarity index 86% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsCreateSample.js rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsCreateSample.js index 158b70fcfd1e..4b2841ee36e0 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsCreateSample.js +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsCreateSample.js @@ -8,17 +8,14 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to create a GeoCatalog * * @summary create a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Create.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Create.json */ async function geoCatalogsCreate() { const credential = new DefaultAzureCredential(); const subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; const client = new SpatioClient(credential, subscriptionId); const result = await client.geoCatalogs.create("MyResourceGroup", "MyCatalog", { - properties: { - tier: "Basic", - autoGeneratedDomainNameLabelScope: "NoReuse", - }, + properties: { tier: "Basic", autoGeneratedDomainNameLabelScope: "NoReuse" }, identity: { type: "UserAssigned", userAssignedIdentities: { diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsDeleteSample.js b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsDeleteSample.js similarity index 91% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsDeleteSample.js rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsDeleteSample.js index e7f52d0d1f30..881059f0680f 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsDeleteSample.js +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsDeleteSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to delete a GeoCatalog * * @summary delete a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Delete.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Delete.json */ async function geoCatalogsDelete() { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsGetSample.js b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsGetSample.js similarity index 91% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsGetSample.js rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsGetSample.js index 843af27e4449..f9cfe25cb0e7 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsGetSample.js +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsGetSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to get a GeoCatalog * * @summary get a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Get.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Get.json */ async function geoCatalogsGet() { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsListByResourceGroupSample.js b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsListByResourceGroupSample.js similarity index 91% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsListByResourceGroupSample.js rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsListByResourceGroupSample.js index c7bacb26d91c..29d00b0576f9 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsListByResourceGroupSample.js +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsListByResourceGroupSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to list GeoCatalog resources by resource group * * @summary list GeoCatalog resources by resource group - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListByResourceGroup.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_ListByResourceGroup.json */ async function geoCatalogsListByResourceGroup() { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsListBySubscriptionSample.js b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsListBySubscriptionSample.js similarity index 91% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsListBySubscriptionSample.js rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsListBySubscriptionSample.js index 80ec0ebec77d..fe76848a53e9 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsListBySubscriptionSample.js +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsListBySubscriptionSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to list GeoCatalog resources by subscription ID * * @summary list GeoCatalog resources by subscription ID - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_ListBySubscription.json */ async function geoCatalogsListBySubscription() { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsUpdateSample.js b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsUpdateSample.js similarity index 93% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsUpdateSample.js rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsUpdateSample.js index c098d8aacc2d..b011cd36889d 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/geoCatalogsUpdateSample.js +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/geoCatalogsUpdateSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to update a GeoCatalog * * @summary update a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Update.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Update.json */ async function geoCatalogsUpdate() { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/package.json b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/package.json similarity index 77% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/package.json rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/package.json index 0c3dd567e570..95a5b5043a95 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/package.json +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/package.json @@ -1,8 +1,8 @@ { - "name": "@azure-samples/arm-planetarycomputer-js-beta", + "name": "@azure-samples/arm-planetarycomputer-js", "private": true, "version": "1.0.0", - "description": "@azure/arm-planetarycomputer client library samples for JavaScript (Beta)", + "description": "@azure/arm-planetarycomputer client library samples for JavaScript", "engines": { "node": ">=20.0.0" }, @@ -26,8 +26,11 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/planetarycomputer/arm-planetarycomputer", "dependencies": { - "@azure/arm-planetarycomputer": "next", + "@azure/arm-planetarycomputer": "latest", "dotenv": "latest", - "@azure/identity": "^4.10.0" + "@azure/identity": "^4.13.0" + }, + "devDependencies": { + "cross-env": "latest" } } diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/sample.env b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/sample.env similarity index 100% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/javascript/sample.env rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/javascript/sample.env diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/README.md b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/README.md similarity index 73% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/README.md rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/README.md index 0665e4f137a8..4a65e351aa46 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/README.md +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/README.md @@ -1,15 +1,15 @@ -# @azure/arm-planetarycomputer client library samples for TypeScript (Beta) +# @azure/arm-planetarycomputer client library samples for TypeScript These sample programs show how to use the TypeScript client libraries for @azure/arm-planetarycomputer in some common scenarios. -| **File Name** | **Description** | -| ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| [geoCatalogsCreateSample.ts][geocatalogscreatesample] | create a GeoCatalog x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Create.json | -| [geoCatalogsDeleteSample.ts][geocatalogsdeletesample] | delete a GeoCatalog x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Delete.json | -| [geoCatalogsGetSample.ts][geocatalogsgetsample] | get a GeoCatalog x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Get.json | -| [geoCatalogsListByResourceGroupSample.ts][geocatalogslistbyresourcegroupsample] | list GeoCatalog resources by resource group x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListByResourceGroup.json | -| [geoCatalogsListBySubscriptionSample.ts][geocatalogslistbysubscriptionsample] | list GeoCatalog resources by subscription ID x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json | -| [geoCatalogsUpdateSample.ts][geocatalogsupdatesample] | update a GeoCatalog x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Update.json | +| **File Name** | **Description** | +| ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| [geoCatalogsCreateSample.ts][geocatalogscreatesample] | create a GeoCatalog x-ms-original-file: 2026-04-15/GeoCatalogs_Create.json | +| [geoCatalogsDeleteSample.ts][geocatalogsdeletesample] | delete a GeoCatalog x-ms-original-file: 2026-04-15/GeoCatalogs_Delete.json | +| [geoCatalogsGetSample.ts][geocatalogsgetsample] | get a GeoCatalog x-ms-original-file: 2026-04-15/GeoCatalogs_Get.json | +| [geoCatalogsListByResourceGroupSample.ts][geocatalogslistbyresourcegroupsample] | list GeoCatalog resources by resource group x-ms-original-file: 2026-04-15/GeoCatalogs_ListByResourceGroup.json | +| [geoCatalogsListBySubscriptionSample.ts][geocatalogslistbysubscriptionsample] | list GeoCatalog resources by subscription ID x-ms-original-file: 2026-04-15/GeoCatalogs_ListBySubscription.json | +| [geoCatalogsUpdateSample.ts][geocatalogsupdatesample] | update a GeoCatalog x-ms-original-file: 2026-04-15/GeoCatalogs_Update.json | ## Prerequisites @@ -51,22 +51,22 @@ npm run build node dist/geoCatalogsCreateSample.js ``` -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -cross-env node dist/geoCatalogsCreateSample.js +node dist/geoCatalogsCreateSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[geocatalogscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsCreateSample.ts -[geocatalogsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsDeleteSample.ts -[geocatalogsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsGetSample.ts -[geocatalogslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsListByResourceGroupSample.ts -[geocatalogslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsListBySubscriptionSample.ts -[geocatalogsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsUpdateSample.ts +[geocatalogscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsCreateSample.ts +[geocatalogsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsDeleteSample.ts +[geocatalogsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsGetSample.ts +[geocatalogslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsListByResourceGroupSample.ts +[geocatalogslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsListBySubscriptionSample.ts +[geocatalogsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsUpdateSample.ts [apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-planetarycomputer?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/planetarycomputer/arm-planetarycomputer/README.md diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/package.json b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/package.json similarity index 78% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/package.json rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/package.json index 2ac66d548109..5ac441a78329 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/package.json +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/package.json @@ -1,8 +1,8 @@ { - "name": "@azure-samples/arm-planetarycomputer-ts-beta", + "name": "@azure-samples/arm-planetarycomputer-ts", "private": true, "version": "1.0.0", - "description": "@azure/arm-planetarycomputer client library samples for TypeScript (Beta)", + "description": "@azure/arm-planetarycomputer client library samples for TypeScript", "engines": { "node": ">=20.0.0" }, @@ -30,13 +30,14 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/planetarycomputer/arm-planetarycomputer", "dependencies": { - "@azure/arm-planetarycomputer": "next", + "@azure/arm-planetarycomputer": "latest", "dotenv": "latest", - "@azure/identity": "^4.10.0" + "@azure/identity": "^4.13.0" }, "devDependencies": { "@types/node": "^20.0.0", - "typescript": "~5.8.2", - "rimraf": "latest" + "cross-env": "latest", + "rimraf": "latest", + "typescript": "~5.9.3" } } diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/sample.env b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/sample.env similarity index 100% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/sample.env rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/sample.env diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsCreateSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsCreateSample.ts similarity index 86% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsCreateSample.ts rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsCreateSample.ts index 01f0d732b8b9..66ccef931fa2 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsCreateSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsCreateSample.ts @@ -8,17 +8,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to create a GeoCatalog * * @summary create a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Create.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Create.json */ async function geoCatalogsCreate(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; const client = new SpatioClient(credential, subscriptionId); const result = await client.geoCatalogs.create("MyResourceGroup", "MyCatalog", { - properties: { - tier: "Basic", - autoGeneratedDomainNameLabelScope: "NoReuse", - }, + properties: { tier: "Basic", autoGeneratedDomainNameLabelScope: "NoReuse" }, identity: { type: "UserAssigned", userAssignedIdentities: { diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsDeleteSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsDeleteSample.ts similarity index 91% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsDeleteSample.ts rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsDeleteSample.ts index 9166eeafbeb7..eddb50cdb793 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsDeleteSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsDeleteSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to delete a GeoCatalog * * @summary delete a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Delete.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Delete.json */ async function geoCatalogsDelete(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsGetSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsGetSample.ts similarity index 91% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsGetSample.ts rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsGetSample.ts index 801dc8afdeb0..6d0ca78be650 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsGetSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsGetSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to get a GeoCatalog * * @summary get a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Get.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Get.json */ async function geoCatalogsGet(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsListByResourceGroupSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsListByResourceGroupSample.ts similarity index 91% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsListByResourceGroupSample.ts rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsListByResourceGroupSample.ts index 7909d23bff6a..881b46fe77ca 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsListByResourceGroupSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsListByResourceGroupSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list GeoCatalog resources by resource group * * @summary list GeoCatalog resources by resource group - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListByResourceGroup.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_ListByResourceGroup.json */ async function geoCatalogsListByResourceGroup(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsListBySubscriptionSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsListBySubscriptionSample.ts similarity index 91% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsListBySubscriptionSample.ts rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsListBySubscriptionSample.ts index 50636a9d70e8..eb95cd38215c 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsListBySubscriptionSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsListBySubscriptionSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list GeoCatalog resources by subscription ID * * @summary list GeoCatalog resources by subscription ID - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_ListBySubscription.json */ async function geoCatalogsListBySubscription(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsUpdateSample.ts b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsUpdateSample.ts similarity index 94% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsUpdateSample.ts rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsUpdateSample.ts index 3b845b33ca37..ce53d2600f8e 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/src/geoCatalogsUpdateSample.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/src/geoCatalogsUpdateSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to update a GeoCatalog * * @summary update a GeoCatalog - * x-ms-original-file: 2025-02-11-preview/GeoCatalogs_Update.json + * x-ms-original-file: 2026-04-15/GeoCatalogs_Update.json */ async function geoCatalogsUpdate(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/tsconfig.json b/sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/tsconfig.json similarity index 100% rename from sdk/planetarycomputer/arm-planetarycomputer/samples/v1-beta/typescript/tsconfig.json rename to sdk/planetarycomputer/arm-planetarycomputer/samples/v1/typescript/tsconfig.json diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/api/geoCatalogs/index.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/api/geoCatalogs/index.ts index ecbc2d253d6f..eea61feeb093 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/api/geoCatalogs/index.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/api/geoCatalogs/index.ts @@ -9,11 +9,11 @@ export { create, get, } from "./operations.js"; -export { - type GeoCatalogsListBySubscriptionOptionalParams, - type GeoCatalogsListByResourceGroupOptionalParams, - type GeoCatalogsDeleteOptionalParams, - type GeoCatalogsUpdateOptionalParams, - type GeoCatalogsCreateOptionalParams, - type GeoCatalogsGetOptionalParams, +export type { + GeoCatalogsListBySubscriptionOptionalParams, + GeoCatalogsListByResourceGroupOptionalParams, + GeoCatalogsDeleteOptionalParams, + GeoCatalogsUpdateOptionalParams, + GeoCatalogsCreateOptionalParams, + GeoCatalogsGetOptionalParams, } from "./options.js"; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/api/geoCatalogs/operations.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/api/geoCatalogs/operations.ts index 9c62e3d90441..1008ea90d23c 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/api/geoCatalogs/operations.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/api/geoCatalogs/operations.ts @@ -1,18 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { SpatioContext as Client } from "../index.js"; +import type { SpatioContext as Client } from "../index.js"; +import type { GeoCatalog, GeoCatalogUpdate, _GeoCatalogListResult } from "../../models/models.js"; import { - GeoCatalog, geoCatalogSerializer, geoCatalogDeserializer, errorResponseDeserializer, - GeoCatalogUpdate, geoCatalogUpdateSerializer, - _GeoCatalogListResult, _geoCatalogListResultDeserializer, } from "../../models/models.js"; -import { +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { GeoCatalogsListBySubscriptionOptionalParams, GeoCatalogsListByResourceGroupOptionalParams, GeoCatalogsDeleteOptionalParams, @@ -20,19 +22,9 @@ import { GeoCatalogsCreateOptionalParams, GeoCatalogsGetOptionalParams, } from "./options.js"; -import { - PagedAsyncIterableIterator, - buildPagedAsyncIterator, -} from "../../static-helpers/pagingHelpers.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; -import { - StreamableMethod, - PathUncheckedResponse, - createRestError, - operationOptionsToRequestParameters, -} from "@azure-rest/core-client"; -import { PollerLike, OperationState } from "@azure/core-lro"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; export function _listBySubscriptionSend( context: Client, @@ -42,7 +34,7 @@ export function _listBySubscriptionSend( "/subscriptions/{subscriptionId}/providers/Microsoft.Orbital/geoCatalogs{?api%2Dversion}", { subscriptionId: context.subscriptionId, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2026-04-15", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -50,10 +42,7 @@ export function _listBySubscriptionSend( ); return context.path(path).get({ ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, + headers: { accept: "application/json", ...options.requestOptions?.headers }, }); } @@ -64,6 +53,7 @@ export async function _listBySubscriptionDeserialize( if (!expectedStatuses.includes(result.status)) { const error = createRestError(result); error.details = errorResponseDeserializer(result.body); + throw error; } @@ -80,23 +70,21 @@ export function listBySubscription( () => _listBySubscriptionSend(context, options), _listBySubscriptionDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2026-04-15" }, ); } export function _listByResourceGroupSend( context: Client, resourceGroupName: string, - options: GeoCatalogsListByResourceGroupOptionalParams = { - requestOptions: {}, - }, + options: GeoCatalogsListByResourceGroupOptionalParams = { requestOptions: {} }, ): StreamableMethod { const path = expandUrlTemplate( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs{?api%2Dversion}", { subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2026-04-15", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -104,10 +92,7 @@ export function _listByResourceGroupSend( ); return context.path(path).get({ ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, + headers: { accept: "application/json", ...options.requestOptions?.headers }, }); } @@ -118,6 +103,7 @@ export async function _listByResourceGroupDeserialize( if (!expectedStatuses.includes(result.status)) { const error = createRestError(result); error.details = errorResponseDeserializer(result.body); + throw error; } @@ -128,16 +114,14 @@ export async function _listByResourceGroupDeserialize( export function listByResourceGroup( context: Client, resourceGroupName: string, - options: GeoCatalogsListByResourceGroupOptionalParams = { - requestOptions: {}, - }, + options: GeoCatalogsListByResourceGroupOptionalParams = { requestOptions: {} }, ): PagedAsyncIterableIterator { return buildPagedAsyncIterator( context, () => _listByResourceGroupSend(context, resourceGroupName, options), _listByResourceGroupDeserialize, ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2026-04-15" }, ); } @@ -153,19 +137,13 @@ export function _$deleteSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, catalogName: catalogName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2026-04-15", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, }, ); - return context.path(path).delete({ - ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, - }); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); } export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { @@ -173,6 +151,7 @@ export async function _$deleteDeserialize(result: PathUncheckedResponse): Promis if (!expectedStatuses.includes(result.status)) { const error = createRestError(result); error.details = errorResponseDeserializer(result.body); + throw error; } @@ -196,6 +175,7 @@ export function $delete( abortSignal: options?.abortSignal, getInitialResponse: () => _$deleteSend(context, resourceGroupName, catalogName, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2026-04-15", }) as PollerLike, void>; } @@ -212,7 +192,7 @@ export function _updateSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, catalogName: catalogName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2026-04-15", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -221,19 +201,17 @@ export function _updateSend( return context.path(path).patch({ ...operationOptionsToRequestParameters(options), contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, + headers: { accept: "application/json", ...options.requestOptions?.headers }, body: geoCatalogUpdateSerializer(properties), }); } export async function _updateDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "202"]; + const expectedStatuses = ["200", "202", "201"]; if (!expectedStatuses.includes(result.status)) { const error = createRestError(result); error.details = errorResponseDeserializer(result.body); + throw error; } @@ -248,12 +226,13 @@ export function update( properties: GeoCatalogUpdate, options: GeoCatalogsUpdateOptionalParams = { requestOptions: {} }, ): PollerLike, GeoCatalog> { - return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { updateIntervalInMs: options?.updateIntervalInMs, abortSignal: options?.abortSignal, getInitialResponse: () => _updateSend(context, resourceGroupName, catalogName, properties, options), resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2026-04-15", }) as PollerLike, GeoCatalog>; } @@ -270,7 +249,7 @@ export function _createSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, catalogName: catalogName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2026-04-15", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -279,19 +258,17 @@ export function _createSend( return context.path(path).put({ ...operationOptionsToRequestParameters(options), contentType: "application/json", - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, + headers: { accept: "application/json", ...options.requestOptions?.headers }, body: geoCatalogSerializer(resource), }); } export async function _createDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "201"]; + const expectedStatuses = ["200", "201", "202"]; if (!expectedStatuses.includes(result.status)) { const error = createRestError(result); error.details = errorResponseDeserializer(result.body); + throw error; } @@ -306,12 +283,13 @@ export function create( resource: GeoCatalog, options: GeoCatalogsCreateOptionalParams = { requestOptions: {} }, ): PollerLike, GeoCatalog> { - return getLongRunningPoller(context, _createDeserialize, ["200", "201"], { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { updateIntervalInMs: options?.updateIntervalInMs, abortSignal: options?.abortSignal, getInitialResponse: () => _createSend(context, resourceGroupName, catalogName, resource, options), resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2026-04-15", }) as PollerLike, GeoCatalog>; } @@ -327,7 +305,7 @@ export function _getSend( subscriptionId: context.subscriptionId, resourceGroupName: resourceGroupName, catalogName: catalogName, - "api%2Dversion": context.apiVersion, + "api%2Dversion": context.apiVersion ?? "2026-04-15", }, { allowReserved: options?.requestOptions?.skipUrlEncoding, @@ -335,10 +313,7 @@ export function _getSend( ); return context.path(path).get({ ...operationOptionsToRequestParameters(options), - headers: { - accept: "application/json", - ...options.requestOptions?.headers, - }, + headers: { accept: "application/json", ...options.requestOptions?.headers }, }); } @@ -347,6 +322,7 @@ export async function _getDeserialize(result: PathUncheckedResponse): Promise { - // Use the apiVersion defined in request url directly - // Append one if there is no apiVersion and we have one at client options - const url = new URL(req.url); - if (!url.searchParams.get("api-version")) { - req.url = `${req.url}${ - Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" - }api-version=${apiVersion}`; - } - - return next(req); - }, - }); + const apiVersion = options.apiVersion; return { ...clientContext, apiVersion, subscriptionId } as SpatioContext; } diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/classic/geoCatalogs/index.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/classic/geoCatalogs/index.ts index 5d6029bb0eef..b162761122a1 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/classic/geoCatalogs/index.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/classic/geoCatalogs/index.ts @@ -1,16 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { SpatioContext } from "../../api/spatioContext.js"; -import { GeoCatalog, GeoCatalogUpdate } from "../../models/models.js"; -import { - GeoCatalogsListBySubscriptionOptionalParams, - GeoCatalogsListByResourceGroupOptionalParams, - GeoCatalogsDeleteOptionalParams, - GeoCatalogsUpdateOptionalParams, - GeoCatalogsCreateOptionalParams, - GeoCatalogsGetOptionalParams, -} from "../../api/geoCatalogs/options.js"; +import type { SpatioContext } from "../../api/spatioContext.js"; import { listBySubscription, listByResourceGroup, @@ -19,8 +10,17 @@ import { create, get, } from "../../api/geoCatalogs/operations.js"; -import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { PollerLike, OperationState } from "@azure/core-lro"; +import type { + GeoCatalogsListBySubscriptionOptionalParams, + GeoCatalogsListByResourceGroupOptionalParams, + GeoCatalogsDeleteOptionalParams, + GeoCatalogsUpdateOptionalParams, + GeoCatalogsCreateOptionalParams, + GeoCatalogsGetOptionalParams, +} from "../../api/geoCatalogs/options.js"; +import type { GeoCatalog, GeoCatalogUpdate } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; /** Interface representing a GeoCatalogs operations. */ export interface GeoCatalogsOperations { diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/classic/index.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/classic/index.ts index a00f06c115a6..b7c36f2b1b17 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/classic/index.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/classic/index.ts @@ -1,4 +1,4 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -export { type GeoCatalogsOperations } from "./geoCatalogs/index.js"; +export type { GeoCatalogsOperations } from "./geoCatalogs/index.js"; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/index.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/index.ts index b1a9eb035156..1b1ec894c4b5 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/index.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/index.ts @@ -1,47 +1,54 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { +import type { AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { AzureClouds } from "./static-helpers/cloudSettingHelpers.js"; +import type { PageSettings, ContinuablePage, PagedAsyncIterableIterator, } from "./static-helpers/pagingHelpers.js"; export { SpatioClient } from "./spatioClient.js"; -export { restorePoller, type RestorePollerOptions } from "./restorePollerHelpers.js"; +export type { RestorePollerOptions } from "./restorePollerHelpers.js"; +export { restorePoller } from "./restorePollerHelpers.js"; +export type { + GeoCatalog, + GeoCatalogProperties, + CatalogTier, + ProvisioningState, + AutoGeneratedDomainNameLabelScope, + ManagedServiceIdentity, + ManagedServiceIdentityType, + UserAssignedIdentity, + TrackedResource, + Resource, + SystemData, + CreatedByType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + GeoCatalogUpdate, + ManagedServiceIdentityUpdate, +} from "./models/index.js"; export { - type GeoCatalog, - type GeoCatalogProperties, KnownCatalogTier, - type CatalogTier, KnownProvisioningState, - type ProvisioningState, KnownAutoGeneratedDomainNameLabelScope, - type AutoGeneratedDomainNameLabelScope, - type ManagedServiceIdentity, KnownManagedServiceIdentityType, - type ManagedServiceIdentityType, - type UserAssignedIdentity, - type TrackedResource, - type Resource, - type SystemData, KnownCreatedByType, - type CreatedByType, - type ErrorResponse, - type ErrorDetail, - type ErrorAdditionalInfo, - type GeoCatalogUpdate, - type ManagedServiceIdentityUpdate, KnownVersions, } from "./models/index.js"; -export { type SpatioClientOptionalParams } from "./api/index.js"; -export { - type GeoCatalogsListBySubscriptionOptionalParams, - type GeoCatalogsListByResourceGroupOptionalParams, - type GeoCatalogsDeleteOptionalParams, - type GeoCatalogsUpdateOptionalParams, - type GeoCatalogsCreateOptionalParams, - type GeoCatalogsGetOptionalParams, +export type { SpatioClientOptionalParams } from "./api/index.js"; +export type { + GeoCatalogsListBySubscriptionOptionalParams, + GeoCatalogsListByResourceGroupOptionalParams, + GeoCatalogsDeleteOptionalParams, + GeoCatalogsUpdateOptionalParams, + GeoCatalogsCreateOptionalParams, + GeoCatalogsGetOptionalParams, } from "./api/geoCatalogs/index.js"; -export { type GeoCatalogsOperations } from "./classic/index.js"; -export { type PageSettings, type ContinuablePage, type PagedAsyncIterableIterator }; +export type { GeoCatalogsOperations } from "./classic/index.js"; +export type { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds }; +export type { AzureSupportedClouds }; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/models/index.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/models/index.ts index 44d7d2e3b65c..054e6ec9b721 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/models/index.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/models/index.ts @@ -1,28 +1,30 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +export type { + GeoCatalog, + GeoCatalogProperties, + CatalogTier, + ProvisioningState, + AutoGeneratedDomainNameLabelScope, + ManagedServiceIdentity, + ManagedServiceIdentityType, + UserAssignedIdentity, + TrackedResource, + Resource, + SystemData, + CreatedByType, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + GeoCatalogUpdate, + ManagedServiceIdentityUpdate, +} from "./models.js"; export { - type GeoCatalog, - type GeoCatalogProperties, KnownCatalogTier, - type CatalogTier, KnownProvisioningState, - type ProvisioningState, KnownAutoGeneratedDomainNameLabelScope, - type AutoGeneratedDomainNameLabelScope, - type ManagedServiceIdentity, KnownManagedServiceIdentityType, - type ManagedServiceIdentityType, - type UserAssignedIdentity, - type TrackedResource, - type Resource, - type SystemData, KnownCreatedByType, - type CreatedByType, - type ErrorResponse, - type ErrorDetail, - type ErrorAdditionalInfo, - type GeoCatalogUpdate, - type ManagedServiceIdentityUpdate, KnownVersions, } from "./models.js"; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/models/models.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/models/models.ts index 0a13e2b55c7a..027a5a530a2e 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/models/models.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/models/models.ts @@ -1,6 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +/** + * This file contains only generated model types and their (de)serializers. + * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input. + */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ /** A Microsoft Planetary Computer Pro GeoCatalog resource */ export interface GeoCatalog extends TrackedResource { /** The resource-specific properties for this resource. */ @@ -24,7 +30,9 @@ export function geoCatalogSerializer(item: GeoCatalog): any { export function geoCatalogDeserializer(item: any): GeoCatalog { return { - tags: item["tags"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), location: item["location"], id: item["id"], name: item["name"], @@ -150,14 +158,11 @@ export interface ManagedServiceIdentity { /** The type of managed identity assigned to this resource. */ type: ManagedServiceIdentityType; /** The identities assigned to this resource by the user. */ - userAssignedIdentities?: Record; + userAssignedIdentities?: Record; } export function managedServiceIdentitySerializer(item: ManagedServiceIdentity): any { - return { - type: item["type"], - userAssignedIdentities: item["userAssignedIdentities"], - }; + return { type: item["type"], userAssignedIdentities: item["userAssignedIdentities"] }; } export function managedServiceIdentityDeserializer(item: any): ManagedServiceIdentity { @@ -165,7 +170,14 @@ export function managedServiceIdentityDeserializer(item: any): ManagedServiceIde principalId: item["principalId"], tenantId: item["tenantId"], type: item["type"], - userAssignedIdentities: item["userAssignedIdentities"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : Object.fromEntries( + Object.entries(item["userAssignedIdentities"]).map(([k, p]: [string, any]) => [ + k, + !p ? p : userAssignedIdentityDeserializer(p), + ]), + ), }; } @@ -232,7 +244,9 @@ export function trackedResourceDeserializer(item: any): TrackedResource { systemData: !item["systemData"] ? item["systemData"] : systemDataDeserializer(item["systemData"]), - tags: item["tags"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), location: item["location"], }; } @@ -307,7 +321,7 @@ export enum KnownCreatedByType { /** * The kind of entity that created the resource. \ - * {@link KnowncreatedByType} can be used interchangeably with createdByType, + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, * this enum contains the known values that the service supports. * ### Known values supported by the service * **User**: The entity was created by a user. \ @@ -372,23 +386,16 @@ export interface ErrorAdditionalInfo { /** The additional info type. */ readonly type?: string; /** The additional info. */ - readonly info?: Record; + readonly info?: any; } export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { return { type: item["type"], - info: !item["info"] ? item["info"] : _errorAdditionalInfoInfoDeserializer(item["info"]), + info: item["info"], }; } -/** model interface _ErrorAdditionalInfoInfo */ -export interface _ErrorAdditionalInfoInfo {} - -export function _errorAdditionalInfoInfoDeserializer(item: any): _ErrorAdditionalInfoInfo { - return item; -} - /** The properties of a GeoCatalog that can be updated. */ export interface GeoCatalogUpdate { /** Resource tags. */ @@ -411,14 +418,11 @@ export interface ManagedServiceIdentityUpdate { /** The type of managed identity assigned to this resource. */ type?: ManagedServiceIdentityType; /** The identities assigned to this resource by the user. */ - userAssignedIdentities?: Record; + userAssignedIdentities?: Record; } export function managedServiceIdentityUpdateSerializer(item: ManagedServiceIdentityUpdate): any { - return { - type: item["type"], - userAssignedIdentities: item["userAssignedIdentities"], - }; + return { type: item["type"], userAssignedIdentities: item["userAssignedIdentities"] }; } /** The response of a GeoCatalog list operation. */ @@ -450,6 +454,6 @@ export function geoCatalogArrayDeserializer(result: Array): any[] { /** Known values of {@link Versions} that the service accepts. */ export enum KnownVersions { - V20240131Preview = "2024-01-31-preview", - V20250211Preview = "2025-02-11-preview", + /** 2026-04-15 */ + _20260415 = "2026-04-15", } diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/restorePollerHelpers.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/restorePollerHelpers.ts index 9e389f4da5aa..e000802e74d4 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/restorePollerHelpers.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/restorePollerHelpers.ts @@ -1,21 +1,17 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { SpatioClient } from "./spatioClient.js"; +import type { SpatioClient } from "./spatioClient.js"; import { _$deleteDeserialize, _updateDeserialize, _createDeserialize, } from "./api/geoCatalogs/operations.js"; import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; -import { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; -import { AbortSignalLike } from "@azure/abort-controller"; -import { - PollerLike, - OperationState, - deserializeState, - ResourceLocationConfig, -} from "@azure/core-lro"; +import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; +import type { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro"; +import { deserializeState } from "@azure/core-lro"; export interface RestorePollerOptions< TResult, @@ -60,6 +56,7 @@ export function restorePoller( `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, ); } + const apiVersion = getApiVersionFromUrl(initialRequestUrl); return getLongRunningPoller( (client as any)["_client"] ?? client, deserializeHelper as (result: TResponse) => Promise, @@ -70,25 +67,23 @@ export function restorePoller( resourceLocationConfig, restoreFrom: serializedState, initialRequestUrl, + apiVersion, }, ); } interface DeserializationHelper { - deserializer: Function; + deserializer: (result: PathUncheckedResponse) => Promise; expectedStatuses: string[]; } const deserializeMap: Record = { "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName}": - { - deserializer: _$deleteDeserialize, - expectedStatuses: ["202", "204", "200"], - }, + { deserializer: _$deleteDeserialize, expectedStatuses: ["202", "204", "200"] }, "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName}": - { deserializer: _updateDeserialize, expectedStatuses: ["200", "202"] }, + { deserializer: _updateDeserialize, expectedStatuses: ["200", "202", "201"] }, "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName}": - { deserializer: _createDeserialize, expectedStatuses: ["200", "201"] }, + { deserializer: _createDeserialize, expectedStatuses: ["200", "201", "202"] }, }; function getDeserializationHelper( @@ -160,3 +155,8 @@ function getPathFromMapKey(mapKey: string): string { const pathStart = mapKey.indexOf("/"); return mapKey.slice(pathStart); } + +function getApiVersionFromUrl(urlStr: string): string | undefined { + const url = new URL(urlStr); + return url.searchParams.get("api-version") ?? undefined; +} diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/spatioClient.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/spatioClient.ts index 7b8d4dfdfada..19e27e82b4a7 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/spatioClient.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/spatioClient.ts @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { createSpatio, SpatioContext, SpatioClientOptionalParams } from "./api/index.js"; -import { GeoCatalogsOperations, _getGeoCatalogsOperations } from "./classic/geoCatalogs/index.js"; -import { Pipeline } from "@azure/core-rest-pipeline"; -import { TokenCredential } from "@azure/core-auth"; +import type { SpatioContext, SpatioClientOptionalParams } from "./api/index.js"; +import { createSpatio } from "./api/index.js"; +import type { GeoCatalogsOperations } from "./classic/geoCatalogs/index.js"; +import { _getGeoCatalogsOperations } from "./classic/geoCatalogs/index.js"; +import type { TokenCredential } from "@azure/core-auth"; +import type { Pipeline } from "@azure/core-rest-pipeline"; -export { type SpatioClientOptionalParams } from "./api/spatioContext.js"; +export type { SpatioClientOptionalParams } from "./api/spatioContext.js"; export class SpatioClient { private _client: SpatioContext; diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/cloudSettingHelpers.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..613112c6e397 --- /dev/null +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/pagingHelpers.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/pagingHelpers.ts index ce33af5f4178..9258ba95eda8 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/pagingHelpers.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/pagingHelpers.ts @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; import { RestError } from "@azure/core-rest-pipeline"; /** @@ -79,6 +80,8 @@ export interface PagedResult< export interface BuildPagedAsyncIteratorOptions { itemName?: string; nextLinkName?: string; + nextLinkMethod?: "GET" | "POST"; + apiVersion?: string; } /** @@ -98,12 +101,20 @@ export function buildPagedAsyncIterator< ): PagedAsyncIterableIterator { const itemName = options.itemName ?? "value"; const nextLinkName = options.nextLinkName ?? "nextLink"; + const nextLinkMethod = options.nextLinkMethod ?? "GET"; + const apiVersion = options.apiVersion; const pagedResult: PagedResult = { getPage: async (pageLink?: string) => { - const result = - pageLink === undefined - ? await getInitialResponse() - : await client.pathUnchecked(pageLink).get(); + let result; + if (pageLink === undefined) { + result = await getInitialResponse(); + } else { + const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink; + result = + nextLinkMethod === "POST" + ? await client.pathUnchecked(resolvedPageLink).post() + : await client.pathUnchecked(resolvedPageLink).get(); + } checkPagingRequest(result, expectedStatuses); const results = await processResponseBody(result as TResponse); const nextLink = getNextLink(results, nextLinkName); @@ -239,3 +250,21 @@ function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: s ); } } + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/pollingHelpers.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/pollingHelpers.ts index f01c41bab69d..8e36a866edcc 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/pollingHelpers.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/pollingHelpers.ts @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { +import type { PollerLike, OperationState, ResourceLocationConfig, RunningOperation, - createHttpPoller, OperationResponse, } from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; -import { Client, PathUncheckedResponse, createRestError } from "@azure-rest/core-client"; -import { AbortSignalLike } from "@azure/abort-controller"; +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; export interface GetLongRunningPollerOptions { /** Delay to wait until next poll, in milliseconds. */ @@ -37,6 +38,10 @@ export interface GetLongRunningPollerOptions { * The function to get the initial response */ getInitialResponse?: () => PromiseLike; + /** + * The api-version of the LRO + */ + apiVersion?: string; } export function getLongRunningPoller( client: Client, @@ -44,7 +49,7 @@ export function getLongRunningPoller, ): PollerLike, TResult> { - const { restoreFrom, getInitialResponse } = options; + const { restoreFrom, getInitialResponse, apiVersion } = options; if (!restoreFrom && !getInitialResponse) { throw new Error("Either restoreFrom or getInitialResponse must be specified"); } @@ -83,7 +88,8 @@ export function getLongRunningPoller( }, }; } + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/urlTemplate.ts b/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/urlTemplate.ts index 9aac558fb377..e8af8cd3ab73 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/urlTemplate.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/src/static-helpers/urlTemplate.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -//--------------------- +// --------------------- // interfaces -//--------------------- +// --------------------- interface ValueOptions { isFirst: boolean; // is first value in the expression op?: string; // operator @@ -21,27 +21,27 @@ export interface UrlTemplateOptions { // --------------------- // helpers // --------------------- -function encodeComponent(val: string, reserved?: boolean, op?: string) { +function encodeComponent(val: string, reserved?: boolean, op?: string): string { return (reserved ?? op === "+") || op === "#" ? encodeReservedComponent(val) : encodeRFC3986URIComponent(val); } -function encodeReservedComponent(str: string) { +function encodeReservedComponent(str: string): string { return str .split(/(%[0-9A-Fa-f]{2})/g) .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) .join(""); } -function encodeRFC3986URIComponent(str: string) { +function encodeRFC3986URIComponent(str: string): string { return encodeURIComponent(str).replace( /[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, ); } -function isDefined(val: any) { +function isDefined(val: any): boolean { return val !== undefined && val !== null; } @@ -49,7 +49,7 @@ function getNamedAndIfEmpty(op?: string): [boolean, string] { return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; } -function getFirstOrSep(op?: string, isFirst = false) { +function getFirstOrSep(op?: string, isFirst = false): string { if (isFirst) { return !op || op === "+" ? "" : op; } else if (!op || op === "+" || op === "#") { @@ -61,7 +61,7 @@ function getFirstOrSep(op?: string, isFirst = false) { } } -function getExpandedValue(option: ValueOptions) { +function getExpandedValue(option: ValueOptions): string { let isFirst = option.isFirst; const { op, varName, varValue: value, reserved } = option; const vals: string[] = []; @@ -73,7 +73,11 @@ function getExpandedValue(option: ValueOptions) { vals.push(`${getFirstOrSep(op, isFirst)}`); if (named && varName) { vals.push(`${encodeURIComponent(varName)}`); - val === "" ? vals.push(ifEmpty) : vals.push("="); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } } vals.push(encodeComponent(val, reserved, op)); isFirst = false; @@ -88,7 +92,11 @@ function getExpandedValue(option: ValueOptions) { vals.push(`${getFirstOrSep(op, isFirst)}`); if (key) { vals.push(`${encodeURIComponent(key)}`); - named && val === "" ? vals.push(ifEmpty) : vals.push("="); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } } vals.push(encodeComponent(val, reserved, op)); isFirst = false; @@ -97,7 +105,7 @@ function getExpandedValue(option: ValueOptions) { return vals.join(""); } -function getNonExpandedValue(option: ValueOptions) { +function getNonExpandedValue(option: ValueOptions): string | undefined { const { op, varName, varValue: value, isFirst, reserved } = option; const vals: string[] = []; const first = getFirstOrSep(op, isFirst); @@ -143,7 +151,11 @@ function getVarValue(option: ValueOptions): string | undefined { if (named && varName) { // No need to encode varName considering it is already encoded vals.push(varName); - val === "" ? vals.push(ifEmpty) : vals.push("="); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } } if (modifier && modifier !== "*") { val = val.substring(0, parseInt(modifier, 10)); @@ -165,23 +177,24 @@ export function expandUrlTemplate( context: Record, option?: UrlTemplateOptions, ): string { - return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, (_, expr, text) => { + const result = template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { if (!expr) { return encodeReservedComponent(text); } let op; if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { - ((op = expr[0]), (expr = expr.slice(1))); + op = expr[0]; + expr = expr.slice(1); } const varList = expr.split(/,/g); - const result = []; + const innerResult = []; for (const varSpec of varList) { - const varMatch = /([^:\*]*)(?::(\d+)|(\*))?/.exec(varSpec); + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); if (!varMatch || !varMatch[1]) { continue; } const varValue = getVarValue({ - isFirst: result.length === 0, + isFirst: innerResult.length === 0, op, varValue: context[varMatch[1]], varName: varMatch[1], @@ -189,9 +202,26 @@ export function expandUrlTemplate( reserved: option?.allowReserved, }); if (varValue) { - result.push(varValue); + innerResult.push(varValue); } } - return result.join(""); + return innerResult.join(""); + }); + + return normalizeUnreserved(result); +} + +/** + * Normalize an expanded URI by decoding percent-encoded unreserved characters. + * RFC 3986 unreserved: "-" / "." / "~" + */ +function normalizeUnreserved(uri: string): string { + return uri.replace(/%([0-9A-Fa-f]{2})/g, (match, hex) => { + const char = String.fromCharCode(parseInt(hex, 16)); + // Decode only if it's unreserved + if (/[.~-]/.test(char)) { + return char; + } + return match; // leave other encodings intact }); } diff --git a/sdk/planetarycomputer/arm-planetarycomputer/test/public/planetarycomputer_operations_test.spec.ts b/sdk/planetarycomputer/arm-planetarycomputer/test/public/planetarycomputer_operations_test.spec.ts index cd83779dd86f..b80ca6519e30 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/test/public/planetarycomputer_operations_test.spec.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/test/public/planetarycomputer_operations_test.spec.ts @@ -5,7 +5,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { env, Recorder, isPlaybackMode } from "@azure-tools/test-recorder"; +import type { Recorder } from "@azure-tools/test-recorder"; +import { env, isPlaybackMode } from "@azure-tools/test-recorder"; import { createTestCredential } from "@azure-tools/test-credential"; import { assert, beforeEach, afterEach, it, describe } from "vitest"; import { createRecorder } from "./utils/recordedClient.js"; @@ -19,25 +20,82 @@ describe("planetarycomputer test", () => { let recorder: Recorder; let subscriptionId: string; let client: SpatioClient; + let resourceGroupName: string; + let catalogName: string; beforeEach(async (context) => { process.env.SystemRoot = process.env.SystemRoot || "C:\\Windows"; recorder = await createRecorder(context); subscriptionId = env.SUBSCRIPTION_ID || ""; - // This is an example of how the environment variables are used + resourceGroupName = env.RESOURCE_GROUP || ""; + catalogName = env.CATALOG_NAME || ""; const credential = createTestCredential(); - client = new SpatioClient(credential, subscriptionId, recorder.configureClientOptions({})); + client = new SpatioClient( + credential, + subscriptionId, + recorder.configureClientOptions({ apiVersion: "2026-04-15" }), + ); }); afterEach(async function () { await recorder.stop(); }); - it("geoCatalogs list test", async function () { + it("geoCatalogs create test", { timeout: 9000000 }, async function () { + const poller = client.geoCatalogs.create( + resourceGroupName, + catalogName, + { + location: "eastus", + properties: { + autoGeneratedDomainNameLabelScope: "TenantReuse", + }, + }, + testPollingOptions, + ); + const result = await poller.pollUntilDone(); + assert.ok(result.name); + assert.equal(result.properties?.provisioningState, "Succeeded"); + }); + + it("geoCatalogs get test", async function () { + const result = await client.geoCatalogs.get(resourceGroupName, catalogName); + assert.ok(result.name); + assert.ok(result.properties?.catalogUri); + }); + + it("geoCatalogs update test", { timeout: 9000000 }, async function () { + const poller = client.geoCatalogs.update( + resourceGroupName, + catalogName, + { + tags: { testKey: "testValue" }, + }, + testPollingOptions, + ); + await poller.pollUntilDone(); + const result = await client.geoCatalogs.get(resourceGroupName, catalogName); + assert.equal(result.tags?.["testKey"], "testValue"); + }); + + it("geoCatalogs list by resource group test", async function () { const resArray = new Array(); - for await (let item of client.geoCatalogs.listBySubscription()) { + for await (const item of client.geoCatalogs.listByResourceGroup(resourceGroupName)) { resArray.push(item); } - assert.ok(resArray); + assert.ok(resArray.length >= 1); + }); + + it("geoCatalogs list by subscription test", async function () { + const resArray = new Array(); + for await (const item of client.geoCatalogs.listBySubscription()) { + resArray.push(item); + } + assert.ok(resArray.length >= 1); + }); + + it("geoCatalogs delete test", { timeout: 9000000 }, async function () { + const poller = client.geoCatalogs.delete(resourceGroupName, catalogName, testPollingOptions); + await poller.pollUntilDone(); }); }); diff --git a/sdk/planetarycomputer/arm-planetarycomputer/test/public/utils/recordedClient.ts b/sdk/planetarycomputer/arm-planetarycomputer/test/public/utils/recordedClient.ts index 14dcd9fa397c..e943e7d9fd9a 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/test/public/utils/recordedClient.ts +++ b/sdk/planetarycomputer/arm-planetarycomputer/test/public/utils/recordedClient.ts @@ -1,14 +1,37 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { Recorder, RecorderStartOptions, VitestTestContext } from "@azure-tools/test-recorder"; +import type { RecorderStartOptions, VitestTestContext } from "@azure-tools/test-recorder"; +import { Recorder } from "@azure-tools/test-recorder"; const replaceableVariables: Record = { SUBSCRIPTION_ID: "azure_subscription_id", + RESOURCE_GROUP: "test-rg", + CATALOG_NAME: "test-catalog", }; const recorderEnvSetup: RecorderStartOptions = { envSetupForPlayback: replaceableVariables, + sanitizerOptions: { + generalSanitizers: [ + { + regex: true, + target: + "https://[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+\\.geocatalog\\.spatio\\.azure\\.com", + value: "https://sanitized.sanitized.sanitized.geocatalog.spatio.azure.com", + }, + { + regex: true, + target: "/resourceGroups/[^/]+/providers", + value: "/resourceGroups/test-rg/providers", + }, + { + regex: true, + target: '/userAssignedIdentities/[^"]+', + value: "/userAssignedIdentities/sanitized-identity", + }, + ], + }, }; /** @@ -19,5 +42,6 @@ const recorderEnvSetup: RecorderStartOptions = { export async function createRecorder(context: VitestTestContext): Promise { const recorder = new Recorder(context); await recorder.start(recorderEnvSetup); + await recorder.setMatcher("HeaderlessMatcher"); return recorder; } diff --git a/sdk/planetarycomputer/arm-planetarycomputer/tsp-location.yaml b/sdk/planetarycomputer/arm-planetarycomputer/tsp-location.yaml index 7ea6dc2f887c..7683cc3b432d 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/tsp-location.yaml +++ b/sdk/planetarycomputer/arm-planetarycomputer/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/orbitalplanetarycomputer/Orbital.Management -commit: 8279d4aee23a3fef5aac9c76333b0895c83e44c3 +commit: 5e21babae10dd7056c3005bb51da815f0495f1aa repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/planetarycomputer/arm-planetarycomputer/warp.config.yml b/sdk/planetarycomputer/arm-planetarycomputer/warp.config.yml index 02e7e2538183..cec71089ee08 100644 --- a/sdk/planetarycomputer/arm-planetarycomputer/warp.config.yml +++ b/sdk/planetarycomputer/arm-planetarycomputer/warp.config.yml @@ -1,5 +1,5 @@ extends: ../../../warp.base.config.yml exports: "./api": "./src/api/index.ts" - "./api/geoCatalogs": "./src/api/geoCatalogs/index.ts" + "./api/geoCatalogs": "src/api/geoCatalogs/index.ts" "./models": "./src/models/index.ts"