@azure-tools/typespec-ts 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_build.json +195 -71
- package/.rush/temp/shrinkwrap-deps.json +58 -54
- package/CHANGELOG.md +4 -0
- package/CONTRIBUTING.md +5 -2
- package/README.md +3 -3
- package/dist/src/casingUtils.d.ts +4 -0
- package/dist/src/casingUtils.d.ts.map +1 -0
- package/dist/src/casingUtils.js +39 -0
- package/dist/src/casingUtils.js.map +1 -0
- package/dist/src/emitUtil.js +7 -1
- package/dist/src/emitUtil.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +41 -9
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +2 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/modelUtils.d.ts +22 -1
- package/dist/src/modelUtils.d.ts.map +1 -1
- package/dist/src/modelUtils.js +105 -13
- package/dist/src/modelUtils.js.map +1 -1
- package/dist/src/modular/buildApiIndex.d.ts +3 -0
- package/dist/src/modular/buildApiIndex.d.ts.map +1 -0
- package/dist/src/modular/buildApiIndex.js +12 -0
- package/dist/src/modular/buildApiIndex.js.map +1 -0
- package/dist/src/modular/buildClassicalClient.d.ts +4 -0
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -0
- package/dist/src/modular/buildClassicalClient.js +112 -0
- package/dist/src/modular/buildClassicalClient.js.map +1 -0
- package/dist/src/modular/buildClientContext.d.ts +7 -0
- package/dist/src/modular/buildClientContext.d.ts.map +1 -0
- package/dist/src/modular/buildClientContext.js +72 -0
- package/dist/src/modular/buildClientContext.js.map +1 -0
- package/dist/src/modular/buildCodeModel.d.ts +14 -0
- package/dist/src/modular/buildCodeModel.d.ts.map +1 -0
- package/dist/src/modular/buildCodeModel.js +1110 -0
- package/dist/src/modular/buildCodeModel.js.map +1 -0
- package/dist/src/modular/buildOperations.d.ts +13 -0
- package/dist/src/modular/buildOperations.d.ts.map +1 -0
- package/dist/src/modular/buildOperations.js +70 -0
- package/dist/src/modular/buildOperations.js.map +1 -0
- package/dist/src/modular/buildProjectFiles.d.ts +5 -0
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -0
- package/dist/src/modular/buildProjectFiles.js +182 -0
- package/dist/src/modular/buildProjectFiles.js.map +1 -0
- package/dist/src/modular/buildRootIndex.d.ts +4 -0
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -0
- package/dist/src/modular/buildRootIndex.js +66 -0
- package/dist/src/modular/buildRootIndex.js.map +1 -0
- package/dist/src/modular/buildSharedTypes.d.ts +6 -0
- package/dist/src/modular/buildSharedTypes.d.ts.map +1 -0
- package/dist/src/modular/buildSharedTypes.js +33 -0
- package/dist/src/modular/buildSharedTypes.js.map +1 -0
- package/dist/src/modular/emitModels.d.ts +7 -0
- package/dist/src/modular/emitModels.d.ts.map +1 -0
- package/dist/src/modular/emitModels.js +63 -0
- package/dist/src/modular/emitModels.js.map +1 -0
- package/dist/src/modular/helpers/clientHelpers.d.ts +4 -0
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/clientHelpers.js +31 -0
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -0
- package/dist/src/modular/helpers/credentialHelpers.d.ts +7 -0
- package/dist/src/modular/helpers/credentialHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/credentialHelpers.js +32 -0
- package/dist/src/modular/helpers/credentialHelpers.js.map +1 -0
- package/dist/src/modular/helpers/namingHelpers.d.ts +3 -0
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/namingHelpers.js +4 -0
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -0
- package/dist/src/modular/helpers/operationHelpers.d.ts +8 -0
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/operationHelpers.js +274 -0
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -0
- package/dist/src/modular/helpers/parameterHelpers.d.ts +3 -0
- package/dist/src/modular/helpers/parameterHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/parameterHelpers.js +16 -0
- package/dist/src/modular/helpers/parameterHelpers.js.map +1 -0
- package/dist/src/modular/helpers/typeHelpers.d.ts +16 -0
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/typeHelpers.js +92 -0
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -0
- package/dist/src/modular/interfaces.d.ts +10 -0
- package/dist/src/modular/interfaces.d.ts.map +1 -0
- package/dist/src/modular/interfaces.js +2 -0
- package/dist/src/modular/interfaces.js.map +1 -0
- package/dist/src/modular/modularCodeModel.d.ts +121 -0
- package/dist/src/modular/modularCodeModel.d.ts.map +1 -0
- package/dist/src/modular/modularCodeModel.js +2 -0
- package/dist/src/modular/modularCodeModel.js.map +1 -0
- package/dist/src/operationUtil.d.ts +4 -4
- package/dist/src/operationUtil.d.ts.map +1 -1
- package/dist/src/operationUtil.js +2 -1
- package/dist/src/operationUtil.js.map +1 -1
- package/dist/src/transform/transform.d.ts +4 -6
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +11 -55
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformAnnotationDetails.d.ts +2 -2
- package/dist/src/transform/transformAnnotationDetails.d.ts.map +1 -1
- package/dist/src/transform/transformAnnotationDetails.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +5 -0
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -0
- package/dist/src/transform/transformApiVersionInfo.js +64 -0
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -0
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +2 -3
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts +2 -2
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts +2 -2
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts +2 -2
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +10 -22
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +2 -2
- package/dist/src/transform/transfromRLCOptions.js +1 -1
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -18
- package/src/casingUtils.ts +48 -0
- package/src/emitUtil.ts +9 -4
- package/src/index.ts +53 -10
- package/src/lib.ts +2 -1
- package/src/modelUtils.ts +137 -14
- package/src/modular/buildApiIndex.ts +13 -0
- package/src/modular/buildClassicalClient.ts +147 -0
- package/src/modular/buildClientContext.ts +104 -0
- package/src/modular/buildCodeModel.ts +1449 -0
- package/src/modular/buildOperations.ts +95 -0
- package/src/modular/buildProjectFiles.ts +219 -0
- package/src/modular/buildRootIndex.ts +94 -0
- package/src/modular/buildSharedTypes.ts +40 -0
- package/src/modular/emitModels.ts +72 -0
- package/src/modular/helpers/clientHelpers.ts +38 -0
- package/src/modular/helpers/credentialHelpers.ts +40 -0
- package/src/modular/helpers/namingHelpers.ts +5 -0
- package/src/modular/helpers/operationHelpers.ts +418 -0
- package/src/modular/helpers/parameterHelpers.ts +17 -0
- package/src/modular/helpers/typeHelpers.ts +106 -0
- package/src/modular/interfaces.ts +10 -0
- package/src/modular/modularCodeModel.ts +151 -0
- package/src/modular/static/karma.conf.cjs +120 -0
- package/src/modular/static/rollup.test.config.js +67 -0
- package/src/modular/static/scripts/renameOutput.mjs +17 -0
- package/src/operationUtil.ts +9 -9
- package/src/transform/transform.ts +23 -93
- package/src/transform/transformAnnotationDetails.ts +8 -8
- package/src/transform/transformApiVersionInfo.ts +108 -0
- package/src/transform/transformParameters.ts +10 -10
- package/src/transform/transformPaths.ts +9 -9
- package/src/transform/transformResponses.ts +6 -6
- package/src/transform/transformSchemas.ts +20 -28
- package/src/transform/transfromRLCOptions.ts +3 -3
- package/test/commands/cadl-ranch-list.ts +36 -0
- package/test/commands/run.ts +3 -13
- package/test/integration/arrayItemTypes.spec.ts +4 -1
- package/test/integration/azurecore.spec.ts +130 -0
- package/test/integration/collectionFormat.spec.ts +74 -0
- package/test/integration/dictionary.spec.ts +4 -0
- package/test/integration/generated/arrays/itemTypes/src/clientDefinitions.ts +15 -0
- package/test/integration/generated/arrays/itemTypes/src/parameters.ts +8 -0
- package/test/integration/generated/arrays/itemTypes/src/responses.ts +11 -0
- package/test/integration/generated/arrays/itemTypes/tspconfig.yaml +5 -2
- package/test/integration/generated/authentication/apiKey/package.json +2 -2
- package/test/integration/generated/authentication/apiKey/tspconfig.yaml +5 -2
- package/test/integration/generated/authentication/oauth2/tspconfig.yaml +5 -2
- package/test/integration/generated/authentication/union/tspconfig.yaml +5 -2
- package/test/integration/generated/azure/core/.eslintrc.json +11 -0
- package/test/integration/generated/azure/core/README.md +56 -0
- package/test/integration/generated/azure/core/api-extractor.json +18 -0
- package/test/integration/generated/azure/core/package.json +81 -0
- package/test/integration/generated/azure/core/rollup.config.js +118 -0
- package/test/integration/generated/azure/core/src/azureCoreClient.ts +31 -0
- package/test/integration/generated/azure/core/src/clientDefinitions.ts +94 -0
- package/test/integration/generated/azure/core/src/index.ts +16 -0
- package/test/integration/generated/azure/core/src/isUnexpected.ts +167 -0
- package/test/integration/generated/azure/core/src/models.ts +18 -0
- package/test/integration/generated/azure/core/src/outputModels.ts +31 -0
- package/test/integration/generated/azure/core/src/paginateHelper.ts +154 -0
- package/test/integration/generated/azure/core/src/parameters.ts +67 -0
- package/test/integration/generated/azure/core/src/responses.ts +136 -0
- package/test/integration/generated/azure/core/src/serializeHelper.ts +16 -0
- package/test/integration/generated/azure/core/tsconfig.json +25 -0
- package/test/integration/generated/azure/core/tspconfig.yaml +15 -0
- package/test/integration/generated/azure/core-traits/.eslintrc.json +11 -0
- package/test/integration/generated/azure/core-traits/README.md +56 -0
- package/test/integration/generated/azure/core-traits/api-extractor.json +18 -0
- package/test/integration/generated/azure/core-traits/package.json +80 -0
- package/test/integration/generated/azure/core-traits/rollup.config.js +118 -0
- package/test/integration/generated/azure/core-traits/src/azureCoreTraitsClient.ts +31 -0
- package/test/integration/generated/azure/core-traits/src/clientDefinitions.ts +40 -0
- package/test/integration/generated/azure/core-traits/src/index.ts +13 -0
- package/test/integration/generated/azure/core-traits/src/isUnexpected.ts +110 -0
- package/test/integration/generated/azure/core-traits/src/outputModels.ts +10 -0
- package/test/integration/generated/azure/core-traits/src/parameters.ts +41 -0
- package/test/integration/generated/azure/core-traits/src/responses.ts +56 -0
- package/test/integration/generated/azure/core-traits/tsconfig.json +25 -0
- package/test/integration/generated/azure/core-traits/tspconfig.yaml +15 -0
- package/test/integration/generated/dictionary/package.json +2 -2
- package/test/integration/generated/dictionary/src/clientDefinitions.ts +15 -0
- package/test/integration/generated/dictionary/src/parameters.ts +8 -0
- package/test/integration/generated/dictionary/src/responses.ts +11 -0
- package/test/integration/generated/dictionary/tspconfig.yaml +5 -2
- package/test/integration/generated/enums/extensible/package.json +2 -2
- package/test/integration/generated/enums/extensible/tspconfig.yaml +5 -2
- package/test/integration/generated/enums/fixed/package.json +2 -2
- package/test/integration/generated/enums/fixed/tspconfig.yaml +5 -2
- package/test/integration/generated/hello/package.json +2 -2
- package/test/integration/generated/hello/tspconfig.yaml +5 -2
- package/test/integration/generated/internal/src/clientDefinitions.ts +27 -0
- package/test/integration/generated/internal/src/index.ts +13 -0
- package/test/integration/generated/internal/src/internalClient.ts +31 -0
- package/test/integration/generated/internal/src/models.ts +8 -0
- package/test/integration/generated/internal/src/outputModels.ts +13 -0
- package/test/integration/generated/internal/src/parameters.ts +21 -0
- package/test/integration/generated/internal/src/responses.ts +20 -0
- package/test/integration/generated/internal/tspconfig.yaml +14 -0
- package/test/integration/generated/lro/lroBasic/package.json +2 -2
- package/test/integration/generated/lro/lroBasic/src/index.ts +1 -0
- package/test/integration/generated/lro/lroBasic/src/outputModels.ts +8 -0
- package/test/integration/generated/lro/lroBasic/src/responses.ts +4 -3
- package/test/integration/generated/lro/lroBasic/tspconfig.yaml +5 -2
- package/test/integration/generated/lro/lroCore/.eslintrc.json +11 -0
- package/test/integration/generated/lro/lroCore/README.md +56 -0
- package/test/integration/generated/lro/lroCore/api-extractor.json +18 -0
- package/test/integration/generated/lro/lroCore/package.json +82 -0
- package/test/integration/generated/lro/lroCore/rollup.config.js +118 -0
- package/test/integration/generated/lro/lroCore/src/azureLroCore.ts +31 -0
- package/test/integration/generated/lro/lroCore/src/clientDefinitions.ts +51 -0
- package/test/integration/generated/lro/lroCore/src/index.ts +15 -0
- package/test/integration/generated/lro/lroCore/src/isUnexpected.ts +128 -0
- package/test/integration/generated/lro/lroCore/src/models.ts +8 -0
- package/test/integration/generated/lro/lroCore/src/outputModels.ts +50 -0
- package/test/integration/generated/lro/lroCore/src/parameters.ts +25 -0
- package/test/integration/generated/lro/lroCore/src/pollingHelper.ts +75 -0
- package/test/integration/generated/lro/lroCore/src/responses.ts +91 -0
- package/test/integration/generated/lro/lroCore/tsconfig.json +25 -0
- package/test/integration/generated/lro/lroCore/tspconfig.yaml +14 -0
- package/test/integration/generated/models/inheritance/package.json +2 -2
- package/test/integration/generated/models/inheritance/tspconfig.yaml +5 -2
- package/test/integration/generated/models/propertyNullable/.eslintrc.json +11 -0
- package/test/integration/generated/models/propertyNullable/README.md +56 -0
- package/test/integration/generated/models/propertyNullable/api-extractor.json +18 -0
- package/test/integration/generated/models/propertyNullable/package.json +80 -0
- package/test/integration/generated/models/propertyNullable/rollup.config.js +118 -0
- package/test/integration/generated/models/propertyNullable/src/clientDefinitions.ts +227 -0
- package/test/integration/generated/models/propertyNullable/src/index.ts +13 -0
- package/test/integration/generated/models/propertyNullable/src/models.ts +56 -0
- package/test/integration/generated/models/propertyNullable/src/modelsPropertyNullable.ts +31 -0
- package/test/integration/generated/models/propertyNullable/src/outputModels.ts +56 -0
- package/test/integration/generated/models/propertyNullable/src/parameters.ts +195 -0
- package/test/integration/generated/models/propertyNullable/src/responses.ts +144 -0
- package/test/integration/generated/models/propertyNullable/tsconfig.json +25 -0
- package/test/integration/generated/models/propertyNullable/tspconfig.yaml +14 -0
- package/test/integration/generated/models/propertyOptional/package.json +2 -2
- package/test/integration/generated/models/propertyOptional/tspconfig.yaml +5 -2
- package/test/integration/generated/models/propertyTypes/package.json +2 -2
- package/test/integration/generated/models/propertyTypes/tspconfig.yaml +5 -2
- package/test/integration/generated/models/usage/package.json +2 -2
- package/test/integration/generated/models/usage/tspconfig.yaml +5 -2
- package/test/integration/generated/models/visibility/package.json +2 -2
- package/test/integration/generated/models/visibility/tspconfig.yaml +5 -2
- package/test/integration/generated/parameters/collection-format/src/clientDefinitions.ts +39 -0
- package/test/integration/generated/parameters/collection-format/src/collectionFormatClient.ts +31 -0
- package/test/integration/generated/parameters/collection-format/src/index.ts +12 -0
- package/test/integration/generated/parameters/collection-format/src/parameters.ts +38 -0
- package/test/integration/generated/parameters/collection-format/src/responses.ts +19 -0
- package/test/integration/generated/parameters/collection-format/src/serializeHelper.ts +16 -0
- package/test/integration/generated/parameters/collection-format/tspconfig.yaml +14 -0
- package/test/integration/generated/projection/src/clientDefinitions.ts +45 -0
- package/test/integration/generated/projection/src/index.ts +12 -0
- package/test/integration/generated/projection/src/models.ts +11 -0
- package/test/integration/generated/projection/src/parameters.ts +26 -0
- package/test/integration/generated/projection/src/projectionClient.ts +31 -0
- package/test/integration/generated/projection/src/responses.ts +19 -0
- package/test/integration/generated/projection/tspconfig.yaml +14 -0
- package/test/integration/generated/resiliency/devDriven/package.json +2 -2
- package/test/integration/generated/resiliency/devDriven/tspconfig.yaml +5 -2
- package/test/integration/generated/resiliency/srvDriven1/package.json +2 -2
- package/test/integration/generated/resiliency/srvDriven1/tspconfig.yaml +5 -2
- package/test/integration/generated/resiliency/srvDriven2/package.json +2 -2
- package/test/integration/generated/resiliency/srvDriven2/src/resiliencyServiceDriven2.ts +1 -1
- package/test/integration/generated/resiliency/srvDriven2/tspconfig.yaml +5 -2
- package/test/integration/generated/server/path/multiple/src/clientDefinitions.ts +35 -0
- package/test/integration/generated/server/path/multiple/src/index.ts +11 -0
- package/test/integration/generated/server/path/multiple/src/multipleParamInServerPathClient.ts +39 -0
- package/test/integration/generated/server/path/multiple/src/parameters.ts +7 -0
- package/test/integration/generated/server/path/multiple/src/responses.ts +14 -0
- package/test/integration/generated/server/path/multiple/tspconfig.yaml +14 -0
- package/test/integration/generated/server/path/single/src/clientDefinitions.ts +19 -0
- package/test/integration/generated/server/path/single/src/index.ts +11 -0
- package/test/integration/generated/server/path/single/src/parameters.ts +6 -0
- package/test/integration/generated/server/path/single/src/responses.ts +9 -0
- package/test/integration/generated/server/path/single/src/singleParamInServerPathClient.ts +34 -0
- package/test/integration/generated/server/path/single/tspconfig.yaml +14 -0
- package/test/integration/generated/specialWords/tspconfig.yaml +5 -2
- package/test/integration/generated/unions/tspconfig.yaml +5 -2
- package/test/integration/internal.spec.ts +43 -0
- package/test/integration/lroBasic.spec.ts +1 -1
- package/test/integration/modelPropertyNullable.spec.ts +115 -0
- package/test/integration/projection.spec.ts +55 -0
- package/test/integration/server.spec.ts +59 -0
- package/test/unit/apiVersion.spec.ts +388 -0
- package/test/unit/clientFactoryGenerator.spec.ts +0 -131
- package/test/unit/modelsGenerator.spec.ts +2 -2
- package/test/unit/parametersGenerator.spec.ts +1 -1
- package/test/unit/responsesGenerator.spec.ts +1 -1
- package/test/unit/util/emitUtil.ts +6 -5
- package/test/unit/util/testUtil.ts +3 -3
- package/dist/src/transform/transformApiVersionParam.d.ts +0 -5
- package/dist/src/transform/transformApiVersionParam.d.ts.map +0 -1
- package/dist/src/transform/transformApiVersionParam.js +0 -76
- package/dist/src/transform/transformApiVersionParam.js.map +0 -1
- package/src/transform/transformApiVersionParam.ts +0 -104
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
getPagedAsyncIterator,
|
|
6
|
+
PagedAsyncIterableIterator,
|
|
7
|
+
PagedResult,
|
|
8
|
+
} from "@azure/core-paging";
|
|
9
|
+
import {
|
|
10
|
+
Client,
|
|
11
|
+
createRestError,
|
|
12
|
+
PathUncheckedResponse,
|
|
13
|
+
} from "@azure-rest/core-client";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Helper type to extract the type of an array
|
|
17
|
+
*/
|
|
18
|
+
export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The type of a custom function that defines how to get a page and a link to the next one if any.
|
|
22
|
+
*/
|
|
23
|
+
export type GetPage<TPage> = (
|
|
24
|
+
pageLink: string,
|
|
25
|
+
maxPageSize?: number
|
|
26
|
+
) => Promise<{
|
|
27
|
+
page: TPage;
|
|
28
|
+
nextPageLink?: string;
|
|
29
|
+
}>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Options for the paging helper
|
|
33
|
+
*/
|
|
34
|
+
export interface PagingOptions<TResponse> {
|
|
35
|
+
/**
|
|
36
|
+
* Custom function to extract pagination details for crating the PagedAsyncIterableIterator
|
|
37
|
+
*/
|
|
38
|
+
customGetPage?: GetPage<PaginateReturn<TResponse>[]>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Helper type to infer the Type of the paged elements from the response type
|
|
43
|
+
* This type is generated based on the swagger information for x-ms-pageable
|
|
44
|
+
* specifically on the itemName property which indicates the property of the response
|
|
45
|
+
* where the page items are found. The default value is `value`.
|
|
46
|
+
* This type will allow us to provide strongly typed Iterator based on the response we get as second parameter
|
|
47
|
+
*/
|
|
48
|
+
export type PaginateReturn<TResult> = TResult extends {
|
|
49
|
+
body: { value?: infer TPage };
|
|
50
|
+
}
|
|
51
|
+
? GetArrayType<TPage>
|
|
52
|
+
: Array<unknown>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
|
|
56
|
+
* @param client - Client to use for sending the next page requests
|
|
57
|
+
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
58
|
+
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
59
|
+
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
60
|
+
*/
|
|
61
|
+
export function paginate<TResponse extends PathUncheckedResponse>(
|
|
62
|
+
client: Client,
|
|
63
|
+
initialResponse: TResponse,
|
|
64
|
+
options: PagingOptions<TResponse> = {}
|
|
65
|
+
): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {
|
|
66
|
+
// Extract element type from initial response
|
|
67
|
+
type TElement = PaginateReturn<TResponse>;
|
|
68
|
+
let firstRun = true;
|
|
69
|
+
const itemName = "value";
|
|
70
|
+
const nextLinkName = "nextLink";
|
|
71
|
+
const { customGetPage } = options;
|
|
72
|
+
const pagedResult: PagedResult<TElement[]> = {
|
|
73
|
+
firstPageLink: "",
|
|
74
|
+
getPage:
|
|
75
|
+
typeof customGetPage === "function"
|
|
76
|
+
? customGetPage
|
|
77
|
+
: async (pageLink: string) => {
|
|
78
|
+
const result = firstRun
|
|
79
|
+
? initialResponse
|
|
80
|
+
: await client.pathUnchecked(pageLink).get();
|
|
81
|
+
firstRun = false;
|
|
82
|
+
checkPagingRequest(result);
|
|
83
|
+
const nextLink = getNextLink(result.body, nextLinkName);
|
|
84
|
+
const values = getElements<TElement>(result.body, itemName);
|
|
85
|
+
return {
|
|
86
|
+
page: values,
|
|
87
|
+
nextPageLink: nextLink,
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return getPagedAsyncIterator(pagedResult);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Gets for the value of nextLink in the body
|
|
97
|
+
*/
|
|
98
|
+
function getNextLink(body: unknown, nextLinkName?: string): string | undefined {
|
|
99
|
+
if (!nextLinkName) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const nextLink = (body as Record<string, unknown>)[nextLinkName];
|
|
104
|
+
|
|
105
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
|
|
106
|
+
throw new Error(
|
|
107
|
+
`Body Property ${nextLinkName} should be a string or undefined`
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return nextLink;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Gets the elements of the current request in the body.
|
|
116
|
+
*/
|
|
117
|
+
function getElements<T = unknown>(body: unknown, itemName: string): T[] {
|
|
118
|
+
const value = (body as Record<string, unknown>)[itemName] as T[];
|
|
119
|
+
|
|
120
|
+
// value has to be an array according to the x-ms-pageable extension.
|
|
121
|
+
// The fact that this must be an array is used above to calculate the
|
|
122
|
+
// type of elements in the page in PaginateReturn
|
|
123
|
+
if (!Array.isArray(value)) {
|
|
124
|
+
throw new Error(
|
|
125
|
+
`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return value ?? [];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Checks if a request failed
|
|
134
|
+
*/
|
|
135
|
+
function checkPagingRequest(response: PathUncheckedResponse): void {
|
|
136
|
+
const Http2xxStatusCodes = [
|
|
137
|
+
"200",
|
|
138
|
+
"201",
|
|
139
|
+
"202",
|
|
140
|
+
"203",
|
|
141
|
+
"204",
|
|
142
|
+
"205",
|
|
143
|
+
"206",
|
|
144
|
+
"207",
|
|
145
|
+
"208",
|
|
146
|
+
"226",
|
|
147
|
+
];
|
|
148
|
+
if (!Http2xxStatusCodes.includes(response.status)) {
|
|
149
|
+
throw createRestError(
|
|
150
|
+
`Pagination failed with unexpected statusCode ${response.status}`,
|
|
151
|
+
response
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import { RequestParameters } from "@azure-rest/core-client";
|
|
5
|
+
import { User } from "./models";
|
|
6
|
+
|
|
7
|
+
/** The resource instance. */
|
|
8
|
+
export type UserResourceMergeAndPatch = Partial<User>;
|
|
9
|
+
|
|
10
|
+
export interface CreateOrUpdateBodyParam {
|
|
11
|
+
/** The resource instance. */
|
|
12
|
+
body: UserResourceMergeAndPatch;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CreateOrUpdateMediaTypesParam {
|
|
16
|
+
/** This request has a JSON Merge Patch body. */
|
|
17
|
+
contentType: "application/merge-patch+json";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type CreateOrUpdateParameters = CreateOrUpdateMediaTypesParam &
|
|
21
|
+
CreateOrUpdateBodyParam &
|
|
22
|
+
RequestParameters;
|
|
23
|
+
|
|
24
|
+
export interface CreateOrReplaceBodyParam {
|
|
25
|
+
/** The resource instance. */
|
|
26
|
+
body: User;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type CreateOrReplaceParameters = CreateOrReplaceBodyParam &
|
|
30
|
+
RequestParameters;
|
|
31
|
+
export type GetParameters = RequestParameters;
|
|
32
|
+
|
|
33
|
+
export interface ListQueryParamProperties {
|
|
34
|
+
/** The number of result items to return. */
|
|
35
|
+
top?: number;
|
|
36
|
+
/** The number of result items to skip. */
|
|
37
|
+
skip?: number;
|
|
38
|
+
/** The maximum number of result items per page. */
|
|
39
|
+
maxpagesize?: number;
|
|
40
|
+
/** Expressions that specify the order of returned results. This parameter needs to be formatted as multi collection, we provide buildMultiCollection from serializeHelper.ts to help, you will probably need to set skipUrlEncoding as true when sending the request */
|
|
41
|
+
orderby?: string;
|
|
42
|
+
/** Filter the result list using the given expression. */
|
|
43
|
+
filter?: string;
|
|
44
|
+
/** Select the specified fields to be included in the response. This parameter needs to be formatted as multi collection, we provide buildMultiCollection from serializeHelper.ts to help, you will probably need to set skipUrlEncoding as true when sending the request */
|
|
45
|
+
select?: string;
|
|
46
|
+
/** Expand the indicated resources into the response. This parameter needs to be formatted as multi collection, we provide buildMultiCollection from serializeHelper.ts to help, you will probably need to set skipUrlEncoding as true when sending the request */
|
|
47
|
+
expand?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ListQueryParam {
|
|
51
|
+
queryParameters?: ListQueryParamProperties;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type ListParameters = ListQueryParam & RequestParameters;
|
|
55
|
+
export type ListWithPageParameters = RequestParameters;
|
|
56
|
+
export type DeleteParameters = RequestParameters;
|
|
57
|
+
|
|
58
|
+
export interface ExportQueryParamProperties {
|
|
59
|
+
/** The format of the data. */
|
|
60
|
+
format: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ExportQueryParam {
|
|
64
|
+
queryParameters: ExportQueryParamProperties;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type ExportParameters = ExportQueryParam & RequestParameters;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import { RawHttpHeaders } from "@azure/core-rest-pipeline";
|
|
5
|
+
import { HttpResponse, ErrorResponse } from "@azure-rest/core-client";
|
|
6
|
+
import { UserOutput, UserListOutput, PagedUserOutput } from "./outputModels";
|
|
7
|
+
|
|
8
|
+
/** The request has succeeded. */
|
|
9
|
+
export interface CreateOrUpdate200Response extends HttpResponse {
|
|
10
|
+
status: "200";
|
|
11
|
+
body: UserOutput;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The request has succeeded and a new resource has been created as a result. */
|
|
15
|
+
export interface CreateOrUpdate201Response extends HttpResponse {
|
|
16
|
+
status: "201";
|
|
17
|
+
body: UserOutput;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CreateOrUpdateDefaultHeaders {
|
|
21
|
+
/** String error code indicating what went wrong. */
|
|
22
|
+
"x-ms-error-code"?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CreateOrUpdateDefaultResponse extends HttpResponse {
|
|
26
|
+
status: string;
|
|
27
|
+
body: ErrorResponse;
|
|
28
|
+
headers: RawHttpHeaders & CreateOrUpdateDefaultHeaders;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The request has succeeded. */
|
|
32
|
+
export interface CreateOrReplace200Response extends HttpResponse {
|
|
33
|
+
status: "200";
|
|
34
|
+
body: UserOutput;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The request has succeeded and a new resource has been created as a result. */
|
|
38
|
+
export interface CreateOrReplace201Response extends HttpResponse {
|
|
39
|
+
status: "201";
|
|
40
|
+
body: UserOutput;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface CreateOrReplaceDefaultHeaders {
|
|
44
|
+
/** String error code indicating what went wrong. */
|
|
45
|
+
"x-ms-error-code"?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface CreateOrReplaceDefaultResponse extends HttpResponse {
|
|
49
|
+
status: string;
|
|
50
|
+
body: ErrorResponse;
|
|
51
|
+
headers: RawHttpHeaders & CreateOrReplaceDefaultHeaders;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The request has succeeded. */
|
|
55
|
+
export interface Get200Response extends HttpResponse {
|
|
56
|
+
status: "200";
|
|
57
|
+
body: UserOutput;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface GetDefaultHeaders {
|
|
61
|
+
/** String error code indicating what went wrong. */
|
|
62
|
+
"x-ms-error-code"?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface GetDefaultResponse extends HttpResponse {
|
|
66
|
+
status: string;
|
|
67
|
+
body: ErrorResponse;
|
|
68
|
+
headers: RawHttpHeaders & GetDefaultHeaders;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The request has succeeded. */
|
|
72
|
+
export interface List200Response extends HttpResponse {
|
|
73
|
+
status: "200";
|
|
74
|
+
body: UserListOutput;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface ListDefaultHeaders {
|
|
78
|
+
/** String error code indicating what went wrong. */
|
|
79
|
+
"x-ms-error-code"?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface ListDefaultResponse extends HttpResponse {
|
|
83
|
+
status: string;
|
|
84
|
+
body: ErrorResponse;
|
|
85
|
+
headers: RawHttpHeaders & ListDefaultHeaders;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The request has succeeded. */
|
|
89
|
+
export interface ListWithPage200Response extends HttpResponse {
|
|
90
|
+
status: "200";
|
|
91
|
+
body: PagedUserOutput;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface ListWithPageDefaultHeaders {
|
|
95
|
+
/** String error code indicating what went wrong. */
|
|
96
|
+
"x-ms-error-code"?: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface ListWithPageDefaultResponse extends HttpResponse {
|
|
100
|
+
status: string;
|
|
101
|
+
body: ErrorResponse;
|
|
102
|
+
headers: RawHttpHeaders & ListWithPageDefaultHeaders;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
106
|
+
export interface Delete204Response extends HttpResponse {
|
|
107
|
+
status: "204";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface DeleteDefaultHeaders {
|
|
111
|
+
/** String error code indicating what went wrong. */
|
|
112
|
+
"x-ms-error-code"?: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface DeleteDefaultResponse extends HttpResponse {
|
|
116
|
+
status: string;
|
|
117
|
+
body: ErrorResponse;
|
|
118
|
+
headers: RawHttpHeaders & DeleteDefaultHeaders;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** The request has succeeded. */
|
|
122
|
+
export interface Export200Response extends HttpResponse {
|
|
123
|
+
status: "200";
|
|
124
|
+
body: UserOutput;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface ExportDefaultHeaders {
|
|
128
|
+
/** String error code indicating what went wrong. */
|
|
129
|
+
"x-ms-error-code"?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface ExportDefaultResponse extends HttpResponse {
|
|
133
|
+
status: string;
|
|
134
|
+
body: ErrorResponse;
|
|
135
|
+
headers: RawHttpHeaders & ExportDefaultHeaders;
|
|
136
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
export function buildMultiCollection(
|
|
5
|
+
queryParameters: string[],
|
|
6
|
+
parameterName: string
|
|
7
|
+
) {
|
|
8
|
+
return queryParameters
|
|
9
|
+
.map((item, index) => {
|
|
10
|
+
if (index === 0) {
|
|
11
|
+
return item;
|
|
12
|
+
}
|
|
13
|
+
return `${parameterName}=${item}`;
|
|
14
|
+
})
|
|
15
|
+
.join("&");
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"module": "es6",
|
|
5
|
+
"lib": [],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"inlineSources": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"importHelpers": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"alwaysStrict": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"forceConsistentCasingInFileNames": true,
|
|
18
|
+
"moduleResolution": "node",
|
|
19
|
+
"allowSyntheticDefaultImports": true,
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"outDir": "./dist-esm",
|
|
22
|
+
"declarationDir": "./types"
|
|
23
|
+
},
|
|
24
|
+
"include": ["./src/**/*.ts"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
emit:
|
|
2
|
+
- "@azure-tools/typespec-ts"
|
|
3
|
+
options:
|
|
4
|
+
"@azure-tools/typespec-ts":
|
|
5
|
+
"emitter-output-dir": "{project-root}"
|
|
6
|
+
generateMetadata: true
|
|
7
|
+
generateTest: false
|
|
8
|
+
addCredentials: false
|
|
9
|
+
azureSdkForJs: false
|
|
10
|
+
isCadlTest: true
|
|
11
|
+
title: AzureCoreClient
|
|
12
|
+
packageDetails:
|
|
13
|
+
name: "@msinternal/azurecore"
|
|
14
|
+
description: "AzureCore Test Service"
|
|
15
|
+
version: "1.0.0"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": ["@azure/azure-sdk"],
|
|
3
|
+
"extends": ["plugin:@azure/azure-sdk/azure-sdk-base"],
|
|
4
|
+
"rules": {
|
|
5
|
+
"@azure/azure-sdk/ts-modules-only-named": "warn",
|
|
6
|
+
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
|
|
7
|
+
"@azure/azure-sdk/ts-package-json-types": "warn",
|
|
8
|
+
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
|
|
9
|
+
"tsdoc/syntax": "warn"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# AzureCoreTraits REST client library for JavaScript
|
|
2
|
+
|
|
3
|
+
Illustrates Azure Core operation customizations by traits
|
|
4
|
+
|
|
5
|
+
**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library**
|
|
6
|
+
|
|
7
|
+
Key links:
|
|
8
|
+
|
|
9
|
+
- [Package (NPM)](https://www.npmjs.com/package/@msinternal/azurecoretraits)
|
|
10
|
+
|
|
11
|
+
## Getting started
|
|
12
|
+
|
|
13
|
+
### Currently supported environments
|
|
14
|
+
|
|
15
|
+
- LTS versions of Node.js
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.
|
|
20
|
+
|
|
21
|
+
### Install the `@msinternal/azurecoretraits` package
|
|
22
|
+
|
|
23
|
+
Install the AzureCoreTraits REST client REST client library for JavaScript with `npm`:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @msinternal/azurecoretraits
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Create and authenticate a `AzureCoreTraitsClient`
|
|
30
|
+
|
|
31
|
+
To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
|
|
32
|
+
provide an instance of the desired credential type obtained from the
|
|
33
|
+
[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.
|
|
34
|
+
|
|
35
|
+
To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
|
|
36
|
+
|
|
37
|
+
After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
|
|
38
|
+
As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
|
|
39
|
+
can be used to authenticate the client.
|
|
40
|
+
|
|
41
|
+
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
|
|
42
|
+
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
|
|
43
|
+
|
|
44
|
+
## Troubleshooting
|
|
45
|
+
|
|
46
|
+
### Logging
|
|
47
|
+
|
|
48
|
+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
const { setLogLevel } = require("@azure/logger");
|
|
52
|
+
|
|
53
|
+
setLogLevel("info");
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"mainEntryPointFilePath": "./types/index.d.ts",
|
|
4
|
+
"docModel": { "enabled": true },
|
|
5
|
+
"apiReport": { "enabled": true, "reportFolder": "./review" },
|
|
6
|
+
"dtsRollup": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"untrimmedFilePath": "",
|
|
9
|
+
"publicTrimmedFilePath": "./types/azurecoretraits.d.ts"
|
|
10
|
+
},
|
|
11
|
+
"messages": {
|
|
12
|
+
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
|
|
13
|
+
"extractorMessageReporting": {
|
|
14
|
+
"ae-missing-release-tag": { "logLevel": "none" },
|
|
15
|
+
"ae-unresolved-link": { "logLevel": "none" }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@msinternal/azurecoretraits",
|
|
3
|
+
"sdk-type": "client",
|
|
4
|
+
"author": "Microsoft Corporation",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "AzureCoreTraits Test Service",
|
|
7
|
+
"keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "./dist-esm/index.js",
|
|
11
|
+
"types": "./types/azurecoretraits.d.ts",
|
|
12
|
+
"repository": "github:Azure/azure-sdk-for-js",
|
|
13
|
+
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/",
|
|
16
|
+
"dist-esm/",
|
|
17
|
+
"types/azurecoretraits.d.ts",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"review/*"
|
|
21
|
+
],
|
|
22
|
+
"engines": { "node": ">=14.0.0" },
|
|
23
|
+
"scripts": {
|
|
24
|
+
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
|
25
|
+
"build:browser": "echo skipped.",
|
|
26
|
+
"build:node": "echo skipped.",
|
|
27
|
+
"build:samples": "echo skipped.",
|
|
28
|
+
"build:test": "echo skipped.",
|
|
29
|
+
"build:debug": "echo skipped.",
|
|
30
|
+
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" ",
|
|
31
|
+
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
32
|
+
"execute:samples": "echo skipped",
|
|
33
|
+
"extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
|
|
34
|
+
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" ",
|
|
35
|
+
"generate:client": "echo skipped",
|
|
36
|
+
"integration-test:browser": "echo skipped",
|
|
37
|
+
"integration-test:node": "echo skipped",
|
|
38
|
+
"integration-test": "echo skipped",
|
|
39
|
+
"lint:fix": "eslint package.json api-extractor.json src --ext .ts --fix --fix-type [problem,suggestion]",
|
|
40
|
+
"lint": "eslint package.json api-extractor.json src --ext .ts",
|
|
41
|
+
"pack": "npm pack 2>&1",
|
|
42
|
+
"test:browser": "echo skipped",
|
|
43
|
+
"test:node": "echo skipped",
|
|
44
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
45
|
+
"unit-test": "echo skipped",
|
|
46
|
+
"unit-test:node": "echo skipped",
|
|
47
|
+
"unit-test:browser": "echo skipped",
|
|
48
|
+
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
|
|
49
|
+
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js"
|
|
50
|
+
},
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"autoPublish": false,
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@azure/core-auth": "^1.3.0",
|
|
55
|
+
"@azure-rest/core-client": "^1.1.2",
|
|
56
|
+
"@azure/core-rest-pipeline": "^1.8.0",
|
|
57
|
+
"@azure/logger": "^1.0.0",
|
|
58
|
+
"tslib": "^2.2.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@microsoft/api-extractor": "^7.31.1",
|
|
62
|
+
"autorest": "latest",
|
|
63
|
+
"@types/node": "^14.0.0",
|
|
64
|
+
"dotenv": "^16.0.0",
|
|
65
|
+
"eslint": "^8.0.0",
|
|
66
|
+
"mkdirp": "^2.1.2",
|
|
67
|
+
"prettier": "^2.5.1",
|
|
68
|
+
"rimraf": "^3.0.0",
|
|
69
|
+
"source-map-support": "^0.5.9",
|
|
70
|
+
"typescript": "~5.0.0",
|
|
71
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
72
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
73
|
+
"@rollup/plugin-multi-entry": "^6.0.0",
|
|
74
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
75
|
+
"rollup": "^2.66.1",
|
|
76
|
+
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
77
|
+
"uglify-js": "^3.4.9"
|
|
78
|
+
},
|
|
79
|
+
"type": "module"
|
|
80
|
+
}
|