@digipair/skill-common 0.76.0 → 0.78.0
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 +17 -1
- package/index.esm.js +17 -2
- package/libs/skill-common/src/lib/skill-common.d.ts +4 -0
- package/package.json +1 -1
- package/schema.fr.json +18 -0
- package/schema.json +18 -0
package/index.cjs.js
CHANGED
|
@@ -16,6 +16,18 @@ function _extends() {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
let CommonService = class CommonService {
|
|
19
|
+
async infos(params, _pinsSettingsList, context) {
|
|
20
|
+
var _context_privates;
|
|
21
|
+
var _context_privates_EDITOR_PATH;
|
|
22
|
+
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';
|
|
23
|
+
const { digipair } = params;
|
|
24
|
+
const content = await fs.promises.readFile(`${path}/${digipair}/config.json`, 'utf8');
|
|
25
|
+
const config = JSON.parse(content);
|
|
26
|
+
return {
|
|
27
|
+
name: config.name,
|
|
28
|
+
description: config.description
|
|
29
|
+
};
|
|
30
|
+
}
|
|
19
31
|
async metadata(params, _pinsSettingsList, context) {
|
|
20
32
|
var _context_privates;
|
|
21
33
|
var _context_privates_EDITOR_PATH;
|
|
@@ -79,7 +91,9 @@ let CommonService = class CommonService {
|
|
|
79
91
|
key: `/action-${name}`,
|
|
80
92
|
value: {
|
|
81
93
|
post: {
|
|
82
|
-
tags: (_metadata_tags = metadata.tags) != null ? _metadata_tags : [
|
|
94
|
+
tags: (_metadata_tags = metadata.tags) != null ? _metadata_tags : [
|
|
95
|
+
'service'
|
|
96
|
+
],
|
|
83
97
|
summary,
|
|
84
98
|
description,
|
|
85
99
|
parameters: (_metadata_parameters = metadata.parameters) != null ? _metadata_parameters : [],
|
|
@@ -117,10 +131,12 @@ let CommonService = class CommonService {
|
|
|
117
131
|
});
|
|
118
132
|
}
|
|
119
133
|
};
|
|
134
|
+
const infos = (params, pinsSettingsList, context)=>new CommonService().infos(params, pinsSettingsList, context);
|
|
120
135
|
const metadata = (params, pinsSettingsList, context)=>new CommonService().metadata(params, pinsSettingsList, context);
|
|
121
136
|
const boosts = (params, pinsSettingsList, context)=>new CommonService().boosts(params, pinsSettingsList, context);
|
|
122
137
|
const schema = (params, pinsSettingsList, context)=>new CommonService().schema(params, pinsSettingsList, context);
|
|
123
138
|
|
|
124
139
|
exports.boosts = boosts;
|
|
140
|
+
exports.infos = infos;
|
|
125
141
|
exports.metadata = metadata;
|
|
126
142
|
exports.schema = schema;
|
package/index.esm.js
CHANGED
|
@@ -12,6 +12,18 @@ function _extends() {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
let CommonService = class CommonService {
|
|
15
|
+
async infos(params, _pinsSettingsList, context) {
|
|
16
|
+
var _context_privates;
|
|
17
|
+
var _context_privates_EDITOR_PATH;
|
|
18
|
+
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';
|
|
19
|
+
const { digipair } = params;
|
|
20
|
+
const content = await promises.readFile(`${path}/${digipair}/config.json`, 'utf8');
|
|
21
|
+
const config = JSON.parse(content);
|
|
22
|
+
return {
|
|
23
|
+
name: config.name,
|
|
24
|
+
description: config.description
|
|
25
|
+
};
|
|
26
|
+
}
|
|
15
27
|
async metadata(params, _pinsSettingsList, context) {
|
|
16
28
|
var _context_privates;
|
|
17
29
|
var _context_privates_EDITOR_PATH;
|
|
@@ -75,7 +87,9 @@ let CommonService = class CommonService {
|
|
|
75
87
|
key: `/action-${name}`,
|
|
76
88
|
value: {
|
|
77
89
|
post: {
|
|
78
|
-
tags: (_metadata_tags = metadata.tags) != null ? _metadata_tags : [
|
|
90
|
+
tags: (_metadata_tags = metadata.tags) != null ? _metadata_tags : [
|
|
91
|
+
'service'
|
|
92
|
+
],
|
|
79
93
|
summary,
|
|
80
94
|
description,
|
|
81
95
|
parameters: (_metadata_parameters = metadata.parameters) != null ? _metadata_parameters : [],
|
|
@@ -113,8 +127,9 @@ let CommonService = class CommonService {
|
|
|
113
127
|
});
|
|
114
128
|
}
|
|
115
129
|
};
|
|
130
|
+
const infos = (params, pinsSettingsList, context)=>new CommonService().infos(params, pinsSettingsList, context);
|
|
116
131
|
const metadata = (params, pinsSettingsList, context)=>new CommonService().metadata(params, pinsSettingsList, context);
|
|
117
132
|
const boosts = (params, pinsSettingsList, context)=>new CommonService().boosts(params, pinsSettingsList, context);
|
|
118
133
|
const schema = (params, pinsSettingsList, context)=>new CommonService().schema(params, pinsSettingsList, context);
|
|
119
134
|
|
|
120
|
-
export { boosts, metadata, schema };
|
|
135
|
+
export { boosts, infos, metadata, schema };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { PinsSettings } from '@digipair/engine';
|
|
2
|
+
export declare const infos: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<{
|
|
3
|
+
name: any;
|
|
4
|
+
description: any;
|
|
5
|
+
}>;
|
|
2
6
|
export declare const metadata: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
3
7
|
export declare const boosts: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<{
|
|
4
8
|
reasoning: string;
|
package/package.json
CHANGED
package/schema.fr.json
CHANGED
|
@@ -8,6 +8,24 @@
|
|
|
8
8
|
"x-icon": "🚀"
|
|
9
9
|
},
|
|
10
10
|
"paths": {
|
|
11
|
+
"/infos": {
|
|
12
|
+
"post": {
|
|
13
|
+
"tags": ["service"],
|
|
14
|
+
"summary": "Lister les informations",
|
|
15
|
+
"parameters": [
|
|
16
|
+
{
|
|
17
|
+
"name": "digipair",
|
|
18
|
+
"summary": "Digipair",
|
|
19
|
+
"description": "Nom du digipair",
|
|
20
|
+
"required": true,
|
|
21
|
+
"schema": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"x-events": []
|
|
27
|
+
}
|
|
28
|
+
},
|
|
11
29
|
"/metadata": {
|
|
12
30
|
"post": {
|
|
13
31
|
"tags": ["service"],
|
package/schema.json
CHANGED
|
@@ -8,6 +8,24 @@
|
|
|
8
8
|
"x-icon": "🚀"
|
|
9
9
|
},
|
|
10
10
|
"paths": {
|
|
11
|
+
"/infos": {
|
|
12
|
+
"post": {
|
|
13
|
+
"tags": ["service"],
|
|
14
|
+
"summary": "List the informations",
|
|
15
|
+
"parameters": [
|
|
16
|
+
{
|
|
17
|
+
"name": "digipair",
|
|
18
|
+
"summary": "Digipair",
|
|
19
|
+
"description": "Digipair's name",
|
|
20
|
+
"required": true,
|
|
21
|
+
"schema": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"x-events": []
|
|
27
|
+
}
|
|
28
|
+
},
|
|
11
29
|
"/metadata": {
|
|
12
30
|
"post": {
|
|
13
31
|
"tags": ["service"],
|