griddo-sdk 1.0.2 → 1.0.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.
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ **GRIDDO SDK**
2
+ Javascript class SDK for making easy automated tasks with Griddo.
3
+
4
+ **ADD TO YOUR PROJECT**
5
+ npm i griddo-sdk
6
+
7
+ **USE IT!**
8
+ Documentation: https://www.notion.so/thesaurus/Griddo-SDK-c3263026c5fa4721a153ec3e7a05a6e4
9
+
10
+ For sporadic and reusable works, please consider using the SDK through Griddo Debugger (https://github.com/griddo/griddo-debugger).
11
+
12
+ Nothing more to say :P
package/api/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import axios from 'axios';
1
+ const axios = require('axios');
2
2
 
3
3
  const api = (env, method, endpoint, body = null, headers = {}) => {
4
4
  const {
@@ -20,6 +20,6 @@ const api = (env, method, endpoint, body = null, headers = {}) => {
20
20
  .then(response => response.data);
21
21
  };
22
22
 
23
- export default{
23
+ module.exports={
24
24
  api,
25
25
  };
package/models/auth.js CHANGED
@@ -1,4 +1,4 @@
1
- const api = require('../api');
1
+ const { api } = require('../api');
2
2
 
3
3
  const getToken = async (params) => {
4
4
  const {
@@ -9,7 +9,7 @@ const getToken = async (params) => {
9
9
  console.log('Logging to api...');
10
10
  const token = await api({ api: apiKey }, 'post', '/login_check', { email, password })
11
11
  .then(data => data.token);
12
- console.log('Authenticated.')
12
+ console.log('Authenticated.');
13
13
  return token;
14
14
  };
15
15
 
@@ -1,4 +1,4 @@
1
- const api = require('../api');
1
+ const { api } = require('../api');
2
2
 
3
3
  const getLanguages = env => api(env, 'get', '/languages')
4
4
  .then(data => data.items);
@@ -1,4 +1,4 @@
1
- const api = require('../api');
1
+ const { api } = require('../api');
2
2
 
3
3
  const getStatus = env => api(env, 'get', '/live-status');
4
4
 
package/models/pages.js CHANGED
@@ -1,4 +1,4 @@
1
- const api = require('../api');
1
+ const { api } = require('../api');
2
2
 
3
3
  const getPages = (env, template = null) => api(env, 'get', `/pages/all/id/${template ? `?template=${template}` : ''}`);
4
4
 
@@ -1,4 +1,4 @@
1
- const api = require('../api');
1
+ const { api } = require('../api');
2
2
 
3
3
  const getStructuredData = async (env, id, site = null, language = null) => {
4
4
  const headers = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "griddo-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {