@mikezimm/fps-core-v7 1.0.47 → 1.0.48

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 (171) hide show
  1. package/lib/banner/components/ItemPicker/functions/fetchFileList.d.ts +3 -2
  2. package/lib/banner/components/ItemPicker/functions/fetchFileList.d.ts.map +1 -1
  3. package/lib/banner/components/ItemPicker/functions/fetchFileList.js +11 -13
  4. package/lib/banner/components/ItemPicker/functions/fetchFileList.js.map +1 -1
  5. package/lib/banner/components/ItemPicker/functions/fetchFileListUniqueIds.d.ts +3 -9
  6. package/lib/banner/components/ItemPicker/functions/fetchFileListUniqueIds.d.ts.map +1 -1
  7. package/lib/banner/components/ItemPicker/functions/fetchFileListUniqueIds.js +2 -2
  8. package/lib/banner/components/ItemPicker/functions/fetchFileListUniqueIds.js.map +1 -1
  9. package/lib/banner/components/ItemPicker/functions/fetchListList.d.ts +4 -3
  10. package/lib/banner/components/ItemPicker/functions/fetchListList.d.ts.map +1 -1
  11. package/lib/banner/components/ItemPicker/functions/fetchListList.js +13 -14
  12. package/lib/banner/components/ItemPicker/functions/fetchListList.js.map +1 -1
  13. package/lib/banner/features/FPSDOM/IFPSDigestValues.d.ts +2 -0
  14. package/lib/banner/features/FPSDOM/IFPSDigestValues.d.ts.map +1 -1
  15. package/lib/banner/mainReact/IWebpartBannerProps.d.ts +2 -0
  16. package/lib/banner/mainReact/IWebpartBannerProps.d.ts.map +1 -1
  17. package/lib/components/atoms/easy-analytics/functions/createAnalyticsSourceProps.d.ts +2 -1
  18. package/lib/components/atoms/easy-analytics/functions/createAnalyticsSourceProps.d.ts.map +1 -1
  19. package/lib/components/atoms/easy-analytics/functions/createAnalyticsSourceProps.js +2 -1
  20. package/lib/components/atoms/easy-analytics/functions/createAnalyticsSourceProps.js.map +1 -1
  21. package/lib/components/molecules/SpHttp/{doSpJsBatchFetch.d.ts → Js/doSpJsBatchFetch.d.ts} +1 -1
  22. package/lib/components/molecules/SpHttp/Js/doSpJsBatchFetch.d.ts.map +1 -0
  23. package/lib/components/molecules/SpHttp/{doSpJsBatchFetch.js → Js/doSpJsBatchFetch.js} +6 -6
  24. package/lib/components/molecules/SpHttp/Js/doSpJsBatchFetch.js.map +1 -0
  25. package/lib/components/molecules/SpHttp/Js/doSpJsFetch copy.d.ts.map +1 -0
  26. package/lib/components/molecules/SpHttp/Js/doSpJsFetch copy.js.map +1 -0
  27. package/lib/components/molecules/SpHttp/{doSpJsFetch.d.ts → Js/doSpJsFetch.d.ts} +3 -3
  28. package/lib/components/molecules/SpHttp/Js/doSpJsFetch.d.ts.map +1 -0
  29. package/lib/components/molecules/SpHttp/{doSpJsFetch.js → Js/doSpJsFetch.js} +19 -17
  30. package/lib/components/molecules/SpHttp/Js/doSpJsFetch.js.map +1 -0
  31. package/lib/components/molecules/SpHttp/{doSpJsFileFetch.d.ts → Js/doSpJsFileFetch.d.ts} +1 -1
  32. package/lib/components/molecules/SpHttp/Js/doSpJsFileFetch.d.ts.map +1 -0
  33. package/lib/components/molecules/SpHttp/{doSpJsFileFetch.js → Js/doSpJsFileFetch.js} +11 -11
  34. package/lib/components/molecules/SpHttp/Js/doSpJsFileFetch.js.map +1 -0
  35. package/lib/components/molecules/SpHttp/Sp/IFpsSpHttpServiceMIN.d.ts +53 -0
  36. package/lib/components/molecules/SpHttp/Sp/IFpsSpHttpServiceMIN.d.ts.map +1 -0
  37. package/lib/components/molecules/SpHttp/Sp/IFpsSpHttpServiceMIN.js +2 -0
  38. package/lib/components/molecules/SpHttp/Sp/IFpsSpHttpServiceMIN.js.map +1 -0
  39. package/lib/components/molecules/SpHttp/Sp/doSpHttpFetch.d.ts +68 -0
  40. package/lib/components/molecules/SpHttp/Sp/doSpHttpFetch.d.ts.map +1 -0
  41. package/lib/components/molecules/SpHttp/Sp/doSpHttpFetch.js +339 -0
  42. package/lib/components/molecules/SpHttp/Sp/doSpHttpFetch.js.map +1 -0
  43. package/lib/components/molecules/SpHttp/Sp/doSpHttpFileFetch.d.ts +25 -0
  44. package/lib/components/molecules/SpHttp/Sp/doSpHttpFileFetch.d.ts.map +1 -0
  45. package/lib/components/molecules/SpHttp/Sp/doSpHttpFileFetch.js +93 -0
  46. package/lib/components/molecules/SpHttp/Sp/doSpHttpFileFetch.js.map +1 -0
  47. package/lib/components/molecules/SpHttp/SpFetchCommon.d.ts +2 -1
  48. package/lib/components/molecules/SpHttp/SpFetchCommon.d.ts.map +1 -1
  49. package/lib/components/molecules/SpHttp/SpFetchCommon.js +7 -4
  50. package/lib/components/molecules/SpHttp/SpFetchCommon.js.map +1 -1
  51. package/lib/components/molecules/SpHttp/helpers/getCurrentFPSDigest.d.ts.map +1 -1
  52. package/lib/components/molecules/SpHttp/helpers/getCurrentFPSDigest.js +2 -1
  53. package/lib/components/molecules/SpHttp/helpers/getCurrentFPSDigest.js.map +1 -1
  54. package/lib/components/molecules/SpHttp/interfaces/IFPSSearchAPIResultsData.d.ts +1 -1
  55. package/lib/components/molecules/process-results/CheckAnyResults.d.ts +2 -1
  56. package/lib/components/molecules/process-results/CheckAnyResults.d.ts.map +1 -1
  57. package/lib/components/molecules/process-results/CheckAnyResults.js +2 -2
  58. package/lib/components/molecules/process-results/CheckAnyResults.js.map +1 -1
  59. package/lib/components/molecules/process-results/CheckItemsResults.d.ts +2 -1
  60. package/lib/components/molecules/process-results/CheckItemsResults.d.ts.map +1 -1
  61. package/lib/components/molecules/process-results/CheckItemsResults.js +2 -2
  62. package/lib/components/molecules/process-results/CheckItemsResults.js.map +1 -1
  63. package/lib/components/molecules/process-results/CheckItemsResultsWDigest.d.ts +3 -0
  64. package/lib/components/molecules/process-results/CheckItemsResultsWDigest.d.ts.map +1 -0
  65. package/lib/components/molecules/process-results/CheckItemsResultsWDigest.js +48 -0
  66. package/lib/components/molecules/process-results/CheckItemsResultsWDigest.js.map +1 -0
  67. package/lib/components/molecules/process-results/IFpsItemsReturn.d.ts +2 -0
  68. package/lib/components/molecules/process-results/IFpsItemsReturn.d.ts.map +1 -1
  69. package/lib/components/molecules/source-props/IMinSourceFetchProps.d.ts +2 -0
  70. package/lib/components/molecules/source-props/IMinSourceFetchProps.d.ts.map +1 -1
  71. package/lib/components/molecules/source-props/ISourceProps.d.ts +2 -0
  72. package/lib/components/molecules/source-props/ISourceProps.d.ts.map +1 -1
  73. package/lib/components/molecules/source-props/ISourceProps.js.map +1 -1
  74. package/lib/components/molecules/source-props/Lists/createListSource.d.ts +6 -2
  75. package/lib/components/molecules/source-props/Lists/createListSource.d.ts.map +1 -1
  76. package/lib/components/molecules/source-props/Lists/createListSource.js +8 -3
  77. package/lib/components/molecules/source-props/Lists/createListSource.js.map +1 -1
  78. package/lib/components/molecules/source-props/SitePages/NewsLinksSource.d.ts +3 -0
  79. package/lib/components/molecules/source-props/SitePages/NewsLinksSource.d.ts.map +1 -1
  80. package/lib/components/molecules/source-props/SitePages/NewsLinksSource.js +4 -0
  81. package/lib/components/molecules/source-props/SitePages/NewsLinksSource.js.map +1 -1
  82. package/lib/components/molecules/source-props/SitePages/NewsSource.d.ts +3 -0
  83. package/lib/components/molecules/source-props/SitePages/NewsSource.d.ts.map +1 -1
  84. package/lib/components/molecules/source-props/SitePages/NewsSource.js +4 -0
  85. package/lib/components/molecules/source-props/SitePages/NewsSource.js.map +1 -1
  86. package/lib/components/molecules/source-props/SitePages/SitePagesSource.d.ts +3 -0
  87. package/lib/components/molecules/source-props/SitePages/SitePagesSource.d.ts.map +1 -1
  88. package/lib/components/molecules/source-props/SitePages/SitePagesSource.js +4 -0
  89. package/lib/components/molecules/source-props/SitePages/SitePagesSource.js.map +1 -1
  90. package/lib/components/molecules/source-props/createGroupsSource.d.ts +3 -2
  91. package/lib/components/molecules/source-props/createGroupsSource.d.ts.map +1 -1
  92. package/lib/components/molecules/source-props/createGroupsSource.js +4 -3
  93. package/lib/components/molecules/source-props/createGroupsSource.js.map +1 -1
  94. package/lib/components/molecules/source-props/createLibrarySource.d.ts +3 -2
  95. package/lib/components/molecules/source-props/createLibrarySource.d.ts.map +1 -1
  96. package/lib/components/molecules/source-props/createLibrarySource.js +5 -3
  97. package/lib/components/molecules/source-props/createLibrarySource.js.map +1 -1
  98. package/lib/components/molecules/state-source/IStateSource.d.ts.map +1 -1
  99. package/lib/components/molecules/state-source/IStateSource.js +1 -0
  100. package/lib/components/molecules/state-source/IStateSource.js.map +1 -1
  101. package/lib/components/webparts/PalettePal/functions/ReactComponent.d.ts +2 -1
  102. package/lib/components/webparts/PalettePal/functions/ReactComponent.d.ts.map +1 -1
  103. package/lib/components/webparts/PalettePal/functions/ReactComponent.js +3 -3
  104. package/lib/components/webparts/PalettePal/functions/ReactComponent.js.map +1 -1
  105. package/lib/logic/Errors/friendly.d.ts.map +1 -1
  106. package/lib/logic/Errors/friendly.js +7 -1
  107. package/lib/logic/Errors/friendly.js.map +1 -1
  108. package/lib/restAPIs/lists/files/getFileEmbedUrl.d.ts +2 -0
  109. package/lib/restAPIs/lists/files/getFileEmbedUrl.d.ts.map +1 -1
  110. package/lib/restAPIs/lists/files/getFileEmbedUrl.js +3 -3
  111. package/lib/restAPIs/lists/files/getFileEmbedUrl.js.map +1 -1
  112. package/lib/restAPIs/lists/files/postSourceFilesAPI.d.ts.map +1 -1
  113. package/lib/restAPIs/lists/files/postSourceFilesAPI.js +4 -5
  114. package/lib/restAPIs/lists/files/postSourceFilesAPI.js.map +1 -1
  115. package/lib/restAPIs/lists/items/getOnlySharedItems.d.ts +2 -1
  116. package/lib/restAPIs/lists/items/getOnlySharedItems.d.ts.map +1 -1
  117. package/lib/restAPIs/lists/items/getOnlySharedItems.js +2 -1
  118. package/lib/restAPIs/lists/items/getOnlySharedItems.js.map +1 -1
  119. package/lib/restAPIs/lists/items/getSourceItemsAPI.js +4 -5
  120. package/lib/restAPIs/lists/items/getSourceItemsAPI.js.map +1 -1
  121. package/lib/restAPIs/lists/items/postSourceItemsAPI.js +2 -2
  122. package/lib/restAPIs/lists/items/postSourceItemsAPI.js.map +1 -1
  123. package/lib/restAPIs/lists/items/updateAnyItemAPI.js +2 -2
  124. package/lib/restAPIs/lists/items/updateAnyItemAPI.js.map +1 -1
  125. package/lib/restAPIs/lists/items/updateCommandItemAPI.d.ts +4 -2
  126. package/lib/restAPIs/lists/items/updateCommandItemAPI.d.ts.map +1 -1
  127. package/lib/restAPIs/lists/items/updateCommandItemAPI.js +9 -9
  128. package/lib/restAPIs/lists/items/updateCommandItemAPI.js.map +1 -1
  129. package/lib/restAPIs/lists/lists/getSourceListsAPI.d.ts.map +1 -1
  130. package/lib/restAPIs/lists/lists/getSourceListsAPI.js +2 -2
  131. package/lib/restAPIs/lists/lists/getSourceListsAPI.js.map +1 -1
  132. package/lib/restAPIs/logging/saveErrorToLog.d.ts +2 -1
  133. package/lib/restAPIs/logging/saveErrorToLog.d.ts.map +1 -1
  134. package/lib/restAPIs/logging/saveErrorToLog.js +5 -6
  135. package/lib/restAPIs/logging/saveErrorToLog.js.map +1 -1
  136. package/lib/restAPIs/logging/saveErrorToLogWDigest.d.ts +10 -0
  137. package/lib/restAPIs/logging/saveErrorToLogWDigest.d.ts.map +1 -0
  138. package/lib/restAPIs/logging/saveErrorToLogWDigest.js +57 -0
  139. package/lib/restAPIs/logging/saveErrorToLogWDigest.js.map +1 -0
  140. package/lib/restAPIs/sites/groups/getGroupMembersAPI.js +3 -3
  141. package/lib/restAPIs/sites/groups/getGroupMembersAPI.js.map +1 -1
  142. package/lib/restAPIs/sites/groups/getWebAssociatedGroupAPI.js +2 -2
  143. package/lib/restAPIs/sites/groups/getWebAssociatedGroupAPI.js.map +1 -1
  144. package/lib/restAPIs/sites/groups/getWebGroupInfoAPI.d.ts +1 -1
  145. package/lib/restAPIs/sites/groups/getWebGroupInfoAPI.d.ts.map +1 -1
  146. package/lib/restAPIs/sites/groups/getWebGroupInfoAPI.js +5 -6
  147. package/lib/restAPIs/sites/groups/getWebGroupInfoAPI.js.map +1 -1
  148. package/lib/restAPIs/sites/groups/getWebGroupInfoBatchAPI.d.ts.map +1 -1
  149. package/lib/restAPIs/sites/groups/getWebGroupInfoBatchAPI.js +3 -4
  150. package/lib/restAPIs/sites/groups/getWebGroupInfoBatchAPI.js.map +1 -1
  151. package/lib/restAPIs/sites/sites/getSiteAPI.d.ts.map +1 -1
  152. package/lib/restAPIs/sites/sites/getSiteAPI.js +6 -6
  153. package/lib/restAPIs/sites/sites/getSiteAPI.js.map +1 -1
  154. package/lib/restAPIs/sites/users/getSiteUsersAPI.js +2 -2
  155. package/lib/restAPIs/sites/users/getSiteUsersAPI.js.map +1 -1
  156. package/lib/restAPIs/sites/users/getSiteUsersBatchAPI.d.ts.map +1 -1
  157. package/lib/restAPIs/sites/users/getSiteUsersBatchAPI.js +2 -3
  158. package/lib/restAPIs/sites/users/getSiteUsersBatchAPI.js.map +1 -1
  159. package/lib/types/fps-returns/common/IFPSBaseContentType.d.ts +1 -1
  160. package/lib/types/fps-returns/common/IFPSBaseContentType.d.ts.map +1 -1
  161. package/package.json +1 -1
  162. package/lib/components/molecules/SpHttp/doSpJsBatchFetch.d.ts.map +0 -1
  163. package/lib/components/molecules/SpHttp/doSpJsBatchFetch.js.map +0 -1
  164. package/lib/components/molecules/SpHttp/doSpJsFetch copy.d.ts.map +0 -1
  165. package/lib/components/molecules/SpHttp/doSpJsFetch copy.js.map +0 -1
  166. package/lib/components/molecules/SpHttp/doSpJsFetch.d.ts.map +0 -1
  167. package/lib/components/molecules/SpHttp/doSpJsFetch.js.map +0 -1
  168. package/lib/components/molecules/SpHttp/doSpJsFileFetch.d.ts.map +0 -1
  169. package/lib/components/molecules/SpHttp/doSpJsFileFetch.js.map +0 -1
  170. /package/lib/components/molecules/SpHttp/{doSpJsFetch copy.d.ts → Js/doSpJsFetch copy.d.ts} +0 -0
  171. /package/lib/components/molecules/SpHttp/{doSpJsFetch copy.js → Js/doSpJsFetch copy.js} +0 -0
