@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,7 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateList = exports.RemoveListPermission = exports.AssignListPermission = exports.BreakListPermissionInheritance = exports.RestoreListPermissionInheritance = exports.ListHasUniquePermissions = exports.ReloadListLastModified = exports.GetListLastItemModifiedDate = exports.DeleteListEventReceiver = exports.AddListEventReceiver = exports.GetListEventReceivers = exports.FindListItemById = exports.GetListItemsSync = exports.GetListItems = exports.GetFieldSchema = exports.GetFieldSchemaSync = exports.GetListFormUrl = exports.GetListContentTypesSync = exports.GetListContentTypes = exports.RemoveViewFieldFromListView = exports.AddViewFieldToListView = exports.GetListViewsSync = exports.GetListViews = exports.DeleteField = exports.UpdateField = exports.CreateField = exports.UserHasPermissionsSync = exports.UserHasPermissions = exports.UserHasEditPermissions = exports.UserHasManagePermissions = exports.GetListWorkflows = exports.GetListFieldsAsHashSync = exports.GetListFieldsAsHash = exports.GetListFieldsSync = exports.GetListFields = exports.GetStandardListFields = exports.GetListField = exports.GetListRootFolderSync = exports.GetListRootFolder = exports.GetListName = exports.GetListNameSync = exports.GetListSync = exports.GetList = exports.GetListTitle = exports.GetSiteAssetLibrary = exports.EnsureSitePagesLibrary = exports.EnsureAssetLibrary = exports.GetListIdFromPageSync = exports.GetListId = exports.GetListRestUrl = void 0;
4
4
  exports.UpdateListExperience = exports.SearchList = 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 sharepoint_1 = require("../../helpers/sharepoint");
8
+ const strings_1 = require("../../helpers/strings");
9
+ const typecheckers_1 = require("../../helpers/typecheckers");
10
+ const url_1 = require("../../helpers/url");
11
+ const rest_types_1 = require("../../types/rest.types");
12
+ const sharepoint_types_1 = require("../../types/sharepoint.types");
6
13
  const consolelogger_1 = require("../consolelogger");
7
14
  const rest_1 = require("../rest");
8
15
  const common_1 = require("./common");
@@ -13,14 +20,14 @@ const logger = consolelogger_1.ConsoleLogger.get("SharePoint.Rest.List");
13
20
  function GetListRestUrl(siteUrl, listIdOrTitle) {
14
21
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
15
22
  let listId = GetListId(siteUrl, listIdOrTitle);
16
- let listPart = (0, _dependencies_1.isValidGuid)(listId) ? `getById('${(0, _dependencies_1.normalizeGuid)(listId)}')` : `getByTitle('${encodeURIComponent(listIdOrTitle)}')`;
23
+ let listPart = (0, typecheckers_1.isValidGuid)(listId) ? `getById('${(0, strings_1.normalizeGuid)(listId)}')` : `getByTitle('${encodeURIComponent(listIdOrTitle)}')`;
17
24
  return (0, common_1.GetRestBaseUrl)(siteUrl) + `/web/lists/${listPart}`;
18
25
  }
19
26
  exports.GetListRestUrl = GetListRestUrl;
