@mikezimm/fps-core-v7 1.0.35 → 1.0.36
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/lib/banner/components/SingleHelpPage/interfaces/ITrickRow.d.ts.map +1 -1
- package/lib/banner/components/SingleHelpPage/interfaces/ITrickRow.js +1 -0
- package/lib/banner/components/SingleHelpPage/interfaces/ITrickRow.js.map +1 -1
- package/lib/components/atoms/easy-icons/SystemIcons/DefaultEasyIcons.d.ts.map +1 -1
- package/lib/components/atoms/easy-icons/SystemIcons/DefaultEasyIcons.js.map +1 -1
- package/lib/components/atoms/easy-icons/interfaces/eiTypes.d.ts.map +1 -1
- package/lib/components/atoms/easy-icons/interfaces/eiTypes.js +3 -4
- package/lib/components/atoms/easy-icons/interfaces/eiTypes.js.map +1 -1
- package/lib/components/molecules/AnyContent/IAnyListLib.d.ts +8 -3
- package/lib/components/molecules/AnyContent/IAnyListLib.d.ts.map +1 -1
- package/lib/components/molecules/AnyContent/IAnyListLib.js +4 -16
- package/lib/components/molecules/AnyContent/IAnyListLib.js.map +1 -1
- package/lib/components/molecules/SearchPage/functions/addListIsAMeta.d.ts +13 -0
- package/lib/components/molecules/SearchPage/functions/addListIsAMeta.d.ts.map +1 -1
- package/lib/components/molecules/SearchPage/functions/addListIsAMeta.js +13 -0
- package/lib/components/molecules/SearchPage/functions/addListIsAMeta.js.map +1 -1
- package/lib/components/molecules/SearchPage/functions/addSearchMeta1.d.ts.map +1 -1
- package/lib/components/molecules/SearchPage/functions/addSearchMeta1.js +3 -1
- package/lib/components/molecules/SearchPage/functions/addSearchMeta1.js.map +1 -1
- package/lib/components/molecules/SpHttp/digestValues/fromUrl/getFormDigestValueNoContext.js +1 -1
- package/lib/components/molecules/SpHttp/digestValues/fromUrl/getFormDigestValueNoContext.js.map +1 -1
- package/lib/components/molecules/SpHttp/digestValues/fromUrl/getThisFPSDigestValueFromUrl.js +1 -1
- package/lib/components/molecules/SpHttp/digestValues/fromUrl/getThisFPSDigestValueFromUrl.js.map +1 -1
- package/lib/components/molecules/SpHttp/digestValues/fromUrl/setMultiFPSFormDigests.js +1 -1
- package/lib/components/molecules/SpHttp/digestValues/fromUrl/setMultiFPSFormDigests.js.map +1 -1
- package/lib/components/molecules/process-results/createEmptyFpsUsersReturn.d.ts +4 -0
- package/lib/components/molecules/process-results/createEmptyFpsUsersReturn.d.ts.map +1 -0
- package/lib/components/molecules/process-results/createEmptyFpsUsersReturn.js +15 -0
- package/lib/components/molecules/process-results/createEmptyFpsUsersReturn.js.map +1 -0
- package/lib/logic/Math/convertFileSizeStringToNum.d.ts.map +1 -1
- package/lib/logic/Math/convertFileSizeStringToNum.js +3 -0
- package/lib/logic/Math/convertFileSizeStringToNum.js.map +1 -1
- package/lib/logic/Math/labels.d.ts +8 -0
- package/lib/logic/Math/labels.d.ts.map +1 -1
- package/lib/logic/Math/labels.js +12 -0
- package/lib/logic/Math/labels.js.map +1 -1
- package/lib/logic/Strings/getAbssoluteWebUrlFromSourceProps.d.ts +10 -0
- package/lib/logic/Strings/getAbssoluteWebUrlFromSourceProps.d.ts.map +1 -0
- package/lib/logic/Strings/getAbssoluteWebUrlFromSourceProps.js +18 -0
- package/lib/logic/Strings/getAbssoluteWebUrlFromSourceProps.js.map +1 -0
- package/lib/restAPIs/lists/files/postSourceFilesAPI.d.ts.map +1 -1
- package/lib/restAPIs/lists/files/postSourceFilesAPI.js +12 -8
- package/lib/restAPIs/lists/files/postSourceFilesAPI.js.map +1 -1
- package/lib/restAPIs/lists/items/getSourceItemsAPI.d.ts.map +1 -1
- package/lib/restAPIs/lists/items/getSourceItemsAPI.js +14 -9
- package/lib/restAPIs/lists/items/getSourceItemsAPI.js.map +1 -1
- package/lib/restAPIs/lists/items/postSourceItemsAPI.d.ts.map +1 -1
- package/lib/restAPIs/lists/items/postSourceItemsAPI.js +10 -6
- package/lib/restAPIs/lists/items/postSourceItemsAPI.js.map +1 -1
- package/lib/restAPIs/lists/lists/MinListSelects.d.ts +8 -0
- package/lib/restAPIs/lists/lists/MinListSelects.d.ts.map +1 -0
- package/lib/restAPIs/lists/lists/MinListSelects.js +26 -0
- package/lib/restAPIs/lists/lists/MinListSelects.js.map +1 -0
- package/lib/restAPIs/lists/lists/getSourceListsAPI.d.ts.map +1 -1
- package/lib/restAPIs/lists/lists/getSourceListsAPI.js +10 -6
- package/lib/restAPIs/lists/lists/getSourceListsAPI.js.map +1 -1
- package/lib/restAPIs/sites/groups/GroupSelects.d.ts +4 -0
- package/lib/restAPIs/sites/groups/GroupSelects.d.ts.map +1 -0
- package/lib/restAPIs/sites/groups/GroupSelects.js +4 -0
- package/lib/restAPIs/sites/groups/GroupSelects.js.map +1 -0
- package/lib/restAPIs/sites/groups/getGroupMembersAPI.d.ts +4 -5
- package/lib/restAPIs/sites/groups/getGroupMembersAPI.d.ts.map +1 -1
- package/lib/restAPIs/sites/groups/getGroupMembersAPI.js +17 -13
- package/lib/restAPIs/sites/groups/getGroupMembersAPI.js.map +1 -1
- package/lib/restAPIs/sites/groups/getWebAssociatedGroupAPI.d.ts +6 -0
- package/lib/restAPIs/sites/groups/getWebAssociatedGroupAPI.d.ts.map +1 -0
- package/lib/restAPIs/sites/groups/getWebAssociatedGroupAPI.js +65 -0
- package/lib/restAPIs/sites/groups/getWebAssociatedGroupAPI.js.map +1 -0
- package/lib/restAPIs/sites/groups/getWebGroupInfoAPI.d.ts +2 -1
- package/lib/restAPIs/sites/groups/getWebGroupInfoAPI.d.ts.map +1 -1
- package/lib/restAPIs/sites/groups/getWebGroupInfoAPI.js +15 -6
- package/lib/restAPIs/sites/groups/getWebGroupInfoAPI.js.map +1 -1
- package/lib/restAPIs/sites/sites/getSiteAPI.d.ts +8 -0
- package/lib/restAPIs/sites/sites/getSiteAPI.d.ts.map +1 -0
- package/lib/restAPIs/sites/sites/getSiteAPI.js +77 -0
- package/lib/restAPIs/sites/sites/getSiteAPI.js.map +1 -0
- package/lib/restAPIs/sites/users/UserGroupSelects.d.ts +3 -0
- package/lib/restAPIs/sites/users/UserGroupSelects.d.ts.map +1 -0
- package/lib/restAPIs/sites/users/UserGroupSelects.js +3 -0
- package/lib/restAPIs/sites/users/UserGroupSelects.js.map +1 -0
- package/lib/restAPIs/sites/users/getSiteUsersAPI.d.ts +5 -0
- package/lib/restAPIs/sites/users/getSiteUsersAPI.d.ts.map +1 -0
- package/lib/restAPIs/sites/users/getSiteUsersAPI.js +62 -0
- package/lib/restAPIs/sites/users/getSiteUsersAPI.js.map +1 -0
- package/lib/types/fps-returns/sites/IFpsSiteReturn.d.ts +41 -0
- package/lib/types/fps-returns/sites/IFpsSiteReturn.d.ts.map +1 -0
- package/lib/types/fps-returns/sites/IFpsSiteReturn.js +2 -0
- package/lib/types/fps-returns/sites/IFpsSiteReturn.js.map +1 -0
- package/lib/types/fps-returns/sites/ISiteErrorObj.d.ts +3 -0
- package/lib/types/fps-returns/sites/ISiteErrorObj.d.ts.map +1 -1
- package/lib/types/fps-returns/sites/groups/IGroupResults.d.ts +18 -12
- package/lib/types/fps-returns/sites/groups/IGroupResults.d.ts.map +1 -1
- package/lib/types/fps-returns/sites/groups/IGroupResults.js +0 -10
- package/lib/types/fps-returns/sites/groups/IGroupResults.js.map +1 -1
- package/lib/types/fps-returns/sites/groups/IGroupsResults.d.ts +10 -12
- package/lib/types/fps-returns/sites/groups/IGroupsResults.d.ts.map +1 -1
- package/lib/types/fps-returns/sites/groups/IGroupsResults.js +0 -10
- package/lib/types/fps-returns/sites/groups/IGroupsResults.js.map +1 -1
- package/lib/types/fps-returns/sites/users/{ISiteUsersResults.d.ts → IFpsUsersReturn.d.ts} +6 -3
- package/lib/types/fps-returns/sites/users/IFpsUsersReturn.d.ts.map +1 -0
- package/lib/types/fps-returns/sites/users/{ISiteUsersResults.js → IFpsUsersReturn.js} +1 -1
- package/lib/types/fps-returns/sites/users/IFpsUsersReturn.js.map +1 -0
- package/lib/types/fps-returns/sites/users/ISiteUserResults.d.ts +5 -2
- package/lib/types/fps-returns/sites/users/ISiteUserResults.d.ts.map +1 -1
- package/lib/types/fps-returns/sites/webs/IWebErrorObj.d.ts +2 -2
- package/lib/types/fps-returns/sites/webs/IWebErrorObj.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/types/fps-returns/sites/users/ISiteUsersResults.d.ts.map +0 -1
- package/lib/types/fps-returns/sites/users/ISiteUsersResults.js.map +0 -1
package/lib/logic/Math/labels.js
CHANGED
|
@@ -17,10 +17,22 @@
|
|
|
17
17
|
const oneKB = 1024;
|
|
18
18
|
const oneMB = 1024 * oneKB;
|
|
19
19
|
const oneGB = 1024 * oneMB;
|
|
20
|
+
/**
|
|
21
|
+
* NOTE: If you pass a string, it will first parseInt it so BE SURE TO VERIFY you are not passing in
|
|
22
|
+
* something like 1.24MB or it will return as 1.24B
|
|
23
|
+
*
|
|
24
|
+
* @param size
|
|
25
|
+
* @param decimal
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
20
28
|
export function getSizeLabel(size, decimal = 1) {
|
|
21
29
|
if (size === null || size === undefined) {
|
|
22
30
|
return '';
|
|
23
31
|
}
|
|
32
|
+
// 2024-12-04: Found in PivotTiles that the FileSizeDisplay is a string like '12341234'.
|
|
33
|
+
// Not sure if I should just parseInt the string or check for other chars like GB etc first.
|
|
34
|
+
if (typeof size === 'string')
|
|
35
|
+
size = parseInt(size);
|
|
24
36
|
return size > oneGB ? `${(size / oneGB).toFixed(decimal)} GB` : size > oneMB ? `${(size / oneMB).toFixed(decimal)} MB` : size > oneKB ? `${(size / oneKB).toFixed(decimal)} KB` : `${(size).toFixed(decimal)} B`;
|
|
25
37
|
}
|
|
26
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../../../src/logic/Math/labels.ts"],"names":[],"mappings":"AAEC;;;;;;;;;EASE;AAEF;;;;;GAKG;AAEJ,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,MAAM,KAAK,GAAG,IAAI,GAAG,KAAK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,MAAM,UAAU,aAAa,CAAG,KAAa,EAAE,UAAkB,CAAC;IAChE,IAAK,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAG;QAAE,OAAO,EAAE,CAAE;KAAE;IAC5D,qIAAqI;IACrI,qHAAqH;IACrH,OAAO,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAI,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAE,IAAI,CAAC,CAAC;QAC1D,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAI,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAE,IAAI,CAAC,CAAC;YACvD,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,GAAI,CAAE,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAE,IAAI,CAAC,CAAC;gBACxD,GAAI,CAAE,KAAK,CAAE,CAAC,OAAO,CAAE,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAG,EAAE,CAAC;AAChE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAE,IAAY;IAC7C,OAAO,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAE7C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ISourceProps } from "../../components/molecules/source-props/ISourceProps";
|
|
2
|
+
/**
|
|
3
|
+
* To be used for any JS Fetch where you need the full absolute web url for the API
|
|
4
|
+
*
|
|
5
|
+
* @param sourceProps
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAbsoluteWebUrlFromSourceProps(sourceProps: ISourceProps): string;
|
|
9
|
+
export declare function makeAbsoluteUrl(useUrl: string): string;
|
|
10
|
+
//# sourceMappingURL=getAbssoluteWebUrlFromSourceProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAbssoluteWebUrlFromSourceProps.d.ts","sourceRoot":"","sources":["../../../src/logic/Strings/getAbssoluteWebUrlFromSourceProps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AAEpF;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAE,WAAW,EAAE,YAAY,GAAI,MAAM,CAKpF;AAED,wBAAgB,eAAe,CAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGvD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TenantUrlOrigin } from "../../components/molecules/source-props/IMinSourceFetchProps";
|
|
2
|
+
/**
|
|
3
|
+
* To be used for any JS Fetch where you need the full absolute web url for the API
|
|
4
|
+
*
|
|
5
|
+
* @param sourceProps
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export function getAbsoluteWebUrlFromSourceProps(sourceProps) {
|
|
9
|
+
const { absoluteWebUrl, webUrl } = sourceProps;
|
|
10
|
+
let useUrl = absoluteWebUrl ? absoluteWebUrl : webUrl ? webUrl : '';
|
|
11
|
+
return makeAbsoluteUrl(useUrl);
|
|
12
|
+
}
|
|
13
|
+
export function makeAbsoluteUrl(useUrl) {
|
|
14
|
+
if (useUrl && useUrl.indexOf('/sites/') === 0)
|
|
15
|
+
useUrl = `${TenantUrlOrigin}${useUrl}`;
|
|
16
|
+
return useUrl;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=getAbssoluteWebUrlFromSourceProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAbssoluteWebUrlFromSourceProps.js","sourceRoot":"","sources":["../../../src/logic/Strings/getAbssoluteWebUrlFromSourceProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAC;AAG/F;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAAE,WAAyB;IAEzE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAC/C,IAAI,MAAM,GAAW,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5E,OAAO,eAAe,CAAE,MAAM,CAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,eAAe,CAAE,MAAc;IAC7C,IAAK,MAAM,IAAI,MAAM,CAAC,OAAO,CAAE,SAAS,CAAC,KAAK,CAAC;QAAG,MAAM,GAAG,GAAG,eAAe,GAAG,MAAM,EAAE,CAAC;IACzF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postSourceFilesAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/files/postSourceFilesAPI.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;
|
|
1
|
+
{"version":3,"file":"postSourceFilesAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/files/postSourceFilesAPI.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;AASrH;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,GAAK,OAAO,CAAC,eAAe,CAAC,CAiDjN"}
|
|
@@ -14,6 +14,7 @@ import { check4This } from "../../../logic/Links/CheckSearch";
|
|
|
14
14
|
import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
|
|
15
15
|
import { doSpJsFileFetchOrPost } from '../../../components/molecules/SpHttp/doSpJsFileFetch';
|
|
16
16
|
import { getThisFPSDigestValueFromUrl } from '../../../components/molecules/SpHttp/digestValues/fromUrl/getThisFPSDigestValueFromUrl';
|
|
17
|
+
import { getAbsoluteWebUrlFromSourceProps } from '../../../logic/Strings/getAbssoluteWebUrlFromSourceProps';
|
|
17
18
|
/**
|
|
18
19
|
* NOTE: You need a CURRENT digest value in source props or it will fetch one... if this is a batch op, be sure to fetch and include once for performance
|
|
19
20
|
* @param sourceProps
|
|
@@ -27,31 +28,34 @@ import { getThisFPSDigestValueFromUrl } from '../../../components/molecules/SpHt
|
|
|
27
28
|
export async function postSourceFilesAPI(sourceProps, overWrite, blob, fileName, alertMe, consoleLog) {
|
|
28
29
|
const { performanceSettings } = sourceProps;
|
|
29
30
|
const fetchOp = performanceSettings ? startPerformOpV2(performanceSettings) : null;
|
|
30
|
-
const {
|
|
31
|
+
const { listTitle, subFolder } = sourceProps;
|
|
32
|
+
// 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
|
|
33
|
+
const useUrl = getAbsoluteWebUrlFromSourceProps(sourceProps);
|
|
31
34
|
/**
|
|
32
35
|
Make a POST request to the SharePoint REST API to upload the file
|
|
33
36
|
*/
|
|
34
37
|
const folderRelativeUrl = subFolder ? `${listTitle}/${subFolder}` : listTitle;
|
|
35
|
-
const postAPI = `${
|
|
36
|
-
if (!
|
|
38
|
+
const postAPI = `${useUrl}/_api/web/GetFolderByServerRelativeUrl('${folderRelativeUrl}')/Files/add(url='${fileName}', overwrite=${overWrite})`;
|
|
39
|
+
if (!useUrl) {
|
|
37
40
|
// NO WebURL... Throw Alert
|
|
38
41
|
if (alertMe === true)
|
|
39
42
|
alert(`${listTitle} ${SourcePropsNoWebUrl}`);
|
|
40
|
-
return createErrorFpsListReturn(
|
|
43
|
+
return createErrorFpsListReturn(useUrl, listTitle);
|
|
41
44
|
}
|
|
42
45
|
if (!listTitle) {
|
|
43
46
|
// NO WebURL... Throw Alert
|
|
44
47
|
if (alertMe === true)
|
|
45
48
|
alert(`${''} ${SourcePropsNoListTitle}`);
|
|
46
|
-
return createErrorFpsListReturn(
|
|
49
|
+
return createErrorFpsListReturn(useUrl, listTitle);
|
|
47
50
|
}
|
|
48
|
-
const requestDigest = sourceProps.digestValue ? sourceProps.digestValue : await getThisFPSDigestValueFromUrl(
|
|
51
|
+
const requestDigest = sourceProps.digestValue ? sourceProps.digestValue : await getThisFPSDigestValueFromUrl(useUrl);
|
|
49
52
|
const initialResult = await doSpJsFileFetchOrPost(postAPI, 'POST', requestDigest, '', blob);
|
|
50
53
|
const result = checkItemsResults(initialResult, `fps-core-v7: postSourceItems ~ 46`, alertMe, consoleLog);
|
|
51
54
|
result.fpsContentType = !sourceProps.fpsContentType ? ['file', 'item'] : sourceProps.fpsContentType;
|
|
52
|
-
if
|
|
55
|
+
// 2024-12-05: changed if to test result, not sourceProps... was getting error reading indexOf
|
|
56
|
+
if (result.fpsContentType.indexOf('item') < 0)
|
|
53
57
|
result.fpsContentType.push('item');
|
|
54
|
-
if (
|
|
58
|
+
if (result.fpsContentType.indexOf('file') < 0)
|
|
55
59
|
result.fpsContentType.push('file');
|
|
56
60
|
result.unifiedPerformanceOps.save = performanceSettings ?
|
|
57
61
|
updatePerformanceEndV2({ op: fetchOp, updateMiliseconds: performanceSettings.updateMiliseconds, count: 1 })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postSourceFilesAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/lists/files/postSourceFilesAPI.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH,OAAO,EAAgB,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC,CAAC,iBAAiB;AACtJ,OAAO,EAAE,iBAAiB,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;IAC/F,IAAK,MAAM,CAAC,cAAc,CAAC,OAAO,CAAE,MAAM,CAAE,GAAG,CAAC;QAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAE,MAAM,CAAE,CAAC;IACxF,IAAK,MAAM,CAAC,cAAc,CAAC,OAAO,CAAE,MAAM,CAAE,GAAG,CAAC;QAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAE,MAAM,CAAE,CAAC;IAExF,MAAM,CAAC,qBAAqB,CAAC,IAAI,GAAG,mBAAmB,CAAC,CAAC;QACvD,sBAAsB,CAAE,EAAE,EAAE,EAAE,OAAyB,EAAE,iBAAiB,EAAE,mBAAmB,CAAC,iBAAiB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAC9H,CAAC,CAAC,IAAW,CAAC,CAAE,oDAAoD;IAEtE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC;IAEnD,IAAK,UAAU,CAAE,0BAA0B,CAAE,KAAK,IAAI,EAAG;QAAE,OAAO,CAAC,GAAG,CAAE,4CAA4C,EAAE,MAAM,CAAE,CAAA;KAAE;IAEhI,OAAO,MAAM,CAAC;AAEhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSourceItemsAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/items/getSourceItemsAPI.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;
|
|
1
|
+
{"version":3,"file":"getSourceItemsAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/items/getSourceItemsAPI.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;AAQrH;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,GAAK,OAAO,CAAC,eAAe,CAAC,CAqE7J"}
|
|
@@ -7,6 +7,7 @@ import { startPerformOpV2, updatePerformanceEndV2 } from "../../../components/mo
|
|
|
7
7
|
import { check4This } from "../../../logic/Links/CheckSearch";
|
|
8
8
|
import { doSpJsFetchOrPost } from "../../../components/molecules/SpHttp/doSpJsFetch";
|
|
9
9
|
import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
|
|
10
|
+
import { getAbsoluteWebUrlFromSourceProps } from '../../../logic/Strings/getAbssoluteWebUrlFromSourceProps';
|
|
10
11
|
/**
|
|
11
12
|
* getSourceItems calls the Pnp function to get the results which returns the raw error.
|
|
12
13
|
* This function then will convert the error into the helpful error and return the standard IItemsError object.
|
|
@@ -19,19 +20,21 @@ import { createErrorFpsListReturn } from '../../../components/molecules/process-
|
|
|
19
20
|
export async function getSourceItemsAPI(sourceProps, alertMe, consoleLog) {
|
|
20
21
|
const { performanceSettings } = sourceProps;
|
|
21
22
|
const fetchOp = performanceSettings ? startPerformOpV2(performanceSettings) : null;
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const { listTitle, orderBy, orderBy2, fetchCount, restFilter, selectThese, expandThese, skip } = sourceProps;
|
|
24
|
+
// 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
|
|
25
|
+
const useUrl = getAbsoluteWebUrlFromSourceProps(sourceProps);
|
|
26
|
+
let fetchAPI = `${useUrl}/_api/web/lists/getbytitle('${listTitle}')/items?`;
|
|
27
|
+
if (!useUrl) {
|
|
25
28
|
// NO WebURL... Throw Alert
|
|
26
29
|
if (alertMe === true)
|
|
27
30
|
alert(`${listTitle} ${SourcePropsNoWebUrl}`);
|
|
28
|
-
return createErrorFpsListReturn(
|
|
31
|
+
return createErrorFpsListReturn(useUrl, listTitle);
|
|
29
32
|
}
|
|
30
33
|
if (!listTitle) {
|
|
31
34
|
// NO WebURL... Throw Alert
|
|
32
35
|
if (alertMe === true)
|
|
33
36
|
alert(`${''} ${SourcePropsNoListTitle}`);
|
|
34
|
-
return createErrorFpsListReturn(
|
|
37
|
+
return createErrorFpsListReturn(useUrl, listTitle);
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
SAMPLE Full SharePoint Items Rest call:
|
|
@@ -56,7 +59,8 @@ export async function getSourceItemsAPI(sourceProps, alertMe, consoleLog) {
|
|
|
56
59
|
orderBys.push(`${orderBy2.prop} ${orderBy2.order}`);
|
|
57
60
|
if (orderBys.length > 0)
|
|
58
61
|
fetchAPI += `$orderby=${orderBys.join(',')}&`;
|
|
59
|
-
|
|
62
|
+
// 2024-12-05: changed to fetchCount > 0 because it was doing top=null which caused an error
|
|
63
|
+
if (fetchCount > 0)
|
|
60
64
|
fetchAPI += `$top=${fetchCount}&`;
|
|
61
65
|
if (skip)
|
|
62
66
|
fetchAPI += `$skip=${skip}&`;
|
|
@@ -65,16 +69,17 @@ export async function getSourceItemsAPI(sourceProps, alertMe, consoleLog) {
|
|
|
65
69
|
// if ( resultHubSites.ok ) {
|
|
66
70
|
// resultHubSites.items = cleanSearchedWebs( resultHubSites.items );
|
|
67
71
|
// }
|
|
68
|
-
const result = checkItemsResults(initialResult, `fps-core-v7:
|
|
72
|
+
const result = checkItemsResults(initialResult, `fps-core-v7: getSourceItemsAPI ~ 79`, alertMe, consoleLog);
|
|
69
73
|
result.fpsContentType = !sourceProps.fpsContentType ? ['item'] : sourceProps.fpsContentType;
|
|
70
|
-
if
|
|
74
|
+
// 2024-12-05: changed if to test result, not sourceProps... was getting error reading indexOf
|
|
75
|
+
if (result.fpsContentType.indexOf('item') < 0)
|
|
71
76
|
result.fpsContentType.push('item');
|
|
72
77
|
result.unifiedPerformanceOps.fetch = performanceSettings ?
|
|
73
78
|
updatePerformanceEndV2({ op: fetchOp, updateMiliseconds: performanceSettings.updateMiliseconds, count: result.items ? result.items.length : 0 })
|
|
74
79
|
: null; // 2024-09-29: set null as any to pass build error.
|
|
75
80
|
result.fetchOp = result.unifiedPerformanceOps.fetch;
|
|
76
81
|
if (check4This(`fpsShowFetchResults=true`) === true) {
|
|
77
|
-
console.log(`fps-core-v7 COMPLETE: getSourceItemsAPI ~
|
|
82
|
+
console.log(`fps-core-v7 COMPLETE: getSourceItemsAPI ~ 90`, result);
|
|
78
83
|
}
|
|
79
84
|
;
|
|
80
85
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSourceItemsAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/lists/items/getSourceItemsAPI.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,EAAgB,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC,CAAC,iBAAiB;AACtJ,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AAErF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E,CAAC;
|
|
1
|
+
{"version":3,"file":"getSourceItemsAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/lists/items/getSourceItemsAPI.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,EAAgB,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC,CAAC,iBAAiB;AACtJ,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAE,UAAU,EAAE,MAA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;IAC/F,IAAK,MAAM,CAAC,cAAc,CAAC,OAAO,CAAE,MAAM,CAAE,GAAG,CAAC;QAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAE,MAAM,CAAE,CAAC;IAEzF,MAAM,CAAC,qBAAqB,CAAC,KAAK,GAAG,mBAAmB,CAAC,CAAC;QACxD,sBAAsB,CAAE,EAAE,EAAE,EAAE,OAAyB,EAAE,iBAAiB,EAAE,mBAAmB,CAAC,iBAAiB,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACnK,CAAC,CAAC,IAAW,CAAC,CAAE,oDAAoD;IAEtE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC;IAEpD,IAAK,UAAU,CAAE,0BAA0B,CAAE,KAAK,IAAI,EAAG;QAAE,OAAO,CAAC,GAAG,CAAE,8CAA8C,EAAE,MAAM,CAAE,CAAA;KAAE;IAAA,CAAC;IAEnI,OAAO,MAAM,CAAC;AAEhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postSourceItemsAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/items/postSourceItemsAPI.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;
|
|
1
|
+
{"version":3,"file":"postSourceItemsAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/items/postSourceItemsAPI.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;AASrH,wBAAsB,kBAAkB,CAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAG,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,GAAK,OAAO,CAAC,eAAe,CAAC,CAsD9K"}
|
|
@@ -4,27 +4,30 @@ import { startPerformOpV2, updatePerformanceEndV2 } from "../../../components/mo
|
|
|
4
4
|
import { check4This } from "../../../logic/Links/CheckSearch";
|
|
5
5
|
import { doSpJsFetchOrPost } from "../../../components/molecules/SpHttp/doSpJsFetch";
|
|
6
6
|
import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
|
|
7
|
+
import { getAbsoluteWebUrlFromSourceProps } from '../../../logic/Strings/getAbssoluteWebUrlFromSourceProps';
|
|
7
8
|
export async function postSourceItemsAPI(sourceProps, saveItem, alertMe, consoleLog) {
|
|
8
9
|
const { performanceSettings } = sourceProps;
|
|
9
10
|
const fetchOp = performanceSettings ? startPerformOpV2(performanceSettings) : null;
|
|
10
|
-
const {
|
|
11
|
+
const { listTitle, } = sourceProps;
|
|
12
|
+
// 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
|
|
13
|
+
const useUrl = getAbsoluteWebUrlFromSourceProps(sourceProps);
|
|
11
14
|
/**
|
|
12
15
|
SAMPLE Full SharePoint Items Rest call:
|
|
13
16
|
https://example.sharepoint.com/sites/MySite/_api/web/lists/getbytitle('MyList')/items
|
|
14
17
|
|
|
15
18
|
*/
|
|
16
|
-
let postAPI = `${
|
|
17
|
-
if (!
|
|
19
|
+
let postAPI = `${useUrl}/_api/web/lists/getbytitle('${listTitle}')/items`;
|
|
20
|
+
if (!useUrl) {
|
|
18
21
|
// NO WebURL... Throw Alert
|
|
19
22
|
if (alertMe === true)
|
|
20
23
|
alert(`${listTitle} ${SourcePropsNoWebUrl}`);
|
|
21
|
-
return createErrorFpsListReturn(
|
|
24
|
+
return createErrorFpsListReturn(useUrl, listTitle);
|
|
22
25
|
}
|
|
23
26
|
if (!listTitle) {
|
|
24
27
|
// NO WebURL... Throw Alert
|
|
25
28
|
if (alertMe === true)
|
|
26
29
|
alert(`${''} ${SourcePropsNoListTitle}`);
|
|
27
|
-
return createErrorFpsListReturn(
|
|
30
|
+
return createErrorFpsListReturn(useUrl, listTitle);
|
|
28
31
|
}
|
|
29
32
|
const initialResult = await doSpJsFetchOrPost(postAPI, 'POST', sourceProps.digestValue ? sourceProps.digestValue : '', '', saveItem);
|
|
30
33
|
// Add any required custom logic here
|
|
@@ -33,7 +36,8 @@ export async function postSourceItemsAPI(sourceProps, saveItem, alertMe, console
|
|
|
33
36
|
// }
|
|
34
37
|
const result = checkItemsResults(initialResult, `fps-core-v7: postSourceItems ~ 46`, alertMe, consoleLog);
|
|
35
38
|
result.fpsContentType = !sourceProps.fpsContentType ? ['item'] : sourceProps.fpsContentType;
|
|
36
|
-
if
|
|
39
|
+
// 2024-12-05: changed if to test result, not sourceProps... was getting error reading indexOf
|
|
40
|
+
if (result.fpsContentType.indexOf('item') < 0)
|
|
37
41
|
result.fpsContentType.push('item');
|
|
38
42
|
result.unifiedPerformanceOps.save = performanceSettings ?
|
|
39
43
|
updatePerformanceEndV2({ op: fetchOp, updateMiliseconds: performanceSettings.updateMiliseconds, count: 1 })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postSourceItemsAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/lists/items/postSourceItemsAPI.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC,CAAC,iBAAiB;AACtJ,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AAErF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E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AO,MAAM,CAAC;AAEhB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IAnyLibrary, IAnyList } from "../../../components/molecules/AnyContent/IAnyListLib";
|
|
2
|
+
/**
|
|
3
|
+
* NOTES: USE These selects for basic List/Library fetches
|
|
4
|
+
* addListIsAMeta
|
|
5
|
+
*/
|
|
6
|
+
export declare const MinListSelects: Array<keyof IAnyList | keyof IAnyLibrary>;
|
|
7
|
+
export declare const MinIsAListSelects: Array<keyof IAnyList | keyof IAnyLibrary>;
|
|
8
|
+
//# sourceMappingURL=MinListSelects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinListSelects.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/lists/MinListSelects.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAG,MAAM,sDAAsD,CAAC;AAE9F;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAGpE,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAkBvE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// https://github.com/mikezimm/pivottiles7/issues/238
|
|
2
|
+
/**
|
|
3
|
+
* NOTES: USE These selects for basic List/Library fetches
|
|
4
|
+
* addListIsAMeta
|
|
5
|
+
*/
|
|
6
|
+
export const MinListSelects = [
|
|
7
|
+
'Title', 'Description', 'BaseType', 'BaseTemplate', 'ServerRelativeUrl', 'Hidden', 'Id', 'EntityTypeName',
|
|
8
|
+
// 'IsSystemList', I think this is my property
|
|
9
|
+
];
|
|
10
|
+
// https://github.com/mikezimm/pivottiles7/issues/238
|
|
11
|
+
export const MinIsAListSelects = [
|
|
12
|
+
...MinListSelects,
|
|
13
|
+
'ItemCount', 'NoCrawl', 'EnableVersioning', 'MajorVersionLimit', 'EnableFolderCreation',
|
|
14
|
+
'EnableAttachments', 'OnQuickLaunch', 'AllowContentTypes', 'HasUniqueRoleAssignments',
|
|
15
|
+
'LastItemModifiedDate', 'LastItemUserModifiedDate',
|
|
16
|
+
// COPIED FROM export const TypeCheckKeysAnyLibrary: string[] = [
|
|
17
|
+
'EnableMinimalDownload',
|
|
18
|
+
'DraftVersionVisibility',
|
|
19
|
+
'ForceCheckout',
|
|
20
|
+
'EnableMinorVersions',
|
|
21
|
+
'MajorWithMinorVersionsLimit',
|
|
22
|
+
'EnableModeration',
|
|
23
|
+
'EnableRequestSignOff',
|
|
24
|
+
'ExemptFromBlockDownloadOfNonViewableFiles',
|
|
25
|
+
];
|
|
26
|
+
//# sourceMappingURL=MinListSelects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinListSelects.js","sourceRoot":"","sources":["../../../../src/restAPIs/lists/lists/MinListSelects.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAIrD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAA8C;IACvE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB;IACzG,8CAA8C;CAC/C,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAA8C;IAC1E,GAAG,cAAc;IACjB,WAAW,EAAE,SAAS,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,sBAAsB;IACvF,mBAAmB,EAAE,eAAe,EAAE,mBAAmB,EAAE,0BAA0B;IACrF,sBAAsB,EAAE,0BAA0B;IAElD,iEAAiE;IACjE,uBAAuB;IACvB,wBAAwB;IACxB,eAAe;IAEf,qBAAqB;IACrB,6BAA6B;IAE7B,kBAAkB;IAClB,sBAAsB;IAEtB,2CAA2C;CAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSourceListsAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/lists/getSourceListsAPI.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;
|
|
1
|
+
{"version":3,"file":"getSourceListsAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/lists/getSourceListsAPI.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;AAQrH,wBAAsB,mBAAmB,CAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,GAAK,OAAO,CAAC,eAAe,CAAC,CAG/J;AAED,wBAAsB,iBAAiB,CAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,GAAK,OAAO,CAAC,eAAe,CAAC,CA0D7J"}
|
|
@@ -4,6 +4,7 @@ import { SourcePropsNoListTitle, SourcePropsNoWebUrl } from '../../../components
|
|
|
4
4
|
import { checkItemsResults } from '../../../components/molecules/process-results/CheckItemsResults';
|
|
5
5
|
import { check4This } from '../../../logic/Links/CheckSearch';
|
|
6
6
|
import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
|
|
7
|
+
import { getAbsoluteWebUrlFromSourceProps } from '../../../logic/Strings/getAbssoluteWebUrlFromSourceProps';
|
|
7
8
|
// Renamed from fetch to get
|
|
8
9
|
export async function fetchSourceListsAPI(sourceProps, alertMe, consoleLog) {
|
|
9
10
|
const results = await getSourceListsAPI(sourceProps, alertMe, consoleLog);
|
|
@@ -13,23 +14,25 @@ export async function getSourceListsAPI(sourceProps, alertMe, consoleLog) {
|
|
|
13
14
|
const { performanceSettings } = sourceProps;
|
|
14
15
|
// 2024-09-15: Change to null as any to pass linting when migrating from fps-library-v2
|
|
15
16
|
const fetchOp = performanceSettings ? startPerformOpV2(performanceSettings) : null;
|
|
16
|
-
const {
|
|
17
|
-
|
|
17
|
+
const { listTitle, orderBy, restFilter, selectThese, } = sourceProps;
|
|
18
|
+
// 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
|
|
19
|
+
const useUrl = getAbsoluteWebUrlFromSourceProps(sourceProps);
|
|
20
|
+
if (!useUrl || !listTitle) {
|
|
18
21
|
// NO WebURL... Throw Alert
|
|
19
22
|
if (alertMe === true)
|
|
20
23
|
alert(`${listTitle ? listTitle : SourcePropsNoListTitle} ${SourcePropsNoWebUrl}`);
|
|
21
|
-
const results = createErrorFpsListReturn(
|
|
24
|
+
const results = createErrorFpsListReturn(useUrl, listTitle);
|
|
22
25
|
return results;
|
|
23
26
|
}
|
|
24
27
|
/**
|
|
25
28
|
SAMPLE Full SharePoint Items Rest call:
|
|
26
|
-
`${this.props.SettingsSource.
|
|
29
|
+
`${this.props.SettingsSource.useUrl}/
|
|
27
30
|
_api/web/lists?
|
|
28
31
|
$filter=startswith(Title,'EULA')&
|
|
29
32
|
$select=Title,Id`;
|
|
30
33
|
|
|
31
34
|
*/
|
|
32
|
-
let fetchAPI = `${
|
|
35
|
+
let fetchAPI = `${useUrl}/_api/web/lists?`;
|
|
33
36
|
if (selectThese && selectThese.length > 0)
|
|
34
37
|
fetchAPI += `$select=${selectThese && selectThese.length > 0 ? selectThese.join(',') : 'Title,Id'}&`;
|
|
35
38
|
if (restFilter)
|
|
@@ -44,7 +47,8 @@ export async function getSourceListsAPI(sourceProps, alertMe, consoleLog) {
|
|
|
44
47
|
// }
|
|
45
48
|
let result = checkItemsResults(initialResult, `fps-core-v7: fetchSourceListsAPI ~ 43`, alertMe, consoleLog);
|
|
46
49
|
result.fpsContentType = !sourceProps.fpsContentType ? ['list'] : sourceProps.fpsContentType;
|
|
47
|
-
if
|
|
50
|
+
// 2024-12-05: changed if to test result, not sourceProps... was getting error reading indexOf
|
|
51
|
+
if (result.fpsContentType.indexOf('list') < 0)
|
|
48
52
|
result.fpsContentType.push('list');
|
|
49
53
|
// result.unifiedPerformanceOps.fetch = performanceSettings ?
|
|
50
54
|
// updatePerformanceEndV2( { op: fetchOp, updateMiliseconds: performanceSettings.updateMiliseconds, count: result.items.length }) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSourceListsAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/lists/lists/getSourceListsAPI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,GAAG,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAgB,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E,CAAC;
|
|
1
|
+
{"version":3,"file":"getSourceListsAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/lists/lists/getSourceListsAPI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,GAAG,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAgB,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E,CAAC;AACvH,OAAO,EAAE,gCAAgC,EAAE,MAAM,0DAA0D,CAAC;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s/sites/groups/GroupSelects.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,EAAE,MAAM,EAAsD,CAAC;AAE3F,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAAsD,CAAC;AAEjG,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAAwC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const GroupSelectsMin = ['Title', 'Description', 'Id', 'PrincipalType'];
|
|
2
|
+
export const GroupSelectsWithOwner = [...GroupSelectsMin, 'Owner/Title', 'Owner/Id'];
|
|
3
|
+
export const GroupSelectsFull = ['*', ...GroupSelectsWithOwner,];
|
|
4
|
+
//# sourceMappingURL=GroupSelects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupSelects.js","sourceRoot":"","sources":["../../../../src/restAPIs/sites/groups/GroupSelects.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAa,CAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,CAAE,CAAC;AAE3F,MAAM,CAAC,MAAM,qBAAqB,GAAa,CAAE,GAAG,eAAe,EAAE,aAAa,EAAE,UAAU,CAAE,CAAC;AAEjG,MAAM,CAAC,MAAM,gBAAgB,GAAa,CAAE,GAAG,EAAE,GAAG,qBAAqB,EAAI,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IFpsItemsReturn } from '../../../components/molecules/process-results/CheckItemsResults';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function getGroupMembersAPI(absoluteWebUrl: string, GroupName: string, restFilter: string, digestValue: string, alertMe: boolean | undefined, consoleLog: boolean | undefined): Promise<IFpsItemsReturn>;
|
|
2
|
+
import { ISourceProps } from '../../../components/molecules/source-props/ISourceProps';
|
|
3
|
+
export declare function checkCurrentUserInGroup(sourceProps: ISourceProps, GroupName: string, LoginName: string): Promise<IFpsItemsReturn>;
|
|
4
|
+
export declare function getAllUsersInGroup(sourceProps: ISourceProps, GroupName: string): Promise<IFpsItemsReturn>;
|
|
5
|
+
export declare function getGroupMembersAPI(sourceProps: ISourceProps, GroupName: string, alertMe: boolean | undefined, consoleLog: boolean | undefined): Promise<IFpsItemsReturn>;
|
|
7
6
|
//# sourceMappingURL=getGroupMembersAPI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGroupMembersAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/sites/groups/getGroupMembersAPI.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;
|
|
1
|
+
{"version":3,"file":"getGroupMembersAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/sites/groups/getGroupMembersAPI.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,eAAe,EAAE,MAAM,iEAAiE,CAAC;AAKrH,OAAO,EAAE,YAAY,EAAuB,MAAM,yDAAyD,CAAC;AAI5G,wBAAsB,uBAAuB,CAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAI,OAAO,CAAC,eAAe,CAAC,CAKzI;AAED,wBAAsB,kBAAkB,CAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAK,OAAO,CAAC,eAAe,CAAC,CAIlH;AAED,wBAAsB,kBAAkB,CAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,GAAK,OAAO,CAAC,eAAe,CAAC,CA8DjL"}
|
|
@@ -4,26 +4,29 @@ import { checkItemsResults } from '../../../components/molecules/process-results
|
|
|
4
4
|
import { check4This } from '../../../logic/Links/CheckSearch';
|
|
5
5
|
import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
|
|
6
6
|
import { SourcePropsNoWebUrl } from '../../../components/molecules/source-props/ISourceProps';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export async function checkCurrentUserInGroup(
|
|
7
|
+
import { getAbsoluteWebUrlFromSourceProps, } from '../../../logic/Strings/getAbssoluteWebUrlFromSourceProps';
|
|
8
|
+
import { UserGroupSelects } from '../users/UserGroupSelects';
|
|
9
|
+
export async function checkCurrentUserInGroup(sourceProps, GroupName, LoginName) {
|
|
10
10
|
// const results: IFpsItemsReturn = await getGroupMembersAPI( absoluteWebUrl, GroupName, `Title eq '${LoginName}'`, false, true );
|
|
11
|
-
|
|
11
|
+
// 2024-12-05: Noticed next line may have error: The rest filter is Title eq and property says LoginName
|
|
12
|
+
const results = await getGroupMembersAPI({ ...sourceProps, ...{ restFilter: `Title eq '${LoginName}'` } }, GroupName, false, true);
|
|
12
13
|
return results;
|
|
13
14
|
}
|
|
14
|
-
export async function getAllUsersInGroup(
|
|
15
|
+
export async function getAllUsersInGroup(sourceProps, GroupName) {
|
|
15
16
|
// const results: IFpsItemsReturn = await getGroupMembersAPI( absoluteWebUrl, GroupName, `Title eq '${LoginName}'`, false, true );
|
|
16
|
-
const results = await getGroupMembersAPI(
|
|
17
|
+
const results = await getGroupMembersAPI(sourceProps, GroupName, false, true);
|
|
17
18
|
return results;
|
|
18
19
|
}
|
|
19
|
-
export async function getGroupMembersAPI(
|
|
20
|
+
export async function getGroupMembersAPI(sourceProps, GroupName, alertMe, consoleLog) {
|
|
21
|
+
const { restFilter, digestValue = '', selectThese = UserGroupSelects } = sourceProps;
|
|
20
22
|
const performanceSettings = { label: GroupName, includeMsStr: true, updateMiliseconds: true, op: 'fetch' };
|
|
21
23
|
const fetchOp = performanceSettings ? startPerformOpV2(performanceSettings) : null;
|
|
22
|
-
|
|
24
|
+
const useUrl = getAbsoluteWebUrlFromSourceProps(sourceProps);
|
|
25
|
+
if (!useUrl) {
|
|
23
26
|
// NO WebURL... Throw Alert
|
|
24
27
|
if (alertMe === true)
|
|
25
28
|
alert(`getGroupInfoAPI: ${SourcePropsNoWebUrl}`);
|
|
26
|
-
const results = createErrorFpsListReturn(
|
|
29
|
+
const results = createErrorFpsListReturn(useUrl, '');
|
|
27
30
|
results.status = 'NoWeb';
|
|
28
31
|
return results;
|
|
29
32
|
}
|
|
@@ -31,7 +34,7 @@ export async function getGroupMembersAPI(absoluteWebUrl, GroupName, restFilter,
|
|
|
31
34
|
// NO WebURL... Throw Alert
|
|
32
35
|
if (alertMe === true)
|
|
33
36
|
alert(`${''} SourceProps does NOT have an GroupName`);
|
|
34
|
-
const results = createErrorFpsListReturn(
|
|
37
|
+
const results = createErrorFpsListReturn(useUrl, '');
|
|
35
38
|
results.statusText = 'No GroupName';
|
|
36
39
|
results.status = 'NoGroup';
|
|
37
40
|
return results;
|
|
@@ -39,14 +42,15 @@ export async function getGroupMembersAPI(absoluteWebUrl, GroupName, restFilter,
|
|
|
39
42
|
/**
|
|
40
43
|
SAMPLE Full SharePoint Items Rest call:
|
|
41
44
|
|
|
42
|
-
https://example.sharepoint.com/sites/MySite/_api/web/
|
|
45
|
+
https://example.sharepoint.com/sites/MySite/_api/web/sitegroups/getbyname('GroupName')/users?
|
|
43
46
|
$select=Id,Title,EULAText,ExpandedField1/Id,ExpandedField1/Title,ExpandedField2/Id,ExpandedField2/Title&
|
|
44
47
|
$expand=ExpandedField1,ExpandedField2&
|
|
45
48
|
$filter=Title eq 'SomeTitle'&
|
|
46
49
|
$orderby=Id desc
|
|
47
50
|
|
|
48
51
|
*/
|
|
49
|
-
let fetchAPI = `${
|
|
52
|
+
let fetchAPI = `${useUrl}/_api/web/sitegroups/getbyname('${GroupName}')/users?$select=${selectThese.join(',')}`;
|
|
53
|
+
fetchAPI += `$orderby=Title asc`;
|
|
50
54
|
if (restFilter)
|
|
51
55
|
fetchAPI += `&$filter=${encodeURIComponent(restFilter)}&`;
|
|
52
56
|
const initialResult = await doSpJsFetchOrPost(fetchAPI, 'GET', digestValue, '');
|
|
@@ -55,7 +59,7 @@ export async function getGroupMembersAPI(absoluteWebUrl, GroupName, restFilter,
|
|
|
55
59
|
// resultHubSites.items = cleanSearchedWebs( resultHubSites.items );
|
|
56
60
|
// }
|
|
57
61
|
const result = checkItemsResults(initialResult, `fps-core-v7: getGroupMembersAPI ~ 24`, alertMe, consoleLog);
|
|
58
|
-
result.fpsContentType = ['
|
|
62
|
+
result.fpsContentType = ['user'];
|
|
59
63
|
result.unifiedPerformanceOps.fetch = performanceSettings ?
|
|
60
64
|
updatePerformanceEndV2({ op: fetchOp, updateMiliseconds: performanceSettings.updateMiliseconds, count: result.items ? result.items.length : 0 })
|
|
61
65
|
: null; // 2024-09-29: set null as any to pass build error.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGroupMembersAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/sites/groups/getGroupMembersAPI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E,CAAC;AAEvH,OAAO,
|
|
1
|
+
{"version":3,"file":"getGroupMembersAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/sites/groups/getGroupMembersAPI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,EAAE,wBAAwB,EAAE,MAAM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AAiB,EAAE,mBAAmB,CAAC,iBAAiB,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACnK,CAAC,CAAC,IAAW,CAAC,CAAE,oDAAoD;IAEtE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC;IAEpD,IAAK,UAAU,CAAE,0BAA0B,CAAE,KAAK,IAAI,EAAG;QAAE,OAAO,CAAC,GAAG,CAAE,+CAA+C,EAAE,MAAM,CAAE,CAAA;KAAE;IAAA,CAAC;IAEpI,OAAO,MAAM,CAAC;AAEhB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ISourceProps } from '../../../components/molecules/source-props/ISourceProps';
|
|
2
|
+
import { IAssociatedGroupType } from '../../../types/fps-returns/sites/groups/IAssociatedGroupType';
|
|
3
|
+
import { IFpsAssocGroupsReturn, IFpsGroupReturn } from '../../../types/fps-returns/sites/groups/IGroupResults';
|
|
4
|
+
export declare function getWebAllAssociatedGroupsAPI(sourceProps: ISourceProps, digestValue: string, alertMe: boolean | undefined, consoleLog: boolean | undefined): Promise<IFpsAssocGroupsReturn>;
|
|
5
|
+
export declare function getWebAssociatedGroupAPI(sourceProps: ISourceProps, group: IAssociatedGroupType, digestValue: string, alertMe: boolean | undefined, consoleLog: boolean | undefined): Promise<IFpsGroupReturn>;
|
|
6
|
+
//# sourceMappingURL=getWebAssociatedGroupAPI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWebAssociatedGroupAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/sites/groups/getWebAssociatedGroupAPI.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAuB,MAAM,yDAAyD,CAAC;AAE5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAC;AAEpG,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAC;AAE/G,wBAAsB,4BAA4B,CAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,GAAK,OAAO,CAAC,qBAAqB,CAAC,CAwBnM;AAED,wBAAsB,wBAAwB,CAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,GAAK,OAAO,CAAC,eAAe,CAAC,CAgDtN"}
|