@@ -2,16 +2,16 @@
2
2
  * 2024-09-15: Migrated to SAME FOLDER in fps-library-v2\src\components\molecules\SpHttp...
3
3
  * export { IJSFetchReturn, createEmptyFetchReturn, doSpJsFetch }
4
4
  */
5
- import { check4This } from "../../../logic/Links/CheckSearch";
6
- import { checkDeepProperty } from "../../../logic/Objects/deep";
7
- import { makeAbsoluteUrl } from "../../../logic/Strings/getSiteCollectionUrlFromLink";
8
- import { getSiteCollectionUrlFromLink } from "../../../logic/Strings/getSiteCollectionUrlFromLink";
9
- import { saveErrorToLog } from "../../../restAPIs/logging/saveErrorToLog";
10
- import { CurrentHostName } from "../source-props/WindowLocationConstants";
5
+ import { check4This } from "../../../../logic/Links/CheckSearch";
6
+ import { checkDeepProperty } from "../../../../logic/Objects/deep";
7
+ import { makeAbsoluteUrl } from "../../../../logic/Strings/getSiteCollectionUrlFromLink";
8
+ import { getSiteCollectionUrlFromLink } from "../../../../logic/Strings/getSiteCollectionUrlFromLink";
9
+ import { saveErrorToLogWDigest } from "../../../../restAPIs/logging/saveErrorToLogWDigest";
10
+ import { CurrentHostName } from "../../source-props/WindowLocationConstants";
11
11
  // import { CurrentHostName } from "../../../logic/Strings/getSiteCollectionUrlFromLink";
