@digipair/skill-common 0.78.0 → 0.78.1
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 +13 -2
- package/index.esm.js +13 -2
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -73,7 +73,9 @@ 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 content
|
|
76
|
+
let content;
|
|
77
|
+
content = await fs.promises.readFile(`${path}/${digipair}/config.json`, 'utf8');
|
|
78
|
+
const config = JSON.parse(content);
|
|
77
79
|
// check if schema.json exists
|
|
78
80
|
if (fs.existsSync(`${path}/${digipair}/schema.json`)) {
|
|
79
81
|
const text = await fs.promises.readFile(`${path}/${digipair}/schema.json`, 'utf8');
|
|
@@ -125,7 +127,16 @@ let CommonService = class CommonService {
|
|
|
125
127
|
acc[item.key] = item.value;
|
|
126
128
|
return acc;
|
|
127
129
|
}, {});
|
|
128
|
-
return _extends({
|
|
130
|
+
return _extends({
|
|
131
|
+
openapi: '3.0.0',
|
|
132
|
+
infos: {
|
|
133
|
+
title: 'digipair:' + digipair,
|
|
134
|
+
summary: config.name,
|
|
135
|
+
description: config.description,
|
|
136
|
+
version: '1.0.0',
|
|
137
|
+
'x-icon': '🤖'
|
|
138
|
+
}
|
|
139
|
+
}, content, {
|
|
129
140
|
paths: _extends({}, content.paths, actions),
|
|
130
141
|
'x-scene-blocks': _extends({}, content['x-scene-blocks'], triggers)
|
|
131
142
|
});
|
package/index.esm.js
CHANGED
|
@@ -69,7 +69,9 @@ 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 content
|
|
72
|
+
let content;
|
|
73
|
+
content = await promises.readFile(`${path}/${digipair}/config.json`, 'utf8');
|
|
74
|
+
const config = JSON.parse(content);
|
|
73
75
|
// check if schema.json exists
|
|
74
76
|
if (existsSync(`${path}/${digipair}/schema.json`)) {
|
|
75
77
|
const text = await promises.readFile(`${path}/${digipair}/schema.json`, 'utf8');
|
|
@@ -121,7 +123,16 @@ let CommonService = class CommonService {
|
|
|
121
123
|
acc[item.key] = item.value;
|
|
122
124
|
return acc;
|
|
123
125
|
}, {});
|
|
124
|
-
return _extends({
|
|
126
|
+
return _extends({
|
|
127
|
+
openapi: '3.0.0',
|
|
128
|
+
infos: {
|
|
129
|
+
title: 'digipair:' + digipair,
|
|
130
|
+
summary: config.name,
|
|
131
|
+
description: config.description,
|
|
132
|
+
version: '1.0.0',
|
|
133
|
+
'x-icon': '🤖'
|
|
134
|
+
}
|
|
135
|
+
}, content, {
|
|
125
136
|
paths: _extends({}, content.paths, actions),
|
|
126
137
|
'x-scene-blocks': _extends({}, content['x-scene-blocks'], triggers)
|
|
127
138
|
});
|