@chijs/client
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -22,2 +22,11 @@ import type { Socket } from 'socket.io-client'; | ||
"$s:service:get"(id: string): import("@chijs/core").IServiceInfo; | ||
"$s:action:dispatch"(serviceId: string, actionId: string, params: Record<string, unknown>): string; | ||
"$s:action:run"(taskId: string, parent: string, serviceId: string, actionId: string, params: Record<string, unknown>): unknown; | ||
"$s:action:get"(serviceId: string, actionId: string): import("@chijs/core").IActionInfoWithService; | ||
"$s:action:list"(): import("@chijs/core").IActionInfoWithService[]; | ||
"$s:action:listByService"(serviceId: string): import("@chijs/core").IActionInfoWithService[]; | ||
"$s:action:getTask"(id: string): import("@chijs/core").ITaskInfo; | ||
"$s:action:listTask"(): import("@chijs/core").ITaskInfo[]; | ||
"$s:action:listTaskByService"(serviceId: string): import("@chijs/core").ITaskInfo[]; | ||
"$s:action:listTaskByAction"(serviceId: string, actionId: string): import("@chijs/core").ITaskInfo[]; | ||
}, "$s:service:">>; | ||
@@ -38,3 +47,36 @@ plugin: import("@chijs/core").MapAsync<import("@chijs/core").Unprefix<{ | ||
"$s:service:get"(id: string): import("@chijs/core").IServiceInfo; | ||
"$s:action:dispatch"(serviceId: string, actionId: string, params: Record<string, unknown>): string; | ||
"$s:action:run"(taskId: string, parent: string, serviceId: string, actionId: string, params: Record<string, unknown>): unknown; | ||
"$s:action:get"(serviceId: string, actionId: string): import("@chijs/core").IActionInfoWithService; | ||
"$s:action:list"(): import("@chijs/core").IActionInfoWithService[]; | ||
"$s:action:listByService"(serviceId: string): import("@chijs/core").IActionInfoWithService[]; | ||
"$s:action:getTask"(id: string): import("@chijs/core").ITaskInfo; | ||
"$s:action:listTask"(): import("@chijs/core").ITaskInfo[]; | ||
"$s:action:listTaskByService"(serviceId: string): import("@chijs/core").ITaskInfo[]; | ||
"$s:action:listTaskByAction"(serviceId: string, actionId: string): import("@chijs/core").ITaskInfo[]; | ||
}, "$s:plugin:">>; | ||
action: import("@chijs/core").MapAsync<import("@chijs/core").Unprefix<{ | ||
"$s:misc:versions"(): Record<string, string>; | ||
"$s:misc:startTime"(): number; | ||
"$s:plugin:load"(id: string): [ok: boolean, reason?: string | undefined]; | ||
"$s:plugin:unload"(id: string): void; | ||
"$s:plugin:list"(): import("@chijs/core").IPluginInfo[]; | ||
"$s:plugin:get"(id: string): import("@chijs/core").IPluginInfo; | ||
"$s:service:add"(defn: import("@chijs/core").IServiceDefn): void; | ||
"$s:service:update"(id: string, attr: Partial<import("@chijs/core").IServiceAttr>): void; | ||
"$s:service:remove"(id: string): void; | ||
"$s:service:start"(id: string): void; | ||
"$s:service:stop"(id: string): void; | ||
"$s:service:list"(): import("@chijs/core").IServiceInfo[]; | ||
"$s:service:get"(id: string): import("@chijs/core").IServiceInfo; | ||
"$s:action:dispatch"(serviceId: string, actionId: string, params: Record<string, unknown>): string; | ||
"$s:action:run"(taskId: string, parent: string, serviceId: string, actionId: string, params: Record<string, unknown>): unknown; | ||
"$s:action:get"(serviceId: string, actionId: string): import("@chijs/core").IActionInfoWithService; | ||
"$s:action:list"(): import("@chijs/core").IActionInfoWithService[]; | ||
"$s:action:listByService"(serviceId: string): import("@chijs/core").IActionInfoWithService[]; | ||
"$s:action:getTask"(id: string): import("@chijs/core").ITaskInfo; | ||
"$s:action:listTask"(): import("@chijs/core").ITaskInfo[]; | ||
"$s:action:listTaskByService"(serviceId: string): import("@chijs/core").ITaskInfo[]; | ||
"$s:action:listTaskByAction"(serviceId: string, actionId: string): import("@chijs/core").ITaskInfo[]; | ||
}, "$s:action:">>; | ||
misc: import("@chijs/core").MapAsync<import("@chijs/core").Unprefix<{ | ||
@@ -54,2 +96,11 @@ "$s:misc:versions"(): Record<string, string>; | ||
"$s:service:get"(id: string): import("@chijs/core").IServiceInfo; | ||
"$s:action:dispatch"(serviceId: string, actionId: string, params: Record<string, unknown>): string; | ||
"$s:action:run"(taskId: string, parent: string, serviceId: string, actionId: string, params: Record<string, unknown>): unknown; | ||
"$s:action:get"(serviceId: string, actionId: string): import("@chijs/core").IActionInfoWithService; | ||
"$s:action:list"(): import("@chijs/core").IActionInfoWithService[]; | ||
"$s:action:listByService"(serviceId: string): import("@chijs/core").IActionInfoWithService[]; | ||
"$s:action:getTask"(id: string): import("@chijs/core").ITaskInfo; | ||
"$s:action:listTask"(): import("@chijs/core").ITaskInfo[]; | ||
"$s:action:listTaskByService"(serviceId: string): import("@chijs/core").ITaskInfo[]; | ||
"$s:action:listTaskByAction"(serviceId: string, actionId: string): import("@chijs/core").ITaskInfo[]; | ||
}, "$s:misc:">>; | ||
@@ -56,0 +107,0 @@ constructor(socket: Socket); |
@@ -1,2 +0,2 @@ | ||
import { RpcEndpoint, createRpcWrapper, RpcId } from '@chijs/core'; | ||
import { RpcEndpoint, createRpcWrapper, RPC } from '@chijs/core'; | ||
export class ChiClient { | ||
@@ -8,11 +8,13 @@ socket; | ||
plugin; | ||
action; | ||
misc; | ||
constructor(socket) { | ||
this.socket = socket; | ||
this.endpoint = new RpcEndpoint(RpcId.client(socket.id), (msg) => socket.emit('rpc', msg)); | ||
this.endpoint = new RpcEndpoint(RPC.client(socket.id), (msg) => socket.emit('rpc', msg)); | ||
this.socket.on('rpc', (msg) => this.endpoint.recv(msg)); | ||
this.server = this.endpoint.getHandle(RpcId.server()); | ||
this.server = this.endpoint.getHandle(RPC.server()); | ||
this.service = createRpcWrapper(this.server, '$s:service:'); | ||
this.plugin = createRpcWrapper(this.server, '$s:plugin:'); | ||
this.misc = createRpcWrapper(this.server, '$s:misc:'); | ||
this.action = createRpcWrapper(this.server, '$s:action:'); | ||
} | ||
@@ -19,0 +21,0 @@ } |
{ | ||
"name": "@chijs/client", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"main": "lib/index.js", | ||
@@ -19,3 +19,3 @@ "license": "AGPL-3.0", | ||
"dependencies": { | ||
"@chijs/core": "^0.0.7", | ||
"@chijs/core": "^0.0.8", | ||
"socket.io-client": "^4.5.1" | ||
@@ -22,0 +22,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10317
129
Updated@chijs/core@^0.0.8