@kwiz/common 1.0.129 → 1.0.132

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 (100) hide show
  1. package/.github/workflows/npm-publish.yml +24 -24
  2. package/LICENSE +21 -21
  3. package/lib/cjs/config.js +2 -0
  4. package/lib/cjs/config.js.map +1 -1
  5. package/lib/cjs/types/libs/msal.types.js +26 -26
  6. package/lib/cjs/utils/sharepoint.rest/user.js +11 -11
  7. package/lib/esm/config.js +2 -0
  8. package/lib/esm/config.js.map +1 -1
  9. package/lib/esm/types/libs/msal.types.js +26 -26
  10. package/lib/esm/utils/sharepoint.rest/user.js +11 -11
  11. package/lib/types/config.d.ts +2 -0
  12. package/package.json +81 -81
  13. package/readme.md +17 -17
  14. package/src/_dependencies.ts +12 -12
  15. package/src/config.ts +19 -17
  16. package/src/helpers/Guid.ts +181 -181
  17. package/src/helpers/base64.ts +173 -173
  18. package/src/helpers/browser.test.js +13 -13
  19. package/src/helpers/browser.ts +1504 -1504
  20. package/src/helpers/browserinfo.ts +292 -292
  21. package/src/helpers/collections.base.test.js +25 -25
  22. package/src/helpers/collections.base.ts +437 -437
  23. package/src/helpers/collections.ts +107 -107
  24. package/src/helpers/color.ts +54 -54
  25. package/src/helpers/cookies.ts +59 -59
  26. package/src/helpers/date.test.js +119 -119
  27. package/src/helpers/date.ts +188 -188
  28. package/src/helpers/debug.ts +186 -186
  29. package/src/helpers/diagrams.ts +43 -43
  30. package/src/helpers/emails.ts +6 -6
  31. package/src/helpers/eval.ts +5 -5
  32. package/src/helpers/file.test.js +50 -50
  33. package/src/helpers/file.ts +63 -63
  34. package/src/helpers/flatted.ts +149 -149
  35. package/src/helpers/functions.ts +16 -16
  36. package/src/helpers/graph/calendar.types.ts +10 -10
  37. package/src/helpers/http.ts +69 -69
  38. package/src/helpers/images.ts +22 -22
  39. package/src/helpers/json.ts +44 -44
  40. package/src/helpers/md5.ts +189 -189
  41. package/src/helpers/objects.test.js +33 -33
  42. package/src/helpers/objects.ts +274 -274
  43. package/src/helpers/promises.test.js +37 -37
  44. package/src/helpers/promises.ts +165 -165
  45. package/src/helpers/random.ts +27 -27
  46. package/src/helpers/scheduler/scheduler.test.js +103 -103
  47. package/src/helpers/scheduler/scheduler.ts +131 -131
  48. package/src/helpers/sharepoint.ts +796 -796
  49. package/src/helpers/strings.test.js +122 -122
  50. package/src/helpers/strings.ts +337 -337
  51. package/src/helpers/typecheckers.test.js +34 -34
  52. package/src/helpers/typecheckers.ts +266 -266
  53. package/src/helpers/url.test.js +43 -43
  54. package/src/helpers/url.ts +207 -207
  55. package/src/helpers/urlhelper.ts +111 -111
  56. package/src/index.ts +6 -6
  57. package/src/types/auth.ts +62 -62
  58. package/src/types/common.types.ts +15 -15
  59. package/src/types/flatted.types.ts +59 -59
  60. package/src/types/globals.types.ts +6 -6
  61. package/src/types/graph/calendar.types.ts +80 -80
  62. package/src/types/knownscript.types.ts +18 -18
  63. package/src/types/libs/datajs.types.ts +28 -28
  64. package/src/types/libs/ics.types.ts +30 -30
  65. package/src/types/libs/msal.types.ts +57 -57
  66. package/src/types/locales.ts +125 -125
  67. package/src/types/localstoragecache.types.ts +8 -8
  68. package/src/types/location.types.ts +27 -27
  69. package/src/types/moment.ts +11 -11
  70. package/src/types/regex.types.ts +16 -16
  71. package/src/types/rest.types.ts +95 -95
  72. package/src/types/sharepoint.types.ts +1466 -1466
  73. package/src/types/sharepoint.utils.types.ts +306 -306
  74. package/src/utils/auth/common.ts +118 -118
  75. package/src/utils/auth/discovery.test.js +12 -12
  76. package/src/utils/auth/discovery.ts +132 -132
  77. package/src/utils/base64.ts +27 -27
  78. package/src/utils/consolelogger.ts +333 -333
  79. package/src/utils/date.ts +172 -172
  80. package/src/utils/emails.ts +24 -24
  81. package/src/utils/knownscript.ts +286 -286
  82. package/src/utils/localstoragecache.ts +446 -446
  83. package/src/utils/rest.ts +501 -501
  84. package/src/utils/script.ts +170 -170
  85. package/src/utils/sharepoint.rest/common.ts +159 -159
  86. package/src/utils/sharepoint.rest/date.ts +62 -62
  87. package/src/utils/sharepoint.rest/file.folder.ts +685 -685
  88. package/src/utils/sharepoint.rest/item.ts +547 -547
  89. package/src/utils/sharepoint.rest/list.ts +1572 -1572
  90. package/src/utils/sharepoint.rest/listutils/GetListItemsByCaml.ts +774 -774
  91. package/src/utils/sharepoint.rest/listutils/GetListItemsById.ts +275 -275
  92. package/src/utils/sharepoint.rest/listutils/common.ts +206 -206
  93. package/src/utils/sharepoint.rest/location.ts +141 -141
  94. package/src/utils/sharepoint.rest/navigation-links.ts +86 -86
  95. package/src/utils/sharepoint.rest/user-search.ts +252 -252
  96. package/src/utils/sharepoint.rest/user.ts +558 -558
  97. package/src/utils/sharepoint.rest/web.ts +1384 -1384
  98. package/src/utils/sod.ts +194 -194
  99. package/.madgerc +0 -3
  100. package/fix-folder-imports.js +0 -27
