@digipair/skill-common 0.78.1 → 0.78.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/index.cjs.js +6 -6
- package/index.esm.js +6 -6
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -73,13 +73,13 @@ let CommonService = class CommonService {
|
|
|
73
73
|
var _context_privates_EDITOR_PATH;
|
|
74
74
|
const path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs';
|
|
75
75
|
const { digipair } = params;
|
|
76
|
-
let
|
|
77
|
-
content = await fs.promises.readFile(`${path}/${digipair}/config.json`, 'utf8');
|
|
76
|
+
let schema = {};
|
|
77
|
+
const content = await fs.promises.readFile(`${path}/${digipair}/config.json`, 'utf8');
|
|
78
78
|
const config = JSON.parse(content);
|
|
79
79
|
// check if schema.json exists
|
|
80
80
|
if (fs.existsSync(`${path}/${digipair}/schema.json`)) {
|
|
81
81
|
const text = await fs.promises.readFile(`${path}/${digipair}/schema.json`, 'utf8');
|
|
82
|
-
|
|
82
|
+
schema = JSON.parse(text);
|
|
83
83
|
}
|
|
84
84
|
const files = await fs.promises.readdir(`${path}/${digipair}`);
|
|
85
85
|
const actions = (await Promise.all(files.map((file)=>{
|
|
@@ -136,9 +136,9 @@ let CommonService = class CommonService {
|
|
|
136
136
|
version: '1.0.0',
|
|
137
137
|
'x-icon': '🤖'
|
|
138
138
|
}
|
|
139
|
-
},
|
|
140
|
-
paths: _extends({},
|
|
141
|
-
'x-scene-blocks': _extends({},
|
|
139
|
+
}, schema, {
|
|
140
|
+
paths: _extends({}, schema.paths, actions),
|
|
141
|
+
'x-scene-blocks': _extends({}, schema['x-scene-blocks'], triggers)
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
};
|
package/index.esm.js
CHANGED
|
@@ -69,13 +69,13 @@ let CommonService = class CommonService {
|
|
|
69
69
|
var _context_privates_EDITOR_PATH;
|
|
70
70
|
const path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs';
|
|
71
71
|
const { digipair } = params;
|
|
72
|
-
let
|
|
73
|
-
content = await promises.readFile(`${path}/${digipair}/config.json`, 'utf8');
|
|
72
|
+
let schema = {};
|
|
73
|
+
const content = await promises.readFile(`${path}/${digipair}/config.json`, 'utf8');
|
|
74
74
|
const config = JSON.parse(content);
|
|
75
75
|
// check if schema.json exists
|
|
76
76
|
if (existsSync(`${path}/${digipair}/schema.json`)) {
|
|
77
77
|
const text = await promises.readFile(`${path}/${digipair}/schema.json`, 'utf8');
|
|
78
|
-
|
|
78
|
+
schema = JSON.parse(text);
|
|
79
79
|
}
|
|
80
80
|
const files = await promises.readdir(`${path}/${digipair}`);
|
|
81
81
|
const actions = (await Promise.all(files.map((file)=>{
|
|
@@ -132,9 +132,9 @@ let CommonService = class CommonService {
|
|
|
132
132
|
version: '1.0.0',
|
|
133
133
|
'x-icon': '🤖'
|
|
134
134
|
}
|
|
135
|
-
},
|
|
136
|
-
paths: _extends({},
|
|
137
|
-
'x-scene-blocks': _extends({},
|
|
135
|
+
}, schema, {
|
|
136
|
+
paths: _extends({}, schema.paths, actions),
|
|
137
|
+
'x-scene-blocks': _extends({}, schema['x-scene-blocks'], triggers)
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
};
|