@kwiz/common 1.0.78 → 1.0.80
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 -0
- package/.madgerc +2 -2
- package/LICENSE +21 -21
- package/fix-folder-imports.js +26 -26
- package/lib/cjs/helpers/sharepoint.js +5 -1
- package/lib/cjs/helpers/sharepoint.js.map +1 -1
- package/lib/cjs/helpers/typecheckers.js +5 -1
- package/lib/cjs/helpers/typecheckers.js.map +1 -1
- package/lib/cjs/types/libs/msal.types.js +26 -26
- package/lib/cjs/utils/sharepoint.rest/list.js +1 -1
- package/lib/cjs/utils/sharepoint.rest/list.js.map +1 -1
- package/lib/cjs/utils/sharepoint.rest/user.js +11 -11
- package/lib/esm/helpers/sharepoint.js +3 -0
- package/lib/esm/helpers/sharepoint.js.map +1 -1
- package/lib/esm/helpers/typecheckers.js +3 -0
- package/lib/esm/helpers/typecheckers.js.map +1 -1
- package/lib/esm/types/libs/msal.types.js +26 -26
- package/lib/esm/utils/sharepoint.rest/list.js +2 -2
- package/lib/esm/utils/sharepoint.rest/list.js.map +1 -1
- package/lib/esm/utils/sharepoint.rest/user.js +11 -11
- package/lib/types/helpers/sharepoint.d.ts +1 -0
- package/lib/types/helpers/typecheckers.d.ts +1 -0
- package/package.json +77 -77
- 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 +1348 -1348
- 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/emails.ts +6 -6
- package/src/helpers/eval.ts +5 -5
- package/src/helpers/file.test.js +50 -50
- package/src/helpers/file.ts +58 -58
- 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 +38 -38
- package/src/helpers/md5.ts +189 -189
- package/src/helpers/objects.test.js +33 -33
- package/src/helpers/objects.ts +270 -270
- 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 +776 -772
- package/src/helpers/strings.test.js +101 -101
- package/src/helpers/strings.ts +317 -317
- package/src/helpers/typecheckers.test.js +34 -34
- package/src/helpers/typecheckers.ts +266 -262
- 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 +54 -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 +49 -49
- package/src/types/locales.ts +124 -124
- 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 +1465 -1465
- package/src/types/sharepoint.utils.types.ts +287 -287
- package/src/utils/auth/common.ts +74 -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 +320 -320
- package/src/utils/date.ts +35 -35
- package/src/utils/emails.ts +24 -24
- package/src/utils/knownscript.ts +286 -286
- package/src/utils/localstoragecache.ts +441 -441
- package/src/utils/rest.ts +501 -501
- package/src/utils/script.ts +170 -170
- package/src/utils/sharepoint.rest/common.ts +154 -154
- package/src/utils/sharepoint.rest/date.ts +62 -62
- package/src/utils/sharepoint.rest/file.folder.ts +598 -598
- package/src/utils/sharepoint.rest/item.ts +547 -547
- package/src/utils/sharepoint.rest/list.ts +1388 -1388
- 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 +491 -491
- package/src/utils/sharepoint.rest/web.ts +1384 -1384
- package/src/utils/sod.ts +194 -194
- package/lib/cjs/helpers/_dependencies.js +0 -21
- package/lib/cjs/helpers/_dependencies.js.map +0 -1
- package/lib/cjs/utils/_dependencies.js +0 -24
- package/lib/cjs/utils/_dependencies.js.map +0 -1
- package/lib/esm/helpers/_dependencies.js +0 -3
- package/lib/esm/helpers/_dependencies.js.map +0 -1
- package/lib/esm/utils/_dependencies.js +0 -4
- package/lib/esm/utils/_dependencies.js.map +0 -1
- package/lib/types/helpers/_dependencies.d.ts +0 -2
- package/lib/types/utils/_dependencies.d.ts +0 -3
package/src/helpers/urlhelper.ts
CHANGED
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
export class URLHelper {
|
|
2
|
-
private queryStringParams: { [key: string]: string; };
|
|
3
|
-
private hashParams: { [key: string]: string; };
|
|
4
|
-
private path: string;
|
|
5
|
-
|
|
6
|
-
public constructor(url: string) {
|
|
7
|
-
let parts = url.split("#");
|
|
8
|
-
let pathAndQueryString = parts[0];
|
|
9
|
-
let hash = parts[1];
|
|
10
|
-
let parts2 = pathAndQueryString.split("?");
|
|
11
|
-
let path = parts2[0];
|
|
12
|
-
let queryString = parts2[1];
|
|
13
|
-
|
|
14
|
-
this.path = path;
|
|
15
|
-
this.queryStringParams = this._parseParams(queryString);
|
|
16
|
-
this.hashParams = this._parseParams(hash);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public getQueryStringParam(keyName: string, bNoDecode?: boolean, bCaseInsensitive?: boolean) {
|
|
20
|
-
return this._getParam(this.queryStringParams, keyName, bNoDecode, bCaseInsensitive);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public setQueryStringParam(keyName: string, keyValue: string, bEncode: boolean) {
|
|
24
|
-
this.queryStringParams[keyName] = bEncode ? encodeURIComponent(keyValue) : keyValue;
|
|
25
|
-
return this.getUrl();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
public removeQueryStringParam(keyName: string, bCaseInsensitive?: boolean) {
|
|
29
|
-
this._removeParam(this.queryStringParams, keyName, bCaseInsensitive);
|
|
30
|
-
return this.getUrl();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public getHashParam(keyName: string, bNoDecode?: boolean, bCaseInsensitive?: boolean) {
|
|
34
|
-
return this._getParam(this.hashParams, keyName, bNoDecode, bCaseInsensitive);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public setHashParam(keyName: string, keyValue: string, bEncode: boolean) {
|
|
38
|
-
this.hashParams[keyName] = bEncode ? encodeURIComponent(keyValue) : keyValue;
|
|
39
|
-
return this.getUrl();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
public removeHashParam(keyName: string) {
|
|
43
|
-
this._removeParam(this.hashParams, keyName);
|
|
44
|
-
return this.getUrl();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
private _parseParams(paramsAsString: string) {
|
|
48
|
-
var paramsDict: { [key: string]: string; } = {};
|
|
49
|
-
try {
|
|
50
|
-
(typeof (paramsAsString) === "string" && paramsAsString.length ? paramsAsString.split("&") : []).forEach((s) => {
|
|
51
|
-
let q = s.split("=");
|
|
52
|
-
let paramKey = decodeURIComponent(q[0]);
|
|
53
|
-
let paramValue = q[1];
|
|
54
|
-
if (typeof (paramKey) === "string" && paramKey.length) {
|
|
55
|
-
paramsDict[paramKey] = typeof (paramValue) === "string" && paramValue.length ? paramValue : null;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
} catch (ex) {
|
|
59
|
-
}
|
|
60
|
-
return paramsDict;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
private _removeParam(obj: { [key: string]: string; }, keyName: string, bCaseInsensitive?: boolean) {
|
|
64
|
-
if (!obj) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
Object.keys(obj).filter((key) => {
|
|
68
|
-
if (bCaseInsensitive === true) {
|
|
69
|
-
return key.toLowerCase() === keyName.toLowerCase();
|
|
70
|
-
}
|
|
71
|
-
return key === keyName;
|
|
72
|
-
}).forEach((key) => {
|
|
73
|
-
try {
|
|
74
|
-
delete obj[key];
|
|
75
|
-
} catch {
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
private _getParam(obj: { [key: string]: string; }, keyName: string, bNoDecode?: boolean, bCaseInsensitive?: boolean) {
|
|
81
|
-
let value: string = null;
|
|
82
|
-
if (bCaseInsensitive) {
|
|
83
|
-
let matchedKey = Object.keys(obj).filter((key) => {
|
|
84
|
-
return key.toLowerCase() === keyName.toLowerCase();
|
|
85
|
-
})[0];
|
|
86
|
-
|
|
87
|
-
if (matchedKey) {
|
|
88
|
-
value = obj[matchedKey];
|
|
89
|
-
}
|
|
90
|
-
} else {
|
|
91
|
-
value = obj[keyName];
|
|
92
|
-
}
|
|
93
|
-
return typeof (value) === "string" ? (bNoDecode ? value : decodeURIComponent(value)) : null;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
public getUrl() {
|
|
97
|
-
let queryString = Object.keys(this.queryStringParams).map((key) => {
|
|
98
|
-
let value = this.queryStringParams[key];
|
|
99
|
-
return `${key}` + (value !== null ? `=${value}` : "");
|
|
100
|
-
});
|
|
101
|
-
let hash = Object.keys(this.hashParams).map((key) => {
|
|
102
|
-
var value = this.hashParams[key];
|
|
103
|
-
return `${key}` + (value !== null ? `=${value}` : "");
|
|
104
|
-
});
|
|
105
|
-
let newUrl = [
|
|
106
|
-
typeof (this.path) === "string" && this.path.length ? this.path : "",
|
|
107
|
-
queryString && queryString.length ? `?${queryString.join("&")}` : "",
|
|
108
|
-
hash && hash.length ? `#${hash.join("&")}` : ""
|
|
109
|
-
];
|
|
110
|
-
return newUrl.join("");
|
|
111
|
-
}
|
|
1
|
+
export class URLHelper {
|
|
2
|
+
private queryStringParams: { [key: string]: string; };
|
|
3
|
+
private hashParams: { [key: string]: string; };
|
|
4
|
+
private path: string;
|
|
5
|
+
|
|
6
|
+
public constructor(url: string) {
|
|
7
|
+
let parts = url.split("#");
|
|
8
|
+
let pathAndQueryString = parts[0];
|
|
9
|
+
let hash = parts[1];
|
|
10
|
+
let parts2 = pathAndQueryString.split("?");
|
|
11
|
+
let path = parts2[0];
|
|
12
|
+
let queryString = parts2[1];
|
|
13
|
+
|
|
14
|
+
this.path = path;
|
|
15
|
+
this.queryStringParams = this._parseParams(queryString);
|
|
16
|
+
this.hashParams = this._parseParams(hash);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public getQueryStringParam(keyName: string, bNoDecode?: boolean, bCaseInsensitive?: boolean) {
|
|
20
|
+
return this._getParam(this.queryStringParams, keyName, bNoDecode, bCaseInsensitive);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public setQueryStringParam(keyName: string, keyValue: string, bEncode: boolean) {
|
|
24
|
+
this.queryStringParams[keyName] = bEncode ? encodeURIComponent(keyValue) : keyValue;
|
|
25
|
+
return this.getUrl();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public removeQueryStringParam(keyName: string, bCaseInsensitive?: boolean) {
|
|
29
|
+
this._removeParam(this.queryStringParams, keyName, bCaseInsensitive);
|
|
30
|
+
return this.getUrl();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public getHashParam(keyName: string, bNoDecode?: boolean, bCaseInsensitive?: boolean) {
|
|
34
|
+
return this._getParam(this.hashParams, keyName, bNoDecode, bCaseInsensitive);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public setHashParam(keyName: string, keyValue: string, bEncode: boolean) {
|
|
38
|
+
this.hashParams[keyName] = bEncode ? encodeURIComponent(keyValue) : keyValue;
|
|
39
|
+
return this.getUrl();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public removeHashParam(keyName: string) {
|
|
43
|
+
this._removeParam(this.hashParams, keyName);
|
|
44
|
+
return this.getUrl();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private _parseParams(paramsAsString: string) {
|
|
48
|
+
var paramsDict: { [key: string]: string; } = {};
|
|
49
|
+
try {
|
|
50
|
+
(typeof (paramsAsString) === "string" && paramsAsString.length ? paramsAsString.split("&") : []).forEach((s) => {
|
|
51
|
+
let q = s.split("=");
|
|
52
|
+
let paramKey = decodeURIComponent(q[0]);
|
|
53
|
+
let paramValue = q[1];
|
|
54
|
+
if (typeof (paramKey) === "string" && paramKey.length) {
|
|
55
|
+
paramsDict[paramKey] = typeof (paramValue) === "string" && paramValue.length ? paramValue : null;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
} catch (ex) {
|
|
59
|
+
}
|
|
60
|
+
return paramsDict;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private _removeParam(obj: { [key: string]: string; }, keyName: string, bCaseInsensitive?: boolean) {
|
|
64
|
+
if (!obj) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
Object.keys(obj).filter((key) => {
|
|
68
|
+
if (bCaseInsensitive === true) {
|
|
69
|
+
return key.toLowerCase() === keyName.toLowerCase();
|
|
70
|
+
}
|
|
71
|
+
return key === keyName;
|
|
72
|
+
}).forEach((key) => {
|
|
73
|
+
try {
|
|
74
|
+
delete obj[key];
|
|
75
|
+
} catch {
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private _getParam(obj: { [key: string]: string; }, keyName: string, bNoDecode?: boolean, bCaseInsensitive?: boolean) {
|
|
81
|
+
let value: string = null;
|
|
82
|
+
if (bCaseInsensitive) {
|
|
83
|
+
let matchedKey = Object.keys(obj).filter((key) => {
|
|
84
|
+
return key.toLowerCase() === keyName.toLowerCase();
|
|
85
|
+
})[0];
|
|
86
|
+
|
|
87
|
+
if (matchedKey) {
|
|
88
|
+
value = obj[matchedKey];
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
value = obj[keyName];
|
|
92
|
+
}
|
|
93
|
+
return typeof (value) === "string" ? (bNoDecode ? value : decodeURIComponent(value)) : null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public getUrl() {
|
|
97
|
+
let queryString = Object.keys(this.queryStringParams).map((key) => {
|
|
98
|
+
let value = this.queryStringParams[key];
|
|
99
|
+
return `${key}` + (value !== null ? `=${value}` : "");
|
|
100
|
+
});
|
|
101
|
+
let hash = Object.keys(this.hashParams).map((key) => {
|
|
102
|
+
var value = this.hashParams[key];
|
|
103
|
+
return `${key}` + (value !== null ? `=${value}` : "");
|
|
104
|
+
});
|
|
105
|
+
let newUrl = [
|
|
106
|
+
typeof (this.path) === "string" && this.path.length ? this.path : "",
|
|
107
|
+
queryString && queryString.length ? `?${queryString.join("&")}` : "",
|
|
108
|
+
hash && hash.length ? `#${hash.join("&")}` : ""
|
|
109
|
+
];
|
|
110
|
+
return newUrl.join("");
|
|
111
|
+
}
|
|
112
112
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { default as _script } from "./utils/script";
|
|
2
|
-
import { default as _sod } from "./utils/sod";
|
|
3
|
-
export * from './exports-index';
|
|
4
|
-
export const script = _script;
|
|
5
|
-
export const Sod = _sod;
|
|
6
|
-
|
|
1
|
+
import { default as _script } from "./utils/script";
|
|
2
|
+
import { default as _sod } from "./utils/sod";
|
|
3
|
+
export * from './exports-index';
|
|
4
|
+
export const script = _script;
|
|
5
|
+
export const Sod = _sod;
|
|
6
|
+
|
package/src/types/auth.ts
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
export interface ITenantInfo {
|
|
2
|
-
environment: AzureEnvironment;
|
|
3
|
-
idOrName: string;
|
|
4
|
-
authorityUrl: string;
|
|
5
|
-
valid: boolean;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line no-shadow
|
|
9
|
-
export enum AzureEnvironment {
|
|
10
|
-
Production = 0,
|
|
11
|
-
PPE = 1,
|
|
12
|
-
China = 2,
|
|
13
|
-
Germany = 3,
|
|
14
|
-
USGovernment = 4
|
|
15
|
-
}
|
|
16
|
-
/** AuthenticationModes enum values for projects that can't use enums (when isolatedModules is true)
|
|
17
|
-
* @deprecated use AzureEnvironment
|
|
18
|
-
*/
|
|
19
|
-
export const $AzureEnvironment = {
|
|
20
|
-
Production: 0,
|
|
21
|
-
PPE: 1,
|
|
22
|
-
China: 2,
|
|
23
|
-
Germany: 3,
|
|
24
|
-
USGovernment: 4,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// eslint-disable-next-line no-shadow
|
|
28
|
-
export enum AuthenticationModes {
|
|
29
|
-
Certificate = "certificate",
|
|
30
|
-
clientSecret = "secret"
|
|
31
|
-
}
|
|
32
|
-
/** AuthenticationModes enum values for projects that can't use enums (when isolatedModules is true) */
|
|
33
|
-
export const $AuthenticationModes = {
|
|
34
|
-
Certificate: AuthenticationModes.Certificate,
|
|
35
|
-
clientSecret: AuthenticationModes.clientSecret,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export type AuthContextType = {
|
|
40
|
-
authenticationMode: AuthenticationModes.Certificate,
|
|
41
|
-
clientId: string,
|
|
42
|
-
privateKey: string,
|
|
43
|
-
thumbprint: string
|
|
44
|
-
} | {
|
|
45
|
-
authenticationMode: AuthenticationModes.clientSecret,
|
|
46
|
-
clientId: string,
|
|
47
|
-
clientSecret: string
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export enum SPFxAuthTokenType {
|
|
51
|
-
Outlook,
|
|
52
|
-
SharePoint,
|
|
53
|
-
Graph,
|
|
54
|
-
MySite
|
|
1
|
+
export interface ITenantInfo {
|
|
2
|
+
environment: AzureEnvironment;
|
|
3
|
+
idOrName: string;
|
|
4
|
+
authorityUrl: string;
|
|
5
|
+
valid: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line no-shadow
|
|
9
|
+
export enum AzureEnvironment {
|
|
10
|
+
Production = 0,
|
|
11
|
+
PPE = 1,
|
|
12
|
+
China = 2,
|
|
13
|
+
Germany = 3,
|
|
14
|
+
USGovernment = 4
|
|
15
|
+
}
|
|
16
|
+
/** AuthenticationModes enum values for projects that can't use enums (when isolatedModules is true)
|
|
17
|
+
* @deprecated use AzureEnvironment
|
|
18
|
+
*/
|
|
19
|
+
export const $AzureEnvironment = {
|
|
20
|
+
Production: 0,
|
|
21
|
+
PPE: 1,
|
|
22
|
+
China: 2,
|
|
23
|
+
Germany: 3,
|
|
24
|
+
USGovernment: 4,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// eslint-disable-next-line no-shadow
|
|
28
|
+
export enum AuthenticationModes {
|
|
29
|
+
Certificate = "certificate",
|
|
30
|
+
clientSecret = "secret"
|
|
31
|
+
}
|
|
32
|
+
/** AuthenticationModes enum values for projects that can't use enums (when isolatedModules is true) */
|
|
33
|
+
export const $AuthenticationModes = {
|
|
34
|
+
Certificate: AuthenticationModes.Certificate,
|
|
35
|
+
clientSecret: AuthenticationModes.clientSecret,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export type AuthContextType = {
|
|
40
|
+
authenticationMode: AuthenticationModes.Certificate,
|
|
41
|
+
clientId: string,
|
|
42
|
+
privateKey: string,
|
|
43
|
+
thumbprint: string
|
|
44
|
+
} | {
|
|
45
|
+
authenticationMode: AuthenticationModes.clientSecret,
|
|
46
|
+
clientId: string,
|
|
47
|
+
clientSecret: string
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export enum SPFxAuthTokenType {
|
|
51
|
+
Outlook,
|
|
52
|
+
SharePoint,
|
|
53
|
+
Graph,
|
|
54
|
+
MySite
|
|
55
55
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
//Drop common, non product specific, types
|
|
2
|
-
|
|
3
|
-
export interface IDictionary<valueType> { [key: string]: valueType; }
|
|
4
|
-
|
|
5
|
-
export type IdTextPair = { id: string; text: string; };
|
|
6
|
-
export type KeyValuePair<T> = { key: string; value: T; };
|
|
7
|
-
|
|
8
|
-
/** display info for enums or custom types for modern UI dropdowns */
|
|
9
|
-
export interface ITypesDisplayInfo<ValueType> {
|
|
10
|
-
value: ValueType;
|
|
11
|
-
title: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
fabricIconName?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
1
|
+
//Drop common, non product specific, types
|
|
2
|
+
|
|
3
|
+
export interface IDictionary<valueType> { [key: string]: valueType; }
|
|
4
|
+
|
|
5
|
+
export type IdTextPair = { id: string; text: string; };
|
|
6
|
+
export type KeyValuePair<T> = { key: string; value: T; };
|
|
7
|
+
|
|
8
|
+
/** display info for enums or custom types for modern UI dropdowns */
|
|
9
|
+
export interface ITypesDisplayInfo<ValueType> {
|
|
10
|
+
value: ValueType;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
fabricIconName?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
16
|
export type DateOrNull = Date | null;
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
/*! (c) 2020 Andrea Giammarchi */
|
|
2
|
-
/**
|
|
3
|
-
* Fast and minimal circular JSON parser.
|
|
4
|
-
* logic example
|
|
5
|
-
```js
|
|
6
|
-
var a = [{one: 1}, {two: '2'}];
|
|
7
|
-
a[0].a = a;
|
|
8
|
-
// a is the main object, will be at index '0'
|
|
9
|
-
// {one: 1} is the second object, index '1'
|
|
10
|
-
// {two: '2'} the third, in '2', and it has a string
|
|
11
|
-
// which will be found at index '3'
|
|
12
|
-
Flatted.stringify(a);
|
|
13
|
-
// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"]
|
|
14
|
-
// a[one,two] {one: 1, a} {two: '2'} '2'
|
|
15
|
-
```
|
|
16
|
-
*/
|
|
17
|
-
export interface IFlatted {
|
|
18
|
-
/**
|
|
19
|
-
* Converts a JavaScript Object Notation (using Flatted encoding) string into an object.
|
|
20
|
-
* @param text A valid Flatted string.
|
|
21
|
-
* @param reviver A function that transforms the results. This function is called for each member of the object.
|
|
22
|
-
* If a member contains nested objects, the nested objects are transformed before the parent object is.
|
|
23
|
-
*/
|
|
24
|
-
parse(
|
|
25
|
-
text: string,
|
|
26
|
-
reviver?: (this: any, key: string, value: any) => any
|
|
27
|
-
): any;
|
|
28
|
-
/**
|
|
29
|
-
* Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
|
|
30
|
-
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
31
|
-
* @param replacer A function that transforms the results.
|
|
32
|
-
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
33
|
-
*/
|
|
34
|
-
stringify(
|
|
35
|
-
value: any,
|
|
36
|
-
replacer?: (this: any, key: string, value: any) => any,
|
|
37
|
-
space?: string | number
|
|
38
|
-
): string;
|
|
39
|
-
/**
|
|
40
|
-
* Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
|
|
41
|
-
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
42
|
-
* @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
|
|
43
|
-
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
44
|
-
*/
|
|
45
|
-
stringify(
|
|
46
|
-
value: any,
|
|
47
|
-
replacer?: (number | string)[] | null,
|
|
48
|
-
space?: string | number
|
|
49
|
-
): string;
|
|
50
|
-
/**
|
|
51
|
-
* Helper to allow explicit conversions with classes.
|
|
52
|
-
* @param value The JSON to convert to JavaScript value
|
|
53
|
-
*/
|
|
54
|
-
fromJSON(value: any): any;
|
|
55
|
-
/**
|
|
56
|
-
* Helper to allow explicit conversions with classes.
|
|
57
|
-
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
58
|
-
*/
|
|
59
|
-
toJSON(value: any): any;
|
|
1
|
+
/*! (c) 2020 Andrea Giammarchi */
|
|
2
|
+
/**
|
|
3
|
+
* Fast and minimal circular JSON parser.
|
|
4
|
+
* logic example
|
|
5
|
+
```js
|
|
6
|
+
var a = [{one: 1}, {two: '2'}];
|
|
7
|
+
a[0].a = a;
|
|
8
|
+
// a is the main object, will be at index '0'
|
|
9
|
+
// {one: 1} is the second object, index '1'
|
|
10
|
+
// {two: '2'} the third, in '2', and it has a string
|
|
11
|
+
// which will be found at index '3'
|
|
12
|
+
Flatted.stringify(a);
|
|
13
|
+
// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"]
|
|
14
|
+
// a[one,two] {one: 1, a} {two: '2'} '2'
|
|
15
|
+
```
|
|
16
|
+
*/
|
|
17
|
+
export interface IFlatted {
|
|
18
|
+
/**
|
|
19
|
+
* Converts a JavaScript Object Notation (using Flatted encoding) string into an object.
|
|
20
|
+
* @param text A valid Flatted string.
|
|
21
|
+
* @param reviver A function that transforms the results. This function is called for each member of the object.
|
|
22
|
+
* If a member contains nested objects, the nested objects are transformed before the parent object is.
|
|
23
|
+
*/
|
|
24
|
+
parse(
|
|
25
|
+
text: string,
|
|
26
|
+
reviver?: (this: any, key: string, value: any) => any
|
|
27
|
+
): any;
|
|
28
|
+
/**
|
|
29
|
+
* Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
|
|
30
|
+
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
31
|
+
* @param replacer A function that transforms the results.
|
|
32
|
+
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
33
|
+
*/
|
|
34
|
+
stringify(
|
|
35
|
+
value: any,
|
|
36
|
+
replacer?: (this: any, key: string, value: any) => any,
|
|
37
|
+
space?: string | number
|
|
38
|
+
): string;
|
|
39
|
+
/**
|
|
40
|
+
* Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
|
|
41
|
+
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
42
|
+
* @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
|
|
43
|
+
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
44
|
+
*/
|
|
45
|
+
stringify(
|
|
46
|
+
value: any,
|
|
47
|
+
replacer?: (number | string)[] | null,
|
|
48
|
+
space?: string | number
|
|
49
|
+
): string;
|
|
50
|
+
/**
|
|
51
|
+
* Helper to allow explicit conversions with classes.
|
|
52
|
+
* @param value The JSON to convert to JavaScript value
|
|
53
|
+
*/
|
|
54
|
+
fromJSON(value: any): any;
|
|
55
|
+
/**
|
|
56
|
+
* Helper to allow explicit conversions with classes.
|
|
57
|
+
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
58
|
+
*/
|
|
59
|
+
toJSON(value: any): any;
|
|
60
60
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IDictionary } from "./common.types";
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
interface IKWizComGlobals {
|
|
5
|
-
globals?: IDictionary<any>;
|
|
6
|
-
}
|
|
1
|
+
import { IDictionary } from "./common.types";
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface IKWizComGlobals {
|
|
5
|
+
globals?: IDictionary<any>;
|
|
6
|
+
}
|
|
7
7
|
}
|