@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.
- package/README.md +39 -39
- package/dist/cxone-expert-node.cjs.development.js +1511 -0
- package/dist/cxone-expert-node.cjs.development.js.map +1 -0
- package/dist/cxone-expert-node.cjs.production.min.js +2 -0
- package/dist/cxone-expert-node.cjs.production.min.js.map +1 -0
- package/dist/cxone-expert-node.esm.js +1505 -0
- package/dist/cxone-expert-node.esm.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +8 -0
- package/dist/modules/archive.d.ts +18 -0
- package/dist/modules/auth.d.ts +8 -0
- package/dist/modules/contextMaps.d.ts +10 -0
- package/dist/modules/events.d.ts +15 -0
- package/dist/modules/files.d.ts +23 -0
- package/dist/modules/groups.d.ts +11 -0
- package/dist/modules/pages.d.ts +68 -0
- package/dist/modules/requests.d.ts +14 -0
- package/dist/modules/site.d.ts +22 -0
- package/dist/modules/users.d.ts +16 -0
- package/dist/types/archive.d.ts +78 -0
- package/dist/types/auth.d.ts +11 -0
- package/dist/types/contextMaps.d.ts +34 -0
- package/dist/types/events.d.ts +68 -0
- package/dist/types/files.d.ts +61 -0
- package/dist/types/groups.d.ts +57 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/pages.d.ts +737 -0
- package/dist/types/requests.d.ts +9 -0
- package/dist/types/security.d.ts +57 -0
- package/dist/types/site.d.ts +254 -0
- package/dist/types/users.d.ts +81 -0
- package/dist/utils.d.ts +2 -0
- package/license.md +20 -20
- package/package.json +16 -5
- package/src/index.ts +105 -35
- package/src/modules/archive.ts +186 -0
- package/src/modules/auth.ts +35 -31
- package/src/modules/contextMaps.ts +56 -0
- package/src/modules/events.ts +140 -0
- package/src/modules/files.ts +291 -0
- package/src/modules/groups.ts +79 -0
- package/src/modules/pages.ts +1236 -73
- package/src/modules/requests.ts +67 -67
- package/src/modules/site.ts +266 -0
- package/src/modules/users.ts +161 -0
- package/src/types/archive.ts +101 -0
- package/src/types/auth.ts +13 -13
- package/src/types/contextMaps.ts +46 -0
- package/src/types/events.ts +91 -0
- package/src/types/files.ts +87 -0
- package/src/types/groups.ts +74 -0
- package/src/types/index.ts +21 -14
- package/src/types/pages.ts +858 -171
- package/src/types/requests.ts +10 -10
- package/src/types/security.ts +60 -47
- package/src/types/site.ts +304 -0
- package/src/types/users.ts +101 -0
- package/src/utils.ts +8 -8
- package/.github/workflows/release.yaml +0 -37
- package/.releaserc.json +0 -15
- 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 =
|
|
15
|
-
|
|
16
|
-
const expert = new Expert(tld);
|
|
17
|
-
|
|
18
|
-
// Authenticate using server credentials
|
|
19
|
-
const authInstance = await expert.auth.ServerToken({
|
|
20
|
-
key:
|
|
21
|
-
secret:
|
|
22
|
-
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
|
|
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).
|