12
- import { check4ThisFPSDigestValue } from "./helpers/check4ThisFPSDigestValue";
13
- import { createEmptyFetchReturn } from "./IJSFetchReturn";
14
- import { addCatchResponseError, addUnknownFetchError } from "./SpFetchCommon";
12
+ import { check4ThisFPSDigestValue } from "../helpers/check4ThisFPSDigestValue";
13
+ import { createEmptyFetchReturn } from "../IJSFetchReturn";
14
+ import { addCatchResponseError, addUnknownFetchError } from "../SpFetchCommon";
15
15
  /**
16
16
  * 2024-12-10: This does NOT have 429 retry yet.
17
17
  * See doSpJsFetch for an example of how to handle that
@@ -88,14 +88,14 @@ export async function doSpJsFileFetchOrPost(fetchAPI, method = `GET`, digestValu
88
88
  console.log(`fps-core-v7 Success: doSpJsFileFetchOrPost ~ 86 results`, results);
89
89
  }
90
90
  else {
91
- results = await addCatchResponseError(results, response, digestValue);
91
+ results = await addCatchResponseError(results, response, null);
92
92
  }
93
93
  return results;
94
94
  }
95
95
  catch (e) {
96
96
  results = addUnknownFetchError(results, e);
97
97
  // 2024-12-09: Copied this over from updateCommandItems so it will always capture the errors somewhere
98
- saveErrorToLog(results.errorInfo, results.errorInput);
98
+ saveErrorToLogWDigest(results.errorInfo, results.errorInput);
99
99
  return results;
100
100
  }
101
101
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doSpJsFileFetch.js","sourceRoot":"","sources":["../../../../../src/components/molecules/SpHttp/Js/doSpJsFileFetch.ts"],"names":[],"mappings":"AACA;;;GAGG;AAYH,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,yFAAyF;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAkB,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE/E;;;;;;;;;GASG;AAEH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,WAAmB,EAAE,iBAAyB,EAAE,IAAU;IAChH,MAAM,OAAO,GAAmB,MAAM,qBAAqB,CAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,IAAI,CAAE,CAAC;IACrH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAE,QAAgB,EAAE,SAAyB,KAAK,EAAE,WAAmB,EAAE,iBAAyB,EAAE,IAAU;IAEvJ,gEAAgE;IAChE,I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,CAAC;KAEhB;AAEH,CAAC"}
@@ -0,0 +1,53 @@
1
+ export interface IFpsSpHttpServiceMIN {
2
+ /**
3
+ * Fetches data from the specified SharePoint site collection.
4
+ * @param siteKey - A unique key representing the SharePoint site collection.
5
+ * @param apiEndpoint - The REST API endpoint to query.
6
+ * @param options - The options for the fetch request (method, headers, body).
7
+ * @returns A Promise containing the response data.
8
+ */
9
+ fpsFetch(apiEndpoint: string, options: RequestInit): Promise<any>;
10
+ }
11
+ export interface ISharePointService {
12
+ /**
13
+ * Fetches data from the specified SharePoint site collection.
14
+ * @param siteKey - A unique key representing the SharePoint site collection.
15
+ * @param apiEndpoint - The REST API endpoint to query.
16
+ * @param options - The options for the fetch request (method, headers, body).
17
+ * @returns A Promise containing the response data.
18
+ */
19
+ fetchWithToken(siteKey: string, apiEndpoint: string, options: RequestInit): Promise<any>;
20
+ /**
21
+ * Creates a new item in a SharePoint list.
22
+ * @param siteKey - The key representing the site collection.
23
+ * @param listTitle - The title of the SharePoint list.
24
+ * @param itemData - The data of the item to create (in JSON format).
25
+ * @returns A Promise containing the response data.
26
+ */
27
+ createListItem(siteKey: string, listTitle: string, itemData: any): Promise<any>;
28
+ /**
29
+ * Updates an existing item in a SharePoint list.
30
+ * @param siteKey - The key representing the site collection.
31
+ * @param listTitle - The title of the SharePoint list.
32
+ * @param itemId - The ID of the item to update.
33
+ * @param itemData - The updated data of the item (in JSON format).
34
+ * @returns A Promise containing the response data.
35
+ */
36
+ updateListItem(siteKey: string, listTitle: string, itemId: number, itemData: any): Promise<any>;
37
+ /**
38
+ * Deletes an item from a SharePoint list.
39
+ * @param siteKey - The key representing the site collection.
40
+ * @param listTitle - The title of the SharePoint list.
41
+ * @param itemId - The ID of the item to delete.
42
+ * @returns A Promise containing the response data.
43
+ */
44
+ deleteListItem(siteKey: string, listTitle: string, itemId: number): Promise<any>;
45
+ /**
46
+ * Gets list items from a SharePoint list.
47
+ * @param siteKey - The key representing the site collection.
48
+ * @param listTitle - The title of the SharePoint list.
49
+ * @returns A Promise containing the list items.
50
+ */
51
+ getListItems(siteKey: string, listTitle: string): Promise<any>;
52
+ }
53
+ //# sourceMappingURL=IFpsSpHttpServiceMIN.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IFpsSpHttpServiceMIN.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/SpHttp/Sp/IFpsSpHttpServiceMIN.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IAEJ,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAClE;AAGD,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEzF;;;;;;OAMG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEhF;;;;;;;OAOG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEhG;;;;;;OAMG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEjF;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAChE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IFpsSpHttpServiceMIN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IFpsSpHttpServiceMIN.js","sourceRoot":"","sources":["../../../../../src/components/molecules/SpHttp/Sp/IFpsSpHttpServiceMIN.ts"],"names":[],"mappings":""}
@@ -0,0 +1,68 @@
1
+ import { IFPSBaseContentTypesAll } from '../../../../types/fps-returns/common/IFPSBaseContentType';
2
+ import { IFpsItemsReturn } from '../../process-results/IFpsItemsReturn';
3
+ import { IJSFetchMethodNoPUT, IJSFetchReturn } from '../IJSFetchReturn';
4
+ import { IFpsSpHttpServiceMIN } from './IFpsSpHttpServiceMIN';
5
+ /**
6
+ *
7
+ * Pass in any SharePoint rest api url and it should return a result or a standard error return object
8
+ * 2024-12-09: changed from accepting headerContentType to headers.
9
+ * old default was: 'Content-Type': headerContentType ? headerContentType : 'application/json;odata=verbose',
10
+ * ALSO, NEED TO add requestDigest into customHeaders like this:
11
+ * headers[ 'X-RequestDigest' ] = digestValue
12
+ *
13
+ * for Updates:
14
+ * Use 'MERGE' for updating items
15
+ *
16
+ * customHeaders: HeadersInit update
17
+ *
18
+ *
19
+ * TOP THINGS TO Look for debugging
20
+ * 1. __metadata: for ALL SAVE ITEMS
21
+ * 2. null for body if there is no body
22
+ *
23
+ *
24
+ * @param fetchAPI
25
+ * @returns
26
+ */
27
+ export declare function doSpHttpFetchOrPost(fetchAPI: string, fpsSpService: IFpsSpHttpServiceMIN, method: IJSFetchMethodNoPUT, customHeaders: HeadersInit, body: any, retryCount?: number, delayTime?: number): Promise<IJSFetchReturn>;
28
+ /**
29
+ * doSpHttpFetchOrPostAndCheck does: the fetch, checkItemsResults, adds fpsContentTypes and performance
30
+ *
31
+ * Use 'MERGE' for updating items
32
+ *
33
+ * Steps to use this vs the No Check:
34
+ * 1. Update call
35
+ const result: IFpsUsersReturn = await doSpHttpFetchOrPostAndCheck( fetchAPI, 'GET', digestValue, '', false, true, null ) as unknown as IFpsUsersReturn;
36
+ *
37
+ * 4. re-assign performance object, update label
38
+ result.unifiedPerformanceOps.fetch.label = 'GroupName';
39
+ initialResult.fetchOp = initialResult.unifiedPerformanceOps.fetch;
40
+ *
41
+ * Things to remove from the older version calls
42
+ * const performanceSettings: IPerformanceSettings = { label: 'FetchCheck', includeMsStr: true, updateMiliseconds: true, op: 'fetch' };
43
+ * const fetchOp = performanceSettings ? startPerformOpV2( performanceSettings ) : null;
44
+
45
+
46
+ * DONE HERE based on 'type' property: move results to the object you want
47
+ result.users = result.items ? result.items : [];
48
+
49
+ DONE HERE based on 'type' property: update fpsContentType
50
+ result.fpsContentType = [ 'user' ];
51
+
52
+ * initialResult.unifiedPerformanceOps.fetch = performanceSettings ?
53
+ updatePerformanceEndV2( { op: fetchOp as IPerformanceOp, updateMiliseconds: performanceSettings.updateMiliseconds, count: initialResult.items ? initialResult.items.length : 0 })
54
+ : null as any; // 2024-09-29: set null as any to pass build error
55
+ *
56
+ *
57
+ * @param fetchAPI
58
+ * @param method
59
+ * @param digestValue
60
+ * @param headerContentType
61
+ * @param type
62
+ * @param alertMe
63
+ * @param consoleLog
64
+ * @param body
65
+ * @returns
66
+ */
67
+ export declare function doSpHttpFetchOrPostAndCheck(fetchAPI: string, method: IJSFetchMethodNoPUT, fpsSpService: IFpsSpHttpServiceMIN, headerContentType: string, alertMe: boolean | undefined, consoleLog: boolean | undefined, type: IFPSBaseContentTypesAll, body: any): Promise<IFpsItemsReturn>;
68
+ //# sourceMappingURL=doSpHttpFetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doSpHttpFetch.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/SpHttp/Sp/doSpHttpFetch.ts"],"names":[],"mappings":"AAUA,OAAO,EAAuB,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AAKxH,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAA0B,MAAM,mBAAmB,CAAC;AAkBhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAW9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,oBAAoB,EAClC,MAAM,EAAE,mBAAmB,EAC3B,aAAa,EAAE,WAAW,EAC1B,IAAI,EAAE,GAAG,EACT,UAAU,GAAE,MAAU,EACtB,SAAS,GAAE,MAAa,GACvB,OAAO,CAAC,cAAc,CAAC,CAyNzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,wBAAsB,2BAA2B,CAC/C,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAE7C,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,EAC7D,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,EAC7D,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,GAAG,GACvC,OAAO,CAAC,eAAe,CAAC,CA4C1B"}
@@ -0,0 +1,339 @@
1
+ import { check4This } from '../../../../logic/Links/CheckSearch';
2
+ import { checkDeepProperty } from '../../../../logic/Objects/deep';
3
+ import { makeAbsoluteUrl } from '../../../../logic/Strings/getSiteCollectionUrlFromLink';
4
+ import { saveErrorToLog } from '../../../../restAPIs/logging/saveErrorToLog';
5
+ import { startPerformOpV2, updatePerformanceEndV2 } from '../../Performance/functions';
6
+ import { checkItemsResults } from '../../process-results/CheckItemsResults';
7
+ import { copyHeadersToReturns, createMinHeaders } from '../headerInitUtilities';
8
+ import { createEmptyFetchReturn } from '../IJSFetchReturn';
9
+ import { addCatchResponseError, addUnknownFetchError } from '../SpFetchCommon';
10
+ // export async function doSpJsFetch(fetchAPI: string, digestValue: string, headerContentType: string, ): Promise<IJSFetchReturn> {
11
+ // const headers: HeadersInit = createMinHeaders( digestValue, headerContentType );
12
+ // const results: IJSFetchReturn = await doSpHttpFetchOrPost( fetchAPI, 'GET', headers, null );
13
+ // return results;
14
+ // }
15
+ // Helper function to introduce a delay
16
+ const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
17
+ /**
18
+ *
19
+ * Pass in any SharePoint rest api url and it should return a result or a standard error return object
20
+ * 2024-12-09: changed from accepting headerContentType to headers.
21
+ * old default was: 'Content-Type': headerContentType ? headerContentType : 'application/json;odata=verbose',
22
+ * ALSO, NEED TO add requestDigest into customHeaders like this:
23
+ * headers[ 'X-RequestDigest' ] = digestValue
24
+ *
25
+ * for Updates:
26
+ * Use 'MERGE' for updating items
27
+ *
28
+ * customHeaders: HeadersInit update
29
+ *
30
+ *
31
+ * TOP THINGS TO Look for debugging
32
+ * 1. __metadata: for ALL SAVE ITEMS
33
+ * 2. null for body if there is no body
34
+ *
35
+ *
36
+ * @param fetchAPI
37
+ * @returns
38
+ */
39
+ export async function doSpHttpFetchOrPost(fetchAPI, fpsSpService, method, customHeaders, body, retryCount = 3, delayTime = 2000) {
40
+ // Automatically added this because API's usually need full url. - NOT Needed because makeAbsoluteUrl already does this
41
+ // if ( fetchAPI.indexOf( CurrentHostName ) === 0 ) fetchAPI = `https://${fetchAPI}`;
42
+ // Always make sure this is an absolute url by running through this first. Note, if the previous line executes, it should be good then.
43
+ fetchAPI = makeAbsoluteUrl(fetchAPI);
44
+ let results = createEmptyFetchReturn(fetchAPI, method);
45
+ const headers = {
46
+ // Accept: 'application/json;odata=nometadata', // non-SpHttp call
47
+ // Accept: 'application/json;odata.metadata=none', // SpHttp nometadata or odata.metadata=full for full
48
+ Accept: 'application/json;odata.metadata=none',
49
+ 'Content-Type': 'application/json;odata=verbose',
50
+ ...customHeaders
51
+ };
52
+ // Add request digest for SharePoint operations if missing
53
+ // const siteCollectionUrl = getSiteCollectionUrlFromLink(fetchAPI);
54
+ // const digestValue = check4ThisFPSDigestValue(siteCollectionUrl);
55
+ // // Added to just check if digestValue exists and if so, use it here
56
+ // if ( digestValue && !(headers as any)[ 'X-RequestDigest' ] ) {
57
+ // (headers as Record<string, string>)['X-RequestDigest'] = digestValue;
58
+ // }
59
+ // Adjust headers for specific SharePoint operations
60
+ if (method === 'MERGE') {
61
+ headers['X-HTTP-Method'] = 'MERGE';
62
+ // Ensure overwrite behavior
63
+ headers['IF-MATCH'] = '*';
64
+ // 2024-12-09: Untested -- Moved this further down so it is used for both MERGE (update) and POST (create)
65
+ // Ensure returning the updated object in case it's needed: Accept: application/json;odata=verbose
66
+ // (headers as Record<string, string>)['Accept'] = 'application/json;odata=verbose';
67
+ method = 'POST'; // SharePoint requires POST for MERGE
68
+ }
69
+ else if (method === 'DELETE') {
70
+ headers['IF-MATCH'] = '*'; // Required for DELETE
71
+ method = 'POST'; // SharePoint requires POST for DELETE
72
+ }
73
+ if (method === 'POST') {
74
+ // Ensure returning the created object in case it's needed: Prefer: return=representation
75
+ headers['Prefer'] = 'return=representation';
76
+ // Ensure returning the updated object in case it's needed: Accept: application/json;odata=verbose
77
+ headers['Accept'] = 'application/json;odata=verbose';
78
+ }
79
+ results.headers = copyHeadersToReturns(headers);
80
+ try {
81
+ // Added these hard coded alerts to help in reducing development errors and time - aka PivotTiles Permission Save and Groups APIs
82
+ if (method === 'POST') {
83
+ if (body === null || body === undefined) {
84
+ console.log(`!!!!! doSpHttpFetchOrPost - POST without body !!!! `, fetchAPI);
85
+ }
86
+ else if (!body.__metadata) {
87
+ console.log(`!!!!! doSpHttpFetchOrPost - POST body NO __metadata !!!! `, body, fetchAPI);
88
+ }
89
+ }
90
+ /**
91
+ * Status Codes Explanation
92
+ 204 No Content: This status code means that the server successfully processed the request but is not returning any content. For example, this is common with DELETE or PUT/MERGE requests when updating an item without requesting the updated data.
93
+ 201 Created: This status code is used when an item is successfully created, and, with the Prefer: return=representation header, SharePoint will include the full response with the item details.
94
+ 200 OK: This status code may appear for updates or other operations when the Prefer header is not set to return=representation, and the response may include the updated item details.
95
+ 1. 400 Bad Request
96
+ Meaning: The request is malformed or missing required data.
97
+ Example: Invalid JSON format, missing mandatory fields, or incorrect request body.
98
+ Resolution: Double-check the request payload, headers, and any required parameters.
99
+ 2. 401 Unauthorized
100
+ Meaning: Authentication is required and has failed or not been provided.
101
+ Example: Missing or incorrect authentication tokens.
102
+ Resolution: Ensure that the request includes a valid authentication token or the correct credentials.
103
+ 3. 403 Forbidden
104
+ Meaning: The user does not have permission to perform the operation.
105
+ Example: Attempting to access a list or site for which the user does not have the required permissions.
106
+ Resolution: Verify the user's permissions and access rights to the resource.
107
+ 4. 404 Not Found
108
+ Meaning: The requested resource (e.g., a list or item) was not found.
109
+ Example: Trying to access a non-existent SharePoint list or item.
110
+ Resolution: Check the URL and ensure the resource exists.
111
+ 5. 409 Conflict
112
+ Meaning: There is a conflict with the current state of the resource.
113
+ Example: Trying to create an item with a duplicate value that violates unique constraints.
114
+ Resolution: Verify the request data to avoid conflicts (e.g., ensure unique values where required).
115
+ 6. 412 Precondition Failed
116
+ Meaning: A condition specified in the If-Match or If-None-Match header was not met.
117
+ Example: Trying to update an item using If-Match with an ETag that does not match the current value.
118
+ Resolution: Ensure that the If-Match or If-None-Match header matches the current ETag of the item.
119
+ 7. 415 Unsupported Media Type
120
+ Meaning: The server does not support the media type of the request payload.
121
+ Example: Sending a request body with an unsupported Content-Type header.
122
+ Resolution: Ensure the Content-Type header matches the format (e.g., application/json for JSON payloads).
123
+ 8. 429 Too Many Requests
124
+ Meaning: The user has sent too many requests in a given amount of time.
125
+ Example: Exceeding the SharePoint Online API rate limits.
126
+ Resolution: Implement retry logic and respect rate limits. Review Microsoft's API throttling documentation for details.
127
+ 9. 500 Internal Server Error
128
+ Meaning: An error occurred on the server while processing the request.
129
+ Example: Server-side issues or unexpected failures.
130
+ Resolution: Retry the request after a short delay or check for known outages or service issues.
131
+ 10. 503 Service Unavailable
132
+ Meaning: The server is currently unable to handle the request due to temporary overloading or maintenance.
133
+ Example: SharePoint Online service issues or server maintenance.
134
+ Resolution: Retry after some time or check the Microsoft 365 Service Health Dashboard for updates.
135
+
136
+ Common HTTP Headers for Handling Responses
137
+ Retry-After: Indicates how long to wait before making another request. This header is often seen with 429 Too Many Requests or 503 Service Unavailable.
138
+ */
139
+ const response = await fpsSpService.fpsFetch(fetchAPI, {
140
+ method: method,
141
+ headers: headers,
142
+ // Added this during testing of PivotTiles permissionsSave
143
+ body: body && body !== undefined ? JSON.stringify(body) : null,
144
+ });
145
+ // If the response status is 429, retry after a delay
146
+ if (response.status === 429 && retryCount > 0) {
147
+ console.warn(`429 Too Many Requests. Retrying in ${delayTime}ms...`);
148
+ await delay(delayTime); // Wait for the specified delay time
149
+ return doSpHttpFetchOrPost(fetchAPI, fpsSpService, method, headers, body, retryCount - 1, delayTime * 2); // Increase delay time exponentially
150
+ }
151
+ if (response.status === 204) {
152
+ /**
153
+ * 204 means there were no errors but nothing is returned...
154
+ * Some examples from ChatGPT:
155
+ * DELETE: When you delete an item or resource, a 204 status indicates that the deletion was successful, but there is no content in the response.
156
+ * PUT or MERGE: When updating an item or resource, a 204 status can indicate that the update was successful, but there is no new content to return.
157
+ * POST (with certain operations): Sometimes used for operations where the server processes the request but doesn't return any additional content.
158
+ */
159
+ console.log('Operation was successful but there is no content to return.');
160
+ results.ok = true;
161
+ results.statusText = 'No Content Recieved';
162
+ results.statusNo = response.status;
163
+ results.status = 'Success';
164
+ // check if the response is OK
165
+ }
166
+ else if (response.ok) {
167
+ const data = await response.json();
168
+ const usesSearch = fetchAPI.indexOf(`_api/search`) > -1 ? true : false;
169
+ // 2024-12-09: Refactored this code from my original commented out below.... VVVVVV
170
+ if (usesSearch) {
171
+ results.rawSearchResults = data;
172
+ const deepPropValue = checkDeepProperty(data, ['PrimaryQueryResult', 'RelevantResults', 'Table', 'Rows'], 'Actual');
173
+ if (deepPropValue) {
174
+ results.items = data.PrimaryQueryResult.RelevantResults.Table.Rows;
175
+ }
176
+ }
177
+ else if (data.value) {
178
+ results.items = data.value; // Standard SharePoint API response
179
+ }
180
+ else {
181
+ results.items = data; // Non-standard response
182
+ }
183
+ // 2024-12-09: Refactored ^^^^^^^^ from my original commented out below.... VVVVVV
184
+ // const deepPropValue = usesSearch === true ? checkDeepProperty( data, [ 'PrimaryQueryResult', 'RelevantResults', 'Table', 'Rows'], 'Actual' ) : undefined;
185
+ // // added logic to solve this: https://github.com/mikezimm/pivottiles7/issues/292
186
+ // if ( deepPropValue !== undefined && deepPropValue !== null ) {
187
+ // results.items = data.PrimaryQueryResult.RelevantResults.Table.Rows;
188
+ // } else if ( fetchAPI.indexOf('GetFolderByServerRelativeUrl') > 0 ) {
189
+ // } else {
190
+ // if ( usesSearch === true && data.ElapsedTime && !data.PrimaryQueryResult ) {
191
+ // // Seems like query did not fail, so do nothing because array of items is already [].
192
+ // // This is what happened when using fetchMySubsites and not having any subsites to return.
193
+ // } else {
194
+ // results.items = data.value ? data.value : data;
195
+ // }
196
+ // }
197
+ results.ok = true;
198
+ results.statusText = response.statusText;
199
+ results.statusNo = response.status;
200
+ results.status = 'Success';
201
+ if (check4This('fpsShowFetchResults=true') === true)
202
+ console.log(`fps-core-v7 Success: doSpHttpFetchOrPost ~ 131 results`, results);
203
+ }
204
+ else {
205
+ // Handle cases where the response isn't JSON (e.g., empty or text response)
206
+ // const text = await response.text();
207
+ // console.warn('Non-JSON response received:', text);
208
+ results = await addCatchResponseError(results, response, fpsSpService);
209
+ // 2024-12-09: Copied this over from updateCommandItems so it will always capture the errors somewhere
210
+ // eslint-disable-next-line no-void
211
+ void saveErrorToLog(results.errorInfo, results.errorInput, fpsSpService);
212
+ }
213
+ return results;
214
+ }
215
+ catch (e) {
216
+ // Added these hard coded alerts to help in reducing development errors and time - aka PivotTiles Permission Save and Groups APIs
217
+ if (method === 'POST') {
218
+ if (body === null || body === undefined) {
219
+ alert(`!!!!! doSpHttpFetchOrPost - POST without body !!!!<br/>${fetchAPI}`);
220
+ }
221
+ else if (!body.__metadata) {
222
+ alert(`!!!!! doSpHttpFetchOrPost - POST body NO __metadata !!!!<br/>${fetchAPI}`);
223
+ }
224
+ }
225
+ return addUnknownFetchError(results, e);
226
+ }
227
+ }
228
+ /**
229
+ * doSpHttpFetchOrPostAndCheck does: the fetch, checkItemsResults, adds fpsContentTypes and performance
230
+ *
231
+ * Use 'MERGE' for updating items
232
+ *
233
+ * Steps to use this vs the No Check:
234
+ * 1. Update call
235
+ const result: IFpsUsersReturn = await doSpHttpFetchOrPostAndCheck( fetchAPI, 'GET', digestValue, '', false, true, null ) as unknown as IFpsUsersReturn;
236
+ *
237
+ * 4. re-assign performance object, update label
238
+ result.unifiedPerformanceOps.fetch.label = 'GroupName';
239
+ initialResult.fetchOp = initialResult.unifiedPerformanceOps.fetch;
240
+ *
241
+ * Things to remove from the older version calls
242
+ * const performanceSettings: IPerformanceSettings = { label: 'FetchCheck', includeMsStr: true, updateMiliseconds: true, op: 'fetch' };
243
+ * const fetchOp = performanceSettings ? startPerformOpV2( performanceSettings ) : null;
244
+
245
+
246
+ * DONE HERE based on 'type' property: move results to the object you want
247
+ result.users = result.items ? result.items : [];
248
+
249
+ DONE HERE based on 'type' property: update fpsContentType
250
+ result.fpsContentType = [ 'user' ];
251
+
252
+ * initialResult.unifiedPerformanceOps.fetch = performanceSettings ?
253
+ updatePerformanceEndV2( { op: fetchOp as IPerformanceOp, updateMiliseconds: performanceSettings.updateMiliseconds, count: initialResult.items ? initialResult.items.length : 0 })
254
+ : null as any; // 2024-09-29: set null as any to pass build error
255
+ *
256
+ *
257
+ * @param fetchAPI
258
+ * @param method
259
+ * @param digestValue
260
+ * @param headerContentType
261
+ * @param type
262
+ * @param alertMe
263
+ * @param consoleLog
264
+ * @param body
265
+ * @returns
266
+ */
267
+ export async function doSpHttpFetchOrPostAndCheck(fetchAPI, method,
268
+ // digestValue: string, headerContentType: string,
269
+ fpsSpService, headerContentType, alertMe, consoleLog, type, body) {
270
+ const performanceSettings = { label: 'FetchCheck', includeMsStr: true, updateMiliseconds: true, op: 'fetch' };
271
+ const fetchOp = performanceSettings ? startPerformOpV2(performanceSettings) : null;
272
+ const headers = createMinHeaders('', headerContentType);
273
+ let initialResult = await doSpHttpFetchOrPost(fetchAPI, fpsSpService, method, headers, body);
274
+ initialResult.fetchAPI = fetchAPI;
275
+ initialResult.method = method;
276
+ initialResult = checkItemsResults(fpsSpService, initialResult, `fps-core-v7: doSpHttpFetchOrPostAndCheck ~ 161`, alertMe, consoleLog);
277
+ // Moved outside of type so it can also be used to update the results cound in performance
278
+ const values = initialResult.item ? initialResult.item : initialResult.items ? initialResult.items : null;
279
+ const isArray = Array.isArray(values) === true ? true : false;
280
+ /**
281
+ * Added to automatically add fpsContentType based on the type, and results to the appropriate key
282
+ */
283
+ if (fetchAPI.indexOf('/RoleAssignments') > 0)
284
+ type = 'roles';
285
+ if (type) {
286
+ if (!initialResult.fpsContentType)
287
+ initialResult.fpsContentType = [];
288
+ // Need to add if it's a file because it is also an item
289
+ if (type === 'file' || type === 'files')
290
+ initialResult.fpsContentType.push('item');
291
+ // https://github.com/fps-solutions/SP-API-Tester/issues/15 - fixed the type.length -1 instead of -2
292
+ const typeNoS = type.endsWith('s') === true ? type.substring(0, type.length - 1) : type;
293
+ if (initialResult.fpsContentType.indexOf(typeNoS) < 0)
294
+ initialResult.fpsContentType.push(typeNoS);
295
+ initialResult[`${typeNoS}${isArray === true && type.endsWith('s') === true ? 's' : ''}`] = values;
296
+ }
297
+ initialResult.unifiedPerformanceOps.fetch = performanceSettings ?
298
+ updatePerformanceEndV2({ op: fetchOp, updateMiliseconds: performanceSettings.updateMiliseconds, count: isArray === true ? values.length : values ? 1 : 0 })
299
+ : null; // 2024-09-29: set null as any to pass build error.
300
+ // export type IJSFetchMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'MERGE' ;
301
+ initialResult.fetchOp = initialResult.unifiedPerformanceOps.fetch;
302
+ if (method === 'POST') {
303
+ initialResult.saveOp = initialResult.unifiedPerformanceOps.fetch;
304
+ }
305
+ else if (method === 'DELETE') {
306
+ initialResult.deleteOp = initialResult.unifiedPerformanceOps.fetch;
307
+ }
308
+ else if (method === 'MERGE') {
309
+ initialResult.saveOp = initialResult.unifiedPerformanceOps.fetch;
310
+ }
311
+ return initialResult;
312
+ }
313
+ // export function checkFpsTypesResults ( type: IFPSBaseContentTypesAll,
314
+ // export async function doSpHttpFetchOrPostAndCheckTypes(
315
+ // fetchAPI: string, method: IJSFetchMethodNoPUT,
316
+ // digestValue: string, headerContentType: string,
317
+ // alertMe: boolean | undefined, consoleLog: boolean | undefined,
318
+ // type: IFPSBaseContentTypesAll, body: any ): Promise<IFpsItemsReturn> {
319
+ // const performanceSettings: IPerformanceSettings = { label: 'FetchCheck', includeMsStr: true, updateMiliseconds: true, op: 'fetch' };
320
+ // const fetchOp = performanceSettings ? startPerformOpV2( performanceSettings ) : null;
321
+ // const headers: HeadersInit = createMinHeaders( digestValue, headerContentType );
322
+ // let initialResult: IFpsItemsReturn = await doSpHttpFetchOrPost( fetchAPI, method, headers, body );
323
+ // initialResult.fetchAPI = fetchAPI;
324
+ // initialResult.method = method;
325
+ // initialResult = checkItemsResults( initialResult, `fps-core-v7: doSpHttpFetchOrPostAndCheck ~ 161`, alertMe, consoleLog );
326
+ // const values = initialResult.item ? initialResult.item : initialResult.items ? initialResult.items : null;
327
+ // const isArray: boolean = Array.isArray( values ) === true ? true : false;
328
+ // initialResult[ `${type}${ isArray === true && type.endsWith('s') === true ? 's' : '' }` as 'item' ] = values;
329
+ // initialResult.unifiedPerformanceOps.fetch = performanceSettings ?
330
+ // updatePerformanceEndV2( { op: fetchOp as IPerformanceOp, updateMiliseconds: performanceSettings.updateMiliseconds, count: initialResult.items ? initialResult.items.length : 0 })
331
+ // : null as any; // 2024-09-29: set null as any to pass build error.
332
+ // // export type IJSFetchMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'MERGE' ;
333
+ // initialResult.fetchOp = initialResult.unifiedPerformanceOps.fetch;
334
+ // if ( method === 'POST' ) { initialResult.saveOp = initialResult.unifiedPerformanceOps.fetch; }
335
+ // else if ( method === 'DELETE' ) { initialResult.deleteOp = initialResult.unifiedPerformanceOps.fetch; }
336
+ // else if ( method === 'MERGE' ) { initialResult.saveOp = initialResult.unifiedPerformanceOps.fetch; }
337
+ // return initialResult;
338
+ // }
339
+ //# sourceMappingURL=doSpHttpFetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doSpHttpFetch.js","sourceRoot":"","sources":["../../../../../src/components/molecules/SpHttp/Sp/doSpHttpFetch.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAuC,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAmB/E,mIAAmI;AACnI,qFAAqF;AACrF,iGAAiG;AACjG,oBAAoB;AACpB,IAAI;AAEJ,uCAAuC;AACvC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAoB,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,QAAgB,EAChB,YAAkC,EAClC,MAA2B,EAC3B,aAA0B,EAC1B,IAAS,EACT,aAAqB,CAAC,EACtB,YAAoB,IAAI;IAGxB,uHAAuH;IACvH,qFAAqF;IAErF,wIAAwI;IACxI,QAAQ,GAAG,eAAe,CAAE,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E;AAC9E,kHAAkH;AAElH,sEAAsE;AACtE,wLAAwL;AACxL,2EAA2E;AAE3E,kFAAkF;AAClF,uEAAuE;AACvE,mGAAmG;AACnG,4GAA4G;AAC5G,yGAAyG;AACzG,0BAA0B;AAE1B,IAAI"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 2024-09-15: Migrated to SAME FOLDER in fps-library-v2\src\components\molecules\SpHttp...
3
+ * export { IJSFetchReturn, createEmptyFetchReturn, doSpJsFetch }
4
+ */
5
+ import { IJSFetchReturn } from "../IJSFetchReturn";
6
+ import { IFpsSpHttpServiceMIN } from "./IFpsSpHttpServiceMIN";
7
+ /**
8
+ * 2024-12-10: This does NOT have 429 retry yet.
9
+ * See doSpJsFetch for an example of how to handle that
10
+ *
11
+ * @param fetchAPI
12
+ * @param digestValue - REQUIRES digestValue
13
+ * @param headerContentType
14
+ * @param blob
15
+ * @returns
16
+ */
17
+ export declare function doSpHttpFileFetch(fetchAPI: string, fpsSpService: IFpsSpHttpServiceMIN, headerContentType: string, blob: Blob): Promise<IJSFetchReturn>;
18
+ /**
19
+ * Pass in any SharePoint rest api url and it should return a result or a standard error return object
20
+ * @param fetchAPI
21
+ * @param digestValue - REQUIRES digestValue for POST operations
22
+ * @returns
23
+ */
24
+ export declare function doSpHttpFileFetchOrPost(fetchAPI: string, method: "GET" | "POST" | undefined, fpsSpService: IFpsSpHttpServiceMIN, headerContentType: string, blob: Blob): Promise<IJSFetchReturn>;
25
+ //# sourceMappingURL=doSpHttpFileFetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doSpHttpFileFetch.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/SpHttp/Sp/doSpHttpFileFetch.ts"],"names":[],"mappings":"AACA;;;GAGG;AAiBH,OAAO,EAAE,cAAc,EAA0B,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;GASG;AAEH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAI,OAAO,CAAC,cAAc,CAAC,CAG7J;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,4BAAwB,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAK,OAAO,CAAC,cAAc,CAAC,CAwErM"}