@kwiz/common 1.0.73 → 1.0.74

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 (546) hide show
  1. package/lib/cjs/_dependencies.js.map +1 -0
  2. package/lib/cjs/config.js.map +1 -0
  3. package/lib/cjs/exports-index.js.map +1 -0
  4. package/lib/cjs/helpers/Guid.js.map +1 -0
  5. package/lib/cjs/helpers/_dependencies.js.map +1 -0
  6. package/lib/cjs/helpers/base64.js.map +1 -0
  7. package/lib/cjs/helpers/browser.js.map +1 -0
  8. package/lib/cjs/helpers/browserinfo.js.map +1 -0
  9. package/{dist → lib/cjs}/helpers/collections.base.js +0 -3
  10. package/lib/cjs/helpers/collections.base.js.map +1 -0
  11. package/lib/cjs/helpers/collections.js.map +1 -0
  12. package/lib/cjs/helpers/color.js.map +1 -0
  13. package/lib/cjs/helpers/cookies.js.map +1 -0
  14. package/lib/cjs/helpers/date.js.map +1 -0
  15. package/{dist → lib/cjs}/helpers/debug.js +1 -1
  16. package/lib/cjs/helpers/debug.js.map +1 -0
  17. package/lib/cjs/helpers/emails.js.map +1 -0
  18. package/lib/cjs/helpers/eval.js.map +1 -0
  19. package/lib/cjs/helpers/exports-index.js.map +1 -0
  20. package/lib/cjs/helpers/file.js.map +1 -0
  21. package/lib/cjs/helpers/flatted.js.map +1 -0
  22. package/lib/cjs/helpers/functions.js.map +1 -0
  23. package/lib/cjs/helpers/graph/calendar.types.js.map +1 -0
  24. package/lib/cjs/helpers/graph/exports-index.js.map +1 -0
  25. package/lib/cjs/helpers/http.js.map +1 -0
  26. package/lib/cjs/helpers/images.js.map +1 -0
  27. package/lib/cjs/helpers/json.js.map +1 -0
  28. package/lib/cjs/helpers/md5.js.map +1 -0
  29. package/lib/cjs/helpers/objects.js.map +1 -0
  30. package/{dist → lib/cjs}/helpers/promises.js +8 -3
  31. package/lib/cjs/helpers/promises.js.map +1 -0
  32. package/lib/cjs/helpers/random.js.map +1 -0
  33. package/lib/cjs/helpers/scheduler/exports-index.js.map +1 -0
  34. package/lib/cjs/helpers/scheduler/scheduler.js.map +1 -0
  35. package/{dist → lib/cjs}/helpers/sharepoint.js +17 -17
  36. package/lib/cjs/helpers/sharepoint.js.map +1 -0
  37. package/lib/cjs/helpers/strings.js.map +1 -0
  38. package/lib/cjs/helpers/typecheckers.js.map +1 -0
  39. package/lib/cjs/helpers/url.js.map +1 -0
  40. package/lib/cjs/helpers/urlhelper.js.map +1 -0
  41. package/{dist → lib/cjs}/index.js +5 -2
  42. package/lib/cjs/index.js.map +1 -0
  43. package/lib/cjs/types/auth.js.map +1 -0
  44. package/lib/cjs/types/common.types.js.map +1 -0
  45. package/lib/cjs/types/exports-index.js.map +1 -0
  46. package/lib/cjs/types/flatted.types.js.map +1 -0
  47. package/lib/cjs/types/globals.types.js.map +1 -0
  48. package/lib/cjs/types/graph/calendar.types.js.map +1 -0
  49. package/lib/cjs/types/graph/exports-index.js.map +1 -0
  50. package/lib/cjs/types/knownscript.types.js.map +1 -0
  51. package/lib/cjs/types/libs/datajs.types.js.map +1 -0
  52. package/lib/cjs/types/libs/exports-index.js.map +1 -0
  53. package/lib/cjs/types/libs/ics.types.js.map +1 -0
  54. package/lib/cjs/types/libs/msal.types.js.map +1 -0
  55. package/{dist → lib/cjs}/types/locales.js.map +1 -1
  56. package/lib/cjs/types/localstoragecache.types.js.map +1 -0
  57. package/lib/cjs/types/location.types.js.map +1 -0
  58. package/{dist → lib/cjs}/types/moment.js.map +1 -1
  59. package/{dist → lib/cjs}/types/regex.types.js.map +1 -1
  60. package/lib/cjs/types/rest.types.js.map +1 -0
  61. package/lib/cjs/types/sharepoint.types.js.map +1 -0
  62. package/lib/cjs/types/sharepoint.utils.types.js.map +1 -0
  63. package/lib/cjs/utils/_dependencies.js.map +1 -0
  64. package/lib/cjs/utils/auth/common.js.map +1 -0
  65. package/{dist → lib/cjs}/utils/auth/discovery.js +16 -14
  66. package/lib/cjs/utils/auth/discovery.js.map +1 -0
  67. package/lib/cjs/utils/auth/exports-index.js.map +1 -0
  68. package/{dist → lib/cjs}/utils/base64.js +4 -3
  69. package/lib/cjs/utils/base64.js.map +1 -0
  70. package/{dist → lib/cjs}/utils/consolelogger.js +31 -26
  71. package/lib/cjs/utils/consolelogger.js.map +1 -0
  72. package/{dist → lib/cjs}/utils/date.js +3 -3
  73. package/lib/cjs/utils/date.js.map +1 -0
  74. package/{dist → lib/cjs}/utils/emails.js +2 -2
  75. package/lib/cjs/utils/emails.js.map +1 -0
  76. package/lib/cjs/utils/exports-index.js.map +1 -0
  77. package/{dist → lib/cjs}/utils/knownscript.js +9 -5
  78. package/lib/cjs/utils/knownscript.js.map +1 -0
  79. package/{dist → lib/cjs}/utils/localstoragecache.js +40 -27
  80. package/lib/cjs/utils/localstoragecache.js.map +1 -0
  81. package/{dist → lib/cjs}/utils/rest.js +63 -48
  82. package/lib/cjs/utils/rest.js.map +1 -0
  83. package/{dist → lib/cjs}/utils/script.js +15 -10
  84. package/lib/cjs/utils/script.js.map +1 -0
  85. package/lib/cjs/utils/sharepoint.rest/common.js.map +1 -0
  86. package/{dist → lib/cjs}/utils/sharepoint.rest/date.js +10 -9
  87. package/lib/cjs/utils/sharepoint.rest/date.js.map +1 -0
  88. package/lib/cjs/utils/sharepoint.rest/exports-index.js.map +1 -0
  89. package/{dist → lib/cjs}/utils/sharepoint.rest/file.folder.js +49 -46
  90. package/lib/cjs/utils/sharepoint.rest/file.folder.js.map +1 -0
  91. package/{dist → lib/cjs}/utils/sharepoint.rest/item.js +51 -45
  92. package/lib/cjs/utils/sharepoint.rest/item.js.map +1 -0
  93. package/{dist → lib/cjs}/utils/sharepoint.rest/list.js +131 -124
  94. package/lib/cjs/utils/sharepoint.rest/list.js.map +1 -0
  95. package/{dist → lib/cjs}/utils/sharepoint.rest/listutils/GetListItemsByCaml.js +55 -50
  96. package/lib/cjs/utils/sharepoint.rest/listutils/GetListItemsByCaml.js.map +1 -0
  97. package/{dist → lib/cjs}/utils/sharepoint.rest/listutils/GetListItemsById.js +31 -23
  98. package/lib/cjs/utils/sharepoint.rest/listutils/GetListItemsById.js.map +1 -0
  99. package/{dist → lib/cjs}/utils/sharepoint.rest/listutils/common.js +20 -16
  100. package/lib/cjs/utils/sharepoint.rest/listutils/common.js.map +1 -0
  101. package/lib/cjs/utils/sharepoint.rest/listutils/exports-index.js.map +1 -0
  102. package/{dist → lib/cjs}/utils/sharepoint.rest/location.js +3 -3
  103. package/lib/cjs/utils/sharepoint.rest/location.js.map +1 -0
  104. package/{dist → lib/cjs}/utils/sharepoint.rest/navigation-links.js +3 -3
  105. package/lib/cjs/utils/sharepoint.rest/navigation-links.js.map +1 -0
  106. package/{dist → lib/cjs}/utils/sharepoint.rest/user-search.js +7 -5
  107. package/lib/cjs/utils/sharepoint.rest/user-search.js.map +1 -0
  108. package/{dist → lib/cjs}/utils/sharepoint.rest/user.js +52 -47
  109. package/lib/cjs/utils/sharepoint.rest/user.js.map +1 -0
  110. package/{dist → lib/cjs}/utils/sharepoint.rest/web.js +167 -158
  111. package/lib/cjs/utils/sharepoint.rest/web.js.map +1 -0
  112. package/{dist → lib/cjs}/utils/sod.js +12 -11
  113. package/lib/cjs/utils/sod.js.map +1 -0
  114. package/lib/esm/_dependencies.js +12 -0
  115. package/lib/esm/_dependencies.js.map +1 -0
  116. package/lib/esm/config.js +12 -0
  117. package/lib/esm/config.js.map +1 -0
  118. package/lib/esm/exports-index.js +5 -0
  119. package/lib/esm/exports-index.js.map +1 -0
  120. package/lib/esm/helpers/Guid.js +179 -0
  121. package/lib/esm/helpers/Guid.js.map +1 -0
  122. package/{src/helpers/_dependencies.ts → lib/esm/helpers/_dependencies.js} +3 -3
  123. package/lib/esm/helpers/_dependencies.js.map +1 -0
  124. package/lib/esm/helpers/base64.js +157 -0
  125. package/lib/esm/helpers/base64.js.map +1 -0
  126. package/lib/esm/helpers/browser.js +1158 -0
  127. package/lib/esm/helpers/browser.js.map +1 -0
  128. package/lib/esm/helpers/browserinfo.js +206 -0
  129. package/lib/esm/helpers/browserinfo.js.map +1 -0
  130. package/lib/esm/helpers/collections.base.js +372 -0
  131. package/lib/esm/helpers/collections.base.js.map +1 -0
  132. package/lib/esm/helpers/collections.js +96 -0
  133. package/lib/esm/helpers/collections.js.map +1 -0
  134. package/lib/esm/helpers/color.js +51 -0
  135. package/lib/esm/helpers/color.js.map +1 -0
  136. package/lib/esm/helpers/cookies.js +53 -0
  137. package/lib/esm/helpers/cookies.js.map +1 -0
  138. package/lib/esm/helpers/date.js +163 -0
  139. package/lib/esm/helpers/date.js.map +1 -0
  140. package/lib/esm/helpers/debug.js +156 -0
  141. package/lib/esm/helpers/debug.js.map +1 -0
  142. package/lib/esm/helpers/emails.js +6 -0
  143. package/lib/esm/helpers/emails.js.map +1 -0
  144. package/lib/esm/helpers/eval.js +6 -0
  145. package/lib/esm/helpers/eval.js.map +1 -0
  146. package/lib/esm/helpers/exports-index.js +30 -0
  147. package/lib/esm/helpers/exports-index.js.map +1 -0
  148. package/lib/esm/helpers/file.js +49 -0
  149. package/lib/esm/helpers/file.js.map +1 -0
  150. package/lib/esm/helpers/flatted.js +131 -0
  151. package/lib/esm/helpers/flatted.js.map +1 -0
  152. package/lib/esm/helpers/functions.js +13 -0
  153. package/lib/esm/helpers/functions.js.map +1 -0
  154. package/lib/esm/helpers/graph/calendar.types.js +10 -0
  155. package/lib/esm/helpers/graph/calendar.types.js.map +1 -0
  156. package/lib/esm/helpers/graph/exports-index.js +2 -0
  157. package/lib/esm/helpers/graph/exports-index.js.map +1 -0
  158. package/lib/esm/helpers/http.js +65 -0
  159. package/lib/esm/helpers/http.js.map +1 -0
  160. package/lib/esm/helpers/images.js +18 -0
  161. package/lib/esm/helpers/images.js.map +1 -0
  162. package/lib/esm/helpers/json.js +39 -0
  163. package/lib/esm/helpers/json.js.map +1 -0
  164. package/lib/esm/helpers/md5.js +168 -0
  165. package/lib/esm/helpers/md5.js.map +1 -0
  166. package/lib/esm/helpers/objects.js +258 -0
  167. package/lib/esm/helpers/objects.js.map +1 -0
  168. package/lib/esm/helpers/promises.js +152 -0
  169. package/lib/esm/helpers/promises.js.map +1 -0
  170. package/lib/esm/helpers/random.js +27 -0
  171. package/lib/esm/helpers/random.js.map +1 -0
  172. package/lib/esm/helpers/scheduler/exports-index.js +2 -0
  173. package/lib/esm/helpers/scheduler/exports-index.js.map +1 -0
  174. package/lib/esm/helpers/scheduler/scheduler.js +103 -0
  175. package/lib/esm/helpers/scheduler/scheduler.js.map +1 -0
  176. package/lib/esm/helpers/sharepoint.js +669 -0
  177. package/lib/esm/helpers/sharepoint.js.map +1 -0
  178. package/lib/esm/helpers/strings.js +273 -0
  179. package/lib/esm/helpers/strings.js.map +1 -0
  180. package/lib/esm/helpers/typecheckers.js +238 -0
  181. package/lib/esm/helpers/typecheckers.js.map +1 -0
  182. package/lib/esm/helpers/url.js +190 -0
  183. package/lib/esm/helpers/url.js.map +1 -0
  184. package/lib/esm/helpers/urlhelper.js +100 -0
  185. package/lib/esm/helpers/urlhelper.js.map +1 -0
  186. package/lib/esm/index.js +6 -0
  187. package/lib/esm/index.js.map +1 -0
  188. package/lib/esm/types/auth.js +38 -0
  189. package/lib/esm/types/auth.js.map +1 -0
  190. package/lib/esm/types/common.types.js +3 -0
  191. package/lib/esm/types/common.types.js.map +1 -0
  192. package/lib/esm/types/exports-index.js +16 -0
  193. package/lib/esm/types/exports-index.js.map +1 -0
  194. package/lib/esm/types/flatted.types.js +2 -0
  195. package/lib/esm/types/flatted.types.js.map +1 -0
  196. package/lib/esm/types/globals.types.js +2 -0
  197. package/lib/esm/types/globals.types.js.map +1 -0
  198. package/lib/esm/types/graph/calendar.types.js +2 -0
  199. package/lib/esm/types/graph/calendar.types.js.map +1 -0
  200. package/lib/esm/types/graph/exports-index.js +2 -0
  201. package/lib/esm/types/graph/exports-index.js.map +1 -0
  202. package/lib/esm/types/knownscript.types.js +2 -0
  203. package/lib/esm/types/knownscript.types.js.map +1 -0
  204. package/lib/esm/types/libs/datajs.types.js +2 -0
  205. package/lib/esm/types/libs/datajs.types.js.map +1 -0
  206. package/lib/esm/types/libs/exports-index.js +4 -0
  207. package/lib/esm/types/libs/exports-index.js.map +1 -0
  208. package/lib/esm/types/libs/ics.types.js +2 -0
  209. package/lib/esm/types/libs/ics.types.js.map +1 -0
  210. package/lib/esm/types/libs/msal.types.js +28 -0
  211. package/lib/esm/types/libs/msal.types.js.map +1 -0
  212. package/lib/esm/types/locales.js +2 -0
  213. package/lib/esm/types/locales.js.map +1 -0
  214. package/lib/esm/types/localstoragecache.types.js +2 -0
  215. package/lib/esm/types/localstoragecache.types.js.map +1 -0
  216. package/lib/esm/types/location.types.js +2 -0
  217. package/lib/esm/types/location.types.js.map +1 -0
  218. package/lib/esm/types/moment.js +2 -0
  219. package/lib/esm/types/moment.js.map +1 -0
  220. package/lib/esm/types/regex.types.js +2 -0
  221. package/lib/esm/types/regex.types.js.map +1 -0
  222. package/lib/esm/types/rest.types.js +21 -0
  223. package/lib/esm/types/rest.types.js.map +1 -0
  224. package/lib/esm/types/sharepoint.types.js +660 -0
  225. package/lib/esm/types/sharepoint.types.js.map +1 -0
  226. package/lib/esm/types/sharepoint.utils.types.js +51 -0
  227. package/lib/esm/types/sharepoint.utils.types.js.map +1 -0
  228. package/{src/utils/_dependencies.ts → lib/esm/utils/_dependencies.js} +4 -4
  229. package/lib/esm/utils/_dependencies.js.map +1 -0
  230. package/lib/esm/utils/auth/common.js +61 -0
  231. package/lib/esm/utils/auth/common.js.map +1 -0
  232. package/lib/esm/utils/auth/discovery.js +104 -0
  233. package/lib/esm/utils/auth/discovery.js.map +1 -0
  234. package/lib/esm/utils/auth/exports-index.js +3 -0
  235. package/lib/esm/utils/auth/exports-index.js.map +1 -0
  236. package/lib/esm/utils/base64.js +27 -0
  237. package/lib/esm/utils/base64.js.map +1 -0
  238. package/lib/esm/utils/consolelogger.js +271 -0
  239. package/lib/esm/utils/consolelogger.js.map +1 -0
  240. package/lib/esm/utils/date.js +26 -0
  241. package/lib/esm/utils/date.js.map +1 -0
  242. package/lib/esm/utils/emails.js +23 -0
  243. package/lib/esm/utils/emails.js.map +1 -0
  244. package/lib/esm/utils/exports-index.js +12 -0
  245. package/lib/esm/utils/exports-index.js.map +1 -0
  246. package/lib/esm/utils/knownscript.js +247 -0
  247. package/lib/esm/utils/knownscript.js.map +1 -0
  248. package/lib/esm/utils/localstoragecache.js +378 -0
  249. package/lib/esm/utils/localstoragecache.js.map +1 -0
  250. package/lib/esm/utils/rest.js +432 -0
  251. package/lib/esm/utils/rest.js.map +1 -0
  252. package/lib/esm/utils/script.js +154 -0
  253. package/lib/esm/utils/script.js.map +1 -0
  254. package/lib/esm/utils/sharepoint.rest/common.js +134 -0
  255. package/lib/esm/utils/sharepoint.rest/common.js.map +1 -0
  256. package/lib/esm/utils/sharepoint.rest/date.js +54 -0
  257. package/lib/esm/utils/sharepoint.rest/date.js.map +1 -0
  258. package/lib/esm/utils/sharepoint.rest/exports-index.js +12 -0
  259. package/lib/esm/utils/sharepoint.rest/exports-index.js.map +1 -0
  260. package/lib/esm/utils/sharepoint.rest/file.folder.js +444 -0
  261. package/lib/esm/utils/sharepoint.rest/file.folder.js.map +1 -0
  262. package/lib/esm/utils/sharepoint.rest/item.js +453 -0
  263. package/lib/esm/utils/sharepoint.rest/item.js.map +1 -0
  264. package/lib/esm/utils/sharepoint.rest/list.js +924 -0
  265. package/lib/esm/utils/sharepoint.rest/list.js.map +1 -0
  266. package/lib/esm/utils/sharepoint.rest/listutils/GetListItemsByCaml.js +624 -0
  267. package/lib/esm/utils/sharepoint.rest/listutils/GetListItemsByCaml.js.map +1 -0
  268. package/lib/esm/utils/sharepoint.rest/listutils/GetListItemsById.js +214 -0
  269. package/lib/esm/utils/sharepoint.rest/listutils/GetListItemsById.js.map +1 -0
  270. package/lib/esm/utils/sharepoint.rest/listutils/common.js +198 -0
  271. package/lib/esm/utils/sharepoint.rest/listutils/common.js.map +1 -0
  272. package/lib/esm/utils/sharepoint.rest/listutils/exports-index.js +4 -0
  273. package/lib/esm/utils/sharepoint.rest/listutils/exports-index.js.map +1 -0
  274. package/lib/esm/utils/sharepoint.rest/location.js +103 -0
  275. package/lib/esm/utils/sharepoint.rest/location.js.map +1 -0
  276. package/lib/esm/utils/sharepoint.rest/navigation-links.js +80 -0
  277. package/lib/esm/utils/sharepoint.rest/navigation-links.js.map +1 -0
  278. package/lib/esm/utils/sharepoint.rest/user-search.js +218 -0
  279. package/lib/esm/utils/sharepoint.rest/user-search.js.map +1 -0
  280. package/lib/esm/utils/sharepoint.rest/user.js +414 -0
  281. package/lib/esm/utils/sharepoint.rest/user.js.map +1 -0
  282. package/lib/esm/utils/sharepoint.rest/web.js +1158 -0
  283. package/lib/esm/utils/sharepoint.rest/web.js.map +1 -0
  284. package/lib/esm/utils/sod.js +164 -0
  285. package/lib/esm/utils/sod.js.map +1 -0
  286. package/{dist → lib/types}/helpers/collections.base.d.ts +1 -1
  287. package/{dist → lib/types}/helpers/collections.d.ts +1 -1
  288. package/{dist → lib/types}/helpers/flatted.d.ts +1 -1
  289. package/{dist → lib/types}/helpers/graph/calendar.types.d.ts +1 -1
  290. package/{dist → lib/types}/helpers/sharepoint.d.ts +3 -1
  291. package/{dist → lib/types}/helpers/strings.d.ts +1 -1
  292. package/{dist → lib/types}/helpers/url.d.ts +1 -1
  293. package/{dist → lib/types}/utils/auth/discovery.d.ts +1 -1
  294. package/{dist → lib/types}/utils/knownscript.d.ts +5 -1
  295. package/{dist → lib/types}/utils/localstoragecache.d.ts +1 -1
  296. package/{dist → lib/types}/utils/rest.d.ts +1 -1
  297. package/{dist → lib/types}/utils/script.d.ts +1 -1
  298. package/{dist → lib/types}/utils/sharepoint.rest/date.d.ts +1 -1
  299. package/{dist → lib/types}/utils/sharepoint.rest/file.folder.d.ts +4 -1
  300. package/{dist → lib/types}/utils/sharepoint.rest/item.d.ts +3 -1
  301. package/{dist → lib/types}/utils/sharepoint.rest/list.d.ts +4 -1
  302. package/{dist → lib/types}/utils/sharepoint.rest/listutils/GetListItemsByCaml.d.ts +1 -1
  303. package/{dist → lib/types}/utils/sharepoint.rest/listutils/GetListItemsById.d.ts +2 -1
  304. package/{dist → lib/types}/utils/sharepoint.rest/listutils/common.d.ts +2 -1
  305. package/{dist → lib/types}/utils/sharepoint.rest/navigation-links.d.ts +1 -1
  306. package/{dist → lib/types}/utils/sharepoint.rest/user-search.d.ts +1 -1
  307. package/{dist → lib/types}/utils/sharepoint.rest/user.d.ts +3 -1
  308. package/{dist → lib/types}/utils/sharepoint.rest/web.d.ts +3 -1
  309. package/{dist → lib/types}/utils/sod.d.ts +1 -1
  310. package/package.json +15 -7
  311. package/src/helpers/browser.ts +1 -1
  312. package/src/helpers/collections.base.ts +1 -2
  313. package/src/helpers/collections.ts +1 -1
  314. package/src/helpers/debug.ts +1 -1
  315. package/src/helpers/flatted.ts +1 -1
  316. package/src/helpers/graph/calendar.types.ts +1 -1
  317. package/src/helpers/promises.ts +10 -5
  318. package/src/helpers/sharepoint.ts +3 -1
  319. package/src/helpers/strings.ts +1 -1
  320. package/src/helpers/url.ts +1 -1
  321. package/src/utils/auth/discovery.ts +3 -1
  322. package/src/utils/base64.ts +2 -1
  323. package/src/utils/consolelogger.ts +7 -1
  324. package/src/utils/date.ts +1 -1
  325. package/src/utils/emails.ts +1 -1
  326. package/src/utils/knownscript.ts +7 -1
  327. package/src/utils/localstoragecache.ts +39 -20
  328. package/src/utils/rest.ts +23 -4
  329. package/src/utils/script.ts +4 -1
  330. package/src/utils/sharepoint.rest/date.ts +3 -1
  331. package/src/utils/sharepoint.rest/file.folder.ts +7 -1
  332. package/src/utils/sharepoint.rest/item.ts +9 -1
  333. package/src/utils/sharepoint.rest/list.ts +10 -1
  334. package/src/utils/sharepoint.rest/listutils/GetListItemsByCaml.ts +9 -1
  335. package/src/utils/sharepoint.rest/listutils/GetListItemsById.ts +14 -4
  336. package/src/utils/sharepoint.rest/listutils/common.ts +6 -1
  337. package/src/utils/sharepoint.rest/location.ts +1 -1
  338. package/src/utils/sharepoint.rest/navigation-links.ts +2 -1
  339. package/src/utils/sharepoint.rest/user-search.ts +4 -1
  340. package/src/utils/sharepoint.rest/user.ts +7 -1
  341. package/src/utils/sharepoint.rest/web.ts +12 -2
  342. package/src/utils/sod.ts +3 -1
  343. package/dist/_dependencies.js.map +0 -1
  344. package/dist/config.js.map +0 -1
  345. package/dist/exports-index.js.map +0 -1
  346. package/dist/helpers/Guid.js.map +0 -1
  347. package/dist/helpers/_dependencies.js.map +0 -1
  348. package/dist/helpers/base64.js.map +0 -1
  349. package/dist/helpers/browser.js.map +0 -1
  350. package/dist/helpers/browserinfo.js.map +0 -1
  351. package/dist/helpers/collections.base.js.map +0 -1
  352. package/dist/helpers/collections.js.map +0 -1
  353. package/dist/helpers/color.js.map +0 -1
  354. package/dist/helpers/cookies.js.map +0 -1
  355. package/dist/helpers/date.js.map +0 -1
  356. package/dist/helpers/debug.js.map +0 -1
  357. package/dist/helpers/emails.js.map +0 -1
  358. package/dist/helpers/eval.js.map +0 -1
  359. package/dist/helpers/exports-index.js.map +0 -1
  360. package/dist/helpers/file.js.map +0 -1
  361. package/dist/helpers/flatted.js.map +0 -1
  362. package/dist/helpers/functions.js.map +0 -1
  363. package/dist/helpers/graph/calendar.types.js.map +0 -1
  364. package/dist/helpers/graph/exports-index.js.map +0 -1
  365. package/dist/helpers/http.js.map +0 -1
  366. package/dist/helpers/images.js.map +0 -1
  367. package/dist/helpers/json.js.map +0 -1
  368. package/dist/helpers/md5.js.map +0 -1
  369. package/dist/helpers/objects.js.map +0 -1
  370. package/dist/helpers/promises.js.map +0 -1
  371. package/dist/helpers/random.js.map +0 -1
  372. package/dist/helpers/scheduler/exports-index.js.map +0 -1
  373. package/dist/helpers/scheduler/scheduler.js.map +0 -1
  374. package/dist/helpers/sharepoint.js.map +0 -1
  375. package/dist/helpers/strings.js.map +0 -1
  376. package/dist/helpers/typecheckers.js.map +0 -1
  377. package/dist/helpers/url.js.map +0 -1
  378. package/dist/helpers/urlhelper.js.map +0 -1
  379. package/dist/index.js.map +0 -1
  380. package/dist/types/auth.js.map +0 -1
  381. package/dist/types/common.types.js.map +0 -1
  382. package/dist/types/exports-index.js.map +0 -1
  383. package/dist/types/flatted.types.js.map +0 -1
  384. package/dist/types/globals.types.js.map +0 -1
  385. package/dist/types/graph/calendar.types.js.map +0 -1
  386. package/dist/types/graph/exports-index.js.map +0 -1
  387. package/dist/types/knownscript.types.js.map +0 -1
  388. package/dist/types/libs/datajs.types.js.map +0 -1
  389. package/dist/types/libs/exports-index.js.map +0 -1
  390. package/dist/types/libs/ics.types.js.map +0 -1
  391. package/dist/types/libs/msal.types.js.map +0 -1
  392. package/dist/types/localstoragecache.types.js.map +0 -1
  393. package/dist/types/location.types.js.map +0 -1
  394. package/dist/types/rest.types.js.map +0 -1
  395. package/dist/types/sharepoint.types.js.map +0 -1
  396. package/dist/types/sharepoint.utils.types.js.map +0 -1
  397. package/dist/utils/_dependencies.js.map +0 -1
  398. package/dist/utils/auth/common.js.map +0 -1
  399. package/dist/utils/auth/discovery.js.map +0 -1
  400. package/dist/utils/auth/exports-index.js.map +0 -1
  401. package/dist/utils/base64.js.map +0 -1
  402. package/dist/utils/consolelogger.js.map +0 -1
  403. package/dist/utils/date.js.map +0 -1
  404. package/dist/utils/emails.js.map +0 -1
  405. package/dist/utils/exports-index.js.map +0 -1
  406. package/dist/utils/knownscript.js.map +0 -1
  407. package/dist/utils/localstoragecache.js.map +0 -1
  408. package/dist/utils/rest.js.map +0 -1
  409. package/dist/utils/script.js.map +0 -1
  410. package/dist/utils/sharepoint.rest/common.js.map +0 -1
  411. package/dist/utils/sharepoint.rest/date.js.map +0 -1
  412. package/dist/utils/sharepoint.rest/exports-index.js.map +0 -1
  413. package/dist/utils/sharepoint.rest/file.folder.js.map +0 -1
  414. package/dist/utils/sharepoint.rest/item.js.map +0 -1
  415. package/dist/utils/sharepoint.rest/list.js.map +0 -1
  416. package/dist/utils/sharepoint.rest/listutils/GetListItemsByCaml.js.map +0 -1
  417. package/dist/utils/sharepoint.rest/listutils/GetListItemsById.js.map +0 -1
  418. package/dist/utils/sharepoint.rest/listutils/common.js.map +0 -1
  419. package/dist/utils/sharepoint.rest/listutils/exports-index.js.map +0 -1
  420. package/dist/utils/sharepoint.rest/location.js.map +0 -1
  421. package/dist/utils/sharepoint.rest/navigation-links.js.map +0 -1
  422. package/dist/utils/sharepoint.rest/user-search.js.map +0 -1
  423. package/dist/utils/sharepoint.rest/user.js.map +0 -1
  424. package/dist/utils/sharepoint.rest/web.js.map +0 -1
  425. package/dist/utils/sod.js.map +0 -1
  426. /package/{dist → lib/cjs}/_dependencies.js +0 -0
  427. /package/{dist → lib/cjs}/config.js +0 -0
  428. /package/{dist → lib/cjs}/exports-index.js +0 -0
  429. /package/{dist → lib/cjs}/helpers/Guid.js +0 -0
  430. /package/{dist → lib/cjs}/helpers/_dependencies.js +0 -0
  431. /package/{dist → lib/cjs}/helpers/base64.js +0 -0
  432. /package/{dist → lib/cjs}/helpers/browser.js +0 -0
  433. /package/{dist → lib/cjs}/helpers/browserinfo.js +0 -0
  434. /package/{dist → lib/cjs}/helpers/collections.js +0 -0
  435. /package/{dist → lib/cjs}/helpers/color.js +0 -0
  436. /package/{dist → lib/cjs}/helpers/cookies.js +0 -0
  437. /package/{dist → lib/cjs}/helpers/date.js +0 -0
  438. /package/{dist → lib/cjs}/helpers/emails.js +0 -0
  439. /package/{dist → lib/cjs}/helpers/eval.js +0 -0
  440. /package/{dist → lib/cjs}/helpers/exports-index.js +0 -0
  441. /package/{dist → lib/cjs}/helpers/file.js +0 -0
  442. /package/{dist → lib/cjs}/helpers/flatted.js +0 -0
  443. /package/{dist → lib/cjs}/helpers/functions.js +0 -0
  444. /package/{dist → lib/cjs}/helpers/graph/calendar.types.js +0 -0
  445. /package/{dist → lib/cjs}/helpers/graph/exports-index.js +0 -0
  446. /package/{dist → lib/cjs}/helpers/http.js +0 -0
  447. /package/{dist → lib/cjs}/helpers/images.js +0 -0
  448. /package/{dist → lib/cjs}/helpers/json.js +0 -0
  449. /package/{dist → lib/cjs}/helpers/md5.js +0 -0
  450. /package/{dist → lib/cjs}/helpers/objects.js +0 -0
  451. /package/{dist → lib/cjs}/helpers/random.js +0 -0
  452. /package/{dist → lib/cjs}/helpers/scheduler/exports-index.js +0 -0
  453. /package/{dist → lib/cjs}/helpers/scheduler/scheduler.js +0 -0
  454. /package/{dist → lib/cjs}/helpers/strings.js +0 -0
  455. /package/{dist → lib/cjs}/helpers/typecheckers.js +0 -0
  456. /package/{dist → lib/cjs}/helpers/url.js +0 -0
  457. /package/{dist → lib/cjs}/helpers/urlhelper.js +0 -0
  458. /package/{dist → lib/cjs}/types/auth.js +0 -0
  459. /package/{dist → lib/cjs}/types/common.types.js +0 -0
  460. /package/{dist → lib/cjs}/types/exports-index.js +0 -0
  461. /package/{dist → lib/cjs}/types/flatted.types.js +0 -0
  462. /package/{dist → lib/cjs}/types/globals.types.js +0 -0
  463. /package/{dist → lib/cjs}/types/graph/calendar.types.js +0 -0
  464. /package/{dist → lib/cjs}/types/graph/exports-index.js +0 -0
  465. /package/{dist → lib/cjs}/types/knownscript.types.js +0 -0
  466. /package/{dist → lib/cjs}/types/libs/datajs.types.js +0 -0
  467. /package/{dist → lib/cjs}/types/libs/exports-index.js +0 -0
  468. /package/{dist → lib/cjs}/types/libs/ics.types.js +0 -0
  469. /package/{dist → lib/cjs}/types/libs/msal.types.js +0 -0
  470. /package/{dist → lib/cjs}/types/locales.js +0 -0
  471. /package/{dist → lib/cjs}/types/localstoragecache.types.js +0 -0
  472. /package/{dist → lib/cjs}/types/location.types.js +0 -0
  473. /package/{dist → lib/cjs}/types/moment.js +0 -0
  474. /package/{dist → lib/cjs}/types/regex.types.js +0 -0
  475. /package/{dist → lib/cjs}/types/rest.types.js +0 -0
  476. /package/{dist → lib/cjs}/types/sharepoint.types.js +0 -0
  477. /package/{dist → lib/cjs}/types/sharepoint.utils.types.js +0 -0
  478. /package/{dist → lib/cjs}/utils/_dependencies.js +0 -0
  479. /package/{dist → lib/cjs}/utils/auth/common.js +0 -0
  480. /package/{dist → lib/cjs}/utils/auth/exports-index.js +0 -0
  481. /package/{dist → lib/cjs}/utils/exports-index.js +0 -0
  482. /package/{dist → lib/cjs}/utils/sharepoint.rest/common.js +0 -0
  483. /package/{dist → lib/cjs}/utils/sharepoint.rest/exports-index.js +0 -0
  484. /package/{dist → lib/cjs}/utils/sharepoint.rest/listutils/exports-index.js +0 -0
  485. /package/{dist → lib/types}/_dependencies.d.ts +0 -0
  486. /package/{dist → lib/types}/config.d.ts +0 -0
  487. /package/{dist → lib/types}/exports-index.d.ts +0 -0
  488. /package/{dist → lib/types}/helpers/Guid.d.ts +0 -0
  489. /package/{dist → lib/types}/helpers/_dependencies.d.ts +0 -0
  490. /package/{dist → lib/types}/helpers/base64.d.ts +0 -0
  491. /package/{dist → lib/types}/helpers/browser.d.ts +0 -0
  492. /package/{dist → lib/types}/helpers/browserinfo.d.ts +0 -0
  493. /package/{dist → lib/types}/helpers/color.d.ts +0 -0
  494. /package/{dist → lib/types}/helpers/cookies.d.ts +0 -0
  495. /package/{dist → lib/types}/helpers/date.d.ts +0 -0
  496. /package/{dist → lib/types}/helpers/debug.d.ts +0 -0
  497. /package/{dist → lib/types}/helpers/emails.d.ts +0 -0
  498. /package/{dist → lib/types}/helpers/eval.d.ts +0 -0
  499. /package/{dist → lib/types}/helpers/exports-index.d.ts +0 -0
  500. /package/{dist → lib/types}/helpers/file.d.ts +0 -0
  501. /package/{dist → lib/types}/helpers/functions.d.ts +0 -0
  502. /package/{dist → lib/types}/helpers/graph/exports-index.d.ts +0 -0
  503. /package/{dist → lib/types}/helpers/http.d.ts +0 -0
  504. /package/{dist → lib/types}/helpers/images.d.ts +0 -0
  505. /package/{dist → lib/types}/helpers/json.d.ts +0 -0
  506. /package/{dist → lib/types}/helpers/md5.d.ts +0 -0
  507. /package/{dist → lib/types}/helpers/objects.d.ts +0 -0
  508. /package/{dist → lib/types}/helpers/promises.d.ts +0 -0
  509. /package/{dist → lib/types}/helpers/random.d.ts +0 -0
  510. /package/{dist → lib/types}/helpers/scheduler/exports-index.d.ts +0 -0
  511. /package/{dist → lib/types}/helpers/scheduler/scheduler.d.ts +0 -0
  512. /package/{dist → lib/types}/helpers/typecheckers.d.ts +0 -0
  513. /package/{dist → lib/types}/helpers/urlhelper.d.ts +0 -0
  514. /package/{dist → lib/types}/index.d.ts +0 -0
  515. /package/{dist → lib/types}/types/auth.d.ts +0 -0
  516. /package/{dist → lib/types}/types/common.types.d.ts +0 -0
  517. /package/{dist → lib/types}/types/exports-index.d.ts +0 -0
  518. /package/{dist → lib/types}/types/flatted.types.d.ts +0 -0
  519. /package/{dist → lib/types}/types/globals.types.d.ts +0 -0
  520. /package/{dist → lib/types}/types/graph/calendar.types.d.ts +0 -0
  521. /package/{dist → lib/types}/types/graph/exports-index.d.ts +0 -0
  522. /package/{dist → lib/types}/types/knownscript.types.d.ts +0 -0
  523. /package/{dist → lib/types}/types/libs/datajs.types.d.ts +0 -0
  524. /package/{dist → lib/types}/types/libs/exports-index.d.ts +0 -0
  525. /package/{dist → lib/types}/types/libs/ics.types.d.ts +0 -0
  526. /package/{dist → lib/types}/types/libs/msal.types.d.ts +0 -0
  527. /package/{dist → lib/types}/types/locales.d.ts +0 -0
  528. /package/{dist → lib/types}/types/localstoragecache.types.d.ts +0 -0
  529. /package/{dist → lib/types}/types/location.types.d.ts +0 -0
  530. /package/{dist → lib/types}/types/moment.d.ts +0 -0
  531. /package/{dist → lib/types}/types/regex.types.d.ts +0 -0
  532. /package/{dist → lib/types}/types/rest.types.d.ts +0 -0
  533. /package/{dist → lib/types}/types/sharepoint.types.d.ts +0 -0
  534. /package/{dist → lib/types}/types/sharepoint.utils.types.d.ts +0 -0
  535. /package/{dist → lib/types}/utils/_dependencies.d.ts +0 -0
  536. /package/{dist → lib/types}/utils/auth/common.d.ts +0 -0
  537. /package/{dist → lib/types}/utils/auth/exports-index.d.ts +0 -0
  538. /package/{dist → lib/types}/utils/base64.d.ts +0 -0
  539. /package/{dist → lib/types}/utils/consolelogger.d.ts +0 -0
  540. /package/{dist → lib/types}/utils/date.d.ts +0 -0
  541. /package/{dist → lib/types}/utils/emails.d.ts +0 -0
  542. /package/{dist → lib/types}/utils/exports-index.d.ts +0 -0
  543. /package/{dist → lib/types}/utils/sharepoint.rest/common.d.ts +0 -0
  544. /package/{dist → lib/types}/utils/sharepoint.rest/exports-index.d.ts +0 -0
  545. /package/{dist → lib/types}/utils/sharepoint.rest/listutils/exports-index.d.ts +0 -0
  546. /package/{dist → lib/types}/utils/sharepoint.rest/location.d.ts +0 -0
