@kwiz/common 1.0.132 → 1.0.134

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 (108) hide show
  1. package/lib/cjs/helpers/promises.js +4 -3
  2. package/lib/cjs/helpers/promises.js.map +1 -1
  3. package/lib/cjs/utils/sharepoint.rest/web.js +10 -2
  4. package/lib/cjs/utils/sharepoint.rest/web.js.map +1 -1
  5. package/lib/esm/helpers/promises.js +4 -3
  6. package/lib/esm/helpers/promises.js.map +1 -1
  7. package/lib/esm/utils/sharepoint.rest/web.js +7 -0
  8. package/lib/esm/utils/sharepoint.rest/web.js.map +1 -1
  9. package/lib/types/helpers/promises.d.ts +1 -1
  10. package/lib/types/utils/sharepoint.rest/web.d.ts +1 -0
  11. package/package.json +3 -2
  12. package/.github/workflows/npm-publish.yml +0 -24
  13. package/src/_dependencies.ts +0 -13
  14. package/src/config.ts +0 -19
  15. package/src/exports-index.ts +0 -4
  16. package/src/helpers/Guid.ts +0 -182
  17. package/src/helpers/base64.ts +0 -174
  18. package/src/helpers/browser.test.js +0 -13
  19. package/src/helpers/browser.ts +0 -1505
  20. package/src/helpers/browserinfo.ts +0 -293
  21. package/src/helpers/collections.base.test.js +0 -26
  22. package/src/helpers/collections.base.ts +0 -438
  23. package/src/helpers/collections.ts +0 -108
  24. package/src/helpers/color.ts +0 -55
  25. package/src/helpers/cookies.ts +0 -60
  26. package/src/helpers/date.test.js +0 -120
  27. package/src/helpers/date.ts +0 -189
  28. package/src/helpers/debug.ts +0 -187
  29. package/src/helpers/diagrams.ts +0 -44
  30. package/src/helpers/emails.ts +0 -7
  31. package/src/helpers/eval.ts +0 -5
  32. package/src/helpers/exports-index.ts +0 -30
  33. package/src/helpers/file.test.js +0 -51
  34. package/src/helpers/file.ts +0 -64
  35. package/src/helpers/flatted.ts +0 -150
  36. package/src/helpers/functions.ts +0 -17
  37. package/src/helpers/graph/calendar.types.ts +0 -11
  38. package/src/helpers/graph/exports-index.ts +0 -1
  39. package/src/helpers/http.ts +0 -70
  40. package/src/helpers/images.ts +0 -23
  41. package/src/helpers/json.ts +0 -45
  42. package/src/helpers/md5.ts +0 -190
  43. package/src/helpers/objects.test.js +0 -34
  44. package/src/helpers/objects.ts +0 -275
  45. package/src/helpers/promises.test.js +0 -38
  46. package/src/helpers/promises.ts +0 -166
  47. package/src/helpers/random.ts +0 -27
  48. package/src/helpers/scheduler/exports-index.ts +0 -1
  49. package/src/helpers/scheduler/scheduler.test.js +0 -104
  50. package/src/helpers/scheduler/scheduler.ts +0 -132
  51. package/src/helpers/sharepoint.ts +0 -797
  52. package/src/helpers/strings.test.js +0 -123
  53. package/src/helpers/strings.ts +0 -338
  54. package/src/helpers/typecheckers.test.js +0 -35
  55. package/src/helpers/typecheckers.ts +0 -267
  56. package/src/helpers/url.test.js +0 -44
  57. package/src/helpers/url.ts +0 -208
  58. package/src/helpers/urlhelper.ts +0 -112
  59. package/src/index.ts +0 -6
  60. package/src/types/auth.ts +0 -63
  61. package/src/types/common.types.ts +0 -16
  62. package/src/types/exports-index.ts +0 -15
  63. package/src/types/flatted.types.ts +0 -60
  64. package/src/types/globals.types.ts +0 -7
  65. package/src/types/graph/calendar.types.ts +0 -81
  66. package/src/types/graph/exports-index.ts +0 -1
  67. package/src/types/knownscript.types.ts +0 -19
  68. package/src/types/libs/datajs.types.ts +0 -29
  69. package/src/types/libs/exports-index.ts +0 -3
  70. package/src/types/libs/ics.types.ts +0 -31
  71. package/src/types/libs/msal.types.ts +0 -58
  72. package/src/types/locales.ts +0 -126
  73. package/src/types/localstoragecache.types.ts +0 -9
  74. package/src/types/location.types.ts +0 -28
  75. package/src/types/moment.ts +0 -12
  76. package/src/types/regex.types.ts +0 -17
  77. package/src/types/rest.types.ts +0 -96
  78. package/src/types/sharepoint.types.ts +0 -1467
  79. package/src/types/sharepoint.utils.types.ts +0 -307
  80. package/src/utils/auth/common.ts +0 -119
  81. package/src/utils/auth/discovery.test.js +0 -13
  82. package/src/utils/auth/discovery.ts +0 -132
  83. package/src/utils/auth/exports-index.ts +0 -2
  84. package/src/utils/base64.ts +0 -28
  85. package/src/utils/consolelogger.ts +0 -334
  86. package/src/utils/date.ts +0 -173
  87. package/src/utils/emails.ts +0 -25
  88. package/src/utils/exports-index.ts +0 -11
  89. package/src/utils/knownscript.ts +0 -287
  90. package/src/utils/localstoragecache.ts +0 -447
  91. package/src/utils/rest.ts +0 -502
  92. package/src/utils/script.ts +0 -171
  93. package/src/utils/sharepoint.rest/common.ts +0 -160
  94. package/src/utils/sharepoint.rest/date.ts +0 -63
  95. package/src/utils/sharepoint.rest/exports-index.ts +0 -11
  96. package/src/utils/sharepoint.rest/file.folder.ts +0 -685
  97. package/src/utils/sharepoint.rest/item.ts +0 -547
  98. package/src/utils/sharepoint.rest/list.ts +0 -1572
  99. package/src/utils/sharepoint.rest/listutils/GetListItemsByCaml.ts +0 -775
  100. package/src/utils/sharepoint.rest/listutils/GetListItemsById.ts +0 -275
  101. package/src/utils/sharepoint.rest/listutils/common.ts +0 -207
  102. package/src/utils/sharepoint.rest/listutils/exports-index.ts +0 -3
  103. package/src/utils/sharepoint.rest/location.ts +0 -142
  104. package/src/utils/sharepoint.rest/navigation-links.ts +0 -87
  105. package/src/utils/sharepoint.rest/user-search.ts +0 -253
  106. package/src/utils/sharepoint.rest/user.ts +0 -559
  107. package/src/utils/sharepoint.rest/web.ts +0 -1385
  108. package/src/utils/sod.ts +0 -195
