-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding typespec-azure-portal-core package (#224)
- Loading branch information
Showing
23 changed files
with
1,031 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@azure-tools/typespec-azure-portal-core": none | ||
--- | ||
|
||
adding typespec-azure-portal-core lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
docs/libraries/typespec-azure-portal-core/reference/data-types.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
title: "Data types" | ||
toc_min_heading_level: 2 | ||
toc_max_heading_level: 3 | ||
--- | ||
|
||
# Data types | ||
|
||
## Azure.Portal | ||
|
||
### `AboutOptions` {#Azure.Portal.AboutOptions} | ||
|
||
Options for about of ARM resource. | ||
|
||
```typespec | ||
model Azure.Portal.AboutOptions | ||
``` | ||
|
||
### `BrowseOptions` {#Azure.Portal.BrowseOptions} | ||
|
||
Options for browse of ARM resource. | ||
|
||
```typespec | ||
model Azure.Portal.BrowseOptions | ||
``` | ||
|
||
### `FilePath` {#Azure.Portal.FilePath} | ||
|
||
File path of a file | ||
|
||
```typespec | ||
model Azure.Portal.FilePath | ||
``` | ||
|
||
### `marketplaceOfferOptions` {#Azure.Portal.marketplaceOfferOptions} | ||
|
||
Options for marketplaceOffer | ||
|
||
```typespec | ||
model Azure.Portal.marketplaceOfferOptions | ||
``` |
81 changes: 81 additions & 0 deletions
81
docs/libraries/typespec-azure-portal-core/reference/decorators.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
title: "Decorators" | ||
toc_min_heading_level: 2 | ||
toc_max_heading_level: 3 | ||
--- | ||
|
||
# Decorators | ||
|
||
## Azure.Portal | ||
|
||
### `@about` {#@Azure.Portal.about} | ||
|
||
Provides a Model describing about of ARM resource. | ||
|
||
```typespec | ||
@Azure.Portal.about(options: Azure.Portal.AboutOptions) | ||
``` | ||
|
||
#### Target | ||
|
||
`Model` | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ------- | --------------------------------- | ------------------------------------------------------------------------ | | ||
| options | `model Azure.Portal.AboutOptions` | Property options allows more detailed infomation about the resourceType. | | ||
|
||
### `@browse` {#@Azure.Portal.browse} | ||
|
||
Provides a Model customizing browse view of ARM resource. | ||
|
||
```typespec | ||
@Azure.Portal.browse(options: Azure.Portal.BrowseOptions) | ||
``` | ||
|
||
#### Target | ||
|
||
`Model` | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ------- | ---------------------------------- | ------------------------------------------------------------------- | | ||
| options | `model Azure.Portal.BrowseOptions` | Property options provides browsing information of the resourceType. | | ||
|
||
### `@displayName` {#@Azure.Portal.displayName} | ||
|
||
Provides a Model Property a display name | ||
|
||
```typespec | ||
@Azure.Portal.displayName(name: valueof string) | ||
``` | ||
|
||
#### Target | ||
|
||
`ModelProperty` | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ----------------------- | ----------- | | ||
| name | `valueof scalar string` | | | ||
|
||
### `@marketplaceOffer` {#@Azure.Portal.marketplaceOffer} | ||
|
||
Provides a Model marketplace offer information of ARM resource. | ||
|
||
```typespec | ||
@Azure.Portal.marketplaceOffer(options: Azure.Portal.marketplaceOfferOptions) | ||
``` | ||
|
||
#### Target | ||
|
||
`Model` | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ------- | -------------------------------------------- | ---------------------------------------------------------------------------- | | ||
| options | `model Azure.Portal.marketplaceOfferOptions` | Property options provides marketplace offer information of the resourceType. | |
50 changes: 50 additions & 0 deletions
50
docs/libraries/typespec-azure-portal-core/reference/index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Overview | ||
sidebar_position: 0 | ||
toc_min_heading_level: 2 | ||
toc_max_heading_level: 3 | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# Overview | ||
|
||
TypeSpec Azure Portal Core library | ||
|
||
## Install | ||
|
||
<Tabs> | ||
<TabItem value="spec" label="In a spec" default> | ||
|
||
```bash | ||
npm install @azure-tools/typespec-azure-portal-core | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="library" label="In a library" default> | ||
|
||
```bash | ||
npm install --save-peer @azure-tools/typespec-azure-portal-core | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
## Azure | ||
|
||
## Azure.Portal | ||
|
||
### Decorators | ||
|
||
- [`@about`](./decorators.md#@Azure.Portal.about) | ||
- [`@browse`](./decorators.md#@Azure.Portal.browse) | ||
- [`@displayName`](./decorators.md#@Azure.Portal.displayName) | ||
- [`@marketplaceOffer`](./decorators.md#@Azure.Portal.marketplaceOffer) | ||
|
||
### Models | ||
|
||
- [`AboutOptions`](./data-types.md#Azure.Portal.AboutOptions) | ||
- [`BrowseOptions`](./data-types.md#Azure.Portal.BrowseOptions) | ||
- [`FilePath`](./data-types.md#Azure.Portal.FilePath) | ||
- [`marketplaceOfferOptions`](./data-types.md#Azure.Portal.marketplaceOfferOptions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require("@typespec/eslint-config-typespec/patch/modern-module-resolution"); | ||
|
||
module.exports = { | ||
plugins: ["@typespec/eslint-plugin"], | ||
extends: ["@typespec/eslint-config-typespec", "plugin:@typespec/eslint-plugin/recommended"], | ||
parserOptions: { tsconfigRootDir: __dirname, project: "tsconfig.config.json" }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# @azure-tools/typespec-azure-portal-core | ||
|
||
TypeSpec Azure Portal Core library | ||
|
||
## Install | ||
|
||
```bash | ||
npm install @azure-tools/typespec-azure-portal-core | ||
``` | ||
|
||
## Decorators | ||
|
||
### Azure.Portal | ||
|
||
- [`@about`](#@about) | ||
- [`@browse`](#@browse) | ||
- [`@displayName`](#@displayname) | ||
- [`@marketplaceOffer`](#@marketplaceoffer) | ||
|
||
#### `@about` | ||
|
||
Provides a Model describing about of ARM resource. | ||
|
||
```typespec | ||
@Azure.Portal.about(options: Azure.Portal.AboutOptions) | ||
``` | ||
|
||
##### Target | ||
|
||
`Model` | ||
|
||
##### Parameters | ||
|
||
| Name | Type | Description | | ||
| ------- | --------------------------------- | ------------------------------------------------------------------------ | | ||
| options | `model Azure.Portal.AboutOptions` | Property options allows more detailed infomation about the resourceType. | | ||
|
||
#### `@browse` | ||
|
||
Provides a Model customizing browse view of ARM resource. | ||
|
||
```typespec | ||
@Azure.Portal.browse(options: Azure.Portal.BrowseOptions) | ||
``` | ||
|
||
##### Target | ||
|
||
`Model` | ||
|
||
##### Parameters | ||
|
||
| Name | Type | Description | | ||
| ------- | ---------------------------------- | ------------------------------------------------------------------- | | ||
| options | `model Azure.Portal.BrowseOptions` | Property options provides browsing information of the resourceType. | | ||
|
||
#### `@displayName` | ||
|
||
Provides a Model Property a display name | ||
|
||
```typespec | ||
@Azure.Portal.displayName(name: valueof string) | ||
``` | ||
|
||
##### Target | ||
|
||
`ModelProperty` | ||
|
||
##### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---- | ----------------------- | ----------- | | ||
| name | `valueof scalar string` | | | ||
|
||
#### `@marketplaceOffer` | ||
|
||
Provides a Model marketplace offer information of ARM resource. | ||
|
||
```typespec | ||
@Azure.Portal.marketplaceOffer(options: Azure.Portal.marketplaceOfferOptions) | ||
``` | ||
|
||
##### Target | ||
|
||
`Model` | ||
|
||
##### Parameters | ||
|
||
| Name | Type | Description | | ||
| ------- | -------------------------------------------- | ---------------------------------------------------------------------------- | | ||
| options | `model Azure.Portal.marketplaceOfferOptions` | Property options provides marketplace offer information of the resourceType. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import "../dist/src/index.js"; | ||
|
||
using TypeSpec.Reflection; | ||
namespace Azure.Portal; | ||
|
||
/** | ||
* Provides a Model describing about of ARM resource. | ||
* @param options Property options allows more detailed infomation about the resourceType. | ||
*/ | ||
extern dec about(target: Model, options: AboutOptions); | ||
|
||
/** | ||
* Provides a Model customizing browse view of ARM resource. | ||
* @param options Property options provides browsing information of the resourceType. | ||
*/ | ||
extern dec browse(target: Model, options: BrowseOptions); | ||
|
||
/** | ||
* Provides a Model marketplace offer information of ARM resource. | ||
* @param options Property options provides marketplace offer information of the resourceType. | ||
*/ | ||
extern dec marketplaceOffer(target: Model, options: marketplaceOfferOptions); | ||
|
||
/** | ||
* Provides a Model Property a display name | ||
*/ | ||
extern dec displayName(target: ModelProperty, name: valueof string); | ||
|
||
// this decorator will be available in next iteration | ||
//extern dec essentials(target: ModelProperty); | ||
|
||
/** Options for browse of ARM resource. */ | ||
model BrowseOptions { | ||
/** argQuery can be a literal string query or KQL file path. | ||
* KQL query which represents all possible data for your desired browse view. | ||
*/ | ||
argQuery?: string | FilePath; | ||
} | ||
|
||
/** File path of a file */ | ||
model FilePath { | ||
/** File path of a file */ | ||
filePath: string; | ||
} | ||
|
||
/** Options for marketplaceOffer */ | ||
model marketplaceOfferOptions { | ||
/** Marketplace offer id of a resource */ | ||
id?: string; | ||
} | ||
|
||
/** Options for about of ARM resource. */ | ||
model AboutOptions { | ||
/** Icon which represent resource */ | ||
icon?: FilePath; | ||
|
||
/** Display name which represent the resource */ | ||
displayName?: string; | ||
|
||
/** Comma-separated set of words or phrases which allow users to search for your asset by identifiers. */ | ||
keywords?: string[]; | ||
|
||
/** Set of links which can help learn more about the resource */ | ||
learnMoreDocs?: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./decorators.tsp"; |
Oops, something went wrong.