@drawcall/design 0.5.6 → 0.5.8
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/protocol.d.ts +21 -1
- package/dist/protocol.js +9 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export { frameCreationCapabilities, type FrameCreationCapability, type FrameCrea
|
|
|
4
4
|
export { cameraPoseSchema, IMAGE_GENERATION_MODEL, IMAGE_GENERATION_PROVIDER, } from "./v1/schemas.js";
|
|
5
5
|
export { parseFrameSize } from "./target.js";
|
|
6
6
|
export { projectFrameLayoutSchema, projectFrameRecordSchema, projectGltsFrameRecordSchema, projectImageFrameRecordSchema, projectMarketFileSchema, projectMarketFrameRecordSchema, projectPresenceClientMessageSchema, projectPresenceServerMessageSchema, projectStateSchema, type ProjectFrameLayout, type ProjectFrameRecord, type ProjectGltsFrameRecord, type ProjectImageFrameRecord, type ProjectMarketFile, type ProjectMarketFrameRecord, type ProjectPresenceClientMessage, type ProjectPresenceServerMessage, type ProjectState, } from "./project-state.js";
|
|
7
|
-
export {
|
|
7
|
+
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, type GltsExportCancelCommand, type GltsExportCancelledResult, type GltsExportCommand, type GltsExportFrameMessage, type GltsExportParentMessage, type GltsExportResult, type GltsRuntimeExportFormat, type CameraCaptureCommand, type CameraSetCommand, type CameraCaptureFailure, type CameraCaptureResult, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, type ImmersiveCommand, type ImmersiveFrameMessage, type ImmersiveMode, type SourceFileChange, type SourceFileReloadResult, type SourceFilesChangedMessage, } from "./protocol.js";
|
|
8
8
|
export type { BinaryFile, CameraPose, CreateFrame, CreateProjectFromBrief, CreateGltsFrame, CreateImageFrame, CreateMarketFrame, GenerateImageFrame, DesignFile, FileList, FileMutation, FrameExport, Frame, GltsFrame, GltsFrameExport, ImageFrame, ImageFrameExport, ImageGenerationOperation, ImageGenerationProvenance, ImageGenerationResult, MarketFrame, MarketFrameExport, Project, ProjectDerivationStatus, Screenshot, TextFile, User, } from "./v1/schemas.js";
|
package/dist/index.js
CHANGED
|
@@ -4,4 +4,4 @@ export { frameCreationCapabilities, } from "./v1/capabilities.js";
|
|
|
4
4
|
export { cameraPoseSchema, IMAGE_GENERATION_MODEL, IMAGE_GENERATION_PROVIDER, } from "./v1/schemas.js";
|
|
5
5
|
export { parseFrameSize } from "./target.js";
|
|
6
6
|
export { projectFrameLayoutSchema, projectFrameRecordSchema, projectGltsFrameRecordSchema, projectImageFrameRecordSchema, projectMarketFileSchema, projectMarketFrameRecordSchema, projectPresenceClientMessageSchema, projectPresenceServerMessageSchema, projectStateSchema, } from "./project-state.js";
|
|
7
|
-
export {
|
|
7
|
+
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, } from "./protocol.js";
|
package/dist/protocol.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const inspectionMessageTypes: {
|
|
|
3
3
|
readonly applied: "drawcall:inspection:applied";
|
|
4
4
|
readonly exit: "drawcall:inspection:exit";
|
|
5
5
|
readonly failed: "drawcall:inspection:failed";
|
|
6
|
+
readonly focus: "drawcall:inspection:focus";
|
|
6
7
|
readonly loading: "drawcall:inspection:loading";
|
|
7
8
|
readonly ready: "drawcall:inspection:ready";
|
|
8
9
|
readonly set: "drawcall:inspection:set";
|
|
@@ -118,6 +119,7 @@ export declare const gltsExportFrameMessageSchema: z.ZodUnion<readonly [z.ZodDis
|
|
|
118
119
|
export declare const cameraMessageTypes: {
|
|
119
120
|
readonly capture: "drawcall:camera:capture";
|
|
120
121
|
readonly captured: "drawcall:camera:captured";
|
|
122
|
+
readonly set: "drawcall:camera:set";
|
|
121
123
|
readonly unavailable: "drawcall:camera:unavailable";
|
|
122
124
|
};
|
|
123
125
|
export declare const sourceFileMessageTypes: {
|
|
@@ -151,6 +153,22 @@ export declare const cameraCaptureCommandSchema: z.ZodObject<{
|
|
|
151
153
|
type: z.ZodLiteral<"drawcall:camera:capture">;
|
|
152
154
|
requestId: z.ZodString;
|
|
153
155
|
}, z.core.$strict>;
|
|
156
|
+
export declare const cameraSetCommandSchema: z.ZodObject<{
|
|
157
|
+
type: z.ZodLiteral<"drawcall:camera:set">;
|
|
158
|
+
camera: z.ZodObject<{
|
|
159
|
+
position: z.ZodObject<{
|
|
160
|
+
x: z.ZodNumber;
|
|
161
|
+
y: z.ZodNumber;
|
|
162
|
+
z: z.ZodNumber;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
quaternion: z.ZodObject<{
|
|
165
|
+
x: z.ZodNumber;
|
|
166
|
+
y: z.ZodNumber;
|
|
167
|
+
z: z.ZodNumber;
|
|
168
|
+
w: z.ZodNumber;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
}, z.core.$strict>;
|
|
171
|
+
}, z.core.$strict>;
|
|
154
172
|
export declare const cameraCaptureResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
155
173
|
type: z.ZodLiteral<"drawcall:camera:captured">;
|
|
156
174
|
requestId: z.ZodString;
|
|
@@ -193,12 +211,15 @@ export declare const inspectionFrameMessageSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
193
211
|
enabled: z.ZodBoolean;
|
|
194
212
|
}, z.core.$strict>, z.ZodObject<{
|
|
195
213
|
type: z.ZodLiteral<"drawcall:inspection:exit">;
|
|
214
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
215
|
+
type: z.ZodLiteral<"drawcall:inspection:focus">;
|
|
196
216
|
}, z.core.$strict>], "type">;
|
|
197
217
|
export type InspectionCommand = z.infer<typeof inspectionCommandSchema>;
|
|
198
218
|
export type ImmersiveMode = z.infer<typeof immersiveModeSchema>;
|
|
199
219
|
export type ImmersiveCommand = z.infer<typeof immersiveCommandSchema>;
|
|
200
220
|
export type ImmersiveFrameMessage = z.infer<typeof immersiveFrameMessageSchema>;
|
|
201
221
|
export type CameraCaptureCommand = z.infer<typeof cameraCaptureCommandSchema>;
|
|
222
|
+
export type CameraSetCommand = z.infer<typeof cameraSetCommandSchema>;
|
|
202
223
|
export type CameraCaptureResult = z.infer<typeof cameraCaptureResultSchema>;
|
|
203
224
|
export type SourceFileChange = z.infer<typeof sourceFileChangeSchema>;
|
|
204
225
|
export type SourceFilesChangedMessage = z.infer<typeof sourceFilesChangedMessageSchema>;
|
|
@@ -217,5 +238,4 @@ export type GltsExportParentMessage = z.infer<typeof gltsExportParentMessageSche
|
|
|
217
238
|
export type GltsExportResult = z.infer<typeof gltsExportResultSchema>;
|
|
218
239
|
export type GltsExportCancelledResult = z.infer<typeof gltsExportCancelledResultSchema>;
|
|
219
240
|
export type GltsExportFrameMessage = z.infer<typeof gltsExportFrameMessageSchema>;
|
|
220
|
-
export declare function acknowledgesInspection(command: InspectionCommand | null, message: InspectionAppliedMessage): boolean;
|
|
221
241
|
export declare function projectSyncUrl(baseUrl: string, project: string): string;
|
package/dist/protocol.js
CHANGED
|
@@ -4,6 +4,7 @@ export const inspectionMessageTypes = {
|
|
|
4
4
|
applied: "drawcall:inspection:applied",
|
|
5
5
|
exit: "drawcall:inspection:exit",
|
|
6
6
|
failed: "drawcall:inspection:failed",
|
|
7
|
+
focus: "drawcall:inspection:focus",
|
|
7
8
|
loading: "drawcall:inspection:loading",
|
|
8
9
|
ready: "drawcall:inspection:ready",
|
|
9
10
|
set: "drawcall:inspection:set",
|
|
@@ -97,6 +98,7 @@ export const gltsExportFrameMessageSchema = z.union([
|
|
|
97
98
|
export const cameraMessageTypes = {
|
|
98
99
|
capture: "drawcall:camera:capture",
|
|
99
100
|
captured: "drawcall:camera:captured",
|
|
101
|
+
set: "drawcall:camera:set",
|
|
100
102
|
unavailable: "drawcall:camera:unavailable",
|
|
101
103
|
};
|
|
102
104
|
export const sourceFileMessageTypes = {
|
|
@@ -132,6 +134,12 @@ export const cameraCaptureCommandSchema = z
|
|
|
132
134
|
requestId: z.string().min(1),
|
|
133
135
|
})
|
|
134
136
|
.strict();
|
|
137
|
+
export const cameraSetCommandSchema = z
|
|
138
|
+
.object({
|
|
139
|
+
type: z.literal(cameraMessageTypes.set),
|
|
140
|
+
camera: cameraPoseSchema,
|
|
141
|
+
})
|
|
142
|
+
.strict();
|
|
135
143
|
export const cameraCaptureResultSchema = z.discriminatedUnion("type", [
|
|
136
144
|
z
|
|
137
145
|
.object({
|
|
@@ -171,11 +179,8 @@ export const inspectionFrameMessageSchema = z.discriminatedUnion("type", [
|
|
|
171
179
|
})
|
|
172
180
|
.strict(),
|
|
173
181
|
z.object({ type: z.literal(inspectionMessageTypes.exit) }).strict(),
|
|
182
|
+
z.object({ type: z.literal(inspectionMessageTypes.focus) }).strict(),
|
|
174
183
|
]);
|
|
175
|
-
export function acknowledgesInspection(command, message) {
|
|
176
|
-
return (command?.requestId === message.requestId &&
|
|
177
|
-
command.enabled === message.enabled);
|
|
178
|
-
}
|
|
179
184
|
export function projectSyncUrl(baseUrl, project) {
|
|
180
185
|
const url = new URL(`/api/v1/projects/${encodeURIComponent(project)}/sync`, baseUrl);
|
|
181
186
|
if (url.protocol === "https:")
|