20
27
  function GetListId(siteUrl, listIdOrTitle) {
21
- if ((0, _dependencies_1.isNullOrEmptyString)(listIdOrTitle))
28
+ if ((0, typecheckers_1.isNullOrEmptyString)(listIdOrTitle))
22
29
  return null;
23
- if ((0, _dependencies_1.isValidGuid)(listIdOrTitle))
30
+ if ((0, typecheckers_1.isValidGuid)(listIdOrTitle))
24
31
  return listIdOrTitle;
25
32
  //Issue 7508
26
33
  //When translation is enabled, and user changes list title but he is not on the same language as the site
@@ -29,20 +36,20 @@ function GetListId(siteUrl, listIdOrTitle) {
29
36
  //instead, we need to get the list id from the web's lists collection.
30
37
  let lists = (0, web_1.GetListsSync)(siteUrl);
31
38
  var lower = listIdOrTitle.toLowerCase();
32
- var list = (0, _dependencies_1.firstOrNull)(lists, l => l.Title.toLowerCase() === lower);
39
+ var list = (0, collections_base_1.firstOrNull)(lists, l => l.Title.toLowerCase() === lower);
33
40
  return list && list.Id || null;
34
41
  }
35
42
  exports.GetListId = GetListId;
36
43
  /** get the list ID from a list page, such as a list view or an item form */
37
44
  function GetListIdFromPageSync(siteUrl, listPageUrl) {
38
- let url = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/getlist('${(0, _dependencies_1.makeServerRelativeUrl)(listPageUrl.split('?')[0].split('#')[0])}')?$select=id`;
45
+ let url = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/web/getlist('${(0, url_1.makeServerRelativeUrl)(listPageUrl.split('?')[0].split('#')[0])}')?$select=id`;
39
46
  let response = (0, rest_1.GetJsonSync)(url, null, {
40
47
  ...rest_1.longLocalCache,
41
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
48
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
42
49
  });
43
- if (!(0, _dependencies_1.isNullOrUndefined)(response) && response.success) {
50
+ if (!(0, typecheckers_1.isNullOrUndefined)(response) && response.success) {
44
51
  let listId = response.result.Id;
45
- return (0, _dependencies_1.normalizeGuid)(listId);
52
+ return (0, strings_1.normalizeGuid)(listId);
46
53
  }
47
54
  return null;
48
55
  }
@@ -71,11 +78,11 @@ async function EnsureSitePagesLibrary(siteUrl) {
71
78
  + `?$select=ID,RootFolder/Name,RootFolder/ServerRelativeUrl,RootFolder/Exists&$expand=RootFolder`;
72
79
  let response = await (0, rest_1.GetJson)(url, null, {
73
80
  method: "POST",
74
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
81
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
75
82
  includeDigestInPost: true,
76
83
  ...rest_1.longLocalCache
77
84
  });
78
- if (!(0, _dependencies_1.isNullOrUndefined)(response) && !(0, _dependencies_1.isNullOrUndefined)(response.RootFolder)) {
85
+ if (!(0, typecheckers_1.isNullOrUndefined)(response) && !(0, typecheckers_1.isNullOrUndefined)(response.RootFolder)) {
79
86
  return {
80
87
  Id: response.Id,
81
88
  Name: response.RootFolder.Name,
@@ -92,9 +99,9 @@ function GetSiteAssetLibrary(siteUrl, sync) {
92
99
  + `$filter=EntityTypeName%20eq%20%27SiteAssets%27&$select=ID,RootFolder/Name,RootFolder/ServerRelativeUrl,RootFolder/Exists`
93
100
  + `&$expand=RootFolder`;
94
101
  let caller = sync ? rest_1.GetJsonSync : rest_1.GetJson;
95
- let result = caller(reqUrl, null, { ...rest_1.longLocalCache, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
102
+ let result = caller(reqUrl, null, { ...rest_1.longLocalCache, jsonMetadata: rest_types_1.jsonTypes.nometadata });
96
103
  let transform = (v) => {
97
- if ((0, _dependencies_1.isNotEmptyArray)(v && v.value)) {
104
+ if ((0, typecheckers_1.isNotEmptyArray)(v && v.value)) {
98
105
  let assetLibrary = v.value[0];
99
106
  return {
100
107
  Id: assetLibrary.Id,
@@ -104,7 +111,7 @@ function GetSiteAssetLibrary(siteUrl, sync) {
104
111
  }
105
112
  return null;
106
113
  };
107
- if ((0, _dependencies_1.isPromise)(result))
114
+ if ((0, typecheckers_1.isPromise)(result))
108
115
  return result.then(r => transform(r), () => null);
109
116
  else
110
117
  return result.success ? transform(result.result) : null;
@@ -123,7 +130,7 @@ exports.GetListTitle = GetListTitle;
123
130
  /** Return the list */
124
131
  function GetList(siteUrlOrId, listIdOrTitle, options) {
125
132
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
126
- if ((0, _dependencies_1.isNullOrEmptyString)(listIdOrTitle))
133
+ if ((0, typecheckers_1.isNullOrEmptyString)(listIdOrTitle))
127
134
  return null;
128
135
  return (0, rest_1.GetJson)(GetListRestUrl(siteUrl, listIdOrTitle) + `?$select=${common_1.LIST_SELECT}&$expand=${common_1.LIST_EXPAND}`, null, { allowCache: true })
129
136
  .then(async (r) => {
@@ -139,8 +146,8 @@ function GetList(siteUrlOrId, listIdOrTitle, options) {
139
146
  list.EventReceivers = await GetListEventReceivers(siteUrl, listIdOrTitle);
140
147
  }
141
148
  if (list.EffectiveBasePermissions
142
- && ((0, _dependencies_1.isString)(list.EffectiveBasePermissions.High)
143
- || (0, _dependencies_1.isString)(list.EffectiveBasePermissions.Low))) {
149
+ && ((0, typecheckers_1.isString)(list.EffectiveBasePermissions.High)
150
+ || (0, typecheckers_1.isString)(list.EffectiveBasePermissions.Low))) {
144
151
  list.EffectiveBasePermissions = {
145
152
  High: Number(list.EffectiveBasePermissions.High),
146
153
  Low: Number(list.EffectiveBasePermissions.Low)
@@ -154,14 +161,14 @@ exports.GetList = GetList;
154
161
  /** Return the list */
155
162
  function GetListSync(siteUrl, listIdOrTitle) {
156
163
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
157
- if ((0, _dependencies_1.isNullOrEmptyString)(listIdOrTitle))
164
+ if ((0, typecheckers_1.isNullOrEmptyString)(listIdOrTitle))
158
165
  return null;
159
166
  let result = (0, rest_1.GetJsonSync)(GetListRestUrl(siteUrl, listIdOrTitle) + `?$select=${common_1.LIST_SELECT}&$expand=${common_1.LIST_EXPAND}`, null, rest_1.shortLocalCache);
160
167
  if (result && result.success) {
161
168
  let list = result.result.d;
162
169
  if (list.EffectiveBasePermissions
163
- && ((0, _dependencies_1.isString)(list.EffectiveBasePermissions.High)
164
- || (0, _dependencies_1.isString)(list.EffectiveBasePermissions.Low))) {
170
+ && ((0, typecheckers_1.isString)(list.EffectiveBasePermissions.High)
171
+ || (0, typecheckers_1.isString)(list.EffectiveBasePermissions.Low))) {
165
172
  list.EffectiveBasePermissions = {
166
173
  High: Number(list.EffectiveBasePermissions.High),
167
174
  Low: Number(list.EffectiveBasePermissions.Low)
@@ -175,12 +182,12 @@ function GetListSync(siteUrl, listIdOrTitle) {
175
182
  exports.GetListSync = GetListSync;
176
183
  function GetListNameSync(webUrl, listIdOrTitle) {
177
184
  let list = GetListSync(webUrl, listIdOrTitle);
178
- return (0, _dependencies_1.NormalizeListName)({ EntityTypeName: list.EntityTypeName, BaseType: list.BaseType });
185
+ return (0, sharepoint_1.NormalizeListName)({ EntityTypeName: list.EntityTypeName, BaseType: list.BaseType });
179
186
  }
180
187
  exports.GetListNameSync = GetListNameSync;
181
188
  async function GetListName(webUrl, listIdOrTitle) {
182
189
  let list = await GetList(webUrl, listIdOrTitle);
183
- return (0, _dependencies_1.NormalizeListName)({ EntityTypeName: list.EntityTypeName, BaseType: list.BaseType });
190
+ return (0, sharepoint_1.NormalizeListName)({ EntityTypeName: list.EntityTypeName, BaseType: list.BaseType });
184
191
  }
185
192
  exports.GetListName = GetListName;
186
193
  function GetListRootFolder(siteUrlOrId, listIdOrTitle) {
@@ -195,14 +202,14 @@ exports.GetListRootFolder = GetListRootFolder;
195
202
  function GetListRootFolderSync(siteUrlOrId, listIdOrTitle) {
196
203
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
197
204
  let result = (0, rest_1.GetJsonSync)(GetListRestUrl(siteUrl, listIdOrTitle) + `/RootFolder?$Select=Name,ServerRelativeUrl`, null, rest_1.longLocalCache);
198
- return (0, _dependencies_1.SafeIfElse)(() => result.result.d, null);
205
+ return (0, typecheckers_1.SafeIfElse)(() => result.result.d, null);
199
206
  }
200
207
  exports.GetListRootFolderSync = GetListRootFolderSync;
201
208
  function GetListField(siteUrlOrId, listIdOrTitle, fieldIdOrName, refreshCache) {
202
209
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
203
210
  var url = GetListRestUrl(siteUrl, listIdOrTitle) + `/fields`;
204
- if ((0, _dependencies_1.isValidGuid)(fieldIdOrName)) {
205
- url += `('${(0, _dependencies_1.normalizeGuid)(fieldIdOrName)}')`;
211
+ if ((0, typecheckers_1.isValidGuid)(fieldIdOrName)) {
212
+ url += `('${(0, strings_1.normalizeGuid)(fieldIdOrName)}')`;
206
213
  }
207
214
  else {
208
215
  url += `/getbyinternalnameortitle(@u)?@u='${encodeURIComponent(fieldIdOrName)}'`;
@@ -225,11 +232,11 @@ function GetStandardListFields(siteUrlOrId, listIdOrTitle, refreshCache) {
225
232
  }
226
233
  exports.GetStandardListFields = GetStandardListFields;
227
234
  function _processGetListFields(fields, fieldNames) {
228
- if ((0, _dependencies_1.isNullOrEmptyArray)(fields)) {
235
+ if ((0, typecheckers_1.isNullOrEmptyArray)(fields)) {
229
236
  return fields;
230
237
  }
231
- let extendedFields = fields.map(f => (0, _dependencies_1.extendFieldInfo)(f, fields));
232
- if (!(0, _dependencies_1.isNullOrEmptyArray)(fieldNames)) {
238
+ let extendedFields = fields.map(f => (0, sharepoint_1.extendFieldInfo)(f, fields));
239
+ if (!(0, typecheckers_1.isNullOrEmptyArray)(fieldNames)) {
233
240
  return extendedFields.filter((extendedField) => {
234
241
  return fieldNames.includes(extendedField.InternalName);
235
242
  });
@@ -241,7 +248,7 @@ function GetListFields(siteUrlOrId, listIdOrTitle, options = {}) {
241
248
  let url = _getListFieldsRequestUrl(siteUrl, listIdOrTitle);
242
249
  let restOptions = {
243
250
  allowCache: options.refreshCache !== true,
244
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
251
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
245
252
  };
246
253
  return (0, rest_1.GetJson)(url, null, restOptions)
247
254
  .then((result) => {
@@ -256,10 +263,10 @@ function GetListFieldsSync(siteUrlOrId, listIdOrTitle, options = {}) {
256
263
  let url = _getListFieldsRequestUrl(siteUrl, listIdOrTitle);
257
264
  let restOptions = {
258
265
  allowCache: options.refreshCache !== true,
259
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
266
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
260
267
  };
261
268
  let result = (0, rest_1.GetJsonSync)(url, null, restOptions);
262
- if (result.success && !(0, _dependencies_1.isNullOrUndefined)(result.result)) {
269
+ if (result.success && !(0, typecheckers_1.isNullOrUndefined)(result.result)) {
263
270
  return _processGetListFields(result.result.value, options.fieldNames);
264
271
  }
265
272
  return null;
@@ -269,8 +276,8 @@ async function GetListFieldsAsHash(siteUrlOrId, listIdOrTitle, refreshCache) {
269
276
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
270
277
  let fields = await GetListFields(siteUrl, listIdOrTitle, { refreshCache: refreshCache });
271
278
  let hash = {};
272
- if ((0, _dependencies_1.isNotEmptyArray)(fields)) {
273
- hash = (0, _dependencies_1.toHash)(fields, f => f.InternalName);
279
+ if ((0, typecheckers_1.isNotEmptyArray)(fields)) {
280
+ hash = (0, collections_base_1.toHash)(fields, f => f.InternalName);
274
281
  }
275
282
  return hash;
276
283
  }
@@ -279,7 +286,7 @@ function GetListFieldsAsHashSync(siteUrlOrId, listIdOrTitle, refreshCache) {
279
286
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
280
287
  let fields = GetListFieldsSync(siteUrl, listIdOrTitle, { refreshCache: refreshCache });
281
288
  let hash = {};
282
- if ((0, _dependencies_1.isNotEmptyArray)(fields)) {
289
+ if ((0, typecheckers_1.isNotEmptyArray)(fields)) {
283
290
  fields.forEach(f => { hash[f.InternalName] = f; });
284
291
  }
285
292
  return hash;
@@ -289,12 +296,12 @@ function GetListWorkflows(siteUrl, listIdOrTitle, refreshCache) {
289
296
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
290
297
  return (0, rest_1.GetJson)(GetListRestUrl(siteUrl, listIdOrTitle) + `/workflowAssociations`, null, { allowCache: refreshCache !== true })
291
298
  .then(r => {
292
- if (r && r.d && (0, _dependencies_1.isNotEmptyArray)(r.d.results)) {
299
+ if (r && r.d && (0, typecheckers_1.isNotEmptyArray)(r.d.results)) {
293
300
  r.d.results.forEach(wf => {
294
- wf.BaseId = (0, _dependencies_1.normalizeGuid)(wf.BaseId);
295
- wf.Id = (0, _dependencies_1.normalizeGuid)(wf.Id);
296
- wf.ListId = (0, _dependencies_1.normalizeGuid)(wf.ListId);
297
- wf.WebId = (0, _dependencies_1.normalizeGuid)(wf.WebId);
301
+ wf.BaseId = (0, strings_1.normalizeGuid)(wf.BaseId);
302
+ wf.Id = (0, strings_1.normalizeGuid)(wf.Id);
303
+ wf.ListId = (0, strings_1.normalizeGuid)(wf.ListId);
304
+ wf.WebId = (0, strings_1.normalizeGuid)(wf.WebId);
298
305
  });
299
306
  return r.d.results;
300
307
  }
@@ -308,20 +315,20 @@ function UserHasManagePermissions(siteUrl, listIdOrTitle) {
308
315
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
309
316
  return (0, rest_1.GetJson)(GetListRestUrl(siteUrl, listIdOrTitle) + `/EffectiveBasePermissions`, null, { ...rest_1.shortLocalCache })
310
317
  .then(r => {
311
- return new _dependencies_1.SPBasePermissions(r.d.EffectiveBasePermissions).has(_dependencies_1.SPBasePermissionKind.ManageLists);
318
+ return new sharepoint_1.SPBasePermissions(r.d.EffectiveBasePermissions).has(sharepoint_types_1.SPBasePermissionKind.ManageLists);
312
319
  })
313
320
  .catch(() => null);
314
321
  }
315
322
  exports.UserHasManagePermissions = UserHasManagePermissions;
316
323
  function UserHasEditPermissions(siteUrl, listIdOrTitle) {
317
- return UserHasPermissions(siteUrl, listIdOrTitle, _dependencies_1.SPBasePermissionKind.EditListItems);
324
+ return UserHasPermissions(siteUrl, listIdOrTitle, sharepoint_types_1.SPBasePermissionKind.EditListItems);
318
325
  }
319
326
  exports.UserHasEditPermissions = UserHasEditPermissions;
320
327
  function UserHasPermissions(siteUrlOrId, listIdOrTitle, permissionKind) {
321
328
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
322
329
  return (0, rest_1.GetJson)(GetListRestUrl(siteUrl, listIdOrTitle) + `/EffectiveBasePermissions`, null, { ...rest_1.shortLocalCache })
323
330
  .then(r => {
324
- return new _dependencies_1.SPBasePermissions(r.d.EffectiveBasePermissions).has(permissionKind);
331
+ return new sharepoint_1.SPBasePermissions(r.d.EffectiveBasePermissions).has(permissionKind);
325
332
  })
326
333
  .catch(() => null);
327
334
  }
@@ -329,7 +336,7 @@ exports.UserHasPermissions = UserHasPermissions;
329
336
  function UserHasPermissionsSync(siteUrlOrId, listIdOrTitle, permissionKind) {
330
337
  let siteUrl = (0, common_1.GetSiteUrl)(siteUrlOrId);
331
338
  const res = (0, rest_1.GetJsonSync)(GetListRestUrl(siteUrl, listIdOrTitle) + `/EffectiveBasePermissions`, null, { ...rest_1.shortLocalCache });
332
- return new _dependencies_1.SPBasePermissions(res.result.d.EffectiveBasePermissions).has(permissionKind);
339
+ return new sharepoint_1.SPBasePermissions(res.result.d.EffectiveBasePermissions).has(permissionKind);
333
340
  }
334
341
  exports.UserHasPermissionsSync = UserHasPermissionsSync;
335
342
  /** create a new column and try to add it to default view. Send either Title and Type, or SchemaXml. Create with SchemaXml also adds to all content types */
@@ -346,16 +353,16 @@ async function CreateField(siteUrl, listIdOrTitle, options) {
346
353
  if (options.SkipAddToDefaultView !== true) {
347
354
  //try to add it to default view, don't wait for it
348
355
  GetListViews(siteUrl, listIdOrTitle).then(views => {
349
- let defaultView = (0, _dependencies_1.firstOrNull)(views, v => v.DefaultView);
356
+ let defaultView = (0, collections_base_1.firstOrNull)(views, v => v.DefaultView);
350
357
  if (defaultView)
351
358
  (0, rest_1.GetJson)(GetListRestUrl(siteUrl, listIdOrTitle) + `/views('${defaultView.Id}')/ViewFields/addViewField('${internalName}')`, null, { method: "POST", spWebUrl: siteUrl });
352
359
  });
353
360
  }
354
361
  }
355
362
  catch (e) { }
356
- return (0, _dependencies_1.firstOrNull)(fields, f => f.InternalName === internalName);
363
+ return (0, collections_base_1.firstOrNull)(fields, f => f.InternalName === internalName);
357
364
  };
358
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.SchemaXml)) {
365
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.SchemaXml)) {
359
366
  try {
360
367
  let updateObject = {
361
368
  'parameters': {
@@ -368,10 +375,10 @@ async function CreateField(siteUrl, listIdOrTitle, options) {
368
375
  };
369
376
  let url = `${GetListRestUrl(siteUrl, listIdOrTitle)}/fields/createFieldAsXml`;
370
377
  let newFieldResult = await (0, rest_1.GetJson)(url, JSON.stringify(updateObject));
371
- if (!(0, _dependencies_1.isNullOrUndefined)(newFieldResult)
372
- && !(0, _dependencies_1.isNullOrUndefined)(newFieldResult.d)) {
373
- if ((!(0, _dependencies_1.isNullOrEmptyString)(options.Title) && options.Title !== newFieldResult.d.Title)
374
- || ((0, _dependencies_1.isBoolean)(options.Indexed) && options.Indexed !== newFieldResult.d.Indexed)) {
378
+ if (!(0, typecheckers_1.isNullOrUndefined)(newFieldResult)
379
+ && !(0, typecheckers_1.isNullOrUndefined)(newFieldResult.d)) {
380
+ if ((!(0, typecheckers_1.isNullOrEmptyString)(options.Title) && options.Title !== newFieldResult.d.Title)
381
+ || ((0, typecheckers_1.isBoolean)(options.Indexed) && options.Indexed !== newFieldResult.d.Indexed)) {
375
382
  let updatedField = await UpdateField(siteUrl, listIdOrTitle, newFieldResult.d.InternalName, {
376
383
  Title: options.Title,
377
384
  Indexed: options.Indexed === true
@@ -385,7 +392,7 @@ async function CreateField(siteUrl, listIdOrTitle, options) {
385
392
  }
386
393
  return null;
387
394
  }
388
- else if (!(0, _dependencies_1.isNullOrEmptyString)(options.Title) && !(0, _dependencies_1.isNullOrUndefined)(options.Type)) {
395
+ else if (!(0, typecheckers_1.isNullOrEmptyString)(options.Title) && !(0, typecheckers_1.isNullOrUndefined)(options.Type)) {
389
396
  let updateObject = {
390
397
  '__metadata': { 'type': 'SP.Field' },
391
398
  'Title': options.Title,
@@ -393,13 +400,13 @@ async function CreateField(siteUrl, listIdOrTitle, options) {
393
400
  'Required': options.Required === true,
394
401
  'Indexed': options.Indexed === true
395
402
  };
396
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.ClientSideComponentId)) {
403
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.ClientSideComponentId)) {
397
404
  updateObject.ClientSideComponentId = options.ClientSideComponentId;
398
405
  }
399
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.ClientSideComponentProperties)) {
406
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.ClientSideComponentProperties)) {
400
407
  updateObject.ClientSideComponentProperties = options.ClientSideComponentProperties;
401
408
  }
402
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.JSLink)) {
409
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.JSLink)) {
403
410
  updateObject.JSLink = options.JSLink;
404
411
  }
405
412
  try {
@@ -423,7 +430,7 @@ async function UpdateField(siteUrlOrId, listIdOrTitle, fieldInternalName, option
423
430
  let finish = async () => {
424
431
  //we need to clear and reload the list fields cache, so call it and return our field from that collection.
425
432
  let fields = await GetListFields(siteUrl, listIdOrTitle, { refreshCache: true });
426
- return (0, _dependencies_1.firstOrNull)(fields, f => f.InternalName === fieldInternalName);
433
+ return (0, collections_base_1.firstOrNull)(fields, f => f.InternalName === fieldInternalName);
427
434
  };
428
435
  let fields = await GetListFieldsAsHash(siteUrl, listIdOrTitle, true);
429
436
  let thisField = fields[fieldInternalName];
@@ -431,24 +438,24 @@ async function UpdateField(siteUrlOrId, listIdOrTitle, fieldInternalName, option
431
438
  let updates = {
432
439
  '__metadata': { 'type': 'SP.Field' }
433
440
  };
434
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.SchemaXml)) {
441
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.SchemaXml)) {
435
442
  updates.SchemaXml = options.SchemaXml;
436
443
  }
437
444
  else {
438
445
  //cannot send schema updates with other updates.
439
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.Title)) {
446
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.Title)) {
440
447
  updates.Title = options.Title;
441
448
  }
442
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.FieldType)) {
449
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.FieldType)) {
443
450
  updates.TypeAsString = options.FieldType;
444
451
  }
445
- if ((0, _dependencies_1.isBoolean)(options.Required)) {
452
+ if ((0, typecheckers_1.isBoolean)(options.Required)) {
446
453
  updates.Required = options.Required === true;
447
454
  }
448
- if ((0, _dependencies_1.isBoolean)(options.Indexed)) {
455
+ if ((0, typecheckers_1.isBoolean)(options.Indexed)) {
449
456
  updates.Indexed = options.Indexed === true;
450
457
  }
451
- if (!(0, _dependencies_1.isNullOrEmptyArray)(options.Choices)) {
458
+ if (!(0, typecheckers_1.isNullOrEmptyArray)(options.Choices)) {
452
459
  let choiceType = options.FieldType || thisField.TypeAsString;
453
460
  if (choiceType === "Choice" || choiceType === "MultiChoice") {
454
461
  updates["__metadata"]["type"] = choiceType === "Choice" ? "SP.FieldChoice" : "SP.FieldMultiChoice";
@@ -458,7 +465,7 @@ async function UpdateField(siteUrlOrId, listIdOrTitle, fieldInternalName, option
458
465
  logger.warn("Can only update 'Choices' property on 'Choice' and 'MultiChoice' field types.");
459
466
  }
460
467
  }
461
- if ((0, _dependencies_1.isBoolean)(options.Hidden)) {
468
+ if ((0, typecheckers_1.isBoolean)(options.Hidden)) {
462
469
  //this requries the CanToggleHidden to be in the schema... if not - we will need to add it before we can update this.
463
470
  let fields = await GetListFieldsAsHash(siteUrl, listIdOrTitle, false);
464
471
  let thisField = fields[fieldInternalName];
@@ -473,11 +480,11 @@ async function UpdateField(siteUrlOrId, listIdOrTitle, fieldInternalName, option
473
480
  updates.Hidden = options.Hidden === true;
474
481
  }
475
482
  }
476
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.ClientSideComponentId))
483
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.ClientSideComponentId))
477
484
  updates.ClientSideComponentId = options.ClientSideComponentId;
478
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.ClientSideComponentProperties))
485
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.ClientSideComponentProperties))
479
486
  updates.ClientSideComponentProperties = options.ClientSideComponentProperties;
480
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.JSLink))
487
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.JSLink))
481
488
  updates.JSLink = options.JSLink;
482
489
  }
483
490
  if (Object.keys(updates).length > 1) {
@@ -512,12 +519,12 @@ async function DeleteField(siteUrl, listIdOrTitle, fieldInternalName, options) {
512
519
  exports.DeleteField = DeleteField;
513
520
  function GetListViews(siteUrl, listIdOrTitle, options) {
514
521
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
515
- return (0, rest_1.GetJson)(GetListRestUrl(siteUrl, listIdOrTitle) + `/views?$select=Title,Id,ServerRelativeUrl,RowLimit,Paged,ViewQuery,ListViewXml,PersonalView,MobileView,MobileDefaultView,Hidden,DefaultView,ReadOnlyView${options && options.includeViewFields ? "&$expand=ViewFields" : ""}`, null, { allowCache: true, jsonMetadata: _dependencies_1.jsonTypes.nometadata })
522
+ return (0, rest_1.GetJson)(GetListRestUrl(siteUrl, listIdOrTitle) + `/views?$select=Title,Id,ServerRelativeUrl,RowLimit,Paged,ViewQuery,ListViewXml,PersonalView,MobileView,MobileDefaultView,Hidden,DefaultView,ReadOnlyView${options && options.includeViewFields ? "&$expand=ViewFields" : ""}`, null, { allowCache: true, jsonMetadata: rest_types_1.jsonTypes.nometadata })
516
523
  .then(r => {
517
524
  let views = r.value;
518
- if ((0, _dependencies_1.isNotEmptyArray)(views)) {
525
+ if ((0, typecheckers_1.isNotEmptyArray)(views)) {
519
526
  views.forEach(v => {
520
- v.Id = (0, _dependencies_1.normalizeGuid)(v.Id);
527
+ v.Id = (0, strings_1.normalizeGuid)(v.Id);
521
528
  if (options && options.includeViewFields) {
522
529
  v.ViewFields = v.ViewFields && v.ViewFields["Items"] && v.ViewFields["Items"] || [];
523
530
  }
@@ -533,8 +540,8 @@ function GetListViewsSync(siteUrl, listIdOrTitle) {
533
540
  let result = (0, rest_1.GetJsonSync)(GetListRestUrl(siteUrl, listIdOrTitle) + `/views`, null, { allowCache: true });
534
541
  if (result.success) {
535
542
  let views = result && result.result && result.result.d && result.result.d.results;
536
- if ((0, _dependencies_1.isNotEmptyArray)(views)) {
537
- views.forEach(v => { v.Id = (0, _dependencies_1.normalizeGuid)(v.Id); });
543
+ if ((0, typecheckers_1.isNotEmptyArray)(views)) {
544
+ views.forEach(v => { v.Id = (0, strings_1.normalizeGuid)(v.Id); });
538
545
  }
539
546
  return views;
540
547
  }
@@ -551,17 +558,17 @@ async function RemoveViewFieldFromListView(siteUrl, listIdOrTitle, viewId, viewF
551
558
  exports.RemoveViewFieldFromListView = RemoveViewFieldFromListView;
552
559
  async function _addOrRemoveViewField(siteUrl, listIdOrTitle, viewId, viewField, action) {
553
560
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
554
- if ((0, _dependencies_1.isNullOrEmptyString)(viewField) || !(0, _dependencies_1.isValidGuid)(viewId)) {
561
+ if ((0, typecheckers_1.isNullOrEmptyString)(viewField) || !(0, typecheckers_1.isValidGuid)(viewId)) {
555
562
  return false;
556
563
  }
557
564
  let views = await GetListViews(siteUrl, listIdOrTitle, { includeViewFields: true });
558
- if ((0, _dependencies_1.isNullOrEmptyArray)(views)) {
565
+ if ((0, typecheckers_1.isNullOrEmptyArray)(views)) {
559
566
  return false;
560
567
  }
561
568
  let view = views.filter((view) => {
562
- return (0, _dependencies_1.normalizeGuid)(view.Id) === (0, _dependencies_1.normalizeGuid)(viewId);
569
+ return (0, strings_1.normalizeGuid)(view.Id) === (0, strings_1.normalizeGuid)(viewId);
563
570
  })[0];
564
- if ((0, _dependencies_1.isNullOrUndefined)(view)) {
571
+ if ((0, typecheckers_1.isNullOrUndefined)(view)) {
565
572
  return false;
566
573
  }
567
574
  let hasField = view.ViewFields.includes(viewField);
@@ -572,7 +579,7 @@ async function _addOrRemoveViewField(siteUrl, listIdOrTitle, viewId, viewField,
572
579
  return true;
573
580
  }
574
581
  try {
575
- let url = GetListRestUrl(siteUrl, listIdOrTitle) + `/views('${(0, _dependencies_1.normalizeGuid)(view.Id)}')/viewfields/${action}('${viewField}')`;
582
+ let url = GetListRestUrl(siteUrl, listIdOrTitle) + `/views('${(0, strings_1.normalizeGuid)(view.Id)}')/viewfields/${action}('${viewField}')`;
576
583
  let result = await (0, rest_1.GetJson)(url, null, { method: "POST" });
577
584
  if (result && result["odata.null"] === true) {
578
585
  return true;
@@ -592,15 +599,15 @@ exports.GetListContentTypesSync = GetListContentTypesSync;
592
599
  /** generic version. for the KWIZ forms version that supports action id call GetListFormUrlAppsWeb instead */
593
600
  function GetListFormUrl(siteUrl, listId, pageType, params) {
594
601
  siteUrl = (0, common_1.GetSiteUrl)(siteUrl);
595
- if (!(0, _dependencies_1.isValidGuid)(listId))
602
+ if (!(0, typecheckers_1.isValidGuid)(listId))
596
603
  console.error('GetListFormUrl requires a list id');
597
- let url = `${(0, _dependencies_1.normalizeUrl)(siteUrl)}/_layouts/15/listform.aspx?PageType=${pageType}&ListId=${encodeURIComponent(listId)}`;
604
+ let url = `${(0, url_1.normalizeUrl)(siteUrl)}/_layouts/15/listform.aspx?PageType=${pageType}&ListId=${encodeURIComponent(listId)}`;
598
605
  if (params) {
599
- if (!(0, _dependencies_1.isNullOrEmptyString)(params.contentTypeId))
606
+ if (!(0, typecheckers_1.isNullOrEmptyString)(params.contentTypeId))
600
607
  url += `&ContentTypeId=${encodeURIComponent(params.contentTypeId)}`;
601
- if (!(0, _dependencies_1.isNullOrEmptyString)(params.itemId))
608
+ if (!(0, typecheckers_1.isNullOrEmptyString)(params.itemId))
602
609
  url += `&ID=${encodeURIComponent(params.itemId)}`;
603
- if (!(0, _dependencies_1.isNullOrEmptyString)(params.rootFolder))
610
+ if (!(0, typecheckers_1.isNullOrEmptyString)(params.rootFolder))
604
611
  url += `&RootFolder=${encodeURIComponent(params.rootFolder)}`;
605
612
  }
606
613
  return url;
@@ -614,11 +621,11 @@ function GetFieldSchemaSync(siteUrl, listIdOrTitle, fieldInternalName, refreshCa
614
621
  refreshCache: refreshCache,
615
622
  fieldNames: [fieldInternalName]
616
623
  });
617
- if ((0, _dependencies_1.isNullOrEmptyArray)(fields)) {
624
+ if ((0, typecheckers_1.isNullOrEmptyArray)(fields)) {
618
625
  return null;
619
626
  }
620
627
  let field = fields[0];
621
- return (0, _dependencies_1.SchemaXmlToJson)(field.SchemaXml);
628
+ return (0, sharepoint_1.SchemaXmlToJson)(field.SchemaXml);
622
629
  // let url = GetListRestUrl(siteUrl, listIdOrTitle) + `/fields/getByInternalNameOrTitle('${fieldInternalName}')?$select=SchemaXml`;
623
630
  // let result = GetJsonSync<{ d: { SchemaXml: string; }; }>(
624
631
  // url,
@@ -642,11 +649,11 @@ async function GetFieldSchema(siteUrl, listIdOrTitle, fieldInternalName, refresh
642
649
  refreshCache: refreshCache,
643
650
  fieldNames: [fieldInternalName]
644
651
  });
645
- if ((0, _dependencies_1.isNullOrEmptyArray)(fields)) {
652
+ if ((0, typecheckers_1.isNullOrEmptyArray)(fields)) {
646
653
  return null;
647
654
  }
648
655
  let field = fields[0];
649
- return (0, _dependencies_1.SchemaXmlToJson)(field.SchemaXml);
656
+ return (0, sharepoint_1.SchemaXmlToJson)(field.SchemaXml);
650
657
  }
651
658
  exports.GetFieldSchema = GetFieldSchema;
652
659
  async function GetListItems(siteUrl, listIdOrTitle, options) {
@@ -670,13 +677,13 @@ async function GetListItems(siteUrl, listIdOrTitle, options) {
670
677
  resultItems = requestResult.d.results;
671
678
  next = requestResult.d.__next;
672
679
  }
673
- if ((0, _dependencies_1.isNotEmptyArray)(resultItems))
680
+ if ((0, typecheckers_1.isNotEmptyArray)(resultItems))
674
681
  items.push(...resultItems);
675
682
  if (info.totalNumberOfItemsToGet > items.length)
676
683
  info.requestUrl = next;
677
684
  else
678
685
  info.requestUrl = null;
679
- } while (!(0, _dependencies_1.isNullOrEmptyString)(info.requestUrl));
686
+ } while (!(0, typecheckers_1.isNullOrEmptyString)(info.requestUrl));
680
687
  return (0, common_2.__fixGetListItemsResults)(siteUrl, listIdOrTitle, items, options.foldersBehaviour, info.expandedLookupFields);
681
688
  }
682
689
  exports.GetListItems = GetListItems;
@@ -700,13 +707,13 @@ function GetListItemsSync(siteUrl, listIdOrTitle, options) {
700
707
  next = requestResult.result.d.__next;
701
708
  }
702
709
  }
703
- if ((0, _dependencies_1.isNotEmptyArray)(resultItems))
710
+ if ((0, typecheckers_1.isNotEmptyArray)(resultItems))
704
711
  items.push(...resultItems);
705
712
  if (info.totalNumberOfItemsToGet > items.length)
706
713
  info.requestUrl = next;
707
714
  else
708
715
  info.requestUrl = null;
709
- } while (!(0, _dependencies_1.isNullOrEmptyString)(info.requestUrl));
716
+ } while (!(0, typecheckers_1.isNullOrEmptyString)(info.requestUrl));
710
717
  return (0, common_2.__fixGetListItemsResults)(siteUrl, listIdOrTitle, items, options.foldersBehaviour, info.expandedLookupFields);
711
718
  }
712
719
  exports.GetListItemsSync = GetListItemsSync;
@@ -719,7 +726,7 @@ function _GetListItemsInfo(siteUrl, listIdOrTitle, options) {
719
726
  let expand = [];
720
727
  let expandedLookupFields = [];
721
728
  options.columns.forEach(c => {
722
- if ((0, _dependencies_1.isString)(c))
729
+ if ((0, typecheckers_1.isString)(c))
723
730
  columns.push(c);
724
731
  else {
725
732
  let internalName = c.InternalName;
@@ -731,7 +738,7 @@ function _GetListItemsInfo(siteUrl, listIdOrTitle, options) {
731
738
  if (isLookupField || isUserField) {
732
739
  //ISSUE: 1519 - Added lookupField property to able to retrieve value of the additional lookup field key
733
740
  let lookupField = c.LookupField;
734
- if (!(0, _dependencies_1.isNullOrEmptyString)(lookupField) && isLookupField) {
741
+ if (!(0, typecheckers_1.isNullOrEmptyString)(lookupField) && isLookupField) {
735
742
  columns.push(`${internalName}/${lookupField}`);
736
743
  }
737
744
  //we want to expand it
@@ -744,24 +751,24 @@ function _GetListItemsInfo(siteUrl, listIdOrTitle, options) {
744
751
  columns.push(internalName);
745
752
  }
746
753
  });
747
- if ((0, _dependencies_1.isNotEmptyArray)(options.expand)) {
754
+ if ((0, typecheckers_1.isNotEmptyArray)(options.expand)) {
748
755
  expand.push(...options.expand);
749
756
  }
750
757
  //add the ones we need
751
- (0, _dependencies_1.PushNoDuplicate)(columns, "Id");
752
- (0, _dependencies_1.PushNoDuplicate)(columns, "FileRef");
753
- (0, _dependencies_1.PushNoDuplicate)(columns, "FileSystemObjectType");
754
- queryParams.push(`$select=${encodeURIComponent((0, _dependencies_1.makeUniqueArray)(columns).join(','))}`);
755
- if ((0, _dependencies_1.isNotEmptyArray)(expand))
756
- queryParams.push(`$expand=${encodeURIComponent((0, _dependencies_1.makeUniqueArray)(expand).join(','))}`);
758
+ (0, collections_base_1.PushNoDuplicate)(columns, "Id");
759
+ (0, collections_base_1.PushNoDuplicate)(columns, "FileRef");
760
+ (0, collections_base_1.PushNoDuplicate)(columns, "FileSystemObjectType");
761
+ queryParams.push(`$select=${encodeURIComponent((0, collections_base_1.makeUniqueArray)(columns).join(','))}`);
762
+ if ((0, typecheckers_1.isNotEmptyArray)(expand))
763
+ queryParams.push(`$expand=${encodeURIComponent((0, collections_base_1.makeUniqueArray)(expand).join(','))}`);
757
764
  let batchSize = 2000;
758
765
  let limit = options.rowLimit >= 0 && options.rowLimit < batchSize ? options.rowLimit : batchSize;
759
- let totalNumberOfItemsToGet = !(0, _dependencies_1.isNumber)(options.rowLimit) || options.rowLimit < 1 ? 99999 : options.rowLimit > batchSize ? options.rowLimit : limit;
760
- if (!(0, _dependencies_1.isNullOrEmptyString)(options.$filter))
766
+ let totalNumberOfItemsToGet = !(0, typecheckers_1.isNumber)(options.rowLimit) || options.rowLimit < 1 ? 99999 : options.rowLimit > batchSize ? options.rowLimit : limit;
767
+ if (!(0, typecheckers_1.isNullOrEmptyString)(options.$filter))
761
768
  queryParams.push(`$filter=${options.$filter}`);
762
769
  queryParams.push(`$top=${limit}`);
763
770
  let requestUrl = url + (queryParams.length > 0 ? '?' + queryParams.join('&') : '');
764
- let noMetadata = options.jsonMetadata === _dependencies_1.jsonTypes.nometadata;
771
+ let noMetadata = options.jsonMetadata === rest_types_1.jsonTypes.nometadata;
765
772
  return { requestUrl, noMetadata, totalNumberOfItemsToGet, expandedLookupFields };
766
773
  }
767
774
  /** Find an item by id, even if it is nested in a sub-folder */
@@ -770,10 +777,10 @@ function FindListItemById(items, itemId) {
770
777
  let current = items[i];
771
778
  if (current.Id === itemId)
772
779
  return current;
773
- else if ((0, _dependencies_1.isNotEmptyArray)(current.__Items)) //folder? look inside
780
+ else if ((0, typecheckers_1.isNotEmptyArray)(current.__Items)) //folder? look inside
774
781
  {
775
782
  let nestedResult = FindListItemById(current.__Items, itemId);
776
- if (!(0, _dependencies_1.isNullOrUndefined)(nestedResult))
783
+ if (!(0, typecheckers_1.isNullOrUndefined)(nestedResult))
777
784
  return nestedResult;
778
785
  }
779
786
  }
@@ -789,9 +796,9 @@ async function GetListEventReceivers(siteUrl, listIdOrTitle, refreshCache) {
789
796
  let url = _getListEventReceiversRequestUrl(siteUrl, listIdOrTitle);
790
797
  let response = await (0, rest_1.GetJson)(url, null, {
791
798
  allowCache: refreshCache !== true,
792
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
799
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
793
800
  });
794
- return !(0, _dependencies_1.isNullOrUndefined)(response) ? response.value : null;
801
+ return !(0, typecheckers_1.isNullOrUndefined)(response) ? response.value : null;
795
802
  }
796
803
  catch {
797
804
  }
@@ -809,12 +816,12 @@ async function AddListEventReceiver(siteUrl, listIdOrTitle, eventReceiverDefinit
809
816
  let response = await (0, rest_1.GetJson)(url, JSON.stringify(newEventReceiver), {
810
817
  method: "POST",
811
818
  includeDigestInPost: true,
812
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
819
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
813
820
  headers: {
814
- "content-type": _dependencies_1.contentTypes.json
821
+ "content-type": rest_types_1.contentTypes.json
815
822
  }
816
823
  });
817
- return !(0, _dependencies_1.isNullOrUndefined)(response) && (0, _dependencies_1.isValidGuid)(response.ReceiverId) ? response : null;
824
+ return !(0, typecheckers_1.isNullOrUndefined)(response) && (0, typecheckers_1.isValidGuid)(response.ReceiverId) ? response : null;
818
825
  }
819
826
  catch {
820
827
  }
@@ -823,13 +830,13 @@ async function AddListEventReceiver(siteUrl, listIdOrTitle, eventReceiverDefinit
823
830
  exports.AddListEventReceiver = AddListEventReceiver;
824
831
  async function DeleteListEventReceiver(siteUrl, listIdOrTitle, eventReceiverId) {
825
832
  try {
826
- let url = `${_getListEventReceiversRequestUrl(siteUrl, listIdOrTitle)}('${(0, _dependencies_1.normalizeGuid)(eventReceiverId)}')/deleteObject`;
833
+ let url = `${_getListEventReceiversRequestUrl(siteUrl, listIdOrTitle)}('${(0, strings_1.normalizeGuid)(eventReceiverId)}')/deleteObject`;
827
834
  let response = await (0, rest_1.GetJson)(url, null, {
828
835
  method: "POST",
829
836
  includeDigestInPost: true,
830
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
837
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
831
838
  });
832
- return !(0, _dependencies_1.isNullOrUndefined)(response) && response["odata.null"] === true;
839
+ return !(0, typecheckers_1.isNullOrUndefined)(response) && response["odata.null"] === true;
833
840
  }
834
841
  catch {
835
842
  }
@@ -843,10 +850,10 @@ function GetListLastItemModifiedDate(siteUrl, listIdOrTitle, options) {
843
850
  let caller = sync ? rest_1.GetJsonSync : rest_1.GetJson;
844
851
  let result = caller(GetListRestUrl(siteUrl, listIdOrTitle) + `/${endPoint}`, null, {
845
852
  allowCache: true, //in memory only
846
- jsonMetadata: _dependencies_1.jsonTypes.nometadata,
853
+ jsonMetadata: rest_types_1.jsonTypes.nometadata,
847
854
  forceCacheUpdate: options && options.refreshCache === true || false
848
855
  });
849
- if ((0, _dependencies_1.isPromise)(result))
856
+ if ((0, typecheckers_1.isPromise)(result))
850
857
  return result.then(r => r.value, () => null);
851
858
  else
852
859
  return result.success ? result.result.value : null;
@@ -855,7 +862,7 @@ exports.GetListLastItemModifiedDate = GetListLastItemModifiedDate;
855
862
  async function ReloadListLastModified(siteUrl, listIdOrTitle) {
856
863
  await GetListLastItemModifiedDate(siteUrl, listIdOrTitle, { refreshCache: true });
857
864
  //make sure we do it for both title and id, we don't know how the other callers may use this in their API
858
- if (!(0, _dependencies_1.isValidGuid)(listIdOrTitle)) {
865
+ if (!(0, typecheckers_1.isValidGuid)(listIdOrTitle)) {
859
866
  try {
860
867
  var listId = GetListId(siteUrl, listIdOrTitle);
861
868
  await GetListLastItemModifiedDate(siteUrl, listId, { refreshCache: true });
@@ -873,28 +880,28 @@ async function ReloadListLastModified(siteUrl, listIdOrTitle) {
873
880
  exports.ReloadListLastModified = ReloadListLastModified;
874
881
  async function ListHasUniquePermissions(siteUrl, listIdOrTitle) {
875
882
  let url = `${GetListRestUrl(siteUrl, listIdOrTitle)}/?$select=hasuniqueroleassignments`;
876
- let has = await (0, rest_1.GetJson)(url, undefined, { allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata });
883
+ let has = await (0, rest_1.GetJson)(url, undefined, { allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata });
877
884
  return has.HasUniqueRoleAssignments === true;
878
885
  }
879
886
  exports.ListHasUniquePermissions = ListHasUniquePermissions;
880
887
  async function RestoreListPermissionInheritance(siteUrl, listIdOrTitle) {
881
888
  let url = `${GetListRestUrl(siteUrl, listIdOrTitle)}/ResetRoleInheritance`;
882
- await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata, spWebUrl: siteUrl });
889
+ await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata, spWebUrl: siteUrl });
883
890
  }
884
891
  exports.RestoreListPermissionInheritance = RestoreListPermissionInheritance;
885
892
  async function BreakListPermissionInheritance(siteUrl, listIdOrTitle, clear = true) {
886
893
  let url = `${GetListRestUrl(siteUrl, listIdOrTitle)}/breakroleinheritance(copyRoleAssignments=${clear ? 'false' : 'true'}, clearSubscopes=true)`;
887
- await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata, spWebUrl: siteUrl });
894
+ await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata, spWebUrl: siteUrl });
888
895
  }
889
896
  exports.BreakListPermissionInheritance = BreakListPermissionInheritance;
890
897
  async function AssignListPermission(siteUrl, listIdOrTitle, principalId, roleId) {
891
898
  let url = `${GetListRestUrl(siteUrl, listIdOrTitle)}/roleassignments/addroleassignment(principalid=${principalId},roleDefId=${roleId})`;
892
- await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata, spWebUrl: siteUrl });
899
+ await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata, spWebUrl: siteUrl });
893
900
  }
894
901
  exports.AssignListPermission = AssignListPermission;
895
902
  async function RemoveListPermission(siteUrl, listIdOrTitle, principalId, roleId) {
896
903
  let url = `${GetListRestUrl(siteUrl, listIdOrTitle)}/roleassignments/removeroleassignment(principalid=${principalId},roleDefId=${roleId})`;
897
- await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: _dependencies_1.jsonTypes.nometadata, spWebUrl: siteUrl });
904
+ await (0, rest_1.GetJson)(url, undefined, { method: "POST", allowCache: false, jsonMetadata: rest_types_1.jsonTypes.nometadata, spWebUrl: siteUrl });
898
905
  }
899
906
  exports.RemoveListPermission = RemoveListPermission;
900
907
  async function CreateList(siteUrl, info) {
@@ -908,8 +915,8 @@ async function CreateList(siteUrl, info) {
908
915
  Description: info.description,
909
916
  Title: info.title
910
917
  };
911
- let newList = (await (0, rest_1.GetJson)(url, (0, _dependencies_1.jsonStringify)(body))).d;
912
- (0, _dependencies_1.normalizeGuid)(newList.Id);
918
+ let newList = (await (0, rest_1.GetJson)(url, (0, json_1.jsonStringify)(body))).d;
919
+ (0, strings_1.normalizeGuid)(newList.Id);
913
920
  return newList;
914
921
  }
915
922
  exports.CreateList = CreateList;
@@ -917,7 +924,7 @@ async function SearchList(siteUrl, listIdOrTitle, query) {
917
924
  let listId = GetListId(siteUrl, listIdOrTitle);
918
925
  let url = `${(0, common_1.GetRestBaseUrl)(siteUrl)}/search/query?querytext='(${query}*)'&querytemplate='{searchTerms} (NormListID:${listId})'`;
919
926
  try {
920
- const result = await (0, rest_1.GetJson)(url, null, { jsonMetadata: _dependencies_1.jsonTypes.nometadata });
927
+ const result = await (0, rest_1.GetJson)(url, null, { jsonMetadata: rest_types_1.jsonTypes.nometadata });
921
928
  logger.json(result.PrimaryQueryResult.RelevantResults, `search ${query}`);
922
929
  let rows = result.PrimaryQueryResult.RelevantResults.Table.Rows;
923
930
  const mapped = [];
@@ -933,7 +940,7 @@ async function SearchList(siteUrl, listIdOrTitle, query) {
933
940
  ? ""
934
941
  : cell.Value;
935
942
  });
936
- let resultPath = (0, _dependencies_1.isNullOrEmptyString)(rowValues.Path) ? "" : rowValues.Path.toLowerCase();
943
+ let resultPath = (0, typecheckers_1.isNullOrEmptyString)(rowValues.Path) ? "" : rowValues.Path.toLowerCase();
937
944
  let indexOfId = resultPath.toLowerCase().indexOf("id=");
938
945
  let itemId = indexOfId >= 0 ? parseInt(resultPath.slice(indexOfId + 3)) : -1;
939
946
  if (itemId >= 0)
@@ -960,9 +967,9 @@ async function UpdateListExperience(siteUrl, listId, experience) {
960
967
  };
961
968
  let result = await (0, rest_1.GetJson)(url, JSON.stringify(data), {
962
969
  xHttpMethod: "MERGE",
963
- jsonMetadata: _dependencies_1.jsonTypes.nometadata
970
+ jsonMetadata: rest_types_1.jsonTypes.nometadata
964
971
  });
965
- return (0, _dependencies_1.isNullOrEmptyString)(result);
972
+ return (0, typecheckers_1.isNullOrEmptyString)(result);
966
973
  }
967
974
  catch (e) {
968
975
  logger.error(e);