@kwiz/common 1.0.132 → 1.0.133

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 (98) hide show
  1. package/package.json +1 -1
  2. package/.github/workflows/npm-publish.yml +0 -24
  3. package/src/_dependencies.ts +0 -13
  4. package/src/config.ts +0 -19
  5. package/src/exports-index.ts +0 -4
  6. package/src/helpers/Guid.ts +0 -182
  7. package/src/helpers/base64.ts +0 -174
  8. package/src/helpers/browser.test.js +0 -13
  9. package/src/helpers/browser.ts +0 -1505
  10. package/src/helpers/browserinfo.ts +0 -293
  11. package/src/helpers/collections.base.test.js +0 -26
  12. package/src/helpers/collections.base.ts +0 -438
  13. package/src/helpers/collections.ts +0 -108
  14. package/src/helpers/color.ts +0 -55
  15. package/src/helpers/cookies.ts +0 -60
  16. package/src/helpers/date.test.js +0 -120
  17. package/src/helpers/date.ts +0 -189
  18. package/src/helpers/debug.ts +0 -187
  19. package/src/helpers/diagrams.ts +0 -44
  20. package/src/helpers/emails.ts +0 -7
  21. package/src/helpers/eval.ts +0 -5
  22. package/src/helpers/exports-index.ts +0 -30
  23. package/src/helpers/file.test.js +0 -51
  24. package/src/helpers/file.ts +0 -64
  25. package/src/helpers/flatted.ts +0 -150
  26. package/src/helpers/functions.ts +0 -17
  27. package/src/helpers/graph/calendar.types.ts +0 -11
  28. package/src/helpers/graph/exports-index.ts +0 -1
  29. package/src/helpers/http.ts +0 -70
  30. package/src/helpers/images.ts +0 -23
  31. package/src/helpers/json.ts +0 -45
  32. package/src/helpers/md5.ts +0 -190
  33. package/src/helpers/objects.test.js +0 -34
  34. package/src/helpers/objects.ts +0 -275
  35. package/src/helpers/promises.test.js +0 -38
  36. package/src/helpers/promises.ts +0 -166
  37. package/src/helpers/random.ts +0 -27
  38. package/src/helpers/scheduler/exports-index.ts +0 -1
  39. package/src/helpers/scheduler/scheduler.test.js +0 -104
  40. package/src/helpers/scheduler/scheduler.ts +0 -132
  41. package/src/helpers/sharepoint.ts +0 -797
  42. package/src/helpers/strings.test.js +0 -123
  43. package/src/helpers/strings.ts +0 -338
  44. package/src/helpers/typecheckers.test.js +0 -35
  45. package/src/helpers/typecheckers.ts +0 -267
  46. package/src/helpers/url.test.js +0 -44
  47. package/src/helpers/url.ts +0 -208
  48. package/src/helpers/urlhelper.ts +0 -112
  49. package/src/index.ts +0 -6
  50. package/src/types/auth.ts +0 -63
  51. package/src/types/common.types.ts +0 -16
  52. package/src/types/exports-index.ts +0 -15
  53. package/src/types/flatted.types.ts +0 -60
  54. package/src/types/globals.types.ts +0 -7
  55. package/src/types/graph/calendar.types.ts +0 -81
  56. package/src/types/graph/exports-index.ts +0 -1
  57. package/src/types/knownscript.types.ts +0 -19
  58. package/src/types/libs/datajs.types.ts +0 -29
  59. package/src/types/libs/exports-index.ts +0 -3
  60. package/src/types/libs/ics.types.ts +0 -31
  61. package/src/types/libs/msal.types.ts +0 -58
  62. package/src/types/locales.ts +0 -126
  63. package/src/types/localstoragecache.types.ts +0 -9
  64. package/src/types/location.types.ts +0 -28
  65. package/src/types/moment.ts +0 -12
  66. package/src/types/regex.types.ts +0 -17
  67. package/src/types/rest.types.ts +0 -96
  68. package/src/types/sharepoint.types.ts +0 -1467
  69. package/src/types/sharepoint.utils.types.ts +0 -307
  70. package/src/utils/auth/common.ts +0 -119
  71. package/src/utils/auth/discovery.test.js +0 -13
  72. package/src/utils/auth/discovery.ts +0 -132
  73. package/src/utils/auth/exports-index.ts +0 -2
  74. package/src/utils/base64.ts +0 -28
  75. package/src/utils/consolelogger.ts +0 -334
  76. package/src/utils/date.ts +0 -173
  77. package/src/utils/emails.ts +0 -25
  78. package/src/utils/exports-index.ts +0 -11
  79. package/src/utils/knownscript.ts +0 -287
  80. package/src/utils/localstoragecache.ts +0 -447
  81. package/src/utils/rest.ts +0 -502
  82. package/src/utils/script.ts +0 -171
  83. package/src/utils/sharepoint.rest/common.ts +0 -160
  84. package/src/utils/sharepoint.rest/date.ts +0 -63
  85. package/src/utils/sharepoint.rest/exports-index.ts +0 -11
  86. package/src/utils/sharepoint.rest/file.folder.ts +0 -685
  87. package/src/utils/sharepoint.rest/item.ts +0 -547
  88. package/src/utils/sharepoint.rest/list.ts +0 -1572
  89. package/src/utils/sharepoint.rest/listutils/GetListItemsByCaml.ts +0 -775
  90. package/src/utils/sharepoint.rest/listutils/GetListItemsById.ts +0 -275
  91. package/src/utils/sharepoint.rest/listutils/common.ts +0 -207
  92. package/src/utils/sharepoint.rest/listutils/exports-index.ts +0 -3
  93. package/src/utils/sharepoint.rest/location.ts +0 -142
  94. package/src/utils/sharepoint.rest/navigation-links.ts +0 -87
  95. package/src/utils/sharepoint.rest/user-search.ts +0 -253
  96. package/src/utils/sharepoint.rest/user.ts +0 -559
  97. package/src/utils/sharepoint.rest/web.ts +0 -1385
  98. 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
- }