@@ -1,24 +1,24 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- push:
8
- tags:
9
- - 'v*.*.*' # run every time we commit with a new version number
10
-
11
- jobs:
12
- build-publish-npm:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@v4
16
- - uses: actions/setup-node@v4
17
- with:
18
- node-version: 18
19
- registry-url: https://registry.npmjs.org/
20
- - run: npm ci
21
- - run: npm run build
22
- - run: npm publish --access public
23
- env:
24
- NODE_AUTH_TOKEN: ${{secrets.KWIZ_NPM_TOKEN}}
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ push:
8
+ tags:
9
+ - 'v*.*.*' # run every time we commit with a new version number
10
+
11
+ jobs:
12
+ build-publish-npm:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: actions/setup-node@v4
17
+ with:
18
+ node-version: 18
19
+ registry-url: https://registry.npmjs.org/
20
+ - run: npm ci
21
+ - run: npm run build
22
+ - run: npm publish --access public
23
+ env:
24
+ NODE_AUTH_TOKEN: ${{secrets.KWIZ_NPM_TOKEN}}
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 KWIZ Corp
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 KWIZ Corp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/lib/cjs/config.js CHANGED
@@ -9,6 +9,8 @@ function config(params) {
9
9
  return consolelogger_1.ConsoleLogger.get(name, params.ProjectName);
10
10
  }
11
11
  return {
12
+ GetLogger,
13
+ /** @deprecated exported as GetLogger, which is how is used anyways */
12
14
  logger: GetLogger
13
15
  };