@@ -1,96 +0,0 @@
1
- import { ILocalStorageCacheLifetime } from "./localstoragecache.types";
2
-
3
- export type IRestResponseType = "" | "blob" | "arraybuffer" | "text" | "json" | "document";
4
- // eslint-disable-next-line no-shadow
5
- export enum jsonTypes {
6
- verbose = "application/json; odata=verbose",
7
- minimal = "application/json; odata=minimal",
8
- nometadata = "application/json; odata=nometadata",
9
- standard = "application/json"
10
- }
11
-
12
- // eslint-disable-next-line no-shadow
13
- export enum contentTypes {
14
- xml = "application/xml",
15
- json = "application/json"
16
- }
17
-
18
- export const AllRestCacheOptionsKeys: Required<IRestCacheOptions> = {
19
- allowCache: true,
20
- forceCacheUpdate: true,
21
- localStorageExpiration: 1,
22
- maxAge: 1
23
- };
24
- export interface IRestCacheOptions {
25
- allowCache?: boolean;
26
- /** if allowCache=true and local storage is supported, this will keep the results in local storage for a while */
27
- localStorageExpiration?: number | ILocalStorageCacheLifetime | Date;
28
- /** max age the runtime memeroy cache result is valid for in seconds */
29
- maxAge?: number;
30
- /** when a request allows to be stored in cache (persistent/memory) - signals that we want to update the cached value */
31
- forceCacheUpdate?: boolean;
32
- }
33
-
34
- export interface IRestRequestOptions {
35
- /** default: get if no body sent, otherwise post */
36
- method?: "GET" | "POST";
37
- xHttpMethod?: "MERGE" | "DELETE" | "PUT";
38
- /**default true */
39
- includeDigestInPost?: boolean;
40
- /**default false */
41
- includeDigestInGet?: boolean;
42
- /**default: Accept: jsonTypes.verbose, and (in post only) content-type: jsonTypes.verbose */
43
- headers?: {
44
- [key: string]: string;
45
- Accept?: string;
46
- "content-type"?: string;
47
- /** `Bearer ${token}` */
48
- Authorization?: string;
49
- };
50
- /** allow cache on post requests if you provide a unique key to identify and match */
51
- postCacheKey?: string;
52
- cors?: boolean;
53
- responseType?: IRestResponseType;
54
- /**If set to true, will return the xhr object itself (XMLHttpRequest) (does not support allowCache!) */
55
- returnXhrObject?: boolean;
56
- /** provide a SharePoint web URL, if running a SharePoint request. Will be used to get the right form digest if/when needed. */
57
- spWebUrl?: string;
58
- jsonMetadata?: jsonTypes;
59
- }
60
- export interface IRestOptions extends IRestRequestOptions, IRestCacheOptions {
61
- }
62
-
63
- export interface IRequestObjects {
64
- xhr: XMLHttpRequest;
65
- options: IRestRequestOptions;
66
- cacheOptions: IRestCacheOptions & { cacheKey?: string; };
67
- }
68
-
69
- export type IRequestBody = Document | Blob | BufferSource | FormData | URLSearchParams | string | null;//should be type XMLHttpRequestBodyInit, but some projects don't recognize it for some reason
70
-
71
- export interface IJsonSyncResultBase<T> {
72
- status: number;
73
- errorData?: any;
74
- /** preserve original error message from failed cached result */
75
- errorMessage?: string;
76
- result?: T;
77
- success: boolean;
78
- cachedTime?: number;
79
- }
80
- export interface IJsonSyncResultSuccess<T> extends IJsonSyncResultBase<T> {
81
- result: T;
82
- success: true;
83
- }
84
- export interface IJsonSyncResultError<T> extends IJsonSyncResultBase<T> {
85
- errorData: any;
86
- /** preserve original error message from failed cached result */
87
- errorMessage: string;
88
- success: false;
89
- }
90
- export type IJsonSyncResult<T> = IJsonSyncResultSuccess<T> | IJsonSyncResultError<T>;
91
-
92
- export interface IRestError {
93
- message: string;
94
- errorData?: any;
95
- xhr?: XMLHttpRequest;
96
- }