griddo-sdk 1.0.8 → 1.0.9
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/index.js +6 -1
- package/models/structuredData.js +6 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { api } = require('./api');
|
|
2
2
|
const { getToken } = require('./models/auth');
|
|
3
3
|
const { getPages, getPage, savePage, deletePage, restorePage } = require('./models/pages');
|
|
4
|
-
const { getStructuredData, saveStructuredData } = require('./models/structuredData');
|
|
4
|
+
const { getStructuredData, saveStructuredData, deleteStructuredData } = require('./models/structuredData');
|
|
5
5
|
const { getLanguages } = require('./models/languages');
|
|
6
6
|
const { getStatus } = require('./models/liveStatus');
|
|
7
7
|
|
|
@@ -19,6 +19,7 @@ class SDK {
|
|
|
19
19
|
this.mapModules = this.mapModules.bind(this);
|
|
20
20
|
this.getStructuredData = this.getStructuredData.bind(this);
|
|
21
21
|
this.saveStructuredData = this.saveStructuredData.bind(this);
|
|
22
|
+
this.deleteStructuredData = this.deleteStructuredData.bind(this);
|
|
22
23
|
this.getLanguage = this.getLanguage.bind(this);
|
|
23
24
|
this.getDefaultLanguage = this.getDefaultLanguage.bind(this);
|
|
24
25
|
this.languages = [];
|
|
@@ -128,6 +129,10 @@ class SDK {
|
|
|
128
129
|
return await saveStructuredData(this._env, structuredData);
|
|
129
130
|
};
|
|
130
131
|
|
|
132
|
+
async deleteStructuredData(id) {
|
|
133
|
+
return await deleteStructuredData(this._env, id);
|
|
134
|
+
};
|
|
135
|
+
|
|
131
136
|
async api(...params) {
|
|
132
137
|
return await api(this._env, ...params);
|
|
133
138
|
};
|
package/models/structuredData.js
CHANGED
|
@@ -33,7 +33,13 @@ const saveStructuredData = async (env, structuredData) => {
|
|
|
33
33
|
return savedItem;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
const deleteStructuredData = (env, id) => {
|
|
37
|
+
if (env.verbose) console.log('\tDelete structured data', id);
|
|
38
|
+
return api(env, 'delete', `/structured_data_content/${id}`);
|
|
39
|
+
};
|
|
40
|
+
|
|
36
41
|
module.exports = {
|
|
37
42
|
getStructuredData,
|
|
38
43
|
saveStructuredData,
|
|
44
|
+
deleteStructuredData,
|
|
39
45
|
};
|