@kwiz/common 1.0.2 → 1.0.3

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 (86) hide show
  1. package/package.json +1 -1
  2. package/src/_dependencies.ts +0 -2
  3. package/src/helpers/Guid.ts +0 -182
  4. package/src/helpers/_dependencies.ts +0 -3
  5. package/src/helpers/base64.ts +0 -174
  6. package/src/helpers/browser.test.js +0 -9
  7. package/src/helpers/browser.ts +0 -1299
  8. package/src/helpers/browserinfo.ts +0 -293
  9. package/src/helpers/collections.base.test.js +0 -26
  10. package/src/helpers/collections.base.ts +0 -439
  11. package/src/helpers/collections.ts +0 -108
  12. package/src/helpers/color.ts +0 -55
  13. package/src/helpers/cookies.ts +0 -55
  14. package/src/helpers/date.test.js +0 -97
  15. package/src/helpers/date.ts +0 -163
  16. package/src/helpers/debug.ts +0 -187
  17. package/src/helpers/emails.ts +0 -7
  18. package/src/helpers/eval.ts +0 -5
  19. package/src/helpers/file.test.js +0 -51
  20. package/src/helpers/file.ts +0 -59
  21. package/src/helpers/flatted.ts +0 -150
  22. package/src/helpers/functions.ts +0 -17
  23. package/src/helpers/graph/calendar.types.ts +0 -11
  24. package/src/helpers/http.ts +0 -70
  25. package/src/helpers/images.ts +0 -23
  26. package/src/helpers/index.ts +0 -29
  27. package/src/helpers/json.ts +0 -39
  28. package/src/helpers/md5.ts +0 -190
  29. package/src/helpers/objects.test.js +0 -27
  30. package/src/helpers/objects.ts +0 -256
  31. package/src/helpers/promises.test.js +0 -18
  32. package/src/helpers/promises.ts +0 -102
  33. package/src/helpers/random.ts +0 -27
  34. package/src/helpers/scheduler/scheduler.test.js +0 -104
  35. package/src/helpers/scheduler/scheduler.ts +0 -132
  36. package/src/helpers/sharepoint.ts +0 -681
  37. package/src/helpers/strings.test.js +0 -43
  38. package/src/helpers/strings.ts +0 -288
  39. package/src/helpers/typecheckers.test.js +0 -35
  40. package/src/helpers/typecheckers.ts +0 -263
  41. package/src/helpers/url.test.js +0 -18
  42. package/src/helpers/url.ts +0 -202
  43. package/src/helpers/urlhelper.ts +0 -104
  44. package/src/index.ts +0 -24
  45. package/src/types/common.types.ts +0 -16
  46. package/src/types/flatted.types.ts +0 -60
  47. package/src/types/globals.types.ts +0 -7
  48. package/src/types/graph/calendar.types.ts +0 -81
  49. package/src/types/graph/index.ts +0 -1
  50. package/src/types/index.ts +0 -12
  51. package/src/types/knownscript.types.ts +0 -19
  52. package/src/types/libs/datajs.types.ts +0 -29
  53. package/src/types/libs/ics.types.ts +0 -31
  54. package/src/types/libs/index.ts +0 -4
  55. package/src/types/libs/msal.types.ts +0 -79
  56. package/src/types/locales.ts +0 -125
  57. package/src/types/localstoragecache.types.ts +0 -9
  58. package/src/types/moment.ts +0 -7
  59. package/src/types/regex.types.ts +0 -17
  60. package/src/types/rest.types.ts +0 -94
  61. package/src/types/sharepoint.types.ts +0 -1413
  62. package/src/types/sharepoint.utils.types.ts +0 -246
  63. package/src/utils/_dependencies.ts +0 -4
  64. package/src/utils/base64.ts +0 -27
  65. package/src/utils/consolelogger.ts +0 -315
  66. package/src/utils/date.ts +0 -36
  67. package/src/utils/emails.ts +0 -25
  68. package/src/utils/index.ts +0 -13
  69. package/src/utils/knownscript.ts +0 -280
  70. package/src/utils/localstoragecache.ts +0 -419
  71. package/src/utils/rest.ts +0 -465
  72. package/src/utils/script.ts +0 -168
  73. package/src/utils/sharepoint.rest/common.ts +0 -149
  74. package/src/utils/sharepoint.rest/date.ts +0 -61
  75. package/src/utils/sharepoint.rest/file.folder.ts +0 -368
  76. package/src/utils/sharepoint.rest/index.ts +0 -11
  77. package/src/utils/sharepoint.rest/item.ts +0 -456
  78. package/src/utils/sharepoint.rest/list.ts +0 -1144
  79. package/src/utils/sharepoint.rest/listutils/GetListItemsByCaml.ts +0 -750
  80. package/src/utils/sharepoint.rest/listutils/GetListItemsById.ts +0 -265
  81. package/src/utils/sharepoint.rest/listutils/common.ts +0 -202
  82. package/src/utils/sharepoint.rest/user-search.ts +0 -254
  83. package/src/utils/sharepoint.rest/user.ts +0 -447
  84. package/src/utils/sharepoint.rest/web.ts +0 -1031
  85. package/src/utils/sod.ts +0 -193
  86. package/tsconfig.json +0 -21
