mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 20:12:51 +00:00
refactor: split api into api, api-cli & api-plugin
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@openstapps/api": "workspace:*",
|
||||
"@openstapps/api-plugin": "workspace:*",
|
||||
"@openstapps/core": "workspace:*",
|
||||
"@openstapps/core-tools": "workspace:*",
|
||||
"@openstapps/logger": "workspace:*",
|
||||
@@ -34,7 +35,7 @@
|
||||
"@types/express": "4.17.17",
|
||||
"@types/node": "18.15.3",
|
||||
"tsup": "6.7.0",
|
||||
"typescript": "4.8.4"
|
||||
"typescript": "4.9.5"
|
||||
},
|
||||
"tsup": {
|
||||
"entry": [
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {HttpClient, PluginClient} from '@openstapps/api';
|
||||
import {HttpClient} from '@openstapps/api';
|
||||
import {PluginClient} from '@openstapps/api-plugin';
|
||||
import {Converter} from '@openstapps/core-tools';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {Command, Option} from 'commander';
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Plugin} from '@openstapps/api';
|
||||
import {Plugin} from '@openstapps/api-plugin';
|
||||
import * as express from 'express';
|
||||
import {SCMinimalRequest} from './protocol/request.js';
|
||||
import {SCMinimalResponse} from './protocol/response.js';
|
||||
@@ -28,7 +28,6 @@ export class MinimalPlugin extends Plugin {
|
||||
* Calculates the sum of a list of numbers
|
||||
*
|
||||
* TODO: remove this function and write your own ones
|
||||
*
|
||||
* @param numbers the list of numbers
|
||||
*/
|
||||
private static sum(numbers: number[]): number {
|
||||
@@ -40,7 +39,6 @@ export class MinimalPlugin extends Plugin {
|
||||
*
|
||||
* For this example the whole purpose of the plugin is to receive a list of numbers and return the sum of them.
|
||||
* TODO: remove the body of the function and replace with your own logic
|
||||
*
|
||||
* @param request the express request object
|
||||
* @param response the express response object
|
||||
*/
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* All incoming requests will look like this, this is being checked by the backend. You need to add the @validatable tag
|
||||
* like shown below for the plugin to work. The request can have any layout you like.
|
||||
* TODO: remove body of the interface and replace with your own layout
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCMinimalRequest {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* All your responses to the backend are required to look like this. You need to add the @validatable tag like shown
|
||||
* below for the plugin to work. The response can have any layout you like.
|
||||
* TODO: remove body of the interface and replace with your own layout
|
||||
*
|
||||
* @validatable
|
||||
*/
|
||||
export interface SCMinimalResponse {
|
||||
|
||||
Reference in New Issue
Block a user