@nomad-media/full 1.1.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.
- package/README-npm.md +64 -0
- package/README.md +27 -0
- package/nomad-media-sdk-debug.js +19607 -0
- package/nomad-media-sdk.min.js +342 -0
- package/package.json +37 -0
package/README-npm.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
# Minimum Requirements
|
|
3
|
+
- Node.js 12.0.0
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
To use the Nomad SDK, download the npm nomad-media-npm.
|
|
7
|
+
|
|
8
|
+
```shell
|
|
9
|
+
npm install @nomad-media/nomad-media
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Then to import it, you can either use the default version, or the debug version. The difference is that the debug version isn't compressed and has more documentation and named parameters.
|
|
13
|
+
|
|
14
|
+
To use the default version use:
|
|
15
|
+
|
|
16
|
+
```javascript
|
|
17
|
+
import NomadMediaSDK from "@nomad-media/nomad-media";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
To use the debug version user:
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import NomadMediaSDK from "@nomad-media/nomad-media/debug";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To initialize the sdk, call the NomadMediaSDK class as shown below:
|
|
27
|
+
|
|
28
|
+
```javascript
|
|
29
|
+
const SDK = NomadMediaSDK(config);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Configure Environmental Variables
|
|
33
|
+
|
|
34
|
+
Follow this format for the config:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
const config = {
|
|
38
|
+
"username": "username",
|
|
39
|
+
"password": "password",
|
|
40
|
+
"serviceApiUrl": "serverApiUrl",
|
|
41
|
+
"apiType": "admin",
|
|
42
|
+
"debugMode": true
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
apiType: Specifies whether the function you are trying to run is **admin** or **portal**.
|
|
47
|
+
|
|
48
|
+
debugMode: Specifies when running functions, whether of not to print api call information.
|
|
49
|
+
|
|
50
|
+
You are now ready to use the SDK in your project.
|
|
51
|
+
|
|
52
|
+
> 📘 Contact: Make sure to contact Nomad Media support to get username, password, and url for your enviromnent.
|
|
53
|
+
|
|
54
|
+
> 🚧 Make sure to keep your configuration options secret and do not share them publicly.
|
|
55
|
+
|
|
56
|
+
## Nomad SDK API Guide
|
|
57
|
+
|
|
58
|
+
An overview of all of the Nomad SDK methods. Includes prameter details for the methods.
|
|
59
|
+
|
|
60
|
+
[Nomad SDK References](https://developer.nomad-cms.com/docs/nomad-api-modules)
|
|
61
|
+
|
|
62
|
+
## Nomad SDK NPM Samples
|
|
63
|
+
|
|
64
|
+
[Nomad SDK NPM Samples](https://github.com/Nomad-Media/samples-js)
|
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
## Build and Publish NPM
|
|
2
|
+
To build the files, run the following command in the root directory of the project:
|
|
3
|
+
```bash
|
|
4
|
+
.\publish
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
It will prompt you to enter your NPM username and password. After entering the credentials, the files will be uploaded to NPM.
|
|
8
|
+
|
|
9
|
+
If you want to set up NPM to not prompt you for credentials every time, create a file called .npmrc in your home directory and add the following line to it:
|
|
10
|
+
```.npmrc
|
|
11
|
+
//registry.npmjs.org/:_authToken=<your-token>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Minor and Major Version Bumps
|
|
15
|
+
To bump the minor version, change `patch` in `call npm version patch` to `minor` in the package.json file.
|
|
16
|
+
To bump the major version, change `patch` in `call version patch` to `major` in the package.json file.
|
|
17
|
+
|
|
18
|
+
## Testing
|
|
19
|
+
To test a specific file in the test directory, run the following command in the root directory of the project:
|
|
20
|
+
```bash
|
|
21
|
+
npm test test/<file-name>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
To test all the files in the test directory, run the following command in the root directory of the project:
|
|
25
|
+
```bash
|
|
26
|
+
npm test
|
|
27
|
+
```
|