14
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAClD,yDAAsD;AAEtD,SAAgB,MAAM,CAAC,MAKtB;IACG,IAAA,+BAAe,EAAC,MAAM,CAAC,CAAC;IACxB,SAAS,SAAS,CAAC,IAAY;QAC3B,OAAO,6BAAa,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACvD,CAAC;IACD,OAAO;QACH,MAAM,EAAE,SAAS;KACpB,CAAA;AACL,CAAC;AAbD,wBAaC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAClD,yDAAsD;AAEtD,SAAgB,MAAM,CAAC,MAKtB;IACG,IAAA,+BAAe,EAAC,MAAM,CAAC,CAAC;IACxB,SAAS,SAAS,CAAC,IAAY;QAC3B,OAAO,6BAAa,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACvD,CAAC;IACD,OAAO;QACH,SAAS;QACT,uEAAuE;QACvE,MAAM,EAAE,SAAS;KACpB,CAAA;AACL,CAAC;AAfD,wBAeC"}
@@ -1,31 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MSALSampleLoginPopupScript = void 0;
4
- exports.MSALSampleLoginPopupScript = `<p id="msg">please wait...</p>
5
- <script>
6
- function finish() {
7
- try {
8
- var hash = window.location.hash;
9
- if (hash[0] === "#") hash = hash.slice(1);//get rid of #
10
- var hashDictionary = {};
11
- hash.split("&").forEach(function (keyValue) {
12
- if (keyValue !== "") {
13
- var vals = keyValue.split("=");
14
- hashDictionary[vals[0]] = decodeURIComponent(vals[1]);
15
- }
16
- });
17
- if (Object.keys(hashDictionary).length < 1)
18
- window.close();//we lose the hash!
19
- else if (hashDictionary.error && hashDictionary.error_description)
20
- document.getElementById("msg").innerHTML = hashDictionary.error_description.replace(/\\+/g," ").replace(/\\n/g,"<br /><br />");
21
- else if (hashDictionary.state) {
22
- var origin = hashDictionary.state.split("|")[1];
23
- if (origin) {
24
- window.location.href = origin.split("#")[0] + window.location.hash;
25
- }
26
- }
27
- } catch (e) { }
28
- }
29
- finish();
4
+ exports.MSALSampleLoginPopupScript = `<p id="msg">please wait...</p>
5
+ <script>
6
+ function finish() {
7
+ try {
8
+ var hash = window.location.hash;
9
+ if (hash[0] === "#") hash = hash.slice(1);//get rid of #
10
+ var hashDictionary = {};
11
+ hash.split("&").forEach(function (keyValue) {
12
+ if (keyValue !== "") {
13
+ var vals = keyValue.split("=");
14
+ hashDictionary[vals[0]] = decodeURIComponent(vals[1]);
15
+ }
16
+ });
17
+ if (Object.keys(hashDictionary).length < 1)
18
+ window.close();//we lose the hash!
19
+ else if (hashDictionary.error && hashDictionary.error_description)
20
+ document.getElementById("msg").innerHTML = hashDictionary.error_description.replace(/\\+/g," ").replace(/\\n/g,"<br /><br />");
21
+ else if (hashDictionary.state) {
22
+ var origin = hashDictionary.state.split("|")[1];
23
+ if (origin) {
24
+ window.location.href = origin.split("#")[0] + window.location.hash;
25
+ }
26
+ }
27
+ } catch (e) { }
28
+ }
29
+ finish();
30
30
  </script>`;
31
31
  //# sourceMappingURL=msal.types.js.map
@@ -410,17 +410,17 @@ async function SetGroupOwner(siteUrl, groupId, ownerId, ownerIsAGroup) {
410
410
  try {
411
411
  let soapUrl = `${(0, common_1.GetSiteUrl)(siteUrl)}_vti_bin/client.svc/ProcessQuery`;
412
412
  let siteId = await (0, web_1.GetSiteId)(siteUrl);
413
- let serviceJSONResponse = await (0, rest_1.GetJson)(soapUrl, `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
414
- <Actions>
415
- <SetProperty Id="1" ObjectPathId="2" Name="Owner">
416
- <Parameter ObjectPathId="3" />
417
- </SetProperty>
418
- <Method Name="Update" Id="4" ObjectPathId="2" />
419
- </Actions>
420
- <ObjectPaths>
421
- <Identity Id="2" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${groupId}" />
422
- <Identity Id="3" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${ownerId}" />
423
- </ObjectPaths>
413
+ let serviceJSONResponse = await (0, rest_1.GetJson)(soapUrl, `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
414
+ <Actions>
415
+ <SetProperty Id="1" ObjectPathId="2" Name="Owner">
416
+ <Parameter ObjectPathId="3" />
417
+ </SetProperty>
418
+ <Method Name="Update" Id="4" ObjectPathId="2" />
419
+ </Actions>
420
+ <ObjectPaths>
421
+ <Identity Id="2" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${groupId}" />
422
+ <Identity Id="3" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${ownerId}" />
423
+ </ObjectPaths>
424
424
  </Request>`, {
425
425
  headers: {
426
426
  Accept: rest_types_1.jsonTypes.standard,
package/lib/esm/config.js CHANGED
@@ -6,6 +6,8 @@ export function config(params) {
6
6
  return ConsoleLogger.get(name, params.ProjectName);
7
7
  }
8
8
  return {
9
+ GetLogger,
10
+ /** @deprecated exported as GetLogger, which is how is used anyways */
9
11
  logger: GetLogger
10
12
  };
11
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,UAAU,MAAM,CAAC,MAKtB;IACG,eAAe,CAAC,MAAM,CAAC,CAAC;IACxB,SAAS,SAAS,CAAC,IAAY;QAC3B,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACvD,CAAC;IACD,OAAO;QACH,MAAM,EAAE,SAAS;KACpB,CAAA;AACL,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,UAAU,MAAM,CAAC,MAKtB;IACG,eAAe,CAAC,MAAM,CAAC,CAAC;IACxB,SAAS,SAAS,CAAC,IAAY;QAC3B,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IACvD,CAAC;IACD,OAAO;QACH,SAAS;QACT,uEAAuE;QACvE,MAAM,EAAE,SAAS;KACpB,CAAA;AACL,CAAC"}
@@ -1,28 +1,28 @@
1
- export const MSALSampleLoginPopupScript = `<p id="msg">please wait...</p>
2
- <script>
3
- function finish() {
4
- try {
5
- var hash = window.location.hash;
6
- if (hash[0] === "#") hash = hash.slice(1);//get rid of #
7
- var hashDictionary = {};
8
- hash.split("&").forEach(function (keyValue) {
9
- if (keyValue !== "") {
10
- var vals = keyValue.split("=");
11
- hashDictionary[vals[0]] = decodeURIComponent(vals[1]);
12
- }
13
- });
14
- if (Object.keys(hashDictionary).length < 1)
15
- window.close();//we lose the hash!
16
- else if (hashDictionary.error && hashDictionary.error_description)
17
- document.getElementById("msg").innerHTML = hashDictionary.error_description.replace(/\\+/g," ").replace(/\\n/g,"<br /><br />");
18
- else if (hashDictionary.state) {
19
- var origin = hashDictionary.state.split("|")[1];
20
- if (origin) {
21
- window.location.href = origin.split("#")[0] + window.location.hash;
22
- }
23
- }
24
- } catch (e) { }
25
- }
26
- finish();
1
+ export const MSALSampleLoginPopupScript = `<p id="msg">please wait...</p>
2
+ <script>
3
+ function finish() {
4
+ try {
5
+ var hash = window.location.hash;
6
+ if (hash[0] === "#") hash = hash.slice(1);//get rid of #
7
+ var hashDictionary = {};
8
+ hash.split("&").forEach(function (keyValue) {
9
+ if (keyValue !== "") {
10
+ var vals = keyValue.split("=");
11
+ hashDictionary[vals[0]] = decodeURIComponent(vals[1]);
12
+ }
13
+ });
14
+ if (Object.keys(hashDictionary).length < 1)
15
+ window.close();//we lose the hash!
16
+ else if (hashDictionary.error && hashDictionary.error_description)
17
+ document.getElementById("msg").innerHTML = hashDictionary.error_description.replace(/\\+/g," ").replace(/\\n/g,"<br /><br />");
18
+ else if (hashDictionary.state) {
19
+ var origin = hashDictionary.state.split("|")[1];
20
+ if (origin) {
21
+ window.location.href = origin.split("#")[0] + window.location.hash;
22
+ }
23
+ }
24
+ } catch (e) { }
25
+ }
26
+ finish();
27
27
  </script>`;
28
28
  //# sourceMappingURL=msal.types.js.map
@@ -385,17 +385,17 @@ export async function SetGroupOwner(siteUrl, groupId, ownerId, ownerIsAGroup) {
385
385
  try {
386
386
  let soapUrl = `${GetSiteUrl(siteUrl)}_vti_bin/client.svc/ProcessQuery`;
387
387
  let siteId = await GetSiteId(siteUrl);
388
- let serviceJSONResponse = await GetJson(soapUrl, `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
389
- <Actions>
390
- <SetProperty Id="1" ObjectPathId="2" Name="Owner">
391
- <Parameter ObjectPathId="3" />
392
- </SetProperty>
393
- <Method Name="Update" Id="4" ObjectPathId="2" />
394
- </Actions>
395
- <ObjectPaths>
396
- <Identity Id="2" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${groupId}" />
397
- <Identity Id="3" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${ownerId}" />
398
- </ObjectPaths>
388
+ let serviceJSONResponse = await GetJson(soapUrl, `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
389
+ <Actions>
390
+ <SetProperty Id="1" ObjectPathId="2" Name="Owner">
391
+ <Parameter ObjectPathId="3" />
392
+ </SetProperty>
393
+ <Method Name="Update" Id="4" ObjectPathId="2" />
394
+ </Actions>
395
+ <ObjectPaths>
396
+ <Identity Id="2" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${groupId}" />
397
+ <Identity Id="3" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${siteId}:g:${ownerId}" />
398
+ </ObjectPaths>
399
399
  </Request>`, {
400
400
  headers: {
401
401
  Accept: jsonTypes.standard,
@@ -5,5 +5,7 @@ export declare function config(params: {
5
5
  ReleaseStatus?: string;
6
6
  ProjectName?: string;
7
7
  }): {
8
+ GetLogger: (name: string) => ConsoleLogger;
9
+ /** @deprecated exported as GetLogger, which is how is used anyways */
8
10
  logger: (name: string) => ConsoleLogger;
9
11
  };
package/package.json CHANGED
@@ -1,81 +1,81 @@
1
- {
2
- "name": "@kwiz/common",
3
- "version": "1.0.129",
4
- "description": "KWIZ common utilities and helpers for M365 platform",
5
- "main": "lib/cjs/index.js",
6
- "module": "lib/esm/index.js",
7
- "types": "lib/types/index.d.ts",
8
- "sideEffects": [
9
- "*.scss*",
10
- "lib/esm/helpers/debug.js",
11
- "lib/esm/config.js"
12
- ],
13
- "exports": {
14
- ".": {
15
- "types": "./lib/types/index.d.ts",
16
- "import": "./lib/esm/index.js",
17
- "require": "./lib/cjs/index.js"
18
- },
19
- "./package.json": "./package.json"
20
- },
21
- "scripts": {
22
- "watch": "npm-run-all --parallel watch:esm watch:cjs",
23
- "watch:esm": "tsc -p tsconfig.esm.json -watch",
24
- "watch:cjs": "tsc -p tsconfig.cjs.json -watch",
25
- "build": "npm run reindex-project && npm run test && npm run build:esm && npm run build:cjs",
26
- "build:esm": "tsc -p tsconfig.esm.json",
27
- "build:cjs": "tsc -p tsconfig.cjs.json",
28
- "build-explain": "tsc --explainFiles",
29
- "check-dependencies": "madge --circular ./src",
30
- "create-link": "npm link",
31
- "test": "node --import tsx --test src",
32
- "npm-v-patch": "npm version patch && git push origin main:main && git push --tags",
33
- "npm-v-major": "npm version major && git push origin main:main && git push --tags",
34
- "___do_not_use_npm-publish": "npm publish --access public",
35
- "reset-repo": "git fetch origin && git reset --hard origin/main",
36
- "reindex-project": "cti create ./src -i _dependencies -w -b -n -o exports-index.ts && node fix-folder-imports.js"
37
- },
38
- "repository": {
39
- "type": "git",
40
- "url": "git+https://github.com/KWizCom/common.git"
41
- },
42
- "keywords": [
43
- "KWIZ",
44
- "SharePoint",
45
- "SPO",
46
- "Teams",
47
- "Utilities",
48
- "Helpers"
49
- ],
50
- "author": "Shai Petel",
51
- "contributors": [
52
- "Shai Petel",
53
- "Kevin Vieira"
54
- ],
55
- "license": "MIT",
56
- "bugs": {
57
- "url": "https://github.com/KWizCom/common/issues",
58
- "email": "support@kwizcom.com"
59
- },
60
- "homepage": "https://github.com/KWizCom/common#readme",
61
- "private": false,
62
- "engines": {
63
- "node": ">=16"
64
- },
65
- "packageManager": "npm@9.5.1",
66
- "devDependencies": {
67
- "@types/dom-navigation": "^1.0.4",
68
- "create-ts-index": "^1.14.0",
69
- "fs-extra": "^11.2.0",
70
- "madge": "^6.1.0",
71
- "npm-run-all": "^4.1.5",
72
- "tsx": "^4.7.1",
73
- "typescript": "^5.3.3",
74
- "xhr2": "^0.2.1"
75
- },
76
- "dependencies": {
77
- "esbuild": "^0.19.12",
78
- "get-tsconfig": "^4.7.2",
79
- "resolve-pkg-maps": "^1.0.0"
80
- }
81
- }
1
+ {
2
+ "name": "@kwiz/common",
3
+ "version": "1.0.132",
4
+ "description": "KWIZ common utilities and helpers for M365 platform",
5
+ "main": "lib/cjs/index.js",
6
+ "module": "lib/esm/index.js",
7
+ "types": "lib/types/index.d.ts",
8
+ "sideEffects": [
9
+ "*.scss*",
10
+ "lib/esm/helpers/debug.js",
11
+ "lib/esm/config.js"
12
+ ],
13
+ "exports": {
14
+ ".": {
15
+ "types": "./lib/types/index.d.ts",
16
+ "import": "./lib/esm/index.js",
17
+ "require": "./lib/cjs/index.js"
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
21
+ "scripts": {
22
+ "watch": "npm-run-all --parallel watch:esm watch:cjs",
23
+ "watch:esm": "tsc -p tsconfig.esm.json -watch",
24
+ "watch:cjs": "tsc -p tsconfig.cjs.json -watch",
25
+ "build": "npm run reindex-project && npm run test && npm run build:esm && npm run build:cjs",
26
+ "build:esm": "tsc -p tsconfig.esm.json",
27
+ "build:cjs": "tsc -p tsconfig.cjs.json",
28
+ "build-explain": "tsc --explainFiles",
29
+ "check-dependencies": "madge --circular ./src",
30
+ "create-link": "npm link",
31
+ "test": "node --import tsx --test src",
32
+ "npm-v-patch": "npm version patch && git push origin main:main && git push --tags",
33
+ "npm-v-major": "npm version major && git push origin main:main && git push --tags",
34
+ "___do_not_use_npm-publish": "npm publish --access public",
35
+ "reset-repo": "git fetch origin && git reset --hard origin/main",
36
+ "reindex-project": "cti create ./src -i _dependencies -w -b -n -o exports-index.ts && node fix-folder-imports.js"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/KWizCom/common.git"
41
+ },
42
+ "keywords": [
43
+ "KWIZ",
44
+ "SharePoint",
45
+ "SPO",
46
+ "Teams",
47
+ "Utilities",
48
+ "Helpers"
49
+ ],
50
+ "author": "Shai Petel",
51
+ "contributors": [
52
+ "Shai Petel",
53
+ "Kevin Vieira"
54
+ ],
55
+ "license": "MIT",
56
+ "bugs": {
57
+ "url": "https://github.com/KWizCom/common/issues",
58
+ "email": "support@kwizcom.com"
59
+ },
60
+ "homepage": "https://github.com/KWizCom/common#readme",
61
+ "private": false,
62
+ "engines": {
63
+ "node": ">=16"
64
+ },
65
+ "packageManager": "npm@9.5.1",
66
+ "devDependencies": {
67
+ "@types/dom-navigation": "^1.0.4",
68
+ "create-ts-index": "^1.14.0",
69
+ "fs-extra": "^11.2.0",
70
+ "madge": "^6.1.0",
71
+ "npm-run-all": "^4.1.5",
72
+ "tsx": "^4.7.1",
73
+ "typescript": "^5.3.3",
74
+ "xhr2": "^0.2.1"
75
+ },
76
+ "dependencies": {
77
+ "esbuild": "^0.19.12",
78
+ "get-tsconfig": "^4.7.2",
79
+ "resolve-pkg-maps": "^1.0.0"
80
+ }
81
+ }
package/readme.md CHANGED
@@ -1,17 +1,17 @@
1
- # KWIZ Common Repo
2
-
3
- A collection of common helpers and utilities used across KWIZ projects
4
-
5
- To get started, configure our modules to your project by calling config:
6
-
7
- ```
8
- import { config } from "@kwiz/common";
9
- export const { logger: GetLogger } = config({
10
- BuildNumber: BuildNumber,
11
- //send true to have verbose logs and turn on debug mode
12
- IsLocalDev: IsLocalDev,
13
- ReleaseStatus: ReleaseStatus,
14
- //prefix logger with your project name
15
- ProjectName: "[cms]"
16
- });
17
- ```
1
+ # KWIZ Common Repo
2
+
3
+ A collection of common helpers and utilities used across KWIZ projects
4
+
5
+ To get started, configure our modules to your project by calling config:
6
+
7
+ ```
8
+ import { config } from "@kwiz/common";
9
+ export const { GetLogger } = config({
10
+ BuildNumber: BuildNumber,
11
+ //send true to have verbose logs and turn on debug mode
12
+ IsLocalDev: IsLocalDev,
13
+ ReleaseStatus: ReleaseStatus,
14
+ //prefix logger with your project name
15
+ ProjectName: "[cms]"
16
+ });
17
+ ```
@@ -1,13 +1,13 @@
1
-
2
- export var BuildNumber = "unset";
3
- export var IsLocalDev = false;
4
- export var ReleaseStatus = "npm";
5
- export function SetDependencies(params: {
6
- BuildNumber?: string;
7
- IsLocalDev?: boolean;
8
- ReleaseStatus?: string;
9
- }) {
10
- if (typeof params.BuildNumber === "string") BuildNumber = params.BuildNumber;
11
- if (typeof params.IsLocalDev === "boolean") IsLocalDev = params.IsLocalDev;
12
- if (typeof params.ReleaseStatus === "string") ReleaseStatus = params.ReleaseStatus;
1
+
2
+ export var BuildNumber = "unset";
3
+ export var IsLocalDev = false;
4
+ export var ReleaseStatus = "npm";
5
+ export function SetDependencies(params: {
6
+ BuildNumber?: string;
7
+ IsLocalDev?: boolean;
8
+ ReleaseStatus?: string;
9
+ }) {
10
+ if (typeof params.BuildNumber === "string") BuildNumber = params.BuildNumber;
11
+ if (typeof params.IsLocalDev === "boolean") IsLocalDev = params.IsLocalDev;
12
+ if (typeof params.ReleaseStatus === "string") ReleaseStatus = params.ReleaseStatus;
13
13
  }
package/src/config.ts CHANGED
@@ -1,17 +1,19 @@
1
- import { SetDependencies } from './_dependencies';
2
- import { ConsoleLogger } from './utils/consolelogger';
3
-
4
- export function config(params: {
5
- BuildNumber?: string;
6
- IsLocalDev?: boolean;
7
- ReleaseStatus?: string;
8
- ProjectName?: string;
9
- }) {
10
- SetDependencies(params);
11
- function GetLogger(name: string) {
12
- return ConsoleLogger.get(name, params.ProjectName);
13
- }
14
- return {
15
- logger: GetLogger
16
- }
17
- }
1
+ import { SetDependencies } from './_dependencies';
2
+ import { ConsoleLogger } from './utils/consolelogger';
3
+
4
+ export function config(params: {
5
+ BuildNumber?: string;
6
+ IsLocalDev?: boolean;
7
+ ReleaseStatus?: string;
8
+ ProjectName?: string;
9
+ }) {
10
+ SetDependencies(params);
11
+ function GetLogger(name: string) {
12
+ return ConsoleLogger.get(name, params.ProjectName);
13
+ }
14
+ return {
15
+ GetLogger,
16
+ /** @deprecated exported as GetLogger, which is how is used anyways */
17
+ logger: GetLogger
18
+ }
19
+ }