@kwiz/common 1.0.126 → 1.0.128
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/.github/workflows/npm-publish.yml +24 -24
- package/.madgerc +2 -2
- package/LICENSE +21 -21
- package/fix-folder-imports.js +26 -26
- package/lib/cjs/types/libs/msal.types.js +26 -26
- package/lib/cjs/utils/auth/common.js +84 -37
- package/lib/cjs/utils/auth/common.js.map +1 -1
- package/lib/cjs/utils/sharepoint.rest/user.js +11 -11
- package/lib/esm/types/libs/msal.types.js +26 -26
- package/lib/esm/utils/auth/common.js +84 -38
- package/lib/esm/utils/auth/common.js.map +1 -1
- package/lib/esm/utils/sharepoint.rest/user.js +11 -11
- package/lib/types/types/auth.d.ts +7 -0
- package/lib/types/utils/auth/common.d.ts +2 -0
- package/package.json +81 -81
- package/readme.md +17 -17
- package/src/_dependencies.ts +12 -12
- package/src/config.ts +17 -17
- package/src/helpers/Guid.ts +181 -181
- package/src/helpers/base64.ts +173 -173
- package/src/helpers/browser.test.js +13 -13
- package/src/helpers/browser.ts +1498 -1498
- package/src/helpers/browserinfo.ts +292 -292
- package/src/helpers/collections.base.test.js +25 -25
- package/src/helpers/collections.base.ts +437 -437
- package/src/helpers/collections.ts +107 -107
- package/src/helpers/color.ts +54 -54
- package/src/helpers/cookies.ts +59 -59
- package/src/helpers/date.test.js +119 -119
- package/src/helpers/date.ts +188 -188
- package/src/helpers/debug.ts +186 -186
- package/src/helpers/diagrams.ts +43 -43
- package/src/helpers/emails.ts +6 -6
- package/src/helpers/eval.ts +5 -5
- package/src/helpers/file.test.js +50 -50
- package/src/helpers/file.ts +63 -63
- package/src/helpers/flatted.ts +149 -149
- package/src/helpers/functions.ts +16 -16
- package/src/helpers/graph/calendar.types.ts +10 -10
- package/src/helpers/http.ts +69 -69
- package/src/helpers/images.ts +22 -22
- package/src/helpers/json.ts +44 -44
- package/src/helpers/md5.ts +189 -189
- package/src/helpers/objects.test.js +33 -33
- package/src/helpers/objects.ts +274 -274
- package/src/helpers/promises.test.js +37 -37
- package/src/helpers/promises.ts +165 -165
- package/src/helpers/random.ts +27 -27
- package/src/helpers/scheduler/scheduler.test.js +103 -103
- package/src/helpers/scheduler/scheduler.ts +131 -131
- package/src/helpers/sharepoint.ts +796 -796
- package/src/helpers/strings.test.js +122 -122
- package/src/helpers/strings.ts +337 -337
- package/src/helpers/typecheckers.test.js +34 -34
- package/src/helpers/typecheckers.ts +266 -266
- package/src/helpers/url.test.js +43 -43
- package/src/helpers/url.ts +207 -207
- package/src/helpers/urlhelper.ts +111 -111
- package/src/index.ts +6 -6
- package/src/types/auth.ts +62 -54
- package/src/types/common.types.ts +15 -15
- package/src/types/flatted.types.ts +59 -59
- package/src/types/globals.types.ts +6 -6
- package/src/types/graph/calendar.types.ts +80 -80
- package/src/types/knownscript.types.ts +18 -18
- package/src/types/libs/datajs.types.ts +28 -28
- package/src/types/libs/ics.types.ts +30 -30
- package/src/types/libs/msal.types.ts +57 -57
- package/src/types/locales.ts +125 -125
- package/src/types/localstoragecache.types.ts +8 -8
- package/src/types/location.types.ts +27 -27
- package/src/types/moment.ts +11 -11
- package/src/types/regex.types.ts +16 -16
- package/src/types/rest.types.ts +95 -95
- package/src/types/sharepoint.types.ts +1466 -1466
- package/src/types/sharepoint.utils.types.ts +306 -306
- package/src/utils/auth/common.ts +119 -74
- package/src/utils/auth/discovery.test.js +12 -12
- package/src/utils/auth/discovery.ts +132 -132
- package/src/utils/base64.ts +27 -27
- package/src/utils/consolelogger.ts +333 -333
- package/src/utils/date.ts +172 -172
- package/src/utils/emails.ts +24 -24
- package/src/utils/knownscript.ts +286 -286
- package/src/utils/localstoragecache.ts +446 -446
- package/src/utils/rest.ts +501 -501
- package/src/utils/script.ts +170 -170
- package/src/utils/sharepoint.rest/common.ts +159 -159
- package/src/utils/sharepoint.rest/date.ts +62 -62
- package/src/utils/sharepoint.rest/file.folder.ts +685 -685
- package/src/utils/sharepoint.rest/item.ts +547 -547
- package/src/utils/sharepoint.rest/list.ts +1572 -1572
- package/src/utils/sharepoint.rest/listutils/GetListItemsByCaml.ts +774 -774
- package/src/utils/sharepoint.rest/listutils/GetListItemsById.ts +275 -275
- package/src/utils/sharepoint.rest/listutils/common.ts +206 -206
- package/src/utils/sharepoint.rest/location.ts +141 -141
- package/src/utils/sharepoint.rest/navigation-links.ts +86 -86
- package/src/utils/sharepoint.rest/user-search.ts +252 -252
- package/src/utils/sharepoint.rest/user.ts +558 -558
- package/src/utils/sharepoint.rest/web.ts +1384 -1384
- package/src/utils/sod.ts +194 -194
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Node.js Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
tags:
|
|
9
|
-
- 'v*.*.*' # run every time we commit with a new version number
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build-publish-npm:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
- uses: actions/setup-node@v4
|
|
17
|
-
with:
|
|
18
|
-
node-version: 18
|
|
19
|
-
registry-url: https://registry.npmjs.org/
|
|
20
|
-
- run: npm ci
|
|
21
|
-
- run: npm run build
|
|
22
|
-
- run: npm publish --access public
|
|
23
|
-
env:
|
|
24
|
-
NODE_AUTH_TOKEN: ${{secrets.KWIZ_NPM_TOKEN}}
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
tags:
|
|
9
|
+
- 'v*.*.*' # run every time we commit with a new version number
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build-publish-npm:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: 18
|
|
19
|
+
registry-url: https://registry.npmjs.org/
|
|
20
|
+
- run: npm ci
|
|
21
|
+
- run: npm run build
|
|
22
|
+
- run: npm publish --access public
|
|
23
|
+
env:
|
|
24
|
+
NODE_AUTH_TOKEN: ${{secrets.KWIZ_NPM_TOKEN}}
|
package/.madgerc
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"fileExtensions": ["js", "ts"]
|
|
1
|
+
{
|
|
2
|
+
"fileExtensions": ["js", "ts"]
|
|
3
3
|
}
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 KWIZ Corp
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 KWIZ Corp
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/fix-folder-imports.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
const glob = require('glob');
|
|
2
|
-
const fs = require("fs-extra");
|
|
3
|
-
const exportsFileName = "exports-index";
|
|
4
|
-
const exportsFileNameWithExt = `${exportsFileName}.ts`;
|
|
5
|
-
const exportsIndexFiles = glob.sync(`./src/**/${exportsFileNameWithExt}`);
|
|
6
|
-
//loop every exportsIndexFiles and find any import to a directory, and replace with /exports-index
|
|
7
|
-
console.time("fixing direcry imports");
|
|
8
|
-
exportsIndexFiles.forEach(file => {
|
|
9
|
-
var content = fs.readFileSync(file, "utf8").split("\n");
|
|
10
|
-
var parentFolderContent = fs.readdirSync(file.replace(exportsFileNameWithExt, ''));
|
|
11
|
-
var hasChanges = false;
|
|
12
|
-
//loop every import - if it does not match a file in the folder, but matches a sub-folder - append exports-index to it
|
|
13
|
-
content.forEach((line, idx) => {
|
|
14
|
-
if (line.replace(/ /g, '').length > 0) {
|
|
15
|
-
let importName = line.slice(line.indexOf('./') + 2, line.length - 2);
|
|
16
|
-
if (parentFolderContent.includes(importName))//its a folder, otherwise it would be .ts
|
|
17
|
-
{
|
|
18
|
-
content[idx] = line.replace(`./${importName}`, `./${importName}/${exportsFileName}`);
|
|
19
|
-
hasChanges = true;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
if (hasChanges) {
|
|
24
|
-
fs.writeFileSync(file, content.join('\n'));
|
|
25
|
-
}
|
|
26
|
-
});
|
|
1
|
+
const glob = require('glob');
|
|
2
|
+
const fs = require("fs-extra");
|
|
3
|
+
const exportsFileName = "exports-index";
|
|
4
|
+
const exportsFileNameWithExt = `${exportsFileName}.ts`;
|
|
5
|
+
const exportsIndexFiles = glob.sync(`./src/**/${exportsFileNameWithExt}`);
|
|
6
|
+
//loop every exportsIndexFiles and find any import to a directory, and replace with /exports-index
|
|
7
|
+
console.time("fixing direcry imports");
|
|
8
|
+
exportsIndexFiles.forEach(file => {
|
|
9
|
+
var content = fs.readFileSync(file, "utf8").split("\n");
|
|
10
|
+
var parentFolderContent = fs.readdirSync(file.replace(exportsFileNameWithExt, ''));
|
|
11
|
+
var hasChanges = false;
|
|
12
|
+
//loop every import - if it does not match a file in the folder, but matches a sub-folder - append exports-index to it
|
|
13
|
+
content.forEach((line, idx) => {
|
|
14
|
+
if (line.replace(/ /g, '').length > 0) {
|
|
15
|
+
let importName = line.slice(line.indexOf('./') + 2, line.length - 2);
|
|
16
|
+
if (parentFolderContent.includes(importName))//its a folder, otherwise it would be .ts
|
|
17
|
+
{
|
|
18
|
+
content[idx] = line.replace(`./${importName}`, `./${importName}/${exportsFileName}`);
|
|
19
|
+
hasChanges = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
if (hasChanges) {
|
|
24
|
+
fs.writeFileSync(file, content.join('\n'));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
27
|
console.timeEnd("fixing direcry imports");
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MSALSampleLoginPopupScript = void 0;
|
|
4
|
-
exports.MSALSampleLoginPopupScript = `<p id="msg">please wait...</p>
|
|
5
|
-
<script>
|
|
6
|
-
function finish() {
|
|
7
|
-
try {
|
|
8
|
-
var hash = window.location.hash;
|
|
9
|
-
if (hash[0] === "#") hash = hash.slice(1);//get rid of #
|
|
10
|
-
var hashDictionary = {};
|
|
11
|
-
hash.split("&").forEach(function (keyValue) {
|
|
12
|
-
if (keyValue !== "") {
|
|
13
|
-
var vals = keyValue.split("=");
|
|
14
|
-
hashDictionary[vals[0]] = decodeURIComponent(vals[1]);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
if (Object.keys(hashDictionary).length < 1)
|
|
18
|
-
window.close();//we lose the hash!
|
|
19
|
-
else if (hashDictionary.error && hashDictionary.error_description)
|
|
20
|
-
document.getElementById("msg").innerHTML = hashDictionary.error_description.replace(/\\+/g," ").replace(/\\n/g,"<br /><br />");
|
|
21
|
-
else if (hashDictionary.state) {
|
|
22
|
-
var origin = hashDictionary.state.split("|")[1];
|
|
23
|
-
if (origin) {
|
|
24
|
-
window.location.href = origin.split("#")[0] + window.location.hash;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
} catch (e) { }
|
|
28
|
-
}
|
|
29
|
-
finish();
|
|
4
|
+
exports.MSALSampleLoginPopupScript = `<p id="msg">please wait...</p>
|
|
5
|
+
<script>
|
|
6
|
+
function finish() {
|
|
7
|
+
try {
|
|
8
|
+
var hash = window.location.hash;
|
|
9
|
+
if (hash[0] === "#") hash = hash.slice(1);//get rid of #
|
|
10
|
+
var hashDictionary = {};
|
|
11
|
+
hash.split("&").forEach(function (keyValue) {
|
|
12
|
+
if (keyValue !== "") {
|
|
13
|
+
var vals = keyValue.split("=");
|
|
14
|
+
hashDictionary[vals[0]] = decodeURIComponent(vals[1]);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
if (Object.keys(hashDictionary).length < 1)
|
|
18
|
+
window.close();//we lose the hash!
|
|
19
|
+
else if (hashDictionary.error && hashDictionary.error_description)
|
|
20
|
+
document.getElementById("msg").innerHTML = hashDictionary.error_description.replace(/\\+/g," ").replace(/\\n/g,"<br /><br />");
|
|
21
|
+
else if (hashDictionary.state) {
|
|
22
|
+
var origin = hashDictionary.state.split("|")[1];
|
|
23
|
+
if (origin) {
|
|
24
|
+
window.location.href = origin.split("#")[0] + window.location.hash;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} catch (e) { }
|
|
28
|
+
}
|
|
29
|
+
finish();
|
|
30
30
|
</script>`;
|
|
31
31
|
//# sourceMappingURL=msal.types.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetSPFxClientAuthToken = exports.GetMSALSiteScope = exports.GetDefaultScope = exports.GetTokenAudiencePrefix = void 0;
|
|
3
|
+
exports.GetSPFxClientAuthTokenSync = exports.GetSPFxClientAuthToken = exports.GetMSALSiteScope = exports.GetDefaultScope = exports.GetTokenAudiencePrefix = void 0;
|
|
4
|
+
const exports_index_1 = require("../../exports-index");
|
|
4
5
|
const typecheckers_1 = require("../../helpers/typecheckers");
|
|
5
6
|
const auth_1 = require("../../types/auth");
|
|
6
7
|
const rest_1 = require("../rest");
|
|
@@ -17,52 +18,98 @@ function GetMSALSiteScope(hostName) {
|
|
|
17
18
|
return `https://${hostName}`;
|
|
18
19
|
}
|
|
19
20
|
exports.GetMSALSiteScope = GetMSALSiteScope;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
postCacheKey: `${spfxTokenType}_${_spPageContextInfo.webId}`,
|
|
21
|
+
function _getGetSPFxClientAuthTokenParams(siteUrl, spfxTokenType = auth_1.SPFxAuthTokenType.Graph) {
|
|
22
|
+
let acquireURL = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/SP.OAuth.Token/Acquire`;
|
|
23
|
+
//todo: add all the resource end points (ie. OneNote, Yammer, Stream)
|
|
24
|
+
let resource = "";
|
|
25
|
+
let isSPOToken = false;
|
|
26
|
+
switch (spfxTokenType) {
|
|
27
|
+
case auth_1.SPFxAuthTokenType.Outlook:
|
|
28
|
+
resource = "https://outlook.office365.com/search";
|
|
29
|
+
break;
|
|
30
|
+
case auth_1.SPFxAuthTokenType.SharePoint:
|
|
31
|
+
case auth_1.SPFxAuthTokenType.MySite:
|
|
32
|
+
isSPOToken = true;
|
|
33
|
+
resource = new URL(acquireURL).origin;
|
|
34
|
+
if (spfxTokenType === auth_1.SPFxAuthTokenType.MySite) {
|
|
35
|
+
let split = resource.split(".");
|
|
36
|
+
split[0] += "-my";
|
|
37
|
+
resource = split.join(".");
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
resource = "https://graph.microsoft.com";
|
|
42
|
+
}
|
|
43
|
+
let data = {
|
|
44
|
+
resource: resource,
|
|
45
|
+
tokenType: isSPOToken ? "SPO" : undefined
|
|
46
|
+
};
|
|
47
|
+
let params = {
|
|
48
|
+
url: acquireURL,
|
|
49
|
+
body: JSON.stringify(data),
|
|
50
|
+
options: {
|
|
51
|
+
allowCache: false,
|
|
52
|
+
// ...shortLocalCache,
|
|
53
|
+
// postCacheKey: `${spfxTokenType}_${_spPageContextInfo.webId}`,
|
|
54
54
|
includeDigestInPost: true,
|
|
55
55
|
headers: {
|
|
56
56
|
"Accept": "application/json;odata.metadata=minimal",
|
|
57
57
|
"content-type": "application/json; charset=UTF-8",
|
|
58
58
|
"odata-version": "4.0",
|
|
59
59
|
}
|
|
60
|
-
}
|
|
61
|
-
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return params;
|
|
63
|
+
}
|
|
64
|
+
function _parseAndCacheGetSPFxClientAuthTokenResult(result, spfxTokenType = auth_1.SPFxAuthTokenType.Graph) {
|
|
65
|
+
if (!(0, typecheckers_1.isNullOrUndefined)(result) && !(0, typecheckers_1.isNullOrEmptyString)(result.access_token)) {
|
|
66
|
+
let expiration = (0, typecheckers_1.isNumber)(result.expires_on) ?
|
|
67
|
+
new Date(result.expires_on * 1000) :
|
|
68
|
+
{
|
|
69
|
+
minutes: 15
|
|
70
|
+
};
|
|
71
|
+
(0, exports_index_1.setCacheItem)(`access_token_${spfxTokenType}_${_spPageContextInfo.webId}`, result.access_token, expiration);
|
|
72
|
+
return result.access_token;
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
function _getSPFxClientAuthTokenFromCache(spfxTokenType = auth_1.SPFxAuthTokenType.Graph) {
|
|
77
|
+
let cachedToken = (0, exports_index_1.getCacheItem)(`access_token_${spfxTokenType}_${_spPageContextInfo.webId}`);
|
|
78
|
+
if (!(0, typecheckers_1.isNullOrEmptyString)(cachedToken)) {
|
|
79
|
+
return cachedToken;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
/** Acquire an authorization token for a Outlook, Graph, or SharePoint the same way SPFx clients do */
|
|
84
|
+
async function GetSPFxClientAuthToken(siteUrl, spfxTokenType = auth_1.SPFxAuthTokenType.Graph) {
|
|
85
|
+
try {
|
|
86
|
+
let cachedToken = _getSPFxClientAuthTokenFromCache(spfxTokenType);
|
|
87
|
+
if (!(0, typecheckers_1.isNullOrEmptyString)(cachedToken)) {
|
|
88
|
+
return cachedToken;
|
|
89
|
+
}
|
|
90
|
+
let { url, body, options } = _getGetSPFxClientAuthTokenParams(siteUrl, spfxTokenType);
|
|
91
|
+
let result = await (0, rest_1.GetJson)(url, body, options);
|
|
92
|
+
return _parseAndCacheGetSPFxClientAuthTokenResult(result, spfxTokenType);
|
|
62
93
|
}
|
|
63
94
|
catch {
|
|
64
95
|
}
|
|
65
96
|
return null;
|
|
66
97
|
}
|
|
67
98
|
exports.GetSPFxClientAuthToken = GetSPFxClientAuthToken;
|
|
99
|
+
/** Acquire an authorization token for a Outlook, Graph, or SharePoint the same way SPFx clients do */
|
|
100
|
+
function GetSPFxClientAuthTokenSync(siteUrl, spfxTokenType = auth_1.SPFxAuthTokenType.Graph) {
|
|
101
|
+
try {
|
|
102
|
+
let cachedToken = _getSPFxClientAuthTokenFromCache(spfxTokenType);
|
|
103
|
+
if (!(0, typecheckers_1.isNullOrEmptyString)(cachedToken)) {
|
|
104
|
+
return cachedToken;
|
|
105
|
+
}
|
|
106
|
+
let { url, body, options } = _getGetSPFxClientAuthTokenParams(siteUrl, spfxTokenType);
|
|
107
|
+
let response = (0, rest_1.GetJsonSync)(url, body, options);
|
|
108
|
+
return _parseAndCacheGetSPFxClientAuthTokenResult(response.result, spfxTokenType);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
exports.GetSPFxClientAuthTokenSync = GetSPFxClientAuthTokenSync;
|
|
68
115
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/utils/auth/common.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/utils/auth/common.ts"],"names":[],"mappings":";;;AAAA,uDAA+E;AAC/E,6DAA8F;AAC9F,2CAAoE;AACpE,kCAA+C;AAC/C,sDAA2D;AAE3D,SAAgB,sBAAsB,CAAC,KAAa;IAChD,OAAO,SAAS,KAAK,EAAE,CAAC;AAC5B,CAAC;AAFD,wDAEC;AACD,SAAgB,eAAe,CAAC,KAAa;IACzC,OAAO,GAAG,sBAAsB,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAC7D,CAAC;AAFD,0CAEC;AACD,SAAgB,gBAAgB,CAAC,QAAgB;IAC7C,OAAO,WAAW,QAAQ,EAAE,CAAC;AACjC,CAAC;AAFD,4CAEC;AAED,SAAS,gCAAgC,CAAC,OAAe,EAAE,gBAAmC,wBAAiB,CAAC,KAAK;IACjH,IAAI,UAAU,GAAG,GAAG,IAAA,uBAAc,EAAC,OAAO,CAAC,yBAAyB,CAAC;IACrE,qEAAqE;IACrE,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,QAAQ,aAAa,EAAE,CAAC;QACpB,KAAK,wBAAiB,CAAC,OAAO;YAC1B,QAAQ,GAAG,sCAAsC,CAAC;YAClD,MAAM;QACV,KAAK,wBAAiB,CAAC,UAAU,CAAC;QAClC,KAAK,wBAAiB,CAAC,MAAM;YACzB,UAAU,GAAG,IAAI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AI,WAAW,GAAG,gCAAgC,CAAC,aAAa,CAAC,CAAC;QAClE,IAAI,CAAC,IAAA,kCAAmB,EAAC,WAAW,CAAC,EAAE,CAAC;YACpC,OAAO,WAAW,CAAC;QACvB,CAAC;QACD,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,gCAAgC,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QACtF,IAAI,QAAQ,GAAG,IAAA,kBAAW,EAAgB,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9D,OAAO,0CAA0C,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtF,CAAC;IAAC,MAAM,CAAC;IACT,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAZD,gEAYC"}
|
|
@@ -410,17 +410,17 @@ async function SetGroupOwner(siteUrl, groupId, ownerId, ownerIsAGroup) {
|
|
|
410
410
|
try {
|
|
411
411
|
let soapUrl = `${(0, common_1.GetSiteUrl)(siteUrl)}_vti_bin/client.svc/ProcessQuery`;
|
|
412
412
|
let siteId = await (0, web_1.GetSiteId)(siteUrl);
|
|
413
|
-
let serviceJSONResponse = await (0, rest_1.GetJson)(soapUrl, `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
|
|
414
|
-
<Actions>
|
|
415
|
-
<SetProperty Id="1" ObjectPathId="2" Name="Owner">
|
|
416
|
-
<Parameter ObjectPathId="3" />
|
|
417
|
-
</SetProperty>
|
|
418
|
-
<Method Name="Update" Id="4" ObjectPathId="2" />
|
|
419
|
-
</Actions>
|
|
420
|
-
<ObjectPaths>
|
|
421
|
-
<Identity Id="2" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${groupId}" />
|
|
422
|
-
<Identity Id="3" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${ownerId}" />
|
|
423
|
-
</ObjectPaths>
|
|
413
|
+
let serviceJSONResponse = await (0, rest_1.GetJson)(soapUrl, `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
|
|
414
|
+
<Actions>
|
|
415
|
+
<SetProperty Id="1" ObjectPathId="2" Name="Owner">
|
|
416
|
+
<Parameter ObjectPathId="3" />
|
|
417
|
+
</SetProperty>
|
|
418
|
+
<Method Name="Update" Id="4" ObjectPathId="2" />
|
|
419
|
+
</Actions>
|
|
420
|
+
<ObjectPaths>
|
|
421
|
+
<Identity Id="2" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${groupId}" />
|
|
422
|
+
<Identity Id="3" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${ownerId}" />
|
|
423
|
+
</ObjectPaths>
|
|
424
424
|
</Request>`, {
|
|
425
425
|
headers: {
|
|
426
426
|
Accept: rest_types_1.jsonTypes.standard,
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
export const MSALSampleLoginPopupScript = `<p id="msg">please wait...</p>
|
|
2
|
-
<script>
|
|
3
|
-
function finish() {
|
|
4
|
-
try {
|
|
5
|
-
var hash = window.location.hash;
|
|
6
|
-
if (hash[0] === "#") hash = hash.slice(1);//get rid of #
|
|
7
|
-
var hashDictionary = {};
|
|
8
|
-
hash.split("&").forEach(function (keyValue) {
|
|
9
|
-
if (keyValue !== "") {
|
|
10
|
-
var vals = keyValue.split("=");
|
|
11
|
-
hashDictionary[vals[0]] = decodeURIComponent(vals[1]);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
if (Object.keys(hashDictionary).length < 1)
|
|
15
|
-
window.close();//we lose the hash!
|
|
16
|
-
else if (hashDictionary.error && hashDictionary.error_description)
|
|
17
|
-
document.getElementById("msg").innerHTML = hashDictionary.error_description.replace(/\\+/g," ").replace(/\\n/g,"<br /><br />");
|
|
18
|
-
else if (hashDictionary.state) {
|
|
19
|
-
var origin = hashDictionary.state.split("|")[1];
|
|
20
|
-
if (origin) {
|
|
21
|
-
window.location.href = origin.split("#")[0] + window.location.hash;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
} catch (e) { }
|
|
25
|
-
}
|
|
26
|
-
finish();
|
|
1
|
+
export const MSALSampleLoginPopupScript = `<p id="msg">please wait...</p>
|
|
2
|
+
<script>
|
|
3
|
+
function finish() {
|
|
4
|
+
try {
|
|
5
|
+
var hash = window.location.hash;
|
|
6
|
+
if (hash[0] === "#") hash = hash.slice(1);//get rid of #
|
|
7
|
+
var hashDictionary = {};
|
|
8
|
+
hash.split("&").forEach(function (keyValue) {
|
|
9
|
+
if (keyValue !== "") {
|
|
10
|
+
var vals = keyValue.split("=");
|
|
11
|
+
hashDictionary[vals[0]] = decodeURIComponent(vals[1]);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
if (Object.keys(hashDictionary).length < 1)
|
|
15
|
+
window.close();//we lose the hash!
|
|
16
|
+
else if (hashDictionary.error && hashDictionary.error_description)
|
|
17
|
+
document.getElementById("msg").innerHTML = hashDictionary.error_description.replace(/\\+/g," ").replace(/\\n/g,"<br /><br />");
|
|
18
|
+
else if (hashDictionary.state) {
|
|
19
|
+
var origin = hashDictionary.state.split("|")[1];
|
|
20
|
+
if (origin) {
|
|
21
|
+
window.location.href = origin.split("#")[0] + window.location.hash;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} catch (e) { }
|
|
25
|
+
}
|
|
26
|
+
finish();
|
|
27
27
|
</script>`;
|
|
28
28
|
//# sourceMappingURL=msal.types.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getCacheItem, setCacheItem } from "../../exports-index";
|
|
2
|
+
import { isNullOrEmptyString, isNullOrUndefined, isNumber } from "../../helpers/typecheckers";
|
|
2
3
|
import { SPFxAuthTokenType } from "../../types/auth";
|
|
3
|
-
import { GetJson,
|
|
4
|
+
import { GetJson, GetJsonSync } from "../rest";
|
|
4
5
|
import { GetRestBaseUrl } from "../sharepoint.rest/common";
|
|
5
6
|
export function GetTokenAudiencePrefix(appId) {
|
|
6
7
|
return `api://${appId}`;
|
|
@@ -11,48 +12,93 @@ export function GetDefaultScope(appId) {
|
|
|
11
12
|
export function GetMSALSiteScope(hostName) {
|
|
12
13
|
return `https://${hostName}`;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
postCacheKey: `${spfxTokenType}_${_spPageContextInfo.webId}`,
|
|
15
|
+
function _getGetSPFxClientAuthTokenParams(siteUrl, spfxTokenType = SPFxAuthTokenType.Graph) {
|
|
16
|
+
let acquireURL = `${GetRestBaseUrl(siteUrl)}/SP.OAuth.Token/Acquire`;
|
|
17
|
+
//todo: add all the resource end points (ie. OneNote, Yammer, Stream)
|
|
18
|
+
let resource = "";
|
|
19
|
+
let isSPOToken = false;
|
|
20
|
+
switch (spfxTokenType) {
|
|
21
|
+
case SPFxAuthTokenType.Outlook:
|
|
22
|
+
resource = "https://outlook.office365.com/search";
|
|
23
|
+
break;
|
|
24
|
+
case SPFxAuthTokenType.SharePoint:
|
|
25
|
+
case SPFxAuthTokenType.MySite:
|
|
26
|
+
isSPOToken = true;
|
|
27
|
+
resource = new URL(acquireURL).origin;
|
|
28
|
+
if (spfxTokenType === SPFxAuthTokenType.MySite) {
|
|
29
|
+
let split = resource.split(".");
|
|
30
|
+
split[0] += "-my";
|
|
31
|
+
resource = split.join(".");
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
resource = "https://graph.microsoft.com";
|
|
36
|
+
}
|
|
37
|
+
let data = {
|
|
38
|
+
resource: resource,
|
|
39
|
+
tokenType: isSPOToken ? "SPO" : undefined
|
|
40
|
+
};
|
|
41
|
+
let params = {
|
|
42
|
+
url: acquireURL,
|
|
43
|
+
body: JSON.stringify(data),
|
|
44
|
+
options: {
|
|
45
|
+
allowCache: false,
|
|
46
|
+
// ...shortLocalCache,
|
|
47
|
+
// postCacheKey: `${spfxTokenType}_${_spPageContextInfo.webId}`,
|
|
48
48
|
includeDigestInPost: true,
|
|
49
49
|
headers: {
|
|
50
50
|
"Accept": "application/json;odata.metadata=minimal",
|
|
51
51
|
"content-type": "application/json; charset=UTF-8",
|
|
52
52
|
"odata-version": "4.0",
|
|
53
53
|
}
|
|
54
|
-
}
|
|
55
|
-
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return params;
|
|
57
|
+
}
|
|
58
|
+
function _parseAndCacheGetSPFxClientAuthTokenResult(result, spfxTokenType = SPFxAuthTokenType.Graph) {
|
|
59
|
+
if (!isNullOrUndefined(result) && !isNullOrEmptyString(result.access_token)) {
|
|
60
|
+
let expiration = isNumber(result.expires_on) ?
|
|
61
|
+
new Date(result.expires_on * 1000) :
|
|
62
|
+
{
|
|
63
|
+
minutes: 15
|
|
64
|
+
};
|
|
65
|
+
setCacheItem(`access_token_${spfxTokenType}_${_spPageContextInfo.webId}`, result.access_token, expiration);
|
|
66
|
+
return result.access_token;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
function _getSPFxClientAuthTokenFromCache(spfxTokenType = SPFxAuthTokenType.Graph) {
|
|
71
|
+
let cachedToken = getCacheItem(`access_token_${spfxTokenType}_${_spPageContextInfo.webId}`);
|
|
72
|
+
if (!isNullOrEmptyString(cachedToken)) {
|
|
73
|
+
return cachedToken;
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
/** Acquire an authorization token for a Outlook, Graph, or SharePoint the same way SPFx clients do */
|
|
78
|
+
export async function GetSPFxClientAuthToken(siteUrl, spfxTokenType = SPFxAuthTokenType.Graph) {
|
|
79
|
+
try {
|
|
80
|
+
let cachedToken = _getSPFxClientAuthTokenFromCache(spfxTokenType);
|
|
81
|
+
if (!isNullOrEmptyString(cachedToken)) {
|
|
82
|
+
return cachedToken;
|
|
83
|
+
}
|
|
84
|
+
let { url, body, options } = _getGetSPFxClientAuthTokenParams(siteUrl, spfxTokenType);
|
|
85
|
+
let result = await GetJson(url, body, options);
|
|
86
|
+
return _parseAndCacheGetSPFxClientAuthTokenResult(result, spfxTokenType);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
/** Acquire an authorization token for a Outlook, Graph, or SharePoint the same way SPFx clients do */
|
|
93
|
+
export function GetSPFxClientAuthTokenSync(siteUrl, spfxTokenType = SPFxAuthTokenType.Graph) {
|
|
94
|
+
try {
|
|
95
|
+
let cachedToken = _getSPFxClientAuthTokenFromCache(spfxTokenType);
|
|
96
|
+
if (!isNullOrEmptyString(cachedToken)) {
|
|
97
|
+
return cachedToken;
|
|
98
|
+
}
|
|
99
|
+
let { url, body, options } = _getGetSPFxClientAuthTokenParams(siteUrl, spfxTokenType);
|
|
100
|
+
let response = GetJsonSync(url, body, options);
|
|
101
|
+
return _parseAndCacheGetSPFxClientAuthTokenResult(response.result, spfxTokenType);
|
|
56
102
|
}
|
|
57
103
|
catch {
|
|
58
104
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/utils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