@microsoft/teamsfx-react 3.0.2-alpha.9b38c38b5.0 → 3.0.2-alpha.ebba7eb40.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/build/cjs/useGraph.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ type GraphOptionWithCredential = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Helper function to call Microsoft Graph API with authentication.
|
|
14
|
+
* @deprecated Please use {@link useGraphWithCredential} instead.
|
|
14
15
|
*
|
|
15
16
|
* @param fetchGraphDataAsync - async function of how to call Graph API and fetch data.
|
|
16
17
|
* @param options - teamsfx instance and OAuth resource scope.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGraph.d.ts","sourceRoot":"","sources":["../../src/useGraph.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAW,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,OAAO,EAGP,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useGraph.d.ts","sourceRoot":"","sources":["../../src/useGraph.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAW,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,OAAO,EAGP,mBAAmB,EAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAc,MAAM,mCAAmC,CAAC;AAIvE,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,EACrF,OAAO,CAAC,EAAE,WAAW,GACpB,IAAI,CAAC,CAAC,CAAC,CAkCT;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,mBAAmB,EAAE,CACnB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,mBAAmB,EAC/B,KAAK,EAAE,MAAM,EAAE,KACZ,OAAO,CAAC,CAAC,CAAC,EACf,OAAO,CAAC,EAAE,yBAAyB,GAClC,IAAI,CAAC,CAAC,CAAC,CAuDT"}
|
package/build/cjs/useGraph.js
CHANGED
|
@@ -7,9 +7,11 @@ var tslib_1 = require("tslib");
|
|
|
7
7
|
var useData_1 = require("./useData");
|
|
8
8
|
var teamsfx_1 = require("@microsoft/teamsfx");
|
|
9
9
|
var microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
|
|
10
|
+
var azureTokenCredentials_1 = require("@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials");
|
|
10
11
|
var react_1 = require("react");
|
|
11
12
|
/**
|
|
12
13
|
* Helper function to call Microsoft Graph API with authentication.
|
|
14
|
+
* @deprecated Please use {@link useGraphWithCredential} instead.
|
|
13
15
|
*
|
|
14
16
|
* @param fetchGraphDataAsync - async function of how to call Graph API and fetch data.
|
|
15
17
|
* @param options - teamsfx instance and OAuth resource scope.
|
|
@@ -101,7 +103,7 @@ function useGraphWithCredential(fetchGraphDataAsync, options) {
|
|
|
101
103
|
}
|
|
102
104
|
var _a = (0, react_1.useState)(false), needConsent = _a[0], setNeedConsent = _a[1];
|
|
103
105
|
var _b = (0, useData_1.useData)(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
104
|
-
var err_3, helpLink, graph, graphData, err_4;
|
|
106
|
+
var err_3, helpLink, authProvider, graph, graphData, err_4;
|
|
105
107
|
var _a, _b;
|
|
106
108
|
return tslib_1.__generator(this, function (_c) {
|
|
107
109
|
switch (_c.label) {
|
|
@@ -127,7 +129,10 @@ function useGraphWithCredential(fetchGraphDataAsync, options) {
|
|
|
127
129
|
throw err_3;
|
|
128
130
|
case 4:
|
|
129
131
|
_c.trys.push([4, 6, , 7]);
|
|
130
|
-
|
|
132
|
+
authProvider = new azureTokenCredentials_1.TokenCredentialAuthenticationProvider(credential, { scopes: scope });
|
|
133
|
+
graph = microsoft_graph_client_1.Client.initWithMiddleware({
|
|
134
|
+
authProvider: authProvider,
|
|
135
|
+
});
|
|
131
136
|
return [4 /*yield*/, fetchGraphDataAsync(graph, credential, scope)];
|
|
132
137
|
case 5:
|
|
133
138
|
graphData = _c.sent();
|
package/build/esm/useGraph.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ type GraphOptionWithCredential = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Helper function to call Microsoft Graph API with authentication.
|
|
14
|
+
* @deprecated Please use {@link useGraphWithCredential} instead.
|
|
14
15
|
*
|
|
15
16
|
* @param fetchGraphDataAsync - async function of how to call Graph API and fetch data.
|
|
16
17
|
* @param options - teamsfx instance and OAuth resource scope.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGraph.d.ts","sourceRoot":"","sources":["../../src/useGraph.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAW,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,OAAO,EAGP,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useGraph.d.ts","sourceRoot":"","sources":["../../src/useGraph.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAW,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,OAAO,EAGP,mBAAmB,EAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAc,MAAM,mCAAmC,CAAC;AAIvE,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,EACrF,OAAO,CAAC,EAAE,WAAW,GACpB,IAAI,CAAC,CAAC,CAAC,CAkCT;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,mBAAmB,EAAE,CACnB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,mBAAmB,EAC/B,KAAK,EAAE,MAAM,EAAE,KACZ,OAAO,CAAC,CAAC,CAAC,EACf,OAAO,CAAC,EAAE,yBAAyB,GAClC,IAAI,CAAC,CAAC,CAAC,CAuDT"}
|
package/build/esm/useGraph.js
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
import { __assign, __awaiter, __generator } from "tslib";
|
|
4
4
|
import { useData } from "./useData";
|
|
5
|
-
import { TeamsFx, createMicrosoftGraphClient, ErrorWithCode, TeamsUserCredential,
|
|
6
|
-
import { GraphError } from "@microsoft/microsoft-graph-client";
|
|
5
|
+
import { TeamsFx, createMicrosoftGraphClient, ErrorWithCode, TeamsUserCredential, } from "@microsoft/teamsfx";
|
|
6
|
+
import { Client, GraphError } from "@microsoft/microsoft-graph-client";
|
|
7
|
+
import { TokenCredentialAuthenticationProvider } from "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials";
|
|
7
8
|
import { useState } from "react";
|
|
8
9
|
/**
|
|
9
10
|
* Helper function to call Microsoft Graph API with authentication.
|
|
11
|
+
* @deprecated Please use {@link useGraphWithCredential} instead.
|
|
10
12
|
*
|
|
11
13
|
* @param fetchGraphDataAsync - async function of how to call Graph API and fetch data.
|
|
12
14
|
* @param options - teamsfx instance and OAuth resource scope.
|
|
@@ -97,7 +99,7 @@ export function useGraphWithCredential(fetchGraphDataAsync, options) {
|
|
|
97
99
|
}
|
|
98
100
|
var _a = useState(false), needConsent = _a[0], setNeedConsent = _a[1];
|
|
99
101
|
var _b = useData(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
100
|
-
var err_3, helpLink, graph, graphData, err_4;
|
|
102
|
+
var err_3, helpLink, authProvider, graph, graphData, err_4;
|
|
101
103
|
var _a, _b;
|
|
102
104
|
return __generator(this, function (_c) {
|
|
103
105
|
switch (_c.label) {
|
|
@@ -123,7 +125,10 @@ export function useGraphWithCredential(fetchGraphDataAsync, options) {
|
|
|
123
125
|
throw err_3;
|
|
124
126
|
case 4:
|
|
125
127
|
_c.trys.push([4, 6, , 7]);
|
|
126
|
-
|
|
128
|
+
authProvider = new TokenCredentialAuthenticationProvider(credential, { scopes: scope });
|
|
129
|
+
graph = Client.initWithMiddleware({
|
|
130
|
+
authProvider: authProvider,
|
|
131
|
+
});
|
|
127
132
|
return [4 /*yield*/, fetchGraphDataAsync(graph, credential, scope)];
|
|
128
133
|
case 5:
|
|
129
134
|
graphData = _c.sent();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/teamsfx-react",
|
|
3
|
-
"version": "3.0.2-alpha.
|
|
3
|
+
"version": "3.0.2-alpha.ebba7eb40.0",
|
|
4
4
|
"description": "React helper functions for Microsoft TeamsFx",
|
|
5
5
|
"main": "build/cjs/index.js",
|
|
6
6
|
"module": "build/esm/index.js",
|
|
@@ -30,10 +30,9 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@fluentui/react-components": "^9.15.0",
|
|
32
32
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
33
|
-
"@microsoft/eslint-plugin-teamsfx": "0.0.5-alpha.9b38c38b5.0",
|
|
34
33
|
"@microsoft/microsoft-graph-client": "^3.0.5",
|
|
35
34
|
"@microsoft/teams-js": "^2.13.0",
|
|
36
|
-
"@microsoft/teamsfx": "2.2.3-alpha.
|
|
35
|
+
"@microsoft/teamsfx": "2.2.3-alpha.ebba7eb40.0",
|
|
37
36
|
"@testing-library/react": "^13.4.0",
|
|
38
37
|
"@types/enzyme": "^3.10.10",
|
|
39
38
|
"@types/jest": "^29.4.0",
|
|
@@ -89,5 +88,5 @@
|
|
|
89
88
|
"npx eslint --cache --fix --quiet"
|
|
90
89
|
]
|
|
91
90
|
},
|
|
92
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "50901701c821f12da858eb87a8941d2d24ddd4c3"
|
|
93
92
|
}
|