@@ -2,10 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BreakWebPermissionInheritance = exports.RestoreWebPermissionInheritance = exports.WebHasUniquePermissions = exports.ensureLegacyProps = exports.getFormDigest = exports.GetWebPropertyByName = exports.GetAllWebProperties = exports.GetRegionalSettings = exports.DeleteUserCustomAction = exports.UpdateUserCustomAction = exports.AddUserCustomAction = exports.GetUserCustomActionByName = exports.GetUserCustomActionById = exports.GetUserCustomActions = exports.GetContextWebInformationSync = exports.SPServerLocalTime = exports.SPServerLocalTimeSync = exports.UTCToSPServerLocalTimeSync = exports.UTCToSPServerLocalTime = exports.SPServerLocalTimeToUTCSync = exports.SPServerLocalTimeToUTC = exports.SPServerLocalTimeToUTCDateSync = exports.SPServerLocalTimeToUTCDate = exports.GetServerTimeZone = exports.GetAppTilesSync = exports.GetAppTiles = exports.GetSubWebs = exports.GetRoleAssignments = exports.GetWebRoleDefinitions = exports.GetWebInfoSync = exports.GetWebInfo = exports.__getSubSites = exports.GetAllSubWebs = exports.GetListsSync = exports.GetLists = exports.GetContentTypesSync = exports.GetContentTypes = exports.UserHasManageSitePermissions = exports.UserHasAllPermissions = exports.IsRootWeb = exports.GetWebIdSync = exports.GetWebId = exports.GetWebTitle = exports.GetRootWebInfo = exports.GetSiteIdSync = exports.GetSiteId = exports.GetPortalUrl = exports.GetTenantId = exports.GetSiteInfoSync = exports.GetSiteInfo = void 0;
4
4
  exports.GetWebAssociatedGroups = exports.SetWelcomePage = exports.GetWelcomePage = exports.DectivateFeature = exports.ActivateFeature = exports.GetActiveFeatures = exports.GetAvailableTagsForSiteSync = exports.GetAvailableTagsForSite = exports.SetUserAsSiteAdmin = exports.RemoveWebPermission = exports.AssignWebPermission = void 0;
