Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@openfin/microsoft365

Package Overview
Dependencies
Maintainers
59
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfin/microsoft365 - npm Package Compare versions

Comparing version
1.1.0-beta.1
to
1.1.0-beta.2
+1
-1
package.json
{
"name": "@openfin/microsoft365",
"description": "Connect OpenFin Container with Microsoft 365",
"version": "1.1.0-beta.1",
"version": "1.1.0-beta.2",
"author": "OpenFin Inc.",

@@ -6,0 +6,0 @@ "homepage": "https://www.openfin.co/",

import { AuthFlowParams, AuthWindowOptions } from '@openfin/oauth';
import { Microsoft365Connection } from './connection.types';
/**
* Initiates the OAuth 2.0 authorization code flow and establishes a connection with a Microsoft 365 instance. Requires that an {@link https://learn.microsoft.com/en-us/graph/auth-register-app-v2 | app has been registered} with Azure AD.
* Initiates the OAuth 2.0 authorization code flow and establishes a connection with a Microsoft 365 tenant. Requires that an {@link https://learn.microsoft.com/en-us/graph/auth-register-app-v2 | app has been registered} with Azure AD.
*

@@ -20,13 +20,14 @@ * @param clientId - The ID of the registered app to use for authorization.

/**
* Retrieves a connection to a Salesforce org, assuming the user is currently authenticated to Salesforce and the {@link https://help.salesforce.com/articleView?id=sf.connected_app_overview.htm | Connected App} has been previously authorized.
* Retrieves a connection to a Microsoft 365 tenant, assuming the user is currently authenticated to Salesforce and the {@link https://learn.microsoft.com/en-us/graph/auth-register-app-v2 | registered application} has been previously authorized.
*
* Unlike {@link connect}, if a connection could not be established because the user is not authenticated to Salesforce or the {@link https://help.salesforce.com/articleView?id=sf.connected_app_overview.htm | Connected App} has not been authorized, the function simply returns `null` and does not throw an error.
* Unlike {@link connect}, if a connection could not be established because the user is not authenticated to Microsoft 365 or the {@link https://learn.microsoft.com/en-us/graph/auth-register-app-v2 | registered application} has not been authorized, the function simply returns `null` and does not throw an error.
*
* @param orgUrl - The URL of the Salesforce org to connect to, which should be in the form: https://*MyDomainName*.my.salesforce.com.
* @param consumerKey - The Consumer Key of the {@link https://help.salesforce.com/articleView?id=sf.connected_app_overview.htm | Connected App} to use for authorization.
* @param scope - Provide any additional OAuth {@link https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_tokens_scopes.htm | scopes} that may be required by your app.
* @param clientId - The ID of the registered app to use for authorization.
* @param tenantId - The ID of the Azure AD tenant where the app has been registered.
* @param redirectUri - The redirect URI value specified in the registered app’s configuration.
* @param permissions - Provide any additional Graph {@link https://learn.microsoft.com/en-us/graph/permissions-reference | permissions} that may be required by your app.
*
* @returns A {@link SalesforceConnection | connection}, or `null` if the user is not authenticated to Salesforce or the {@link https://help.salesforce.com/articleView?id=sf.connected_app_overview.htm | Connected App} has not been authorized.
* @returns A {@link Microsoft365Connection | connection}, or `null` if the user is not authenticated to Microsoft 365 or the {@link https://learn.microsoft.com/en-us/graph/auth-register-app-v2 | registered application} has not been authorized.
*
* @throws {@link AuthorizationError} if the authorization process does not complete successfully for any reason other than the user is not authenticated to Salesforce or the {@link https://help.salesforce.com/articleView?id=sf.connected_app_overview.htm | Connected App} has not been authorized.
* @throws {@link AuthorizationError} if the authorization process does not complete successfully.
* @throws {@link ParameterError} if invalid function parameter values are detected.

@@ -33,0 +34,0 @@ */

import { ApiRequestHeaders, HttpMethod } from '@openfin/oauth';
import { Microsoft365Provider } from '../provider/provider';
import { GraphResponse, GraphUser } from '../rest-api/rest-api.types';
import { GraphApiTypes, GraphResponse } from '../rest-api/rest-api.types';
/**

@@ -13,3 +13,3 @@ * A connection to a Microsoft 365 instance.

/** The Azure AD user that has delegated Graph API permissions via the authorization process. */
currentUser: GraphUser;
currentUser: GraphApiTypes.User;
/** Terminates the connection to Microsoft 365 and cleans up utilized resources. */

@@ -30,2 +30,3 @@ disconnect: () => Promise<void>;

* @param includeAuthorization - Whether the `Authorization` header will be added automatically. Defaults to 'true', set this to `false` when making requests to endpoints that do not expect an `Authorization` header.
* @param abortSignal - Optionally provide an {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | abort signal} that can be used to cancel the request before completion.
*

@@ -37,3 +38,3 @@ * @returns A {@link GraphResponse | response object} containing the HTTP response status code and requested data (if relevant).

*/
executeApiRequest<T = unknown>(apiEndpoint: string, httpMethod?: HttpMethod, data?: any, headers?: ApiRequestHeaders, includeAuthorization?: boolean): Promise<GraphResponse<T>>;
executeApiRequest<T = unknown>(apiEndpoint: string, httpMethod?: HttpMethod, data?: any, headers?: ApiRequestHeaders, includeAuthorization?: boolean, abortSignal?: AbortSignal): Promise<GraphResponse<T>>;
/** @internal */

@@ -40,0 +41,0 @@ provider: Microsoft365Provider;

@@ -12,3 +12,3 @@ /**

export { TeamsConnection } from './products/teams/teams-connection';
export { GraphResponse, GraphUser } from './rest-api/rest-api.types';
export { ApiError, ApiRequestError, ApiRequestHeaders, AuthFlowParams, AuthorizationError, AuthTokenExpiredError, AuthWindowOptions, HttpMethod, InitializationError, ParameterError, } from '@openfin/oauth';
export { GraphApiTypes, GraphResponse } from './rest-api/rest-api.types';
export { ApiError, ApiRequestCancelledError, ApiRequestError, ApiRequestHeaders, AuthFlowParams, AuthorizationError, AuthTokenExpiredError, AuthWindowOptions, HttpMethod, InitializationError, ParameterError, } from '@openfin/oauth';
import * as Graph from '@microsoft/microsoft-graph-types';
import { ApiRequestHeaders, HttpMethod } from '@openfin/oauth';
import { Microsoft365Provider } from '../provider/provider';
import { GraphBatchRequestItem, GraphResponse } from './rest-api.types';
import { GraphApiTypes, GraphResponse } from './rest-api.types';
export declare const appendLeadingSlashIfMissing: (text: string) => string;
export declare const executeBatchRequest: <T = unknown>(provider: Microsoft365Provider, requests?: GraphBatchRequestItem[]) => Promise<T>;
export declare const executeGraphApiRequest: (provider: Microsoft365Provider) => <T = unknown>(apiEndpoint: string, httpMethod?: HttpMethod, data?: any, headers?: ApiRequestHeaders, includeAuthorization?: boolean) => Promise<GraphResponse<T>>;
export declare const executeBatchRequest: <T = unknown>(provider: Microsoft365Provider, requests?: GraphApiTypes.BatchRequestItem[]) => Promise<T>;
export declare const executeGraphApiRequest: (provider: Microsoft365Provider) => <T = unknown>(apiEndpoint: string, httpMethod?: HttpMethod, data?: any, headers?: ApiRequestHeaders, includeAuthorization?: boolean, abortSignal?: AbortSignal) => Promise<GraphResponse<T>>;
export declare const getCurrentUser: (provider: Microsoft365Provider) => Promise<Graph.User>;
export declare const getUsersFromEmailAddresses: (provider: Microsoft365Provider, emails: string[], props?: string[]) => Promise<(Graph.User | undefined)[]>;
import { ApiRequestHeaders, HttpMethod } from '@openfin/oauth';
/** @internal */
export type GraphBatchRequestItem = {
body?: any;
headers?: ApiRequestHeaders;
id?: string;
method: HttpMethod;
url: string;
};
/** @internal */
export type GraphBatchRequestResponse = {
responses: GraphBatchRequestResponseItem[];
};
/** @internal */
export type GraphBatchRequestResponseItem = {
body: any;
headers: ApiRequestHeaders;
id: string;
status: number;
};
/** @internal */
export type GraphError = {
code: string;
innerError: GraphError;
message: string;
};
/** @internal */
export type GraphErrorResponse = {
error: GraphError;
};
/** @internal */
export type GraphListResponse<T = unknown> = {
value: T[];
};
/**
* A collection of Microsoft Graph API type definitions for use when using the `Microsoft365Connection.executeApiRequest` function.
*/
export declare namespace GraphApiTypes {
/**
* @group Types
*/
type BatchRequestItem = {
body?: any;
headers?: ApiRequestHeaders;
id?: string;
method: HttpMethod;
url: string;
};
/**
* @group Types
*/
type BatchRequestResponse = {
responses: BatchRequestResponseItem[];
};
/**
* @group Types
*/
type BatchRequestResponseItem = {
body: any;
headers: ApiRequestHeaders;
id: string;
status: number;
};
/**
* @group Types
*/
type Error = {
code: string;
innerError: Error;
message: string;
};
/**
* @group Types
*/
type ErrorResponse = {
error: Error;
};
/**
* @group Types
*/
type ListResponse<T = unknown> = {
value: T[];
};
/**
* Default set of properties returned from Graph API for an Azure AD user.
*
* Note: This type is provided to avoid a dependency on the {@link https://www.npmjs.com/package/@microsoft/microsoft-graph-types | @microsoft/microsoft-graph-types} NPM package, API consumers should prefer the `User` type from that package over this one.
*
* @group Types
*/
type User = {
businessPhones?: string[];
displayName?: string | null;
givenName?: string | null;
id?: string;
jobTitle?: string | null;
mail?: string | null;
mobilePhone?: string | null;
officeLocation?: string | null;
preferredLanguage?: string | null;
surname?: string | null;
userPrincipalName?: string | null;
};
}
/**
* Response to a Graph API request made by calling `executeApiRequest` from a {@link Microsoft365Connection} object.

@@ -50,21 +87,1 @@ *

};
/**
* Default set of properties returned from Graph API for an Azure AD user.
*
* Note: This type is not intended to be imported and used, instead import `User` type from the {@link https://www.npmjs.com/package/@microsoft/microsoft-graph-types | @microsoft/microsoft-graph-types} NPM package.
*
* @group Types
*/
export type GraphUser = {
businessPhones?: string[];
displayName?: string | null;
givenName?: string | null;
id?: string;
jobTitle?: string | null;
mail?: string | null;
mobilePhone?: string | null;
officeLocation?: string | null;
preferredLanguage?: string | null;
surname?: string | null;
userPrincipalName?: string | null;
};

@@ -1,1 +0,1 @@

export declare const API_VERSION = "1.1.0-beta.1";
export declare const API_VERSION = "1.1.0-beta.2";

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display