@vyr/service-rpc-universal 0.0.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/package.json +15 -0
- package/src/IMessage.ts +14 -0
- package/src/Message.ts +17 -0
- package/src/Operation.ts +113 -0
- package/src/Scheme.ts +20 -0
- package/src/UseRecord.ts +50 -0
- package/src/User.ts +21 -0
- package/src/VirtualNode.ts +107 -0
- package/src/asset/add.ts +35 -0
- package/src/asset/close.ts +35 -0
- package/src/asset/copy.ts +23 -0
- package/src/asset/create.ts +39 -0
- package/src/asset/cut.ts +23 -0
- package/src/asset/delete.ts +28 -0
- package/src/asset/dragdrap.ts +36 -0
- package/src/asset/index.ts +13 -0
- package/src/asset/initialize.ts +24 -0
- package/src/asset/open.ts +35 -0
- package/src/asset/remove.ts +29 -0
- package/src/asset/rename.ts +21 -0
- package/src/asset/select.ts +19 -0
- package/src/asset/update.ts +39 -0
- package/src/dep/add.ts +22 -0
- package/src/dep/create.ts +23 -0
- package/src/dep/delete.ts +23 -0
- package/src/dep/index.ts +5 -0
- package/src/dep/remove.ts +23 -0
- package/src/dep/update.ts +22 -0
- package/src/index.ts +14 -0
- package/src/rpc/confirm.ts +32 -0
- package/src/rpc/connection.ts +20 -0
- package/src/rpc/disconnect.ts +20 -0
- package/src/rpc/getUser.ts +37 -0
- package/src/rpc/index.ts +9 -0
- package/src/rpc/login.ts +35 -0
- package/src/rpc/logout.ts +20 -0
- package/src/rpc/redo.ts +18 -0
- package/src/rpc/undo.ts +18 -0
- package/src/scene/add.ts +35 -0
- package/src/scene/create.ts +28 -0
- package/src/scene/delete.ts +27 -0
- package/src/scene/download.ts +20 -0
- package/src/scene/dragdrap.ts +36 -0
- package/src/scene/index.ts +10 -0
- package/src/scene/initialize.ts +36 -0
- package/src/scene/record.ts +22 -0
- package/src/scene/remove.ts +28 -0
- package/src/scene/switch.ts +37 -0
- package/src/scene/update.ts +34 -0
- package/src/sidebar/index.ts +1 -0
- package/src/sidebar/switch.ts +35 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/asset.remove'
|
|
4
|
+
|
|
5
|
+
interface Params {
|
|
6
|
+
url: string
|
|
7
|
+
uuids: string[]
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class RequestMessage extends IMessage {
|
|
11
|
+
method = Method
|
|
12
|
+
params: Params
|
|
13
|
+
constructor(url: Params['url'], uuids: Params['uuids']) {
|
|
14
|
+
super()
|
|
15
|
+
this.params = { url, uuids }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
class NoticeMessage extends IMessage {
|
|
20
|
+
method = Method
|
|
21
|
+
params: Params
|
|
22
|
+
constructor(url: Params['url'], uuids: Params['uuids']) {
|
|
23
|
+
super()
|
|
24
|
+
this.params = { url, uuids }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export { Method, RequestMessage, NoticeMessage }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/asset.rename'
|
|
4
|
+
|
|
5
|
+
interface RequestParams {
|
|
6
|
+
url: string
|
|
7
|
+
newName: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class RequestMessage extends IMessage {
|
|
11
|
+
method = Method
|
|
12
|
+
params: RequestParams
|
|
13
|
+
|
|
14
|
+
constructor(newName: RequestParams['newName'], url: RequestParams['url'],) {
|
|
15
|
+
super()
|
|
16
|
+
this.params = { newName, url }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export { Method, RequestMessage }
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/asset.select'
|
|
4
|
+
|
|
5
|
+
interface RequestParams {
|
|
6
|
+
url: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class RequestMessage extends IMessage {
|
|
10
|
+
method = Method
|
|
11
|
+
params: RequestParams
|
|
12
|
+
|
|
13
|
+
constructor(url: RequestParams['url']) {
|
|
14
|
+
super()
|
|
15
|
+
this.params = { url }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { Method, RequestMessage }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Descriptor, DeserializationObject } from '@vyr/engine'
|
|
2
|
+
import { IMessage } from '../IMessage'
|
|
3
|
+
|
|
4
|
+
const Method = '/cli/asset.update'
|
|
5
|
+
|
|
6
|
+
interface RequestParams {
|
|
7
|
+
url: string
|
|
8
|
+
content: DeserializationObject<Descriptor>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class RequestMessage extends IMessage {
|
|
12
|
+
method = Method
|
|
13
|
+
params: RequestParams
|
|
14
|
+
|
|
15
|
+
constructor(url: RequestParams['url'], content: RequestParams['content']) {
|
|
16
|
+
super()
|
|
17
|
+
this.params = { url, content }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface NoticeParams {
|
|
22
|
+
url: string
|
|
23
|
+
scheme: string
|
|
24
|
+
client: string
|
|
25
|
+
content: DeserializationObject<Descriptor>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
class NoticeMessage extends IMessage {
|
|
29
|
+
method = Method
|
|
30
|
+
params: NoticeParams
|
|
31
|
+
|
|
32
|
+
constructor(url: NoticeParams['url'], scheme: NoticeParams['scheme'], client: NoticeParams['client'], content: NoticeParams['content']) {
|
|
33
|
+
super()
|
|
34
|
+
this.params = { url, scheme, client, content }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export { Method, RequestMessage, NoticeMessage }
|
package/src/dep/add.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/dep.add'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
interface NoticeParams {
|
|
7
|
+
origin: 'asset' | 'scene'
|
|
8
|
+
url: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class NoticeMessage extends IMessage {
|
|
12
|
+
method = Method
|
|
13
|
+
params: NoticeParams
|
|
14
|
+
|
|
15
|
+
constructor(origin: NoticeParams['origin'], url: NoticeParams['url']) {
|
|
16
|
+
super()
|
|
17
|
+
this.params = { origin, url }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export { Method, NoticeMessage }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/dep.create'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
interface NoticeParams {
|
|
7
|
+
origin: 'asset' | 'scene'
|
|
8
|
+
url: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class NoticeMessage extends IMessage {
|
|
12
|
+
method = Method
|
|
13
|
+
params: NoticeParams
|
|
14
|
+
|
|
15
|
+
constructor(origin: NoticeParams['origin'], url: NoticeParams['url']) {
|
|
16
|
+
super()
|
|
17
|
+
this.params = { origin, url }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export { Method, NoticeMessage }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/dep.delete'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
interface NoticeParams {
|
|
7
|
+
origin: 'asset' | 'scene'
|
|
8
|
+
url: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class NoticeMessage extends IMessage {
|
|
12
|
+
method = Method
|
|
13
|
+
params: NoticeParams
|
|
14
|
+
|
|
15
|
+
constructor(origin: NoticeParams['origin'], url: NoticeParams['url']) {
|
|
16
|
+
super()
|
|
17
|
+
this.params = { origin, url }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export { Method, NoticeMessage }
|
package/src/dep/index.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/dep.remove'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
interface NoticeParams {
|
|
7
|
+
origin: 'asset' | 'scene'
|
|
8
|
+
url: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class NoticeMessage extends IMessage {
|
|
12
|
+
method = Method
|
|
13
|
+
params: NoticeParams
|
|
14
|
+
|
|
15
|
+
constructor(origin: NoticeParams['origin'], url: NoticeParams['url']) {
|
|
16
|
+
super()
|
|
17
|
+
this.params = { origin, url }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export { Method, NoticeMessage }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/dep.update'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
interface NoticeParams {
|
|
7
|
+
origin: 'asset' | 'scene'
|
|
8
|
+
url: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class NoticeMessage extends IMessage {
|
|
12
|
+
method = Method
|
|
13
|
+
params: NoticeParams
|
|
14
|
+
|
|
15
|
+
constructor(origin: NoticeParams['origin'], url: NoticeParams['url']) {
|
|
16
|
+
super()
|
|
17
|
+
this.params = { origin, url }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export { Method, NoticeMessage }
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './Scheme'
|
|
2
|
+
export * from './Operation'
|
|
3
|
+
export * from './Message'
|
|
4
|
+
export * from './VirtualNode'
|
|
5
|
+
export * from './VirtualNode'
|
|
6
|
+
export * from './UseRecord'
|
|
7
|
+
export * from './User'
|
|
8
|
+
export * from './rpc/confirm'
|
|
9
|
+
|
|
10
|
+
const path = '/rpc.io'
|
|
11
|
+
const topic = '/service'
|
|
12
|
+
const tokenKey = '@vyr/key'
|
|
13
|
+
|
|
14
|
+
export { path, topic, tokenKey }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Generate } from '@vyr/engine'
|
|
2
|
+
import { IMessage } from '../IMessage'
|
|
3
|
+
|
|
4
|
+
const Method = '/cli/rpc.confirm'
|
|
5
|
+
|
|
6
|
+
interface Confirm {
|
|
7
|
+
type?: string
|
|
8
|
+
title?: string
|
|
9
|
+
message?: string
|
|
10
|
+
value: any
|
|
11
|
+
options: { label?: string, value?: string }[]
|
|
12
|
+
mode?: string
|
|
13
|
+
success: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface NoticeParams {
|
|
17
|
+
config: Confirm
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class NoticeMessage extends IMessage {
|
|
21
|
+
method = Method
|
|
22
|
+
uuid = Generate.uuid()
|
|
23
|
+
params: NoticeParams
|
|
24
|
+
|
|
25
|
+
constructor(config: NoticeParams['config']) {
|
|
26
|
+
super()
|
|
27
|
+
this.params = { config }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export { Method, Confirm, NoticeMessage }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/rpc.connection'
|
|
4
|
+
|
|
5
|
+
interface NoticeParams {
|
|
6
|
+
client: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class NoticeMessage extends IMessage {
|
|
10
|
+
method = Method
|
|
11
|
+
params: NoticeParams
|
|
12
|
+
|
|
13
|
+
constructor(client: NoticeParams['client']) {
|
|
14
|
+
super()
|
|
15
|
+
this.params = { client }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export { Method, NoticeMessage }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/rpc.disconnect'
|
|
4
|
+
|
|
5
|
+
interface NoticeParams {
|
|
6
|
+
client: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class NoticeMessage extends IMessage {
|
|
10
|
+
method = Method
|
|
11
|
+
params: NoticeParams
|
|
12
|
+
|
|
13
|
+
constructor(client: NoticeParams['client']) {
|
|
14
|
+
super()
|
|
15
|
+
this.params = { client }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export { Method, NoticeMessage }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DeserializationObject } from '@vyr/engine'
|
|
2
|
+
import { IMessage } from '../IMessage'
|
|
3
|
+
import { User } from '../User'
|
|
4
|
+
|
|
5
|
+
const Method = '/cli/rpc.getUser'
|
|
6
|
+
|
|
7
|
+
interface RequestParams {
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class RequestMessage extends IMessage {
|
|
12
|
+
method = Method
|
|
13
|
+
params: RequestParams
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super()
|
|
17
|
+
this.params = {}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
interface NoticeParams {
|
|
23
|
+
user: DeserializationObject<User> | null
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class NoticeMessage extends IMessage {
|
|
27
|
+
method = Method
|
|
28
|
+
params: NoticeParams
|
|
29
|
+
|
|
30
|
+
constructor(user: NoticeParams['user']) {
|
|
31
|
+
super()
|
|
32
|
+
this.params = { user }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export { Method, RequestMessage, NoticeMessage }
|
package/src/rpc/index.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * as logout from './logout'
|
|
2
|
+
export * as login from './login'
|
|
3
|
+
export * as getUser from './getUser'
|
|
4
|
+
|
|
5
|
+
export * as connection from './connection'
|
|
6
|
+
export * as disconnect from './disconnect'
|
|
7
|
+
export * as undo from './undo'
|
|
8
|
+
export * as redo from './redo'
|
|
9
|
+
export * as confirm from './confirm'
|
package/src/rpc/login.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/rpc.login'
|
|
4
|
+
|
|
5
|
+
interface RequestParams {
|
|
6
|
+
name: string
|
|
7
|
+
password: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class RequestMessage extends IMessage {
|
|
11
|
+
method = Method
|
|
12
|
+
params: RequestParams
|
|
13
|
+
|
|
14
|
+
constructor(name: RequestParams['name'], password: RequestParams['password']) {
|
|
15
|
+
super()
|
|
16
|
+
this.params = { name, password }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface NoticeParams {
|
|
21
|
+
token: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
class NoticeMessage extends IMessage {
|
|
25
|
+
method = Method
|
|
26
|
+
params: NoticeParams
|
|
27
|
+
|
|
28
|
+
constructor(token: NoticeParams['token']) {
|
|
29
|
+
super()
|
|
30
|
+
this.params = { token }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export { Method, RequestMessage, NoticeMessage }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/rpc.logout'
|
|
4
|
+
|
|
5
|
+
interface Params {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class NoticeMessage extends IMessage {
|
|
10
|
+
method = Method
|
|
11
|
+
params: Params
|
|
12
|
+
|
|
13
|
+
constructor(params: Params) {
|
|
14
|
+
super()
|
|
15
|
+
this.params = params
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export { Method, NoticeMessage }
|
package/src/rpc/redo.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/rpc.redo'
|
|
4
|
+
|
|
5
|
+
interface NoticeParams { }
|
|
6
|
+
|
|
7
|
+
class RequestMessage extends IMessage {
|
|
8
|
+
method = Method
|
|
9
|
+
params: NoticeParams
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
super()
|
|
13
|
+
this.params = {}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export { Method, RequestMessage }
|
package/src/rpc/undo.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/rpc.undo'
|
|
4
|
+
|
|
5
|
+
interface NoticeParams { }
|
|
6
|
+
|
|
7
|
+
class RequestMessage extends IMessage {
|
|
8
|
+
method = Method
|
|
9
|
+
params: NoticeParams
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
super()
|
|
13
|
+
this.params = {}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export { Method, RequestMessage }
|
package/src/scene/add.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Descriptor, DeserializationObject } from '@vyr/engine'
|
|
2
|
+
import { IMessage } from '../IMessage'
|
|
3
|
+
|
|
4
|
+
const Method = '/cli/scene.add'
|
|
5
|
+
|
|
6
|
+
interface Params {
|
|
7
|
+
parent: string
|
|
8
|
+
node: DeserializationObject<Descriptor>[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class RequestMessage extends IMessage {
|
|
12
|
+
method = Method
|
|
13
|
+
params: Params
|
|
14
|
+
constructor(node: Params['node'], parent: Params['parent']) {
|
|
15
|
+
super()
|
|
16
|
+
this.params = { node, parent }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface NoticeParams extends Params {
|
|
21
|
+
/**将新增节点插入到此节点之前 */
|
|
22
|
+
next: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
class NoticeMessage extends IMessage {
|
|
26
|
+
method = Method
|
|
27
|
+
params: NoticeParams
|
|
28
|
+
constructor(node: NoticeParams['node'], parent: NoticeParams['parent'], next: NoticeParams['next'] = '') {
|
|
29
|
+
super()
|
|
30
|
+
this.params = { node, parent, next }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export { Method, RequestMessage, NoticeMessage }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/scene.create'
|
|
4
|
+
|
|
5
|
+
interface Params {
|
|
6
|
+
url: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class RequestMessage extends IMessage {
|
|
10
|
+
method = Method
|
|
11
|
+
params: Params
|
|
12
|
+
constructor(url: Params['url']) {
|
|
13
|
+
super()
|
|
14
|
+
this.params = { url }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class NoticeMessage extends IMessage {
|
|
19
|
+
method = Method
|
|
20
|
+
params: Params
|
|
21
|
+
constructor(url: Params['url']) {
|
|
22
|
+
super()
|
|
23
|
+
this.params = { url }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export { Method, RequestMessage, NoticeMessage }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/scene.delete'
|
|
4
|
+
|
|
5
|
+
interface Params {
|
|
6
|
+
url: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class RequestMessage extends IMessage {
|
|
10
|
+
method = Method
|
|
11
|
+
params: Params
|
|
12
|
+
constructor(url: Params['url']) {
|
|
13
|
+
super()
|
|
14
|
+
this.params = { url }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class NoticeMessage extends IMessage {
|
|
19
|
+
method = Method
|
|
20
|
+
params: Params
|
|
21
|
+
constructor(url: Params['url']) {
|
|
22
|
+
super()
|
|
23
|
+
this.params = { url }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { Method, RequestMessage, NoticeMessage }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IMessage } from '../IMessage'
|
|
2
|
+
|
|
3
|
+
const Method = '/cli/scene.downalod'
|
|
4
|
+
|
|
5
|
+
interface Params {
|
|
6
|
+
url?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class RequestMessage extends IMessage {
|
|
10
|
+
method = Method
|
|
11
|
+
params: Params
|
|
12
|
+
|
|
13
|
+
constructor(url: Params['url']) {
|
|
14
|
+
super()
|
|
15
|
+
this.params = { url }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export { Method, RequestMessage }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DraggableEndType, DraggableData } from '@vyr/declare'
|
|
2
|
+
import { IMessage } from '../IMessage'
|
|
3
|
+
|
|
4
|
+
const Method = '/cli/scene.dragdrap'
|
|
5
|
+
|
|
6
|
+
interface Params {
|
|
7
|
+
type: DraggableEndType,
|
|
8
|
+
dragData: DraggableData<{ uuids: string[] }>,
|
|
9
|
+
targetData: DraggableData<{ uuid: string }>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class RequestMessage extends IMessage {
|
|
13
|
+
method = Method
|
|
14
|
+
params: Params
|
|
15
|
+
constructor(type: Params['type'], dragData: Params['dragData'], targetData: Params['targetData']) {
|
|
16
|
+
super()
|
|
17
|
+
this.params = { type, dragData, targetData }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface NoticeParams extends Params {
|
|
22
|
+
/**将新增节点插入到此节点之前 */
|
|
23
|
+
next: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class NoticeMessage extends IMessage {
|
|
27
|
+
method = Method
|
|
28
|
+
params: NoticeParams
|
|
29
|
+
constructor(type: NoticeParams['type'], dragData: NoticeParams['dragData'], targetData: NoticeParams['targetData'], next: NoticeParams['next'] = '') {
|
|
30
|
+
super()
|
|
31
|
+
this.params = { type, dragData, targetData, next }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export { Method, RequestMessage, NoticeMessage }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * as initialize from './initialize'
|
|
2
|
+
export * as record from './record'
|
|
3
|
+
export * as add from './add'
|
|
4
|
+
export * as remove from './remove'
|
|
5
|
+
export * as switch from './switch'
|
|
6
|
+
export * as create from './create'
|
|
7
|
+
export * as delete from './delete'
|
|
8
|
+
export * as update from './update'
|
|
9
|
+
export * as dragdrap from './dragdrap'
|
|
10
|
+
export * as download from './download'
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Descriptor, DeserializationObject } from '@vyr/engine'
|
|
2
|
+
import { IMessage } from '../IMessage'
|
|
3
|
+
|
|
4
|
+
const Method = '/cli/scene.initialize'
|
|
5
|
+
|
|
6
|
+
interface RequestParams {
|
|
7
|
+
url: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class RequestMessage extends IMessage {
|
|
11
|
+
method = Method
|
|
12
|
+
params: RequestParams
|
|
13
|
+
|
|
14
|
+
constructor(url: NoticeParams['url']) {
|
|
15
|
+
super()
|
|
16
|
+
this.params = { url }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface NoticeParams {
|
|
21
|
+
url: string
|
|
22
|
+
scenes: string[]
|
|
23
|
+
serialization: DeserializationObject<Descriptor>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class NoticeMessage extends IMessage {
|
|
27
|
+
method = Method
|
|
28
|
+
params: NoticeParams
|
|
29
|
+
|
|
30
|
+
constructor(url: NoticeParams['url'], serialization: NoticeParams['serialization'], scenes: NoticeParams['scenes']) {
|
|
31
|
+
super()
|
|
32
|
+
this.params = { url, serialization, scenes }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { Method, RequestMessage, NoticeMessage }
|