konnektive-engine 0.1.5

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 (2) hide show
  1. package/package.json +43 -0
  2. package/readme.md +69 -0
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "konnektive-engine",
3
+ "version": "0.1.5",
4
+ "description": "",
5
+ "files": [
6
+ "dist/*.js",
7
+ "dist/**/*.js"
8
+ ],
9
+ "scripts": {
10
+ "rm": "rimraf ./dist",
11
+ "build": "npm run rm && webpack --color --progress --mode=development",
12
+ "build:prod": "npm run rm && NODE_ENV=production webpack --color --progress --mode=production",
13
+ "watch": "npm run build -- --watch",
14
+ "dev": "concurrently \"npm run serve\" \"npm run watch\"",
15
+ "serve": "http-server ./dist -a 0.0.0.0 -p 3000",
16
+ "publish": "npm run build:prod && npm publish",
17
+ "lint": "eslint ./src",
18
+ "lint:fix": "eslint ./src --fix"
19
+ },
20
+ "author": "brunoferreiras",
21
+ "license": "ISC",
22
+ "dependencies": {
23
+ "jquery": "1.11.2",
24
+ "sweetalert2": "^11.4.8"
25
+ },
26
+ "devDependencies": {
27
+ "@babel/cli": "^7.17.6",
28
+ "@babel/core": "^7.17.9",
29
+ "@babel/preset-env": "^7.16.11",
30
+ "babel-loader": "^8.2.4",
31
+ "babel-preset-minify": "^0.5.1",
32
+ "concurrently": "^7.1.0",
33
+ "eslint": "^8.13.0",
34
+ "eslint-config-airbnb-base": "^15.0.0",
35
+ "eslint-plugin-import": "^2.26.0",
36
+ "glob": "^7.2.0",
37
+ "http-server": "^14.1.0",
38
+ "npm-watch": "^0.11.0",
39
+ "rimraf": "^3.0.2",
40
+ "webpack": "^5.72.0",
41
+ "webpack-cli": "^4.10.0"
42
+ }
43
+ }
package/readme.md ADDED
@@ -0,0 +1,69 @@
1
+ # Konnektive Engine
2
+
3
+ ## Dependencies
4
+ - jquery: 1.12.4 (is needed you import the jquery before importing this library)
5
+ - [jsDelivr](https://www.jsdelivr.com/) (Create a CDN based on the npm package)
6
+
7
+ # Running on local
8
+
9
+ 1. Build the library
10
+ ```bash
11
+ npm run build # Compile files in development
12
+ npm run build:prod # Compile files optimized for production
13
+ ```
14
+
15
+ 2. Running a local server
16
+ ```bash
17
+ npm run serve # Start a new server on: http://localhost:3000
18
+ ```
19
+
20
+ 3. Running watch with the local server at the same time
21
+ ```bash
22
+ npm run dev # This command will execute `npm run watch` to see all modification files and start a new server.
23
+ ```
24
+
25
+ 4. Acessing the files
26
+ After that you started a local server, you can access the files on `http://localhost:3000`.
27
+
28
+ For example: `http://localhost:3000/index.js`, `http://localhost:3000/api.js`, and so on.
29
+
30
+ # Publish this lib
31
+ First, you need to sign in on npm: `npm login`.
32
+ When you create a new version, it is needly to update the version on `package.json` and execute this command: `npm run publish.` This command is responsible for building the application and publishing the files to npm.
33
+
34
+ The build will create all minified files on `dist` at the same level.
35
+
36
+ Obs.: You cannot override the version, so each version is unique.
37
+
38
+ # Using this lib
39
+ The `version` on URL is the version set on package.json and published on npm.
40
+
41
+ You need to import the file `index.js`. This file is responsible for creating the start function on the application.
42
+ ```
43
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/konnektive-engine@version/dist/index.js"></script>
44
+ ```
45
+
46
+ On the operation site, you need to create a file to set the configurations. In this file, you can override all default variables.
47
+ ```js
48
+ //engine-override.js
49
+ PaymentEngine.init({
50
+ debugMode: 1,
51
+ // others configs
52
+ })
53
+ ```
54
+
55
+ A comparing about the files:
56
+
57
+ | Last file | This lib | Comments
58
+ | ------ | ------ | ------ |
59
+ | 1.stickyConfig.js | https://cdn.jsdelivr.net/npm/konnektive-engine@version/dist/index.js | You need to create the engine-override.js |
60
+ | 1.stickyBaseConfig.js | https://cdn.jsdelivr.net/npm/konnektive-engine@version/dist/index.js | You need to create the engine-override.js |
61
+ | 2.stickyAPIFramework.js | https://cdn.jsdelivr.net/npm/konnektive-engine@version/dist/api.js | You need to import this only if the front is using some function there |
62
+ | 3.stickyUtils.js | https://cdn.jsdelivr.net/npm/konnektive-engine@version/dist/actions.js | |
63
+ | 4.stickyZIPAutofill.js | https://cdn.jsdelivr.net/npm/konnektive-engine@version/dist/zip-autofill.js | |
64
+ | 5.stickyValidations.js | https://cdn.jsdelivr.net/npm/konnektive-engine@version/dist/validation.js | |
65
+ | op-configure.php | It's not needed anymore. | |
66
+ | tracking.php | It's manual copy. | |
67
+ | Code php to set cookies | https://cdn.jsdelivr.net/npm/konnektive-engine@version/dist/cookies.js | Where was using php to set cookies, you can import this file. |
68
+ | ipify.org | You don't need to import anymore, because the IP is got when init the payment engine. | |
69
+ | firePostBack | https://cdn.jsdelivr.net/npm/konnektive-engine@version/dist/redtrack.js | You can use the function after importing this file. |