@libretexts/cxone-expert-node 1.0.0 → 1.1.1

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 (61) hide show
  1. package/README.md +39 -39
  2. package/dist/cxone-expert-node.cjs.development.js +1511 -0
  3. package/dist/cxone-expert-node.cjs.development.js.map +1 -0
  4. package/dist/cxone-expert-node.cjs.production.min.js +2 -0
  5. package/dist/cxone-expert-node.cjs.production.min.js.map +1 -0
  6. package/dist/cxone-expert-node.esm.js +1505 -0
  7. package/dist/cxone-expert-node.esm.js.map +1 -0
  8. package/dist/index.d.ts +32 -0
  9. package/dist/index.js +8 -0
  10. package/dist/modules/archive.d.ts +18 -0
  11. package/dist/modules/auth.d.ts +8 -0
  12. package/dist/modules/contextMaps.d.ts +10 -0
  13. package/dist/modules/events.d.ts +15 -0
  14. package/dist/modules/files.d.ts +23 -0
  15. package/dist/modules/groups.d.ts +11 -0
  16. package/dist/modules/pages.d.ts +68 -0
  17. package/dist/modules/requests.d.ts +14 -0
  18. package/dist/modules/site.d.ts +22 -0
  19. package/dist/modules/users.d.ts +16 -0
  20. package/dist/types/archive.d.ts +78 -0
  21. package/dist/types/auth.d.ts +11 -0
  22. package/dist/types/contextMaps.d.ts +34 -0
  23. package/dist/types/events.d.ts +68 -0
  24. package/dist/types/files.d.ts +61 -0
  25. package/dist/types/groups.d.ts +57 -0
  26. package/dist/types/index.d.ts +19 -0
  27. package/dist/types/pages.d.ts +737 -0
  28. package/dist/types/requests.d.ts +9 -0
  29. package/dist/types/security.d.ts +57 -0
  30. package/dist/types/site.d.ts +254 -0
  31. package/dist/types/users.d.ts +81 -0
  32. package/dist/utils.d.ts +2 -0
  33. package/license.md +20 -20
  34. package/package.json +16 -5
  35. package/src/index.ts +105 -35
  36. package/src/modules/archive.ts +186 -0
  37. package/src/modules/auth.ts +35 -31
  38. package/src/modules/contextMaps.ts +56 -0
  39. package/src/modules/events.ts +140 -0
  40. package/src/modules/files.ts +291 -0
  41. package/src/modules/groups.ts +79 -0
  42. package/src/modules/pages.ts +1236 -73
  43. package/src/modules/requests.ts +67 -67
  44. package/src/modules/site.ts +266 -0
  45. package/src/modules/users.ts +161 -0
  46. package/src/types/archive.ts +101 -0
  47. package/src/types/auth.ts +13 -13
  48. package/src/types/contextMaps.ts +46 -0
  49. package/src/types/events.ts +91 -0
  50. package/src/types/files.ts +87 -0
  51. package/src/types/groups.ts +74 -0
  52. package/src/types/index.ts +21 -14
  53. package/src/types/pages.ts +858 -171
  54. package/src/types/requests.ts +10 -10
  55. package/src/types/security.ts +60 -47
  56. package/src/types/site.ts +304 -0
  57. package/src/types/users.ts +101 -0
  58. package/src/utils.ts +8 -8
  59. package/.github/workflows/release.yaml +0 -37
  60. package/.releaserc.json +0 -15
  61. package/tsconfig.json +0 -26
package/README.md CHANGED
@@ -1,40 +1,40 @@
1
- # CXone Expert Node SDK
2
- This package is a custom SDK developed by [LibreTexts](https://libretexts.org) to interact with the [CXone Expert API](https://expert-help.nice.com/Integrations_and_Extending_Content/API). It should be noted that this package is NOT developed or maintained by CXone and, as such, does not guarantee 100% compatibility with the latest API updates.
3
-
4
- ## Install
5
-
6
- ```
7
- npm install @libretexts/cxone-expert-node
8
- ```
9
-
10
- ## Usage
11
- ```
12
- import Expert from "@libretexts/cxone-expert-node";
13
-
14
- const tld = "mysite.example.com"; // Your CXone site domain
15
-
16
- const expert = new Expert(tld);
17
-
18
- // Authenticate using server credentials
19
- const authInstance = await expert.auth.ServerToken({
20
- key: "mykey",
21
- secret: "mysecret",
22
- user: "myuser",
23
- });
24
-
25
- // Or, use auth.BrowserToken() to use a CXone provided JWT (not intended for production use)
26
-
27
- // Get authentication header(s) (X-Deki-Token)
28
- const authHeaders = authInstance.getHeader();
29
-
30
- // Use the appropriate module(s) to interact with your site's API
31
- const page = await expert.pages.getPage(123, {
32
- auth: authHeaders,
33
- tld,
34
- });
35
-
36
- console.log(page);
37
- ```
38
-
39
- ## License
1
+ # CXone Expert Node SDK
2
+ This package is a custom SDK developed by [LibreTexts](https://libretexts.org) to interact with the [CXone Expert API](https://expert-help.nice.com/Integrations_and_Extending_Content/API). It should be noted that this package is NOT developed or maintained by CXone and, as such, does not guarantee 100% compatibility with the latest API updates.
3
+
4
+ ## Install
5
+
6
+ ```
7
+ npm install @libretexts/cxone-expert-node
8
+ ```
9
+
10
+ ## Usage
11
+ ```
12
+ import Expert from "@libretexts/cxone-expert-node";
13
+
14
+ const tld = process.env.SERVER_DOMAIN; // Your CXone site domain
15
+
16
+ const expert = new Expert(tld);
17
+
18
+ // Authenticate using server credentials
19
+ const authInstance = await expert.auth.ServerToken({
20
+ key: proccess.env.SERVER_KEY,
21
+ secret: process.env.SERVER_SECRET,
22
+ user: process.env.SERVER_USER,
23
+ });
24
+
25
+ // Or, use auth.BrowserToken() to use a CXone provided JWT (not intended for production use)
26
+
27
+ // Get authentication header(s) (X-Deki-Token)
28
+ const authHeaders = authInstance.getHeader();
29
+
30
+ // Use the appropriate module(s) to interact with your site's API
31
+ const page = await expert.pages.getPage(123, {
32
+ auth: authHeaders,
33
+ tld,
34
+ });
35
+
36
+ console.log(page);
37
+ ```
38
+
39
+ ## License
40
40
  This package is open-source and free to use under the [MIT License](http://opensource.org/licenses/MIT).