@mikezimm/fps-core-v7 1.0.56 → 1.0.57

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.
Files changed (31) hide show
  1. package/lib/logic/Links/getSPOUrl.d.ts +9 -1
  2. package/lib/logic/Links/getSPOUrl.d.ts.map +1 -1
  3. package/lib/logic/Links/getSPOUrl.js +9 -1
  4. package/lib/logic/Links/getSPOUrl.js.map +1 -1
  5. package/lib/restAPIs/lists/fields/getSourceFieldsAPI.d.ts +15 -0
  6. package/lib/restAPIs/lists/fields/getSourceFieldsAPI.d.ts.map +1 -0
  7. package/lib/restAPIs/lists/fields/getSourceFieldsAPI.js +51 -0
  8. package/lib/restAPIs/lists/fields/getSourceFieldsAPI.js.map +1 -0
  9. package/lib/restAPIs/lists/types/getSourceContentTypesAPI.d.ts +15 -0
  10. package/lib/restAPIs/lists/types/getSourceContentTypesAPI.d.ts.map +1 -0
  11. package/lib/restAPIs/lists/types/getSourceContentTypesAPI.js +53 -0
  12. package/lib/restAPIs/lists/types/getSourceContentTypesAPI.js.map +1 -0
  13. package/lib/restAPIs/lists/views/getSourceViewsAPI.d.ts +15 -0
  14. package/lib/restAPIs/lists/views/getSourceViewsAPI.d.ts.map +1 -0
  15. package/lib/restAPIs/lists/views/getSourceViewsAPI.js +51 -0
  16. package/lib/restAPIs/lists/views/getSourceViewsAPI.js.map +1 -0
  17. package/lib/restAPIs/sites/sites/getClientSideWebParts.d.ts +15 -0
  18. package/lib/restAPIs/sites/sites/getClientSideWebParts.d.ts.map +1 -0
  19. package/lib/restAPIs/sites/sites/getClientSideWebParts.js +52 -0
  20. package/lib/restAPIs/sites/sites/getClientSideWebParts.js.map +1 -0
  21. package/lib/restAPIs/sites/sites/getSiteFeaturesAPI.d.ts +15 -0
  22. package/lib/restAPIs/sites/sites/getSiteFeaturesAPI.d.ts.map +1 -0
  23. package/lib/restAPIs/sites/sites/getSiteFeaturesAPI.js +55 -0
  24. package/lib/restAPIs/sites/sites/getSiteFeaturesAPI.js.map +1 -0
  25. package/lib/restAPIs/sites/users/ensureUserOnWeb.d.ts +15 -0
  26. package/lib/restAPIs/sites/users/ensureUserOnWeb.d.ts.map +1 -0
  27. package/lib/restAPIs/sites/users/ensureUserOnWeb.js +39 -0
  28. package/lib/restAPIs/sites/users/ensureUserOnWeb.js.map +1 -0
  29. package/lib/types/fps-returns/common/IFPSBaseContentType.d.ts +1 -1
  30. package/lib/types/fps-returns/common/IFPSBaseContentType.d.ts.map +1 -1
  31. package/package.json +1 -1