@@ -1,125 +0,0 @@
1
- type SysNumberFormatType = {
2
- CurrencyDecimalDigits: number;
3
- CurrencyDecimalSeparator: string;
4
- IsReadOnly: boolean;
5
- CurrencyGroupSizes: number[];
6
- NumberGroupSizes: number[];
7
- PercentGroupSizes: number[];
8
- CurrencyGroupSeparator: string;
9
- CurrencySymbol: string;
10
- NaNSymbol: string;
11
- CurrencyNegativePattern: number;
12
- NumberNegativePattern: number;
13
- PercentPositivePattern: number;
14
- PercentNegativePattern: number;
15
- NegativeInfinitySymbol: string;
16
- NegativeSign: string;
17
- NumberDecimalDigits: number;
18
- NumberDecimalSeparator: string;
19
- NumberGroupSeparator: string;
20
- CurrencyPositivePattern: number;
21
- PositiveInfinitySymbol: string;
22
- PositiveSign: string;
23
- PercentDecimalDigits: number;
24
- PercentDecimalSeparator: string;
25
- PercentGroupSeparator: string;
26
- PercentSymbol: string;
27
- PerMilleSymbol: string;
28
- NativeDigits: string[];
29
- DigitSubstitution: number;
30
- };
31
-
32
- type SysDateFormatType = {
33
- AMDesignator: string;
34
- Calendar: {
35
- MinSupportedDateTime: string;
36
- MaxSupportedDateTime: string;
37
- AlgorithmType: number;
38
- CalendarType: number;
39
- Eras: number[];
40
- TwoDigitYearMax: number;
41
- IsReadOnly: boolean;
42
- };
43
- DateSeparator: string;
44
- FirstDayOfWeek: number;
45
- CalendarWeekRule: number;
46
- FullDateTimePattern: string;
47
- LongDatePattern: string;
48
- LongTimePattern: string;
49
- MonthDayPattern: string;
50
- PMDesignator: string;
51
- RFC1123Pattern: string;
52
- ShortDatePattern: string;
53
- ShortTimePattern: string;
54
- SortableDateTimePattern: string;
55
- TimeSeparator: string;
56
- UniversalSortableDateTimePattern: string;
57
- YearMonthPattern: string;
58
- AbbreviatedDayNames: string[];
59
- ShortestDayNames: string[];
60
- DayNames: string[];
61
- AbbreviatedMonthNames: string[];
62
- MonthNames: string[];
63
- IsReadOnly: boolean;
64
- NativeCalendarName: string;
65
- AbbreviatedMonthGenitiveNames: string[];
66
- MonthGenitiveNames: string[];
67
- eras: any[];
68
- };
69
- type CultureInfoType = {
70
- LCID: number;
71
- name: string;
72
- numberFormat: SysNumberFormatType;
73
- dateTimeFormat: SysDateFormatType;
74
- ShortDatePattern?: string;
75
- ShortTimePattern?: string;
76
- DateSeparator?: string;
77
- TimeSeparator?: string;
78
- CurrencySymbol?: string;
79
- PercentSymbol?: string;
80
- NumberDecimalSeparator?: string;
81
- NumberGroupSeparator?: string;
82
- };
83
-
84
- interface Date {
85
- /**
86
- * Formats a date by using the invariant (culture-independent) culture.
87
- */
88
- format(format: string): string;
89
- }
90
-
91
- interface IKLocales {
92
- getCultureNameOrLCIDFromContextInfo(s: number): string | number;
93
- GetCulture(cultureNameOrLCID: string | number): CultureInfoType;
94
- GetCurrentCulture(): CultureInfoType;
95
- SetCurrentCulture(culture: CultureInfoType);
96
- ParseDate(strDate: string, culture?: CultureInfoType): Date;
97
- /** default format: date only */
98
- DateToString(dateObj: Date, culture: CultureInfoType, format?: { includeDate?: boolean; includeTime?: boolean; }): string;
99
- ParseNumber(strNumber: string, culture?: CultureInfoType): number;
100
- /** isPercentAsWholeNumbers means a percent number that is 1 to 100, not 0-1. will not multiply it by 100. */
101
- NumberToString(num: number,
102
- /** current web cutlure, default=GetCurrentCulture */
103
- webCulture?: CultureInfoType,
104
- numFormat?: {
105
- /** default=false */
106
- includeGroupSeparator?: boolean;
107
- /** default=false */
108
- isPercent?: boolean;
109
- /** isPercentAsWholeNumbers means a percent number that is 1 to 100, not 0-1. will not multiply it by 100, default=false */
110
- isPercentAsWholeNumbers?: boolean;
111
- /** default=false */
112
- isCurrency?: boolean;
113
- /** default=webCulture.LCID */
114
- currencyLocaleId?: number;
115
- /** default=false */
116
- numberOnly?: boolean;
117
- }): string;
118
- IsValidNumber(strNumber: string, culture: CultureInfoType): boolean;
119
- }
120
-
121
- interface IKWizComGlobals {
122
- kLocales?: IKLocales;
123
- }
124
-
125
- declare var kLocales: IKLocales;
@@ -1,9 +0,0 @@
1
- //#region Cache Service
2
- export interface ILocalStorageCacheLifetime {
3
- seconds?: number;
4
- minutes?: number;
5
- hours?: number;
6
- days?: number;
7
- months?: number;
8
- years?: number;
9
- }
@@ -1,7 +0,0 @@
1
- interface IMomentJSObj {
2
- toDate: () => Date;
3
- isValid: () => boolean;
4
- }
5
-
6
- declare function momentJS(inp?: string, format?: string, strict?: boolean): IMomentJSObj;
7
- declare function monentJSTimeZone(inp?: string, format?: string, strict?: boolean): IMomentJSObj;
@@ -1,17 +0,0 @@
1
- import { IDictionary } from "./common.types";
2
-
3
- export interface IRegexExpression {
4
- pattern: string;
5
- example: string;
6
- options: string[];
7
- isDefault: boolean;
8
- }
9
-
10
- export interface IRegexList extends IDictionary<IRegexExpression> {
11
- }
12
-
13
- declare global {
14
- interface IModernListSettings {
15
- RegexList?: IRegexList;
16
- }
17
- }
@@ -1,94 +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
- };
48
- /** allow cache on post requests if you provide a unique key to identify and match */
49
- postCacheKey?: string;
50
- cors?: boolean;
51
- responseType?: IRestResponseType;
52
- /**If set to true, will return the xhr object itself (XMLHttpRequest) (does not support allowCache!) */
53
- returnXhrObject?: boolean;
54
- /** provide a SharePoint web URL, if running a SharePoint request. Will be used to get the right form digest if/when needed. */
55
- spWebUrl?: string;
56
- jsonMetadata?: jsonTypes;
57
- }
58
- export interface IRestOptions extends IRestRequestOptions, IRestCacheOptions {
59
- }
60
-
61
- export interface IRequestObjects {
62
- xhr: XMLHttpRequest;
63
- options: IRestRequestOptions;
64
- cacheOptions: IRestCacheOptions & { cacheKey?: string; };
65
- }
66
-
67
- export type IRequestBody = Document | Blob | BufferSource | FormData | URLSearchParams | string | null;//should be type XMLHttpRequestBodyInit, but some projects don't recognize it for some reason
68
-
69
- export interface IJsonSyncResultBase<T> {
70
- status: number;
71
- errorData?: any;
72
- /** preserve original error message from failed cached result */
73
- errorMessage?: string;
74
- result?: T;
75
- success: boolean;
76
- cachedTime?: number;
77
- }
78
- export interface IJsonSyncResultSuccess<T> extends IJsonSyncResultBase<T> {
79
- result: T;
80
- success: true;
81
- }
82
- export interface IJsonSyncResultError<T> extends IJsonSyncResultBase<T> {
83
- errorData: any;
84
- /** preserve original error message from failed cached result */
85
- errorMessage: string;
86
- success: false;
87
- }
88
- export type IJsonSyncResult<T> = IJsonSyncResultSuccess<T> | IJsonSyncResultError<T>;
89
-
90
- export interface IRestError {
91
- message: string;
92
- errorData?: any;
93
- xhr?: XMLHttpRequest;
94
- }