5
- const _dependencies_1 = require("../_dependencies");
5
+ const collections_base_1 = require("../../helpers/collections.base");
6
+ const json_1 = require("../../helpers/json");
7
+ const objects_1 = require("../../helpers/objects");
8
+ const sharepoint_1 = require("../../helpers/sharepoint");
9
+ const strings_1 = require("../../helpers/strings");
10
+ const typecheckers_1 = require("../../helpers/typecheckers");
11
+ const url_1 = require("../../helpers/url");
12
+ const rest_types_1 = require("../../types/rest.types");
13
+ const sharepoint_types_1 = require("../../types/sharepoint.types");
14
+ const sharepoint_utils_types_1 = require("../../types/sharepoint.utils.types");
15
+ const discovery_1 = require("../auth/discovery");
6
16
  const consolelogger_1 = require("../consolelogger");
7
17
  const date_1 = require("../date");
8
- const exports_index_1 = require("../exports-index");
9
18
  const rest_1 = require("../rest");
10
19
  const common_1 = require("./common");
11
20
  const list_1 = require("./list");
@@ -14,9 +23,9 @@ async function GetSiteInfo(siteUrl) {
14
23
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
15
24
  try {
16
25
  const r = await (0, rest_1.GetJson)((0, common_1.GetRestBaseUrl)(siteUrl) + "/site?$select=id,serverRelativeUrl", null, { ...rest_1.longLocalCache });
17
- var id = (0, _dependencies_1.normalizeGuid)(r.d.Id);
18
- var serverRelativeUrl = (0, _dependencies_1.normalizeUrl)(r.d.ServerRelativeUrl);
19
- if ((0, _dependencies_1.isNullOrEmptyString)(serverRelativeUrl))
26
+ var id = (0, strings_1.normalizeGuid)(r.d.Id);
27
+ var serverRelativeUrl = (0, url_1.normalizeUrl)(r.d.ServerRelativeUrl);
28
+ if ((0, typecheckers_1.isNullOrEmptyString)(serverRelativeUrl))
20
29
  serverRelativeUrl = "/"; //can't return "" since it will be treated as current sub site, when tyring to access the root site from a sub-site
21
30
  return { Id: id, ServerRelativeUrl: serverRelativeUrl };
22
31
  }
@@ -29,8 +38,8 @@ function GetSiteInfoSync(siteUrl) {
29
38
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
30
39
  let result = (0, rest_1.GetJsonSync)((0, common_1.GetRestBaseUrl)(siteUrl) + "/site?$select=id,serverRelativeUrl", null, { ...rest_1.longLocalCache });
31
40
  if (result.success) {
32
- var id = (0, _dependencies_1.normalizeGuid)(result.result.d.Id);
33
- var serverRelativeUrl = (0, _dependencies_1.normalizeUrl)(result.result.d.ServerRelativeUrl);
41
+ var id = (0, strings_1.normalizeGuid)(result.result.d.Id);
42
+ var serverRelativeUrl = (0, url_1.normalizeUrl)(result.result.d.ServerRelativeUrl);
34
43
  return { Id: id, ServerRelativeUrl: serverRelativeUrl };
35
44
  }
36
45
  return null;
@@ -40,8 +49,8 @@ function _getSiteIdFromContext(siteUrl) {
40
49
  if ((0, common_1.hasGlobalContext)()) {
41
50
  //issue 7295
42
51
  //make sure we return false for /sites/ab/c is not under /sites/a by adding a / at the end
43
- let normalizedWebUrl = (0, _dependencies_1.normalizeUrl)((0, _dependencies_1.makeServerRelativeUrl)(siteUrl), true).toLowerCase();
44
- let normalizedCurrentSiteUrl = (0, _dependencies_1.normalizeUrl)(_spPageContextInfo.siteServerRelativeUrl, true).toLowerCase();
52
+ let normalizedWebUrl = (0, url_1.normalizeUrl)((0, url_1.makeServerRelativeUrl)(siteUrl), true).toLowerCase();
53
+ let normalizedCurrentSiteUrl = (0, url_1.normalizeUrl)(_spPageContextInfo.siteServerRelativeUrl, true).toLowerCase();
45
54
  //test cases
46
55
  //if (!testSub("/", "/hello")) console.error("1");
47
56
  //if (testSub("/", "/sites/hello")) console.error("2");
@@ -50,11 +59,11 @@ function _getSiteIdFromContext(siteUrl) {
50
59
  //if (!testSub("/", "/")) console.error("5");
51
60
  //if (!testSub("/sites/a", "/sites/a")) console.error("6");
52
61
  //if (testSub("/sites/a", "/hello")) console.error("7");
53
- if ((0, _dependencies_1.isNullOrUndefined)(siteUrl)
62
+ if ((0, typecheckers_1.isNullOrUndefined)(siteUrl)
54
63
  || normalizedCurrentSiteUrl === "/" && !normalizedWebUrl.startsWith("/sites")
55
64
  || normalizedCurrentSiteUrl !== "/" && normalizedWebUrl.startsWith(normalizedCurrentSiteUrl)) {
56
- if (!(0, _dependencies_1.isNullOrEmptyString)(_spPageContextInfo.siteId)) {
57
- return (0, _dependencies_1.normalizeGuid)(_spPageContextInfo.siteId);
65
+ if (!(0, typecheckers_1.isNullOrEmptyString)(_spPageContextInfo.siteId)) {
66
+ return (0, strings_1.normalizeGuid)(_spPageContextInfo.siteId);
58
67
  }
59
68
  }
60
69
  }
@@ -62,12 +71,12 @@ function _getSiteIdFromContext(siteUrl) {
62
71
  }
63
72
  /** Get tenant id lower case no {} */
64
73
  function GetTenantId() {
65
- if (!(0, _dependencies_1.isTypeofFullNameNullOrUndefined)("_spPageContextInfo")) {
66
- return (0, _dependencies_1.normalizeGuid)(_spPageContextInfo.aadTenantId);
74
+ if (!(0, typecheckers_1.isTypeofFullNameNullOrUndefined)("_spPageContextInfo")) {
75
+ return (0, strings_1.normalizeGuid)(_spPageContextInfo.aadTenantId);
67
76
  }
68
- let info = (0, exports_index_1.AutoDiscoverTenantInfo)(true);
69
- if (!(0, _dependencies_1.isNullOrUndefined)(info) && (0, _dependencies_1.isValidGuid)(info.idOrName)) {
70
- return (0, _dependencies_1.normalizeGuid)(info.idOrName);
77
+ let info = (0, discovery_1.AutoDiscoverTenantInfo)(true);
78
+ if (!(0, typecheckers_1.isNullOrUndefined)(info) && (0, typecheckers_1.isValidGuid)(info.idOrName)) {
79
+ return (0, strings_1.normalizeGuid)(info.idOrName);
71
80
  }
72
81
  return null;
73
82
  }
@@ -80,12 +89,12 @@ exports.GetPortalUrl = GetPortalUrl;
80
89
  /** Get site id lower case no {} */
81
90
  async function GetSiteId(siteUrl) {
82
91
  let siteId = _getSiteIdFromContext(siteUrl);
83
- if (!(0, _dependencies_1.isNullOrEmptyString)(siteId)) {
92
+ if (!(0, typecheckers_1.isNullOrEmptyString)(siteId)) {
84
93
  return siteId;
85
94
  }
86
95
  return GetSiteInfo(siteUrl).then((info) => {
87
- if (!(0, _dependencies_1.isNullOrUndefined)(info) && !(0, _dependencies_1.isNullOrEmptyString)(info.Id)) {
88
- return (0, _dependencies_1.normalizeGuid)(info.Id);
96
+ if (!(0, typecheckers_1.isNullOrUndefined)(info) && !(0, typecheckers_1.isNullOrEmptyString)(info.Id)) {
97
+ return (0, strings_1.normalizeGuid)(info.Id);
89
98
  }
90
99
  return null;
91
100
  }).catch(() => {
@@ -96,11 +105,11 @@ exports.GetSiteId = GetSiteId;
96
105
  /** Get site id lower case no {} */
97
106
  function GetSiteIdSync(siteUrl) {
98
107
  let siteId = _getSiteIdFromContext(siteUrl);
99
- if (!(0, _dependencies_1.isNullOrEmptyString)(siteId)) {
108
+ if (!(0, typecheckers_1.isNullOrEmptyString)(siteId)) {
100
109
  return siteId;
101
110
  }
102
111
  let result = GetSiteInfoSync(siteUrl);
103
- return !(0, _dependencies_1.isNullOrUndefined)(result) ? (0, _dependencies_1.normalizeGuid)(result.Id) : null;
112
+ return !(0, typecheckers_1.isNullOrUndefined)(result) ? (0, strings_1.normalizeGuid)(result.Id) : null;
104
113
  }
105
114
  exports.GetSiteIdSync = GetSiteIdSync;
106
115
  /** Get root web id lower case no {} */
@@ -108,8 +117,8 @@ function GetRootWebInfo(siteUrl) {
108
117
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
109
118
  return (0, rest_1.GetJson)((0, common_1.GetRestBaseUrl)(siteUrl) + "/site/rootWeb?$select=id,serverRelativeUrl", null, { ...rest_1.longLocalCache })
110
119
  .then(r => {
111
- var id = (0, _dependencies_1.normalizeGuid)(r.d.Id);
112
- var serverRelativeUrl = (0, _dependencies_1.normalizeUrl)(r.d.ServerRelativeUrl);
120
+ var id = (0, strings_1.normalizeGuid)(r.d.Id);
121
+ var serverRelativeUrl = (0, url_1.normalizeUrl)(r.d.ServerRelativeUrl);
113
122
  //console.log("site id: " + id);
114
123
  return { Id: id, ServerRelativeUrl: serverRelativeUrl };
115
124
  })
@@ -133,7 +142,7 @@ function _getWebIdRequestUrl(siteUrl) {
133
142
  function GetWebId(siteUrl) {
134
143
  return (0, rest_1.GetJson)(_getWebIdRequestUrl(siteUrl), null, { ...rest_1.longLocalCache })
135
144
  .then(r => {
136
- return (0, _dependencies_1.normalizeGuid)(r.d.Id);
145
+ return (0, strings_1.normalizeGuid)(r.d.Id);
137
146
  })
138
147
  .catch(() => null);
139
148
  }
@@ -159,7 +168,7 @@ function UserHasAllPermissions(siteUrl, permissions) {
159
168
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
160
169
  return (0, rest_1.GetJson)((0, common_1.GetRestBaseUrl)(siteUrl) + `/web/EffectiveBasePermissions`, null, { ...rest_1.shortLocalCache })
161
170
  .then(r => {
162
- var effectivePermissions = new _dependencies_1.SPBasePermissions(r.d.EffectiveBasePermissions);
171
+ var effectivePermissions = new sharepoint_1.SPBasePermissions(r.d.EffectiveBasePermissions);
163
172
  return permissions.every((perm) => {
164
173
  return effectivePermissions.has(perm);
165
174
  });
@@ -169,14 +178,14 @@ function UserHasAllPermissions(siteUrl, permissions) {
169
178
  exports.UserHasAllPermissions = UserHasAllPermissions;
170
179
  function UserHasManageSitePermissions(siteUrl) {
171
180
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
172
- if (!(0, _dependencies_1.isTypeofFullNameNullOrUndefined)("_spPageContextInfo")) {
181
+ if (!(0, typecheckers_1.isTypeofFullNameNullOrUndefined)("_spPageContextInfo")) {
173
182
  if (siteUrl.startsWith(_spPageContextInfo.siteServerRelativeUrl))
174
183
  if (_spPageContextInfo.isSiteAdmin || _spPageContextInfo["isSiteOwner"])
175
184
  return Promise.resolve(true);
176
185
  }
177
186
  return (0, rest_1.GetJson)((0, common_1.GetRestBaseUrl)(siteUrl) + `/web/EffectiveBasePermissions`, null, { ...rest_1.shortLocalCache })
178
187
  .then(r => {
179
- return new _dependencies_1.SPBasePermissions(r.d.EffectiveBasePermissions).has(_dependencies_1.SPBasePermissionKind.ManageWeb);
188
+ return new sharepoint_1.SPBasePermissions(r.d.EffectiveBasePermissions).has(sharepoint_types_1.SPBasePermissionKind.ManageWeb);
180
189
  })
181
190
  .catch(() => null);
182
191
  }
@@ -184,7 +193,7 @@ exports.UserHasManageSitePermissions = UserHasManageSitePermissions;
184
193
  function _getContentTypesRequestUrl(siteUrl, options = {}) {
185
194
  const { fromRootWeb, includeFields, listIdOrTitle } = options;
186
195
  let query = `$select=${includeFields === true ? common_1.CONTENT_TYPES_SELECT : common_1.CONTENT_TYPES_SELECT_WITH_FIELDS}${includeFields === true ? "&$expand=Fields" : ""}`;
187
- if (!(0, _dependencies_1.isNullOrEmptyString)(listIdOrTitle)) {
196
+ if (!(0, typecheckers_1.isNullOrEmptyString)(listIdOrTitle)) {
188
197
  return `${(0, list_1.GetListRestUrl)(siteUrl, listIdOrTitle)}/contenttypes?${query}`;
189
198
  }
190
199
  else if (fromRootWeb) {
@@ -196,7 +205,7 @@ function _getContentTypesRequestUrl(siteUrl, options = {}) {
196
205
  }
197
206
  function _postProcessGetContentTypes(contentTypes, options = {}, allListFields) {
198
207
  const { ignoreHidden, ignoreFolders, includeFields } = options;
199
- if (!(0, _dependencies_1.isNullOrEmptyArray)(contentTypes)) {
208
+ if (!(0, typecheckers_1.isNullOrEmptyArray)(contentTypes)) {
200
209
  if (ignoreFolders === true || ignoreHidden === true) {
201
210
  contentTypes = contentTypes.filter(rr => {
202
211
  if (options.ignoreFolders && rr.StringId.startsWith('0x0120'))
@@ -208,9 +217,9 @@ function _postProcessGetContentTypes(contentTypes, options = {}, allListFields)
208
217
  }
209
218
  if (includeFields === true) {
210
219
  contentTypes.forEach((result) => {
211
- if (!(0, _dependencies_1.isNullOrEmptyArray)(result.Fields)) {
220
+ if (!(0, typecheckers_1.isNullOrEmptyArray)(result.Fields)) {
212
221
  result.Fields = result.Fields.map((field) => {
213
- return (0, _dependencies_1.extendFieldInfo)(field, allListFields || result.Fields);
222
+ return (0, sharepoint_1.extendFieldInfo)(field, allListFields || result.Fields);
214
223
  });
215
224
  }
216
225
  });
@@ -225,9 +234,9 @@ async function GetContentTypes(siteUrl, options = {}, refreshCache = false) {
225
234
  if (options.includeFields) {
226
235
  allListFields = await (0, list_1.GetListFields)(siteUrl, options.listIdOrTitle);
227
236
  }
228
- return (0, rest_1.GetJson)(url, null, { allowCache: refreshCache !== true, jsonMetadata: _dependencies_1.jsonTypes.nometadata })
237
+ return (0, rest_1.GetJson)(url, null, { allowCache: refreshCache !== true, jsonMetadata: rest_types_1.jsonTypes.nometadata })
229
238
  .then(result => {
230
- if (!(0, _dependencies_1.isNullOrUndefined)(result)) {
239
+ if (!(0, typecheckers_1.isNullOrUndefined)(result)) {
231
240
  return _postProcessGetContentTypes(result.value, options, allListFields);
232
241
  }
233
242
  return null;
@@ -241,8 +250,8 @@ function GetContentTypesSync(siteUrl, options = {}, refreshCache = false) {
241
250
  if (options.includeFields) {
242
251
  allListFields = (0, list_1.GetListFieldsSync)(siteUrl, options.listIdOrTitle);
243
252
  }
244
- let result = (0, rest_1.GetJsonSync)(url, null, { allowCache: refreshCache !== true, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
245
- if (!(0, _dependencies_1.isNullOrUndefined)(result) && result.success === true && !(0, _dependencies_1.isNullOrUndefined)(result.result)) {
253
+ let result = (0, rest_1.GetJsonSync)(url, null, { allowCache: refreshCache !== true, jsonMetadata: rest_types_1.jsonTypes.nometadata });
254
+ if (!(0, typecheckers_1.isNullOrUndefined)(result) && result.success === true && !(0, typecheckers_1.isNullOrUndefined)(result.result)) {
246
255
  return _postProcessGetContentTypes(result.result.value, options, allListFields);
247
256
  }
248
257
  return null;
@@ -264,16 +273,16 @@ function _postProcessGetLists(lists, options = {}) {
264
273
  lists = lists || [];
265
274
  if (options && options.includeViews) {
266
275
  lists.forEach(l => {
267
- if ((0, _dependencies_1.isNullOrEmptyArray)(l.Views)) {
276
+ if ((0, typecheckers_1.isNullOrEmptyArray)(l.Views)) {
268
277
  l.Views = [];
269
278
  }
270
- l.Views.forEach(v => { v.Id = (0, _dependencies_1.normalizeGuid)(v.Id); });
279
+ l.Views.forEach(v => { v.Id = (0, strings_1.normalizeGuid)(v.Id); });
271
280
  });
272
281
  }
273
282
  lists.forEach((list) => {
274
283
  if (list.EffectiveBasePermissions
275
- && ((0, _dependencies_1.isString)(list.EffectiveBasePermissions.High)
276
- || (0, _dependencies_1.isString)(list.EffectiveBasePermissions.Low))) {
284
+ && ((0, typecheckers_1.isString)(list.EffectiveBasePermissions.High)
285
+ || (0, typecheckers_1.isString)(list.EffectiveBasePermissions.Low))) {
277
286
  list.EffectiveBasePermissions = {
278
287
  High: Number(list.EffectiveBasePermissions.High),
279
288
  Low: Number(list.EffectiveBasePermissions.Low)
@@ -284,7 +293,7 @@ function _postProcessGetLists(lists, options = {}) {
284
293
  }
285
294
  function GetLists(siteUrl, options = {}) {
286
295
  let url = _getListsRequestUrl(siteUrl, options);
287
- return (0, rest_1.GetJson)(url, null, { allowCache: true, jsonMetadata: _dependencies_1.jsonTypes.nometadata })
296
+ return (0, rest_1.GetJson)(url, null, { allowCache: true, jsonMetadata: rest_types_1.jsonTypes.nometadata })
288
297
  .then(result => {
289
298
  return _postProcessGetLists(result.value, options);
290
299
  })
@@ -293,8 +302,8 @@ function GetLists(siteUrl, options = {}) {
293
302
  exports.GetLists = GetLists;
294
303
  function GetListsSync(siteUrl, options = {}) {
295
304
  let url = _getListsRequestUrl(siteUrl, options);
296
- let response = (0, rest_1.GetJsonSync)(url, null, { ...rest_1.shortLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
297
- if (response && response.success && response.result && (0, _dependencies_1.isNotEmptyArray)(response.result.value)) {
305
+ let response = (0, rest_1.GetJsonSync)(url, null, { ...rest_1.shortLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
306
+ if (response && response.success && response.result && (0, typecheckers_1.isNotEmptyArray)(response.result.value)) {
298
307
  return _postProcessGetLists(response.result.value, options);
299
308
  }
300
309
  return [];
@@ -334,7 +343,7 @@ async function GetAllSubWebs(siteUrl, options) {
334
343
  let skip = false;
335
344
  for (var i = 0; i < row.Cells.results.length; i++) {
336
345
  let cell = row.Cells.results[i];
337
- let value = (0, _dependencies_1.isNullOrEmptyString)(cell.Value) ? "" : cell.Value;
346
+ let value = (0, typecheckers_1.isNullOrEmptyString)(cell.Value) ? "" : cell.Value;
338
347
  switch (cell.Key) {
339
348
  case "WebTemplate":
340
349
  WebTemplate = value;
@@ -345,7 +354,7 @@ async function GetAllSubWebs(siteUrl, options) {
345
354
  Title = value;
346
355
  break;
347
356
  case "WebId":
348
- WebId = (0, _dependencies_1.normalizeGuid)(value);
357
+ WebId = (0, strings_1.normalizeGuid)(value);
349
358
  break;
350
359
  case "Url":
351
360
  if (addedSites.indexOf(value.toLowerCase()) >= 0) {
@@ -371,19 +380,19 @@ async function GetAllSubWebs(siteUrl, options) {
371
380
  {
372
381
  sites.push({
373
382
  Title: Title,
374
- ServerRelativeUrl: (0, _dependencies_1.makeServerRelativeUrl)(Url),
383
+ ServerRelativeUrl: (0, url_1.makeServerRelativeUrl)(Url),
375
384
  WebId: WebId,
376
385
  WebTemplate: WebTemplate,
377
- WebType: WebTemplate === "APP" ? _dependencies_1.WebTypes.App :
378
- WebTemplate === "GROUP" ? _dependencies_1.WebTypes.Group :
379
- WebTemplate === "STS" ? _dependencies_1.WebTypes.Team :
380
- _dependencies_1.WebTypes.Other
386
+ WebType: WebTemplate === "APP" ? sharepoint_utils_types_1.WebTypes.App :
387
+ WebTemplate === "GROUP" ? sharepoint_utils_types_1.WebTypes.Group :
388
+ WebTemplate === "STS" ? sharepoint_utils_types_1.WebTypes.Team :
389
+ sharepoint_utils_types_1.WebTypes.Other
381
390
  });
382
391
  }
383
392
  });
384
393
  }
385
394
  //Issue 7161
386
- if (sites.length === 1 || (!(0, _dependencies_1.isNullOrUndefined)(currentSite) && !sites.filter((site) => {
395
+ if (sites.length === 1 || (!(0, typecheckers_1.isNullOrUndefined)(currentSite) && !sites.filter((site) => {
387
396
  return site.WebId !== currentSite.WebId;
388
397
  })[0])) {
389
398
  queryFailed = true;
@@ -402,20 +411,20 @@ async function GetAllSubWebs(siteUrl, options) {
402
411
  //we make a request for the site collection root web. If we get a valid response, replace currentSite/siteUrl with
403
412
  //the site collection root web info.
404
413
  let currentSiteCollection = await GetWebInfo(_spPageContextInfo.siteServerRelativeUrl);
405
- if (currentSiteCollection && !(0, _dependencies_1.isNullOrEmptyString)(currentSiteCollection.ServerRelativeUrl)) {
414
+ if (currentSiteCollection && !(0, typecheckers_1.isNullOrEmptyString)(currentSiteCollection.ServerRelativeUrl)) {
406
415
  currentSite = currentSiteCollection;
407
416
  siteUrl = _spPageContextInfo.siteServerRelativeUrl;
408
417
  }
409
418
  }
410
419
  //add current site
411
- if (currentSite && (options.allowAppWebs || currentSite.WebType !== _dependencies_1.WebTypes.App)) {
420
+ if (currentSite && (options.allowAppWebs || currentSite.WebType !== sharepoint_utils_types_1.WebTypes.App)) {
412
421
  sites.push(currentSite);
413
422
  }
414
423
  //Issue 6651
415
424
  //add sub sites
416
425
  //if the query failed, we can't rely on search to get the subwebs
417
426
  var currentSiteSubSites = await __getSubSites(siteUrl, options.allowAppWebs);
418
- if ((0, _dependencies_1.isNotEmptyArray)(currentSiteSubSites)) {
427
+ if ((0, typecheckers_1.isNotEmptyArray)(currentSiteSubSites)) {
419
428
  sites = [...sites, ...currentSiteSubSites];
420
429
  }
421
430
  }
@@ -427,7 +436,7 @@ async function GetAllSubWebs(siteUrl, options) {
427
436
  filteredSites.push(site);
428
437
  }
429
438
  }
430
- (0, _dependencies_1.sortArray)(filteredSites, s => s.ServerRelativeUrl);
439
+ (0, collections_base_1.sortArray)(filteredSites, s => s.ServerRelativeUrl);
431
440
  return filteredSites;
432
441
  }
433
442
  exports.GetAllSubWebs = GetAllSubWebs;
@@ -438,7 +447,7 @@ async function __getSubSites(siteUrl, allowAppWebs) {
438
447
  //maybe search is not wokring? use regular REST API
439
448
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/getsubwebsfilteredforcurrentuser(nwebtemplatefilter=-1,nconfigurationfilter=0)?$Select=Title,ServerRelativeUrl,Id,WebTemplate`;
440
449
  let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.shortLocalCache });
441
- if (result && result.d && (0, _dependencies_1.isNotEmptyArray)(result.d.results)) {
450
+ if (result && result.d && (0, typecheckers_1.isNotEmptyArray)(result.d.results)) {
442
451
  let results = (allowAppWebs) ? result.d.results : result.d.results.filter(s => s.WebTemplate !== "APP");
443
452
  let promises = [];
444
453
  results.forEach(s => {
@@ -447,10 +456,10 @@ async function __getSubSites(siteUrl, allowAppWebs) {
447
456
  ServerRelativeUrl: s.ServerRelativeUrl,
448
457
  WebId: s.Id,
449
458
  WebTemplate: s.WebTemplate,
450
- WebType: s.WebTemplate === "APP" ? _dependencies_1.WebTypes.App :
451
- s.WebTemplate === "GROUP" ? _dependencies_1.WebTypes.Group :
452
- s.WebTemplate === "STS" ? _dependencies_1.WebTypes.Team :
453
- _dependencies_1.WebTypes.Other
459
+ WebType: s.WebTemplate === "APP" ? sharepoint_utils_types_1.WebTypes.App :
460
+ s.WebTemplate === "GROUP" ? sharepoint_utils_types_1.WebTypes.Group :
461
+ s.WebTemplate === "STS" ? sharepoint_utils_types_1.WebTypes.Team :
462
+ sharepoint_utils_types_1.WebTypes.Other
454
463
  });
455
464
  promises.push(__getSubSites(s.ServerRelativeUrl, allowAppWebs));
456
465
  });
@@ -473,7 +482,7 @@ function _getCurrentWebInfoRequestUrl(siteUrl) {
473
482
  return `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web?$Select=${common_1.WEB_SELECT}`;
474
483
  }
475
484
  function _postProcessGetWebInfo(webInfo) {
476
- if (!(0, _dependencies_1.isNullOrUndefined)(webInfo)) {
485
+ if (!(0, typecheckers_1.isNullOrUndefined)(webInfo)) {
477
486
  return {
478
487
  Title: webInfo.Title,
479
488
  ServerRelativeUrl: webInfo.ServerRelativeUrl,
@@ -489,23 +498,23 @@ function _postProcessGetWebInfo(webInfo) {
489
498
  async function GetWebInfo(siteUrl, webId, refreshCache) {
490
499
  let webInfoResponse = null;
491
500
  try {
492
- if (!(0, _dependencies_1.isNullOrEmptyString)(webId) && (0, _dependencies_1.isValidGuid)(webId)) {
493
- webId = (0, _dependencies_1.normalizeGuid)(webId);
501
+ if (!(0, typecheckers_1.isNullOrEmptyString)(webId) && (0, typecheckers_1.isValidGuid)(webId)) {
502
+ webId = (0, strings_1.normalizeGuid)(webId);
494
503
  let currentWebId = await GetWebId(siteUrl);
495
504
  if (currentWebId !== webId) {
496
505
  let url = _getWebInfoByIdRequestUrl(siteUrl, webId);
497
506
  webInfoResponse = await (0, rest_1.GetJson)(url, null, {
498
507
  method: "POST", spWebUrl: (0, common_1.GetSiteUrl)(siteUrl), ...rest_1.shortLocalCache,
499
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
508
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
500
509
  allowCache: refreshCache !== true
501
510
  });
502
511
  }
503
512
  }
504
- if ((0, _dependencies_1.isNullOrUndefined)(webInfoResponse)) {
513
+ if ((0, typecheckers_1.isNullOrUndefined)(webInfoResponse)) {
505
514
  let url = _getCurrentWebInfoRequestUrl(siteUrl);
506
515
  webInfoResponse = await (0, rest_1.GetJson)(url, null, {
507
516
  ...rest_1.shortLocalCache,
508
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
517
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
509
518
  allowCache: refreshCache !== true
510
519
  });
511
520
  }
@@ -516,25 +525,25 @@ async function GetWebInfo(siteUrl, webId, refreshCache) {
516
525
  exports.GetWebInfo = GetWebInfo;
517
526
  function GetWebInfoSync(siteUrl, webId) {
518
527
  let webInfoResponse = null;
519
- if (!(0, _dependencies_1.isNullOrEmptyString)(webId) && (0, _dependencies_1.isValidGuid)(webId)) {
520
- webId = (0, _dependencies_1.normalizeGuid)(webId);
528
+ if (!(0, typecheckers_1.isNullOrEmptyString)(webId) && (0, typecheckers_1.isValidGuid)(webId)) {
529
+ webId = (0, strings_1.normalizeGuid)(webId);
521
530
  let currentWebId = GetWebIdSync(siteUrl);
522
531
  if (currentWebId !== webId) {
523
532
  let url = _getWebInfoByIdRequestUrl(siteUrl, webId);
524
533
  let syncResult = (0, rest_1.GetJsonSync)(url, null, {
525
534
  method: "POST", spWebUrl: (0, common_1.GetSiteUrl)(siteUrl), ...rest_1.shortLocalCache,
526
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
535
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
527
536
  });
528
537
  if (syncResult.success) {
529
538
  webInfoResponse = syncResult.result;
530
539
  }
531
540
  }
532
541
  }
533
- if ((0, _dependencies_1.isNullOrUndefined)(webInfoResponse)) {
542
+ if ((0, typecheckers_1.isNullOrUndefined)(webInfoResponse)) {
534
543
  let url = _getCurrentWebInfoRequestUrl(siteUrl);
535
544
  let syncResult = (0, rest_1.GetJsonSync)(url, null, {
536
545
  ...rest_1.shortLocalCache,
537
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
546
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
538
547
  });
539
548
  if (syncResult.success) {
540
549
  webInfoResponse = syncResult.result;
@@ -554,8 +563,8 @@ exports.GetWebRoleDefinitions = GetWebRoleDefinitions;
554
563
  ;
555
564
  /** get roles for site or list */
556
565
  async function GetRoleAssignments(siteUrl, listIdOrTitle, itemId) {
557
- const url = `${(0, _dependencies_1.isNullOrEmptyString)(listIdOrTitle) ? (0, common_1.GetRestBaseUrl)(siteUrl) + "/web" : (0, list_1.GetListRestUrl)(siteUrl, listIdOrTitle)}/${(0, _dependencies_1.isNullOrNaN)(itemId) ? '' : `items(${itemId})/`}roleassignments?$expand=Member/users,RoleDefinitionBindings`;
558
- const result = await (0, rest_1.GetJson)(url, undefined, { jsonMetadata: _dependencies_1.jsonTypes.nometadata });
566
+ const url = `${(0, typecheckers_1.isNullOrEmptyString)(listIdOrTitle) ? (0, common_1.GetRestBaseUrl)(siteUrl) + "/web" : (0, list_1.GetListRestUrl)(siteUrl, listIdOrTitle)}/${(0, typecheckers_1.isNullOrNaN)(itemId) ? '' : `items(${itemId})/`}roleassignments?$expand=Member/users,RoleDefinitionBindings`;
567
+ const result = await (0, rest_1.GetJson)(url, undefined, { jsonMetadata: rest_types_1.jsonTypes.nometadata });
559
568
  return result.value;
560
569
  }
561
570
  exports.GetRoleAssignments = GetRoleAssignments;
@@ -575,12 +584,12 @@ async function GetAppTiles(siteUrl) {
575
584
  logger.warn('GetAppTiles does not work in an app web');
576
585
  return null;
577
586
  }
578
- return (0, rest_1.GetJson)((0, common_1.GetRestBaseUrl)(siteUrl) + "/web/AppTiles?$filter=AppType%20eq%203&$select=Title,ProductId", null, { ...rest_1.shortLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata })
587
+ return (0, rest_1.GetJson)((0, common_1.GetRestBaseUrl)(siteUrl) + "/web/AppTiles?$filter=AppType%20eq%203&$select=Title,ProductId", null, { ...rest_1.shortLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata })
579
588
  .then(r => {
580
- return (0, _dependencies_1.isNotEmptyArray)(r.value) ? r.value.map(t => {
589
+ return (0, typecheckers_1.isNotEmptyArray)(r.value) ? r.value.map(t => {
581
590
  return {
582
591
  Title: t.Title,
583
- ProductId: (0, _dependencies_1.normalizeGuid)(t.ProductId)
592
+ ProductId: (0, strings_1.normalizeGuid)(t.ProductId)
584
593
  };
585
594
  }) : [];
586
595
  })
@@ -595,26 +604,26 @@ function GetAppTilesSync(siteUrl) {
595
604
  logger.warn('GetAppTiles does not work in an app web');
596
605
  return null;
597
606
  }
598
- let r = (0, rest_1.GetJsonSync)((0, common_1.GetRestBaseUrl)(siteUrl) + "/web/AppTiles?$filter=AppType%20eq%203&$select=Title,ProductId", null, { ...rest_1.shortLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
599
- return r.success && r.result && (0, _dependencies_1.isNotEmptyArray)(r.result.value) ? r.result.value.map(t => {
607
+ let r = (0, rest_1.GetJsonSync)((0, common_1.GetRestBaseUrl)(siteUrl) + "/web/AppTiles?$filter=AppType%20eq%203&$select=Title,ProductId", null, { ...rest_1.shortLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
608
+ return r.success && r.result && (0, typecheckers_1.isNotEmptyArray)(r.result.value) ? r.result.value.map(t => {
600
609
  return {
601
610
  Title: t.Title,
602
- ProductId: (0, _dependencies_1.normalizeGuid)(t.ProductId)
611
+ ProductId: (0, strings_1.normalizeGuid)(t.ProductId)
603
612
  };
604
613
  }) : [];
605
614
  }
606
615
  exports.GetAppTilesSync = GetAppTilesSync;
607
616
  function GetWebType(WebTemplate) {
608
- return WebTemplate === "APP" ? _dependencies_1.WebTypes.App :
609
- WebTemplate === "GROUP" ? _dependencies_1.WebTypes.Group :
610
- WebTemplate === "STS" ? _dependencies_1.WebTypes.Team :
611
- _dependencies_1.WebTypes.Other;
617
+ return WebTemplate === "APP" ? sharepoint_utils_types_1.WebTypes.App :
618
+ WebTemplate === "GROUP" ? sharepoint_utils_types_1.WebTypes.Group :
619
+ WebTemplate === "STS" ? sharepoint_utils_types_1.WebTypes.Team :
620
+ sharepoint_utils_types_1.WebTypes.Other;
612
621
  }
613
622
  async function GetServerTimeZone(siteUrl) {
614
623
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
615
624
  let getTimeZoneUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/regionalSettings/timeZone`;
616
625
  let result = await (0, rest_1.GetJson)(getTimeZoneUrl, null, { ...rest_1.longLocalCache });
617
- if (result && result.d && !(0, _dependencies_1.isNullOrUndefined)(result.d)) {
626
+ if (result && result.d && !(0, typecheckers_1.isNullOrUndefined)(result.d)) {
618
627
  return result.d;
619
628
  }
620
629
  else
@@ -634,8 +643,8 @@ async function GetServerTimeOffset(siteUrl, date) {
634
643
  let dateStr = (0, date_1.toIsoDateFormat)(date, { zeroTime: true, omitZ: true });
635
644
  let inputDate = new Date(dateStr);
636
645
  let getTimeZoneOffsetUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/regionalSettings/timeZone/localTimeToUTC(@date)?@date='${encodeURIComponent(dateStr)}'`;
637
- let result = await (0, rest_1.GetJson)(getTimeZoneOffsetUrl, null, { ...rest_1.weeekLongLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
638
- if (result && !(0, _dependencies_1.isNullOrEmptyString)(result.value)) {
646
+ let result = await (0, rest_1.GetJson)(getTimeZoneOffsetUrl, null, { ...rest_1.weeekLongLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
647
+ if (result && !(0, typecheckers_1.isNullOrEmptyString)(result.value)) {
639
648
  let resultDate = new Date(result.value.slice(0, result.value.length - 1)); //remove Z and get as date.
640
649
  return (resultDate.getTime() - inputDate.getTime());
641
650
  }
@@ -655,8 +664,8 @@ function GetServerTimeOffsetSync(siteUrl, date) {
655
664
  let dateStr = (0, date_1.toIsoDateFormat)(date, { zeroTime: true, omitZ: true });
656
665
  let inputDate = new Date(dateStr);
657
666
  let getTimeZoneOffsetUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/regionalSettings/timeZone/localTimeToUTC(@date)?@date='${encodeURIComponent(dateStr)}'`;
658
- let result = (0, rest_1.GetJsonSync)(getTimeZoneOffsetUrl, null, { ...rest_1.weeekLongLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
659
- if (result && result.success && !(0, _dependencies_1.isNullOrEmptyString)(result.result.value)) {
667
+ let result = (0, rest_1.GetJsonSync)(getTimeZoneOffsetUrl, null, { ...rest_1.weeekLongLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
668
+ if (result && result.success && !(0, typecheckers_1.isNullOrEmptyString)(result.result.value)) {
660
669
  let resultDate = new Date(result.result.value.slice(0, result.result.value.length - 1)); //remove Z and get as date.
661
670
  return (resultDate.getTime() - inputDate.getTime());
662
671
  }
@@ -666,10 +675,10 @@ function GetServerTimeOffsetSync(siteUrl, date) {
666
675
  /** get date yyyy:MM:ddTHH:mm:ss NO ZED, or a date object created in the server local time, and return a date object of the corrected UTC time */
667
676
  async function SPServerLocalTimeToUTCDate(siteUrl, date) {
668
677
  //used in 7700
669
- if ((0, _dependencies_1.isNullOrEmptyString)(date))
678
+ if ((0, typecheckers_1.isNullOrEmptyString)(date))
670
679
  return null;
671
680
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
672
- if (!(0, _dependencies_1.isDate)(date))
681
+ if (!(0, typecheckers_1.isDate)(date))
673
682
  date = new Date(date);
674
683
  let serverTimeOffset = await GetServerTimeOffset(siteUrl, date);
675
684
  return _SPServerLocalTimeToUTCDate(date, serverTimeOffset);
@@ -678,10 +687,10 @@ exports.SPServerLocalTimeToUTCDate = SPServerLocalTimeToUTCDate;
678
687
  /** get date yyyy:MM:ddTHH:mm:ss NO ZED, or a date object created in the server local time, and return a date object of the corrected UTC time */
679
688
  function SPServerLocalTimeToUTCDateSync(siteUrl, date) {
680
689
  //used in 7700
681
- if ((0, _dependencies_1.isNullOrEmptyString)(date))
690
+ if ((0, typecheckers_1.isNullOrEmptyString)(date))
682
691
  return null;
683
692
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
684
- if (!(0, _dependencies_1.isDate)(date))
693
+ if (!(0, typecheckers_1.isDate)(date))
685
694
  date = new Date(date);
686
695
  let serverTimeOffset = GetServerTimeOffsetSync(siteUrl, date);
687
696
  return _SPServerLocalTimeToUTCDate(date, serverTimeOffset);
@@ -698,11 +707,11 @@ function _SPServerLocalTimeToUTCDate(date, serverTimeOffset) {
698
707
  */
699
708
  async function SPServerLocalTimeToUTC(siteUrl, date) {
700
709
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
701
- if ((0, _dependencies_1.isDate)(date)) {
710
+ if ((0, typecheckers_1.isDate)(date)) {
702
711
  date = (0, date_1.toIsoDateFormat)(date, { omitZ: true });
703
712
  }
704
713
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/regionalSettings/timeZone/localTimeToUTC(@date)?@date='${encodeURIComponent(date)}'`;
705
- let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.weeekLongLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
714
+ let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.weeekLongLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
706
715
  return result && result.value || null;
707
716
  }
708
717
  exports.SPServerLocalTimeToUTC = SPServerLocalTimeToUTC;
@@ -714,11 +723,11 @@ exports.SPServerLocalTimeToUTC = SPServerLocalTimeToUTC;
714
723
  */
715
724
  function SPServerLocalTimeToUTCSync(siteUrl, date) {
716
725
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
717
- if ((0, _dependencies_1.isDate)(date)) {
726
+ if ((0, typecheckers_1.isDate)(date)) {
718
727
  date = (0, date_1.toIsoDateFormat)(date, { omitZ: true });
719
728
  }
720
729
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/regionalSettings/timeZone/localTimeToUTC(@date)?@date='${encodeURIComponent(date)}'`;
721
- let result = (0, rest_1.GetJsonSync)(restUrl, null, { ...rest_1.weeekLongLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
730
+ let result = (0, rest_1.GetJsonSync)(restUrl, null, { ...rest_1.weeekLongLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
722
731
  return result.success && result.result.value || null;
723
732
  }
724
733
  exports.SPServerLocalTimeToUTCSync = SPServerLocalTimeToUTCSync;
@@ -728,11 +737,11 @@ exports.SPServerLocalTimeToUTCSync = SPServerLocalTimeToUTCSync;
728
737
  */
729
738
  async function UTCToSPServerLocalTime(siteUrl, date) {
730
739
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
731
- if ((0, _dependencies_1.isDate)(date)) {
740
+ if ((0, typecheckers_1.isDate)(date)) {
732
741
  date = (0, date_1.toIsoDateFormat)(date);
733
742
  }
734
743
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/regionalSettings/timeZone/utcToLocalTime(@date)?@date='${encodeURIComponent(date)}'`;
735
- let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.longLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
744
+ let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.longLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
736
745
  return result && result.value || null;
737
746
  }
738
747
  exports.UTCToSPServerLocalTime = UTCToSPServerLocalTime;
@@ -742,20 +751,20 @@ exports.UTCToSPServerLocalTime = UTCToSPServerLocalTime;
742
751
  */
743
752
  function UTCToSPServerLocalTimeSync(siteUrl, date) {
744
753
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
745
- if ((0, _dependencies_1.isDate)(date)) {
754
+ if ((0, typecheckers_1.isDate)(date)) {
746
755
  date = (0, date_1.toIsoDateFormat)(date);
747
756
  }
748
757
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/regionalSettings/timeZone/utcToLocalTime(@date)?@date='${encodeURIComponent(date)}'`;
749
- let result = (0, rest_1.GetJsonSync)(restUrl, null, { ...rest_1.longLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
758
+ let result = (0, rest_1.GetJsonSync)(restUrl, null, { ...rest_1.longLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
750
759
  return result.success && result.result.value || null;
751
760
  }
752
761
  exports.UTCToSPServerLocalTimeSync = UTCToSPServerLocalTimeSync;
753
762
  function SPServerLocalTimeSync(siteUrl) {
754
763
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
755
- var clientNowServerDeltas = (0, _dependencies_1.getGlobal)("ClientNowServerDeltas");
764
+ var clientNowServerDeltas = (0, objects_1.getGlobal)("ClientNowServerDeltas");
756
765
  var clientNowServerDelta = clientNowServerDeltas[siteUrl];
757
766
  var now = new Date();
758
- if ((0, _dependencies_1.isNullOrUndefined)(clientNowServerDelta)) {
767
+ if ((0, typecheckers_1.isNullOrUndefined)(clientNowServerDelta)) {
759
768
  var local = UTCToSPServerLocalTimeSync(siteUrl, now.toISOString());
760
769
  clientNowServerDelta = (+now - +(new Date(local)));
761
770
  clientNowServerDeltas[siteUrl] = clientNowServerDelta;
@@ -766,10 +775,10 @@ function SPServerLocalTimeSync(siteUrl) {
766
775
  exports.SPServerLocalTimeSync = SPServerLocalTimeSync;
767
776
  async function SPServerLocalTime(siteUrl) {
768
777
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
769
- var clientNowServerDeltas = (0, _dependencies_1.getGlobal)("ClientNowServerDeltas");
778
+ var clientNowServerDeltas = (0, objects_1.getGlobal)("ClientNowServerDeltas");
770
779
  var clientNowServerDelta = clientNowServerDeltas[siteUrl];
771
780
  var now = new Date();
772
- if ((0, _dependencies_1.isNullOrUndefined)(clientNowServerDelta)) {
781
+ if ((0, typecheckers_1.isNullOrUndefined)(clientNowServerDelta)) {
773
782
  var local = await UTCToSPServerLocalTime(siteUrl, now.toISOString());
774
783
  clientNowServerDelta = (+now - +(new Date(local)));
775
784
  clientNowServerDeltas[siteUrl] = clientNowServerDelta;
@@ -787,7 +796,7 @@ function GetContextWebInformationSync(siteUrl) {
787
796
  }
788
797
  else {
789
798
  siteId = GetSiteIdSync(siteUrl);
790
- if ((0, _dependencies_1.isNullOrEmptyString)(siteId)) {
799
+ if ((0, typecheckers_1.isNullOrEmptyString)(siteId)) {
791
800
  return null;
792
801
  }
793
802
  }
@@ -796,7 +805,7 @@ function GetContextWebInformationSync(siteUrl) {
796
805
  maxAge: 5 * 60,
797
806
  includeDigestInPost: false,
798
807
  allowCache: true,
799
- postCacheKey: `GetContextWebInformation_${(0, _dependencies_1.normalizeGuid)(siteId)}`
808
+ postCacheKey: `GetContextWebInformation_${(0, strings_1.normalizeGuid)(siteId)}`
800
809
  });
801
810
  if (result && result.success) {
802
811
  return result.result.d.GetContextWebInformation;
@@ -809,24 +818,24 @@ exports.GetContextWebInformationSync = GetContextWebInformationSync;
809
818
  function _getCustomActionsBaseRestUrl(siteUrl, options = {}) {
810
819
  const { listId, actionId } = { ...options };
811
820
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web`;
812
- if (!(0, _dependencies_1.isNullOrEmptyString)(listId)) {
813
- restUrl += `/lists('${(0, _dependencies_1.normalizeGuid)(listId)}')`;
821
+ if (!(0, typecheckers_1.isNullOrEmptyString)(listId)) {
822
+ restUrl += `/lists('${(0, strings_1.normalizeGuid)(listId)}')`;
814
823
  }
815
824
  restUrl += `/UserCustomActions`;
816
- if (!(0, _dependencies_1.isNullOrEmptyString)(actionId)) {
825
+ if (!(0, typecheckers_1.isNullOrEmptyString)(actionId)) {
817
826
  restUrl += `('${actionId}')`;
818
827
  }
819
828
  return restUrl;
820
829
  }
821
830
  function _parseCustomActionReponse(action) {
822
- if ((0, _dependencies_1.isNullOrUndefined)(action)) {
831
+ if ((0, typecheckers_1.isNullOrUndefined)(action)) {
823
832
  return action;
824
833
  }
825
- if (!(0, _dependencies_1.isNullOrUndefined)(action.Rights)) {
826
- if ((0, _dependencies_1.isNumeric)(action.Rights.High)) {
834
+ if (!(0, typecheckers_1.isNullOrUndefined)(action.Rights)) {
835
+ if ((0, typecheckers_1.isNumeric)(action.Rights.High)) {
827
836
  action.Rights.High = Number(action.Rights.High);
828
837
  }
829
- if ((0, _dependencies_1.isNumeric)(action.Rights.Low)) {
838
+ if ((0, typecheckers_1.isNumeric)(action.Rights.Low)) {
830
839
  action.Rights.Low = Number(action.Rights.Low);
831
840
  }
832
841
  }
@@ -836,7 +845,7 @@ function _convertCustomActionToPostData(action) {
836
845
  //The rest end point expects the rights in string format for some odd reason despite IBasePermissions being stored
837
846
  //as High/Low numbers and the methods using numbers (ie. SPBasePermission). Even EffectiveBasePermissions on
838
847
  //a list are stored using numbers.
839
- let hasRights = !(0, _dependencies_1.isNullOrUndefined)(action.Rights);
848
+ let hasRights = !(0, typecheckers_1.isNullOrUndefined)(action.Rights);
840
849
  let partialAction;
841
850
  if (hasRights) {
842
851
  partialAction = {
@@ -855,12 +864,12 @@ async function GetUserCustomActions(siteUrl, listId, allowCache = true) {
855
864
  let restUrl = _getCustomActionsBaseRestUrl(siteUrl, { listId: listId });
856
865
  let cacheOptions = allowCache === true ? rest_1.shortLocalCache : { allowCache: false };
857
866
  let restOptions = {
858
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
867
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
859
868
  ...cacheOptions
860
869
  };
861
870
  try {
862
871
  let response = await (0, rest_1.GetJson)(restUrl, null, restOptions);
863
- if (!(0, _dependencies_1.isNullOrUndefined)(response) && !(0, _dependencies_1.isNullOrEmptyArray)(response.value)) {
872
+ if (!(0, typecheckers_1.isNullOrUndefined)(response) && !(0, typecheckers_1.isNullOrEmptyArray)(response.value)) {
864
873
  return response.value.map(_parseCustomActionReponse);
865
874
  }
866
875
  }
@@ -874,12 +883,12 @@ async function GetUserCustomActionById(siteUrl, customActionId, listId, allowCac
874
883
  let restUrl = _getCustomActionsBaseRestUrl(siteUrl, { listId: listId, actionId: customActionId });
875
884
  let cacheOptions = allowCache === true ? rest_1.shortLocalCache : { allowCache: false };
876
885
  let restOptions = {
877
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
886
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
878
887
  ...cacheOptions
879
888
  };
880
889
  try {
881
890
  let response = await (0, rest_1.GetJson)(restUrl, null, restOptions);
882
- if (!(0, _dependencies_1.isNullOrUndefined)(response)) {
891
+ if (!(0, typecheckers_1.isNullOrUndefined)(response)) {
883
892
  return _parseCustomActionReponse(response);
884
893
  }
885
894
  }
@@ -893,12 +902,12 @@ async function GetUserCustomActionByName(siteUrl, name, listId, allowCache = tru
893
902
  let restUrl = `${_getCustomActionsBaseRestUrl(siteUrl, { listId: listId })}?$filter=Name eq '${encodeURIComponent(name)}'`;
894
903
  let cacheOptions = allowCache === true ? rest_1.shortLocalCache : { allowCache: false };
895
904
  let restOptions = {
896
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
905
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
897
906
  ...cacheOptions
898
907
  };
899
908
  try {
900
909
  let response = await (0, rest_1.GetJson)(restUrl, null, restOptions);
901
- if (!(0, _dependencies_1.isNullOrUndefined)(response) && !(0, _dependencies_1.isNullOrEmptyArray)(response.value)) {
910
+ if (!(0, typecheckers_1.isNullOrUndefined)(response) && !(0, typecheckers_1.isNullOrEmptyArray)(response.value)) {
902
911
  return response.value.map(_parseCustomActionReponse);
903
912
  }
904
913
  }
@@ -911,14 +920,14 @@ exports.GetUserCustomActionByName = GetUserCustomActionByName;
911
920
  async function AddUserCustomAction(siteUrl, userCustomActionInfo, listId) {
912
921
  let restUrl = _getCustomActionsBaseRestUrl(siteUrl, { listId: listId });
913
922
  let restOptions = {
914
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
923
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
915
924
  method: "POST",
916
925
  includeDigestInPost: true
917
926
  };
918
927
  try {
919
928
  let data = _convertCustomActionToPostData(userCustomActionInfo);
920
929
  let response = await (0, rest_1.GetJson)(restUrl, JSON.stringify(data), restOptions);
921
- if (!(0, _dependencies_1.isNullOrUndefined)(response)) {
930
+ if (!(0, typecheckers_1.isNullOrUndefined)(response)) {
922
931
  return _parseCustomActionReponse(response);
923
932
  }
924
933
  }
@@ -931,7 +940,7 @@ exports.AddUserCustomAction = AddUserCustomAction;
931
940
  async function UpdateUserCustomAction(siteUrl, customActionId, userCustomActionInfo, listId) {
932
941
  let restUrl = _getCustomActionsBaseRestUrl(siteUrl, { listId: listId, actionId: customActionId });
933
942
  let restOptions = {
934
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
943
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
935
944
  method: "POST",
936
945
  xHttpMethod: "MERGE",
937
946
  includeDigestInPost: true
@@ -939,7 +948,7 @@ async function UpdateUserCustomAction(siteUrl, customActionId, userCustomActionI
939
948
  try {
940
949
  let data = _convertCustomActionToPostData(userCustomActionInfo);
941
950
  let result = await (0, rest_1.GetJson)(restUrl, JSON.stringify(data), restOptions);
942
- return !(0, _dependencies_1.isNullOrUndefined)(result) && result["odata.null"] === true || (0, _dependencies_1.isNullOrEmptyString)(result);
951
+ return !(0, typecheckers_1.isNullOrUndefined)(result) && result["odata.null"] === true || (0, typecheckers_1.isNullOrEmptyString)(result);
943
952
  }
944
953
  catch {
945
954
  }
@@ -950,14 +959,14 @@ exports.UpdateUserCustomAction = UpdateUserCustomAction;
950
959
  async function DeleteUserCustomAction(siteUrl, customActionId, listId) {
951
960
  let restUrl = _getCustomActionsBaseRestUrl(siteUrl, { listId: listId, actionId: customActionId });
952
961
  let restOptions = {
953
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
962
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
954
963
  method: "POST",
955
964
  xHttpMethod: "DELETE",
956
965
  includeDigestInPost: true
957
966
  };
958
967
  try {
959
968
  let result = await (0, rest_1.GetJson)(restUrl, null, restOptions);
960
- return !(0, _dependencies_1.isNullOrUndefined)(result) && result["odata.null"] === true || (0, _dependencies_1.isNullOrEmptyString)(result);
969
+ return !(0, typecheckers_1.isNullOrUndefined)(result) && result["odata.null"] === true || (0, typecheckers_1.isNullOrEmptyString)(result);
961
970
  }
962
971
  catch {
963
972
  }
@@ -969,7 +978,7 @@ async function GetRegionalSettings(siteUrl) {
969
978
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
970
979
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/regionalSettings`;
971
980
  try {
972
- let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.mediumLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
981
+ let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.mediumLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
973
982
  return result;
974
983
  }
975
984
  catch {
@@ -982,7 +991,7 @@ async function GetAllWebProperties(siteUrl) {
982
991
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
983
992
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/AllProperties`;
984
993
  try {
985
- let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.shortLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
994
+ let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.shortLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
986
995
  return result;
987
996
  }
988
997
  catch {
@@ -995,8 +1004,8 @@ async function GetWebPropertyByName(name, siteUrl) {
995
1004
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
996
1005
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/AllProperties?$select=${name}`;
997
1006
  try {
998
- let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.shortLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
999
- if (!(0, _dependencies_1.isNullOrUndefined)(result) && !(0, _dependencies_1.isNullOrUndefined)(result[name])) {
1007
+ let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.shortLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
1008
+ if (!(0, typecheckers_1.isNullOrUndefined)(result) && !(0, typecheckers_1.isNullOrUndefined)(result[name])) {
1000
1009
  return result[name];
1001
1010
  }
1002
1011
  }
@@ -1012,23 +1021,23 @@ function getFormDigest(serverRelativeWebUrl) {
1012
1021
  exports.getFormDigest = getFormDigest;
1013
1022
  function ensureLegacyProps(pageContext) {
1014
1023
  try {
1015
- let isContextOk = (ctx) => !(0, _dependencies_1.isNullOrUndefined)(ctx) && !(0, _dependencies_1.isNullOrUndefined)(ctx.webServerRelativeUrl);
1016
- let getLegacyContext = (ctx) => !(0, _dependencies_1.isNullOrUndefined)(ctx) && !(0, _dependencies_1.isNullOrUndefined)(ctx.legacyPageContext) ? ctx.legacyPageContext : null;
1024
+ let isContextOk = (ctx) => !(0, typecheckers_1.isNullOrUndefined)(ctx) && !(0, typecheckers_1.isNullOrUndefined)(ctx.webServerRelativeUrl);
1025
+ let getLegacyContext = (ctx) => !(0, typecheckers_1.isNullOrUndefined)(ctx) && !(0, typecheckers_1.isNullOrUndefined)(ctx.legacyPageContext) ? ctx.legacyPageContext : null;
1017
1026
  let getContext = (ctx) => isContextOk(ctx) ? ctx : getLegacyContext(ctx);
1018
- if ((0, _dependencies_1.isTypeofFullNameNullOrUndefined)("_spPageContextInfo") || !isContextOk(_spPageContextInfo)) {
1019
- logger.info(`_spPageContextInfo ${(0, _dependencies_1.isTypeofFullNameNullOrUndefined)("_spPageContextInfo") ? 'is missing' : 'is broken'}, wrapping with our property`);
1027
+ if ((0, typecheckers_1.isTypeofFullNameNullOrUndefined)("_spPageContextInfo") || !isContextOk(_spPageContextInfo)) {
1028
+ logger.info(`_spPageContextInfo ${(0, typecheckers_1.isTypeofFullNameNullOrUndefined)("_spPageContextInfo") ? 'is missing' : 'is broken'}, wrapping with our property`);
1020
1029
  //bug in SPFx during inplace left navigation will put an SPFx object into this global. Correct it using the setter.
1021
1030
  let _currentContext = pageContext.legacyPageContext;
1022
1031
  Object.defineProperty(window, "_spPageContextInfo", {
1023
1032
  set: (newContext) => {
1024
- if (!(0, _dependencies_1.isNullOrUndefined)(newContext)) {
1033
+ if (!(0, typecheckers_1.isNullOrUndefined)(newContext)) {
1025
1034
  if (isContextOk(newContext)) {
1026
1035
  logger.debug("Context ok");
1027
1036
  _currentContext = newContext;
1028
1037
  }
1029
1038
  else {
1030
1039
  let legacy = getLegacyContext(newContext);
1031
- if (!(0, _dependencies_1.isNullOrUndefined)(legacy)) {
1040
+ if (!(0, typecheckers_1.isNullOrUndefined)(legacy)) {
1032
1041
  logger.error("Context NOT ok - using legacy context");
1033
1042
  _currentContext = legacy;
1034
1043
  }
@@ -1047,34 +1056,34 @@ function ensureLegacyProps(pageContext) {
1047
1056
  exports.ensureLegacyProps = ensureLegacyProps;
1048
1057
  async function WebHasUniquePermissions(siteUrl) {
1049
1058
  let url = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web?$select=hasuniqueroleassignments`;
1050
- let has = await (0, rest_1.GetJson)(url, undefined, { allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
1059
+ let has = await (0, rest_1.GetJson)(url, undefined, { allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata });
1051
1060
  return has.HasUniqueRoleAssignments === true;
1052
1061
  }
1053
1062
  exports.WebHasUniquePermissions = WebHasUniquePermissions;
1054
1063
  async function RestoreWebPermissionInheritance(siteUrl) {
1055
1064
  let url = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/ResetRoleInheritance`;
1056
- await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata, spWebUrl: siteUrl });
1065
+ await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata, spWebUrl: siteUrl });
1057
1066
  }
1058
1067
  exports.RestoreWebPermissionInheritance = RestoreWebPermissionInheritance;
1059
1068
  async function BreakWebPermissionInheritance(siteUrl, clear = true) {
1060
1069
  let url = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/breakroleinheritance(copyRoleAssignments=${clear ? 'false' : 'true'}, clearSubscopes=true)`;
1061
- await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata, spWebUrl: siteUrl });
1070
+ await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata, spWebUrl: siteUrl });
1062
1071
  }
1063
1072
  exports.BreakWebPermissionInheritance = BreakWebPermissionInheritance;
1064
1073
  async function AssignWebPermission(siteUrl, principalId, roleId) {
1065
1074
  let url = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/roleassignments/addroleassignment(principalid=${principalId},roleDefId=${roleId})`;
1066
- await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata, spWebUrl: siteUrl });
1075
+ await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata, spWebUrl: siteUrl });
1067
1076
  }
1068
1077
  exports.AssignWebPermission = AssignWebPermission;
1069
1078
  async function RemoveWebPermission(siteUrl, principalId, roleId) {
1070
1079
  let url = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/roleassignments/removeroleassignment(principalid=${principalId},roleDefId=${roleId})`;
1071
- await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata, spWebUrl: siteUrl });
1080
+ await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata, spWebUrl: siteUrl });
1072
1081
  }
1073
1082
  exports.RemoveWebPermission = RemoveWebPermission;
1074
1083
  /** set a user as site admin - rejects/throws if not successful */
1075
1084
  async function SetUserAsSiteAdmin(siteUrl, userId) {
1076
1085
  const url = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/getuserbyid(${userId})`;
1077
- await (0, rest_1.GetJson)(url, (0, _dependencies_1.jsonStringify)({
1086
+ await (0, rest_1.GetJson)(url, (0, json_1.jsonStringify)({
1078
1087
  "__metadata": { "type": "SP.User" },
1079
1088
  "IsSiteAdmin": true
1080
1089
  }), { method: 'POST', xHttpMethod: 'MERGE' });
@@ -1085,9 +1094,9 @@ exports.SetUserAsSiteAdmin = SetUserAsSiteAdmin;
1085
1094
  async function GetAvailableTagsForSite(siteUrlOrId) {
1086
1095
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
1087
1096
  try {
1088
- let url = `${siteUrl}_api/SP.CompliancePolicy.SPPolicyStoreProxy.GetAvailableTagsForSite(siteUrl=@a1)?@a1='${encodeURIComponent((0, _dependencies_1.makeFullUrl)(siteUrl))}'`;
1097
+ let url = `${siteUrl}_api/SP.CompliancePolicy.SPPolicyStoreProxy.GetAvailableTagsForSite(siteUrl=@a1)?@a1='${encodeURIComponent((0, url_1.makeFullUrl)(siteUrl))}'`;
1089
1098
  let result = await (0, rest_1.GetJson)(url, null, {
1090
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
1099
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
1091
1100
  });
1092
1101
  return result.value;
1093
1102
  }
@@ -1100,9 +1109,9 @@ exports.GetAvailableTagsForSite = GetAvailableTagsForSite;
1100
1109
  function GetAvailableTagsForSiteSync(siteUrlOrId) {
1101
1110
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
1102
1111
  try {
1103
- let url = `${siteUrl}_api/SP.CompliancePolicy.SPPolicyStoreProxy.GetAvailableTagsForSite(siteUrl=@a1)?@a1='${encodeURIComponent((0, _dependencies_1.makeFullUrl)(siteUrl))}'`;
1112
+ let url = `${siteUrl}_api/SP.CompliancePolicy.SPPolicyStoreProxy.GetAvailableTagsForSite(siteUrl=@a1)?@a1='${encodeURIComponent((0, url_1.makeFullUrl)(siteUrl))}'`;
1104
1113
  let response = (0, rest_1.GetJsonSync)(url, null, {
1105
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
1114
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
1106
1115
  });
1107
1116
  return response.success ? response.result.value : [];
1108
1117
  }
@@ -1117,7 +1126,7 @@ async function GetActiveFeatures(siteUrlOrId, allowCache = true) {
1117
1126
  let url = `${siteUrl}/_api/web/features?$select=DisplayName,DefinitionId`;
1118
1127
  let response = await (0, rest_1.GetJson)(url, null, {
1119
1128
  method: "GET",
1120
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
1129
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
1121
1130
  includeDigestInGet: true,
1122
1131
  ...(allowCache === true ? rest_1.mediumLocalCache : rest_1.noLocalCache)
1123
1132
  });
@@ -1131,14 +1140,14 @@ exports.GetActiveFeatures = GetActiveFeatures;
1131
1140
  async function ActivateFeature(siteUrlOrId, id) {
1132
1141
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
1133
1142
  try {
1134
- id = (0, _dependencies_1.normalizeGuid)(id);
1143
+ id = (0, strings_1.normalizeGuid)(id);
1135
1144
  let url = `${siteUrl}/_api/web/features/add('${id}')`;
1136
1145
  let response = await (0, rest_1.GetJson)(url, null, {
1137
1146
  method: "POST",
1138
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
1147
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
1139
1148
  includeDigestInPost: true
1140
1149
  });
1141
- return !(0, _dependencies_1.isNullOrUndefined)(response) && (0, _dependencies_1.normalizeGuid)(response.DefinitionId) === id;
1150
+ return !(0, typecheckers_1.isNullOrUndefined)(response) && (0, strings_1.normalizeGuid)(response.DefinitionId) === id;
1142
1151
  }
1143
1152
  catch {
1144
1153
  }
@@ -1148,14 +1157,14 @@ exports.ActivateFeature = ActivateFeature;
1148
1157
  async function DectivateFeature(siteUrlOrId, id) {
1149
1158
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
1150
1159
  try {
1151
- id = (0, _dependencies_1.normalizeGuid)(id);
1160
+ id = (0, strings_1.normalizeGuid)(id);
1152
1161
  let url = `${siteUrl}/_api/web/features/remove('${id}')`;
1153
1162
  let response = await (0, rest_1.GetJson)(url, null, {
1154
1163
  method: "POST",
1155
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
1164
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
1156
1165
  includeDigestInPost: true
1157
1166
  });
1158
- return !(0, _dependencies_1.isNullOrUndefined)(response) && response["odata.null"] === true;
1167
+ return !(0, typecheckers_1.isNullOrUndefined)(response) && response["odata.null"] === true;
1159
1168
  }
1160
1169
  catch {
1161
1170
  }
@@ -1168,9 +1177,9 @@ async function GetWelcomePage(siteUrlOrId) {
1168
1177
  let url = `${siteUrl}/_api/web/rootFolder`;
1169
1178
  let response = await (0, rest_1.GetJson)(url, null, {
1170
1179
  method: "GET",
1171
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
1180
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
1172
1181
  });
1173
- if (!(0, _dependencies_1.isNullOrUndefined)(response) && response.Exists && !(0, _dependencies_1.isNullOrEmptyString)(response.WelcomePage)) {
1182
+ if (!(0, typecheckers_1.isNullOrUndefined)(response) && response.Exists && !(0, typecheckers_1.isNullOrEmptyString)(response.WelcomePage)) {
1174
1183
  return response.WelcomePage;
1175
1184
  }
1176
1185
  }
@@ -1188,10 +1197,10 @@ async function SetWelcomePage(siteUrlOrId, welcomePage) {
1188
1197
  }), {
1189
1198
  method: "POST",
1190
1199
  xHttpMethod: "MERGE",
1191
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
1200
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
1192
1201
  includeDigestInPost: true
1193
1202
  });
1194
- return !(0, _dependencies_1.isNullOrUndefined)(response) && response["odata.null"] === true || (0, _dependencies_1.isNullOrEmptyString)(response);
1203
+ return !(0, typecheckers_1.isNullOrUndefined)(response) && response["odata.null"] === true || (0, typecheckers_1.isNullOrEmptyString)(response);
1195
1204
  }
1196
1205
  catch {
1197
1206
  }
@@ -1203,7 +1212,7 @@ async function GetWebAssociatedGroups(siteUrl) {
1203
1212
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
1204
1213
  let restUrl = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web?$select=AssociatedOwnerGroup,AssociatedMemberGroup,AssociatedVisitorGroup&$expand=AssociatedOwnerGroup,AssociatedMemberGroup,AssociatedVisitorGroup`;
1205
1214
  try {
1206
- let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.longLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
1215
+ let result = await (0, rest_1.GetJson)(restUrl, null, { ...rest_1.longLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
1207
1216
  return result;
1208
1217
  }
1209
1218
  catch {