@unibridge/sdk 0.5.0 → 0.9.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/LICENSE +21 -0
- package/README.md +67 -0
- package/dist/client.d.ts +6 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +59 -0
- package/dist/client.js.map +1 -0
- package/dist/commands/component/contract.d.ts +174 -0
- package/dist/commands/component/contract.d.ts.map +1 -0
- package/dist/commands/component/contract.js +142 -0
- package/dist/commands/component/contract.js.map +1 -0
- package/dist/commands/contracts.d.ts +9 -0
- package/dist/commands/contracts.d.ts.map +1 -0
- package/dist/commands/contracts.js +2 -0
- package/dist/commands/contracts.js.map +1 -0
- package/dist/commands/define.d.ts +19 -0
- package/dist/commands/define.d.ts.map +1 -0
- package/dist/commands/define.js +20 -0
- package/dist/commands/define.js.map +1 -0
- package/dist/commands/domain/contract.d.ts +10 -0
- package/dist/commands/domain/contract.d.ts.map +1 -0
- package/dist/commands/domain/contract.js +12 -0
- package/dist/commands/domain/contract.js.map +1 -0
- package/dist/commands/execute/contract.d.ts +4 -0
- package/dist/commands/execute/contract.d.ts.map +1 -0
- package/dist/commands/execute/contract.js +10 -0
- package/dist/commands/execute/contract.js.map +1 -0
- package/dist/commands/gameobject/contract.d.ts +320 -0
- package/dist/commands/gameobject/contract.d.ts.map +1 -0
- package/dist/commands/gameobject/contract.js +154 -0
- package/dist/commands/gameobject/contract.js.map +1 -0
- package/dist/commands/log/contract.d.ts +46 -0
- package/dist/commands/log/contract.d.ts.map +1 -0
- package/dist/commands/log/contract.js +31 -0
- package/dist/commands/log/contract.js.map +1 -0
- package/dist/commands/registry.d.ts +303 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands/registry.js +10 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/commands/runtime.d.ts +7 -0
- package/dist/commands/runtime.d.ts.map +1 -0
- package/dist/commands/runtime.js +2 -0
- package/dist/commands/runtime.js.map +1 -0
- package/dist/commands/scene/contract.d.ts +127 -0
- package/dist/commands/scene/contract.d.ts.map +1 -0
- package/dist/commands/scene/contract.js +79 -0
- package/dist/commands/scene/contract.js.map +1 -0
- package/dist/commands/status/contract.d.ts +18 -0
- package/dist/commands/status/contract.d.ts.map +1 -0
- package/dist/commands/status/contract.js +16 -0
- package/dist/commands/status/contract.js.map +1 -0
- package/dist/commands/test/contract.d.ts +111 -0
- package/dist/commands/test/contract.d.ts.map +1 -0
- package/dist/commands/test/contract.js +71 -0
- package/dist/commands/test/contract.js.map +1 -0
- package/dist/connection.d.ts +37 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +311 -0
- package/dist/connection.js.map +1 -0
- package/dist/hash.d.ts +4 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +41 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/project.d.ts +6 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +71 -0
- package/dist/project.js.map +1 -0
- package/dist/types.d.ts +55 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +31 -5
- package/src/client.ts +0 -76
- package/src/commands/contracts.ts +0 -4
- package/src/commands/define.ts +0 -56
- package/src/commands/domain/contract.ts +0 -15
- package/src/commands/execute/contract.ts +0 -12
- package/src/commands/registry.ts +0 -6
- package/src/commands/runtime.ts +0 -7
- package/src/commands/scene/contract.ts +0 -46
- package/src/commands/status/contract.ts +0 -19
- package/src/connection.test.ts +0 -330
- package/src/connection.ts +0 -382
- package/src/hash.test.ts +0 -48
- package/src/hash.ts +0 -50
- package/src/index.ts +0 -10
- package/src/project.test.ts +0 -93
- package/src/project.ts +0 -99
- package/src/types.ts +0 -64
- package/tsconfig.json +0 -16
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { type InferResult } from '../define.ts';
|
|
3
|
+
declare const GameObjectDimensionSchema: v.PicklistSchema<["2d", "3d"], undefined>;
|
|
4
|
+
declare const PrimitiveSchema: v.PicklistSchema<["cube", "sphere", "capsule", "cylinder", "plane", "quad"], undefined>;
|
|
5
|
+
declare const TransformSpaceSchema: v.PicklistSchema<["local", "world"], undefined>;
|
|
6
|
+
declare const Vector3Schema: v.ObjectSchema<{
|
|
7
|
+
readonly x: v.NumberSchema<undefined>;
|
|
8
|
+
readonly y: v.NumberSchema<undefined>;
|
|
9
|
+
readonly z: v.NumberSchema<undefined>;
|
|
10
|
+
}, undefined>;
|
|
11
|
+
declare const CreateTransformSchema: v.ObjectSchema<{
|
|
12
|
+
readonly space: v.OptionalSchema<v.PicklistSchema<["local", "world"], undefined>, undefined>;
|
|
13
|
+
readonly position: v.OptionalSchema<v.ObjectSchema<{
|
|
14
|
+
readonly x: v.NumberSchema<undefined>;
|
|
15
|
+
readonly y: v.NumberSchema<undefined>;
|
|
16
|
+
readonly z: v.NumberSchema<undefined>;
|
|
17
|
+
}, undefined>, undefined>;
|
|
18
|
+
readonly rotation: v.OptionalSchema<v.ObjectSchema<{
|
|
19
|
+
readonly x: v.NumberSchema<undefined>;
|
|
20
|
+
readonly y: v.NumberSchema<undefined>;
|
|
21
|
+
readonly z: v.NumberSchema<undefined>;
|
|
22
|
+
}, undefined>, undefined>;
|
|
23
|
+
readonly scale: v.OptionalSchema<v.ObjectSchema<{
|
|
24
|
+
readonly x: v.NumberSchema<undefined>;
|
|
25
|
+
readonly y: v.NumberSchema<undefined>;
|
|
26
|
+
readonly z: v.NumberSchema<undefined>;
|
|
27
|
+
}, undefined>, undefined>;
|
|
28
|
+
}, undefined>;
|
|
29
|
+
export declare const GameObjectCreateInputSchema: v.ObjectSchema<{
|
|
30
|
+
readonly name: v.StringSchema<undefined>;
|
|
31
|
+
readonly parent: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
32
|
+
readonly parentInstanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
33
|
+
readonly dimension: v.OptionalSchema<v.PicklistSchema<["2d", "3d"], undefined>, undefined>;
|
|
34
|
+
readonly primitive: v.OptionalSchema<v.PicklistSchema<["cube", "sphere", "capsule", "cylinder", "plane", "quad"], undefined>, undefined>;
|
|
35
|
+
readonly transform: v.OptionalSchema<v.ObjectSchema<{
|
|
36
|
+
readonly space: v.OptionalSchema<v.PicklistSchema<["local", "world"], undefined>, undefined>;
|
|
37
|
+
readonly position: v.OptionalSchema<v.ObjectSchema<{
|
|
38
|
+
readonly x: v.NumberSchema<undefined>;
|
|
39
|
+
readonly y: v.NumberSchema<undefined>;
|
|
40
|
+
readonly z: v.NumberSchema<undefined>;
|
|
41
|
+
}, undefined>, undefined>;
|
|
42
|
+
readonly rotation: v.OptionalSchema<v.ObjectSchema<{
|
|
43
|
+
readonly x: v.NumberSchema<undefined>;
|
|
44
|
+
readonly y: v.NumberSchema<undefined>;
|
|
45
|
+
readonly z: v.NumberSchema<undefined>;
|
|
46
|
+
}, undefined>, undefined>;
|
|
47
|
+
readonly scale: v.OptionalSchema<v.ObjectSchema<{
|
|
48
|
+
readonly x: v.NumberSchema<undefined>;
|
|
49
|
+
readonly y: v.NumberSchema<undefined>;
|
|
50
|
+
readonly z: v.NumberSchema<undefined>;
|
|
51
|
+
}, undefined>, undefined>;
|
|
52
|
+
}, undefined>, undefined>;
|
|
53
|
+
}, undefined>;
|
|
54
|
+
export declare const GameObjectCreateResultSchema: v.ObjectSchema<{
|
|
55
|
+
readonly name: v.StringSchema<undefined>;
|
|
56
|
+
readonly path: v.StringSchema<undefined>;
|
|
57
|
+
readonly isActive: v.BooleanSchema<undefined>;
|
|
58
|
+
readonly siblingIndex: v.NumberSchema<undefined>;
|
|
59
|
+
readonly instanceId: v.NumberSchema<undefined>;
|
|
60
|
+
}, undefined>;
|
|
61
|
+
export declare const gameObjectCreateCommand: import("../define.ts").CommandDef<"gameObjectCreate", [input: {
|
|
62
|
+
name: string;
|
|
63
|
+
parent?: string | undefined;
|
|
64
|
+
parentInstanceId?: number | undefined;
|
|
65
|
+
dimension?: "2d" | "3d" | undefined;
|
|
66
|
+
primitive?: "cube" | "sphere" | "capsule" | "cylinder" | "plane" | "quad" | undefined;
|
|
67
|
+
transform?: {
|
|
68
|
+
space?: "local" | "world" | undefined;
|
|
69
|
+
position?: {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
z: number;
|
|
73
|
+
} | undefined;
|
|
74
|
+
rotation?: {
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
z: number;
|
|
78
|
+
} | undefined;
|
|
79
|
+
scale?: {
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
z: number;
|
|
83
|
+
} | undefined;
|
|
84
|
+
} | undefined;
|
|
85
|
+
}], {
|
|
86
|
+
name: string;
|
|
87
|
+
path: string;
|
|
88
|
+
isActive: boolean;
|
|
89
|
+
siblingIndex: number;
|
|
90
|
+
instanceId: number;
|
|
91
|
+
}>;
|
|
92
|
+
export declare const GameObjectDestroyInputSchema: v.ObjectSchema<{
|
|
93
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
94
|
+
readonly instanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
95
|
+
}, undefined>;
|
|
96
|
+
export declare const GameObjectDestroyResultSchema: v.ObjectSchema<{
|
|
97
|
+
readonly destroyed: v.BooleanSchema<undefined>;
|
|
98
|
+
readonly name: v.StringSchema<undefined>;
|
|
99
|
+
readonly path: v.StringSchema<undefined>;
|
|
100
|
+
readonly instanceId: v.NumberSchema<undefined>;
|
|
101
|
+
}, undefined>;
|
|
102
|
+
export declare const gameObjectDestroyCommand: import("../define.ts").CommandDef<"gameObjectDestroy", [input: {
|
|
103
|
+
path?: string | undefined;
|
|
104
|
+
instanceId?: number | undefined;
|
|
105
|
+
}], {
|
|
106
|
+
destroyed: boolean;
|
|
107
|
+
name: string;
|
|
108
|
+
path: string;
|
|
109
|
+
instanceId: number;
|
|
110
|
+
}>;
|
|
111
|
+
export declare const GameObjectUpdateInputSchema: v.ObjectSchema<{
|
|
112
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
113
|
+
readonly instanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
114
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
115
|
+
readonly tag: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
116
|
+
readonly layer: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
117
|
+
readonly isStatic: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
118
|
+
readonly transform: v.OptionalSchema<v.ObjectSchema<{
|
|
119
|
+
readonly space: v.OptionalSchema<v.PicklistSchema<["local", "world"], undefined>, undefined>;
|
|
120
|
+
readonly position: v.OptionalSchema<v.ObjectSchema<{
|
|
121
|
+
readonly x: v.NumberSchema<undefined>;
|
|
122
|
+
readonly y: v.NumberSchema<undefined>;
|
|
123
|
+
readonly z: v.NumberSchema<undefined>;
|
|
124
|
+
}, undefined>, undefined>;
|
|
125
|
+
readonly rotation: v.OptionalSchema<v.ObjectSchema<{
|
|
126
|
+
readonly x: v.NumberSchema<undefined>;
|
|
127
|
+
readonly y: v.NumberSchema<undefined>;
|
|
128
|
+
readonly z: v.NumberSchema<undefined>;
|
|
129
|
+
}, undefined>, undefined>;
|
|
130
|
+
readonly scale: v.OptionalSchema<v.ObjectSchema<{
|
|
131
|
+
readonly x: v.NumberSchema<undefined>;
|
|
132
|
+
readonly y: v.NumberSchema<undefined>;
|
|
133
|
+
readonly z: v.NumberSchema<undefined>;
|
|
134
|
+
}, undefined>, undefined>;
|
|
135
|
+
}, undefined>, undefined>;
|
|
136
|
+
}, undefined>;
|
|
137
|
+
export declare const GameObjectUpdateResultSchema: v.ObjectSchema<{
|
|
138
|
+
readonly name: v.StringSchema<undefined>;
|
|
139
|
+
readonly path: v.StringSchema<undefined>;
|
|
140
|
+
readonly instanceId: v.NumberSchema<undefined>;
|
|
141
|
+
readonly tag: v.StringSchema<undefined>;
|
|
142
|
+
readonly layer: v.StringSchema<undefined>;
|
|
143
|
+
readonly isStatic: v.BooleanSchema<undefined>;
|
|
144
|
+
readonly transform: v.ObjectSchema<{
|
|
145
|
+
readonly position: v.ObjectSchema<{
|
|
146
|
+
readonly x: v.NumberSchema<undefined>;
|
|
147
|
+
readonly y: v.NumberSchema<undefined>;
|
|
148
|
+
readonly z: v.NumberSchema<undefined>;
|
|
149
|
+
}, undefined>;
|
|
150
|
+
readonly rotation: v.ObjectSchema<{
|
|
151
|
+
readonly x: v.NumberSchema<undefined>;
|
|
152
|
+
readonly y: v.NumberSchema<undefined>;
|
|
153
|
+
readonly z: v.NumberSchema<undefined>;
|
|
154
|
+
}, undefined>;
|
|
155
|
+
readonly scale: v.ObjectSchema<{
|
|
156
|
+
readonly x: v.NumberSchema<undefined>;
|
|
157
|
+
readonly y: v.NumberSchema<undefined>;
|
|
158
|
+
readonly z: v.NumberSchema<undefined>;
|
|
159
|
+
}, undefined>;
|
|
160
|
+
}, undefined>;
|
|
161
|
+
}, undefined>;
|
|
162
|
+
export declare const gameObjectUpdateCommand: import("../define.ts").CommandDef<"gameObjectUpdate", [input: {
|
|
163
|
+
path?: string | undefined;
|
|
164
|
+
instanceId?: number | undefined;
|
|
165
|
+
name?: string | undefined;
|
|
166
|
+
tag?: string | undefined;
|
|
167
|
+
layer?: string | undefined;
|
|
168
|
+
isStatic?: boolean | undefined;
|
|
169
|
+
transform?: {
|
|
170
|
+
space?: "local" | "world" | undefined;
|
|
171
|
+
position?: {
|
|
172
|
+
x: number;
|
|
173
|
+
y: number;
|
|
174
|
+
z: number;
|
|
175
|
+
} | undefined;
|
|
176
|
+
rotation?: {
|
|
177
|
+
x: number;
|
|
178
|
+
y: number;
|
|
179
|
+
z: number;
|
|
180
|
+
} | undefined;
|
|
181
|
+
scale?: {
|
|
182
|
+
x: number;
|
|
183
|
+
y: number;
|
|
184
|
+
z: number;
|
|
185
|
+
} | undefined;
|
|
186
|
+
} | undefined;
|
|
187
|
+
}], {
|
|
188
|
+
name: string;
|
|
189
|
+
path: string;
|
|
190
|
+
instanceId: number;
|
|
191
|
+
tag: string;
|
|
192
|
+
layer: string;
|
|
193
|
+
isStatic: boolean;
|
|
194
|
+
transform: {
|
|
195
|
+
position: {
|
|
196
|
+
x: number;
|
|
197
|
+
y: number;
|
|
198
|
+
z: number;
|
|
199
|
+
};
|
|
200
|
+
rotation: {
|
|
201
|
+
x: number;
|
|
202
|
+
y: number;
|
|
203
|
+
z: number;
|
|
204
|
+
};
|
|
205
|
+
scale: {
|
|
206
|
+
x: number;
|
|
207
|
+
y: number;
|
|
208
|
+
z: number;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
}>;
|
|
212
|
+
export declare const GameObjectReparentInputSchema: v.ObjectSchema<{
|
|
213
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
214
|
+
readonly instanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
215
|
+
readonly parentPath: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
216
|
+
readonly parentInstanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
217
|
+
readonly toRoot: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
218
|
+
readonly worldPositionStays: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
219
|
+
}, undefined>;
|
|
220
|
+
export declare const GameObjectReparentResultSchema: v.ObjectSchema<{
|
|
221
|
+
readonly name: v.StringSchema<undefined>;
|
|
222
|
+
readonly path: v.StringSchema<undefined>;
|
|
223
|
+
readonly instanceId: v.NumberSchema<undefined>;
|
|
224
|
+
readonly parentPath: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
225
|
+
readonly siblingIndex: v.NumberSchema<undefined>;
|
|
226
|
+
}, undefined>;
|
|
227
|
+
export declare const gameObjectReparentCommand: import("../define.ts").CommandDef<"gameObjectReparent", [input: {
|
|
228
|
+
path?: string | undefined;
|
|
229
|
+
instanceId?: number | undefined;
|
|
230
|
+
parentPath?: string | undefined;
|
|
231
|
+
parentInstanceId?: number | undefined;
|
|
232
|
+
toRoot?: boolean | undefined;
|
|
233
|
+
worldPositionStays?: boolean | undefined;
|
|
234
|
+
}], {
|
|
235
|
+
name: string;
|
|
236
|
+
path: string;
|
|
237
|
+
instanceId: number;
|
|
238
|
+
parentPath: string | null;
|
|
239
|
+
siblingIndex: number;
|
|
240
|
+
}>;
|
|
241
|
+
export declare const GameObjectGetInputSchema: v.ObjectSchema<{
|
|
242
|
+
readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
243
|
+
readonly instanceId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
244
|
+
}, undefined>;
|
|
245
|
+
export declare const GameObjectGetResultSchema: v.ObjectSchema<{
|
|
246
|
+
readonly name: v.StringSchema<undefined>;
|
|
247
|
+
readonly path: v.StringSchema<undefined>;
|
|
248
|
+
readonly instanceId: v.NumberSchema<undefined>;
|
|
249
|
+
readonly isActive: v.BooleanSchema<undefined>;
|
|
250
|
+
readonly tag: v.StringSchema<undefined>;
|
|
251
|
+
readonly layer: v.StringSchema<undefined>;
|
|
252
|
+
readonly isStatic: v.BooleanSchema<undefined>;
|
|
253
|
+
readonly parentPath: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
254
|
+
readonly siblingIndex: v.NumberSchema<undefined>;
|
|
255
|
+
readonly transform: v.ObjectSchema<{
|
|
256
|
+
readonly position: v.ObjectSchema<{
|
|
257
|
+
readonly x: v.NumberSchema<undefined>;
|
|
258
|
+
readonly y: v.NumberSchema<undefined>;
|
|
259
|
+
readonly z: v.NumberSchema<undefined>;
|
|
260
|
+
}, undefined>;
|
|
261
|
+
readonly rotation: v.ObjectSchema<{
|
|
262
|
+
readonly x: v.NumberSchema<undefined>;
|
|
263
|
+
readonly y: v.NumberSchema<undefined>;
|
|
264
|
+
readonly z: v.NumberSchema<undefined>;
|
|
265
|
+
}, undefined>;
|
|
266
|
+
readonly scale: v.ObjectSchema<{
|
|
267
|
+
readonly x: v.NumberSchema<undefined>;
|
|
268
|
+
readonly y: v.NumberSchema<undefined>;
|
|
269
|
+
readonly z: v.NumberSchema<undefined>;
|
|
270
|
+
}, undefined>;
|
|
271
|
+
}, undefined>;
|
|
272
|
+
}, undefined>;
|
|
273
|
+
export declare const gameObjectGetCommand: import("../define.ts").CommandDef<"gameObjectGet", [input: {
|
|
274
|
+
path?: string | undefined;
|
|
275
|
+
instanceId?: number | undefined;
|
|
276
|
+
}], {
|
|
277
|
+
name: string;
|
|
278
|
+
path: string;
|
|
279
|
+
instanceId: number;
|
|
280
|
+
isActive: boolean;
|
|
281
|
+
tag: string;
|
|
282
|
+
layer: string;
|
|
283
|
+
isStatic: boolean;
|
|
284
|
+
parentPath: string | null;
|
|
285
|
+
siblingIndex: number;
|
|
286
|
+
transform: {
|
|
287
|
+
position: {
|
|
288
|
+
x: number;
|
|
289
|
+
y: number;
|
|
290
|
+
z: number;
|
|
291
|
+
};
|
|
292
|
+
rotation: {
|
|
293
|
+
x: number;
|
|
294
|
+
y: number;
|
|
295
|
+
z: number;
|
|
296
|
+
};
|
|
297
|
+
scale: {
|
|
298
|
+
x: number;
|
|
299
|
+
y: number;
|
|
300
|
+
z: number;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
}>;
|
|
304
|
+
export type GameObjectDimension = v.InferOutput<typeof GameObjectDimensionSchema>;
|
|
305
|
+
export type PrimitiveTypeName = v.InferOutput<typeof PrimitiveSchema>;
|
|
306
|
+
export type TransformSpace = v.InferOutput<typeof TransformSpaceSchema>;
|
|
307
|
+
export type Vector3Value = v.InferOutput<typeof Vector3Schema>;
|
|
308
|
+
export type CreateTransform = v.InferOutput<typeof CreateTransformSchema>;
|
|
309
|
+
export type GameObjectCreateInput = v.InferOutput<typeof GameObjectCreateInputSchema>;
|
|
310
|
+
export type GameObjectCreateResult = InferResult<typeof gameObjectCreateCommand>;
|
|
311
|
+
export type GameObjectDestroyInput = v.InferOutput<typeof GameObjectDestroyInputSchema>;
|
|
312
|
+
export type GameObjectDestroyResult = InferResult<typeof gameObjectDestroyCommand>;
|
|
313
|
+
export type GameObjectUpdateInput = v.InferOutput<typeof GameObjectUpdateInputSchema>;
|
|
314
|
+
export type GameObjectUpdateResult = InferResult<typeof gameObjectUpdateCommand>;
|
|
315
|
+
export type GameObjectReparentInput = v.InferOutput<typeof GameObjectReparentInputSchema>;
|
|
316
|
+
export type GameObjectReparentResult = InferResult<typeof gameObjectReparentCommand>;
|
|
317
|
+
export type GameObjectGetInput = v.InferOutput<typeof GameObjectGetInputSchema>;
|
|
318
|
+
export type GameObjectGetResult = InferResult<typeof gameObjectGetCommand>;
|
|
319
|
+
export {};
|
|
320
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/commands/gameobject/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D,QAAA,MAAM,yBAAyB,2CAA2B,CAAA;AAC1D,QAAA,MAAM,eAAe,yFAAyE,CAAA;AAC9F,QAAA,MAAM,oBAAoB,iDAAiC,CAAA;AAE3D,QAAA,MAAM,aAAa;;;;aAIjB,CAAA;AAEF,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;aAKzB,CAAA;AAQF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;aAOtC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;aAMvC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA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,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAChF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACvF,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAClF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,2BAA2B,CAAC,CAAA;AACrF,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAChF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACzF,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,OAAO,yBAAyB,CAAC,CAAA;AACpF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAC/E,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { defineCommand } from "../define.js";
|
|
3
|
+
const GameObjectDimensionSchema = v.picklist(['2d', '3d']);
|
|
4
|
+
const PrimitiveSchema = v.picklist(['cube', 'sphere', 'capsule', 'cylinder', 'plane', 'quad']);
|
|
5
|
+
const TransformSpaceSchema = v.picklist(['local', 'world']);
|
|
6
|
+
const Vector3Schema = v.object({
|
|
7
|
+
x: v.number(),
|
|
8
|
+
y: v.number(),
|
|
9
|
+
z: v.number(),
|
|
10
|
+
});
|
|
11
|
+
const CreateTransformSchema = v.object({
|
|
12
|
+
space: v.optional(TransformSpaceSchema),
|
|
13
|
+
position: v.optional(Vector3Schema),
|
|
14
|
+
rotation: v.optional(Vector3Schema),
|
|
15
|
+
scale: v.optional(Vector3Schema),
|
|
16
|
+
});
|
|
17
|
+
const TransformSnapshotSchema = v.object({
|
|
18
|
+
position: Vector3Schema,
|
|
19
|
+
rotation: Vector3Schema,
|
|
20
|
+
scale: Vector3Schema,
|
|
21
|
+
});
|
|
22
|
+
export const GameObjectCreateInputSchema = v.object({
|
|
23
|
+
name: v.string(),
|
|
24
|
+
parent: v.optional(v.string()),
|
|
25
|
+
parentInstanceId: v.optional(v.number()),
|
|
26
|
+
dimension: v.optional(GameObjectDimensionSchema),
|
|
27
|
+
primitive: v.optional(PrimitiveSchema),
|
|
28
|
+
transform: v.optional(CreateTransformSchema),
|
|
29
|
+
});
|
|
30
|
+
export const GameObjectCreateResultSchema = v.object({
|
|
31
|
+
name: v.string(),
|
|
32
|
+
path: v.string(),
|
|
33
|
+
isActive: v.boolean(),
|
|
34
|
+
siblingIndex: v.number(),
|
|
35
|
+
instanceId: v.number(),
|
|
36
|
+
});
|
|
37
|
+
export const gameObjectCreateCommand = defineCommand({
|
|
38
|
+
method: 'gameObjectCreate',
|
|
39
|
+
wire: 'gameobject.create',
|
|
40
|
+
params: (input) => ({
|
|
41
|
+
name: input.name,
|
|
42
|
+
parent: input.parent,
|
|
43
|
+
parentInstanceId: input.parentInstanceId,
|
|
44
|
+
dimension: input.dimension,
|
|
45
|
+
primitive: input.primitive,
|
|
46
|
+
transform: input.transform,
|
|
47
|
+
}),
|
|
48
|
+
result: GameObjectCreateResultSchema,
|
|
49
|
+
});
|
|
50
|
+
export const GameObjectDestroyInputSchema = v.object({
|
|
51
|
+
path: v.optional(v.string()),
|
|
52
|
+
instanceId: v.optional(v.number()),
|
|
53
|
+
});
|
|
54
|
+
export const GameObjectDestroyResultSchema = v.object({
|
|
55
|
+
destroyed: v.boolean(),
|
|
56
|
+
name: v.string(),
|
|
57
|
+
path: v.string(),
|
|
58
|
+
instanceId: v.number(),
|
|
59
|
+
});
|
|
60
|
+
export const gameObjectDestroyCommand = defineCommand({
|
|
61
|
+
method: 'gameObjectDestroy',
|
|
62
|
+
wire: 'gameobject.destroy',
|
|
63
|
+
params: (input) => ({
|
|
64
|
+
path: input.path,
|
|
65
|
+
instanceId: input.instanceId,
|
|
66
|
+
}),
|
|
67
|
+
result: GameObjectDestroyResultSchema,
|
|
68
|
+
});
|
|
69
|
+
export const GameObjectUpdateInputSchema = v.object({
|
|
70
|
+
path: v.optional(v.string()),
|
|
71
|
+
instanceId: v.optional(v.number()),
|
|
72
|
+
name: v.optional(v.string()),
|
|
73
|
+
tag: v.optional(v.string()),
|
|
74
|
+
layer: v.optional(v.string()),
|
|
75
|
+
isStatic: v.optional(v.boolean()),
|
|
76
|
+
transform: v.optional(CreateTransformSchema),
|
|
77
|
+
});
|
|
78
|
+
export const GameObjectUpdateResultSchema = v.object({
|
|
79
|
+
name: v.string(),
|
|
80
|
+
path: v.string(),
|
|
81
|
+
instanceId: v.number(),
|
|
82
|
+
tag: v.string(),
|
|
83
|
+
layer: v.string(),
|
|
84
|
+
isStatic: v.boolean(),
|
|
85
|
+
transform: TransformSnapshotSchema,
|
|
86
|
+
});
|
|
87
|
+
export const gameObjectUpdateCommand = defineCommand({
|
|
88
|
+
method: 'gameObjectUpdate',
|
|
89
|
+
wire: 'gameobject.update',
|
|
90
|
+
params: (input) => ({
|
|
91
|
+
path: input.path,
|
|
92
|
+
instanceId: input.instanceId,
|
|
93
|
+
name: input.name,
|
|
94
|
+
tag: input.tag,
|
|
95
|
+
layer: input.layer,
|
|
96
|
+
isStatic: input.isStatic,
|
|
97
|
+
transform: input.transform,
|
|
98
|
+
}),
|
|
99
|
+
result: GameObjectUpdateResultSchema,
|
|
100
|
+
});
|
|
101
|
+
export const GameObjectReparentInputSchema = v.object({
|
|
102
|
+
path: v.optional(v.string()),
|
|
103
|
+
instanceId: v.optional(v.number()),
|
|
104
|
+
parentPath: v.optional(v.string()),
|
|
105
|
+
parentInstanceId: v.optional(v.number()),
|
|
106
|
+
toRoot: v.optional(v.boolean()),
|
|
107
|
+
worldPositionStays: v.optional(v.boolean()),
|
|
108
|
+
});
|
|
109
|
+
export const GameObjectReparentResultSchema = v.object({
|
|
110
|
+
name: v.string(),
|
|
111
|
+
path: v.string(),
|
|
112
|
+
instanceId: v.number(),
|
|
113
|
+
parentPath: v.nullable(v.string()),
|
|
114
|
+
siblingIndex: v.number(),
|
|
115
|
+
});
|
|
116
|
+
export const gameObjectReparentCommand = defineCommand({
|
|
117
|
+
method: 'gameObjectReparent',
|
|
118
|
+
wire: 'gameobject.reparent',
|
|
119
|
+
params: (input) => ({
|
|
120
|
+
path: input.path,
|
|
121
|
+
instanceId: input.instanceId,
|
|
122
|
+
parentPath: input.parentPath,
|
|
123
|
+
parentInstanceId: input.parentInstanceId,
|
|
124
|
+
toRoot: input.toRoot,
|
|
125
|
+
worldPositionStays: input.worldPositionStays,
|
|
126
|
+
}),
|
|
127
|
+
result: GameObjectReparentResultSchema,
|
|
128
|
+
});
|
|
129
|
+
export const GameObjectGetInputSchema = v.object({
|
|
130
|
+
path: v.optional(v.string()),
|
|
131
|
+
instanceId: v.optional(v.number()),
|
|
132
|
+
});
|
|
133
|
+
export const GameObjectGetResultSchema = v.object({
|
|
134
|
+
name: v.string(),
|
|
135
|
+
path: v.string(),
|
|
136
|
+
instanceId: v.number(),
|
|
137
|
+
isActive: v.boolean(),
|
|
138
|
+
tag: v.string(),
|
|
139
|
+
layer: v.string(),
|
|
140
|
+
isStatic: v.boolean(),
|
|
141
|
+
parentPath: v.nullable(v.string()),
|
|
142
|
+
siblingIndex: v.number(),
|
|
143
|
+
transform: TransformSnapshotSchema,
|
|
144
|
+
});
|
|
145
|
+
export const gameObjectGetCommand = defineCommand({
|
|
146
|
+
method: 'gameObjectGet',
|
|
147
|
+
wire: 'gameobject.get',
|
|
148
|
+
params: (input) => ({
|
|
149
|
+
path: input.path,
|
|
150
|
+
instanceId: input.instanceId,
|
|
151
|
+
}),
|
|
152
|
+
result: GameObjectGetResultSchema,
|
|
153
|
+
});
|
|
154
|
+
//# sourceMappingURL=contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.js","s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AE,CAAC,CAAC,MAAM,EAAE;IACtB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,uBAAuB;CACnC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;IAChD,MAAM,EAAE,eAAe;IACvB,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE,CAAC,KAAyB,EAAE,EAAE,CAAC,CAAC;QACtC,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,UAAU,EAAE,KAAK,CAAC,UAAU;KAC7B,CAAC;IACF,MAAM,EAAE,yBAAyB;CAClC,CAAC,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { type InferResult } from '../define.ts';
|
|
3
|
+
export declare const LogsSeveritySchema: v.PicklistSchema<["info", "warn", "error"], undefined>;
|
|
4
|
+
export declare const LogsQuerySchema: v.ObjectSchema<{
|
|
5
|
+
readonly severity: v.OptionalSchema<v.PicklistSchema<["info", "warn", "error"], undefined>, undefined>;
|
|
6
|
+
readonly limit: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
7
|
+
readonly offset: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
8
|
+
}, undefined>;
|
|
9
|
+
declare const LogEntrySchema: v.ObjectSchema<{
|
|
10
|
+
readonly timestamp: v.StringSchema<undefined>;
|
|
11
|
+
readonly severity: v.PicklistSchema<["info", "warn", "error"], undefined>;
|
|
12
|
+
readonly message: v.StringSchema<undefined>;
|
|
13
|
+
readonly stackTrace: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
14
|
+
}, undefined>;
|
|
15
|
+
export declare const LogsResultSchema: v.ObjectSchema<{
|
|
16
|
+
readonly logs: v.ArraySchema<v.ObjectSchema<{
|
|
17
|
+
readonly timestamp: v.StringSchema<undefined>;
|
|
18
|
+
readonly severity: v.PicklistSchema<["info", "warn", "error"], undefined>;
|
|
19
|
+
readonly message: v.StringSchema<undefined>;
|
|
20
|
+
readonly stackTrace: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
21
|
+
}, undefined>, undefined>;
|
|
22
|
+
readonly total: v.NumberSchema<undefined>;
|
|
23
|
+
readonly limit: v.NumberSchema<undefined>;
|
|
24
|
+
readonly offset: v.NumberSchema<undefined>;
|
|
25
|
+
}, undefined>;
|
|
26
|
+
export declare const logsCommand: import("../define.ts").CommandDef<"logs", [query?: {
|
|
27
|
+
severity?: "info" | "warn" | "error" | undefined;
|
|
28
|
+
limit?: number | undefined;
|
|
29
|
+
offset?: number | undefined;
|
|
30
|
+
} | undefined], {
|
|
31
|
+
logs: {
|
|
32
|
+
timestamp: string;
|
|
33
|
+
severity: "info" | "warn" | "error";
|
|
34
|
+
message: string;
|
|
35
|
+
stackTrace?: string | undefined;
|
|
36
|
+
}[];
|
|
37
|
+
total: number;
|
|
38
|
+
limit: number;
|
|
39
|
+
offset: number;
|
|
40
|
+
}>;
|
|
41
|
+
export type LogsSeverity = v.InferOutput<typeof LogsSeveritySchema>;
|
|
42
|
+
export type LogsQuery = v.InferOutput<typeof LogsQuerySchema>;
|
|
43
|
+
export type LogEntry = v.InferOutput<typeof LogEntrySchema>;
|
|
44
|
+
export type LogsResult = InferResult<typeof logsCommand>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/commands/log/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D,eAAO,MAAM,kBAAkB,wDAAwC,CAAA;AAEvE,eAAO,MAAM,eAAe;;;;aAI1B,CAAA;AAEF,QAAA,MAAM,cAAc;;;;;aAKlB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;aAK3B,CAAA;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;EAStB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAA;AACnE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,eAAe,CAAC,CAAA;AAC7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,cAAc,CAAC,CAAA;AAC3D,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,WAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { defineCommand } from "../define.js";
|
|
3
|
+
export const LogsSeveritySchema = v.picklist(['info', 'warn', 'error']);
|
|
4
|
+
export const LogsQuerySchema = v.object({
|
|
5
|
+
severity: v.optional(LogsSeveritySchema),
|
|
6
|
+
limit: v.optional(v.number()),
|
|
7
|
+
offset: v.optional(v.number()),
|
|
8
|
+
});
|
|
9
|
+
const LogEntrySchema = v.object({
|
|
10
|
+
timestamp: v.string(),
|
|
11
|
+
severity: LogsSeveritySchema,
|
|
12
|
+
message: v.string(),
|
|
13
|
+
stackTrace: v.optional(v.string()),
|
|
14
|
+
});
|
|
15
|
+
export const LogsResultSchema = v.object({
|
|
16
|
+
logs: v.array(LogEntrySchema),
|
|
17
|
+
total: v.number(),
|
|
18
|
+
limit: v.number(),
|
|
19
|
+
offset: v.number(),
|
|
20
|
+
});
|
|
21
|
+
export const logsCommand = defineCommand({
|
|
22
|
+
method: 'logs',
|
|
23
|
+
wire: 'logs',
|
|
24
|
+
params: (query) => ({
|
|
25
|
+
severity: query?.severity,
|
|
26
|
+
limit: query?.limit,
|
|
27
|
+
offset: query?.offset,
|
|
28
|
+
}),
|
|
29
|
+
result: LogsResultSchema,
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../src/commands/log/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAA;AAE9D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAEvE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC/B,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,kBAAkB;IAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACnC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;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