@dyrra/protocol 0.1.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/README.md +11 -0
- package/dist/actions.d.ts +196 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +90 -0
- package/dist/actions.js.map +1 -0
- package/dist/api.d.ts +330 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +232 -0
- package/dist/api.js.map +1 -0
- package/dist/common.d.ts +108 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +74 -0
- package/dist/common.js.map +1 -0
- package/dist/endpoints.d.ts +44 -0
- package/dist/endpoints.d.ts.map +1 -0
- package/dist/endpoints.js +33 -0
- package/dist/endpoints.js.map +1 -0
- package/dist/errors.d.ts +73 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +84 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/registry.d.ts +829 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +357 -0
- package/dist/registry.js.map +1 -0
- package/dist/rpc.d.ts +433 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +185 -0
- package/dist/rpc.js.map +1 -0
- package/dist/screen.d.ts +116 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +95 -0
- package/dist/screen.js.map +1 -0
- package/dist/system.d.ts +101 -0
- package/dist/system.d.ts.map +1 -0
- package/dist/system.js +99 -0
- package/dist/system.js.map +1 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @dyrra/protocol
|
|
2
|
+
|
|
3
|
+
Схемы протокола Dyrra на zod: запросы и ответы публичного API, коды ошибок,
|
|
4
|
+
пути к gateway. Отсюда же генерируются OpenAPI и типы Swift для приложения
|
|
5
|
+
на Mac.
|
|
6
|
+
|
|
7
|
+
Обычно напрямую не нужен — его используют `@dyrra/sdk` и `@dyrra/mcp`.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { ErrorCode, ScreenshotRequest } from "@dyrra/protocol";
|
|
11
|
+
```
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Действия ввода. ВСЕ координаты — логические точки главного дисплея (ТЗ 7.6),
|
|
4
|
+
* не пиксели Retina.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MouseButton: z.ZodEnum<{
|
|
7
|
+
left: "left";
|
|
8
|
+
middle: "middle";
|
|
9
|
+
right: "right";
|
|
10
|
+
}>;
|
|
11
|
+
export type MouseButton = z.infer<typeof MouseButton>;
|
|
12
|
+
export declare const Modifier: z.ZodEnum<{
|
|
13
|
+
alt: "alt";
|
|
14
|
+
cmd: "cmd";
|
|
15
|
+
ctrl: "ctrl";
|
|
16
|
+
fn: "fn";
|
|
17
|
+
shift: "shift";
|
|
18
|
+
}>;
|
|
19
|
+
export type Modifier = z.infer<typeof Modifier>;
|
|
20
|
+
export declare const MoveAction: z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"move">;
|
|
22
|
+
x: z.ZodNumber;
|
|
23
|
+
y: z.ZodNumber;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export declare const ClickAction: z.ZodObject<{
|
|
26
|
+
type: z.ZodLiteral<"click">;
|
|
27
|
+
x: z.ZodNumber;
|
|
28
|
+
y: z.ZodNumber;
|
|
29
|
+
button: z.ZodDefault<z.ZodEnum<{
|
|
30
|
+
left: "left";
|
|
31
|
+
middle: "middle";
|
|
32
|
+
right: "right";
|
|
33
|
+
}>>;
|
|
34
|
+
count: z.ZodDefault<z.ZodNumber>;
|
|
35
|
+
modifiers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
36
|
+
alt: "alt";
|
|
37
|
+
cmd: "cmd";
|
|
38
|
+
ctrl: "ctrl";
|
|
39
|
+
fn: "fn";
|
|
40
|
+
shift: "shift";
|
|
41
|
+
}>>>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const MouseDownAction: z.ZodObject<{
|
|
44
|
+
type: z.ZodLiteral<"mouse_down">;
|
|
45
|
+
x: z.ZodNumber;
|
|
46
|
+
y: z.ZodNumber;
|
|
47
|
+
button: z.ZodDefault<z.ZodEnum<{
|
|
48
|
+
left: "left";
|
|
49
|
+
middle: "middle";
|
|
50
|
+
right: "right";
|
|
51
|
+
}>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export declare const MouseUpAction: z.ZodObject<{
|
|
54
|
+
type: z.ZodLiteral<"mouse_up">;
|
|
55
|
+
x: z.ZodNumber;
|
|
56
|
+
y: z.ZodNumber;
|
|
57
|
+
button: z.ZodDefault<z.ZodEnum<{
|
|
58
|
+
left: "left";
|
|
59
|
+
middle: "middle";
|
|
60
|
+
right: "right";
|
|
61
|
+
}>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export declare const DragAction: z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<"drag">;
|
|
65
|
+
from: z.ZodObject<{
|
|
66
|
+
x: z.ZodNumber;
|
|
67
|
+
y: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
to: z.ZodObject<{
|
|
70
|
+
x: z.ZodNumber;
|
|
71
|
+
y: z.ZodNumber;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
button: z.ZodDefault<z.ZodEnum<{
|
|
74
|
+
left: "left";
|
|
75
|
+
middle: "middle";
|
|
76
|
+
right: "right";
|
|
77
|
+
}>>;
|
|
78
|
+
durationMs: z.ZodDefault<z.ZodNumber>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export declare const ScrollAction: z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"scroll">;
|
|
82
|
+
x: z.ZodNumber;
|
|
83
|
+
y: z.ZodNumber;
|
|
84
|
+
dx: z.ZodDefault<z.ZodNumber>;
|
|
85
|
+
dy: z.ZodDefault<z.ZodNumber>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
/** Текст вводится через keyboardSetUnicodeString — поддерживает кириллицу и эмодзи. */
|
|
88
|
+
export declare const TypeAction: z.ZodObject<{
|
|
89
|
+
type: z.ZodLiteral<"type">;
|
|
90
|
+
text: z.ZodString;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export declare const KeyAction: z.ZodObject<{
|
|
93
|
+
type: z.ZodLiteral<"key">;
|
|
94
|
+
keys: z.ZodArray<z.ZodString>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
export declare const WaitAction: z.ZodObject<{
|
|
97
|
+
type: z.ZodLiteral<"wait">;
|
|
98
|
+
ms: z.ZodNumber;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
/** Клик по элементу из снимка ui_tree (ТЗ 7.12) — точнее, чем по пикселям. */
|
|
101
|
+
export declare const ClickElementAction: z.ZodObject<{
|
|
102
|
+
type: z.ZodLiteral<"click_element">;
|
|
103
|
+
snapshotId: z.ZodString;
|
|
104
|
+
elementId: z.ZodString;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
export declare const SetValueAction: z.ZodObject<{
|
|
107
|
+
type: z.ZodLiteral<"set_value">;
|
|
108
|
+
snapshotId: z.ZodString;
|
|
109
|
+
elementId: z.ZodString;
|
|
110
|
+
text: z.ZodString;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
export declare const Action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
113
|
+
type: z.ZodLiteral<"move">;
|
|
114
|
+
x: z.ZodNumber;
|
|
115
|
+
y: z.ZodNumber;
|
|
116
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
+
type: z.ZodLiteral<"click">;
|
|
118
|
+
x: z.ZodNumber;
|
|
119
|
+
y: z.ZodNumber;
|
|
120
|
+
button: z.ZodDefault<z.ZodEnum<{
|
|
121
|
+
left: "left";
|
|
122
|
+
middle: "middle";
|
|
123
|
+
right: "right";
|
|
124
|
+
}>>;
|
|
125
|
+
count: z.ZodDefault<z.ZodNumber>;
|
|
126
|
+
modifiers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
127
|
+
alt: "alt";
|
|
128
|
+
cmd: "cmd";
|
|
129
|
+
ctrl: "ctrl";
|
|
130
|
+
fn: "fn";
|
|
131
|
+
shift: "shift";
|
|
132
|
+
}>>>;
|
|
133
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
134
|
+
type: z.ZodLiteral<"mouse_down">;
|
|
135
|
+
x: z.ZodNumber;
|
|
136
|
+
y: z.ZodNumber;
|
|
137
|
+
button: z.ZodDefault<z.ZodEnum<{
|
|
138
|
+
left: "left";
|
|
139
|
+
middle: "middle";
|
|
140
|
+
right: "right";
|
|
141
|
+
}>>;
|
|
142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
143
|
+
type: z.ZodLiteral<"mouse_up">;
|
|
144
|
+
x: z.ZodNumber;
|
|
145
|
+
y: z.ZodNumber;
|
|
146
|
+
button: z.ZodDefault<z.ZodEnum<{
|
|
147
|
+
left: "left";
|
|
148
|
+
middle: "middle";
|
|
149
|
+
right: "right";
|
|
150
|
+
}>>;
|
|
151
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
+
type: z.ZodLiteral<"drag">;
|
|
153
|
+
from: z.ZodObject<{
|
|
154
|
+
x: z.ZodNumber;
|
|
155
|
+
y: z.ZodNumber;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
to: z.ZodObject<{
|
|
158
|
+
x: z.ZodNumber;
|
|
159
|
+
y: z.ZodNumber;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
button: z.ZodDefault<z.ZodEnum<{
|
|
162
|
+
left: "left";
|
|
163
|
+
middle: "middle";
|
|
164
|
+
right: "right";
|
|
165
|
+
}>>;
|
|
166
|
+
durationMs: z.ZodDefault<z.ZodNumber>;
|
|
167
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
168
|
+
type: z.ZodLiteral<"scroll">;
|
|
169
|
+
x: z.ZodNumber;
|
|
170
|
+
y: z.ZodNumber;
|
|
171
|
+
dx: z.ZodDefault<z.ZodNumber>;
|
|
172
|
+
dy: z.ZodDefault<z.ZodNumber>;
|
|
173
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
174
|
+
type: z.ZodLiteral<"type">;
|
|
175
|
+
text: z.ZodString;
|
|
176
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
177
|
+
type: z.ZodLiteral<"key">;
|
|
178
|
+
keys: z.ZodArray<z.ZodString>;
|
|
179
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
180
|
+
type: z.ZodLiteral<"wait">;
|
|
181
|
+
ms: z.ZodNumber;
|
|
182
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
183
|
+
type: z.ZodLiteral<"click_element">;
|
|
184
|
+
snapshotId: z.ZodString;
|
|
185
|
+
elementId: z.ZodString;
|
|
186
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
+
type: z.ZodLiteral<"set_value">;
|
|
188
|
+
snapshotId: z.ZodString;
|
|
189
|
+
elementId: z.ZodString;
|
|
190
|
+
text: z.ZodString;
|
|
191
|
+
}, z.core.$strip>], "type">;
|
|
192
|
+
export type Action = z.infer<typeof Action>;
|
|
193
|
+
/** Какое право нужно для действия. Проверяется и на gateway, и в приложении (ТЗ 15). */
|
|
194
|
+
export declare function scopeForAction(action: Action): "input";
|
|
195
|
+
export declare const MAX_ACTIONS_PER_BATCH = 50;
|
|
196
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AAEH,eAAO,MAAM,WAAW;;;;EAAkE,CAAC;AAC3F,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,QAAQ;;;;;;EAAyE,CAAC;AAC/F,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAIhD,eAAO,MAAM,UAAU;;;;iBAAsE,CAAC;AAE9F,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;iBAOtB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;iBAK1B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;iBAKxB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;iBAMrB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;iBAMvB,CAAC;AAEH,uFAAuF;AACvF,eAAO,MAAM,UAAU;;;iBAGrB,CAAC;AAEH,eAAO,MAAM,SAAS;;;iBAGpB,CAAC;AAEH,eAAO,MAAM,UAAU;;;iBAGrB,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;iBAKzB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAcM,CAAC;AAC1B,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAE5C,wFAAwF;AACxF,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED,eAAO,MAAM,qBAAqB,KAAK,CAAC"}
|
package/dist/actions.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Действия ввода. ВСЕ координаты — логические точки главного дисплея (ТЗ 7.6),
|
|
4
|
+
* не пиксели Retina.
|
|
5
|
+
*/
|
|
6
|
+
export const MouseButton = z.enum(["left", "right", "middle"]).meta({ id: "MouseButton" });
|
|
7
|
+
export const Modifier = z.enum(["cmd", "shift", "alt", "ctrl", "fn"]).meta({ id: "Modifier" });
|
|
8
|
+
const Point = z.object({ x: z.number(), y: z.number() });
|
|
9
|
+
export const MoveAction = z.object({ type: z.literal("move"), x: z.number(), y: z.number() });
|
|
10
|
+
export const ClickAction = z.object({
|
|
11
|
+
type: z.literal("click"),
|
|
12
|
+
x: z.number(),
|
|
13
|
+
y: z.number(),
|
|
14
|
+
button: MouseButton.default("left"),
|
|
15
|
+
count: z.number().int().min(1).max(3).default(1),
|
|
16
|
+
modifiers: z.array(Modifier).default([]),
|
|
17
|
+
});
|
|
18
|
+
export const MouseDownAction = z.object({
|
|
19
|
+
type: z.literal("mouse_down"),
|
|
20
|
+
x: z.number(),
|
|
21
|
+
y: z.number(),
|
|
22
|
+
button: MouseButton.default("left"),
|
|
23
|
+
});
|
|
24
|
+
export const MouseUpAction = z.object({
|
|
25
|
+
type: z.literal("mouse_up"),
|
|
26
|
+
x: z.number(),
|
|
27
|
+
y: z.number(),
|
|
28
|
+
button: MouseButton.default("left"),
|
|
29
|
+
});
|
|
30
|
+
export const DragAction = z.object({
|
|
31
|
+
type: z.literal("drag"),
|
|
32
|
+
from: Point,
|
|
33
|
+
to: Point,
|
|
34
|
+
button: MouseButton.default("left"),
|
|
35
|
+
durationMs: z.number().int().min(0).max(10_000).default(300),
|
|
36
|
+
});
|
|
37
|
+
export const ScrollAction = z.object({
|
|
38
|
+
type: z.literal("scroll"),
|
|
39
|
+
x: z.number(),
|
|
40
|
+
y: z.number(),
|
|
41
|
+
dx: z.number().default(0),
|
|
42
|
+
dy: z.number().default(0),
|
|
43
|
+
});
|
|
44
|
+
/** Текст вводится через keyboardSetUnicodeString — поддерживает кириллицу и эмодзи. */
|
|
45
|
+
export const TypeAction = z.object({
|
|
46
|
+
type: z.literal("type"),
|
|
47
|
+
text: z.string().max(10_000),
|
|
48
|
+
});
|
|
49
|
+
export const KeyAction = z.object({
|
|
50
|
+
type: z.literal("key"),
|
|
51
|
+
keys: z.array(z.string()).min(1).max(8),
|
|
52
|
+
});
|
|
53
|
+
export const WaitAction = z.object({
|
|
54
|
+
type: z.literal("wait"),
|
|
55
|
+
ms: z.number().int().min(0).max(5000),
|
|
56
|
+
});
|
|
57
|
+
/** Клик по элементу из снимка ui_tree (ТЗ 7.12) — точнее, чем по пикселям. */
|
|
58
|
+
export const ClickElementAction = z.object({
|
|
59
|
+
type: z.literal("click_element"),
|
|
60
|
+
snapshotId: z.string(),
|
|
61
|
+
elementId: z.string(),
|
|
62
|
+
});
|
|
63
|
+
export const SetValueAction = z.object({
|
|
64
|
+
type: z.literal("set_value"),
|
|
65
|
+
snapshotId: z.string(),
|
|
66
|
+
elementId: z.string(),
|
|
67
|
+
text: z.string().max(10_000),
|
|
68
|
+
});
|
|
69
|
+
export const Action = z
|
|
70
|
+
.discriminatedUnion("type", [
|
|
71
|
+
MoveAction,
|
|
72
|
+
ClickAction,
|
|
73
|
+
MouseDownAction,
|
|
74
|
+
MouseUpAction,
|
|
75
|
+
DragAction,
|
|
76
|
+
ScrollAction,
|
|
77
|
+
TypeAction,
|
|
78
|
+
KeyAction,
|
|
79
|
+
WaitAction,
|
|
80
|
+
ClickElementAction,
|
|
81
|
+
SetValueAction,
|
|
82
|
+
])
|
|
83
|
+
.meta({ id: "Action" });
|
|
84
|
+
/** Какое право нужно для действия. Проверяется и на gateway, и в приложении (ТЗ 15). */
|
|
85
|
+
export function scopeForAction(action) {
|
|
86
|
+
void action;
|
|
87
|
+
return "input";
|
|
88
|
+
}
|
|
89
|
+
export const MAX_ACTIONS_PER_BATCH = 50;
|
|
90
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAA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tB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC;KACpB,kBAAkB,CAAC,MAAM,EAAE;IAC1B,UAAU;IACV,WAAW;IACX,eAAe;IACf,aAAa;IACb,UAAU;IACV,YAAY;IACZ,UAAU;IACV,SAAS;IACT,UAAU;IACV,kBAAkB;IAClB,cAAc;CACf,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;AAG1B,wFAAwF;AACxF,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,KAAK,MAAM,CAAC;IACZ,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC"}
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CreateEndUserRequest: z.ZodObject<{
|
|
3
|
+
externalId: z.ZodString;
|
|
4
|
+
email: z.ZodOptional<z.ZodString>;
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type CreateEndUserRequest = z.infer<typeof CreateEndUserRequest>;
|
|
8
|
+
export declare const EndUser: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
externalId: z.ZodString;
|
|
11
|
+
email: z.ZodNullable<z.ZodString>;
|
|
12
|
+
name: z.ZodNullable<z.ZodString>;
|
|
13
|
+
createdAt: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type EndUser = z.infer<typeof EndUser>;
|
|
16
|
+
export declare const CreateLinkSessionRequest: z.ZodObject<{
|
|
17
|
+
endUserId: z.ZodString;
|
|
18
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
19
|
+
clipboard: "clipboard";
|
|
20
|
+
files: "files";
|
|
21
|
+
input: "input";
|
|
22
|
+
record: "record";
|
|
23
|
+
screen: "screen";
|
|
24
|
+
shell: "shell";
|
|
25
|
+
}>>;
|
|
26
|
+
redirectUrl: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type CreateLinkSessionRequest = z.infer<typeof CreateLinkSessionRequest>;
|
|
29
|
+
export declare const LinkSession: z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
url: z.ZodString;
|
|
32
|
+
code: z.ZodString;
|
|
33
|
+
expiresAt: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type LinkSession = z.infer<typeof LinkSession>;
|
|
36
|
+
export declare const LINK_SESSION_TTL_SEC: number;
|
|
37
|
+
export declare const Connection: z.ZodObject<{
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
endUserId: z.ZodString;
|
|
40
|
+
machineId: z.ZodString;
|
|
41
|
+
kind: z.ZodEnum<{
|
|
42
|
+
cloud: "cloud";
|
|
43
|
+
connected: "connected";
|
|
44
|
+
vm: "vm";
|
|
45
|
+
}>;
|
|
46
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
47
|
+
clipboard: "clipboard";
|
|
48
|
+
files: "files";
|
|
49
|
+
input: "input";
|
|
50
|
+
record: "record";
|
|
51
|
+
screen: "screen";
|
|
52
|
+
shell: "shell";
|
|
53
|
+
}>>;
|
|
54
|
+
status: z.ZodEnum<{
|
|
55
|
+
active: "active";
|
|
56
|
+
revoked: "revoked";
|
|
57
|
+
}>;
|
|
58
|
+
machine: z.ZodObject<{
|
|
59
|
+
online: z.ZodBoolean;
|
|
60
|
+
availability: z.ZodEnum<{
|
|
61
|
+
asleep: "asleep";
|
|
62
|
+
no_gui_session: "no_gui_session";
|
|
63
|
+
ready: "ready";
|
|
64
|
+
screen_locked: "screen_locked";
|
|
65
|
+
unknown: "unknown";
|
|
66
|
+
}>;
|
|
67
|
+
lastSeenAt: z.ZodNullable<z.ZodString>;
|
|
68
|
+
paused: z.ZodBoolean;
|
|
69
|
+
permissions: z.ZodObject<{
|
|
70
|
+
screenRecording: z.ZodBoolean;
|
|
71
|
+
accessibility: z.ZodBoolean;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
display: z.ZodNullable<z.ZodObject<{
|
|
74
|
+
widthPoints: z.ZodNumber;
|
|
75
|
+
heightPoints: z.ZodNumber;
|
|
76
|
+
scaleFactor: z.ZodNumber;
|
|
77
|
+
displayId: z.ZodNumber;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
appVersion: z.ZodNullable<z.ZodString>;
|
|
80
|
+
macosVersion: z.ZodNullable<z.ZodString>;
|
|
81
|
+
hiddenAppCount: z.ZodDefault<z.ZodNumber>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
createdAt: z.ZodString;
|
|
84
|
+
revokedAt: z.ZodNullable<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type Connection = z.infer<typeof Connection>;
|
|
87
|
+
export declare const CloudTerm: z.ZodEnum<{
|
|
88
|
+
day: "day";
|
|
89
|
+
month: "month";
|
|
90
|
+
week: "week";
|
|
91
|
+
}>;
|
|
92
|
+
export type CloudTerm = z.infer<typeof CloudTerm>;
|
|
93
|
+
/**
|
|
94
|
+
* Конфигурация железа облачного Mac.
|
|
95
|
+
*
|
|
96
|
+
* Сдаётся ли конфигурация — решает не этот список, а цена в конфиге
|
|
97
|
+
* сервера: нет цены, значит только по запросу (ТЗ 4.2). Так новую позицию
|
|
98
|
+
* можно открыть или закрыть, не трогая код.
|
|
99
|
+
*/
|
|
100
|
+
export declare const CloudHardware: z.ZodEnum<{
|
|
101
|
+
mac_mini_m4: "mac_mini_m4";
|
|
102
|
+
mac_mini_m4_pro: "mac_mini_m4_pro";
|
|
103
|
+
mac_pro: "mac_pro";
|
|
104
|
+
mac_studio_m1_max: "mac_studio_m1_max";
|
|
105
|
+
mac_studio_m1_ultra: "mac_studio_m1_ultra";
|
|
106
|
+
mac_studio_m2_max: "mac_studio_m2_max";
|
|
107
|
+
mac_studio_m2_ultra: "mac_studio_m2_ultra";
|
|
108
|
+
mac_studio_m3_ultra: "mac_studio_m3_ultra";
|
|
109
|
+
mac_studio_m4_max: "mac_studio_m4_max";
|
|
110
|
+
mac_studio_m4_ultra: "mac_studio_m4_ultra";
|
|
111
|
+
mac_studio_m5_max: "mac_studio_m5_max";
|
|
112
|
+
mac_studio_m5_ultra: "mac_studio_m5_ultra";
|
|
113
|
+
}>;
|
|
114
|
+
export type CloudHardware = z.infer<typeof CloudHardware>;
|
|
115
|
+
/**
|
|
116
|
+
* Железо, которое мы держим в пуле готовым к выдаче.
|
|
117
|
+
* Всё остальное закупается или арендуется у провайдера под клиента,
|
|
118
|
+
* поэтому такая аренда ждёт администратора.
|
|
119
|
+
*/
|
|
120
|
+
export declare const POOLED_HARDWARE: CloudHardware[];
|
|
121
|
+
export declare function isPooledHardware(hardware: CloudHardware): boolean;
|
|
122
|
+
/** Названия для писем и интерфейса: коды в глаза человеку показывать не нужно. */
|
|
123
|
+
export declare const CLOUD_HARDWARE_NAMES: Record<CloudHardware, string>;
|
|
124
|
+
export declare const CLOUD_TERM_NAMES: Record<CloudTerm, string>;
|
|
125
|
+
export declare const CreateCloudMacRequest: z.ZodObject<{
|
|
126
|
+
term: z.ZodEnum<{
|
|
127
|
+
day: "day";
|
|
128
|
+
month: "month";
|
|
129
|
+
week: "week";
|
|
130
|
+
}>;
|
|
131
|
+
hardware: z.ZodDefault<z.ZodEnum<{
|
|
132
|
+
mac_mini_m4: "mac_mini_m4";
|
|
133
|
+
mac_mini_m4_pro: "mac_mini_m4_pro";
|
|
134
|
+
mac_pro: "mac_pro";
|
|
135
|
+
mac_studio_m1_max: "mac_studio_m1_max";
|
|
136
|
+
mac_studio_m1_ultra: "mac_studio_m1_ultra";
|
|
137
|
+
mac_studio_m2_max: "mac_studio_m2_max";
|
|
138
|
+
mac_studio_m2_ultra: "mac_studio_m2_ultra";
|
|
139
|
+
mac_studio_m3_ultra: "mac_studio_m3_ultra";
|
|
140
|
+
mac_studio_m4_max: "mac_studio_m4_max";
|
|
141
|
+
mac_studio_m4_ultra: "mac_studio_m4_ultra";
|
|
142
|
+
mac_studio_m5_max: "mac_studio_m5_max";
|
|
143
|
+
mac_studio_m5_ultra: "mac_studio_m5_ultra";
|
|
144
|
+
}>>;
|
|
145
|
+
developerUseAcknowledged: z.ZodLiteral<true>;
|
|
146
|
+
preinstall: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
147
|
+
"claude-code": "claude-code";
|
|
148
|
+
node: "node";
|
|
149
|
+
"xcode-cli": "xcode-cli";
|
|
150
|
+
}>>>;
|
|
151
|
+
xcodeVersion: z.ZodOptional<z.ZodString>;
|
|
152
|
+
contactEmail: z.ZodOptional<z.ZodEmail>;
|
|
153
|
+
note: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export type CreateCloudMacRequest = z.infer<typeof CreateCloudMacRequest>;
|
|
156
|
+
export declare const CloudMac: z.ZodObject<{
|
|
157
|
+
id: z.ZodString;
|
|
158
|
+
status: z.ZodEnum<{
|
|
159
|
+
awaiting_payment: "awaiting_payment";
|
|
160
|
+
ended: "ended";
|
|
161
|
+
provisioning: "provisioning";
|
|
162
|
+
queued: "queued";
|
|
163
|
+
ready: "ready";
|
|
164
|
+
}>;
|
|
165
|
+
term: z.ZodEnum<{
|
|
166
|
+
day: "day";
|
|
167
|
+
month: "month";
|
|
168
|
+
week: "week";
|
|
169
|
+
}>;
|
|
170
|
+
hardware: z.ZodEnum<{
|
|
171
|
+
mac_mini_m4: "mac_mini_m4";
|
|
172
|
+
mac_mini_m4_pro: "mac_mini_m4_pro";
|
|
173
|
+
mac_pro: "mac_pro";
|
|
174
|
+
mac_studio_m1_max: "mac_studio_m1_max";
|
|
175
|
+
mac_studio_m1_ultra: "mac_studio_m1_ultra";
|
|
176
|
+
mac_studio_m2_max: "mac_studio_m2_max";
|
|
177
|
+
mac_studio_m2_ultra: "mac_studio_m2_ultra";
|
|
178
|
+
mac_studio_m3_ultra: "mac_studio_m3_ultra";
|
|
179
|
+
mac_studio_m4_max: "mac_studio_m4_max";
|
|
180
|
+
mac_studio_m4_ultra: "mac_studio_m4_ultra";
|
|
181
|
+
mac_studio_m5_max: "mac_studio_m5_max";
|
|
182
|
+
mac_studio_m5_ultra: "mac_studio_m5_ultra";
|
|
183
|
+
}>;
|
|
184
|
+
leaseStartedAt: z.ZodNullable<z.ZodString>;
|
|
185
|
+
leaseEndsAt: z.ZodNullable<z.ZodString>;
|
|
186
|
+
price: z.ZodObject<{
|
|
187
|
+
amount: z.ZodNumber;
|
|
188
|
+
currency: z.ZodString;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
checkoutUrl: z.ZodNullable<z.ZodString>;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
export type CloudMac = z.infer<typeof CloudMac>;
|
|
193
|
+
/**
|
|
194
|
+
* Заявка на конфигурацию по запросу.
|
|
195
|
+
*
|
|
196
|
+
* Возвращается с кодом 202: аренда НЕ создана и деньги не списываются.
|
|
197
|
+
* Заявка сохраняется у нас и уходит письмом администратору.
|
|
198
|
+
*/
|
|
199
|
+
export declare const CloudMacQuote: z.ZodObject<{
|
|
200
|
+
id: z.ZodString;
|
|
201
|
+
status: z.ZodLiteral<"quote_requested">;
|
|
202
|
+
hardware: z.ZodEnum<{
|
|
203
|
+
mac_mini_m4: "mac_mini_m4";
|
|
204
|
+
mac_mini_m4_pro: "mac_mini_m4_pro";
|
|
205
|
+
mac_pro: "mac_pro";
|
|
206
|
+
mac_studio_m1_max: "mac_studio_m1_max";
|
|
207
|
+
mac_studio_m1_ultra: "mac_studio_m1_ultra";
|
|
208
|
+
mac_studio_m2_max: "mac_studio_m2_max";
|
|
209
|
+
mac_studio_m2_ultra: "mac_studio_m2_ultra";
|
|
210
|
+
mac_studio_m3_ultra: "mac_studio_m3_ultra";
|
|
211
|
+
mac_studio_m4_max: "mac_studio_m4_max";
|
|
212
|
+
mac_studio_m4_ultra: "mac_studio_m4_ultra";
|
|
213
|
+
mac_studio_m5_max: "mac_studio_m5_max";
|
|
214
|
+
mac_studio_m5_ultra: "mac_studio_m5_ultra";
|
|
215
|
+
}>;
|
|
216
|
+
term: z.ZodEnum<{
|
|
217
|
+
day: "day";
|
|
218
|
+
month: "month";
|
|
219
|
+
week: "week";
|
|
220
|
+
}>;
|
|
221
|
+
contactEmail: z.ZodNullable<z.ZodString>;
|
|
222
|
+
note: z.ZodNullable<z.ZodString>;
|
|
223
|
+
message: z.ZodString;
|
|
224
|
+
createdAt: z.ZodString;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
export type CloudMacQuote = z.infer<typeof CloudMacQuote>;
|
|
227
|
+
/**
|
|
228
|
+
* Тарификация пакетами, а не по факту: по внешней ссылке на оплату
|
|
229
|
+
* нельзя списать переменную сумму.
|
|
230
|
+
*/
|
|
231
|
+
export declare const BillingPackage: z.ZodEnum<{
|
|
232
|
+
free: "free";
|
|
233
|
+
p1000: "p1000";
|
|
234
|
+
p200: "p200";
|
|
235
|
+
p50: "p50";
|
|
236
|
+
}>;
|
|
237
|
+
export type BillingPackage = z.infer<typeof BillingPackage>;
|
|
238
|
+
/** Сколько активных подключённых Mac в месяц разрешает каждый пакет. */
|
|
239
|
+
export declare const PACKAGE_MACHINE_LIMIT: Record<BillingPackage, number>;
|
|
240
|
+
export declare const Subscription: z.ZodObject<{
|
|
241
|
+
package: z.ZodEnum<{
|
|
242
|
+
free: "free";
|
|
243
|
+
p1000: "p1000";
|
|
244
|
+
p200: "p200";
|
|
245
|
+
p50: "p50";
|
|
246
|
+
}>;
|
|
247
|
+
status: z.ZodEnum<{
|
|
248
|
+
active: "active";
|
|
249
|
+
canceled: "canceled";
|
|
250
|
+
past_due: "past_due";
|
|
251
|
+
}>;
|
|
252
|
+
machineLimit: z.ZodNumber;
|
|
253
|
+
activeMachines: z.ZodNumber;
|
|
254
|
+
currentPeriodEnd: z.ZodNullable<z.ZodString>;
|
|
255
|
+
cancelAtPeriodEnd: z.ZodBoolean;
|
|
256
|
+
upgradeUrls: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
257
|
+
}, z.core.$strip>;
|
|
258
|
+
export type Subscription = z.infer<typeof Subscription>;
|
|
259
|
+
export declare const Job: z.ZodObject<{
|
|
260
|
+
id: z.ZodString;
|
|
261
|
+
status: z.ZodEnum<{
|
|
262
|
+
failed: "failed";
|
|
263
|
+
running: "running";
|
|
264
|
+
succeeded: "succeeded";
|
|
265
|
+
}>;
|
|
266
|
+
logTail: z.ZodString;
|
|
267
|
+
artifacts: z.ZodArray<z.ZodObject<{
|
|
268
|
+
type: z.ZodString;
|
|
269
|
+
path: z.ZodString;
|
|
270
|
+
}, z.core.$strip>>;
|
|
271
|
+
durationSec: z.ZodNumber;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
export type Job = z.infer<typeof Job>;
|
|
274
|
+
export declare const Recording: z.ZodObject<{
|
|
275
|
+
id: z.ZodString;
|
|
276
|
+
status: z.ZodEnum<{
|
|
277
|
+
deleted: "deleted";
|
|
278
|
+
processing: "processing";
|
|
279
|
+
ready: "ready";
|
|
280
|
+
}>;
|
|
281
|
+
url: z.ZodOptional<z.ZodString>;
|
|
282
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
283
|
+
durationSec: z.ZodNumber;
|
|
284
|
+
createdAt: z.ZodString;
|
|
285
|
+
}, z.core.$strip>;
|
|
286
|
+
export type Recording = z.infer<typeof Recording>;
|
|
287
|
+
export declare const WebhookEventType: z.ZodEnum<{
|
|
288
|
+
"billing.payment_failed": "billing.payment_failed";
|
|
289
|
+
"cloud_mac.ended": "cloud_mac.ended";
|
|
290
|
+
"cloud_mac.expiring": "cloud_mac.expiring";
|
|
291
|
+
"cloud_mac.ready": "cloud_mac.ready";
|
|
292
|
+
"command.completed": "command.completed";
|
|
293
|
+
"command.expired": "command.expired";
|
|
294
|
+
"command.failed": "command.failed";
|
|
295
|
+
"connection.created": "connection.created";
|
|
296
|
+
"connection.revoked": "connection.revoked";
|
|
297
|
+
"machine.offline": "machine.offline";
|
|
298
|
+
"machine.online": "machine.online";
|
|
299
|
+
"machine.paused": "machine.paused";
|
|
300
|
+
"machine.permissions_changed": "machine.permissions_changed";
|
|
301
|
+
"machine.resumed": "machine.resumed";
|
|
302
|
+
"recording.ready": "recording.ready";
|
|
303
|
+
}>;
|
|
304
|
+
export type WebhookEventType = z.infer<typeof WebhookEventType>;
|
|
305
|
+
export declare const WebhookEvent: z.ZodObject<{
|
|
306
|
+
id: z.ZodString;
|
|
307
|
+
type: z.ZodEnum<{
|
|
308
|
+
"billing.payment_failed": "billing.payment_failed";
|
|
309
|
+
"cloud_mac.ended": "cloud_mac.ended";
|
|
310
|
+
"cloud_mac.expiring": "cloud_mac.expiring";
|
|
311
|
+
"cloud_mac.ready": "cloud_mac.ready";
|
|
312
|
+
"command.completed": "command.completed";
|
|
313
|
+
"command.expired": "command.expired";
|
|
314
|
+
"command.failed": "command.failed";
|
|
315
|
+
"connection.created": "connection.created";
|
|
316
|
+
"connection.revoked": "connection.revoked";
|
|
317
|
+
"machine.offline": "machine.offline";
|
|
318
|
+
"machine.online": "machine.online";
|
|
319
|
+
"machine.paused": "machine.paused";
|
|
320
|
+
"machine.permissions_changed": "machine.permissions_changed";
|
|
321
|
+
"machine.resumed": "machine.resumed";
|
|
322
|
+
"recording.ready": "recording.ready";
|
|
323
|
+
}>;
|
|
324
|
+
createdAt: z.ZodString;
|
|
325
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
export type WebhookEvent = z.infer<typeof WebhookEvent>;
|
|
328
|
+
export declare const WEBHOOK_SIGNATURE_HEADER = "dyrra-signature";
|
|
329
|
+
export declare const WEBHOOK_TOLERANCE_SEC = 300;
|
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