@@ -26,7 +26,7 @@ export declare function getDomain2Reg(url: string, regex1: RegExp, regex2: RegEx
26
26
  Explanation of the regex:
27
27
 
28
28
  https:\/\/ matches the https:// part of the URL.
29
- [^.]+ matches one or more characters that are not a dot, capturing the subdomain part (e.g., fuzzypawstech).
29
+ [^.]+ matches one or more characters that are not a dot, capturing the subdomain part (e.g., tenant).
30
30
  \.sharepoint\.com\/sites\/ matches .sharepoint.com/sites/.
31
31
  ([^\/]+) captures one or more characters that are not a forward slash (/), representing the site collection name.
32
32
  i is the case-insensitive flag.
@@ -38,9 +38,17 @@ export declare function getDomain2Reg(url: string, regex1: RegExp, regex2: RegEx
38
38
  * NOTE: There is a better function for getting full absolute value of current site: getSiteCollectionUrlFromLink
39
39
  * You can also get it directly using the constant: CurrentSiteAbsolute
40
40
  *
41
+ * url = 'https://tenant.sharepoint.com/sites/XYZ/MoreStuff'
42
+ * output: XYZ
43
+ *
41
44
  * @param url
42
45
  * @returns
43
46
  */
44
47
  export declare function getCollectionUrl(url: string): string;
48
+ /**
49
+ *
50
+ * @param url
51
+ * @returns
52
+ */
45
53
  export declare function getTeamsUrl(url: string): string;
46
54
  //# sourceMappingURL=getSPOUrl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSPOUrl.d.ts","sourceRoot":"","sources":["../../../src/logic/Links/getSPOUrl.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAUjF;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOpD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/C"}
1
+ {"version":3,"file":"getSPOUrl.d.ts","sourceRoot":"","sources":["../../../src/logic/Links/getSPOUrl.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAUjF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOpD;AAGD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/C"}
@@ -33,7 +33,7 @@ export function getDomain2Reg(url, regex1, regex2) {
33
33
  Explanation of the regex:
34
34
 
35
35
  https:\/\/ matches the https:// part of the URL.
36
- [^.]+ matches one or more characters that are not a dot, capturing the subdomain part (e.g., fuzzypawstech).
36
+ [^.]+ matches one or more characters that are not a dot, capturing the subdomain part (e.g., tenant).
37
37
  \.sharepoint\.com\/sites\/ matches .sharepoint.com/sites/.
38
38
  ([^\/]+) captures one or more characters that are not a forward slash (/), representing the site collection name.
39
39
  i is the case-insensitive flag.
@@ -45,6 +45,9 @@ export function getDomain2Reg(url, regex1, regex2) {
45
45
  * NOTE: There is a better function for getting full absolute value of current site: getSiteCollectionUrlFromLink
46
46
  * You can also get it directly using the constant: CurrentSiteAbsolute
47
47
  *
48
+ * url = 'https://tenant.sharepoint.com/sites/XYZ/MoreStuff'
49
+ * output: XYZ
50
+ *
48
51
  * @param url
49
52
  * @returns
50
53
  */
@@ -56,6 +59,11 @@ export function getCollectionUrl(url) {
56
59
  // 2024-09-22: Changed return from null to ''
57
60
  return url ? getDomain2Reg(url, regex, regex2) : '';
58
61
  }
62
+ /**
63
+ *
64
+ * @param url
65
+ * @returns
66
+ */
59
67
  export function getTeamsUrl(url) {
60
68
  const regex = /https:\/\/[^.]+\.sharepoint\.com\/teams\/([^/]+)/i;
61
69
  const regex2 = /\/teams\/([^/]+)/;
@@ -1 +1 @@
1
- {"version":3,"file":"getSPOUrl.js","sourceRoot":"","sources":["../../../src/logic/Links/getSPOUrl.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,MAAc,EAAE,MAAc;IAEvE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3B,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEjC,8CAA8C;IAC9C,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAEjC,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,KAAK,GAAG,mDAAmD,CAAC;IAClE,MAAM,MAAM,GAAG,kBAAkB,CAAC;IAClC,IAAI,GAAG;QAAE,OAAO,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAElD,8CAA8C;IAC9C,OAAO,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,WAAW,CA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WAAW,CAAC,GAAW;IACrC,MAAM,KAAK,GAAG,mDAAmD,CAAC;IAClE,MAAM,MAAM,GAAG,kBAAkB,CAAC;IAClC,IAAI,GAAG;QAAE,OAAO,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAElD,8CAA8C;IAC9C,OAAO,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtD,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ISourceProps } from '../../../components/molecules/source-props/ISourceProps';
2
+ import { IFpsItemsReturn } from '../../../components/molecules/process-results/IFpsItemsReturn';
3
+ /**
4
+ * getSourceFieldsAPI will get all the fields information for a list
5
+ * import { getSourceFieldsAPI, getSourceFieldByInternalNameOrTitleAPI } from '@mikezimm/fps-core-v7/lib/restAPIs/lists/fields/getSourceFieldsAPI';
6
+ *
7
+ * Replaces fetchFieldsD from pnp2
8
+ *
9
+ * @param sourceProps
10
+ * @param alertMe
11
+ * @param consoleLog
12
+ * @returns
13
+ */
14
+ export declare function getSourceFieldsAPI(sourceProps: ISourceProps, alertMe: boolean | undefined, consoleLog: boolean | undefined, fieldNameTitle?: string): Promise<IFpsItemsReturn>;
15
+ //# sourceMappingURL=getSourceFieldsAPI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSourceFieldsAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/fields/getSourceFieldsAPI.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAKhG;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,EAAE,cAAc,GAAE,MAAW,GAAI,OAAO,CAAC,eAAe,CAAC,CAkC1L"}
@@ -0,0 +1,51 @@
1
+ import { doSpHttpFetchOrPostAndCheck } from '../../../components/molecules/SpHttp/Sp/doSpHttpFetch';
2
+ import { SourcePropsNoListTitle, SourcePropsNoWebUrl } from '../../../components/molecules/source-props/ISourceProps';
3
+ import { check4This } from '../../../logic/Links/CheckSearch';
4
+ import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
5
+ import { getAbsoluteWebUrlFromSourceProps } from '../../../logic/Strings/getAbssoluteWebUrlFromSourceProps';
6
+ /**
7
+ * getSourceFieldsAPI will get all the fields information for a list
8
+ * import { getSourceFieldsAPI, getSourceFieldByInternalNameOrTitleAPI } from '@mikezimm/fps-core-v7/lib/restAPIs/lists/fields/getSourceFieldsAPI';
9
+ *
10
+ * Replaces fetchFieldsD from pnp2
11
+ *
12
+ * @param sourceProps
13
+ * @param alertMe
14
+ * @param consoleLog
15
+ * @returns
16
+ */
17
+ export async function getSourceFieldsAPI(sourceProps, alertMe, consoleLog, fieldNameTitle = '') {
18
+ // const { performanceSettings } = sourceProps;
19
+ // 2024-09-15: Change to null as any to pass linting when migrating from fps-library-v2
20
+ // const fetchOp = performanceSettings ? startPerformOpV2( performanceSettings ) : null as any;
21
+ const { listTitle, orderBy, restFilter, } = sourceProps;
22
+ let { selectThese, } = sourceProps;
23
+ // 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
24
+ const useUrl = getAbsoluteWebUrlFromSourceProps(sourceProps);
25
+ if (!useUrl || !listTitle) {
26
+ // NO WebURL... Throw Alert
27
+ if (alertMe === true)
28
+ alert(`${listTitle ? listTitle : SourcePropsNoListTitle} ${SourcePropsNoWebUrl}`);
29
+ const results = createErrorFpsListReturn(useUrl, listTitle);
30
+ return results;
31
+ }
32
+ if (!selectThese || selectThese.length === 0)
33
+ selectThese = ['*'];
34
+ let fetchAPI = `${useUrl}/_api/web/lists/getbytitle('${listTitle}')/fields?`;
35
+ if (selectThese)
36
+ fetchAPI += `&$select= ${selectThese.join(',')}`;
37
+ if (orderBy)
38
+ fetchAPI += `&$orderby=${orderBy}`;
39
+ if (restFilter)
40
+ fetchAPI += `&$filter= ${restFilter}`;
41
+ const orderBys = [];
42
+ if (orderBy)
43
+ orderBys.push(`${orderBy.prop} ${orderBy.order}`);
44
+ const result = await doSpHttpFetchOrPostAndCheck(fetchAPI, 'GET', sourceProps.fpsSpService, '', alertMe, consoleLog, fieldNameTitle ? 'field' : 'fields', null);
45
+ if (check4This(`fpsShowFetchResults=true`) === true) {
46
+ console.log(`fps-core-v7 COMPLETE: getSourceFieldsAPI ~ 47`, result);
47
+ }
48
+ ;
49
+ return result;
50
+ }
51
+ //# sourceMappingURL=getSourceFieldsAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSourceFieldsAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/lists/fields/getSourceFieldsAPI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAAgB,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAEpI,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E,CAAC;AACvH,OAAO,EAAE,gCAAgC,EAAE,MAAM,0DAA0D,CAAC;AAE5G;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAE,WAAyB,EAAE,OAA4B,EAAE,UAA+B,EAAE,iBAAyB,EAAE;IAE7J,+CAA+C;IAC/C,wFAAwF;IACxF,+FAA+F;IAE/F,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,GAAG,WAAW,CAAC;IACxD,IAAI,EAAE,WAAW,GAAG,GAAG,WAAW,CAAC;IAEnC,sIAAsI;IACtI,MAAM,MAAM,GAAW,gCAAgC,CAAE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C;AAEhB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ISourceProps } from '../../../components/molecules/source-props/ISourceProps';
2
+ import { IFpsItemsReturn } from '../../../components/molecules/process-results/IFpsItemsReturn';
3
+ /**
4
+ * getSourceContentTypesAPI will get all the content types information for a list or site
5
+ * import { getSourceContentTypesAPI } from '@mikezimm/fps-core-v7/lib/restAPIs/lists/types/getSourceContentTypesAPI';
6
+ *
7
+ * NOTE: In order to get site content types, just remove the listTitle from sourceProps
8
+ *
9
+ * @param sourceProps
10
+ * @param alertMe
11
+ * @param consoleLog
12
+ * @returns
13
+ */
14
+ export declare function getSourceContentTypesAPI(sourceProps: ISourceProps, alertMe: boolean | undefined, consoleLog: boolean | undefined, contentTypeId?: string): Promise<IFpsItemsReturn>;
15
+ //# sourceMappingURL=getSourceContentTypesAPI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSourceContentTypesAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/types/getSourceContentTypesAPI.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAuB,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAKhG;;;;;;;;;;GAUG;AAEH,wBAAsB,wBAAwB,CAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,EAAE,aAAa,GAAE,MAAW,GAAI,OAAO,CAAC,eAAe,CAAC,CAuC/L"}
@@ -0,0 +1,53 @@
1
+ import { doSpHttpFetchOrPostAndCheck } from '../../../components/molecules/SpHttp/Sp/doSpHttpFetch';
2
+ import { SourcePropsNoWebUrl } from '../../../components/molecules/source-props/ISourceProps';
3
+ import { check4This } from '../../../logic/Links/CheckSearch';
4
+ import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
5
+ import { getAbsoluteWebUrlFromSourceProps } from '../../../logic/Strings/getAbssoluteWebUrlFromSourceProps';
6
+ /**
7
+ * getSourceContentTypesAPI will get all the content types information for a list or site
8
+ * import { getSourceContentTypesAPI } from '@mikezimm/fps-core-v7/lib/restAPIs/lists/types/getSourceContentTypesAPI';
9
+ *
10
+ * NOTE: In order to get site content types, just remove the listTitle from sourceProps
11
+ *
12
+ * @param sourceProps
13
+ * @param alertMe
14
+ * @param consoleLog
15
+ * @returns
16
+ */
17
+ export async function getSourceContentTypesAPI(sourceProps, alertMe, consoleLog, contentTypeId = '') {
18
+ // const { performanceSettings } = sourceProps;
19
+ // 2024-09-15: Change to null as any to pass linting when migrating from fps-library-v2
20
+ // const fetchOp = performanceSettings ? startPerformOpV2( performanceSettings ) : null as any;
21
+ const { listTitle, orderBy, restFilter, } = sourceProps;
22
+ let { selectThese, } = sourceProps;
23
+ // 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
24
+ const useUrl = getAbsoluteWebUrlFromSourceProps(sourceProps);
25
+ if (!useUrl) {
26
+ // NO WebURL... Throw Alert
27
+ if (alertMe === true)
28
+ alert(`${SourcePropsNoWebUrl}`);
29
+ const results = createErrorFpsListReturn(useUrl, listTitle);
30
+ return results;
31
+ }
32
+ if (!selectThese || selectThese.length === 0)
33
+ selectThese = ['*'];
34
+ let fetchAPI = listTitle ? `${useUrl}/_api/web/lists/getbytitle('${listTitle}')/contenttypes` : `${useUrl}/_api/web/contenttypes`;
35
+ fetchAPI = contentTypeId ? `${fetchAPI}/getbyid('${contentTypeId}')?`
36
+ : `${fetchAPI}?`;
37
+ if (selectThese)
38
+ fetchAPI += `&$select= ${selectThese.join(',')}`;
39
+ if (!contentTypeId && orderBy)
40
+ fetchAPI += `&$orderby=${orderBy}`;
41
+ if (!contentTypeId && restFilter)
42
+ fetchAPI += `&$filter= ${restFilter}`;
43
+ const orderBys = [];
44
+ if (orderBy)
45
+ orderBys.push(`${orderBy.prop} ${orderBy.order}`);
46
+ const result = await doSpHttpFetchOrPostAndCheck(fetchAPI, 'GET', sourceProps.fpsSpService, '', alertMe, consoleLog, contentTypeId ? 'type' : 'types', null);
47
+ if (check4This(`fpsShowFetchResults=true`) === true) {
48
+ console.log(`fps-core-v7 COMPLETE: getSourceViewsAPI ~ 47`, result);
49
+ }
50
+ ;
51
+ return result;
52
+ }
53
+ //# sourceMappingURL=getSourceContentTypesAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSourceContentTypesAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/lists/types/getSourceContentTypesAPI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAAgB,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAE5G,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E,CAAC;AACvH,OAAO,EAAE,gCAAgC,EAAE,MAAM,0DAA0D,CAAC;AAE5G;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAE,WAAyB,EAAE,OAA4B,EAAE,UAA+B,EAAE,gBAAwB,EAAE;IAElK,+CAA+C;IAC/C,wFAAwF;IACxF,+FAA+F;IAE/F,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,GAAG,WAAW,CAAC;IACxD,IAAI,EAAE,WAAW,GAAG,GAAG,WAAW,CAAC;IAEnC,sIAAsI;IACtI,MAAM,MAAM,GAAW,gCAAgC,CAAE,WAAW,CAAE,CAAC;IAEvE,IAAK,CAAC,MAAM,EAAG;QACb,2BAA2B;QAC3B,IAAK,OAAO,KAAK,IAAI;YAAG,KAAK,CAAC,GAAG,mBAAmB,EAAE,CAAC,CAAC;QACxD,MAAM,OAAO,GAAoB,wBAAwB,CAAE,MAAM,EAAE,SAAS,CAAG,CAAC;QAChF,OAAO,OAAO,CAAC;KAChB;IAED,IAAK,CAAC,W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ItemsReturn';
3
+ /**
4
+ * getSourceViewsAPI will get all the views information for a list
5
+ * import { getSourceViewsAPI, getSourceViewByTitleOrIdAPI } from '@mikezimm/fps-core-v7/lib/restAPIs/lists/views/getSourceViewsAPI';
6
+ *
7
+ * Replaces fetchFieldsD from pnp2
8
+ *
9
+ * @param sourceProps
10
+ * @param alertMe
11
+ * @param consoleLog
12
+ * @returns
13
+ */
14
+ export declare function getSourceViewsAPI(sourceProps: ISourceProps, alertMe: boolean | undefined, consoleLog: boolean | undefined, viewTitleOrId?: string): Promise<IFpsItemsReturn>;
15
+ //# sourceMappingURL=getSourceViewsAPI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSourceViewsAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/lists/views/getSourceViewsAPI.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAA+C,MAAM,yDAAyD,CAAC;AACpI,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAKhG;;;;;;;;;;GAUG;AAEH,wBAAsB,iBAAiB,CAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,EAAE,aAAa,GAAE,MAAW,GAAI,OAAO,CAAC,eAAe,CAAC,CAkCxL"}
@@ -0,0 +1,51 @@
1
+ import { doSpHttpFetchOrPostAndCheck } from '../../../components/molecules/SpHttp/Sp/doSpHttpFetch';
2
+ import { SourcePropsNoListTitle, SourcePropsNoWebUrl } from '../../../components/molecules/source-props/ISourceProps';
3
+ import { check4This } from '../../../logic/Links/CheckSearch';
4
+ import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
5
+ import { getAbsoluteWebUrlFromSourceProps } from '../../../logic/Strings/getAbssoluteWebUrlFromSourceProps';
6
+ /**
7
+ * getSourceViewsAPI will get all the views information for a list
8
+ * import { getSourceViewsAPI, getSourceViewByTitleOrIdAPI } from '@mikezimm/fps-core-v7/lib/restAPIs/lists/views/getSourceViewsAPI';
9
+ *
10
+ * Replaces fetchFieldsD from pnp2
11
+ *
12
+ * @param sourceProps
13
+ * @param alertMe
14
+ * @param consoleLog
15
+ * @returns
16
+ */
17
+ export async function getSourceViewsAPI(sourceProps, alertMe, consoleLog, viewTitleOrId = '') {
18
+ // const { performanceSettings } = sourceProps;
19
+ // 2024-09-15: Change to null as any to pass linting when migrating from fps-library-v2
20
+ // const fetchOp = performanceSettings ? startPerformOpV2( performanceSettings ) : null as any;
21
+ const { listTitle, orderBy, restFilter, } = sourceProps;
22
+ let { selectThese, } = sourceProps;
23
+ // 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
24
+ const useUrl = getAbsoluteWebUrlFromSourceProps(sourceProps);
25
+ if (!useUrl || !listTitle) {
26
+ // NO WebURL... Throw Alert
27
+ if (alertMe === true)
28
+ alert(`${listTitle ? listTitle : SourcePropsNoListTitle} ${SourcePropsNoWebUrl}`);
29
+ const results = createErrorFpsListReturn(useUrl, listTitle);
30
+ return results;
31
+ }
32
+ if (!selectThese || selectThese.length === 0)
33
+ selectThese = ['*'];
34
+ let fetchAPI = `${useUrl}/_api/web/lists/getbytitle('${listTitle}')/views?`;
35
+ if (selectThese)
36
+ fetchAPI += `&$select= ${selectThese.join(',')}`;
37
+ if (orderBy)
38
+ fetchAPI += `&$orderby=${orderBy}`;
39
+ if (restFilter)
40
+ fetchAPI += `&$filter= ${restFilter}`;
41
+ const orderBys = [];
42
+ if (orderBy)
43
+ orderBys.push(`${orderBy.prop} ${orderBy.order}`);
44
+ const result = await doSpHttpFetchOrPostAndCheck(fetchAPI, 'GET', sourceProps.fpsSpService, '', alertMe, consoleLog, viewTitleOrId ? 'view' : 'views', null);
45
+ if (check4This(`fpsShowFetchResults=true`) === true) {
46
+ console.log(`fps-core-v7 COMPLETE: getSourceViewsAPI ~ 47`, result);
47
+ }
48
+ ;
49
+ return result;
50
+ }
51
+ //#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AM,+BAA+B,SAAS,WAAW,CAAC;IACpF,IAAK,WAAW;QAAG,QAAQ,IAAI,aAAa,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACpE,IAAK,OAAO;QAAG,QAAQ,IAAI,aAAa,OAAO,EAAE,CAAC;IAClD,IAAK,UAAU;QAAG,QAAQ,IAAI,aAAa,UAAU,EAAE,CAAC;IAExD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAK,OAAO;QAAG,QAAQ,CAAC,IAAI,CAAE,GAAI,OAAO,CAAC,IAAK,IAAK,OAAO,CAAC,KAAM,EAAE,CAAE,CAAE;IAExE,MAAM,MAAM,GAAG,MAAM,2BAA2B,CAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAE,CAAC;IAE/J,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"}
@@ -0,0 +1,15 @@
1
+ import { ISourceProps } from '../../../components/molecules/source-props/ISourceProps';
2
+ import { IFpsItemsReturn } from '../../../components/molecules/process-results/IFpsItemsReturn';
3
+ /**
4
+ * getClientSideWebParts will get all the fields information for a list
5
+ * import { getClientSideWebPartsI } from '@mikezimm/fps-core-v7/lib/restAPIs/sites/sites/getClientSideWebParts';
6
+ *
7
+ * Replaces fetchFieldsD from pnp2
8
+ *
9
+ * @param sourceProps
10
+ * @param alertMe
11
+ * @param consoleLog
12
+ * @returns
13
+ */
14
+ export declare function getClientSideWebParts(sourceProps: ISourceProps, alertMe: boolean | undefined, consoleLog: boolean | undefined, webpartId?: string): Promise<IFpsItemsReturn>;
15
+ //# sourceMappingURL=getClientSideWebParts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getClientSideWebParts.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/sites/sites/getClientSideWebParts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAuB,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAKhG;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,EAAE,SAAS,GAAE,MAAW,GAAI,OAAO,CAAC,eAAe,CAAC,CA+BxL"}
@@ -0,0 +1,52 @@
1
+ import { doSpHttpFetchOrPostAndCheck } from '../../../components/molecules/SpHttp/Sp/doSpHttpFetch';
2
+ import { SourcePropsNoWebUrl } from '../../../components/molecules/source-props/ISourceProps';
3
+ import { check4This } from '../../../logic/Links/CheckSearch';
4
+ import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
5
+ import { getSiteCollectionUrlFromLink } from '../../../logic/Strings/getSiteCollectionUrlFromLink';
6
+ /**
7
+ * getClientSideWebParts will get all the fields information for a list
8
+ * import { getClientSideWebPartsI } from '@mikezimm/fps-core-v7/lib/restAPIs/sites/sites/getClientSideWebParts';
9
+ *
10
+ * Replaces fetchFieldsD from pnp2
11
+ *
12
+ * @param sourceProps
13
+ * @param alertMe
14
+ * @param consoleLog
15
+ * @returns
16
+ */
17
+ export async function getClientSideWebParts(sourceProps, alertMe, consoleLog, webpartId = '') {
18
+ const { orderBy, restFilter, } = sourceProps;
19
+ let { selectThese, } = sourceProps;
20
+ // 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
21
+ const useUrl = getSiteCollectionUrlFromLink(sourceProps.absoluteWebUrl ? sourceProps.absoluteWebUrl : sourceProps.webUrl ? sourceProps.webUrl : '');
22
+ if (!useUrl) {
23
+ // NO WebURL... Throw Alert
24
+ if (alertMe === true)
25
+ alert(`${SourcePropsNoWebUrl}`);
26
+ const results = createErrorFpsListReturn(useUrl, '');
27
+ return results;
28
+ }
29
+ if (!selectThese || selectThese.length === 0)
30
+ selectThese = ['*'];
31
+ let fetchAPI = `${useUrl}/_api/web/GetClientSideWebParts?`;
32
+ if (selectThese)
33
+ fetchAPI += `&$select= ${selectThese.join(',')}`;
34
+ if (orderBy)
35
+ fetchAPI += `&$orderby=${orderBy}`;
36
+ if (webpartId) {
37
+ fetchAPI += `&$filter=Id eq '${webpartId}'`;
38
+ }
39
+ else if (restFilter) {
40
+ fetchAPI += `&$filter= ${restFilter}`;
41
+ }
42
+ const orderBys = [];
43
+ if (orderBy)
44
+ orderBys.push(`${orderBy.prop} ${orderBy.order}`);
45
+ const result = await doSpHttpFetchOrPostAndCheck(fetchAPI, 'GET', sourceProps.fpsSpService, '', alertMe, consoleLog, webpartId ? 'webpart' : 'webparts', null);
46
+ if (check4This(`fpsShowFetchResults=true`) === true) {
47
+ console.log(`fps-core-v7 COMPLETE: getClientSideWebParts ~ 49`, result);
48
+ }
49
+ ;
50
+ return result;
51
+ }
52
+ //# sourceMappingURL=getClientSideWebParts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getClientSideWebParts.js","sourceRoot":"","sources":["../../../../src/restAPIs/sites/sites/getClientSideWebParts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAAgB,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAE5G,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E,CAAC;AACvH,OAAO,EAAE,4BAA4B,EAAE,MAAM,qDAAqD,CAAC;AAEnG;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAE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AAM,GAAG,MAAM,2BAA2B,CAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,CAAE,CAAC;IAEjK,IAAK,UAAU,CAAE,0BAA0B,CAAE,KAAK,IAAI,EAAG;QAAE,OAAO,CAAC,GAAG,CAAE,kDAAkD,EAAE,MAAM,CAAE,CAAA;KAAE;IAAA,CAAC;IAEvI,OAAO,MAAM,CAAC;AAEhB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ISourceProps } from '../../../components/molecules/source-props/ISourceProps';
2
+ import { IFpsItemsReturn } from '../../../components/molecules/process-results/IFpsItemsReturn';
3
+ /**
4
+ * getSourceFieldsAPI will get all the fields information for a list
5
+ * import { getSiteFeaturesAPI } from '@mikezimm/fps-core-v7/lib/restAPIs/sites/sites/getSiteFeaturesAPI';
6
+ *
7
+ * Replaces fetchFieldsD from pnp2
8
+ *
9
+ * @param sourceProps
10
+ * @param alertMe
11
+ * @param consoleLog
12
+ * @returns
13
+ */
14
+ export declare function getSiteFeaturesAPI(sourceProps: ISourceProps, alertMe: boolean | undefined, consoleLog: boolean | undefined, featureId?: string): Promise<IFpsItemsReturn>;
15
+ //# sourceMappingURL=getSiteFeaturesAPI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSiteFeaturesAPI.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/sites/sites/getSiteFeaturesAPI.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAuB,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAKhG;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,EAAE,SAAS,GAAE,MAAW,GAAI,OAAO,CAAC,eAAe,CAAC,CAmCrL"}
@@ -0,0 +1,55 @@
1
+ import { doSpHttpFetchOrPostAndCheck } from '../../../components/molecules/SpHttp/Sp/doSpHttpFetch';
2
+ import { SourcePropsNoWebUrl } from '../../../components/molecules/source-props/ISourceProps';
3
+ import { check4This } from '../../../logic/Links/CheckSearch';
4
+ import { createErrorFpsListReturn } from '../../../components/molecules/process-results/createErrorFpsListItemsReturn';
5
+ import { getSiteCollectionUrlFromLink } from '../../../logic/Strings/getSiteCollectionUrlFromLink';
6
+ /**
7
+ * getSourceFieldsAPI will get all the fields information for a list
8
+ * import { getSiteFeaturesAPI } from '@mikezimm/fps-core-v7/lib/restAPIs/sites/sites/getSiteFeaturesAPI';
9
+ *
10
+ * Replaces fetchFieldsD from pnp2
11
+ *
12
+ * @param sourceProps
13
+ * @param alertMe
14
+ * @param consoleLog
15
+ * @returns
16
+ */
17
+ export async function getSiteFeaturesAPI(sourceProps, alertMe, consoleLog, featureId = '') {
18
+ // const { performanceSettings } = sourceProps;
19
+ // 2024-09-15: Change to null as any to pass linting when migrating from fps-library-v2
20
+ // const fetchOp = performanceSettings ? startPerformOpV2( performanceSettings ) : null as any;
21
+ const { orderBy, restFilter, } = sourceProps;
22
+ let { selectThese, } = sourceProps;
23
+ // 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
24
+ const useUrl = getSiteCollectionUrlFromLink(sourceProps.absoluteWebUrl ? sourceProps.absoluteWebUrl : sourceProps.webUrl ? sourceProps.webUrl : '');
25
+ if (!useUrl) {
26
+ // NO WebURL... Throw Alert
27
+ if (alertMe === true)
28
+ alert(`${SourcePropsNoWebUrl}`);
29
+ const results = createErrorFpsListReturn(useUrl, '');
30
+ return results;
31
+ }
32
+ if (!selectThese || selectThese.length === 0)
33
+ selectThese = ['*'];
34
+ let fetchAPI = `${useUrl}/_api/site/features?`;
35
+ if (selectThese)
36
+ fetchAPI += `&$select= ${selectThese.join(',')}`;
37
+ if (orderBy)
38
+ fetchAPI += `&$orderby=${orderBy}`;
39
+ if (featureId) {
40
+ fetchAPI += `&$filter=Id eq '${featureId}'`;
41
+ }
42
+ else if (restFilter) {
43
+ fetchAPI += `&$filter= ${restFilter}`;
44
+ }
45
+ const orderBys = [];
46
+ if (orderBy)
47
+ orderBys.push(`${orderBy.prop} ${orderBy.order}`);
48
+ const result = await doSpHttpFetchOrPostAndCheck(fetchAPI, 'GET', sourceProps.fpsSpService, '', alertMe, consoleLog, featureId ? 'feature' : 'features', null);
49
+ if (check4This(`fpsShowFetchResults=true`) === true) {
50
+ console.log(`fps-core-v7 COMPLETE: getSiteFeaturesAPI ~ 53`, result);
51
+ }
52
+ ;
53
+ return result;
54
+ }
55
+ //# sourceMappingURL=getSiteFeaturesAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSiteFeaturesAPI.js","sourceRoot":"","sources":["../../../../src/restAPIs/sites/sites/getSiteFeaturesAPI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAAgB,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAE5G,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E,CAAC;AACvH,OAAO,EAAE,4BAA4B,EAAE,MAAM,qDAAqD,CAAC;AAEnG;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAE,WAAyB,EAAE,OAA4B,EAAE,UAA+B,EAAE,YAAoB,EAAE;IAExJ,+CAA+C;IAC/C,wFAAwF;IACxF,+FAA+F;IAE/F,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,GAAG,WAAW,CAAC;IAC7C,IAAI,EAAE,WAAW,GAAG,GAAG,WAAW,CAAC;IAEnC,sIAAsI;IACtI,MAAM,MAAM,GAAW,4BAA4B,CAA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AE,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,15 @@
1
+ import { ISourceProps } from '../../../components/molecules/source-props/ISourceProps';
2
+ import { IFpsItemsReturn } from '../../../components/molecules/process-results/IFpsItemsReturn';
3
+ /**
4
+ * ensureUserOnWeb will ensure a user is on the web and return their User Info when they are
5
+ * import { ensureUserOnWeb } from '@mikezimm/fps-core-v7/lib/restAPIs/sites/users/ensureUserOnWeb';
6
+ *
7
+ * Replaces ensureUserInfoD and ensureUserHereD from pnp2
8
+ *
9
+ * @param sourceProps
10
+ * @param alertMe
11
+ * @param consoleLog
12
+ * @returns
13
+ */
14
+ export declare function ensureUserOnWeb(sourceProps: ISourceProps, loginName: string, alertMe: boolean | undefined, consoleLog: boolean | undefined): Promise<IFpsItemsReturn>;
15
+ //# sourceMappingURL=ensureUserOnWeb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureUserOnWeb.d.ts","sourceRoot":"","sources":["../../../../src/restAPIs/sites/users/ensureUserOnWeb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAuB,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAKhG;;;;;;;;;;GAUG;AAEH,wBAAsB,eAAe,CAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,GAAI,OAAO,CAAC,eAAe,CAAC,CA0B7K"}
@@ -0,0 +1,39 @@
1
+ import { doSpHttpFetchOrPostAndCheck } from '../../../components/molecules/SpHttp/Sp/doSpHttpFetch';
2
+ import { SourcePropsNoWebUrl } from '../../../components/molecules/source-props/ISourceProps';
3
+ import { check4This } from '../../../logic/Links/CheckSearch';
4
+ import { getAbsoluteWebUrlFromSourceProps } from '../../../logic/Strings/getAbssoluteWebUrlFromSourceProps';
5
+ import { createErrorFpsUsersReturn } from '../../../components/molecules/process-results/createEmptyFpsUsersReturn';
6
+ /**
7
+ * ensureUserOnWeb will ensure a user is on the web and return their User Info when they are
8
+ * import { ensureUserOnWeb } from '@mikezimm/fps-core-v7/lib/restAPIs/sites/users/ensureUserOnWeb';
9
+ *
10
+ * Replaces ensureUserInfoD and ensureUserHereD from pnp2
11
+ *
12
+ * @param sourceProps
13
+ * @param alertMe
14
+ * @param consoleLog
15
+ * @returns
16
+ */
17
+ export async function ensureUserOnWeb(sourceProps, loginName, alertMe, consoleLog) {
18
+ // const { performanceSettings } = sourceProps;
19
+ // 2024-09-15: Change to null as any to pass linting when migrating from fps-library-v2
20
+ // const fetchOp = performanceSettings ? startPerformOpV2( performanceSettings ) : null as any;
21
+ // 2024-12-05: Added this because some places like PivotTiles had absoluteWebUrl in webUrl prop... so just taking care of differences
22
+ const useUrl = getAbsoluteWebUrlFromSourceProps(sourceProps);
23
+ if (!useUrl || !loginName) {
24
+ // NO WebURL... Throw Alert
25
+ if (alertMe === true)
26
+ alert(`${loginName ? loginName : 'Requires Login Name'} ${SourcePropsNoWebUrl}`);
27
+ const results = createErrorFpsUsersReturn(useUrl);
28
+ return results;
29
+ }
30
+ let fetchAPI = `${useUrl}/_api/web/ensureuser?`;
31
+ const body = { logonName: loginName };
32
+ const result = await doSpHttpFetchOrPostAndCheck(fetchAPI, 'POST', sourceProps.fpsSpService, '', alertMe, consoleLog, 'user', body);
33
+ if (check4This(`fpsShowFetchResults=true`) === true) {
34
+ console.log(`fps-core-v7 COMPLETE: ensureUserOnWeb ~ 47`, result);
35
+ }
36
+ ;
37
+ return result;
38
+ }
39
+ //# sourceMappingURL=ensureUserOnWeb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureUserOnWeb.js","sourceRoot":"","sources":["../../../../src/restAPI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E;IAAA,CAAC;IAEjI,OAAO,MAAM,CAAC;AAEhB,CAAC"}
@@ -1,4 +1,4 @@
1
- export type IFPSBaseContentType = 'hub' | 'site' | 'web' | 'list' | 'item' | 'search' | 'page' | 'file' | 'group' | 'user' | 'role' | 'field' | 'view' | 'nav' | 'theme';
1
+ export type IFPSBaseContentType = 'hub' | 'site' | 'web' | 'list' | 'item' | 'search' | 'page' | 'file' | 'group' | 'user' | 'role' | 'field' | 'view' | 'nav' | 'theme' | 'type' | 'feature' | 'webpart';
2
2
  export type IFPSBaseContentTypesPlural = `${IFPSBaseContentType}s`;
3
3
  export type IFPSBaseContentTypesAll = IFPSBaseContentType | IFPSBaseContentTypesPlural;
4
4
  export type IFpsMappedTypes = {
@@ -1 +1 @@
1
- {"version":3,"file":"IFPSBaseContentType.d.ts","sourceRoot":"","sources":["../../../../src/types/fps-returns/common/IFPSBaseContentType.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;AAEzK,MAAM,MAAM,0BAA0B,GAAG,GAAG,mBAAmB,GAAG,CAAC;AACnE,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,GAAG,0BAA0B,CAAC;AAEvF,MAAM,MAAM,eAAe,GAAG;KAC3B,CAAC,IAAI,mBAAmB,CAAC,CAAC,EAAE,GAAG;CACjC,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,0BAA0B,CAAE,CAAC,EAAE,GAAG,EAAE;CAC3C,CAAC"}
1
+ {"version":3,"file":"IFPSBaseContentType.d.ts","sourceRoot":"","sources":["../../../../src/types/fps-returns/common/IFPSBaseContentType.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAE1M,MAAM,MAAM,0BAA0B,GAAG,GAAG,mBAAmB,GAAG,CAAC;AACnE,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,GAAG,0BAA0B,CAAC;AAEvF,MAAM,MAAM,eAAe,GAAG;KAC3B,CAAC,IAAI,mBAAmB,CAAC,CAAC,EAAE,GAAG;CACjC,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,0BAA0B,CAAE,CAAC,EAAE,GAAG,EAAE;CAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikezimm/fps-core-v7",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "description": "Library of reusable core interfaces, types and constants migrated from fps-library-v2",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",