diff --git a/packages/@azure/graph/LICENSE.txt b/packages/@azure/graph/LICENSE.txt index a70e8cf66038..5431ba98b936 100644 --- a/packages/@azure/graph/LICENSE.txt +++ b/packages/@azure/graph/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@azure/graph/README.md b/packages/@azure/graph/README.md index 30ed73d24a30..b0eaa4700303 100644 --- a/packages/@azure/graph/README.md +++ b/packages/@azure/graph/README.md @@ -1,96 +1,77 @@ -## Azure GraphRbacManagementClient SDK for JavaScript - -This package contains an isomorphic SDK for GraphRbacManagementClient. - -### Currently supported environments - -- Node.js version 6.x.x or higher -- Browser JavaScript - -### How to Install - -``` -npm install @azure/graph -``` - -### How to use - -#### nodejs - Authentication, client creation and get signedInUser as an example written in TypeScript. - -##### Install @azure/ms-rest-nodeauth - -``` -npm install @azure/ms-rest-nodeauth -``` - -##### Sample code - -```ts -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { GraphRbacManagementClient, GraphRbacManagementModels, GraphRbacManagementMappers } from "@azure/graph"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new GraphRbacManagementClient(creds, subscriptionId); - client.signedInUser.get().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); -``` - -#### browser - Authentication, client creation and get signedInUser as an example written in JavaScript. - -##### Install @azure/ms-rest-browserauth - -``` -npm install @azure/ms-rest-browserauth -``` - -##### Sample code - -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/graph sample - - - - - - - - -``` - -## Related projects - -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +# Azure GraphRbacManagementClient SDK for JavaScript +This package contains an isomorphic SDK for GraphRbacManagementClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install @azure/graph +``` + + +## How to use + +### nodejs - Authentication, client creation and get signedInUser as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { GraphRbacManagementClient, GraphRbacManagementModels, GraphRbacManagementMappers } from "@azure/graph"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new GraphRbacManagementClient(creds, subscriptionId); + client.signedInUser.get().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and get signedInUser as an example written in JavaScript. +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/graph sample + + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/graph/lib/graphRbacManagementClient.ts b/packages/@azure/graph/lib/graphRbacManagementClient.ts index c9a03bdb6cf1..76a90ee21c02 100644 --- a/packages/@azure/graph/lib/graphRbacManagementClient.ts +++ b/packages/@azure/graph/lib/graphRbacManagementClient.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "./models"; import * as Mappers from "./models/mappers"; import * as operations from "./operations"; diff --git a/packages/@azure/graph/lib/graphRbacManagementClientContext.ts b/packages/@azure/graph/lib/graphRbacManagementClientContext.ts index 6ad0e2233daa..79d7fadce7cf 100644 --- a/packages/@azure/graph/lib/graphRbacManagementClientContext.ts +++ b/packages/@azure/graph/lib/graphRbacManagementClientContext.ts @@ -9,8 +9,8 @@ */ import * as Models from "./models"; -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; const packageName = "@azure/graph"; const packageVersion = "0.1.0"; diff --git a/packages/@azure/graph/lib/models/deletedApplicationsMappers.ts b/packages/@azure/graph/lib/models/deletedApplicationsMappers.ts index 8f257066e9f6..82b9865e080b 100644 --- a/packages/@azure/graph/lib/models/deletedApplicationsMappers.ts +++ b/packages/@azure/graph/lib/models/deletedApplicationsMappers.ts @@ -15,6 +15,8 @@ export { AppRole, RequiredResourceAccess, ResourceAccess, + KeyCredential, + PasswordCredential, GraphError, ApplicationListResult, ADGroup, diff --git a/packages/@azure/graph/lib/models/groupsMappers.ts b/packages/@azure/graph/lib/models/groupsMappers.ts index 3d00ed56ed4c..79a28976255e 100644 --- a/packages/@azure/graph/lib/models/groupsMappers.ts +++ b/packages/@azure/graph/lib/models/groupsMappers.ts @@ -26,6 +26,8 @@ export { AppRole, RequiredResourceAccess, ResourceAccess, + KeyCredential, + PasswordCredential, ServicePrincipal, User, SignInName diff --git a/packages/@azure/graph/lib/models/index.ts b/packages/@azure/graph/lib/models/index.ts index e18d2325314b..5212fcbe6f93 100644 --- a/packages/@azure/graph/lib/models/index.ts +++ b/packages/@azure/graph/lib/models/index.ts @@ -8,8 +8,8 @@ * regenerated. */ -import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import { BaseResource, CloudError, AzureServiceClientOptions } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; export { BaseResource, CloudError }; @@ -100,9 +100,9 @@ export interface KeyCredential { */ type?: string; /** - * @member {Uint8Array} [customKeyIdentifier] Custom Key Identifier + * @member {string} [customKeyIdentifier] Custom Key Identifier */ - customKeyIdentifier?: Uint8Array; + customKeyIdentifier?: string; /** * @property Describes unknown properties. The value of an unknown property * can be of "any" type. @@ -133,6 +133,10 @@ export interface PasswordCredential { * @member {string} [value] Key value. */ value?: string; + /** + * @member {Uint8Array} [customKeyIdentifier] Custom Key Identifier + */ + customKeyIdentifier?: Uint8Array; /** * @property Describes unknown properties. The value of an unknown property * can be of "any" type. @@ -174,7 +178,7 @@ export interface ResourceAccess { * OAuth 2.0 permission scopes may be requested by client applications (through * the requiredResourceAccess collection) when calling a resource application. * The requiredResourceAccess property of the Application entity is a - * collection of ReqiredResourceAccess. + * collection of RequiredResourceAccess. * */ export interface RequiredResourceAccess { @@ -444,6 +448,16 @@ export interface Application { * consent experience. */ requiredResourceAccess?: RequiredResourceAccess[]; + /** + * @member {KeyCredential[]} [keyCredentials] A collection of KeyCredential + * objects. + */ + keyCredentials?: KeyCredential[]; + /** + * @member {PasswordCredential[]} [passwordCredentials] A collection of + * PasswordCredential objects + */ + passwordCredentials?: PasswordCredential[]; } /** @@ -1312,7 +1326,7 @@ export interface OAuth2GetOptionalParams extends msRest.RequestOptionsBase { export interface OAuth2GrantOptionalParams extends msRest.RequestOptionsBase { /** * @member {Permissions} [body] The relevant app Service Principal Object Id - * and the Service Principal Objecit Id you want to grant. + * and the Service Principal Object Id you want to grant. */ body?: Permissions; } diff --git a/packages/@azure/graph/lib/models/mappers.ts b/packages/@azure/graph/lib/models/mappers.ts index 7022f2da87d4..82bc3fe693eb 100644 --- a/packages/@azure/graph/lib/models/mappers.ts +++ b/packages/@azure/graph/lib/models/mappers.ts @@ -8,8 +8,8 @@ * regenerated. */ -import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; -import * as msRest from "@azure/ms-rest-js"; +import { CloudErrorMapper, BaseResourceMapper } from "ms-rest-azure-js"; +import * as msRest from "ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; @@ -122,7 +122,7 @@ export const KeyCredential: msRest.CompositeMapper = { customKeyIdentifier: { serializedName: "customKeyIdentifier", type: { - name: "ByteArray" + name: "String" } } }, @@ -163,6 +163,12 @@ export const PasswordCredential: msRest.CompositeMapper = { type: { name: "String" } + }, + customKeyIdentifier: { + serializedName: "customKeyIdentifier", + type: { + name: "ByteArray" + } } }, additionalProperties: { @@ -642,6 +648,40 @@ export const Application: msRest.CompositeMapper = { } } } + }, + keyCredentials: { + serializedName: "keyCredentials", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "KeyCredential", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } + }, + passwordCredentials: { + serializedName: "passwordCredentials", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PasswordCredential", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } } }, additionalProperties: DirectoryObject.type.additionalProperties @@ -1698,6 +1738,11 @@ export const DirectoryObjectListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", + polymorphicDiscriminator: { + serializedName: "objectType", + clientName: "objectType" + }, + uberParent: "DirectoryObject", className: "DirectoryObject", additionalProperties: { type: { @@ -1731,6 +1776,8 @@ export const ApplicationListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", + polymorphicDiscriminator: DirectoryObject.type.polymorphicDiscriminator, + uberParent: "DirectoryObject", className: "Application", additionalProperties: DirectoryObject.type.additionalProperties } @@ -1814,6 +1861,8 @@ export const GroupListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", + polymorphicDiscriminator: DirectoryObject.type.polymorphicDiscriminator, + uberParent: "DirectoryObject", className: "ADGroup", additionalProperties: DirectoryObject.type.additionalProperties } @@ -1864,6 +1913,8 @@ export const ServicePrincipalListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", + polymorphicDiscriminator: DirectoryObject.type.polymorphicDiscriminator, + uberParent: "DirectoryObject", className: "ServicePrincipal", additionalProperties: DirectoryObject.type.additionalProperties } @@ -1893,6 +1944,8 @@ export const UserListResult: msRest.CompositeMapper = { element: { type: { name: "Composite", + polymorphicDiscriminator: DirectoryObject.type.polymorphicDiscriminator, + uberParent: "DirectoryObject", className: "User", additionalProperties: DirectoryObject.type.additionalProperties } diff --git a/packages/@azure/graph/lib/models/objectsMappers.ts b/packages/@azure/graph/lib/models/objectsMappers.ts index 48ec347b8ac6..7ee737c7254b 100644 --- a/packages/@azure/graph/lib/models/objectsMappers.ts +++ b/packages/@azure/graph/lib/models/objectsMappers.ts @@ -18,6 +18,8 @@ export { AppRole, RequiredResourceAccess, ResourceAccess, + KeyCredential, + PasswordCredential, ADGroup, ServicePrincipal, User, diff --git a/packages/@azure/graph/lib/models/parameters.ts b/packages/@azure/graph/lib/models/parameters.ts index 57d946162f5d..c5feac022131 100644 --- a/packages/@azure/graph/lib/models/parameters.ts +++ b/packages/@azure/graph/lib/models/parameters.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; export const acceptLanguage: msRest.OperationParameter = { parameterPath: "acceptLanguage", diff --git a/packages/@azure/graph/lib/models/signedInUserMappers.ts b/packages/@azure/graph/lib/models/signedInUserMappers.ts index 8b06f0505013..bf7b3bd0a9f4 100644 --- a/packages/@azure/graph/lib/models/signedInUserMappers.ts +++ b/packages/@azure/graph/lib/models/signedInUserMappers.ts @@ -19,6 +19,8 @@ export { AppRole, RequiredResourceAccess, ResourceAccess, + KeyCredential, + PasswordCredential, ADGroup, ServicePrincipal } from "../models/mappers"; diff --git a/packages/@azure/graph/lib/models/usersMappers.ts b/packages/@azure/graph/lib/models/usersMappers.ts index b5a83a95b4c9..6c5e11b1ca84 100644 --- a/packages/@azure/graph/lib/models/usersMappers.ts +++ b/packages/@azure/graph/lib/models/usersMappers.ts @@ -25,6 +25,8 @@ export { AppRole, RequiredResourceAccess, ResourceAccess, + KeyCredential, + PasswordCredential, ADGroup, ServicePrincipal } from "../models/mappers"; diff --git a/packages/@azure/graph/lib/operations/applications.ts b/packages/@azure/graph/lib/operations/applications.ts index 1f9021edd05a..7e48149aeee3 100644 --- a/packages/@azure/graph/lib/operations/applications.ts +++ b/packages/@azure/graph/lib/operations/applications.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/applicationsMappers"; import * as Parameters from "../models/parameters"; diff --git a/packages/@azure/graph/lib/operations/deletedApplications.ts b/packages/@azure/graph/lib/operations/deletedApplications.ts index 27a02f296c4c..a004c5db947d 100644 --- a/packages/@azure/graph/lib/operations/deletedApplications.ts +++ b/packages/@azure/graph/lib/operations/deletedApplications.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/deletedApplicationsMappers"; import * as Parameters from "../models/parameters"; diff --git a/packages/@azure/graph/lib/operations/domains.ts b/packages/@azure/graph/lib/operations/domains.ts index 5a7c6dca619e..a335bda681a8 100644 --- a/packages/@azure/graph/lib/operations/domains.ts +++ b/packages/@azure/graph/lib/operations/domains.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/domainsMappers"; import * as Parameters from "../models/parameters"; diff --git a/packages/@azure/graph/lib/operations/groups.ts b/packages/@azure/graph/lib/operations/groups.ts index bbbb65ef2645..13b12937a6d0 100644 --- a/packages/@azure/graph/lib/operations/groups.ts +++ b/packages/@azure/graph/lib/operations/groups.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/groupsMappers"; import * as Parameters from "../models/parameters"; diff --git a/packages/@azure/graph/lib/operations/oAuth2.ts b/packages/@azure/graph/lib/operations/oAuth2.ts index 4d14c94451bd..b715b3d45ebe 100644 --- a/packages/@azure/graph/lib/operations/oAuth2.ts +++ b/packages/@azure/graph/lib/operations/oAuth2.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/oAuth2Mappers"; import * as Parameters from "../models/parameters"; diff --git a/packages/@azure/graph/lib/operations/objects.ts b/packages/@azure/graph/lib/operations/objects.ts index 477daeb10505..37945879a87f 100644 --- a/packages/@azure/graph/lib/operations/objects.ts +++ b/packages/@azure/graph/lib/operations/objects.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/objectsMappers"; import * as Parameters from "../models/parameters"; diff --git a/packages/@azure/graph/lib/operations/servicePrincipals.ts b/packages/@azure/graph/lib/operations/servicePrincipals.ts index 0c5b9e517092..0d58ca3989d3 100644 --- a/packages/@azure/graph/lib/operations/servicePrincipals.ts +++ b/packages/@azure/graph/lib/operations/servicePrincipals.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/servicePrincipalsMappers"; import * as Parameters from "../models/parameters"; diff --git a/packages/@azure/graph/lib/operations/signedInUser.ts b/packages/@azure/graph/lib/operations/signedInUser.ts index d10d7f2c4bfd..07ffc7817ec3 100644 --- a/packages/@azure/graph/lib/operations/signedInUser.ts +++ b/packages/@azure/graph/lib/operations/signedInUser.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/signedInUserMappers"; import * as Parameters from "../models/parameters"; diff --git a/packages/@azure/graph/lib/operations/users.ts b/packages/@azure/graph/lib/operations/users.ts index 3da2a311bd1a..8a8c37e531f1 100644 --- a/packages/@azure/graph/lib/operations/users.ts +++ b/packages/@azure/graph/lib/operations/users.ts @@ -8,7 +8,7 @@ * regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/usersMappers"; import * as Parameters from "../models/parameters"; diff --git a/packages/@azure/graph/package.json b/packages/@azure/graph/package.json index ad0617f9c047..0c8a74049adc 100644 --- a/packages/@azure/graph/package.json +++ b/packages/@azure/graph/package.json @@ -4,8 +4,8 @@ "description": "GraphRbacManagementClient Library with typescript type definitions for node.js and browser.", "version": "0.1.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", + "ms-rest-azure-js": "^1.0.181", + "ms-rest-js": "^1.0.460", "tslib": "^1.9.3" }, "keywords": [ diff --git a/packages/@azure/graph/rollup.config.js b/packages/@azure/graph/rollup.config.js index ce8ffd7b2db8..1ff5fdf654cf 100644 --- a/packages/@azure/graph/rollup.config.js +++ b/packages/@azure/graph/rollup.config.js @@ -4,15 +4,15 @@ import nodeResolve from "rollup-plugin-node-resolve"; */ const config = { input: './esm/graphRbacManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + external: ["ms-rest-js", "ms-rest-azure-js"], output: { file: "./dist/graph.js", format: "umd", name: "Azure.Graph", sourcemap: true, globals: { - "@azure/ms-rest-js": "msRest", - "@azure/ms-rest-azure-js": "msRestAzure" + "ms-rest-js": "msRest", + "ms-rest-azure-js": "msRestAzure" }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/packages/@azure/graph/tsconfig.json b/packages/@azure/graph/tsconfig.json index 51ea90961ce5..f32d1664f320 100644 --- a/packages/@azure/graph/tsconfig.json +++ b/packages/@azure/graph/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./lib/**/*.ts"], + "include": ["./lib/**/*"], "exclude": ["node_modules"] }